-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add Two Reasons for Updating and Stopping Remediation #76
Merged
openshift-merge-robot
merged 5 commits into
medik8s:main
from
razo7:stop-remediation-for-2-reasons
Aug 16, 2023
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9126ce4
Add two reasons for updating and stoping remediation
razo7 8005d8a
Don't stop update of condition from false to true
razo7 6f62b11
Better reason for NHC annotation signal
razo7 01241d6
Separate condition message for RemediationFinishedNodeNotFound and Re…
razo7 c0e69f2
Switch case usage for conditionMessage of a failure
razo7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,7 @@ var _ = Describe("FAR Controller", func() { | |
farNamespacedName := client.ObjectKey{Name: workerNode, Namespace: defaultNamespace} | ||
farNoExecuteTaint := utils.CreateFARNoExecuteTaint() | ||
resourceDeletionWasTriggered := true // corresponds to testVADeletion bool value | ||
conditionStatusPointer := func(status metav1.ConditionStatus) *metav1.ConditionStatus { return &status } | ||
BeforeEach(func() { | ||
// Create two VAs and two pods, and at the end clean them up with DeferCleanup | ||
va1 := createVA(vaName1, workerNode) | ||
|
@@ -166,7 +167,6 @@ var _ = Describe("FAR Controller", func() { | |
testPodDeletion(testPodName, resourceDeletionWasTriggered) | ||
|
||
By("Having Succeed condition set to true") | ||
conditionStatusPointer := func(status metav1.ConditionStatus) *metav1.ConditionStatus { return &status } | ||
verifyStatusCondition(workerNode, commonConditions.ProcessingType, conditionStatusPointer(metav1.ConditionFalse)) | ||
verifyStatusCondition(workerNode, v1alpha1.FenceAgentActionSucceededType, conditionStatusPointer(metav1.ConditionTrue)) | ||
verifyStatusCondition(workerNode, commonConditions.SucceededType, conditionStatusPointer(metav1.ConditionTrue)) | ||
|
@@ -200,9 +200,9 @@ var _ = Describe("FAR Controller", func() { | |
testPodDeletion(testPodName, resourceDeletionWasTriggered) | ||
|
||
By("Not having any condition set") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. message does not fit anymore |
||
verifyStatusCondition(dummyNode, commonConditions.ProcessingType, nil) | ||
verifyStatusCondition(dummyNode, v1alpha1.FenceAgentActionSucceededType, nil) | ||
verifyStatusCondition(dummyNode, commonConditions.SucceededType, nil) | ||
verifyStatusCondition(dummyNode, commonConditions.ProcessingType, conditionStatusPointer(metav1.ConditionFalse)) | ||
verifyStatusCondition(dummyNode, v1alpha1.FenceAgentActionSucceededType, conditionStatusPointer(metav1.ConditionFalse)) | ||
verifyStatusCondition(dummyNode, commonConditions.SucceededType, conditionStatusPointer(metav1.ConditionFalse)) | ||
}) | ||
}) | ||
}) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
IMHO a switch makes more sense here, which errors when a reason isn't handled. Prevents forgetting this part when adding another reason to the case statement above.
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.
Good point