Skip to content
This repository was archived by the owner on Mar 11, 2023. It is now read-only.

Commit cacf920

Browse files
Merge pull request #24 from MaterializeInc/fix-buildargs-3
actually force the output to a nil rather than empty slice
2 parents 814cf54 + 470f21c commit cacf920

File tree

1 file changed

+4
-2
lines changed
  • cmd/pulumi-resource-docker-buildkit

1 file changed

+4
-2
lines changed

cmd/pulumi-resource-docker-buildkit/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func (k *dockerBuildkitProvider) dockerBuild(
274274
"--target", target,
275275
"-t", name, "--push",
276276
}
277-
buildArgs := []map[string]string{}
277+
var buildArgs []map[string]string
278278
if !inputs["args"].IsNull() {
279279
for _, v := range inputs["args"].ArrayValue() {
280280
name := v.ObjectValue()["name"].StringValue()
@@ -314,9 +314,11 @@ func (k *dockerBuildkitProvider) dockerBuild(
314314
"platforms": platforms,
315315
"contextDigest": contextDigest,
316316
"repoDigest": repoDigest,
317-
"args": buildArgs,
318317
"registryServer": registry["server"].StringValue(),
319318
}
319+
if buildArgs != nil {
320+
outputs["args"] = buildArgs
321+
}
320322
return plugin.MarshalProperties(
321323
resource.NewPropertyMapFromMap(outputs),
322324
plugin.MarshalOptions{KeepUnknowns: true, SkipNulls: true},

0 commit comments

Comments
 (0)