-
Notifications
You must be signed in to change notification settings - Fork 79
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 medusa validation #1054
Add medusa validation #1054
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1054 +/- ##
==========================================
+ Coverage 57.27% 57.37% +0.09%
==========================================
Files 100 100
Lines 10109 10160 +51
==========================================
+ Hits 5790 5829 +39
- Misses 3815 3823 +8
- Partials 504 508 +4
|
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.
Awesome stuff, I would just like one tiny change to avoid breaking restores of backups created before we modified the MedusaBackup CRD.
@@ -54,6 +54,9 @@ type MedusaRestoreJobStatus struct { | |||
Finished []string `json:"finished,omitempty"` | |||
|
|||
Failed []string `json:"failed,omitempty"` | |||
|
|||
// Message gives the reason why restore operation failed | |||
Message string `json:"message,omitempty"` |
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.
suggestion: putting StartTime, FinishTime and Message as printcolumns would be a nice addition. Can do that in a subsequent ticket.
return fmt.Errorf("target backup has not completed successfully") | ||
} | ||
|
||
if backup.Status.TotalNodes != cassdc.Spec.Size { |
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.
issue: This would break for all backups that were created prior to the new fields being added in the MedusaBackup CRD, right?
Maybe we should detect that and skip validation in this case?
I guess that if backup.Status.TotalNodes = backup.Status.FinishedNodes == 0
then we can skip the validation.
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.
Right, backwards compatibility. Will do.
…ttier output of MedusaRestoreJob
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
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.
Looks good now 👍
What this PR does:
Adds validation to MedusaRestoreJob controller that verifies the targetted MedusaBackup can be used to safely restore the target CassandraDatacenter
Which issue(s) this PR fixes:
Fixes #1045
Checklist