oc-mirror v2 panics on startup when the REGISTRY_AUTH_FILE environment variable is set, which is common on Podman-based systems.
The distribution/distribution library's configuration.Parse() scans all environment variables prefixed with REGISTRY_ and attempts to unmarshal their values as YAML configuration overrides. REGISTRY_AUTH_FILE is a standard Podman/containers convention pointing to an auth.json file path, not a distribution registry config parameter. The file path string fails YAML unmarshalling, producing a broken config that causes a panic.
Steps to reproduce:
export REGISTRY_AUTH_FILE=~/.config/containers/auth.json
oc-mirror --v2 --config ./isc.yaml --workspace file:///tmp/workspace docker://registry.example.com/mirror
Expected:
oc-mirror runs normally, using REGISTRY_AUTH_FILE for authentication.
Actual:
[ERROR] : parsing config error parsing local storage configuration : parsing environment variable REGISTRY_AUTH_FILE: yaml: unmarshal errors:
line 1: cannot unmarshal !!str `/home/u...` into configuration.Parameters
panic: StorageDriver not registered:
goroutine 1 [running]:
github.com/distribution/distribution/v3/registry/handlers.NewApp(...)
.../registry/handlers/app.go:131
...
github.com/openshift/oc-mirror/v2/internal/pkg/cli.(*ExecutorSchema).setupLocalStorage(...)
.../internal/pkg/cli/executor.go:731
Workaround:
unset REGISTRY_AUTH_FILE before running oc-mirror, and pass --authfile explicitly instead.
oc-mirror v2 panics on startup when the REGISTRY_AUTH_FILE environment variable is set, which is common on Podman-based systems.
The distribution/distribution library's configuration.Parse() scans all environment variables prefixed with REGISTRY_ and attempts to unmarshal their values as YAML configuration overrides. REGISTRY_AUTH_FILE is a standard Podman/containers convention pointing to an auth.json file path, not a distribution registry config parameter. The file path string fails YAML unmarshalling, producing a broken config that causes a panic.
Steps to reproduce:
Expected:
oc-mirror runs normally, using REGISTRY_AUTH_FILE for authentication.
Actual:
Workaround:
unset REGISTRY_AUTH_FILE before running oc-mirror, and pass --authfile explicitly instead.