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

332 Commits

Author SHA1 Message Date
sbwsg
de2ce53efb
Fix issue where kubectl apply is run in place of kubectl create (#494) 2021-11-09 13:15:24 -05:00
Jason Hall
0015a81537
Enforce more lint checks, fix findings (#492) 2021-11-05 10:26:09 -07:00
Jason Hall
9821190605
Add e2e test for using ldflags to set a build-time variable (#480) 2021-11-02 17:36:05 -04:00
Jason Hall
17edbb3957
docs: Mention other deployment targets (#461) 2021-11-02 17:36:00 -04:00
Jason Hall
52d42d87a3
Document setup-ko in README.md (#484) 2021-11-02 17:35:50 -04:00
Jason Hall
1e46fdebd5
Use signal.NotifyContext and cmd.Context (#482) 2021-11-02 17:15:25 -04:00
dependabot[bot]
b1c35d29f5
Bump github.com/docker/docker (#490)
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.9+incompatible to 20.10.10+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Changelog](https://github.com/moby/moby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/docker/docker/compare/v20.10.9...v20.10.10)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-31 22:15:08 -04:00
dependabot[bot]
08dfc02f41
Bump k8s.io/apimachinery from 0.22.2 to 0.22.3 (#489)
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.22.2 to 0.22.3.
- [Release notes](https://github.com/kubernetes/apimachinery/releases)
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.22.2...v0.22.3)

---
updated-dependencies:
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-31 22:14:40 -04:00
Ben Moss
5d7673e944
Use tools/go/packages in place of go/build (#486)
* Use tools/go/packages in place of go/build

* Use build config dir

Signed-off-by: Ben Moss <benm@vmware.com>

* Use filepath.Dir in place of ".." for explicitness
2021-10-27 11:10:27 -04:00
Matthias Diester
b9f92681ba
Improve build config issue error scenario #483 (#487)
* Add build config usage log statement

There is currently no indication whether `ko` picks one of the configured
build configurations from the `.ko.yaml` configuration file for a build.

Add log statement to print the build config being picked for the build.

Introduce default entry for build config `ID` in case it is not specified.

* Add path check for build configuration settings

Add `os.Stat` to verify that the path that is configured in the build
configuration entry is valid. As a side effect, this will print out an error
message in case someone sets an import path like `github.com/google/ko` in
the `main` field of the build config.

* Fix trimpath command line flag in README

Fixed wrong command line flag `--trimpath` to `-trimpath`.
2021-10-27 11:09:41 -04:00
Halvard Skogsrud
00d0a34583 Add integration test config to repo
Add files to repo instead of dynamically generate during the integration
test.

Also document default values of `dir` and `main`.
2021-10-27 08:22:23 +11:00
Halvard Skogsrud
103ff5b2a8 Use build config Dir for all go tool commands
Ensure that the directory specified in build configs in `.ko.yaml` is
used to:

1. Load module information
2. Resolve local paths to Go import paths
3. Working directory for compilation

The change achieves this by introducing `gobuilds`, which contains a
map of import path to `build.Interface` instances. Each entry maps to a
`builds` entry from `.ko.yaml`. `gobuilds` dispatches to the builder
instances based on the requested import path, and falls back to a
default builder if there's no match.

Thanks to @jonjohnsonjr for the suggestions in
https://github.com/google/ko/issues/422#issuecomment-909408527

Also removes mutable globals in the `commands` package.

Fixes: #422
2021-10-27 08:22:23 +11:00
Carlos Alexandro Becker
6447264ff8
use github api to generate the changelog (#474)
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-10-11 14:18:08 -04:00
Jason Hall
1e3c8ae940
Document ko publish in README (#469) 2021-10-09 18:01:21 -04:00
dependabot[bot]
6230daabdd
Bump github.com/docker/docker (#466)
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.8+incompatible to 20.10.9+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Changelog](https://github.com/moby/moby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/docker/docker/compare/v20.10.8...v20.10.9)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-07 13:16:24 -04:00
dependabot[bot]
b7c9449729
Bump golang.org/x/tools from 0.1.6 to 0.1.7 (#465)
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.1.6 to 0.1.7.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.1.6...v0.1.7)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-07 13:10:44 -04:00
dependabot[bot]
7477a29d40
Bump github.com/containerd/stargz-snapshotter/estargz (#464)
Bumps [github.com/containerd/stargz-snapshotter/estargz](https://github.com/containerd/stargz-snapshotter) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/stargz-snapshotter/estargz
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-07 13:09:04 -04:00
Jason Hall
6014fcda9a
bump containerd dependency (#463) 2021-10-07 12:45:26 -04:00
Jason Hall
42723d75e7
Revert "Always produce OCI images and indexes (#449)" (#462)
This reverts commit 465eca2b93f860b212a2911f93dc9547876f898a.

This breaks pushing to quay.io.
2021-10-06 07:15:52 -04:00
Jason Hall
465eca2b93
Always produce OCI images and indexes (#449)
* Always produce OCI images and indexes

* test each constituent manifest's mediatype
2021-10-05 11:58:31 -04:00
Jason Hall
729419aebb
Add 'ko build' as a preferred alias for 'ko publish' (#456)
* Add 'ko build' as a preferred alias for 'ko publish'

* rm ko_publish.md
2021-10-05 08:48:57 -07:00
Jason Hall
dde6c6dc9b
Re-enable codeql analysis (#457) 2021-10-01 14:25:35 -04:00
Jason Hall
5ac3ef93f7
Clean filepath from zip before creating tempdir (#459) 2021-10-01 14:20:21 -04:00
Jason Hall
b9cd759f25
Don't log the value of --password if given (#458) 2021-10-01 14:19:26 -04:00
jonjohnsonjr
688ca47675
Isolate unit tests from os.Environ (#455)
Platform resolution unit tests were affected by GOARCH/GOOS. Move the
os.Environ() call out of the function under test to avoid this.
v0.9.3
2021-09-29 09:23:32 -07:00
Jason Hall
91077c8c5e
Remove Travis badge (#452) 2021-09-29 08:52:34 -07:00
Jason Hall
2adcadd918
Fix regression in adding /ko-app to PATH (#448) v0.9.2 2021-09-27 11:00:25 -04:00
Jason Hall
5a8663b58d
[ci] upgrade to Go 1.17 everywhere, clean up configs (#445)
* [ci] upgrade to go 1.17 everywhere

* remove unnecessary step names and shell:bash

gofmt with Go v1.17

* add boilerplate to hack/tools.go
2021-09-22 23:19:13 -04:00
Jason Hall
0451db7d0c
drop special behavior to support Go pre-1.13 (#446) 2021-09-22 12:59:09 -04:00
Jason Hall
08c6c716f4
Use Go 1.16+ to release (#444) v0.9.1 2021-09-21 15:21:48 -04:00
dependabot[bot]
2dced74571
Bump github.com/spf13/viper from 1.8.1 to 1.9.0 (#442)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.8.1 to 1.9.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.8.1...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
v0.9.0
2021-09-20 07:46:25 -04:00
dependabot[bot]
d5b606e919
Bump golang.org/x/tools from 0.1.5 to 0.1.6 (#441)
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.1.5 to 0.1.6.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.1.5...v0.1.6)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-20 07:26:56 -04:00
jonjohnsonjr
45467f076b
Do not require docker installed for tests (#438) 2021-09-20 07:07:56 -04:00
dependabot[bot]
e73be50bbe
Bump k8s.io/apimachinery from 0.22.0 to 0.22.2 (#440)
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.22.0 to 0.22.2.
- [Release notes](https://github.com/kubernetes/apimachinery/releases)
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.22.0...v0.22.2)

---
updated-dependencies:
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-20 07:07:21 -04:00
jonjohnsonjr
61d5250c55
Drop scary warning (#439) 2021-09-16 10:48:12 -07:00
Chmouel Boudjnah
eef795f19c
Update OpenShift instructions to point to latest (#437)
* Update the OpenShift documentation url to use latest instead of a specific version.
* Use `openshift registry info --public` to get registry public URL
2021-09-15 06:20:43 -04:00
Matt Moore
501111b063
Bump to Go 1.16.x (#435) 2021-09-13 10:40:29 -07:00
Jason Hall
35a4d2c28e
Warn that watch mode is deprecated (#434)
Also update generated markdown docs, and omit unnecessary autogenerated
bits.
2021-09-13 10:30:28 -07:00
dependabot[bot]
7f145a7e10
Bump github.com/containerd/stargz-snapshotter/estargz (#431)
Bumps [github.com/containerd/stargz-snapshotter/estargz](https://github.com/containerd/stargz-snapshotter) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/stargz-snapshotter/estargz
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-06 06:23:51 -04:00
dependabot[bot]
a965b407b2
Bump github.com/fsnotify/fsnotify from 1.4.9 to 1.5.1 (#430)
Bumps [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) from 1.4.9 to 1.5.1.
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.4.9...v1.5.1)

---
updated-dependencies:
- dependency-name: github.com/fsnotify/fsnotify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 07:41:08 -04:00
Halvard Skogsrud
1fcfd75417
Use working directory and build config dir (#427)
* Use working directory and build config `dir`

Use the working directory from `BuildOptions` to load `.ko.yaml`.

Also, use the `dir` build config field to load package information,
instead of assuming that `go.mod` is in the current working directory.

This removes the `init()` function from `./pkg/commands/config.go`.

And avoids the global viper instance, which caused some Heisenbugs (and
associated hair loss).

Fixes: #422, #424

* Return error instead of log.Fatal

`log.Fatal` is no longer needed in `loadConfig()`, since it's no longer
an `init()` function.

Also removed `log.Fatal` from `createBuildConfigMap()`.
2021-08-27 09:55:39 -07:00
Halvard Skogsrud
29fccb0832
Speed up base image unit test with local registry (#429)
Also follow my own advice to `defer Close()` 😇
2021-08-27 09:52:01 -07:00
Halvard Skogsrud
ae594dcc74
Set build config via BuildOptions (#421)
* Set build config via BuildOptions

Enables programmatically overriding build configs when ko is
embedded in another tool.

Related: #340, #419

* Use local registry for base images in unit tests

Tests create a local registry (using ggcr) with a dummy base image. This
speeds up tests, since they don't need to hit gcr.io to fetch the
default distroless base image.

* Update function comment to refer to random image
2021-08-26 09:33:01 -07:00
Jason Hall
335c1ac8a6
Delete .travis.yml (#428) 2021-08-23 08:53:53 -07:00
Halvard Skogsrud
9a256a4b19
Enable setting environment variables in .ko.yaml (#419)
* Enable setting environment variables in .ko.yaml

Matches the GoReleaser format.

Related: #340

* Use different env example
2021-08-23 08:05:01 -07:00
Halvard Skogsrud
040b7c7698
Ignore cobra auto-generate comments in doc diff (#420)
spf13/cobra inserts comments with dates in generated Markdown files.

This change makes the presubmit check ignore those comments when
verifying that ko's Markdown docs are up-to-date.

Also fixes some `shellcheck` warnings.
2021-08-19 08:47:47 -07:00
Jason Hall
780c281292
Generate Markdown docs (#414)
* Generate Markdown docs

This is largely copied from similar work in go-containerregistry

This required moving the Root command definition out of main() into a
place where it could be referenced from the gendoc tooling.

* fix boilerplate

* moar fix boilerplate

* update cmd/ko/main.go

* set -j to GOMAXPROCS at runtime

* rebase on cli-runtime change

* remove trailing whitespace
2021-08-11 13:54:13 -07:00
Jason Hall
86a7b6f4b8
Don't set image.base.name if base is specified by digest (#408)
* Don't set image.base.name if base is specified by digest

* don't set empty annotation

* annotate Results, not Images and Indexes separately

* moar cleanup

* skip annotations check for images in indexes, these won't be annotated anymore
2021-08-11 16:52:01 -04:00
Jason Hall
466dbab6c4
Remove dependency on cli-runtime (#413)
* first pass: kubectl flags must be passed after '--'

* add warning when using non-separated flags

* mark flags as deprecated

* drop defaultCacheDir and homedir dependency
2021-08-10 13:57:23 -04:00
dependabot[bot]
9f6e0d305b
Bump github.com/docker/docker (#410)
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.7+incompatible to 20.10.8+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Changelog](https://github.com/moby/moby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/docker/docker/compare/v20.10.7...v20.10.8)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-08 22:56:17 -04:00