Skip to content

Commit

Permalink
fix: Install fails with int commit hash
Browse files Browse the repository at this point in the history
Resolves #472

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
  • Loading branch information
ckadner committed Jan 9, 2024
1 parent 739770c commit 20d00fc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/fvt-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ jobs:
kubectl get pods -n kube-system
- name: Set controller image tag
run: echo "IMAGE_TAG=$(date +'%Y%m%dT%H%M%S%Z')" >> $GITHUB_ENV
run: |
# TODO: remove this next line and reinstate the original line after that
echo "IMAGE_TAG=7284872" >> $GITHUB_ENV
# echo "IMAGE_TAG=$(date +'%Y%m%dT%H%M%S%Z')" >> $GITHUB_ENV
- name: Update configs
# Update the image tag and reduce some resource request amounts to allow FVTs to run
Expand Down
23 changes: 23 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,29 @@ if [[ $enable_self_signed_ca == "true" ]]; then
rm default/kustomization.yaml.bak
fi

# watch out when newTag has no non-numeric characters, and gets interpreted as an int, rather than srting
# sed -i.bak 's/newTag:.*$/newTag: '"$GIT_COMMIT_SHORT"'/' config/manager/kustomization.yaml
# ++ sed -i.bak 's/newTag:.*$/newTag: 7284872/' config/manager/kustomization.yaml
# Error: accumulating resources from '../manager':
# '/config/manager' must resolve to a file':
# couldn't make target for path '/config/manager':
# invalid Kustomization:
# json: cannot unmarshal number into Go struct field
# Image.images.newTag of type string
# error: no objects passed to apply
# CLI check:
# git log -1 --format=%h --abbrev=7
# 7284872
# This happened 7 times as of 2023/12/02:
# git log --format=%h --abbrev=7 | grep -E "^[0-9]+$"
# 7284872
# 4808804
# 4746079
# 0281170
# 1631706
# 5293579
# 4207065
info "kustomize build default"
kustomize build default | kubectl apply -f -

if [[ $dev_mode_logging == "true" ]]; then
Expand Down

0 comments on commit 20d00fc

Please sign in to comment.