- Export functions and a variable to enable embedding of ko's
`publish` functionality to be embedded in other tools.
See https://github.com/GoogleContainerTools/skaffold/pull/5611
- Remove DockerRepo PublishOption and flag.
This removes the `DockerRepo` config option and `--docker-repo`
flag from the PR.
New PR with the extracted config option:
https://github.com/google/ko/pull/351
- Fix copyright headers for boilerplate check.
- Use DockerRepo PublishOption instead of env var.
- Override defaultBaseImage using BuildOptions.
Remove exported package global SetDefaultBaseImage and instead
allow programmatic override of the default base image using
the field `BaseImage` in `options.BuildOptions`.
Also fix copyright header years.
- Add BuildOptions parameter to getBaseImage
This enables access to BaseImage for programmatically overriding
the default base image from `.ko.yaml`.
- Add UserAgent to BuildOptions and PublishOptions
This enables programmatically overriding the `User-Agent` HTTP
request header for both pulling the base image and pushing the
built image.
- Rename MakeBuilder to NewBuilder and MakePublisher to NewPublisher.
For more idiomatic constructor function names.
* 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
* Add flag and PublishOption for destination repo
This enables programmatically setting the destination image repository
when embedding ko's `publish` functionality in other tools.
See https://github.com/google/ko/pull/348
* Set DockerRepo PublishOption from KO_DOCKER_REPO
This enables programmatically setting the destination image repository
and avoids exposing a flag.
* Update comment on DockerRepo option
* Fix readme and copyright headers
The current `--bare` help message is a little bit confusing: It says
that it will not work with `--tags` properly, but in fact, I would
assume it means that it may not work properly instead.
With `--bare`, the name will be `${KO_DOCKER_REPO}:<tag>`.
* Refactor the publish.Namer to produce the full repo name.
* Add --naked to have image publishing use ${KO_DOCKER_REPO}:tag
* Change flag name, add disclaimer
* Create a MultiPublisher
MultiPublisher mimics io.MultiWriter in that it will publish an image to
multiple publish.Interface implementations.
* Add publish.{Tarball,Layout}Publisher
This adds support for publishing in the tarball format and to an OCI
image layout.
The tarball format isn't great, yet. It only supports writing once
instead of appending.
* Consolidate options
These were spread all over the place for no reasons. Now all the
publisher related options are grouped together.
* Add options for tarball/layout
Adds --oci-layout-path, --tarball, and --push flags.
--push=false will disable the default behavior of publishing to a
registry.
* go mod vendor
* Add Close method to publish.Interface
This allows us to defer writing to the tarball until we've collected all
the images that have been published.
* Fix tests