-
Notifications
You must be signed in to change notification settings - Fork 780
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
WIP added implementation for scoped-without-registry support on sync #1100
base: main
Are you sure you want to change the base?
Conversation
3f89568
to
18a72aa
Compare
@c0ffee Needs a rebase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Did you try @mtrmac's suggestion in #854 (comment)? Not sure a new flag is needed. Can you elaborate why you prefer a flag over #854 (comment)?
@@ -548,6 +550,13 @@ func (opts *syncOptions) run(args []string, stdout io.Writer) error { | |||
case docker.Transport: | |||
// docker -> dir or docker -> docker | |||
destSuffix = ref.DockerReference().String() | |||
if opts.scopedWithoutRegistry { | |||
removeRegistry := func(s string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the anonymous function.
Signed-off-by: Martin Schuessler <[email protected]>
18a72aa
to
26e69f2
Compare
Yeah, I think it’s been a mistake to hard-code any naming policy in sync as a default behavior, and adding more and more options of that kind won’t make the basic mistake go away. AFAICS to this day you can’t copy $registry1/ns1/repo to $registry2/ns2/some-other-repo-name if I’m not mistaken.
|
we use this basically to synchronize some of our on-prem host registries to a merged remote one and some images use several namespaces which makes it uncomfortable from my perspective the behavior of scope is not what you would expect and this is why all these issues exists, so the best way would be to fix this, but this is not possible right? i actually like the yaml format, one nice way to use it is to check it in a repo and use it as a kind of promoting way which images should be available on the external mirror(controlled access on the repo and CI chain is using it as input) before i put now more work into this? what would be the preferred way to continue? |
For CLI, an option (sadly it has to be an option) to do no mapping and just let the user specify a destination repo, per the previous comment. For YAML, I’m not immediately sure. It would be possible to keep the existing format and add a repo map (source repo → destination repo) at the same level as the current |
I understand the concerns of not littering the CLI with all kind of options. But in this case couldn't it be said that the current way is the default way and when you want the namespace of the source repository to be respected is actually an option? So instead of --scoped-without-registry add on option --keep-namespace I understand this doesn't make the mistake go away, but it makes the tool much more useful. |
A friendly reminder that this PR had no activity for 30 days. |
@vrothberg Can you explain what the right direction would be here? |
@PG2000, that looks like a good starting point to me. |
A friendly reminder that this PR had no activity for 30 days. |
Adds support to sync 2 registries with all namespaces but without adding the registry as prefix
Fixes #1072 based on the comments of #854
Name of the commandline argument can be discussed
Help is appreciated especially for writing meaningful tests!
✔️ Code
❌ Tests
❌ Documentation