Commit Graph
234 Commits
Author SHA1 Message Date
Matt Moore c6dc504a60 Fix: Incorporate platform architecture (#1029)
🐛 Right now `--sbom-dir` with a multi-arch build just writes the same file over and over.

This loosely follows the lead of apko which uses the form `sbom-{arch}.{form}.json`, but we are going with: `{app}-{platform}.{form}.json`.

It is notable that `{platform}` is a superset of `{arch}` and we sanitize the string encoding replacing the `/` and `:` characters with `-`.

/kind bug
2023-05-01 10:32:09 -04:00
Jon Johnson 6284661a61 Fix --local with KO_DOCKER_REPO (#1017) 2023-04-21 20:43:50 -04:00
Jon Johnson 6a1169b0a5 Add context to many gobuild errors (#1016) 2023-04-21 20:23:30 -04:00
Jon Johnson a42d0f2068 Don't publish tags twice (#1010) 2023-04-18 14:09:33 -04:00
Jon Johnson 657cd9466a Push images faster (#1005) 2023-04-07 13:33:24 -04:00
Felix Yan 427beff447 Correct a typo in resolver.go (#989) 2023-03-18 08:37:44 -04:00
Carlos Tadeu Panato Junior 4cde944f30 Upgrade to go120 (#984)
* upgrade to use go1.20

Signed-off-by: cpanato <ctadeu@gmail.com>

* bump go module to require minimum go1.19

Signed-off-by: cpanato <ctadeu@gmail.com>

* fix gofmt

Signed-off-by: cpanato <ctadeu@gmail.com>

* update base image

Signed-off-by: cpanato <ctadeu@gmail.com>

---------

Signed-off-by: cpanato <ctadeu@gmail.com>
2023-03-14 10:35:54 -04:00
Batuhan Apaydın 8e075ae1f1 fix file extension for cyclonedx (#974)
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
2023-03-09 08:33:12 -05:00
Jason Hall 11670b7498 fix: handle docker's unknown/unknown platform in index manifests (#975) 2023-03-08 17:09:49 -05:00
Michael GaschandJason Hall f6025f951e feat: Add KO_GO_PATH env var (#930)
* feat: Add KO_GO_BIN env var

Closes: #926
Signed-off-by: Michael Gasch <15986659+embano1@users.noreply.github.com>

* Update docs/configuration.md

Signed-off-by: Michael Gasch <15986659+embano1@users.noreply.github.com>
Co-authored-by: Jason Hall <jason@chainguard.dev>
2023-01-19 15:02:34 -05:00
Jason Hall 18d3a82e3b remove 'ko deps' (#937) 2023-01-18 13:18:19 -05:00
Jason Hall 76f46cc1d1 upgrade to cosign v2.0.0-rc.0 (#933) 2023-01-16 11:42:41 -05:00
Jason Hall 453bf803e3 fix KO_CONFIG_PATH pointing to a file (#923)
* fix KO_CONFIG_PATH pointing to a file

* make test pass
2023-01-11 14:33:17 -05:00
Jason Hall ffe5ac0071 update docs to reflect actual base image (#903) 2022-12-22 15:03:52 -05:00
Carlos Alexandro Becker ff69e17d10 fix: possible race condition when applying templates to flags/ldflags (#913)
* fix: possible race condition when applying templates to flags/ldflags

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: wrong param order

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-12-22 14:55:01 -05:00
Reto Lehmann 7dc51c0cf6 Add option to configure default platforms (#897) 2022-12-12 10:07:39 -05:00
Jason Hall f70e3cad38 bump ggcr and handle breaking change (#866) 2022-11-09 12:17:09 -05:00
Jason Hall 32f68f3c3a nit: replace one-item slice with const (#885) 2022-11-09 11:53:53 -05:00
Nico Braun 5f75bcfe82 feat: deduplicate tags (#884)
Signed-off-by: Nico Braun <rainbowstack@gmail.com>

Signed-off-by: Nico Braun <rainbowstack@gmail.com>
2022-11-09 09:55:32 -05:00
Jason Hall e03e4448be Handle KO_DOCKER_REPO=ko.local/repo and --bare correctly (#820)
* Handle KO_DOCKER_REPO=ko.local/repo and --bare correctly

* support ko.local/foo for other namers too

* more robust defaulting
2022-10-19 16:16:37 -04:00
Jason Hall 43cdbd25fb update docs: fix broken links, align with README (#854)
* update docs: fix broken links, align with README

* update google/ko references that can be updated
2022-10-18 14:30:34 -04:00
Jason Hall 3f08dc235d truncate -image-refs file (#855) 2022-10-18 13:47:23 -04:00
Batuhan Apaydın e93dbee854 feat: add keychain instead of auth to fix different repository problem (#821)
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>

Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
2022-09-21 15:12:54 -04:00
Batuhan Apaydın 5e0452ad67 feat: write sbom result to disk (#822)
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>

Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
2022-09-20 16:44:54 -04:00
Jason Hall f9775dcf6b Support --tag and --tag-only with nop publisher (#797)
* Support --tag and --tag-only with nop publisher

* log the output, for debugging

* unset KO_DOCKER_REPO for push=false test

* run e2e test first before other stuff

* review feedback
2022-08-24 10:57:52 -04:00
Jason Hall 568da167be Extend ko.local and kind.local detection to include sub-repos (#796) 2022-08-22 19:51:02 -04:00
Ben Moss cbe2784e52 Error if image platform does not match desired (#785) 2022-08-19 17:19:55 -04:00
Jason Hall 6bda550899 update default base image to distroless.dev/static (#790) 2022-08-18 12:00:41 -04:00
Josh Wolf f9b4471f65 expose commands.ResolveFilesToWriter() method to allow downstream (#787)
consumers more easily leverage `ko resolve` functionality through public apis
2022-08-12 15:45:50 -04:00
Jason Hall ccddbb800e Add kind e2e test for ko run (#779) 2022-07-22 17:21:16 -04:00
Jason Hall 2f230b88c4 Set layer media types consistently (#776)
* Set layer media types consistently

* Also test that base image mediaType is not changed
2022-07-21 15:04:34 -04:00
Jason Hall 562039fc7a Deprecate ko deps (#770)
* Deprecate ko deps and ko run

* update-codegen.sh

* delete docs for deprecated stuff

* update deprecation message for ko run

* un-deprecate ko run

* add doc/ko_run.md
2022-07-21 15:04:23 -04:00
jonjohnsonjr d32cfff9eb Remove redundant return path (#774) 2022-07-21 06:30:16 -04:00
Jason Hall 2336bb5cb2 ko run: remove --generator flag (#751)
* ko run: remove --generator flag

* ignore dashes when passing args to kubectl

* avoid panic
2022-07-13 16:55:31 -04:00
Jason Hall d108e694ed Reject the -toolexec flag (#752) 2022-07-13 16:35:20 -04:00
Jason Hall ca1648dcbf remove deprecated k8s flags support (#750) 2022-07-13 16:29:54 -04:00
Matt Moore 8f228585b9 Have --image-refs list all images for multi-arch builds. (#761)
* Have `--image-refs` list all images for multi-arch builds.

This change alters the behavior of `--image-refs` to also include all of the image references when a multi-architecture build is being performed.

* Add test coverage for the new path

* Add ref count check to unit test
2022-07-12 09:06:42 -07:00
Matt Moore bd8cfaa245 Decorate per-architecture images with base image annotations. (#759)
* Decorate per-architecture images with base image annotations.

Currently we only decorate the topmost index/image with base image data for the base index/image (for everything except docker manifest lists).

This change makes multi-arch builds decorate the manifest of the per-architecture images with the reference of the base index, and the digest of the specific base image used for that particular architecture's image.

This results in the per-architecture SBOMs starting to encode `DESCENDENT_OF` links as well.

* Add a detailed comment outlining why the per-arch digest is preferable even for cases where we want to watch the base index for updates.
2022-07-11 12:18:25 -07:00
Jason Hall 59c4264234 don't fail if LDFLAGS env isn't set (#758) 2022-07-08 14:45:49 -07:00
Matt Moore 2299765c54 Start emitting multi-arch SBOMs for SPDX with ko (#743)
This plumbs through support for building multi-arch SPDX SBOMs largely based on Puerco's outline, but with a few
adaptations.  I added a few minor refactorings to try to enable consistency across the Image/Index SBOMs.

Related: https://github.com/google/ko/issues/655
2022-07-05 12:47:15 -07:00
Matt Moore 787d625019 Unconditionally set the base image annotation. (#745)
* Unconditionally set the base image annotation.

Previously we only set this annotation when our base image was a tag, but this means when folks actually follow the best practice of use digest base images they get strictly worse resulting images!

It sounds like maybe the original motivation for this condition was that it was supposed to contain the mutable reference (tag), but I don't see anything detailing such a restriction (just an example), so there should be nothing
precluding this from the spec.

* Fold assignment into map initialization.
2022-07-05 11:17:28 -07:00
Matt Moore 12e5001192 Convert our SPDX SBOMs to spdx+json. (#740) 2022-07-01 07:13:30 -07:00
Jason Hall a61e14dc6a Update base image to ghcr.io/distroless/static:latest (#737)
* Update base image to ghcr.io/distroless/static:latest

* Add more logging to e2e for windows

* skip timezone conversion on Windows
2022-06-30 15:12:39 -04:00
Ben Moss be76051d44 Allow KO_CONFIG_PATH to point to a file (#731) 2022-06-16 15:21:29 -04:00
Jason Hall 1a5551d10a build: Imply current import path (#717)
* build: Imply current import path

* update generated docs
2022-06-15 23:51:40 -04:00
Sean Liao eaba2b8aee allow refs-file to be read by other users (#723) 2022-06-10 20:29:55 -04:00
Carlos Tadeu Panato Junior c08133d9a8 check if have all and other platforms set in the --platform flag (#630)
* check if have all and other platforms set in the --platform flag

Signed-off-by: cpanato <ctadeu@gmail.com>

* update per feedback

Signed-off-by: cpanato <ctadeu@gmail.com>
2022-06-06 09:02:52 -04:00
Jason Hall e4a01f683f Bump deps to silence security alerts (#667)
* Update dependencies

* Fix cosign breakage

* ignore vendor for misspell

* Configure woke to ignore vendor and some usages
2022-06-01 09:49:42 -04:00
Carlos Tadeu Panato Junior aff9be76f1 add warning when using both --local and KO_DOCKER_REPO to ko.local (#629)
Signed-off-by: cpanato <ctadeu@gmail.com>
2022-06-01 07:28:38 -04:00
Jason Hall 691da5afb6 Use sync.Map to cache base image lookups (#712) 2022-05-25 12:42:45 -04:00