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

Ability to remove org/project during swap - MAPS #84

Closed
M4C4R opened this issue Sep 21, 2022 · 2 comments · Fixed by #85
Closed

Ability to remove org/project during swap - MAPS #84

M4C4R opened this issue Sep 21, 2022 · 2 comments · Fixed by #85
Labels
enhancement New feature or request maps question Further information is requested swap logic

Comments

@M4C4R
Copy link
Contributor

M4C4R commented Sep 21, 2022

What would you like to be added:

The ability to do what the deprecated legacy mode can do but within the MAPS method.
Currently, I cannot see a way to reproduce what the legacy method can do, which is to transform say docker.io/a/b/c/d:v1 to quay.io/x/y/z/d:v1

Maybe we could use a new reserved keyword ([replace] in the example below) and wildcard, e.g.:

default::
[replace]quay.io*::docker.io/x/y/z

Expectation: quay.io/a/b/c/d:v1 -> docker.io/x/y/z/d:v1

The following would be equivalent, but now would not replace quay.io/a/d:v1.

default::
[replace]quay.io/a/b/*::docker.io/x/y/z

Why is this needed:

Sometimes the whole repo path needs amending, this ability appears to only be possible using legacy mode or exact matching - which is not ideal for when dealing with a large number of images.

@M4C4R M4C4R added the enhancement New feature or request label Sep 21, 2022
@phenixblue
Copy link
Owner

Ok, I think I understand this. Is this a blocker for you currently? Is this an enhancement you are wanting to contribute?

The next big enhancement for ImageSwap will be a rewrite in Golang, and moving to using an actual configuration file. This should give a lot more flexibility in how swaps are defined and we can use first-party config rather than overloaded/hacky syntax. With those intentions, I've been trying to hold off on any additional map syntax changes.

No timeline on when the rewrite would be ready. If you're wanting to do the contribution, I am inclined to allow it in before the rewrite, otherwise I would probably want to record this as a constraint in the config design going forward.

@phenixblue phenixblue added question Further information is requested swap logic maps labels Sep 26, 2022
@M4C4R
Copy link
Contributor Author

M4C4R commented Sep 27, 2022

Currently, I'm using the legacy mode, but if this is removed then it will be a blocker.
I've created a PR #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maps question Further information is requested swap logic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants