@@ -20,6 +20,7 @@ import (
2020 "context"
2121 "fmt"
2222 "net"
23+ "time"
2324
2425 "github.com/aws/aws-sdk-go-v2/aws"
2526 "github.com/aws/aws-sdk-go-v2/service/eks"
@@ -266,7 +267,7 @@ func (s *Service) deleteClusterAndWait(ctx context.Context, cluster *ekstypes.Cl
266267 Name : cluster .Name ,
267268 }
268269
269- err = s .EKSClient .WaitUntilClusterDeleted (ctx , waitInput )
270+ err = s .EKSClient .WaitUntilClusterDeleted (ctx , waitInput , s . scope . MaxWaitActiveUpdateDelete )
270271 if err != nil {
271272 return errors .Wrapf (err , "failed waiting for eks cluster %s to delete" , * cluster .Name )
272273 }
@@ -494,7 +495,7 @@ func (s *Service) waitForClusterActive(ctx context.Context) (*ekstypes.Cluster,
494495 req := eks.DescribeClusterInput {
495496 Name : aws .String (eksClusterName ),
496497 }
497- if err := s .EKSClient .WaitUntilClusterActive (ctx , & req ); err != nil {
498+ if err := s .EKSClient .WaitUntilClusterActive (ctx , & req , s . scope . MaxWaitActiveUpdateDelete ); err != nil {
498499 return nil , errors .Wrapf (err , "failed to wait for eks control plane %q" , * req .Name )
499500 }
500501
@@ -586,7 +587,6 @@ func publicAccessCIDRsEqual(as []string, bs []string) bool {
586587 bsDefault = true
587588 }
588589 if sets .NewString (as ... ).Equal (sets .NewString (bs ... )) {
589- fmt .Println ("Found IPV6 true" )
590590 return true
591591 }
592592
@@ -702,6 +702,7 @@ func (s *Service) reconcileClusterVersion(ctx context.Context, cluster *ekstypes
702702 if err := s .EKSClient .WaitUntilClusterUpdating (
703703 ctx ,
704704 & eks.DescribeClusterInput {Name : aws .String (s .scope .KubernetesClusterName ())},
705+ s .scope .MaxWaitActiveUpdateDelete ,
705706 ); err != nil {
706707 return false , err
707708 }
@@ -752,6 +753,7 @@ func (s *Service) updateEncryptionConfig(ctx context.Context, updatedEncryptionC
752753 if err := s .EKSClient .WaitUntilClusterUpdating (
753754 ctx ,
754755 & eks.DescribeClusterInput {Name : aws .String (s .scope .KubernetesClusterName ())},
756+ s .scope .MaxWaitActiveUpdateDelete ,
755757 ); err != nil {
756758 return false , err
757759 }
@@ -791,29 +793,29 @@ func getKeyArn(encryptionConfig ekstypes.EncryptionConfig) string {
791793}
792794
793795// WaitUntilClusterActive is blocking function to wait until EKS Cluster is Active.
794- func (k * EKSClient ) WaitUntilClusterActive (ctx context.Context , input * eks.DescribeClusterInput ) error {
796+ func (k * EKSClient ) WaitUntilClusterActive (ctx context.Context , input * eks.DescribeClusterInput , maxWait time. Duration ) error {
795797 waiter := eks .NewClusterActiveWaiter (k , func (o * eks.ClusterActiveWaiterOptions ) {
796798 o .LogWaitAttempts = true
797799 })
798800
799- return waiter .Wait (ctx , input , maxActiveUpdateDeleteWait )
801+ return waiter .Wait (ctx , input , maxWait )
800802}
801803
802804// WaitUntilClusterDeleted is blocking function to wait until EKS Cluster is Deleted.
803- func (k * EKSClient ) WaitUntilClusterDeleted (ctx context.Context , input * eks.DescribeClusterInput ) error {
805+ func (k * EKSClient ) WaitUntilClusterDeleted (ctx context.Context , input * eks.DescribeClusterInput , maxWait time. Duration ) error {
804806 waiter := eks .NewClusterDeletedWaiter (k )
805807
806- return waiter .Wait (ctx , input , maxActiveUpdateDeleteWait )
808+ return waiter .Wait (ctx , input , maxWait )
807809}
808810
809811// WaitUntilClusterUpdating is blocking function to wait until EKS Cluster is Updating.
810- func (k * EKSClient ) WaitUntilClusterUpdating (ctx context.Context , input * eks.DescribeClusterInput ) error {
812+ func (k * EKSClient ) WaitUntilClusterUpdating (ctx context.Context , input * eks.DescribeClusterInput , maxWait time. Duration ) error {
811813 waiter := eks .NewClusterActiveWaiter (k , func (o * eks.ClusterActiveWaiterOptions ) {
812814 o .LogWaitAttempts = true
813815 o .Retryable = clusterUpdatingStateRetryable
814816 })
815817
816- return waiter .Wait (ctx , input , maxActiveUpdateDeleteWait )
818+ return waiter .Wait (ctx , input , maxWait )
817819}
818820
819821// clusterUpdatingStateRetryable is adapted from aws-sdk-go-v2/service/eks/api_op_DescribeCluster.go.
0 commit comments