Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDPCP-10921 - GCP environment creation fails due quotes firewall rule parameters #66

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading