1
0
mirror of https://github.com/ko-build/ko.git synced 2024-12-12 08:54:09 +02:00
Commit Graph

11 Commits

Author SHA1 Message Date
jonjohnsonjr
3c6a907da9
Add additional output formats (tarball and layout) (#134)
* 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
2020-02-19 09:30:01 -08:00
jonjohnsonjr
cfd680de28
Deterministically fail ko {apply, create} (#133)
When resolving files, we would just log.Fatal if we encountered an
error. This seems to be racy and causes ko to exit with a 0 error code
when it shouldn't. To fix this, we synchronize the builder goroutines
with the kubectl go routine and exit with an error if either of them
failed.

This fix also happened to fix a goroutine leak. If the kubectl goroutine
failed, we never properly cancelled the builds, which would happily
conitnue compiling packages and consuming resources.
2020-02-11 10:44:25 -08:00
Daniel Helfand
2e28671384 add kubectl check for ko delete, apply, and create (#120) 2020-01-16 13:27:43 -08:00
jonjohnsonjr
b7e1a7fdbc
Update ggcr dependency (#119)
* Update ggcr dependency

I had to move genericclioptions to k8s.io/cli-runtime

* bump client-go

* usePersistentConfig=false
2020-01-15 13:16:11 -08:00
Stanley Nguyen
1c54dd6b3e Add context to go build (#105) 2019-11-09 09:23:09 -08:00
jonjohnsonjr
99a587ede5
Add build.Limiter (#79)
* Add build.Limiter

You can limit the number of concurrent builds with -j (a la make).

The default value for this is GOMAXPROCS, which seems reasonable.
2019-09-11 10:07:02 -07:00
Jason Hall
3315663a21 Remove strictness checks from build, into resolve
Strictness has nothing to do with building, and is independent of how
images are built (fixed builder, some future exotic builder type, etc.)
2019-08-15 14:22:45 -04:00
Jason Hall
4342ceff74 Implement "strict mode"
When ko is invoked in this mode, import paths must have the `ko://`
prefix. If a human marks an import path with `ko://` and ko can't
resolve the resulting import path, it fails. In "loose mode", such an
import path would be silently ignored and passed on to the resolved
YAML, often resulting in invalid image names (e.g., `image:
github.com/foo/bar`)

In loose mode, `ko://` prefixes are always ignored for
backward-compatibility.
2019-08-15 09:45:59 -04:00
Scott Weiss
0c205ab8e4 add selector flag and logic (#46)
* add selector flag and logic

* comments, cleanup

* add readme note for selector flag

* preserve comments, fix nits

* readme nit
2019-06-27 13:55:47 -07:00
jonjohnsonjr
cef9764e3d
Return better error messages (#33)
This hoists the publisher creation out of the loop for `ko publish` to
avoid needlessly resolving credentials multiple times.

This pulls the publisher creation outside of resolveFilesToWriter so we
can fail earlier if e.g. KO_DOCKER_REPO is unset, otherwise we start up
the kubectl goroutine and it would asynchronously fail with:

  error: no objects passed to apply
2019-04-30 13:08:54 -05:00
Scott Nichols
7c4a93a717 Adding create. (#30) 2019-04-26 16:28:22 -07:00