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

271 Commits

Author SHA1 Message Date
Jason Hall
c014ec1feb
disable travis arm64 builds (#395) 2021-07-26 11:52:09 -04:00
dependabot[bot]
4d17e6e284
Bump k8s.io/apimachinery from 0.20.6 to 0.21.3 (#391)
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.20.6 to 0.21.3.
- [Release notes](https://github.com/kubernetes/apimachinery/releases)
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.20.6...v0.21.3)

---
updated-dependencies:
- dependency-name: k8s.io/apimachinery
  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-07-26 09:48:01 -04:00
Jason Hall
30716ad823
Enable dependabot (#386) 2021-07-23 13:58:39 -04:00
Jason Hall
26d03e92c2
Annotate images with base image information (#354)
* WIP: annotate base images

* remove TODO

* .

* Annotate with base index digest, if based on an index

* use correct new proposed annotation
2021-07-20 15:06:08 -05:00
Jason Hall
56282bf645
Fix layout tests on macos (#384) 2021-07-15 10:16:24 -04:00
Halvard Skogsrud
8295e25f7d
Enable overriding docker client (#378)
When embedding ko, it may be necessary to override the docker client.

This adds a PublishOption to inject a docker client created elsewhere.
Ko will use this client to interact with the docker daemon.

Context: https://github.com/GoogleContainerTools/skaffold/pull/6054#discussion_r662230195
2021-07-15 07:10:52 -07:00
Jason Hall
674932fb2c
Use helm/kind-action to set up KinD cluster (#381)
Also:
- collect and upload logs as build artifacts
- don't bother testing many k8s versions
- don't checkout and install into GOPATH
- install ko from ./ to avoid warning
- remove unnecessary knative cruft
2021-07-14 20:29:27 -04:00
Jason Hall
ef45f113e8
Allow KinD e2e tests to be run manually (#380) 2021-07-14 14:00:11 -07:00
Matthias Diester
ab4d264103
Add support for Go build flags (#340)
There are use cases, where multiple Go build flags need to be set. However, the
environment variable to pass flags to Go build has some limits for `ldFlags`.

Add GoReleaser inspired configuration section to `.ko.yaml` to support setting
specific Go build and ldFlags to be used by the build. Like GoReleaser the
content of the configuration can use Go templates. Currently, only a section
for environment variables is included.

In order to reduce dependency overhead, only the respective config structs from
https://github.com/goreleaser/goreleaser/blob/master/pkg/config/config.go are
used internally to load from `.ko.yaml`.
2021-07-02 08:40:56 -07:00
Simon Kirsten
ee23538378
Add KO_DATA_DATE_EPOCH env var to set the modification time for files in kodata (#372)
* Add KO_DATA_DATE_EPOCH env var

* Add documentation for KO_DATA_DATE_EPOCH env var
2021-06-15 12:50:35 -07:00
Halvard Skogsrud
2ba8bb26d1
Enable setting the working dir for the go tool (#365)
This change adds a `WorkingDirectory` field to `options.BuildOptions`,
but doesn't expose this as a CLI flag. The default zero value means the
current working directory. The value is used as the directory for
executing `go` tool commands.

When embedding ko in other tools, it is sometimes necessary to set the
working directory for executing the `go` tool, instead of assuming the
current process working directory.

An example of where this is required from Skaffold:
https://github.com/GoogleContainerTools/skaffold/tree/master/examples/microservices

In this example, the working directory doesn't contain either `go.mod`
or any Go files. The `skaffold.yaml` configuration file specifies
a `context` field for each image, which is the directory where the `go`
tool can find package information.
2021-06-10 08:29:30 -07:00
Jason Hall
380705fd26
Document KIND_CLUSTER_NAME env var in README.md (#373) 2021-06-09 13:13:33 -04:00
jonjohnsonjr
82e899db0c
Look for ko.local in the daemon (#371)
* Look for ko.local in the daemon

* Update README
2021-06-09 09:20:45 -07:00
jonjohnsonjr
23ecf4753b
Propagate --insecure-registry to base image (#370) 2021-06-01 09:47:30 -07:00
Halvard Skogsrud
d6b3a3cba3
Enable embedding of ko publish (#348)
- 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.
2021-05-25 11:44:52 -07:00
Jason Hall
21728fdbb0
Fix typo in stale GitHub Action (#367) 2021-05-21 08:36:16 -07:00
Chun-Hung Hsiao
bc92184f85
Add a tag-only flag to publisher. (#332)
Co-authored-by: chhsia0 <chhsiao@mesosphere.io>
2021-05-17 08:26:15 -07:00
Halvard Skogsrud
a68d0ab75f
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
2021-05-17 08:25:47 -07:00
Jason Hall
9814e6e0e4
Break free from Knative actions (#364) 2021-05-16 10:32:29 -04:00
knative-automation
1b023d3020
Update actions (#363)
Signed-off-by: Knative Automation <automation@knative.team>
2021-05-12 14:34:56 -04:00
Dario Tranchitella
09aea0d50b
docs: typo on README.md (#359) v0.8.3 2021-05-10 08:27:39 -04:00
knative-automation
d5ec166882
Update actions (#355) 2021-05-06 06:26:18 -04:00
Halvard Skogsrud
516cdeec7d
Add flag and PublishOption for destination repo (#351)
* 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
2021-04-30 13:53:00 -04:00
Jason Hall
37aef60644
Remove GitHub Action (#352) 2021-04-29 14:44:34 -04:00
knative-automation
9e8023aded
Format markdown (#353)
Signed-off-by: Knative Automation <automation@knative.team>
2021-04-28 21:42:44 -04:00
Jason Hall
5395f992fc
bump ggcr dep to v0.5.0 (#349) 2021-04-28 18:08:12 -04:00
Jason Hall
938bbcdbd4
Add GitHub Action to install and setup ko (#347) 2021-04-28 16:20:08 -04:00
Chmouel Boudjnah
aeb0830048
Updating README for information on OpenShift (#346)
- Spellings and formatting from @ImjasonH

Signed-off-by: Chmouel Boudjnah <chmouel@chmouel.com>
2021-04-28 15:20:24 -04:00
Jason Hall
de98ea1b9c
Build ko for Windows (#339)
Also explicitly build for macOS (darwin), I'm not sure how that was
being done before.
2021-04-28 11:58:06 -07:00
Jason Hall
29cd8e09e9
Use cobra's RunE wherever possible (#343) 2021-04-22 12:37:42 -04:00
Jason Hall
75ab99123d
Plumb through context in kind.Tag and kind.Write (#341) 2021-04-20 15:46:17 -04:00
Jason Hall
d498734556
Merge pull request #338 from mgiessing/main v0.8.2 2021-04-10 20:37:03 -04:00
mgiessing
9d79f6c2b7
Update .goreleaser.yml 2021-04-11 01:32:26 +02:00
Jason Hall
5eef982548
Merge pull request #313 from zhouhaibing089/update-bare-comment
options: update --bare help message
2021-04-07 20:50:16 -04:00
Jason Hall
0621cbac8e
Update README.md 2021-04-07 20:49:26 -04:00
Jason Hall
866dcde0d4
Merge pull request #335 from google/ImJasonH-patch-1
Update README.md
2021-04-07 20:48:07 -04:00
Jason Hall
d050647092
Update README.md 2021-04-01 09:45:59 -04:00
Jason Hall
f5b79ffb0c
Merge pull request #333 from knative-automation/auto-updates/common-actions
[Automated] Update actions
2021-04-01 09:41:17 -04:00
Jason Hall
1d9e8e7ff6
Merge pull request #334 from knative-automation/auto-updates/format-markdown
[Automated] Format markdown
2021-04-01 09:40:38 -04:00
Knative Automation
c17d05030f Update common github actions
Signed-off-by: Knative Automation <automation@knative.team>
2021-04-01 02:00:57 +00:00
Knative Automation
b21673e547 Format markdown
Signed-off-by: Knative Automation <automation@knative.team>
2021-04-01 02:00:06 +00:00
Jason Hall
abe1433980
Merge pull request #331 from ImJasonH/base-import-paths 2021-03-31 18:46:16 -04:00
Jason Hall
c55c3fef24 Fix typo in README.md 2021-03-25 22:01:17 -04:00
Jason Hall
0b96f41240
Merge pull request #329 from knative-automation/auto-updates/common-actions
[Automated] Update actions
2021-03-18 10:27:16 -04:00
Knative Automation
e7e38b453a Update common github actions
Signed-off-by: Knative Automation <automation@knative.team>
2021-03-18 14:11:11 +00:00
Jason Hall
ee02868e32
Merge pull request #327 from knative-automation/auto-updates/common-actions
[Automated] Update actions
2021-03-11 08:49:24 -05:00
Knative Automation
9ea38a2a59 Update common github actions
Signed-off-by: Knative Automation <automation@knative.team>
2021-03-11 08:02:52 +00:00
Jason Hall
dd332573fa
Merge pull request #326 from knative-automation/auto-updates/common-actions 2021-03-08 20:55:33 -05:00
Knative Automation
146f9bcf0c Update common github actions
Signed-off-by: Knative Automation <automation@knative.team>
2021-03-09 01:54:40 +00:00
Jason Hall
f7df810619
Add --image-label to add labels to built images (#324) 2021-03-03 10:03:31 -08:00