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

change: allow full K3s registry configuration #1215

Merged
merged 4 commits into from
Apr 28, 2023

Conversation

maxsargentdev
Copy link
Contributor

What

Allow rewrites configuration via config file or inline file to be reflected in generated registries.yaml file via merge.

Why

Provide rewrite functionality from k3s private registries

Implications

No impact for previous versions.

@iwilltry42
Copy link
Member

Hi @maxsargentdev thank you for this PR!
I just started working on this when I saw this incoming.
Can you try to replace the custom Registry implementation directly with https://github.com/rancher/wharfie/tree/main/pkg/registries ?
It should be fairly straightforward and we'd get rid of the registry.go file.

@maxsargentdev
Copy link
Contributor Author

Sure I will give it a go after work today :)

@iwilltry42
Copy link
Member

Hey @maxsargentdev did you have any luck yet? :)

@maxsargentdev
Copy link
Contributor Author

Sorry haven't had time yet @iwilltry42.

Feel free to take it off my hands, I will find some other area to contribute in future.

@maxsargentdev
Copy link
Contributor Author

@iwilltry42 is this still needing doing? Got some free time this week.

@iwilltry42
Copy link
Member

@maxsargentdev yes please that would be great! I played with integrating it via wharfie, but didn't actually get around 5o properly implementing it...

@maxsargentdev
Copy link
Contributor Author

Roger that will take a look over the next week.

@maxsargentdev
Copy link
Contributor Author

@iwilltry42

So I have dropped the pkg/types/k3s/registry.go containing the registry types and replaced it with a wharfie import. I have updated other references and unit tests are passing, which I would expect as not much has really changed.

Is this the change you had in mind? I have left my original change to pkg/client/registry.go to allow for rewrites.

… of config

- This will allow for passing through mirror config via the config block
- This wont allow rewrites to be configured as part of a k3d config file, only via registries.yaml (inline or not)
- Updated vendor folder with new deps pulled in by wharfie
- Replaces old registry implementation with the exact same but from ranchers wharfie project
@iwilltry42
Copy link
Member

@maxsargentdev yep, that's it!
Thank you very much for this! 🙏

@iwilltry42 iwilltry42 changed the title Add rewrites map to mirrors struct, initialize empty map for k3d side… change: allow full K3s registry configuration Apr 28, 2023
@iwilltry42 iwilltry42 merged commit dc9f050 into k3d-io:main Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants