Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odsComponentStageCopyImage fails when copying images from Nexus Artifact Repository #1119

Open
dechants opened this issue Jun 3, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@dechants
Copy link

dechants commented Jun 3, 2024

Describe the bug
I am unable to use this component with the following source image registry:
docker-group-ods.<OCP_DOMAIN>

To Reproduce

odsComponentStageCopyImage(
 context,
 [branch: 'dev',
 sourceCredential: '',
 sourceImageUrlIncludingRegistry: "docker-group-ods.<OCP_DOMAIN>/kong:3.0.1-alpine",
 tagIntoTargetEnv: false,
 verifyTLS: false]
 )

Results in:

skopeo copy --src-tls-verify=false docker://image-registry.openshift-image-registry.svc:5000/docker-group-ods.<OCP_DOMAIN>/kong:3.0.1-alpine --dest-creds openshift:eyJhbGc... docker://image-registry.openshift-image-registry.svc:5000/pames-cd/kong:3.0.1-alpine --dest-tls-verify=false

Why is image-registry.openshift-image-registry.svc:5000/ prepended to docker-group-ods.<OCP_DOMAIN>/kong:3.0.1-alpine?

Expected behavior
Here is a working example:

odsComponentStageCopyImage(
 context,
 [branch: 'dev',
 sourceCredential: '',
 sourceImageUrlIncludingRegistry: "ghcr.io/ing-bank/scruid/druid:0.18.0",
 tagIntoTargetEnv: false,
 verifyTLS: false]
 )

Results in:

skopeo copy --src-tls-verify=false docker://ghcr.io/ing-bank/scruid/druid:0.18.0 --dest-creds openshift:eyJhbGc... docker://image-registry.openshift-image-registry.svc:5000/pames-cd/druid:0.18.0 --dest-tls-verify=false

@dechants dechants added the bug Something isn't working label Jun 3, 2024
@jeronimolina
Copy link
Contributor

I've been reviewing this incident as you opened a ticket on our support queue. The problem is that the image you are looking for on the nexus docker registry it's not being found. I try to replicate it in my project which is in europe using the europe nexus cluster and at the end of the log I received the same as you + at the end of the pipeline the following:
ERROR: Could not copy `docker-group-ods.apps.eu-dev.ocp.aws.boehringer.com/kong:3.0.1-alpine', status 1

When this happens, seems that the shared library doesn't found the image and try to find it locally on openshift by default. This is the reason why is adding the "image-registry.openshift-image-registry.svc:5000/" in front of.

To solve it I checked how the nexus docker path for the image was exactly on nexus europe and I found that it was "library/kong:3.0.1" instead of only "kong:3.0.1". When I applied the correct path adding "library/kong:3.0.1-alpine" all worked fine and the log was correct again as seen here:
skopeo copy --src-tls-verify=false docker://docker-group-ods.apps.eu-dev.ocp.aws.boehringer.com/library/kong:3.0.1-alpine --dest-creds openshift:eyJhbGc...
And the pipeline succeeded. If your pipeline is in europe also try to do what I explained before, if not check that the path is correct on the nexus of the cluster where your project is as the problem point to this.

Hope this helps and adds a bit of context!

Kind regards.

@dechants
Copy link
Author

@jeronimolina can you please take a look at #1174 ?

@tbugfinder
Copy link
Contributor

This issue should be solved with #1177.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants