1
0
mirror of https://github.com/ko-build/ko.git synced 2025-02-13 19:42:26 +02:00

132 Commits

Author SHA1 Message Date
Jason Hall
27676b12d8
Merge pull request #198 from google/ImJasonH-patch-1
Fix API Versions in README.md
v0.6.0
2020-09-30 01:00:07 -04:00
Jason Hall
efbe5b7281
Merge pull request #205 from mattmoor/auto-updates/format-markdown
[Automated] Format markdown
2020-09-29 21:35:26 -04:00
Matt Moore (via Sockpuppet)
0bdf5ee792 Format markdown
Signed-off-by: Matt Moore (via Sockpuppet) <mattmoor@vmware.com>
2020-09-30 01:29:56 +00:00
Matt Moore
61fbde832a
Have kind.local test use --platform=all (#208)
Fix --platform=all with kind.local
2020-09-29 10:11:15 -07:00
Napoleon Santana
0f5a478d75
(Fix #191) Add required go version to docs (#204)
KO gives an error for the wrong go versions. The error is not very verbose.It is diffcult to decipher the logs of the error given. As a developer, adding a note to the installation process would prevent me from stumbling onto this issue.
2020-09-25 17:24:22 -07:00
jonjohnsonjr
4a4d1b02bd
Revive progress and warning logs (#203)
These got dropped when we pulled in:
https://github.com/google/go-containerregistry/pull/481

Which doesn't log by default, and requires opting in.
2020-09-25 11:50:20 -07:00
Matt Moore
d48767339f
Fix base image resolution (#201) 2020-09-25 10:20:33 -07:00
Matt Moore
5af0bc138f
Print more complete platform information. (#200)
Fixes: https://github.com/google/ko/issues/199
2020-09-25 08:51:18 -07:00
Jason Hall
5b4d3e400c
apps-v1
Fix API Versions in README.md
2020-09-25 06:04:44 -04:00
Matt Moore
b3645fa096
Add a handful of files to trigger more analyses. (#197)
`.codecov.yaml` - Enable codecov.io coverage reports
`.golangci.yaml` - Enable the enumerated checks in golangci-lint
`boilerplate.*.txt` - Enable file header boilerplate checks for these extensions
2020-09-24 20:15:21 -07:00
Matt Moore
bd3f1cb17b
[Automated] Update actions (#194)
* Update common github actions

Signed-off-by: Matt Moore (via Sockpuppet) <mattmoor@vmware.com>

* Run gofmt
2020-09-24 19:00:36 -07:00
Matt Moore
985c449e0b
Fix goimports (#196) 2020-09-24 18:39:46 -07:00
Matt Moore
8d9a4172cc
upgrade to latest dependencies (#195)
Signed-off-by: Matt Moore (via Sockpuppet) <mattmoor@vmware.com>
2020-09-24 18:34:43 -07:00
Matt Moore
33e66aca49
Remove deprecated things. (#162)
Fixes: https://github.com/google/ko/issues/158
Fixes: https://github.com/google/ko/issues/160
2020-09-24 16:14:58 -07:00
jonjohnsonjr
8b52ec2374
Multi-platform ko (#38)
🦜
2020-09-24 15:58:08 -07:00
Matt Moore
718587b3af
Add hack/update-deps.sh (#193) 2020-09-24 15:56:25 -07:00
Matt Moore
bec089d9c8
Fix k8s.io/cli-runtime "require" (#189)
The "require" is behind the version in "replace", and since cli-runtime references the package mentioned in the errors we are seeing, rule this out as a source!
2020-09-04 10:53:50 -07:00
Matt Moore
1e05e91f92
Pin k8s.io/api for good measure (#188) 2020-09-04 10:05:05 -07:00
Matt Moore
60e32d0655
Switch to go 1.14 in go.mod, test 1.15 (#187)
* Switch to go 1.14 in go.mod, test 1.15

* Fix the integration test semantics with go 1.14+
2020-09-04 09:31:01 -07:00
Markus Thömmes
64c2eef7ba
Bump Kubernetes dependencies to 1.18. (#186) 2020-09-04 08:58:35 -07:00
Markus Thömmes
1aa3b3793e
Allow images to be loaded into kind using 'kind.local'. (#180)
* Allow images to be loaded into kind using 'kind.local'.

* Add documentation for kind.
2020-09-04 08:32:26 -07:00
Matt Moore
b7b0435ef0
Format markdown using prettier. (#185) 2020-09-04 07:36:05 -07:00
Markus Thömmes
8104425e11
Update kind to the latest release. (#184) 2020-09-04 07:35:45 -07:00
Markus Thömmes
feb4443416 Format markdown using prettier. 2020-09-04 16:28:41 +02:00
Markus Thömmes
618b1631a5
Make Tarball publisher types private and return Interface. (#182) v0.5.2 2020-08-12 08:11:22 -07:00
Markus Thömmes
ecce857be6
Some small nits around the codebase to make linters happy. (#181) 2020-08-10 08:21:31 -07:00
Jon Donovan
6e4a93eee0
Add integration tests for various go mod corner cases. (#179)
* Add manual integration tests for various go mod corner cases.

* Move integration test back and actually test the outputs.

I realize now this is run in a travis CI job :) So I'll make it actually work.

* Add _, gofmt

* Add tools build constraint.

* Stop redirecting stderr

* Use local mode to support CI.
2020-08-05 12:16:28 -07:00
Matt Moore
ab4ca8ec17
Fix the other publishers (#165) 2020-05-06 13:26:22 -07:00
Matt Moore
ea2beac575
Fix -P with passing ko:// through. (#163)
Turns out I broke this.  Thanks to @bobcatfish for reporting the issue.

With this change:
```
ko resolve -Pf cmd/ko/test/test.yaml > /dev/null
2020/05/04 08:44:35 Using base gcr.io/distroless/static:nonroot for github.com/google/ko/cmd/ko/test
2020/05/04 08:44:36 Building github.com/google/ko/cmd/ko/test
2020/05/04 08:44:37 Publishing gcr.io/mattmoor-knative/github.com/google/ko/cmd/ko/test:latest
2020/05/04 08:44:39 Published gcr.io/mattmoor-knative/github.com/google/ko/cmd/ko/test@sha256:ee655510172b429dbce619fc69677621d71cb824cbbf2a21746d700127257ec4
```

I can cut v0.5.1 once this lands.
v0.5.1 v0.5.0
2020-05-04 09:06:55 -07:00
Matt Moore
d45c527750
This adds the deprecation notices for ko:// and nonroot (#161)
* Add a deprecation notice when `defaultBaseImage` is not specified.

Related: https://github.com/google/ko/issues/160

* Add a deprecation notice when `ko://` is not specified.

Related: https://github.com/google/ko/issues/158

* Add a sample import path.
2020-05-03 18:42:51 -07:00
Dave Protasowski
6cbfe964d7
[modules] Dependent command packages can now be built with ko (#154)
Thus if you have a (in)direct command package as a dependency
say `myhost.com/go/package/cmd/run` you can now publish this
with the following ko command

  ko publish myhost.com/go/package/cmd/run
2020-05-01 07:18:26 -07:00
Dave Protasowski
429a4097a7
Update .travis.yml (#156) 2020-04-30 16:27:12 -04:00
Matt Moore
ff61ea330c
Refactor how/where ko:// is handled. (#153)
This change more or less completely changes how `ko://` is handled internally to `ko`, but the user-facing changes should only be net-positive.  `ko://` was previously stripped at the highest level, and the build logic was unaware, which had some undesirable diagnostic/functional implications that are collectively addressed in this change.

With this change, the `ko://` prefix is preserved and passed to the build logic, which internally parses a new `reference` type (this was useful to have Go's type checker find all of the places that needed fixing).  The main functional differences are:
1. If a reference is prefixed with `ko://` we will now fail fast in `IsSupportedReference` regardless of whether `--strict` is passed.
2. If a reference is prefixed with `ko://` it will bypass the prefix check, which allows the use of `ko://github.com/another/repo` that references a vendored binary package.

For `2.` the absence of the module prefix causes the filtering logic Jon introduced to avoid the reference.  This was critical for efficiency when `ko://` isn't around because we feed every string in the yaml through it, but when the user has explicitly decorated things it's the perfect thing to be sensitive to.

Fixes: https://github.com/google/ko/issues/146
Fixes: https://github.com/google/ko/issues/152
2020-04-29 19:32:30 -07:00
Matt Moore
f45bc13ded
Viper keys are case insensitive. (#150)
* Viper keys are case insensitive.

This fixes an issue where import paths with uppercase (github.com/GoogleCloudPlatform 👀) were being canonicalized by Viper to all lowercase and the baseImageOverrides in `.ko.yaml` were failing to properly identify the base image.

I hit this in: https://github.com/tektoncd/pipeline/pull/2435 trying to opt some of the GCP images out of `:nonroot`.

This also adds some logging to a place where I see a lot of folks have issues with `ko` where we swallow an error.  I hit it experimenting with variants on the `ko publish` import path, and added the logging to debug.

* Drop the new log statement
2020-04-20 09:13:33 -07:00
jonjohnsonjr
3e73a508fa
go mod tidy (#141) v0.4.0 2020-03-10 09:42:26 -07:00
jonjohnsonjr
ed28755e6b
Update go-containerregistry (#140)
Pick up https://github.com/google/go-containerregistry/pull/690
2020-03-10 09:36:12 -07:00
jonjohnsonjr
acf34edd61
Rework parsing logic (#138)
Fixes #137
2020-02-25 10:12:20 -08:00
jonjohnsonjr
f9e50dc059
Update ggcr (#136) 2020-02-19 11:26:04 -08:00
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.
v0.3.0
2020-02-11 10:44:25 -08:00
jonjohnsonjr
c3a657a04b
Set AutomaticEnv for viper (#131)
This allows viper configuration to be set using environment variables
instead of just with a config file.
2020-02-06 13:51:22 -08:00
Halvard Skogsrud
ca1b2a1ded Fix: Add directory containing binary to PATH (#127)
Fixes the PATH environment variable so it contains the directory
containing the binary (i.e., /ko-app) instead of the binary itself
(e.g., /ko-app/ko).

See #114.
2020-01-28 09:15:14 -08:00
Jason Hall
f12b9e62de Document strict mode in README.md (#126) 2020-01-27 09:21:50 -08:00
jonjohnsonjr
99ecfeb5c4
Add goreleaser GitHub action (#121) v0.2.0 2020-01-24 08:44:56 -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
cezkuj
1fcfe62a96 Reorder parsing KO_DOCKER_REPO to get proper credentials (#117)
Fixes #93

With this change we support also pointing to default registry (without prefix).
Eg. KO_DOCKER_REPO=myuser
2019-12-18 09:47:56 -08:00
jonjohnsonjr
d24b60a88f
Set UA to something ko-specific (#116) 2019-12-13 15:08:52 -08:00
jonjohnsonjr
4ff72e36de
Add entrypoint to PATH (#114)
This makes it easier to invoke the binary when using a debug container.
E.g. you could invoke `ko` instead of `/ko-app/ko`.
2019-12-11 11:08:26 -08:00
jonjohnsonjr
28f239ab78
Update ggcr (#113)
Mostly to pick up media type mutation, but this includes a bunch of
other fixes.

ff1ac7f977...73724ba06b
2019-12-09 11:07:23 -08:00