Skip to content

Commit

Permalink
Go rewrite diffs fix (GoogleCloudPlatform#11659)
Browse files Browse the repository at this point in the history
  • Loading branch information
zli82016 authored Sep 9, 2024
1 parent 924f914 commit 8c0282d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mmv1/products/securitycenterv2/ProjectMuteConfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ examples:
vars:
mute_config_id: 'my-config'
test_env_vars:
project_id: PROJECT_NAME
project_id: :PROJECT_NAME
parameters:
- !ruby/object:Api::Type::String
name: location
Expand Down
3 changes: 3 additions & 0 deletions mmv1/templates/terraform/env_var_context.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@
"{{$varKey}}": envvar.GetTestZoneFromEnv(),
{{- end }}
{{- end }}
{{- if and $.HasNewLine (gt (len $.TestEnvVars) 0)}}
{{""}}
{{- end}}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestAcc{{ $e.TestSlug $.Res.ProductMetadata.Name $.Res.Name }}(t *testing.T
t.Parallel()

context := map[string]interface{}{
{{- template "EnvVarContext" $e }}
{{- template "EnvVarContext" dict "TestEnvVars" $e.TestEnvVars "HasNewLine" false}}
{{- range $varKey, $varVal := $e.TestVarsOverrides }}
"{{$varKey}}": {{$varVal}},
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion mmv1/templates/terraform/iam/go/iam_context.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{- if $.IamPolicy.TestProjectName }}
"project_id" : fmt.Sprintf("{{ $.IamPolicy.TestProjectName }}%s", acctest.RandString(t, 10)),
{{- end }}
{{- template "EnvVarContext" $.FirstTestExample }}
{{- template "EnvVarContext" dict "TestEnvVars" $.FirstTestExample.TestEnvVars "HasNewLine" true}}
{{- if $.FirstTestExample.TestVarsOverrides }}
{{- range $varName, $override := $.FirstTestExample.TestVarsOverrides }}
"{{ $varName }}": {{ $override }},
Expand Down

0 comments on commit 8c0282d

Please sign in to comment.