Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a readiness gate for scheduled backups so they don’t run while the PerconaServerMySQL cluster is not Ready, with an opt-out unsafe flag to preserve prior behavior when needed.
Changes:
- Skip scheduled backup execution when
status.state != Readyunlessspec.unsafeFlags.backupIfUnhealthyis enabled. - Introduce
unsafeFlags.backupIfUnhealthyin the API type and CRD OpenAPI schemas. - Update sample CR (
deploy/cr.yaml) to document the new unsafe flag.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/controller/ps/backup.go | Adds the runtime check to skip scheduled backups when the cluster isn’t ready (unless overridden). |
| api/v1/perconaservermysql_types.go | Adds BackupIfUnhealthy to UnsafeFlags API. |
| config/crd/bases/ps.percona.com_perconaservermysqls.yaml | Updates CRD base schema to include unsafeFlags.backupIfUnhealthy. |
| deploy/crd.yaml | Updates shipped CRD manifest with the new field schema. |
| deploy/bundle.yaml | Updates operator bundle CRD schema with the new field. |
| deploy/cw-bundle.yaml | Updates CW bundle CRD schema with the new field. |
| deploy/cr.yaml | Documents the new unsafe flag in the example CR. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| } | ||
|
|
||
| if cr.Status.State != apiv1.StateReady && !cr.Spec.Unsafe.BackupIfUnhealthy { | ||
| log.Info("Skipping scheduled backup because cluster is not ready", "cluster", cr.Name, "namespace", cr.Namespace, "state", cr.Status.State, "job", backupJob.Name) |
Comment on lines
+89
to
+92
| if cr.Status.State != apiv1.StateReady && !cr.Spec.Unsafe.BackupIfUnhealthy { | ||
| log.Info("Skipping scheduled backup because cluster is not ready", "cluster", cr.Name, "namespace", cr.Namespace, "state", cr.Status.State, "job", backupJob.Name) | ||
| return | ||
| } |
Collaborator
commit: ba00f80 |
This file contains hidden or 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
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.
https://perconadev.atlassian.net/browse/K8SPS-435
CHANGE DESCRIPTION
Problem:
Short explanation of the problem.
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Short explanation of the solution we are providing with this PR.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability