From 789e5fc6ac0c6e84f03642768be424b8aa611a5e 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 e1ff2d65fa74..97868c445016 100644 --- a/pilot/pkg/config/kube/gateway/conversion.go +++ b/pilot/pkg/config/kube/gateway/conversion.go @@ -1865,7 +1865,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 { @@ -1883,7 +1883,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 }) } @@ -2032,7 +2031,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) -}