-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add Dir
config field to ko builder
#6496
Add Dir
config field to ko builder
#6496
Conversation
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.
LGTM: a few tiny optional comments
docs/design_proposals/ko-builder.md
Outdated
// Dir is the directory where the `go` tool will be run. | ||
// The value is a directory path relative to the `context` directory. | ||
// If empty, the `go` tool will run in the `context` directory. | ||
// Example: `my-go-mod-is-in-this-dir` |
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.
I hoped to come up with a more realistic example, but I can't think of anything that is any better (live-at-head
, compat-go114
)
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.
Those are better examples, I've updated the doc.
The `Dir` config field supports users who have directory layouts where the Go sources and `go.mod` file are in subdirectories of the `context` directory. The value of `Dir` is a directory path relative to the `context` directory, and it specifies the directory where `go build` is run. This change also moves forward some of the additional ko builder flags in the implementation plan, since the relevant ko PRs have been merged.
Also change example ko builder `Dir` config values.
a1c8155
to
0cf3ab4
Compare
Codecov Report
@@ Coverage Diff @@
## main #6496 +/- ##
==========================================
- Coverage 70.43% 70.41% -0.02%
==========================================
Files 515 515
Lines 23127 23127
==========================================
- Hits 16289 16286 -3
- Misses 5780 5783 +3
Partials 1058 1058
Continue to review full report at Codecov.
|
**Description** Container images built by ko have the [author](https://github.com/opencontainers/image-spec/blob/main/config.md#properties) property set to the value [`github.com/google/ko`](https://github.com/google/ko/blob/v0.8.3/pkg/build/gobuild.go#L610). Skaffold debug can use this property to detect a Go runtime artifact. This feature can be used for images built using Skaffold's ko builder (when ready), and for images build using ko via a custom build (usable now). **Tracking**: GoogleContainerTools#6041 **Related**: GoogleContainerTools#6563 **Context**: GoogleContainerTools#6496 (comment)
**Description** Container images built by ko have the [author](https://github.com/opencontainers/image-spec/blob/main/config.md#properties) property set to the value [`github.com/google/ko`](https://github.com/google/ko/blob/v0.8.3/pkg/build/gobuild.go#L610). Skaffold debug can use this property to detect a Go runtime artifact. This feature can be used for images built using Skaffold's ko builder (when ready), and for images build using ko via a custom build (usable now). **Tracking**: #6041 **Related**: #6563 **Context**: #6496 (comment)
Description
The
Dir
config field supports users who have directory layouts where the Go sources andgo.mod
file are in subdirectories of thecontext
directory.The value of
Dir
is a directory path relative to thecontext
directory, and it specifies the directory wherego build
is run.This change also moves forward some of the additional ko builder flags in the implementation plan, since the relevant ko PRs have been merged.
Context: #6054 (comment)
Tracking: #6041
Related: #6437 #6447