Skip to content

Commit

Permalink
Fix OpenAPIEdgeGatewayEdgeCluster struct (vmware#688)
Browse files Browse the repository at this point in the history
Signed-off-by: abarreiro <abarreiro@vmware.com>
  • Loading branch information
adambarreiro committed Jun 19, 2024
1 parent dd98244 commit 3d05fb3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
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

0 comments on commit 3d05fb3

Please sign in to comment.