1
0
mirror of https://github.com/ko-build/ko.git synced 2025-07-15 23:54:17 +02:00

Enable override of daemon publisher local domain (#362)

* Enable override of daemon publisher local domain

Add a `LocalDomain` field to `PublishOptions`, but no flag (yet?).

This allows use of a domain (base repo) other than `ko.local` for images
that are side-loaded to the local Docker daemon.

An alternative implementation would be to add a boolean field that
indicates that `ko publish` should use the value of the `KO_DOCKER_REPO`
environment variable (or the `DockerRepo` field in `PublishOptions`) as
the base name for images side-loaded to the local Docker daemon. I'd be
happy to get feedback on which option would work best.

* Restore NewDaemon tags positional arg
This commit is contained in:
Halvard Skogsrud
2021-05-18 01:25:47 +10:00
committed by GitHub
parent 9814e6e0e4
commit a68d0ab75f
4 changed files with 95 additions and 33 deletions

View File

@ -139,7 +139,8 @@ func makePublisher(po *options.PublishOptions) (publish.Interface, error) {
// TODO(jonjohnsonjr): I'm assuming that nobody will
// use local with other publishers, but that might
// not be true.
return publish.NewDaemon(namer, po.Tags), nil
return publish.NewDaemon(namer, po.Tags,
publish.WithLocalDomain(po.LocalDomain))
}
if repoName == publish.KindDomain {
return publish.NewKindPublisher(namer, po.Tags), nil