-
Notifications
You must be signed in to change notification settings - Fork 69
K8SPG-904 Allow no repos when restoring from dataSource #1395
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
base: main
Are you sure you want to change the base?
Conversation
| return crunchyv1beta1.Backups{ | ||
| PGBackRest: crunchyv1beta1.PGBackRestArchive{ | ||
| Image: b.PGBackRest.Image, | ||
| }, | ||
| } |
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.
crunchy controller decides whether backups are disabled by comparing backup spec with crunchyv1beta1.Backups{PGBackRest: crunchyv1beta1.PGBackRestArchive{}}
| backupsSpecFound = !reflect.DeepEqual(postgresCluster.Spec.Backups, v1beta1.Backups{PGBackRest: v1beta1.PGBackRestArchive{}}) |
will this affect that?
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.
It will (in a way).
That's why the backup-enable-disable test was updated to show how a cluster without repos but with dataSource is expected to work. Which is: in case we specify the image in the crunchyv1beta1.Backups{PGBackRest: crunchyv1beta1.PGBackRestArchive{}} section, crunchy considers backups as enabled indeed, however since there are no repos defined, it's only expected that the sts will be created for repohost but no backup job should be created until we enable the backups. It's being explicitly checked in this new test step
Please let me know if you have any concerns about this behaviour.
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.
is there a way to not create the sts for repohost?
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.
Apparently there is this RELATED_IMAGE_PGBACKREST env var for crunchy cluster that should do the trick without defining the image in the .backups.pgbackrest section. That could potentially allow to reach the goal but avoid creating sts. I'll play around with it and get back.
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.
posted the current state to the related ticket, the work on it is paused until the proper solution is found.
commit: 1588646 |
Allow no repos when restoring from dataSource
Problem:
K8SPG-904 When restoring from dataSource while backups are disabled, the restore job fails to be created.
Cause:
The
crunchyv1beta1.Backups.PGBackRest.Imagewas never set if the backups were disabled which caused the following error:Solution:
Init the
crunchyv1beta1.Backups.PGBackRest.Imagewith the given image from the PG CR.Note: if the
crunchyv1beta1.Backups.PGBackRest.Imageis set then the repohost sts appears which was the cause why thebackup-enable-disablee2e test was failing on step 2.So the following changes are also applied:
crunchyv1beta1.Backups.PGBackRest.Imageonly if the pg cluster has datasourcecrunchyv1beta1.Backups.PGBackRest.ImageCHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability