-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ko build ./...
#644
Conversation
This changes `ko build` to interpret an importpath string that ends in "/..." by running `go list` and parsing its output to find `package main`s matched by that wildcard. Since `ko build` already supports passing multiple paths, this additively collects uniq matched importpaths, so this works, and produces three images for the three `package main`s in this repo: ``` ko build ./... ./cmd/... ./ ``` Matched paths are still checked if they're `package main`, so this doesn't work: ``` ko build ./... ./pkg/build ``` (because `pkg/build` isn't `package main`)
Codecov Report
@@ Coverage Diff @@
## main #644 +/- ##
==========================================
- Coverage 51.92% 51.64% -0.29%
==========================================
Files 44 44
Lines 3291 3309 +18
==========================================
Hits 1709 1709
- Misses 1371 1389 +18
Partials 211 211
Continue to review full report at Codecov.
|
``` $ ko build ./pkg/... 2022/03/11 09:47:49 error during command execution: no package main packages matched ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that seems nice and easy 👍
Integration tests fail while I'm using |
This Pull Request is stale because it has been open for 90 days with |
This Pull Request is stale because it has been open for 90 days with |
This changes
ko build
to interpret an importpath string that ends in"/..." by running
go list
and parsing its output to findpackage main
s matched by that wildcard.Since
ko build
already supports passing multiple paths, thisadditively collects uniq matched importpaths, so this works, and
produces three images for the three
package main
s in this repo:Matched paths are still checked if they're
package main
, so thisdoesn't work:
(because the explicit
pkg/build
isn'tpackage main
)This also doesn't work, because the wildcard importpath doesn't match any
package main
s:This does work, because the set of wildcard importpaths taken together matches at least one
package main
:Fixes #643
Fixes #273