Skip to content

fix: report a clear error when chart-testing blob verification fails#210

Open
somaz94 wants to merge 1 commit into
helm:mainfrom
somaz94:fix/blob-verify-error
Open

fix: report a clear error when chart-testing blob verification fails#210
somaz94 wants to merge 1 commit into
helm:mainfrom
somaz94:fix/blob-verify-error

Conversation

@somaz94
Copy link
Copy Markdown

@somaz94 somaz94 commented Jun 5, 2026

Under set -o errexit, the retVal=$? check after cosign verify-blob was
unreachable: a non-zero cosign verify-blob aborts the script immediately, so
the intended "Unable to validate chart-testing version" message never fired. The
error branch also called log_error, which is not defined anywhere in ct.sh
(it would fail with command not found if it were ever reached).

This rewrites the check as if ! cosign verify-blob ...; then, which suspends
errexit for the tested command so the failure branch is actually reached, and
replaces the undefined log_error with echo "ERROR: ..." >&2, matching the
existing error style used in parse_command_line. Behavior on success is
unchanged; on verification failure the script now prints the intended clear
error and exits 1.

Validation:

  • bash -n ct.sh and zsh -n ct.sh parse clean
  • shellcheck ct.sh clean
  • Confirmed in both bash and zsh that if ! cmd reaches the failure branch under set -o errexit

Note: open PR #205 wraps this same block in a verify_blob toggle but copies the
broken retVal/log_error pattern verbatim, so this fix is complementary
regardless of merge order.

@somaz94 somaz94 marked this pull request as ready for review June 5, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant