From 8db6a6b272a771fdca97fdafd585f42b73af179d Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 17 Jul 2024 15:48:29 -0700 Subject: [PATCH] Drop SupportedFeatures from gateway-api This field provides no value but causes a lot of harm: * https://github.com/kubernetes-sigs/gateway-api/pull/3200#discussion_r1681853821 * https://github.com/istio/istio/issues/50851 --- pilot/pkg/config/kube/gateway/conversion.go | 5 ++--- pilot/pkg/config/kube/gateway/supported_features.go | 13 ------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/pilot/pkg/config/kube/gateway/conversion.go b/pilot/pkg/config/kube/gateway/conversion.go index a10cde941798..df3fedbe7bc1 100644 --- a/pilot/pkg/config/kube/gateway/conversion.go +++ b/pilot/pkg/config/kube/gateway/conversion.go @@ -1862,7 +1862,7 @@ func createGRPCURIMatch(match k8s.GRPCRouteMatch) (*istio.StringMatch, *ConfigEr // getGatewayClass finds all gateway class that are owned by Istio // Response is ClassName -> Controller type -func getGatewayClasses(r GatewayResources, supportedFeatures []k8s.SupportedFeature) map[string]k8s.GatewayController { +func getGatewayClasses(r GatewayResources) map[string]k8s.GatewayController { res := map[string]k8s.GatewayController{} // Setup builtin ones - these can be overridden possibly for name, controller := range builtinClasses { @@ -1880,7 +1880,6 @@ func getGatewayClasses(r GatewayResources, supportedFeatures []k8s.SupportedFeat obj.Status.(*kstatus.WrappedStatus).Mutate(func(s config.Status) config.Status { gcs := s.(*k8s.GatewayClassStatus) *gcs = GetClassStatus(gcs, obj.Generation) - gcs.SupportedFeatures = supportedFeatures return gcs }) } @@ -2029,7 +2028,7 @@ func convertGateways(r configContext) ([]config.Config, map[parentKey][]*parentI // namespaceLabelReferences keeps track of all namespace label keys referenced by Gateways. This is // used to ensure we handle namespace updates for those keys. namespaceLabelReferences := sets.New[string]() - classes := getGatewayClasses(r.GatewayResources, gatewaySupportedFeatures) + classes := getGatewayClasses(r.GatewayResources) for _, obj := range r.Gateway { obj := obj kgw := obj.Spec.(*k8s.GatewaySpec) diff --git a/pilot/pkg/config/kube/gateway/supported_features.go b/pilot/pkg/config/kube/gateway/supported_features.go index ca1934a94cab..e71988cacb80 100644 --- a/pilot/pkg/config/kube/gateway/supported_features.go +++ b/pilot/pkg/config/kube/gateway/supported_features.go @@ -15,20 +15,7 @@ package gateway import ( - k8sv1 "sigs.k8s.io/gateway-api/apis/v1" "sigs.k8s.io/gateway-api/pkg/features" - - "istio.io/istio/pkg/util/sets" ) var SupportedFeatures = features.AllFeatures - -var gatewaySupportedFeatures = getSupportedFeatures() - -func getSupportedFeatures() []k8sv1.SupportedFeature { - ret := sets.New[k8sv1.SupportedFeature]() - for _, feature := range SupportedFeatures.UnsortedList() { - ret.Insert(k8sv1.SupportedFeature(feature)) - } - return sets.SortedList(ret) -}