diff --git a/api/cmd/api/setup.go b/api/cmd/api/setup.go index 99d58e28b..afafc899b 100644 --- a/api/cmd/api/setup.go +++ b/api/cmd/api/setup.go @@ -3,6 +3,7 @@ package main import ( "context" "errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "net/http" "time" @@ -98,6 +99,11 @@ func initImageBuilder(cfg *config.Config) (webserviceBuilder imagebuilder.ImageB log.Panicf("%s, unable to initialize image builder", err.Error()) } + _, err = kubeClient.CoreV1().Pods("").List(context.Background(), metav1.ListOptions{}) + if err != nil { + log.Panicf("%s, error sending request to kube client at startup to verify connection", err.Error()) + } + timeout, err := time.ParseDuration(cfg.ImageBuilderConfig.BuildTimeout) if err != nil { log.Panicf("unable to parse image builder timeout to time.Duration %s", cfg.ImageBuilderConfig.BuildTimeout)