Skip to content

Commit 19b2bc4

Browse files
authored
Update preflight check logic in Makefile and GitHub Actions workflow (#328)
- Modified the `report-preflight-check-result` target in the Makefile to use `certification-component-id` instead of `certification-project-id`. - Enhanced error handling in the GitHub Actions workflow for preflight check submissions, providing clearer output and handling cases where the image may already be certified or published.
1 parent b26daee commit 19b2bc4

2 files changed

Lines changed: 25 additions & 10 deletions

File tree

.github/workflows/release-operator.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,29 @@ jobs:
9999
preflight -v
100100
make docker-push-redhat
101101
make redhat-preflight-check-image
102-
make report-preflight-check-result || {
103-
echo "::warning::Preflight submission failed - image may already be published"
104-
if [[ $? -eq 1 ]]; then
105-
echo "Image appears to be already certified, continuing..."
106-
exit 0
107-
fi
108-
exit 1
109-
}
102+
set +e
103+
preflight_output=$(make report-preflight-check-result 2>&1)
104+
exit_code=$?
105+
set -e
106+
107+
echo "$preflight_output"
108+
109+
if [[ $exit_code -ne 0 ]]; then
110+
echo "::warning::Preflight submission failed (exit code: $exit_code)"
111+
112+
# Check if the failure is due to already published image
113+
if echo "$preflight_output" | grep -i "published image can't be updated\|already published\|already certified\|cannot update published image"; then
114+
echo "::notice::Image appears to be already certified/published - this is expected for existing releases"
115+
echo "Continuing workflow as image certification is already complete"
116+
else
117+
echo "::error::Preflight submission failed with unexpected error"
118+
echo "Error output: $preflight_output"
119+
echo "Please check Red Hat certification status manually"
120+
exit 1
121+
fi
122+
else
123+
echo "::notice::Preflight submission completed successfully"
124+
fi
110125
111126
export BUNDLE_IMG=$IMAGE_TAG_BASE_QUAY-bundle:v$VERSION
112127
export CHANNELS=alpha,beta,stable

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ redhat-preflight-check-image:
162162

163163
.PHONY: report-preflight-check-result
164164
report-preflight-check-result:
165-
preflight check container ${IMG} --submit --docker-config=${HOME}/.docker/config.json --certification-project-id=${PROJECT_ID_PULSAR_RESOURCES_OPERATOR} --pyxis-api-token=${REDHAT_API_KEY}
166-
preflight check container ${IMG_LATEST} --submit --docker-config=${HOME}/.docker/config.json --certification-project-id=${PROJECT_ID_PULSAR_RESOURCES_OPERATOR} --pyxis-api-token=${REDHAT_API_KEY}
165+
preflight check container ${IMG} --submit --docker-config=${HOME}/.docker/config.json --certification-component-id=${PROJECT_ID_PULSAR_RESOURCES_OPERATOR} --pyxis-api-token=${REDHAT_API_KEY}
166+
# preflight check container ${IMG_LATEST} --submit --docker-config=${HOME}/.docker/config.json --certification-component-id=${PROJECT_ID_PULSAR_RESOURCES_OPERATOR} --pyxis-api-token=${REDHAT_API_KEY}
167167

168168
##@ Deployment
169169

0 commit comments

Comments
 (0)