Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.15] kubeletconfig: ignore nonmatching kubeletconfig objects #885

Conversation

openshift-cherrypick-robot

This is an automated cherry-pick of #874

/assign ffromani

fix copy/paste mistake which triggered reconciliation with
the wrong key.

Signed-off-by: Francesco Romani <fromani@redhat.com>
In 3caa829 we added support to handle gracefully payload-less
kubeletconfig objects. There's however another issue lurking:
we can have multiple kubeletconfig objects.

Previously, the code was incorrectly assuming there is at most
one kubeletconfig object in the cluster, targeting the MCP
worker pool.

But we can actually have more kubeletconfig objects as long
as they don't target overlapping MCPs (e.g. with 2 MCPs we can
have 2 kubeletconfig objects, say, or perhaps even 4 considering
payloadles objects).

Thus, we need to fix our matching logic to handle this occurrence.
The fix is simple: just look for kubeletconfig which we target
NodeGroups we are interested into, silently skipping everything else.

e2e tests are pending and will be added in a separate commit.

Signed-off-by: Francesco Romani <fromani@redhat.com>
add labels to easily infer which MCP and which NROP
instance are linked to a generated configmap

The OwnerReference is already correctly set to
handle the cascading delete, we need more soft links
between objects and labels seems a good and natural fit.

We plan to use these labels for troubleshooting and
in the e2e tests.

Signed-off-by: Francesco Romani <fromani@redhat.com>
add e2e tests to make sure the nonmatching kubeletconfigs
(e.g. kubeletconfigs which are not linked to NodeGroups
the operator monitors) are safely skipped.

Signed-off-by: Francesco Romani <fromani@redhat.com>
Copy link
Contributor

openshift-ci bot commented Mar 14, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found 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

@ffromani
Copy link
Member

/cherry-pick release-4.14

@openshift-cherrypick-robot
Copy link
Author

@ffromani: once the present PR merges, I will cherry-pick it on top of release-4.14 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.14

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.

@ffromani ffromani merged commit 772666e into openshift-kni:release-4.15 Mar 19, 2024
6 of 7 checks passed
@openshift-cherrypick-robot
Copy link
Author

@ffromani: #885 failed to apply on top of branch "release-4.14":

Applying: controller: kubeletconfig: test: fix reconcile key
Applying: controller: kubeletconfig: ignore non-matching MCP
Using index info to reconstruct a base tree...
M	controllers/kubeletconfig_controller.go
M	internal/machineconfigpools/machineconfigpools.go
Falling back to patching base and 3-way merge...
Auto-merging internal/machineconfigpools/machineconfigpools.go
CONFLICT (content): Merge conflict in internal/machineconfigpools/machineconfigpools.go
Auto-merging controllers/kubeletconfig_controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 controller: kubeletconfig: ignore non-matching MCP
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:

/cherry-pick release-4.14

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants