diff --git a/pkg/await/extensions_ingress.go b/pkg/await/extensions_ingress.go index 9f551abef1..ef87c8277e 100644 --- a/pkg/await/extensions_ingress.go +++ b/pkg/await/extensions_ingress.go @@ -333,16 +333,18 @@ func expectedIngressPath(host, path, serviceName string) string { } // It is valid for a user not to specify either a host or path [1]. In this case, any traffic not - // matching another rule is routed to the specified Service for this rule. Print to make - // this expectation clear to users. + // matching another rule is routed to the specified Service for this rule. Print + // `"" (default path)` to make this expectation clear to users. // // [1] https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#httpingresspath-v1beta1-extensions if rulePath == "" { - rulePath = "" + rulePath = `"" (default path)` + } else { + rulePath = fmt.Sprintf("%q", rulePath) } // [host][path] -> serviceName - return fmt.Sprintf("%q -> %q", rulePath, serviceName) + return fmt.Sprintf("%s -> %q", rulePath, serviceName) } func (iia *ingressInitAwaiter) processEndpointEvent(event watch.Event, settledCh chan<- struct{}) { diff --git a/pkg/await/extensions_ingress_test.go b/pkg/await/extensions_ingress_test.go index 3e72986da3..2c59c897b7 100644 --- a/pkg/await/extensions_ingress_test.go +++ b/pkg/await/extensions_ingress_test.go @@ -334,7 +334,7 @@ func initializedIngressUnspecifiedPath(namespace, name, targetService string) *u return obj } -func Test_fqIngressPath(t *testing.T) { +func Test_expectedIngressPath(t *testing.T) { type args struct { host string path string @@ -348,7 +348,7 @@ func Test_fqIngressPath(t *testing.T) { {name: "host + path", args: args{host: "foo", path: "/bar", serviceName: "baz"}, want: `"foo/bar" -> "baz"`}, {name: "host only", args: args{host: "foo", serviceName: "baz"}, want: `"foo" -> "baz"`}, {name: "path only", args: args{path: "/bar", serviceName: "baz"}, want: `"/bar" -> "baz"`}, - {name: "empty", args: args{serviceName: "baz"}, want: `"" -> "baz"`}, + {name: "empty", args: args{serviceName: "baz"}, want: `"" (default path) -> "baz"`}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {