From 89cebaa1b71b66844493616ae30c2e7a0a97d5b9 Mon Sep 17 00:00:00 2001 From: Ray Zhang Date: Mon, 18 Dec 2023 08:34:52 +0000 Subject: [PATCH] chore: omit null defaultValue in bpmetadata --- cli/bpmetadata/int-test/goldens/golden-metadata.yaml | 2 -- cli/bpmetadata/tfconfig.go | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cli/bpmetadata/int-test/goldens/golden-metadata.yaml b/cli/bpmetadata/int-test/goldens/golden-metadata.yaml index 5abd4a21311..814422849c2 100644 --- a/cli/bpmetadata/int-test/goldens/golden-metadata.yaml +++ b/cli/bpmetadata/int-test/goldens/golden-metadata.yaml @@ -151,7 +151,6 @@ spec: - name: names description: Bucket name suffixes. varType: list(string) - defaultValue: null required: true - name: prefix description: Prefix used to generate the bucket name. @@ -160,7 +159,6 @@ spec: - name: project_id description: Bucket project id. varType: string - defaultValue: null required: true - name: public_access_prevention description: Prevents public access to a bucket. Acceptable values are inherited or enforced. If inherited, the bucket uses public access prevention, only if the bucket is subject to the public access prevention organization policy constraint. diff --git a/cli/bpmetadata/tfconfig.go b/cli/bpmetadata/tfconfig.go index b22bd1a1fe5..503f10a43fb 100644 --- a/cli/bpmetadata/tfconfig.go +++ b/cli/bpmetadata/tfconfig.go @@ -231,12 +231,12 @@ func getBlueprintVariable(modVar *tfconfig.Variable) *BlueprintVariable { Required: modVar.Required, VarType: modVar.Type, } - - vl, err := structpb.NewValue(modVar.Default) - if err == nil { - v.DefaultValue = vl + if modVar.Default != nil { + vl, err := structpb.NewValue(modVar.Default) + if err == nil { + v.DefaultValue = vl + } } - return v }