1
0
mirror of https://github.com/ko-build/ko.git synced 2025-11-26 22:40:38 +02:00
Commit Graph

17 Commits

Author SHA1 Message Date
Jason Hall
c9e27f0dae Update integration_test.sh 2024-05-21 11:29:50 -04:00
Nathan Mittler
7cb29ac9b8 Refactor global values to be defaults
There was recent work to add global values for `env`, `flags`, and `ldflags`. The global values would be merged with per-build values to generate the value used for the builds.

There are a couple issues with this:

- It's inconsistent with the existing code, which only has `default` values declared globally (there is no merging today).
- The name of the `flag` variable, caused a conflict with knative's `KO_FLAGS` environment variable (see #1317)

This PR does the following:

- Refactors the logic to use `defaultEnv`, `defaultFlags`, and `defaultLdflags`. This resolves both issues described above.
- Updates documentation

Fixes #1317
2024-05-21 11:29:50 -04:00
Nathan Mittler
38a1feb001 Remove vendor directory
Also adding dependency on testify to replace some hand-rolled `requireXXX` methods.
2024-05-15 12:49:39 -04:00
Nick Zavaritsky
1f6a357d8f Ko learns about Linux capabilities
Signed-off-by: Nick Zavaritsky <mejedi@gmail.com>
2024-04-03 08:51:14 -04:00
cpanato
a0cfc60910 upgrade integration_test
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-03-26 09:45:42 -04:00
Jason Hall
04cc1d5278 Update integration_test.sh 2024-03-26 09:45:42 -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
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
Matt Moore
501111b063 Bump to Go 1.16.x (#435) 2021-09-13 10:40:29 -07:00
Scott Nichols
c2b862d468 Move ko binary to root of project. (#257)
* Move ko binary to root of project.

* go.mod says required golang version is 1.14

* go install uses the folder name

* lint and copyright bump

* moving the test file changed the test hash.

* more refs of cmd/test

* add deprecation message
2020-12-22 09:31:02 -08:00
Matt Moore
d9cc0ca9ea Move the kind and integration tests to actions (#225) 2020-10-23 10:19:48 -07: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
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
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
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
Stanley Nguyen
be4e1ffdd6 [Resolves #71] Add trimpath arg to gobuild (#102)
* Add trimpath arg to gobuild

* Add build constraints for trimpath usage

* Reduce duplications across go versions

* Change trimpath fn-files for better names

* Attempt to apply with minikube on Travis

* Attempt to apply with KinD on Travis

* Install kind thru curl to not affect build
2019-11-01 10:55:03 -07:00