Closed ckadner closed 5 months ago
When the short hash of the most recent commit has no non-numeric characters (e.g. 7284872
) and gets used as the newTag
for building and installing the latest modelmesh-controller image, then Kubernetes interprets the value of the newTag
field as an int, rather than a string.
See this sed
command in one of the install scripts
sed -i.bak 's/newTag:.*$/newTag: '"$GIT_COMMIT_SHORT"'/' config/manager/kustomization.yaml
This will cause this error during the installation (i.e. when running FVT on IKS)
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
Check the latest git commit:
git log -1 --format=%h --abbrev=7
7284872
A git commit short hash with exclusively numeric characters happened 7 times in the past (as of 2023/12/02):
git log --format=%h --abbrev=7 | grep -E "^[0-9]+$"
7284872
4808804
4746079
0281170
1631706
5293579
4207065
Capturing this an installation error in an issue as it was a bit tricky to debug.
Core of the error message:
cannot unmarshal number into Go struct field Image.images.newTag of type string
How to reproduce it?
Assume the latest git commit short hash is composed of numeric characters exclusively, i.e.
Run:
Output:
The root cause of the error was in the
sed
command (see the swapped quotes in the before/after in the code block below).That
sed
command (or variations of it) can be found in various places. There is a fix in PR #473, but in case I missed one, or, if a similar one may get added in the future, I created this issue to save future developers some time._Originally posted by @ckadner in https://github.com/kserve/modelmesh-serving/pull/464#discussion_r1442361903_