From a0df2c1c483711abad6beccc0ed21746a2b5e26d Mon Sep 17 00:00:00 2001 From: Brendan Galloway Date: Mon, 28 Jun 2021 10:13:34 +0200 Subject: [PATCH] feat: remove ingress default processing v1 ingresses no longer need default processing --- defaults.go | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/defaults.go b/defaults.go index 783caf2..15a5e51 100644 --- a/defaults.go +++ b/defaults.go @@ -4,7 +4,6 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" - networking "k8s.io/api/networking/v1" rbac "k8s.io/api/rbac/v1" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" @@ -15,27 +14,6 @@ import ( var defaulter = runtime.NewScheme() -func DefaultsIngress(ing *networking.Ingress) *networking.Ingress { - defaulter.Default(ing) - implementationSpecific := networking.PathTypeImplementationSpecific - _rules := []networking.IngressRule{} - for _, rule := range ing.Spec.Rules { - if rule.HTTP != nil { - _paths := []networking.HTTPIngressPath{} - for _, path := range rule.HTTP.Paths { - if path.PathType == nil { - path.PathType = &implementationSpecific - } - _paths = append(_paths, path) - } - rule.HTTP.Paths = _paths - } - _rules = append(_rules, rule) - } - ing.Spec.Rules = _rules - return ing -} - func DefaultsService(svc *v1.Service) *v1.Service { defaulter.Default(svc) _ports := []v1.ServicePort{} @@ -355,13 +333,6 @@ func Defaults(obj *unstructured.Unstructured) (*unstructured.Unstructured, error return nil, err } return ToUnstructured(obj, DefaultsClusterRoleBinding(rb)) - } else if IsIngress(obj) { - ing, err := AsIngress(obj) - if err != nil { - return nil, err - } - return ToUnstructured(obj, DefaultsIngress(ing)) - } return obj, nil