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.14][manual] kubeletconfig: ignore nonmatching kubeletconfig objects #903

Merged

Conversation

ffromani
Copy link
Member

@ffromani ffromani commented Apr 2, 2024

This is a manual cherry-pick of #885

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

Signed-off-by: Francesco Romani <fromani@redhat.com>
(cherry picked from commit 4e4c92c)
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>
(cherry picked from commit ee717aa)
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>
(cherry picked from commit ada1095)
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>
(cherry picked from commit f7e4d06)
@openshift-ci openshift-ci bot requested review from shajmakh and Tal-or April 2, 2024 11:44
@ffromani
Copy link
Member Author

ffromani commented Apr 2, 2024

/cherry-pick release-4.13

Copy link
Contributor

openshift-ci bot commented Apr 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ffromani

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 2, 2024
@openshift-cherrypick-robot

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

In response to this:

/cherry-pick release-4.13

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.

@shajmakh
Copy link
Member

shajmakh commented Apr 2, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 1c8bcfd into release-4.14 Apr 2, 2024
7 checks passed
@openshift-cherrypick-robot

@ffromani: #903 failed to apply on top of branch "release-4.13":

Applying: controller: kubeletconfig: test: fix reconcile key
Applying: controller: kubeletconfig: ignore non-matching MCP
Applying: kubeletconfig: controller: add softowner labels
Applying: e2e: kubeletconfig: add e2e tests for nonmatching kubeletconfigs
Using index info to reconstruct a base tree...
M	internal/objects/objects.go
M	test/e2e/serial/tests/configuration.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/serial/tests/configuration.go
CONFLICT (content): Merge conflict in test/e2e/serial/tests/configuration.go
Auto-merging internal/objects/objects.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 e2e: kubeletconfig: add e2e tests for nonmatching kubeletconfigs
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.13

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 deleted the manual-cherry-pick-885-to-release-4.14 branch April 2, 2024 13:34
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants