Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add localhost registry to the set avoiding tag resolution as a workaround for #467 #468

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions pkg/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...")
Expand All @@ -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

Expand All @@ -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
Expand Down
9 changes: 8 additions & 1 deletion pkg/kind/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/minikube.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading