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

Support Multiple Same Kind Remediation #200

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

clobrano
Copy link
Contributor

@clobrano clobrano commented May 14, 2024

Why we need this PR

This PR will enable the user to select several SNR Templates (of the same kind) when using NHC escalating remediation.

This feature is dependent on the changes in NHC as well (which is available starting from NHC 0.8.0).

Changes made

  • Automatically add the MultipleTemplatesSupportedAnnotation that enables this feature via "Defaulting" (Mutating) webhook.
  • Support that Node's name might come from NodeNameAnnotation instead than from remediation's name (when the feature is enabled).
  • Updated Common package to the version shipping the new annotations needed by this feature.
  • Test coverage for both configurations (supported and unsupported multiple same kind remediation).

Which issue(s) this PR fixes

https://issues.redhat.com/browse/ECOPROJECT-1930

Test plan

Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
Copy link
Contributor

openshift-ci bot commented May 14, 2024

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

Copy link
Contributor

openshift-ci bot commented May 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clobrano

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

@clobrano
Copy link
Contributor Author

/test 4.15-openshift-e2e

Copy link
Member

@slintes slintes left a comment

Choose a reason for hiding this comment

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

didn't review the test yet...

controllers/selfnoderemediation_controller.go Outdated Show resolved Hide resolved
controllers/selfnoderemediation_controller.go Outdated Show resolved Hide resolved
controllers/selfnoderemediation_controller.go Outdated Show resolved Hide resolved
Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
@clobrano clobrano force-pushed the support-multiple-same-kind-template-0 branch from b5bd5ca to 8a3376e Compare May 15, 2024 12:56
@clobrano
Copy link
Contributor Author

/test 4.15-openshift-e2e

@clobrano
Copy link
Contributor Author

/test 4.15-openshift-e2e

…f same kind

In order to make the tests more maintanable, limit testing both
supported and unsupported multiple template of the same kind to
"Out-of-service taint: remediation flow" test.

Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
@clobrano clobrano force-pushed the support-multiple-same-kind-template-0 branch from 199d0c7 to 630aea1 Compare May 27, 2024 12:59
@mshitrit
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm label May 28, 2024
@clobrano clobrano marked this pull request as ready for review May 28, 2024 12:18
@openshift-ci openshift-ci bot requested review from beekhof and mshitrit May 28, 2024 12:18
@@ -647,10 +648,11 @@ func (r *SelfNodeRemediationReconciler) getNodeFromSnr(snr *v1alpha1.SelfNodeRem
}
}

//since we didn't find a machine owner ref, we assume that snr name is the unhealthy node name
// since we didn't find a Machine owner ref, we assume that SNR remediation contains the node's name either in the
// remediation Name or in its annotation
Copy link
Member

Choose a reason for hiding this comment

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

nit: lowercase name


// getNodeName checks for the node name in SNR CR's annotation. If it does not exist it assumes the node name equals to SNR CR's name and returns it.
func getNodeName(snr *v1alpha1.SelfNodeRemediation) string {
if ann := snr.GetAnnotations(); ann != nil {
Copy link
Member

Choose a reason for hiding this comment

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

no need for nil check

"A nil map is equivalent to an empty map except that no elements may be added." 🙂
https://go.dev/ref/spec#Map_types

@openshift-ci openshift-ci bot removed the lgtm label May 28, 2024
@clobrano
Copy link
Contributor Author

/retest

3 similar comments
@clobrano
Copy link
Contributor Author

/retest

@clobrano
Copy link
Contributor Author

/retest

@clobrano
Copy link
Contributor Author

clobrano commented Jun 3, 2024

/retest

Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
Copy link
Contributor

openshift-ci bot commented Jun 5, 2024

@clobrano: 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
ci/prow/4.16-openshift-e2e 05d3d9f link true /test 4.16-openshift-e2e

Full PR test history. Your PR dashboard.

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.

@clobrano
Copy link
Contributor Author

clobrano commented Jun 5, 2024

/test 4.15-openshift-e2e

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

Successfully merging this pull request may close these issues.

None yet

3 participants