From f893b947d0a9b60c8e62bcda4cc25ed1be57748e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Gergely?= Date: Thu, 16 Nov 2023 16:10:54 +0100 Subject: [PATCH] CDPCP-10921 - GCP environment creation fails due quotes firewall rule parameters --- resources/environments/converter_gcp.go | 6 +++--- resources/environments/converter_gcp_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/environments/converter_gcp.go b/resources/environments/converter_gcp.go index 02b4fe6e..3b00fc5a 100644 --- a/resources/environments/converter_gcp.go +++ b/resources/environments/converter_gcp.go @@ -43,7 +43,7 @@ func toGcpEnvironmentRequest(ctx context.Context, model *gcpEnvironmentResourceM if model.FreeIpa != nil { res.FreeIpa = &environmentsmodels.GCPFreeIpaCreationRequest{ InstanceCountByGroup: int32(model.FreeIpa.InstanceCountByGroup.ValueInt64()), - InstanceType: model.FreeIpa.InstanceType.String(), + InstanceType: model.FreeIpa.InstanceType.ValueString(), Recipes: utils.FromSetValueToStringList(model.FreeIpa.Recipes), } } @@ -57,8 +57,8 @@ func toGcpEnvironmentRequest(ctx context.Context, model *gcpEnvironmentResourceM } if model.SecurityAccess != nil { res.SecurityAccess = &environmentsmodels.GcpSecurityAccessRequest{ - DefaultSecurityGroupID: model.SecurityAccess.DefaultSecurityGroupId.String(), - SecurityGroupIDForKnox: model.SecurityAccess.SecurityGroupIdForKnox.String(), + DefaultSecurityGroupID: model.SecurityAccess.DefaultSecurityGroupId.ValueString(), + SecurityGroupIDForKnox: model.SecurityAccess.SecurityGroupIdForKnox.ValueString(), } } res.Tags = ConvertGcpTags(ctx, model.Tags) diff --git a/resources/environments/converter_gcp_test.go b/resources/environments/converter_gcp_test.go index 3293cb35..93ce2f81 100644 --- a/resources/environments/converter_gcp_test.go +++ b/resources/environments/converter_gcp_test.go @@ -53,8 +53,8 @@ func TestToGcpEnvironmentRequestSecurityAccess(t *testing.T) { result := toGcpEnvironmentRequest(context.TODO(), testObject) assert.NotNilf(t, result.SecurityAccess, "SecurityAccess is expected to be not nil") - assert.Equal(t, testObject.SecurityAccess.DefaultSecurityGroupId.String(), result.SecurityAccess.DefaultSecurityGroupID) - assert.Equal(t, testObject.SecurityAccess.SecurityGroupIdForKnox.String(), result.SecurityAccess.SecurityGroupIDForKnox) + assert.Equal(t, testObject.SecurityAccess.DefaultSecurityGroupId.ValueString(), result.SecurityAccess.DefaultSecurityGroupID) + assert.Equal(t, testObject.SecurityAccess.SecurityGroupIdForKnox.ValueString(), result.SecurityAccess.SecurityGroupIDForKnox) } func TestToGcpEnvironmentRequestLogStorage(t *testing.T) { @@ -76,7 +76,7 @@ func TestToGcpEnvironmentRequestFreeIpa(t *testing.T) { assert.NotNilf(t, result.FreeIpa, "FreeIpa is expected to be not nil") assert.Equal(t, testObject.FreeIpa.InstanceCountByGroup.ValueInt64(), int64(result.FreeIpa.InstanceCountByGroup)) assert.Equal(t, len(testObject.FreeIpa.Recipes.Elements()), len(result.FreeIpa.Recipes)) - assert.Equal(t, testObject.FreeIpa.InstanceType.String(), result.FreeIpa.InstanceType) + assert.Equal(t, testObject.FreeIpa.InstanceType.ValueString(), result.FreeIpa.InstanceType) } func createFilledGcpEnvironmentResourceModel() *gcpEnvironmentResourceModel {