Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix chart_sync_utils.sh #7674

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions script/chart_sync_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,12 @@ replaceImage_latestToProduction() {
curl_opts=(-s -H "Authorization: token ${GITHUB_TOKEN}")
fi

local tags, tag

# Get the latest tag from the bitnami repository in DockerHub.
local tags
tags=$(curl "${curl_opts[@]}" "https://hub.docker.com/v2/namespaces/bitnami/repositories/${repoName}/tags" | jq -r '.results[].name' | sort -r --version-sort)

# Initialize an empty array to store the filtered tags
filtered_tags=()
local filtered_tags=()

# Read the output line by line and filter out unwanted tags (empty, "latest" and those with "sha")
while IFS= read -r tag; do
Expand All @@ -124,7 +123,7 @@ replaceImage_latestToProduction() {
done <<<"$tags"

# Get the first tag (already ordered)
tag="${filtered_tags[0]}"
local tag="${filtered_tags[0]}"

# Replace image and tag from the values.yaml
sed -i.bk -e '1h;2,$H;$!d;g' -re \
Expand Down
Loading