diff --git a/pkg/k8scheck/wait.go b/pkg/k8scheck/wait.go deleted file mode 100644 index 4fdb2bbaa..000000000 --- a/pkg/k8scheck/wait.go +++ /dev/null @@ -1,33 +0,0 @@ -package k8scheck - -import ( - "context" - "fmt" - "time" - - "github.com/sirupsen/logrus" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" -) - -func Wait(ctx context.Context, config rest.Config) error { - client, err := kubernetes.NewForConfig(&config) - if err != nil { - return err - } - - for { - _, err := client.Discovery().ServerVersion() - if err == nil { - break - } - logrus.Infof("Waiting for server to become available: %v", err) - select { - case <-ctx.Done(): - return fmt.Errorf("startup canceled") - case <-time.After(2 * time.Second): - } - } - - return nil -}