cluster-api
cluster-api copied to clipboard
:bug: Ensure Kubeadmconfig is reconciled after datasecretname is set
Signed-off-by: killianmuldoon [email protected]
This changes the order in which the bootstrap reconciliation is done in the Machine controller to ensure the ownerReference, and other changes, are set after the dataSecretName has been set. This is designed to help in backup and restore use cases, or any other case where the ownerReference is removed.
In the previous code once the dataSecretName is set the KubeadmConfigTemplate never has its ownerReferences and labels reconciled. This change makes the reconcile loop always attempt to make changes to the bootstrap object, even if the secret name has previously been set.
#6980
This changes the order in which the bootstrap reconciliation is done in the Machine controller to ensure the ownerReference, and other changes, are set after the dataSecretName has been set.
"are set after the dataSecretName has been set" should be "are set before the dataSecretName has been set", right?
(or rather before we check for if dataSecretName is set and then just return)
"are set after the dataSecretName has been set" should be "are set before the dataSecretName has been set", right? (or rather before we check for if dataSecretName is set and then just return)
Sorry for the ambiguity here - this was meant to mean after it's set on the object, rather than referencing when the check happens.
No worries! I understood what the plan was independent of the phrasing :)
/lgtm
/assign @fabriziopandini for approval
/lgtm
is this a candidate for cherry-pick?
is this a candidate for cherry-pick? I think yes
/cherry-pick release-1.2
@fabriziopandini Can you take a final look at this PR?
@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.2 in a new PR and assign it to you.
In response to this:
is this a candidate for cherry-pick? I think yes
/cherry-pick release-1.2
@fabriziopandini Can you take a final look at this 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/test-infra repository.
/lgtm
great work! /lgtm /approve
[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
- ~~OWNERS~~ [fabriziopandini]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@sbueringer: #7394 failed to apply on top of branch "release-1.2":
Applying: Ensure Kubeadmconfig is reconciled after datasecretname is set
Using index info to reconstruct a base tree...
M internal/controllers/machine/machine_controller_phases.go
Falling back to patching base and 3-way merge...
Auto-merging internal/controllers/machine/machine_controller_phases.go
CONFLICT (content): Merge conflict in internal/controllers/machine/machine_controller_phases.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Ensure Kubeadmconfig is reconciled after datasecretname is set
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
In response to this:
is this a candidate for cherry-pick? I think yes
/cherry-pick release-1.2
@fabriziopandini Can you take a final look at this 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/test-infra repository.