Adapt API changes to TGW HA config#2006
Conversation
b92bf23 to
ff04637
Compare
|
/test-all |
|
LGTM |
|
/test-all |
|
/test-all |
|
|
||
| log.Printf("[INFO] Creating TransitGateway with ID %s", id) | ||
| // Attach centralized_config as H-API child in same transaction | ||
| if cc := getCentralizedConfigFromSchema(d.Get("centralized_config")); cc != nil { |
There was a problem hiding this comment.
should cc == nil be an error?
If not we will end up adding an object without children to the H-API made below.
There was a problem hiding this comment.
cc == nil is not an error - a user can create a TGW without centralized config.
| tgw.Id = &tgwID | ||
| childTGW := model.ChildTransitGateway{ | ||
| Id: &tgwID, | ||
| ResourceType: model.ChildTransitGateway__TYPE_IDENTIFIER, |
There was a problem hiding this comment.
is this the right SDK attribute for the resource_type?
There was a problem hiding this comment.
I believe so - it's a child under org->project etc. It's similar to what we have in resource_nsxt_policy_predefined_security_policy.go.
| d.Set("span", span) | ||
| } | ||
|
|
||
| // Read centralized config via H-API |
There was a problem hiding this comment.
the following does not seem to be using h-api.
| if cfg.HaMode != nil { | ||
| m["ha_mode"] = *cfg.HaMode | ||
| } else { | ||
| m["ha_mode"] = model.CentralizedConfig_HA_MODE_ACTIVE |
There was a problem hiding this comment.
Do you believe this is the right thing to do?
From what I gathered it should not lead to a permadiff, but maybe the thing is that we will never find haMode to be nil
There was a problem hiding this comment.
We shouldn't do this, and this attribute has a default anyway...
| } | ||
| m["edge_cluster_paths"] = cfg.EdgeClusterPaths | ||
| if m["edge_cluster_paths"] == nil { | ||
| m["edge_cluster_paths"] = []string{} |
There was a problem hiding this comment.
I'm also not sure about this one.
An empty list is not the same thing as not specified.
| } | ||
|
|
||
| // createChildOrgWithTransitGatewayMarkedForDelete builds the H-API tree for delete: Org -> Project -> TransitGateway with MarkedForDelete. | ||
| func createChildOrgWithTransitGatewayMarkedForDelete(orgID, projectID, tgwID string) (*data.StructValue, error) { |
There was a problem hiding this comment.
you-know-who created another function which is exactly the same as createChildOrgWithTransitGateway with the exception of the value used for MarkedForDelete.
Is there are a good reason for this?
Transit gateway high_availability_config attribute has been replaced with centralized_config chile object with a separate API. Signed-off-by: Kobi Samoray <kobi.samoray@broadcom.com>
|
/test-all |
Transit gateway high_availability_config attribute has been replaced with centralized_config chile object with a separate API. Signed-off-by: Kobi Samoray <kobi.samoray@broadcom.com>
Transit gateway high_availability_config attribute has been replaced with centralized_config child object with a separate API.