Skip to content

Commit c74640b

Browse files
[release-1.12] Add localhost registry to the set avoiding tag resolution as a workaround for #467 (#469)
* Add localhost registry to the set avoiding tag resolution as a workaround for #467 * Update comment per suggestion by rhuss@ --------- Co-authored-by: Evan Anderson <[email protected]>
1 parent 7e8cda6 commit c74640b

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

pkg/install/install.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ spec:
8282
fmt.Println(" Kourier service installed...")
8383

8484
domainDns := exec.Command("kubectl", "patch", "configmap", "-n", "knative-serving", "config-domain", "-p", "{\"data\": {\"127.0.0.1.sslip.io\": \"\"}}")
85-
if err := domainDns.Run(); err != nil {
85+
if err := runCommand(domainDns); err != nil {
8686
return fmt.Errorf("domain dns: %w", err)
8787
}
8888
fmt.Println(" Domain DNS set up...")
@@ -109,7 +109,7 @@ func KourierMinikube() error {
109109
}
110110

111111
// Serving installs Knative Serving from Github YAML files
112-
func Serving() error {
112+
func Serving(registries string) error {
113113
fmt.Println("🍿 Installing Knative Serving v" + ServingVersion + " ...")
114114
baseURL := "https://github.com/knative/serving/releases/download/knative-v" + ServingVersion
115115

@@ -132,6 +132,15 @@ func Serving() error {
132132

133133
fmt.Println(" Core installed...")
134134

135+
if registries != "" {
136+
configPatch := fmt.Sprintf(`{"data":{"registries-skipping-tag-resolving":"%s"}}`, registries)
137+
ignoreRegistry := exec.Command("kubectl", "patch", "configmap", "-n", "knative-serving", "config-deployment", "-p", configPatch)
138+
if err := runCommand(ignoreRegistry); err != nil {
139+
return fmt.Errorf("tag resolving configuration: %w", err)
140+
}
141+
fmt.Println(" Enabled local registry deployment...")
142+
}
143+
135144
fmt.Println(" Finished installing Knative Serving")
136145

137146
return nil

pkg/kind/kind.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,14 @@ func SetUp(name, kVersion string, installServing, installEventing, installKindRe
6565
}
6666
if installKnative {
6767
if installServing {
68-
if err := install.Serving(); err != nil {
68+
// Disable tag resolution for localhost registry, since there's no
69+
// way to redirect Knative Serving to use the kind-registry name.
70+
// See https://github.com/knative-extensions/kn-plugin-quickstart/issues/467
71+
registries := ""
72+
if installKindRegistry {
73+
registries = fmt.Sprintf("localhost:%s", container_reg_port)
74+
}
75+
if err := install.Serving(registries); err != nil {
6976
return fmt.Errorf("install serving: %w", err)
7077
}
7178
if err := install.Kourier(); err != nil {

pkg/minikube/minikube.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func SetUp(name, kVersion string, installServing, installEventing bool) error {
6969
fmt.Scanln()
7070
if installKnative {
7171
if installServing {
72-
if err := install.Serving(); err != nil {
72+
if err := install.Serving(""); err != nil {
7373
return fmt.Errorf("install serving: %w", err)
7474
}
7575
if err := install.Kourier(); err != nil {

0 commit comments

Comments
 (0)