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

Image Paths are not evaluated correctly when attempting a skopeo sync to another GitLab Instance #2461

Open
justinreddick opened this issue Nov 13, 2024 · 4 comments

Comments

@justinreddick
Copy link

justinreddick commented Nov 13, 2024

When trying to sync to another gitlab registry there was an issue encountered where the image path was not parsed correctly by skopeo. A longer image path will cause an error when attempting to sync.

customgitlab.example.com:
    images:
        gitlabgroup/repo/projectpath:
            - "latest"

The above will cause an error and skopeo will evaluate the above with customgitlab.example.com/projectpath:latest instead of the provided path for the image (customgitlab.example.com/gitlabgroup/repo/projectpath:latest).

@mtrmac
Copy link
Contributor

mtrmac commented Nov 14, 2024

Thanks for reaching out.

AFAICS this works as expected: see the documentation of --scoped, and the examples in the man page (“keeping the repository”).

If you want to report that you see an error message, please include that error message (or, in general, steps to reproduce / actual results / expected results).

@justinreddick
Copy link
Author

justinreddick commented Nov 15, 2024

Thanks for reaching out.

AFAICS this works as expected: see the documentation of --scoped, and the examples in the man page (“keeping the repository”).

If you want to report that you see an error message, please include that error message (or, in general, steps to reproduce / actual results / expected results).

Hey, thanks for the response. I don't want to keep the registry name because the domain of the registry is different, but the group structure is the same. Also, I cannot include the logs due to being in an air-gapped protected env and cannot export the logs. I'll try to give as much detail as I can as it pertains to the issue.

For example I want to transfer an image from customgitlab.example.com/<group>/<repo>/<project>:<tag> to customgitlabtwo.example.io/<group>/<repo>/<project>:<tag>

My skopeo sync command:

skopeo sync --src-tls-verify=false --dest-tls-verify=false --keep-going --debug --src yaml --dest docker mirror.yaml customgitlabtwo.example.io

The above will produce the error where the image path is evaluated as customgitlab.example.com/projectpath:latest and I will get a 401, of course, because the project is not located at this path in GitLab.

@justinreddick justinreddick changed the title Long Image Paths are not evaluated correctly when attempting a skopeo sync Image Paths are not evaluated correctly when attempting a skopeo sync to another GitLab Instance Nov 15, 2024
@mtrmac
Copy link
Contributor

mtrmac commented Nov 15, 2024

Something like skopeo sync … --src yaml mirror.yaml --dest docker customgitlabtwo.example.io/<group>/<repo> should work (assuming the intent was to write to customgitlabtwo.example.io/<group>/<repo>/<project>:<tag> and that the missing / between <repo><project> was a mistake).

That might require splitting the yaml into several ones.

Making this more general is tracked in various issues in this repo, e.g. #1998 can be a starting point.

Copy link

A friendly reminder that this issue had no activity for 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants