-
Notifications
You must be signed in to change notification settings - Fork 405
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
Allow specifying binary path in image #1128
base: main
Are you sure you want to change the base?
Conversation
Opening for discussion, I expect we'll want e.g. some test coverage and docs. |
Codecov ReportPatch coverage:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1128 +/- ##
==========================================
+ Coverage 49.20% 49.37% +0.16%
==========================================
Files 44 44
Lines 3652 3670 +18
==========================================
+ Hits 1797 1812 +15
- Misses 1623 1626 +3
Partials 232 232
☔ View full report in Codecov by Sentry. |
This change looks pretty good to me. I think we should also support it as a flag in |
@justinsb I see |
0da27f1
to
b7eeb9b
Compare
I was trying to follow go-releaser here in terms of how this value was provided by the user. It's not a perfect match because goreleaser also adds goos and goarch, but I think that's primarily to keep things separated in the artifacts directory, and the container image does that naturally. It sounds like we do want to export the path to the binary for e.g. dlv, which we can add (not sure if a separate PR)
I added a flag I also added some tests (and note: I think the app layer test was actually checking the data layer, so I tweaked that) |
264745c
to
a11384e
Compare
What's the next step here? Any thoughts on the flag @imjasonh ? |
This Pull Request is stale because it has been open for 90 days with |
Not stale, needs review. |
This Pull Request is stale because it has been open for 90 days with |
Still needs review ... |
Previously this was hard-coded to `/ko-app/<app-name>`. go-releaser allows specifying the binary (including directory prefix); we now support the same.
The default path is /ko-app/<binaryname>, but this allows that to be changed from the command line.
a11384e
to
f22ca24
Compare
This Pull Request is stale because it has been open for 90 days with |
/reopen |
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 think we should finally bite the bullet and accept a change for this, possibly even this change.
I have one comment about the flag name, but otherwise it looks pretty good. An end-to-end test that exercised this behavior would be great, especially to get confidence about the Windows case.
The other open PR to address this request has a few more tests, if you feel inclined to port those over to this change as well.
@@ -93,6 +96,8 @@ func AddBuildOptions(cmd *cobra.Command, bo *BuildOptions) { | |||
"Path to file where the SBOM will be written.") | |||
cmd.Flags().StringSliceVar(&bo.Platforms, "platform", []string{}, | |||
"Which platform to use when pulling a multi-platform base. Format: all | <os>[/<arch>[/<variant>]][,platform]*") | |||
cmd.Flags().StringVar(&bo.BinaryPath, "binary", "", |
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.
Could we rename this to --binary-path
instead?
Previously this was hard-coded to
/ko-app/<app-name>
.go-releaser allows specifying the binary (including directory prefix);
we now support the same.