Skip to content

Commit

Permalink
chore: omit null defaultValue in bpmetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
rzy-goog committed Dec 18, 2023
1 parent cc4f2cf commit 89cebaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions cli/bpmetadata/int-test/goldens/golden-metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions cli/bpmetadata/tfconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 89cebaa

Please sign in to comment.