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

don't fail if LDFLAGS env isn't set #758

Merged
merged 1 commit into from
Jul 8, 2022
Merged

Conversation

imjasonh
Copy link
Member

@imjasonh imjasonh commented Jul 8, 2022

Without this, if a .ko.yaml has:

builds:
- id: foo
  ldflags:
  - "{{ .Env.LDFLAGS }}"

(usually to set build-time VCS data like commit SHA, etc.)

If LDFLAGS isn't set, you'll get an error like:

Error: failed to publish images: error building "ko://blah/blah": template: argsTmpl:1:7: executing "argsTmpl" at <.Env.LDFLAGS>: map has no entry for key "LDFLAGS"

which is very annoying.

With this change, the build will succeed, without any additional -ldflags being set on the build.

@imjasonh imjasonh added this to the 0.12 milestone Jul 8, 2022
@imjasonh imjasonh requested a review from mattmoor July 8, 2022 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants