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

improve condition name #173

Merged
merged 1 commit into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions controllers/selfnoderemediation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const (
remediationStarted processingChangeReason = "RemediationStarted"
remediationTimeoutByNHC processingChangeReason = "RemediationTimeoutByNHC"
remediationFinishedSuccessfully processingChangeReason = "RemediationFinishedSuccessfully"
remediationFinishedNodeNotFound processingChangeReason = "RemediationFinishedNodeNotFound"
remediationSkippedNodeNotFound processingChangeReason = "RemediationSkippedNodeNotFound"
)

type remediationPhase string
Expand Down Expand Up @@ -238,7 +238,7 @@ func (r *SelfNodeRemediationReconciler) Reconcile(ctx context.Context, req ctrl.
if err != nil {
if apiErrors.IsNotFound(err) {
r.logger.Info("couldn't find node matching remediation", "node name", snr.Name)
if err = r.updateConditions(remediationFinishedNodeNotFound, snr); err != nil {
if err = r.updateConditions(remediationSkippedNodeNotFound, snr); err != nil {
return ctrl.Result{}, err
}
r.Recorder.Event(snr, eventTypeNormal, eventReasonRemediationStopped, "couldn't find node matching remediation")
Expand Down Expand Up @@ -281,7 +281,7 @@ func (r *SelfNodeRemediationReconciler) updateConditions(processingTypeReason pr
case remediationTimeoutByNHC:
processingConditionStatus = metav1.ConditionFalse
succeededConditionStatus = metav1.ConditionFalse
case remediationFinishedNodeNotFound:
case remediationSkippedNodeNotFound:
processingConditionStatus = metav1.ConditionFalse
succeededConditionStatus = metav1.ConditionFalse
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ var _ = Describe("SNR Controller", func() {
})

It("remediation should stop and update conditions", func() {
verifyTypeConditions(snr.Name, metav1.ConditionFalse, metav1.ConditionFalse, "RemediationFinishedNodeNotFound")
verifyTypeConditions(snr.Name, metav1.ConditionFalse, metav1.ConditionFalse, "RemediationSkippedNodeNotFound")

verifyEvent("Normal", "RemediationStopped", "couldn't find node matching remediation")
})
Expand Down Expand Up @@ -409,7 +409,7 @@ var _ = Describe("SNR Controller", func() {
It("Node is not found", func() {
time.Sleep(time.Second)
verifyNoEvent("Normal", "MarkUnschedulable", "Remediation process - unhealthy node marked as unschedulable")
verifyTypeConditions(snr.Name, metav1.ConditionFalse, metav1.ConditionFalse, "RemediationFinishedNodeNotFound")
verifyTypeConditions(snr.Name, metav1.ConditionFalse, metav1.ConditionFalse, "RemediationSkippedNodeNotFound")
verifyEvent("Normal", "RemediationStopped", "couldn't find node matching remediation")
})
})
Expand Down