-
Bug
-
Resolution: Done
-
Normal
-
4.20.0
-
Quality / Stability / Reliability
-
False
-
-
None
-
None
-
None
-
None
-
None
-
CLID Sprint 274, CLID Sprint 275
-
2
-
In Progress
-
Release Note Not Required
-
None
-
None
-
None
-
None
-
None
Description of problem:
in ImageSetConfiguration file, mirror.helm.local.path value is invalid, cause panic when mirror to disk
Version-Release number of selected component (if applicable):
4.20.0-202507271558.p2.ga71b6b0.assembly.stream.el9-a71b6b0
How reproducible:
Always
Steps to Reproduce:
1. prepare the ImageSetConfiguration file isc.yaml as the following:
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v2alpha1
mirror:
helm:
local:
- name: test-mirror-helm
path: data/test-mirror-helm-0.3.0.tgz
imagePaths:
- "{.spec.template.spec.containers[*].env[*].value}"
2. have not data folder
or have not data/test-mirror-helm-0.3.0.tgz file
or the data/test-mirror-helm-0.3.0.tgz file size is 0
3. oc-mirror -c isc.yaml file://test --v2 --log-level debug
Actual results:
$ ./oc-mirror -c isc.yaml file://test --v2 --log-level debug
2025/07/29 09:54:28 [INFO] : 👋 Hello, welcome to oc-mirror
2025/07/29 09:54:28 [INFO] : ⚙️ setting up the environment for you...
2025/07/29 09:54:28 [INFO] : 🔀 workflow mode: mirrorToDisk
2025/07/29 09:54:28 [DEBUG] : helm.New opts.SrcImage.TlsVerify true
2025/07/29 09:54:28 [DEBUG] : GetDefaultChartDownloader - lsc.Helm.insecure false
2025/07/29 09:54:28 [DEBUG] : local storage registry will log to /home/fedora/imgtest/1178/test/working-dir/logs/registry-20250729_095428.log
2025/07/29 09:54:28 [DEBUG] : starting local storage on localhost:55000
2025/07/29 09:54:28 [INFO] : 🕵 going to discover the necessary images...
2025/07/29 09:54:28 [INFO] : 🔍 collecting release images...
2025/07/29 09:54:28 [DEBUG] : [ReleaseImageCollector] setting copy option o.Opts.MultiArch=system when collecting releases image
2025/07/29 09:54:28 [DEBUG] : [CollectAll] total release images to copy 0
2025/07/29 09:54:28 [INFO] : 🔍 collecting operator images...
2025/07/29 09:54:28 [DEBUG] : [OperatorImageCollector] setting copy option o.Opts.MultiArch=all when collecting operator images
2025/07/29 09:54:28 [DEBUG] : [OperatorImageCollector] related images length 0
2025/07/29 09:54:28 [DEBUG] : [OperatorImageCollector] images to copy (before duplicates) 0
2025/07/29 09:54:28 [DEBUG] : [CollectAll] total operator images to copy 0
2025/07/29 09:54:28 [INFO] : 🔍 collecting additional images...
2025/07/29 09:54:28 [DEBUG] : [AdditionalImagesCollector] setting copy option o.Opts.MultiArch=all when collecting releases image
2025/07/29 09:54:28 [DEBUG] : [CollectAll] total additional images to copy 0
2025/07/29 09:54:28 [INFO] : 🔍 collecting helm images...
2025/07/29 09:54:28 [DEBUG] : Reading from path data1/test_mirror-helm-no.tgz
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x3189bfb]goroutine 1 [running]:
helm.sh/helm/v3/pkg/chart.(*Chart).Name(...)
/cachi2/output/deps/gomod/pkg/mod/helm.sh/helm/v3@v3.18.4/pkg/chart/chart.go:76
github.com/openshift/oc-mirror/v2/internal/pkg/helm.getImages({0xc0000ebaa0, 0x1d}, {0xc0003930a0, 0x1, 0x4463a18?})
/go/src/github.com/openshift/oc-mirror/v2/internal/pkg/helm/local_stored_collector.go:357 +0x21b
github.com/openshift/oc-mirror/v2/internal/pkg/helm.getHelmImagesFromLocalChart()
/go/src/github.com/openshift/oc-mirror/v2/internal/pkg/helm/local_stored_collector.go:227 +0x117
Expected results:
prompt error of data/test-mirror-helm-0.3.0.tgz
Additional info: