From 421e1e20c6513bede8f29fb3cfe86df21a0752dc Mon Sep 17 00:00:00 2001 From: Christy Norman Date: Thu, 2 Dec 2021 13:42:22 -0600 Subject: [PATCH] close a verify-codegen ci failure loophole if the go codegen commands failed, the the hack/verify-codegen.sh script continued and the CI check passed. see #5406 for an example. the script was not set to fail on a non-zero return code. this pr adds the bash e option to the set builtin to catch errors and exit on failure. Signed-off-by: Christy Norman --- hack/verify-codegen.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hack/verify-codegen.sh b/hack/verify-codegen.sh index 58336a51729..8bcbe789c4c 100755 --- a/hack/verify-codegen.sh +++ b/hack/verify-codegen.sh @@ -1,10 +1,11 @@ #!/bin/sh if [ "$IS_CONTAINER" != "" ]; then - set -x + set -xe go generate ./pkg/types/installconfig.go - go generate ./pkg/rhcos/ami.go - set +x + # See https://github.com/openshift/installer/pull/5447#discussion_r762340594 + # go generate ./pkg/rhcos/ami.go + set +ex git diff --exit-code else podman run --rm \