@@ -551,8 +551,7 @@ func resourceTencentcloudEKSClusterUpdate(d *schema.ResourceData, meta interface
551
551
enablePublic := false
552
552
if d .HasChange ("internal_lb" ) {
553
553
updateAttrs = append (updateAttrs , "internal_lb" )
554
- if v , ok := d .GetOk ("internal_lb" ); ok {
555
- lb := v .([]map [string ]interface {})[0 ]
554
+ if lb , ok := helper .InterfacesHeadMap (d , "internal_lb" ); ok {
556
555
enabled := lb ["enabled" ].(bool )
557
556
request .InternalLB = & tke.ClusterInternalLB {
558
557
Enabled : & enabled ,
@@ -570,8 +569,7 @@ func resourceTencentcloudEKSClusterUpdate(d *schema.ResourceData, meta interface
570
569
571
570
if d .HasChange ("public_lb" ) {
572
571
updateAttrs = append (updateAttrs , "public_lb" )
573
- if v , ok := d .GetOk ("public_lb" ); ok {
574
- lb := v .([]map [string ]interface {})[0 ]
572
+ if lb , ok := helper .InterfacesHeadMap (d , "public_lb" ); ok {
575
573
enabled := lb ["enabled" ].(bool )
576
574
request .PublicLB = & tke.ClusterPublicLB {
577
575
Enabled : & enabled ,
@@ -591,8 +589,15 @@ func resourceTencentcloudEKSClusterUpdate(d *schema.ResourceData, meta interface
591
589
Enabled : helper .Bool (false ),
592
590
}
593
591
}
592
+ }
594
593
595
- err := resource .Retry (readRetryTimeout , func () * resource.RetryError {
594
+ if len (updateAttrs ) > 0 {
595
+ err := service .UpdateEksCluster (ctx , request )
596
+ if err != nil {
597
+ return err
598
+ }
599
+
600
+ err = resource .Retry (readRetryTimeout , func () * resource.RetryError {
596
601
info , inErr := service .DescribeEKSClusterCredentialById (ctx , id )
597
602
if inErr != nil {
598
603
return retryError (inErr )
@@ -610,17 +615,6 @@ func resourceTencentcloudEKSClusterUpdate(d *schema.ResourceData, meta interface
610
615
if err != nil {
611
616
return err
612
617
}
613
-
614
- }
615
-
616
- if len (updateAttrs ) > 0 {
617
- err := service .UpdateEksCluster (ctx , request )
618
- if err != nil {
619
- return err
620
- }
621
- for _ , attr := range updateAttrs {
622
- d .SetPartial (attr )
623
- }
624
618
}
625
619
626
620
if d .HasChange ("tags" ) {
0 commit comments