Skip to content

Commit 8718f3b

Browse files
Merge pull request #155 from stuggi/branch_images
Update default_images.yaml on openstack-operator release branch
2 parents c9ebcd7 + be7d5cd commit 8718f3b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/create-release-branch-v1.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,38 @@ jobs:
415415
echo "No Makefile found."
416416
fi
417417

418+
# Special handling for openstack-operator: update default_images.yaml
419+
if [[ "$repo_name" == "openstack-operator" ]]; then
420+
DEFAULT_IMAGES_FILE="config/operator/default_images.yaml"
421+
if [ -f "${DEFAULT_IMAGES_FILE}" ]; then
422+
echo "Updating ${DEFAULT_IMAGES_FILE} for release branch ${BRANCH_NAME}..."
423+
# Update specific images to use the release branch tag
424+
if ! sed -i -E "s|(quay\.io/openstack-k8s-operators/openstack-ansibleee-runner):latest|\1:${BRANCH_NAME}-latest|g" "${DEFAULT_IMAGES_FILE}"; then
425+
handle_repo_error "${repo_name}" "Failed to update openstack-ansibleee-runner in ${DEFAULT_IMAGES_FILE}" "$TEMP_DIR"
426+
fi
427+
if ! sed -i -E "s|(quay\.io/openstack-k8s-operators/openstack-baremetal-operator-agent):latest|\1:${BRANCH_NAME}-latest|g" "${DEFAULT_IMAGES_FILE}"; then
428+
handle_repo_error "${repo_name}" "Failed to update openstack-baremetal-operator-agent in ${DEFAULT_IMAGES_FILE}" "$TEMP_DIR"
429+
fi
430+
if ! sed -i -E "s|(quay\.io/openstack-k8s-operators/openstack-must-gather):latest|\1:${BRANCH_NAME}-latest|g" "${DEFAULT_IMAGES_FILE}"; then
431+
handle_repo_error "${repo_name}" "Failed to update openstack-must-gather in ${DEFAULT_IMAGES_FILE}" "$TEMP_DIR"
432+
fi
433+
434+
# Check if there are changes to commit and push
435+
if ! git diff --quiet -- "${DEFAULT_IMAGES_FILE}"; then
436+
echo "Changes detected in ${DEFAULT_IMAGES_FILE}"
437+
# FAIL if commit and push fails
438+
if ! commit_and_push "[${BRANCH_NAME}] Update default images for ${BRANCH_NAME}" "${DEFAULT_IMAGES_FILE}" "${BRANCH_NAME}"; then
439+
handle_repo_error "${repo_name}" "Failed to commit and push ${DEFAULT_IMAGES_FILE} changes" "$TEMP_DIR"
440+
fi
441+
BRANCH_PUSHED=true
442+
else
443+
echo "No changes detected in ${DEFAULT_IMAGES_FILE}."
444+
fi
445+
else
446+
echo "No ${DEFAULT_IMAGES_FILE} found in ${repo_name}."
447+
fi
448+
fi
449+
418450
# Push the branch if it wasn't already pushed via commit_and_push
419451
if [ "$BRANCH_PUSHED" = "false" ]; then
420452
echo "Pushing branch ${BRANCH_NAME} without Makefile changes."

0 commit comments

Comments
 (0)