-
Notifications
You must be signed in to change notification settings - Fork 406
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
Allow to customize publish.Namer
#476
Comments
The There have been some discussions in the past about making the image name templatized/scriptable from the commandline, but I don't think we've ever landed on something we're happy with. If you have ideas about how you'd like this to look, that could be helpful. In the meantime, you could pass your own edit to add:
This is largely why the default naming option for |
That's not true, that By default, ko builds image name Imagine you have an app called
It's really hard to tell which ones belong to which project. Also, you can't use Of course, you could walk around the issue by managing 2 organizations on docker hub: With my proposal, (see #477) you could use different separator, and set KO_DOCKER_REPO appropriately while deploying. In the example above, that might be:
You would end up with the following images (much better IMHO):
|
* A rework of the library structure * Project builds and passes golangci-lint * Binary builds are working * In fact build for various platforms. * Tweaking the output * KO build works, tests as well * Basic KO publisher * Publishing works * LDflags for images works * Minor UI fixes * Remove changes for ko-build/ko#476
This reverts commit 6b07449.
* Allow to customize publish.Namer Fixes #476 * Removing a CLI flag for path separator * Removing ImageNameSeparator option after review
* Apply changes for ko-build/ko#476 This reverts commit 6b07449. * Adjusting code to outcome of ko-build/ko#477
Problem
Ko has a number of built-in
publish.Namer
's, but despite its public type, the code doesn't allow to influence it. Also, the built-in namers, all, use thepath.Join
which is uses/
char, which often prevents using google/ko with container registries that don't allow nested directories - a majority.https://github.com/google/ko/blob/6447264ff8b5d48aff64000f81bb0847aefc7bac/pkg/commands/options/publish.go#L119-L128
Possible solutions
I think a specific function should be used instead of
path.Join
, and maybe it should use some environmental variable to allow overriding default delimiter (/
char). It also seems to be good idea to allow providing completely custom implementation for users.The text was updated successfully, but these errors were encountered: