diff --git a/controllers/k6_start.go b/controllers/k6_start.go index 13a0b7f9..9308cffb 100644 --- a/controllers/k6_start.go +++ b/controllers/k6_start.go @@ -17,7 +17,7 @@ import ( ) func isServiceReady(log logr.Logger, service *v1.Service) bool { - resp, err := http.Get(fmt.Sprintf("http://%v.%v.svc.cluster.local:6565/v1/status", service.ObjectMeta.Name, service.ObjectMeta.Namespace)) + resp, err := http.Get(fmt.Sprintf("http://%v:6565/v1/status", service.Spec.ClusterIP)) if err != nil { log.Error(err, fmt.Sprintf("failed to get status from %v", service.ObjectMeta.Name)) diff --git a/controllers/k6_stopped_jobs.go b/controllers/k6_stopped_jobs.go index da9d73ce..d010e0a1 100644 --- a/controllers/k6_stopped_jobs.go +++ b/controllers/k6_stopped_jobs.go @@ -18,7 +18,7 @@ import ( ) func isJobRunning(log logr.Logger, service *v1.Service) bool { - resp, err := http.Get(fmt.Sprintf("http://%v.%v.svc.cluster.local:6565/v1/status", service.ObjectMeta.Name, service.ObjectMeta.Namespace)) + resp, err := http.Get(fmt.Sprintf("http://%v:6565/v1/status", service.Spec.ClusterIP)) if err != nil { return false }