-
Notifications
You must be signed in to change notification settings - Fork 408
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
Customized image name #44
Comments
Seems it's a unattractive idea, so we still need use |
So there's the default namer, which adds a md5 hash of the repo, |
I'm afraid you are right.
|
Wouldn't it make sense to have an option that allows you to just define the image name yourself? No logic required, just like the |
This makes sense for a single image, but when publishing multiple images (e.g. I wonder if we could do something with go templates. |
I wonder if this is a case where ko could be strict but aligned with best practices and at the same time give users an easy target to hit. ko operates on executables, and (IIUC) they're always supposed to be in cmd unless the project has exactly one top-level main.go and no mains in cmd. So, the image name for a flat repository (docker, quay) could always be the "basename" of the go import used in a kube manifest: it's the name of the repo if you have one top-level main.go, and it's the package if the package is in cmd. so,
I can't prove that part of the project name ending up as part of the executable name as a kind of "stutter" is conventional, let alone best practice, but if it affords "containers as invisible infrastructure", then maybe it becomes best practice (for people with that need)? For bonus points, maybe ko could interpret replace directives in go.mod so that users didn't have to necessarily actually move files around? I don't know if that's difficult and/or adds value relative to having users move the files around and add the opposite of the replace directive they would have added if ko had this feature. I also don't know if the replace directive affords any leverage for simplifying the handling of needs for "flat and stutter executable" vs nested image repository. |
This issue is stale because it has been open for 90 days with no |
FYI, #234 may partially address this issue, and Matt revived the discussion a bit in mattmoor/mink#279. |
For now, there is two way to identify name/url of image:
-P
: The image name should begcr.io/foo/github.com/bar/baz/cmd/blah
-P
: gcr.io/foo/blahIn a docker hub based repository it's not friendly,
Firstly, option 1 is not work, since url of docker hub based repository is
repo-address/user-name/repo-name:tags
.Then if I want push images from several projects, for example:
knative
,tekton
, they all hascontroller
, the only solution to different them is add tags.So I wonder if could supply one more option to make the url of image as
project-pakcage
, likegcr.io/foo/bar-blah
The text was updated successfully, but these errors were encountered: