cmd/k8s-operator: default ingress paths to '/' if not specified by user (#15706)
in resource Fixes #14908 Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>
This commit is contained in:
@@ -292,9 +292,15 @@ func validateIngressClass(ctx context.Context, cl client.Client) error {
|
||||
|
||||
func handlersForIngress(ctx context.Context, ing *networkingv1.Ingress, cl client.Client, rec record.EventRecorder, tlsHost string, logger *zap.SugaredLogger) (handlers map[string]*ipn.HTTPHandler, err error) {
|
||||
addIngressBackend := func(b *networkingv1.IngressBackend, path string) {
|
||||
if path == "" {
|
||||
path = "/"
|
||||
rec.Eventf(ing, corev1.EventTypeNormal, "PathUndefined", "configured backend is missing a path, defaulting to '/'")
|
||||
}
|
||||
|
||||
if b == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if b.Service == nil {
|
||||
rec.Eventf(ing, corev1.EventTypeWarning, "InvalidIngressBackend", "backend for path %q is missing service", path)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user