-
Notifications
You must be signed in to change notification settings - Fork 15
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
base: main
Are you sure you want to change the base?
Support Multiple Same Kind Remediation #200
Conversation
Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
Skipping CI for Draft Pull Request. |
[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 |
/test 4.15-openshift-e2e |
There was a problem hiding this 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...
Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
b5bd5ca
to
8a3376e
Compare
/test 4.15-openshift-e2e |
controllers/tests/controller/selfnoderemediation_controller_test.go
Outdated
Show resolved
Hide resolved
/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>
199d0c7
to
630aea1
Compare
/lgtm |
@@ -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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
/retest |
3 similar comments
/retest |
/retest |
/retest |
Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
@clobrano: The following test failed, say
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. |
/test 4.15-openshift-e2e |
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
MultipleTemplatesSupportedAnnotation
that enables this feature via "Defaulting" (Mutating) webhook.NodeNameAnnotation
instead than from remediation's name (when the feature is enabled).Which issue(s) this PR fixes
https://issues.redhat.com/browse/ECOPROJECT-1930
Test plan