-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Context
OCM cli will fail with a unspecific error message when no docker credential helpers are in the PATH but a dockerConfigFile is referenced in the OCM credentials.
Version
v0.27.0
To Reproduce
Steps to reproduce the behavior:
Assume you have the following minimum OCM configuration file:
type: generic.config.ocm.software/v1
configurations:
- type: credentials.config.ocm.software
repositories:
- repository:
type: DockerConfig/v1
dockerConfigFile: "~/.docker/config.jsonThe component version is ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11.
The following command will work:
ocm -v get cv -o yaml ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11The following command will not work because the PATH environment variable will be empty:
PATH="" ocm -v get cv -o yaml ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11
Error: error processing "ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11": invalid component version reference "ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11": component version "ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11" is invalidOn my system if I only include /usr/local/bin in the PATH it is working again:
PATH="/usr/local/bin" ./bin/openmcp-bootstrapper-test/ocm-cli-cache/ocm get cv -o yaml ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11This is because the /usr/local/bin directory contains the docker credential helper binaries
ls /usr/local/bin
[...] docker-credential-desktop docker-credential-ecr-login docker-credential-osxkeychain [...]Actual behavior
The error message is not giving the root cause to the user but rather returns the follow-up error, which is confusing to the user:
Error: error processing "<component-reference>": invalid component version reference "<component-reference>": component version "<component-reference>" is invalidExpected behavior
The error message should include the actual root cause of the error. Something like:
OCM credential helper failed to call docker credentials helpers because of "credentials.config.ocm.software" is referencing a dockerConfigFile.
Screenshots (optional)
If applicable, add screenshots to help explain your problem.
Environment
- windows
- linux
- mac
Additional Comments
Any observation, gut feeling or other information you think help the community to troubleshoot the problem?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status