diff --git a/Makefile b/Makefile index 9ac3067..e1cf50e 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ test: generate fmt vet manifests # Run integration tests on local KIND cluster # TODO: modify once integration tests have been implemented test-integration: - echo "no tests yet" + ginkgo -v ./controllers/... # Build manager binary manager: generate fmt vet diff --git a/main.go b/main.go index 258a317..a137404 100644 --- a/main.go +++ b/main.go @@ -54,7 +54,7 @@ func main() { var enableLeaderElection bool flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.") - flag.StringVar(&hydraURL, "hydra-url", "http://ory-hydra-admin.kyma-system.svc.cluster.local", "The address of ORY Hydra") + flag.StringVar(&hydraURL, "hydra-url", "", "The address of ORY Hydra") flag.IntVar(&port, "port", 4445, "Port ORY Hydra is listening on") flag.StringVar(&endpoint, "endpoint", "/clients", "ORY Hydra's client endpoint") flag.BoolVar(&enableLeaderElection, "enable-leader-election", false, @@ -73,6 +73,11 @@ func main() { os.Exit(1) } + if hydraURL == "" { + setupLog.Error(fmt.Errorf("hydra service address can't be empty"), "unable to create controller", "controller", "OAuth2Client") + os.Exit(1) + } + u, err := url.Parse(fmt.Sprintf("%s:%d", hydraURL, port)) if err != nil { setupLog.Error(err, "unable to parse ORY Hydra's URL", "controller", "OAuth2Client")