Skip to content

Commit

Permalink
Workaround for non-existent GH repo tags. (#6221)
Browse files Browse the repository at this point in the history
<!--
Before you open the request please review the following guidelines and
tips to help it be more easily integrated:

 - Describe the scope of your change - i.e. what the change does.
 - Describe any known limitations with your change.
- Please run any tests or examples that can exercise your modified code.

 Thank you for contributing!
 -->

### Description of the change

See #6220 for a description.

### Benefits

We can release.

### Possible drawbacks

We'll need to manually update the auto-generated PR for the upstream
change with the correct images.

### Applicable issues


- ref #6220

### Additional information

Signed-off-by: Michael Nelson <[email protected]>
  • Loading branch information
absoludity authored Apr 20, 2023
1 parent 1e4634e commit 77155ab
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions script/chart_sync_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,16 @@ replaceImage_latestToProduction() {
fi

# Get the latest tag from the bitnami repository
local tag
tag=$(curl "${curl_opts[@]}" "https://api.github.com/repos/bitnami/${repoName}/tags" | jq -r '.[0].name')
# See https://github.com/vmware-tanzu/kubeapps/issues/6220
# We may need to update to use dockerhub if we want the most recent tag
# explicitly. For now, just create the PR with the latest tag.
# local tag
# tag=$(curl "${curl_opts[@]}" "https://api.github.com/repos/bitnami/${repoName}/tags" | jq -r '.[0].name')

if [[ $tag == "" ]]; then
echo "ERROR: Unable to obtain latest tag for ${repoName}. Stopping..."
exit 1
fi
# if [[ $tag == "" ]]; then
# echo "ERROR: Unable to obtain latest tag for ${repoName}. Stopping..."
# exit 1
# fi

# Replace image and tag from the values.yaml
sed -i.bk -e '1h;2,$H;$!d;g' -re \
Expand Down Expand Up @@ -157,7 +160,7 @@ replaceImage_productionToLatest() {

# Replace image and tag from the values.yaml
sed -i.bk -e '1h;2,$H;$!d;g' -re \
's/repository: '${currentImageEscaped}'\n tag: \S*/repository: '${targetImageEscaped}'\n tag: latest/g' \
's/repository: '${currentImageEscaped}'\n/repository: '${targetImageEscaped}'\n/g' \
"${FILE}"
rm "${FILE}.bk"
}
Expand Down

0 comments on commit 77155ab

Please sign in to comment.