Skip to content

Conversation

@mpeddada1
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Oct 16, 2023
@mpeddada1
Copy link
Contributor Author

After adding set -o pipefail, the script is failing with the following error, as expected:

ERROR: (gcloud.container.images.describe) [gcr.io/cloud-devrel-public-resources/graalvm_a:1.6.0] is not a valid name. Expected tag in the form "base:tag" or "tag" or digest in the form "sha256:<digest>"
+ exit_status=1
+ [[ 1 = 0 ]]
+ exit 1
cleanup

@mpeddada1 mpeddada1 marked this pull request as ready for review October 16, 2023 21:14
@mpeddada1 mpeddada1 requested a review from a team as a code owner October 16, 2023 21:14
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. and removed size: s Pull request size is small. labels Oct 16, 2023
Comment on lines +38 to +39
else
exit $exit_status
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't set -o pipefail exit with the non-zero status code? I might be missing something, but Is this check needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question! Just tried it out in f48fb2d but unfortunately, it looks like we still need the check otherwise the script results in an exit 0 even when the command results in an error:

ERROR: (gcloud.container.images.describe) [:latest] digest must be of the form "sha256:<digest>".
+ exit_status=1
cleanup

[ID: 8899040] Command finished after 23 secs, exit value: 0

@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Oct 16, 2023
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. and removed size: s Pull request size is small. labels Oct 16, 2023
@mpeddada1 mpeddada1 merged commit e599bd4 into main Oct 17, 2023
@mpeddada1 mpeddada1 deleted the propagate-error branch October 17, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: xs Pull request size is extra small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants