-
Notifications
You must be signed in to change notification settings - Fork 406
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
feat: Add global ldflags #1304
Comments
nmittler
added a commit
to nmittler/ko
that referenced
this issue
May 15, 2024
nmittler
added a commit
to nmittler/ko
that referenced
this issue
May 15, 2024
nmittler
added a commit
to nmittler/ko
that referenced
this issue
May 15, 2024
imjasonh
pushed a commit
that referenced
this issue
May 15, 2024
nmittler
added a commit
to nmittler/ko
that referenced
this issue
May 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When creating images for multiple builds (e.g. in a monorepo), the
ldflags
would have to be duplicated in each build in.ko.yaml
. This creates a lot of boilerplate and potential for inconsistencies, etc.Instead, a better experience would be to allow a global set of ldflags that will automatically be applied to each build as their generated. Additionally, they can have all the same template parameters that you would have under the build section, since they will be re-evaluated for each build.
There is one choice to make that comes to mind, however:
defaultLDFlags
: This naming would be in keeping with some other values, likedefaultBaseImage
. In this case, they would be a default that would simply be replaced ifldflags
were specified for a particular binary.ldflags
: In this case, they're simply globally ldfags that would always be prepended to any per-buildldflags
.I think I'm fine either way. Happy to discuss.
Also, I'm happy to do the work and send a PR if folks think this is a good idea.
The text was updated successfully, but these errors were encountered: