STAC-25087 restore: fail on missing StackPacks; drop S3 prefix on local-bucket download#31
Open
viliakov wants to merge 1 commit into
Open
STAC-25087 restore: fail on missing StackPacks; drop S3 prefix on local-bucket download#31viliakov wants to merge 1 commit into
viliakov wants to merge 1 commit into
Conversation
…on local-bucket download
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.
Summary
Two fixes to the restore shell scripts under
internal/scripts/scripts/that ship inside the restore Job images.restore-settings-backup.shBACKUP_CONFIGURATION_S3_PREFIXfrom the local-bucket StackPacks download. The local (in-cluster) bucket does not use the configurable prefix at backup time, so the previous path included a prefix that was never written. That made the local-bucket lookup miss, the script silently fell through to the warning-and-skip branch, and the operator never saw a real failure. Prefix is still applied to the remote-bucket fallback, which is where it belongs.WARNINGandexit 0when neither the local nor remote bucket had the StackPacks companion file. The settings restore had already succeeded, so the Job reported success and the missing StackPacks went unnoticed. Now it logsERRORand exits non-zero so the Job fails and the operator decides how to proceed.restore-stackgraph-backup.shlsprobe'selsebranch silently warned and fell through, so the Job exited 0 even though StackPacks restore did not run. Inverted to fail fast withERROR+exit 1.Both scripts already have
set -Eeuo pipefail, so the explicitexit 1is what flips the previously-silent skip into a hard failure.Locally verified by the reporter.
Test plan
ERROR: StackPacks backup ... not foundline.ERROR: StackPacks backup ... not found in S3line.Jira: https://stackstate.atlassian.net/browse/STAC-25087