Skip to content

Commit

Permalink
CDPCP-10921 - GCP environment creation fails due quotes firewall rule…
Browse files Browse the repository at this point in the history
… parameters
  • Loading branch information
gregito committed Nov 16, 2023
1 parent d3c3fc7 commit f893b94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions resources/environments/converter_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions resources/environments/converter_gcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down

0 comments on commit f893b94

Please sign in to comment.