Fix shared-secrets silent failures

What does this MR do?

Fix shared-secrets silent failures

Set the -e and pipefail options to exit the shared-secrets script early if a command fails. When the script fails, the whole Job is retried unless the backoff limit is exceeded.

Closes #6561 (closed)

Changelog: fixed

Test Plan

To test early failure/retry add a failing kubectl command to the shared secrets script:

kubectl get secret {{ template "gitlab.gitlab-shell.hostKeys.secret" . }}-wrong -n $namespace

The shared secret pod should fail once it reaches that command and should continue to be retired until the backoff limit is exceeded.

Author checklist

For general guidance, please follow our Contributing guide.

Required

For anything in this list which will not be completed, please provide a reason in the MR discussion.

  • Merge Request Title and Description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • MR has a green pipeline.
  • Documentation created/updated.
  • Tests added/updated.
  • Have you validated that your change works end-to-end on a real cluster deployment?
    • Describe how you did it in a comment.
  • Equivalent MR/issue for omnibus-gitlab opened.

Reviewers checklist

Closes #6561 (closed)

Edited by Clemens Beck

Merge request reports

Loading