cmd/k8s-operator: warn if unsupported Ingress Exact path type is used. (#10865)

To reduce the likelihood of breaking users,
if we implement stricter Exact path type matching in the future.

Updates tailscale/tailscale#10730

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
pull/10871/head
Irbe Krumina 10 months ago committed by GitHub
parent 50b52dbd7d
commit 1c3c3d6752
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -217,6 +217,15 @@ func (a *IngressReconciler) maybeProvision(ctx context.Context, logger *zap.Suga
continue continue
} }
for _, p := range rule.HTTP.Paths { for _, p := range rule.HTTP.Paths {
// Send a warning if folks use Exact path type - to make
// it easier for us to support Exact path type matching
// in the future if needed.
// https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types
if *p.PathType == networkingv1.PathTypeExact {
msg := "Exact path type strict matching is currently not supported and requests will be routed as for Prefix path type. This behaviour might change in the future."
logger.Warnf(fmt.Sprintf("Unsupported Path type exact for path %s. %s", p.Path, msg))
a.recorder.Eventf(ing, corev1.EventTypeWarning, "UnsupportedPathTypeExact", msg)
}
addIngressBackend(&p.Backend, p.Path) addIngressBackend(&p.Backend, p.Path)
} }
} }

Loading…
Cancel
Save