Look in more directories for restore binaries#4310
Merged
cbandy merged 3 commits intoCrunchyData:mainfrom Oct 6, 2025
Merged
Conversation
6 tasks
benjaminjb
reviewed
Oct 3, 2025
| // Patroni config when bootstrapping a cluster using an existing data directory. | ||
| func RestoreCommand(pgdata, hugePagesSetting, fetchKeyCommand string, _ []*corev1.PersistentVolumeClaim, args ...string) []string { | ||
| ps := postgres.NewParameterSet() | ||
| func RestoreCommand(postgresVersion int32, pgdata string, params *postgres.ParameterSet, args ...string) []string { |
benjaminjb
reviewed
Oct 3, 2025
benjaminjb
reviewed
Oct 3, 2025
benjaminjb
reviewed
Oct 3, 2025
| // ensure options are properly set | ||
| // TODO (andrewlecuyer): move validation logic to a webhook | ||
| for _, opt := range options { | ||
| { |
Contributor
There was a problem hiding this comment.
Do we want to check all the flags and emit all the errors at once?
Member
Author
There was a problem hiding this comment.
I don't want to change any more of this behavior right now. 🌱 The comment above suggests CRD validation.
Contributor
There was a problem hiding this comment.
Should we be ranging over hasOptions?
Member
Author
There was a problem hiding this comment.
Not that I know of. What would a range do here?
Contributor
There was a problem hiding this comment.
Ah, I see where I was going wrong: in the original code, we loop over the options, and if one of them is wrong for some reason, we emit an event and return.
(As opposed to, say, telling the user every things that's wrong with their input in one pass.)
Input options were being scanned multiple times in different ways.
This makes restores compatible with images from other distros. Issue: PGO-864
benjaminjb
approved these changes
Oct 3, 2025
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.
This is similar to #4304, but for restore jobs in PostgresCluster using Postgres images.
Checklist:
Type of Changes:
Other Information:
📝 Might be easier to review as separate commits.
Issue: PGO-864