cluster-api icon indicating copy to clipboard operation
cluster-api copied to clipboard

🌱 Add NamingStrategy to KubeadmControlPlane

Open adilGhaffarDev opened this issue 1 year ago • 18 comments

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): Fixes part of #10577

adilGhaffarDev avatar Aug 31 '24 11:08 adilGhaffarDev

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

k8s-ci-robot avatar Aug 31 '24 11:08 k8s-ci-robot

right now it only has API changes, and the remaining work is in progress, I opened a draft PR so I can get some early inputs. cc @sbueringer

adilGhaffarDev avatar Aug 31 '24 11:08 adilGhaffarDev

lgtm for the API from my side (+/- the godoc nit)

Before I start to review the implementation, @fabriziopandini @chrischdi @mdbooth @lentzi90 Are we fine with the API and does it cover your use cases?

sbueringer avatar Sep 03 '24 17:09 sbueringer

lgtm for the API from my side (+/- the godoc nit)

Before I start to review the implementation, @fabriziopandini @chrischdi @mdbooth @lentzi90 Are we fine with the API and does it cover your use cases?

@adilGhaffarDev is representing the interests of @lentzi90 while he's away. From my POV, I'm happy if @adilGhaffarDev thinks it covers the use case.

mdbooth avatar Sep 03 '24 19:09 mdbooth

Before I start to review the implementation, @fabriziopandini @chrischdi @mdbooth @lentzi90 Are we fine with the API and does it cover your use cases?

@lentzi90 flag was also for machineset and that is also going to be removed after 1.9, can I add same namingStrategy in MchineDeployments too in this same PR?

adilGhaffarDev avatar Sep 05 '24 09:09 adilGhaffarDev

@lentzi90 flag was also for machineset and that is also going to be removed after 1.9, can I add same namingStrategy in MchineDeployments too in this same PR?

I will open separate PR for MDs, as discussed here: https://github.com/kubernetes-sigs/cluster-api/issues/10577#issuecomment-2333319671 , @sbueringer please review this one. Also, fuzzing tests are failing in v1alpha APIs, Do you have any idea why they are failing?

adilGhaffarDev avatar Sep 09 '24 06:09 adilGhaffarDev

@sbueringer please review this one.

I would like to get reviews from other maintainers on the API first. It's not only my call.

sbueringer avatar Sep 09 '24 17:09 sbueringer

LGTM label has been added.

Git tree hash: 8c506758c47f4cf2c10dbc19e12c368095531f1f

k8s-ci-robot avatar Sep 10 '24 15:09 k8s-ci-robot

@sbueringer please review this one.

I would like to get reviews from other maintainers on the API first. It's not only my call.

/hold for above

sbueringer avatar Sep 10 '24 16:09 sbueringer

@fabriziopandini @chrischdi please take a look when you get time.

adilGhaffarDev avatar Sep 13 '24 11:09 adilGhaffarDev

@adilGhaffarDev: 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-test-main 94c96ca link true /test pull-cluster-api-test-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.

@sbueringer fuzz tests for v1alpha are failing, what do I need to add to fix these tests?

adilGhaffarDev avatar Oct 04 '24 07:10 adilGhaffarDev

@sbueringer fuzz tests for v1alpha are failing, what do I need to add to fix these tests?

You have to implement conversion. Basically when these objects are converted e.g. v1beta1 => v1alpha3 => v1beta1 the new field gets lost.

Conversion is implemented in ConvertTo & ConvertFrom functions of v1alpha3 & v1alpha4, e.g.: https://github.com/kubernetes-sigs/cluster-api/blob/4e151e2aa4cebf34efccc6c13410d8b35d1c4a64/internal/apis/controlplane/kubeadm/v1alpha3/conversion.go

To give you an example. For KubeadmControlPlane & v1alpha3 you have to set the new field in ConvertTo somewhere where we are setting (i.e. "restoring") all the other fields, e.g.

	dst.Spec.RolloutBefore = restored.Spec.RolloutBefore

sbueringer avatar Oct 09 '24 18:10 sbueringer

@sbueringer fuzz tests for v1alpha are failing, what do I need to add to fix these tests?

You have to implement conversion. Basically when these objects are converted e.g. v1beta1 => v1alpha3 => v1beta1 the new field gets lost.

Conversion is implemented in ConvertTo & ConvertFrom functions of v1alpha3 & v1alpha4, e.g.: https://github.com/kubernetes-sigs/cluster-api/blob/4e151e2aa4cebf34efccc6c13410d8b35d1c4a64/internal/apis/controlplane/kubeadm/v1alpha3/conversion.go

To give you an example. For KubeadmControlPlane & v1alpha3 you have to set the new field in ConvertTo somewhere where we are setting (i.e. "restoring") all the other fields, e.g.

	dst.Spec.RolloutBefore = restored.Spec.RolloutBefore

conversions are added. now tests should pass.

adilGhaffarDev avatar Oct 09 '24 19:10 adilGhaffarDev

@JoelSpeed @sbueringer @chrischdi @vincepri please take a look, all comments are addressed. Let me know if anything else is needed.

adilGhaffarDev avatar Oct 10 '24 06:10 adilGhaffarDev

On my list

sbueringer avatar Oct 15 '24 08:10 sbueringer

Thx!

/lgtm /approve

/hold I'll give other folks a few days time to also take another look, otherwise happy to merge

sbueringer avatar Oct 21 '24 12:10 sbueringer

LGTM label has been added.

Git tree hash: 99d51f95cf193c78c44efc5fd94f9a757c9cabb8

k8s-ci-robot avatar Oct 21 '24 12:10 k8s-ci-robot

@adilGhaffarDev Can you rebase? I'll merge afterwards

sbueringer avatar Oct 25 '24 14:10 sbueringer

Thanks for driving this effort @adilGhaffarDev /lgtm

fabriziopandini avatar Oct 25 '24 16:10 fabriziopandini

LGTM label has been added.

Git tree hash: 82f83b511e399fb4d142abcc9773e9b43bef2d14

k8s-ci-robot avatar Oct 25 '24 16:10 k8s-ci-robot

/test pull-cluster-api-test-main

adilGhaffarDev avatar Oct 28 '24 08:10 adilGhaffarDev

/test pull-cluster-api-e2e-main

sbueringer avatar Oct 28 '24 09:10 sbueringer

Thx!

/lgtm /approve /hold cancel

sbueringer avatar Oct 28 '24 09:10 sbueringer

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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 avatar Oct 28 '24 09:10 k8s-ci-robot