Skip to content

Commit

Permalink
Merge pull request #166 from scoheb/RELEASE-1108
Browse files Browse the repository at this point in the history
fix(RELEASE-1108): improve error messaging
  • Loading branch information
scoheb authored Aug 20, 2024
2 parents a99d465 + 6fe2f12 commit 7425c76
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions internal-services/catalog/pulp-push-disk-images-task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ spec:
COMPONENT=$1
PULLSPEC=$(jq -er '.containerImage' <<< "${COMPONENT}")
DESTINATION="${DISK_IMAGE_DIR}/$(jq -er '.staged.destination' <<< "${COMPONENT}")/FILES" \
|| (echo Missing staged.destination value for component. This should be an existing pulp repo. Failing \
&& exit 1)
|| (echo "Missing staged.destination value for component. This should be an existing pulp repo. \
Failing" && exit 1)
mkdir -p "${DESTINATION}"
DOWNLOAD_DIR=$(mktemp -d)
cd "$DOWNLOAD_DIR"
Expand Down Expand Up @@ -197,25 +197,28 @@ spec:
process_component_for_developer_portal() { # Expected argument are [component json], [content_directory]
COMPONENT=$1
productName=$(jq -er '.contentGateway.productName' <<< "${COMPONENT}") \
|| (echo Missing contentGateway.productName value for component. This should be an existing product in the \
Developer Portal. Failing && exit 1)
productCode=$(jq -er '.contentGateway.productCode' <<< "${COMPONENT}") \
|| (echo Missing contentGateway.productCode value for component. This should be an existing product in the \
Developer Portal. Failing && exit 1)
productVersionName=$(jq -er '.contentGateway.productVersionName' <<< "${COMPONENT}") \
|| (echo Missing contentGateway.productVersionName value for component. This should be an existing product \
in the Developer Portal. Failing && exit 1)
filePrefix=$(jq -er '.contentGateway.filePrefix' <<< "${COMPONENT}") \
|| (echo Missing contentGateway.filePrefix value for component. This should be the prefix for files to \
upload to the Developer Portal. Failing && exit 1)
productName="$(jq -er '.contentGateway.productName' <<< "${COMPONENT}")" \
|| (echo "Missing contentGateway.productName value for component. This should be an existing product \
in the Developer Portal. Failing" && exit 1)
productCode="$(jq -er '.contentGateway.productCode' <<< "${COMPONENT}")" \
|| (echo "Missing contentGateway.productCode value for component. This should be an existing product \
in the Developer Portal. Failing" && exit 1)
productVersionName="$(jq -er '.contentGateway.productVersionName' <<< "${COMPONENT}")" \
|| (echo "Missing contentGateway.productVersionName value for component. This should be an existing \
product in the Developer Portal. Failing" && exit 1)
filePrefix="$(jq -er '.contentGateway.filePrefix' <<< "${COMPONENT}")" \
|| (echo "Missing contentGateway.filePrefix value for component. This should be the prefix for files to \
upload to the Developer Portal. Failing" && exit 1)
developer_portal_wrapper --debug --product-name "${productName}" \
--product-code "${productCode}" \
--product-version-name "${productVersionName}" \
--cgw-hostname "$(params.cgwHostname)" \
--content-directory "$2" \
--file-prefix "${filePrefix}" 2> "$STDERR_FILE"
--file-prefix "${filePrefix}"
}
Expand Down Expand Up @@ -268,5 +271,5 @@ spec:
NUM_COMPONENTS=$(jq '.components | length' <<< "$SNAPSHOT_JSON")
for ((i = 0; i < NUM_COMPONENTS; i++)) ; do
COMPONENT=$(jq -c --arg i "$i" '.components[$i|tonumber]' <<< "$SNAPSHOT_JSON")
process_component_for_developer_portal "$COMPONENT" "${component_destinations[$i]}"
process_component_for_developer_portal "$COMPONENT" "${component_destinations[$i]}" 2> "$STDERR_FILE"
done

0 comments on commit 7425c76

Please sign in to comment.