Skip to content

Conversation

@sbueringer
Copy link
Member

@sbueringer sbueringer commented May 15, 2025

Signed-off-by: Stefan Büringer [email protected]

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Follow-up to #11671 (comment)
Part of #10852

@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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 15, 2025
@sbueringer sbueringer added the area/clusterclass Issues or PRs related to clusterclass label May 15, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label May 15, 2025
@sbueringer sbueringer force-pushed the pr-move-infra-naming-strategy branch from 8f17b1f to bc159d7 Compare May 15, 2025 07:16
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer sbueringer force-pushed the pr-move-infra-naming-strategy branch from bc159d7 to b666b41 Compare May 15, 2025 07:24
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer sbueringer changed the title ⚠️ [WIP] Move infrastructure namingStrategy field in ClusterClass ⚠️ Move infrastructure namingStrategy field in ClusterClass May 15, 2025
@sbueringer sbueringer force-pushed the pr-move-infra-naming-strategy branch from b666b41 to afce0bd Compare May 15, 2025 12:44
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member Author

kind: DockerClusterTemplate
name: quick-start-cluster
infrastructureNamingStrategy:
namingStrategy:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API version is v1beta1, so should we keep it ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! Thx! Reverted this diff

@sbueringer sbueringer force-pushed the pr-move-infra-naming-strategy branch from afce0bd to a7fb549 Compare May 15, 2025 13:36
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

// infrastructureNamingStrategy allows changing the naming pattern used when creating the infrastructure object.
// +optional
InfrastructureNamingStrategy *InfrastructureNamingStrategy `json:"infrastructureNamingStrategy,omitempty"`
Infrastructure InfrastructureClass `json:"infrastructure,omitempty"`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this should be a pointer, but I chose to be consistent with the controlPlane field below for now.

Added a sub-task to the v1beta2 umbrella issue to follow-up

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure that we correct this before we ship.

InfrastructureClass is a struct, and cannot be omitempty'd correctly.

LocalObjectTemplate is inlined and has a required field within.

The required field should not accept "", which means a structured client marshalling this right now creates an invalid object and cannot treat Infrastructure as truly optional

Copy link
Member Author

@sbueringer sbueringer May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I just don't want to create a different set of problems between this field and the ControlPlane field

Because even if we make the Infrastructure + ControlPlane fields a pointer it's still not perfect as the required Ref field in there is a pointer, so we have to change more to fix this all up

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's fine, is the umbrella issue tracking what's required and what's optional to be completed before the next release?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we only flagged must have (P0) and nice to have (P1) for the alpha (in 2-3 weeks)

Copy link
Member Author

@sbueringer sbueringer May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My personal goal would be to fix all these marshalling problems if somehow possible once the KAL linter is available.

Independent of that. I don't know if this should be a showstopper for the release, given we have the exact same situation for the existing ControPlane field

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The optionalfields work for KAL I think is pretty close. Might be able to get that here next week, and at least it will highlight where we have marshalling issues. Fixes will still be partially manual/need to be discussed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it helps for the current PR. I think the PR doesn't make it worse as we had the same problem on this field before? (probably? :))

@fabriziopandini
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 15, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 0b8d0aea0d269c2294f46226a302e6aeedfd7bbe

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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

The pull request process is described here

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 15, 2025
@sivchari
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot merged commit ed49ea2 into kubernetes-sigs:main May 15, 2025
19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.11 milestone May 15, 2025
@sbueringer sbueringer deleted the pr-move-infra-naming-strategy branch May 15, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/clusterclass Issues or PRs related to clusterclass cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

6 participants