Skip to content

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Aug 12, 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):
Part of #12325

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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 Aug 12, 2025
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Aug 12, 2025
@sbueringer sbueringer force-pushed the pr-bump-cr-v0.22 branch 2 times, most recently from 96348cb to d69e8a1 Compare August 12, 2025 14:05
@@ -41,7 +41,7 @@ type etcd interface {
AlarmList(ctx context.Context) (*clientv3.AlarmResponse, error)
Close() error
Endpoints() []string
MemberList(ctx context.Context) (*clientv3.MemberListResponse, error)
MemberList(ctx context.Context, opts ...clientv3.OpOption) (*clientv3.MemberListResponse, error)
Copy link
Member Author

@sbueringer sbueringer Aug 12, 2025

Choose a reason for hiding this comment

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

@fabriziopandini We should check if we want to specify one of the options
/hold

Copy link
Member Author

@sbueringer sbueringer Aug 28, 2025

Choose a reason for hiding this comment

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

Took a look at the diff in the client, nothing actually changed.

The MemberList func now handles the serializable option, but the default behavior stays the same

So no follow-up for us

image

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 12, 2025
@sbueringer sbueringer force-pushed the pr-bump-cr-v0.22 branch 3 times, most recently from ffb77a6 to 5b9559d Compare August 13, 2025 15:58
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 13, 2025
@@ -116,10 +116,12 @@ type DockerClusterV1Beta2Status struct {
// APIEndpoint represents a reachable Kubernetes API endpoint.
type APIEndpoint struct {
// Host is the hostname on which the API server is serving.
// +optional
Copy link
Member Author

@sbueringer sbueringer Aug 14, 2025

Choose a reason for hiding this comment

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

This is a fun one.

Context:

  • topology controller filters out host if host is set to empty string
  • so it will sent a v1beta1 DockerCluster without host being set

Why did this work before

  • v1.10 (v1beta1): defaulting webhook was adding host: ""
  • v1.11 (v1beta1+v1beta2): defaulting webhook was adding metadata.creationTimestamp: nil => then conversion v1beta2 => v1beta1 was invoked before OpenAPI validation and conversion added host: ""
  • v1.12 (v1beta1+v1beta2): defaulting webhook does nothing => no additional conversion, so original v1beta1 DockerCluster hits OpenAPI validation => spec.controlPlaneEndpoint.host: Required value

Potential solutions:

  • Stop filtering out empty string in topology controller
    • => We can't do that because otherwise the topology controller would overwrite host values written by the InfraCluster provider
  • Changing v1beta1 OpenAPI validation to make host/port optional
    • => should work. When getting v1beta1 DockerCluster it will still return host: "" in any case
  • Trying to keep defaulting webhook constant by always patching creationTimestamp, but this doesn't fix issues we might already have with v1.11 where we dropped defaulting webhooks entirely

Wider impact:

  • We should think about if we have similar cases elsewhere. I.e. cases where in the past conversion was fixing up objects and they passed OpenAPI validation only because of that. We should consider also making these fields optional in v1beta1 OpenAPI validation in CAPI v1.12

Copy link
Member Author

@sbueringer sbueringer Aug 21, 2025

Choose a reason for hiding this comment

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

Discussed. We'll:

  • make host + port optional in v1beta1 DockerCluster
  • make host + port optional in v1beta1 APIEndpoint (core CAPI)
  • Add an explanation to v1.11-to-v1.12.md

@sbueringer sbueringer added the area/dependency Issues or PRs related to dependency changes label Aug 14, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label Aug 14, 2025
@sbueringer sbueringer force-pushed the pr-bump-cr-v0.22 branch 3 times, most recently from df9aaf7 to 99c51dd Compare August 18, 2025 11:24
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 19, 2025
@sbueringer sbueringer force-pushed the pr-bump-cr-v0.22 branch 2 times, most recently from 1c46b8c to d702cc4 Compare August 27, 2025 11:30
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 27, 2025
@sbueringer sbueringer changed the title [WIP] ⚠️ Bump to controller-runtime v0.22 [WIP] ⚠️ Bump to controller-runtime v0.22 & controller-tools v0.19 Aug 27, 2025
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-blocking-main
/test pull-cluster-api-e2e-conformance-ci-latest-main
/test pull-cluster-api-e2e-conformance-main
/test pull-cluster-api-e2e-latestk8s-main
/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-mink8s-main
/test pull-cluster-api-e2e-upgrade-1-34-1-35-main
/test pull-cluster-api-test-main
/test pull-cluster-api-test-mink8s-main

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 29, 2025
@sbueringer
Copy link
Member Author

/assign @sivchari
(if you want to take a look)

@sbueringer
Copy link
Member Author

/assign @chrischdi

@chrischdi
Copy link
Member

/lgtm

Thanks for working on this!

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

LGTM label has been added.

Git tree hash: 1bcf50a235b5eb46c23f8db5f6cf00cacd7e04c8

@@ -1555,6 +1556,7 @@ func (f *FakeClusterClass) Objs() []client.Object {
}

clusterClass := clusterClassBuilder.Build()
clusterClass.SetGroupVersionKind(clusterv1.GroupVersion.WithKind("ClusterClass"))
Copy link
Member

Choose a reason for hiding this comment

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

What about if we unset the gvk right after we use it for computing the UID a few lines below?

This could prevent this to hide wrong assumption in the codebase due to the fact that we are setting GVK in a typed object

@@ -101,12 +100,12 @@ func InFailureDomains(failureDomains ...string) Func {

// OwnedMachines returns a filter to find all machines owned by specified owner.
// Usage: GetFilteredMachinesForCluster(ctx, client, cluster, OwnedMachines(controlPlane)).
func OwnedMachines(owner client.Object) func(machine *clusterv1.Machine) bool {
func OwnedMachines(owner *controlplanev1.KubeadmControlPlane) func(machine *clusterv1.Machine) bool {
Copy link
Member

Choose a reason for hiding this comment

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

godoc seems out of date
(might be we should also rename the func / move it to KCP)

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'll change the func so it still works for other CP providers that have Machines

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 3, 2025
@sbueringer
Copy link
Member Author

@fabriziopandini Thx, should be all fixed, PTAL

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-blocking-main
/test pull-cluster-api-e2e-conformance-ci-latest-main
/test pull-cluster-api-e2e-conformance-main
/test pull-cluster-api-e2e-latestk8s-main
/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-mink8s-main
/test pull-cluster-api-e2e-upgrade-1-34-1-35-main
/test pull-cluster-api-test-main
/test pull-cluster-api-test-mink8s-main

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Sep 3, 2025

@sbueringer: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-apidiff-main 3bc72c8 link false /test pull-cluster-api-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@fabriziopandini
Copy link
Member

lgtm pending a check on test failures

@fabriziopandini
Copy link
Member

It is a flake, re running tests
/approve
/lgtm

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

LGTM label has been added.

Git tree hash: c54e41d4facb8007629cc90233b54df4db891571

@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 Sep 3, 2025
@k8s-ci-robot k8s-ci-robot merged commit 1d9f42a into kubernetes-sigs:main Sep 3, 2025
25 of 26 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.12 milestone Sep 3, 2025
@sbueringer sbueringer deleted the pr-bump-cr-v0.22 branch September 3, 2025 14:18
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/dependency Issues or PRs related to dependency changes 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants