1
0
mirror of https://github.com/ko-build/ko.git synced 2024-11-27 08:21:07 +02:00

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

This commit is contained in:
Jason Hall 2022-07-08 17:45:49 -04:00 committed by GitHub
parent 9139f454d7
commit 59c4264234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -1,2 +1,7 @@
baseImageOverrides:
github.com/google/ko: golang:1.17
builds:
- id: ko
ldflags:
- "{{ .Env.LDFLAGS }}"

View File

@ -638,7 +638,9 @@ func (g *gobuild) tarKoData(ref reference, platform *v1.Platform) (*bytes.Buffer
}
func createTemplateData() map[string]interface{} {
envVars := map[string]string{}
envVars := map[string]string{
"LDFLAGS": "",
}
for _, entry := range os.Environ() {
kv := strings.SplitN(entry, "=", 2)
envVars[kv[0]] = kv[1]