Skip to content

Commit

Permalink
add fields introduced in ACI-CNI 5.2.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fpants authored and Anna Blendermann committed Aug 16, 2022
1 parent dd573a6 commit d943312
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 126 deletions.
11 changes: 11 additions & 0 deletions docs/resources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -1015,13 +1015,18 @@ The following attributes are exported:

* `aep` - (Required) Attachable entity profile (string)
* `apic_hosts` - (Required) List of APIC hosts to connect for APIC API (list)
* `apic_refresh_ticker_adjust` - (Optional) APIC refresh ticker adjust amount (string)
* `apic_refresh_time` - (Optional) APIC refresh time in seconds (string)
* `apic_subscription_delay` - (Optional) APIC subscription delay amount (string)
* `apic_user_crt` - (Required/Sensitive) APIC user certificate (string)
* `apic_user_key` - (Required/Sensitive) APIC user key (string)
* `apic_user_name` - (Required) APIC user name (string)
* `capic` - (Optional) cAPIC cloud (string)
* `controller_log_level` - (Optional) Log level for ACI controller (string)
* `disable_periodic_snat_global_info_sync` - (Optional) Whether to disable periodic SNAT global info sync (string)
* `disable_wait_for_network` - (Optional) Whether to disable waiting for network (string)
* `drop_log_enable` - (Optional) Whether to enable drop log (string)
* `duration_wait_for_network` - (Optional) The duration to wait for network (string)
* `extern_dynamic` - (Required) Subnet to use for dynamic external IPs (string)
* `enable_endpoint_slice` - (Optional) Whether to enable endpoint slices (string)
* `encap_type` - (Required) Encap type: vxlan or vlan (string)
Expand All @@ -1042,11 +1047,15 @@ The following attributes are exported:
* `max_nodes_svc_graph` - (Optional) Max nodes in service graph (string)
* `mcast_range_end` - (Required) End of mcast range (string)
* `mcast_range_start` - (Required) Start of mcast range (string)
* `mtu_head_room` - (Optional) MTU head room amount (string)
* `multus_disable` - (Optional) Whether to disable Multus (string)
* `no_priority_class` - (Optional) Whether to use priority class (string)
* `node_pod_if_enable` - (Optional) Whether to enable node pod interface (string)
* `node_subnet` - (Required) Subnet to use for nodes (string)
* `ovs_memory_limit` - (Optional) OVS memory limit (string)
* `opflex_log_level` - (Optional) Log level for ACI opflex (string)
* `opflex_client_ssl` - (Optional) Whether to use client SSL for Opflex (string)
* `opflex_device_delete_timeout` - (Optional) Opflex device delete timeout (string)
* `opflex_mode` - (Optional) Opflex mode (string)
* `opflex_server_port` - (Optional) Opflex server port (string)
* `overlay_vrf_name` - (Optional) Overlay VRF name (string)
Expand All @@ -1062,13 +1071,15 @@ The following attributes are exported:
* `snat_port_range_end` - (Optional) End of snat port range (string)
* `snat_port_range_start` - (Optional) End of snat port range (string)
* `snat_ports_per_node` - (Optional) Snat ports per node (string)
* `sriov_enable` - (Optional) Whether to enable SR-IOV (string)
* `extern_static` - (Required) Subnet to use for static external IPs (string)
* `subnet_domain_name` - (Optional) Subnet domain name (string)
* `system_id` - (Required) ACI system ID (string)
* `tenant` - (Optional) ACI tenant (string)
* `token` - (Required/Sensitive) ACI token (string)
* `use_aci_anywhere_crd` - (Optional) Whether to use ACI anywhere CRD (string)
* `use_aci_cni_priority_class` - (Optional) Whether to use ACI CNI priority class (string)
* `use_cluster_role` - (Optional) Whether to use cluster role (string)
* `use_host_netns_volume` - (Optional) Whether to use host netns volume (string)
* `use_opflex_server_volume` - (Optional) Whether use Opflex server volume (string)
* `use_privileged_container` - (Optional) Whether ACI containers should run as privileged (string)
Expand Down
44 changes: 44 additions & 0 deletions rancher2/schema_cluster_rke_config_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,18 @@ func clusterRKEConfigNetworkAciFields() map[string]*schema.Schema {
Type: schema.TypeString,
},
},
"apic_refresh_ticker_adjust": {
Type: schema.TypeString,
Optional: true,
},
"apic_refresh_time": {
Type: schema.TypeString,
Optional: true,
},
"apic_subscription_delay": {
Type: schema.TypeString,
Optional: true,
},
"apic_user_crt": {
Type: schema.TypeString,
Required: true,
Expand All @@ -67,10 +75,22 @@ func clusterRKEConfigNetworkAciFields() map[string]*schema.Schema {
Type: schema.TypeString,
Optional: true,
},
"disable_periodic_snat_global_info_sync": {
Type: schema.TypeString,
Optional: true,
},
"disable_wait_for_network": {
Type: schema.TypeString,
Optional: true,
},
"drop_log_enable": {
Type: schema.TypeString,
Optional: true,
},
"duration_wait_for_network": {
Type: schema.TypeString,
Optional: true,
},
"extern_dynamic": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -157,10 +177,22 @@ func clusterRKEConfigNetworkAciFields() map[string]*schema.Schema {
Type: schema.TypeString,
Required: true,
},
"mtu_head_room": {
Type: schema.TypeString,
Optional: true,
},
"multus_disable": {
Type: schema.TypeString,
Optional: true,
},
"no_priority_class": {
Type: schema.TypeString,
Optional: true,
},
"node_pod_if_enable": {
Type: schema.TypeString,
Optional: true,
},
"node_subnet": {
Type: schema.TypeString,
Required: true,
Expand All @@ -177,6 +209,10 @@ func clusterRKEConfigNetworkAciFields() map[string]*schema.Schema {
Type: schema.TypeString,
Optional: true,
},
"opflex_device_delete_timeout": {
Type: schema.TypeString,
Optional: true,
},
"opflex_mode": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -237,6 +273,10 @@ func clusterRKEConfigNetworkAciFields() map[string]*schema.Schema {
Type: schema.TypeString,
Optional: true,
},
"sriov_enable": {
Type: schema.TypeString,
Optional: true,
},
"extern_static": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -266,6 +306,10 @@ func clusterRKEConfigNetworkAciFields() map[string]*schema.Schema {
Type: schema.TypeString,
Optional: true,
},
"use_cluster_role": {
Type: schema.TypeString,
Optional: true,
},
"use_host_netns_volume": {
Type: schema.TypeString,
Optional: true,
Expand Down
66 changes: 66 additions & 0 deletions rancher2/structure_cluster_rke_config_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ func flattenClusterRKEConfigNetworkAci(in *managementClient.AciNetworkProvider)
if len(in.ApicHosts) > 0 {
obj["apic_hosts"] = toArrayInterface(in.ApicHosts)
}
if len(in.ApicRefreshTickerAdjust) > 0 {
obj["apic_refresh_ticker_adjust"] = in.ApicRefreshTickerAdjust
}
if len(in.ApicRefreshTime) > 0 {
obj["apic_refresh_time"] = in.ApicRefreshTime
}
if len(in.ApicSubscriptionDelay) > 0 {
obj["apic_subscription_delay"] = in.ApicSubscriptionDelay
}
if len(in.ApicUserCrt) > 0 {
obj["apic_user_crt"] = in.ApicUserCrt
}
Expand All @@ -36,9 +42,18 @@ func flattenClusterRKEConfigNetworkAci(in *managementClient.AciNetworkProvider)
if len(in.ControllerLogLevel) > 0 {
obj["controller_log_level"] = in.ControllerLogLevel
}
if len(in.DisablePeriodicSnatGlobalInfoSync) > 0 {
obj["disable_periodic_snat_global_info_sync"] = in.DisablePeriodicSnatGlobalInfoSync
}
if len(in.DisableWaitForNetwork) > 0 {
obj["disable_wait_for_network"] = in.DisableWaitForNetwork
}
if len(in.DropLogEnable) > 0 {
obj["drop_log_enable"] = in.DropLogEnable
}
if len(in.DurationWaitForNetwork) > 0 {
obj["duration_wait_for_network"] = in.DurationWaitForNetwork
}
if len(in.DynamicExternalSubnet) > 0 {
obj["extern_dynamic"] = in.DynamicExternalSubnet
}
Expand Down Expand Up @@ -99,9 +114,18 @@ func flattenClusterRKEConfigNetworkAci(in *managementClient.AciNetworkProvider)
if len(in.McastRangeStart) > 0 {
obj["mcast_range_start"] = in.McastRangeStart
}
if len(in.MTUHeadRoom) > 0 {
obj["mtu_head_room"] = in.MTUHeadRoom
}
if len(in.MultusDisable) > 0 {
obj["multus_disable"] = in.MultusDisable
}
if len(in.NoPriorityClass) > 0 {
obj["no_priority_class"] = in.NoPriorityClass
}
if len(in.NodePodIfEnable) > 0 {
obj["node_pod_if_enable"] = in.NodePodIfEnable
}
if len(in.NodeSubnet) > 0 {
obj["node_subnet"] = in.NodeSubnet
}
Expand All @@ -114,6 +138,9 @@ func flattenClusterRKEConfigNetworkAci(in *managementClient.AciNetworkProvider)
if len(in.OpflexClientSSL) > 0 {
obj["opflex_client_ssl"] = in.OpflexClientSSL
}
if len(in.OpflexDeviceDeleteTimeout) > 0 {
obj["opflex_device_delete_timeout"] = in.OpflexDeviceDeleteTimeout
}
if len(in.OpflexMode) > 0 {
obj["opflex_mode"] = in.OpflexMode
}
Expand Down Expand Up @@ -159,6 +186,9 @@ func flattenClusterRKEConfigNetworkAci(in *managementClient.AciNetworkProvider)
if len(in.SnatPortsPerNode) > 0 {
obj["snat_ports_per_node"] = in.SnatPortsPerNode
}
if len(in.SriovEnable) > 0 {
obj["sriov_enable"] = in.SriovEnable
}
if len(in.StaticExternalSubnet) > 0 {
obj["extern_static"] = in.StaticExternalSubnet
}
Expand All @@ -180,6 +210,9 @@ func flattenClusterRKEConfigNetworkAci(in *managementClient.AciNetworkProvider)
if len(in.UseAciCniPriorityClass) > 0 {
obj["use_aci_cni_priority_class"] = in.UseAciCniPriorityClass
}
if len(in.UseClusterRole) > 0 {
obj["use_cluster_role"] = in.UseClusterRole
}
if len(in.UseHostNetnsVolume) > 0 {
obj["use_host_netns_volume"] = in.UseHostNetnsVolume
}
Expand Down Expand Up @@ -337,9 +370,15 @@ func expandClusterRKEConfigNetworkAci(p []interface{}) (*managementClient.AciNet
if v, ok := in["apic_hosts"].([]interface{}); ok && len(v) > 0 {
obj.ApicHosts = toArrayString(v)
}
if v, ok := in["apic_refresh_ticker_adjust"].(string); ok && len(v) > 0 {
obj.ApicRefreshTickerAdjust = v
}
if v, ok := in["apic_refresh_time"].(string); ok && len(v) > 0 {
obj.ApicRefreshTime = v
}
if v, ok := in["apic_subscription_delay"].(string); ok && len(v) > 0 {
obj.ApicSubscriptionDelay = v
}
if v, ok := in["apic_user_crt"].(string); ok && len(v) > 0 {
obj.ApicUserCrt = v
}
Expand All @@ -355,9 +394,18 @@ func expandClusterRKEConfigNetworkAci(p []interface{}) (*managementClient.AciNet
if v, ok := in["controller_log_level"].(string); ok && len(v) > 0 {
obj.ControllerLogLevel = v
}
if v, ok := in["disable_periodic_snat_global_info_sync"].(string); ok && len(v) > 0 {
obj.DisablePeriodicSnatGlobalInfoSync = v
}
if v, ok := in["disable_wait_for_network"].(string); ok && len(v) > 0 {
obj.DisableWaitForNetwork = v
}
if v, ok := in["drop_log_enable"].(string); ok && len(v) > 0 {
obj.DropLogEnable = v
}
if v, ok := in["duration_wait_for_network"].(string); ok && len(v) > 0 {
obj.DurationWaitForNetwork = v
}
if v, ok := in["extern_dynamic"].(string); ok && len(v) > 0 {
obj.DynamicExternalSubnet = v
}
Expand Down Expand Up @@ -418,9 +466,18 @@ func expandClusterRKEConfigNetworkAci(p []interface{}) (*managementClient.AciNet
if v, ok := in["mcast_range_start"].(string); ok && len(v) > 0 {
obj.McastRangeStart = v
}
if v, ok := in["mtu_head_room"].(string); ok && len(v) > 0 {
obj.MTUHeadRoom = v
}
if v, ok := in["multus_disable"].(string); ok && len(v) > 0 {
obj.MultusDisable = v
}
if v, ok := in["no_priority_class"].(string); ok && len(v) > 0 {
obj.NoPriorityClass = v
}
if v, ok := in["node_pod_if_enable"].(string); ok && len(v) > 0 {
obj.NodePodIfEnable = v
}
if v, ok := in["node_subnet"].(string); ok && len(v) > 0 {
obj.NodeSubnet = v
}
Expand All @@ -433,6 +490,9 @@ func expandClusterRKEConfigNetworkAci(p []interface{}) (*managementClient.AciNet
if v, ok := in["opflex_client_ssl"].(string); ok && len(v) > 0 {
obj.OpflexClientSSL = v
}
if v, ok := in["opflex_device_delete_timeout"].(string); ok && len(v) > 0 {
obj.OpflexDeviceDeleteTimeout = v
}
if v, ok := in["opflex_mode"].(string); ok && len(v) > 0 {
obj.OpflexMode = v
}
Expand Down Expand Up @@ -478,6 +538,9 @@ func expandClusterRKEConfigNetworkAci(p []interface{}) (*managementClient.AciNet
if v, ok := in["snat_ports_per_node"].(string); ok && len(v) > 0 {
obj.SnatPortsPerNode = v
}
if v, ok := in["sriov_enable"].(string); ok && len(v) > 0 {
obj.SriovEnable = v
}
if v, ok := in["extern_static"].(string); ok && len(v) > 0 {
obj.StaticExternalSubnet = v
}
Expand All @@ -499,6 +562,9 @@ func expandClusterRKEConfigNetworkAci(p []interface{}) (*managementClient.AciNet
if v, ok := in["use_aci_cni_priority_class"].(string); ok && len(v) > 0 {
obj.UseAciCniPriorityClass = v
}
if v, ok := in["use_cluster_role"].(string); ok && len(v) > 0 {
obj.UseClusterRole = v
}
if v, ok := in["use_host_netns_volume"].(string); ok && len(v) > 0 {
obj.UseHostNetnsVolume = v
}
Expand Down
Loading

0 comments on commit d943312

Please sign in to comment.