Skip to content
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

LDFLAGS is not passed to ko's build command even if it is defined in .ko.yaml #795

Closed
developer-guy opened this issue Aug 22, 2022 · 2 comments

Comments

@developer-guy
Copy link
Collaborator

We (w/@Dentrax) noticed an environment variable in .ko.yaml for passing ldflags to ko's binary. But in a workflow used for building ko's image, there is no environment variable to fill this value.

I think we can do something like the following:

LDFLAGS = "-s -w -X github.com/google/ko/pkg/commands.Version=$VERSION"
img=$(./ko build --bare --platform=all -t latest -t ${{ github.sha }} ./)
@imjasonh
Copy link
Member

#758 changed ko to not fail if the env is unset. A few of us found this to be a pretty annoying speedbump when just trying to build an image.

AFAIK if the env is set like you demonstrate above, it will be correctly passed to the build command.

Please let me know if you find this to not be the case.

@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants