Skip to content

Commit

Permalink
fix(cloudauth): create gcp key only when present (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgeers authored Mar 7, 2024
1 parent 238519b commit 50a496f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sysdig/resource_sysdig_secure_cloud_auth_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func constructAccountComponents(data *schema.ResourceData) []*cloudauth.AccountC
if data.Get(SchemaCloudProviderType).(string) == cloudauth.Provider_PROVIDER_GCP.String() {
spGcp := &internalServicePrincipalMetadata{}
err = json.Unmarshal([]byte(value.(string)), spGcp)
if len(spGcp.Gcp.Key) >= 0 {
if len(spGcp.Gcp.Key) > 0 {
var spGcpKeyBytes []byte
spGcpKeyBytes, err = base64.StdEncoding.DecodeString(spGcp.Gcp.Key)
if err != nil {
Expand Down

0 comments on commit 50a496f

Please sign in to comment.