diff --git a/pkg/install/install.go b/pkg/install/install.go index 53a18c7d..999ed3b8 100644 --- a/pkg/install/install.go +++ b/pkg/install/install.go @@ -82,7 +82,7 @@ spec: fmt.Println(" Kourier service installed...") domainDns := exec.Command("kubectl", "patch", "configmap", "-n", "knative-serving", "config-domain", "-p", "{\"data\": {\"127.0.0.1.sslip.io\": \"\"}}") - if err := domainDns.Run(); err != nil { + if err := runCommand(domainDns); err != nil { return fmt.Errorf("domain dns: %w", err) } fmt.Println(" Domain DNS set up...") @@ -109,7 +109,7 @@ func KourierMinikube() error { } // Serving installs Knative Serving from Github YAML files -func Serving() error { +func Serving(registries string) error { fmt.Println("🍿 Installing Knative Serving v" + ServingVersion + " ...") baseURL := "https://github.com/knative/serving/releases/download/knative-v" + ServingVersion @@ -132,6 +132,15 @@ func Serving() error { fmt.Println(" Core installed...") + if registries != "" { + configPatch := fmt.Sprintf(`{"data":{"registries-skipping-tag-resolving":"%s"}}`, registries) + ignoreRegistry := exec.Command("kubectl", "patch", "configmap", "-n", "knative-serving", "config-deployment", "-p", configPatch) + if err := runCommand(ignoreRegistry); err != nil { + return fmt.Errorf("tag resolving configuration: %w", err) + } + fmt.Println(" Enabled local registry deployment...") + } + fmt.Println(" Finished installing Knative Serving") return nil diff --git a/pkg/kind/kind.go b/pkg/kind/kind.go index 770e6d6a..0af2d607 100644 --- a/pkg/kind/kind.go +++ b/pkg/kind/kind.go @@ -65,7 +65,14 @@ func SetUp(name, kVersion string, installServing, installEventing, installKindRe } if installKnative { if installServing { - if err := install.Serving(); err != nil { + // Disable tag resolution for localhost registry, since there's no + // way to redirect Knative Serving to use the kind-registry name. + // See https://github.com/knative-extensions/kn-plugin-quickstart/issues/467 + registries := "" + if installKindRegistry { + registries = fmt.Sprintf("localhost:%s", container_reg_port) + } + if err := install.Serving(registries); err != nil { return fmt.Errorf("install serving: %w", err) } if err := install.Kourier(); err != nil { diff --git a/pkg/minikube/minikube.go b/pkg/minikube/minikube.go index a6555e75..54aa9aaf 100644 --- a/pkg/minikube/minikube.go +++ b/pkg/minikube/minikube.go @@ -69,7 +69,7 @@ func SetUp(name, kVersion string, installServing, installEventing bool) error { fmt.Scanln() if installKnative { if installServing { - if err := install.Serving(); err != nil { + if err := install.Serving(""); err != nil { return fmt.Errorf("install serving: %w", err) } if err := install.Kourier(); err != nil {