-
Bug
-
Resolution: Done
-
Undefined
-
None
-
4.12
Description of problem:
Invoking the factory -precaching-cli with the -ai-img flag set to ,,, causes the tool to panic
Version-Release number of selected component (if applicable):
telco-ran-tools:latest
How reproducible:
Invoke this command: podman run -v /mnt:/mnt -v /root/.docker:/root/.docker --privileged -it --rm quay.io/openshift-kni/telco-ran-tools:latest -- factory-precaching-cli download --ai-img ,,,quay.io/alosadag/troubleshoot --du-profile -f /mnt --hub-version -s -r WRONG_VALUE
Steps to Reproduce:
1. 2. 3.
Actual results:
panic: runtime error: index out of range [1] with length 1 goroutine 1 [running]: github.com/openshift-kni/telco-ran-tools/cmd.templatizeImageset({0x7ffd116cdce8, 0xb}, {0x7ffd116cdccf, 0x4}, {0xc000132300, 0x4, 0x4}, {0xa 42430, 0x0, 0x0}, ...) /workspace/cmd/download.go:114 +0x5a7 github.com/openshift-kni/telco-ran-tools/cmd.download({0x7ffd116cdccf, 0x4}, {0x7ffd116cdce8, 0xb}, {0x0, 0x0}, {0xc000132300, 0x4, 0x4}, {0 xa42430, ...}, ...) /workspace/cmd/download.go:246 +0x645 github.com/openshift-kni/telco-ran-tools/cmd.glob..func1(0xa0c6e0?, {0xc000210120, 0x0, 0x9}) /workspace/cmd/download.go:42 +0x2c5 github.com/spf13/cobra.(*Command).execute(0xa0c6e0, {0xc000210090, 0x9, 0x9}) /workspace/vendor/github.com/spf13/cobra/command.go:860 +0x663 github.com/spf13/cobra.(*Command).ExecuteC(0xa0cbe0) /workspace/vendor/github.com/spf13/cobra/command.go:974 +0x3b4 github.com/spf13/cobra.(*Command).Execute(...) /workspace/vendor/github.com/spf13/cobra/command.go:902 github.com/openshift-kni/telco-ran-tools/cmd.Execute() /workspace/cmd/root.go:31 +0x25 main.main() /workspace/main.go:10 +0x17
Expected results:
should exit with clear error message and exit code 1
Additional info: