Skip to content

Commit 496e7c3

Browse files
committed
fix: use separate local variable when determining component tag in release workflow
Signed-off-by: Michael Zeevi <[email protected]>
1 parent e11c06e commit 496e7c3

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/release.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
echo "Managed repositories: $repos"
9191
echo "managed_repos=$(echo $repos)" >> $GITHUB_OUTPUT
9292
93-
# Extract image names with repository for components that have sourceRepository
93+
# Extract image names with repository for components that have sourceRepository
9494
images=$(yq 'to_entries | map(select(.value.sourceRepository != null) | .value.image) | join(" ")' hack/release.yaml)
9595
echo "Managed images: $images"
9696
echo "managed_images=$images" >> $GITHUB_OUTPUT
@@ -169,11 +169,17 @@ jobs:
169169
retry_count=0
170170
171171
for image in "${IMAGE_ARRAY[@]}"; do
172-
image_url="${DOCKER_REGISTRY}/${image}:${COMPONENT_TAG}"
172+
if [[ "$image" == *stig-fips ]]; then
173+
component_tag="${COMPONENT_TAG}-stig-fips"
174+
else
175+
component_tag="${COMPONENT_TAG}"
176+
fi
177+
178+
image_url="${DOCKER_REGISTRY}/${image}:${component_tag}"
173179
echo "Checking availability of: ${image_url}"
174180
175181
while [ $retry_count -lt $MAX_RETRIES ]; do
176-
if docker manifest inspect "${DOCKER_REGISTRY}/${image}:${COMPONENT_TAG}" > /dev/null 2>&1; then
182+
if docker manifest inspect "${DOCKER_REGISTRY}/${image}:${component_tag}" > /dev/null 2>&1; then
177183
echo "Image available: ${image_url}"
178184
break
179185
else
@@ -247,16 +253,18 @@ jobs:
247253
# We always need to add '-stig-fips' suffix for corresponding image version
248254
# TODO: do not DOCA Driver image for now because $SOURCE_REPO is null one Network Operator will support a new version format
249255
if [[ "$component" == *StigFips ]]; then
250-
COMPONENT_TAG="${COMPONENT_TAG}-stig-fips"
256+
component_tag="${COMPONENT_TAG}-stig-fips"
257+
else
258+
component_tag="${COMPONENT_TAG}"
251259
fi
252260
253261
echo "Updating component: $component"
254262
echo " Setting repository to: $DOCKER_REGISTRY_MANAGED_COMPONENTS"
255-
echo " Setting version to: $COMPONENT_TAG"
263+
echo " Setting version to: $component_tag"
256264
257265
# Update repository and version for components with sourceRepository
258266
yq -i ".${component}.repository = \"$DOCKER_REGISTRY_MANAGED_COMPONENTS\"" hack/release.yaml
259-
yq -i ".${component}.version = \"$COMPONENT_TAG\"" hack/release.yaml
267+
yq -i ".${component}.version = \"$component_tag\"" hack/release.yaml
260268
261269
# Pull the component's helm chart
262270
CHART_LOCATION=$(yq ".${component}.chartLocation" hack/release.yaml)

0 commit comments

Comments
 (0)