Skip to content

Commit

Permalink
update network uses new update connector client method
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfmnk committed Jul 26, 2024
1 parent 55a7fd8 commit 45a9dbe
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cloudconnexa/resource_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,21 +294,15 @@ func resourceNetworkUpdate(ctx context.Context, d *schema.ResourceData, m interf
newMap := newSlice[0].(map[string]interface{})
if oldMap["name"].(string) != newMap["name"].(string) || oldMap["vpn_region_id"].(string) != newMap["vpn_region_id"].(string) {
newConnector := cloudconnexa.Connector{
Id: d.Id(),
Name: newMap["name"].(string),
VpnRegionId: newMap["vpn_region_id"].(string),
NetworkItemType: "NETWORK",
}
_, err := c.Connectors.Create(newConnector, d.Id())
_, err := c.Connectors.Update(newConnector)

Check failure on line 302 in cloudconnexa/resource_network.go

View workflow job for this annotation

GitHub Actions / lint

c.Connectors.Update undefined (type *"github.com/openvpn/cloudconnexa-go-client/v2/cloudconnexa".ConnectorsService has no field or method Update)) (typecheck)

Check failure on line 302 in cloudconnexa/resource_network.go

View workflow job for this annotation

GitHub Actions / lint

c.Connectors.Update undefined (type *"github.com/openvpn/cloudconnexa-go-client/v2/cloudconnexa".ConnectorsService has no field or method Update) (typecheck)

Check failure on line 302 in cloudconnexa/resource_network.go

View workflow job for this annotation

GitHub Actions / lint

c.Connectors.Update undefined (type *"github.com/openvpn/cloudconnexa-go-client/v2/cloudconnexa".ConnectorsService has no field or method Update)) (typecheck)
if err != nil {
return append(diags, diag.FromErr(err)...)
}
if len(oldMap["id"].(string)) > 0 {
// This can sometimes happen when importing the resource
err = c.Connectors.Delete(oldMap["id"].(string), d.Id(), oldMap["network_item_type"].(string))
if err != nil {
return append(diags, diag.FromErr(err)...)
}
}
}
}
}
Expand Down

0 comments on commit 45a9dbe

Please sign in to comment.