Skip to content

Conversation

@sathieu
Copy link
Contributor

@sathieu sathieu commented Dec 23, 2025

What this PR does / why we need it:

We use metal3 provider and the image depends on various factors:

  • what is the distro (debian/ubuntu/...)
  • is the image using 4k or 512-bytes block size ?
  • which k8s version
  • ...

Instead of hardcoding the image template in the clusterclass, we need to construct it from various other variables.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label labels Dec 23, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign vincepri for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 23, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @sathieu. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot requested a review from elmiko December 23, 2025 14:13
@sathieu
Copy link
Contributor Author

sathieu commented Dec 23, 2025

/area clusterclass

@k8s-ci-robot k8s-ci-robot added area/clusterclass Issues or PRs related to clusterclass and removed do-not-merge/needs-area PR is missing an area label labels Dec 23, 2025
@fabriziopandini
Copy link
Member

Allows to evaluate strings as templates inside a template

We implemented https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20220330-topology-mutation-hook.md which provides a better alternative for when you are hitting limitations of json patches.

Notably, the benefits that you will get from moving patches to an external component are way more that addressing this specific use case.

@sathieu
Copy link
Contributor Author

sathieu commented Dec 30, 2025

There is currently only one provider available (https://cluster-api.sigs.k8s.io/reference/providers#runtime-extensions), nutanix, which works like a black box. The effective changes made by the provider are not detailed (unless you read the code). I find this confusing.

I agree that JSON patches are limited, but this feature (more dynamic patches) should be in core IMO. Maybe another method is needed?

Kubernetes is including CEL mutations (currently beta, off-by-default), could this be a part forward in core ?

Also, giving access to intermediary resources would be great (to understand what is changed by each step). This is another topic.

@sbueringer
Copy link
Member

sbueringer commented Dec 30, 2025

I think we should not try to build an extensive templating engine within the core CAPI controller.

If there is demand I would recommend building that out-of-tree, while also not trying to reinvent the wheel considering numerous pre-existing projects and languages for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/clusterclass Issues or PRs related to clusterclass cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants