-
Notifications
You must be signed in to change notification settings - Fork 56
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 validation of VR conditions #1643
Open
nirs
wants to merge
5
commits into
RamenDR:main
Choose a base branch
from
nirs:vr-status-cleanups
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
nirs
force-pushed
the
vr-status-cleanups
branch
from
November 7, 2024 16:23
c2299f3
to
48262f0
Compare
nirs
changed the title
WIP: Improve validation of VR conditions
Improve validation of VR conditions
Nov 7, 2024
nirs
force-pushed
the
vr-status-cleanups
branch
from
November 7, 2024 20:37
48262f0
to
27a785e
Compare
ELENAGER
reviewed
Nov 10, 2024
nirs
force-pushed
the
vr-status-cleanups
branch
from
November 10, 2024 15:32
27a785e
to
847680b
Compare
ELENAGER
approved these changes
Nov 10, 2024
nirs
force-pushed
the
vr-status-cleanups
branch
from
November 11, 2024 13:44
847680b
to
010302b
Compare
nirs
force-pushed
the
vr-status-cleanups
branch
from
November 11, 2024 17:51
010302b
to
0ac2eb8
Compare
While changing isVRConditionMet() return values, stale line from the previous comment was left by mistake. Signed-off-by: Nir Soffer <[email protected]>
Signed-off-by: Nir Soffer <[email protected]>
With this we will log a helpful message when the condition is missing: Failed to get the Validated condition from status of VolumeReplication resource To ensure that we log a helpful message, we don't log the default message as we do in other conditions. We use a default message only if we don't get an error message from isVRConditionMet(), which happens only when using csi-addon <= 0.10.0. Because we handle an empty message, we don't need to use the helper for setting a condition with message or default message. Signed-off-by: Nir Soffer <[email protected]>
When VR condition is not met, we were setting the DataReady and DataProtected protected pvc conditions using either a default error message, or the error message from the VR condition. However we always logged the default message, even we if have a better message from the VR condition (csi-addons > 0.10.0), or from isVRConditionMet() (e.g. condition is missing, state, or unknown) Change all the callers to use the default error message as a fallback and log the same message we report in the protected pvc conditions. Fix also the log when the condition is met to use the same message we report in the protected pvc conditions. This simplifies the code and ensure that the logs matches the status. With this change the helper for logging either a message or default message are eliminated. Signed-off-by: Nir Soffer <[email protected]>
Use `errorMsg` for the error message returned from isVRConditionMet(), and `msg` for the default successful message. Signed-off-by: Nir Soffer <[email protected]>
nirs
force-pushed
the
vr-status-cleanups
branch
from
November 11, 2024 18:20
0ac2eb8
to
ce74c3a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Based on #1639 temporarily.