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

Miscellaneous fixes in methods and tests #688

Merged
merged 4 commits into from
Jun 19, 2024
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
2 changes: 2 additions & 0 deletions .changes/v2.25.0/688-bug-fixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Fixed an error that occurred when updating an Edge Gateway configuration, with an Edge cluster configuration section
(`OpenAPIEdgeGatewayEdgeClusterConfig`). If this section was added, the update operation failed in VCD 10.6+ [GH-688]
9 changes: 9 additions & 0 deletions govcd/nsxt_edgegateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ func (vcd *TestVCD) Test_NsxtEdgeCreate(check *C) {
openApiEndpoint := types.OpenApiPathVersion1_0_0 + types.OpenApiEndpointEdgeGateways + createdEdge.EdgeGateway.ID
AddToCleanupListOpenApi(createdEdge.EdgeGateway.Name, check.TestName(), openApiEndpoint)

edgeCluster, err := nsxtVdc.GetNsxtEdgeClusterByName(vcd.config.VCD.Nsxt.NsxtEdgeCluster)
check.Assert(err, IsNil)
check.Assert(edgeCluster, NotNil)

createdEdge.EdgeGateway.EdgeClusterConfig = &types.OpenAPIEdgeGatewayEdgeClusterConfig{
PrimaryEdgeCluster: types.OpenAPIEdgeGatewayEdgeCluster{
BackingID: edgeCluster.NsxtEdgeCluster.ID,
},
}
createdEdge.EdgeGateway.Name = "renamed-edge"
updatedEdge, err := createdEdge.Update(createdEdge.EdgeGateway)
check.Assert(err, IsNil)
Expand Down
4 changes: 2 additions & 2 deletions types/v56/nsxt_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ type OpenAPIEdgeGatewayBacking struct {

// OpenAPIEdgeGatewayEdgeCluster allows users to specify edge cluster reference
type OpenAPIEdgeGatewayEdgeCluster struct {
EdgeClusterRef OpenApiReference `json:"edgeClusterRef"`
BackingID string `json:"backingId"`
EdgeClusterRef *OpenApiReference `json:"edgeClusterRef"`
BackingID string `json:"backingId"`
}

type OpenAPIEdgeGatewayEdgeClusterConfig struct {
Expand Down
Loading