Skip to content

Commit f5d27fc

Browse files
authored
PLT-1471: Fixed VIP and dns_server hash set (#535)
* PLT-1471: Fixed VIP and dns_server has set * fixing aws example for PLT-1129
1 parent 6ca4f10 commit f5d27fc

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

examples/e2e/aws/resource_cluster.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ resource "spectrocloud_cluster_aws" "cluster" {
3838
count = 1
3939
instance_type = "t3.large"
4040
disk_size_gb = 62
41-
azs = [var.aws_region_az]
41+
azs = var.aws_region_az
4242
}
4343

4444
machine_pool {
4545
name = "worker-basic"
4646
count = 1
4747
instance_type = "t3.large"
48-
azs = [var.aws_region_az]
48+
azs = var.aws_region_az
4949
}
5050

5151
}

spectrocloud/cluster_common_hash.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,30 @@ func resourceMachinePoolEdgeNativeHash(v interface{}) int {
375375
if staticIP, ok := hostMap["static_ip"]; ok {
376376
buf.WriteString(fmt.Sprintf("static_ip:%s-", staticIP.(string)))
377377
}
378+
379+
if nicName, ok := hostMap["nic_name"]; ok {
380+
buf.WriteString(fmt.Sprintf("nic_name:%s-", nicName.(string)))
381+
}
382+
383+
if defaultGateway, ok := hostMap["default_gateway"]; ok {
384+
buf.WriteString(fmt.Sprintf("default_gateway:%s-", defaultGateway.(string)))
385+
}
386+
387+
if subnetMask, ok := hostMap["subnet_mask"]; ok {
388+
buf.WriteString(fmt.Sprintf("subnet_mask:%s-", subnetMask.(string)))
389+
}
390+
391+
if dnsServers, ok := hostMap["dns_servers"]; ok {
392+
var dns []string
393+
for _, v := range dnsServers.(*schema.Set).List() {
394+
dns = append(dns, v.(string))
395+
}
396+
buf.WriteString(fmt.Sprintf("dns_servers:%s-", strings.Join(dns, ",")))
397+
}
398+
399+
if twoNodeRole, ok := hostMap["two_node_role"]; ok {
400+
buf.WriteString(fmt.Sprintf("two_node_role:%s-", twoNodeRole.(string)))
401+
}
378402
}
379403
}
380404

spectrocloud/resource_cluster_edge_native.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,6 @@ func flattenClusterConfigsEdgeNative(cloudConfig map[string]interface{}, config
411411
if config.Spec.ClusterConfig.ControlPlaneEndpoint.Host != "" {
412412
if v, ok := cloudConfig["vip"]; ok && v.(string) != "" {
413413
m["vip"] = config.Spec.ClusterConfig.ControlPlaneEndpoint.Host
414-
} else {
415-
m["vip"] = config.Spec.ClusterConfig.ControlPlaneEndpoint.Host
416414
}
417415
}
418416
if config.Spec.ClusterConfig.NtpServers != nil {

0 commit comments

Comments
 (0)