Skip to content

Commit

Permalink
Merge pull request #871 from fsoppelsa/check-snapshot-exitcode
Browse files Browse the repository at this point in the history
Exits with a non-zero code in case Etcd backup fails
  • Loading branch information
openshift-merge-robot committed Jul 30, 2022
2 parents c6db403 + c9540ed commit 2272cc7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bindata/etcd/cluster-backup.sh
Expand Up @@ -126,5 +126,11 @@ ETCDCTL_ENDPOINTS="https://${NODE_NODE_ENVVAR_NAME_IP}:2379" etcdctl snapshot sa

# Check the integrity of the snapshot
check_snapshot_status "${SNAPSHOT_FILE}"
snapshot_failed=$?

# If check_snapshot_status returned 1 it failed, so exit with code 1
if [[ $snapshot_failed -eq 1 ]]; then
exit 1
fi

echo "snapshot db and kube resources are successfully saved to ${BACKUP_DIR}"
6 changes: 6 additions & 0 deletions pkg/operator/etcd_assets/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2272cc7

Please sign in to comment.