From 4c46c4ee9ef2668e254f2b11b71d8392098beb29 Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Wed, 17 Jul 2024 16:35:14 -0700 Subject: [PATCH] disable writing into GatewayClass.Status.SupportedFeatures disable until the field moves from experiemental to stable so status writes for a GatewayClass dont fail when the datatypes differ Signed-off-by: Arko Dasgupta --- .../translate/out/default-resources.all.yaml | 23 ------------------ .../out/echo-gateway-api.cluster.yaml | 23 ------------------ .../translate/out/echo-gateway-api.route.json | 24 ------------------- .../translate/out/invalid-envoyproxy.all.yaml | 23 ------------------ .../out/rejected-http-route.route.yaml | 23 ------------------ .../translate/out/valid-envoyproxy.all.yaml | 23 ------------------ internal/gatewayapi/status/gatewayclass.go | 5 +++- 7 files changed, 4 insertions(+), 140 deletions(-) diff --git a/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml b/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml index ac5bde3ed570..86df2f9de4c9 100644 --- a/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml @@ -196,29 +196,6 @@ gatewayClass: reason: Accepted status: "True" type: Accepted - supportedFeatures: - - GRPCRoute - - Gateway - - GatewayPort8080 - - HTTPRoute - - HTTPRouteBackendProtocolH2C - - HTTPRouteBackendProtocolWebSocket - - HTTPRouteBackendTimeout - - HTTPRouteDestinationPortMatching - - HTTPRouteHostRewrite - - HTTPRouteMethodMatching - - HTTPRouteParentRefPort - - HTTPRoutePathRedirect - - HTTPRoutePathRewrite - - HTTPRoutePortRedirect - - HTTPRouteQueryParamMatching - - HTTPRouteRequestMirror - - HTTPRouteRequestMultipleMirrors - - HTTPRouteRequestTimeout - - HTTPRouteResponseHeaderModification - - HTTPRouteSchemeRedirect - - ReferenceGrant - - TLSRoute gateways: - metadata: creationTimestamp: null diff --git a/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.cluster.yaml b/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.cluster.yaml index 85b5c588ecbf..3d88f20f51db 100644 --- a/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.cluster.yaml +++ b/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.cluster.yaml @@ -12,29 +12,6 @@ gatewayClass: reason: Accepted status: "True" type: Accepted - supportedFeatures: - - GRPCRoute - - Gateway - - GatewayPort8080 - - HTTPRoute - - HTTPRouteBackendProtocolH2C - - HTTPRouteBackendProtocolWebSocket - - HTTPRouteBackendTimeout - - HTTPRouteDestinationPortMatching - - HTTPRouteHostRewrite - - HTTPRouteMethodMatching - - HTTPRouteParentRefPort - - HTTPRoutePathRedirect - - HTTPRoutePathRewrite - - HTTPRoutePortRedirect - - HTTPRouteQueryParamMatching - - HTTPRouteRequestMirror - - HTTPRouteRequestMultipleMirrors - - HTTPRouteRequestTimeout - - HTTPRouteResponseHeaderModification - - HTTPRouteSchemeRedirect - - ReferenceGrant - - TLSRoute gateways: - metadata: creationTimestamp: null diff --git a/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.route.json b/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.route.json index 663ce5404e73..41dfd6683e7f 100644 --- a/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.route.json +++ b/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.route.json @@ -17,30 +17,6 @@ "reason": "Accepted", "message": "Valid GatewayClass" } - ], - "supportedFeatures": [ - "GRPCRoute", - "Gateway", - "GatewayPort8080", - "HTTPRoute", - "HTTPRouteBackendProtocolH2C", - "HTTPRouteBackendProtocolWebSocket", - "HTTPRouteBackendTimeout", - "HTTPRouteDestinationPortMatching", - "HTTPRouteHostRewrite", - "HTTPRouteMethodMatching", - "HTTPRouteParentRefPort", - "HTTPRoutePathRedirect", - "HTTPRoutePathRewrite", - "HTTPRoutePortRedirect", - "HTTPRouteQueryParamMatching", - "HTTPRouteRequestMirror", - "HTTPRouteRequestMultipleMirrors", - "HTTPRouteRequestTimeout", - "HTTPRouteResponseHeaderModification", - "HTTPRouteSchemeRedirect", - "ReferenceGrant", - "TLSRoute" ] } }, diff --git a/internal/cmd/egctl/testdata/translate/out/invalid-envoyproxy.all.yaml b/internal/cmd/egctl/testdata/translate/out/invalid-envoyproxy.all.yaml index df3038175707..81df01be9e4e 100644 --- a/internal/cmd/egctl/testdata/translate/out/invalid-envoyproxy.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/invalid-envoyproxy.all.yaml @@ -38,29 +38,6 @@ gatewayClass: reason: InvalidParameters status: "False" type: Accepted - supportedFeatures: - - GRPCRoute - - Gateway - - GatewayPort8080 - - HTTPRoute - - HTTPRouteBackendProtocolH2C - - HTTPRouteBackendProtocolWebSocket - - HTTPRouteBackendTimeout - - HTTPRouteDestinationPortMatching - - HTTPRouteHostRewrite - - HTTPRouteMethodMatching - - HTTPRouteParentRefPort - - HTTPRoutePathRedirect - - HTTPRoutePathRewrite - - HTTPRoutePortRedirect - - HTTPRouteQueryParamMatching - - HTTPRouteRequestMirror - - HTTPRouteRequestMultipleMirrors - - HTTPRouteRequestTimeout - - HTTPRouteResponseHeaderModification - - HTTPRouteSchemeRedirect - - ReferenceGrant - - TLSRoute gateways: - metadata: creationTimestamp: null diff --git a/internal/cmd/egctl/testdata/translate/out/rejected-http-route.route.yaml b/internal/cmd/egctl/testdata/translate/out/rejected-http-route.route.yaml index 1dd8cc46a939..c578d14aef50 100644 --- a/internal/cmd/egctl/testdata/translate/out/rejected-http-route.route.yaml +++ b/internal/cmd/egctl/testdata/translate/out/rejected-http-route.route.yaml @@ -12,29 +12,6 @@ gatewayClass: reason: Accepted status: "True" type: Accepted - supportedFeatures: - - GRPCRoute - - Gateway - - GatewayPort8080 - - HTTPRoute - - HTTPRouteBackendProtocolH2C - - HTTPRouteBackendProtocolWebSocket - - HTTPRouteBackendTimeout - - HTTPRouteDestinationPortMatching - - HTTPRouteHostRewrite - - HTTPRouteMethodMatching - - HTTPRouteParentRefPort - - HTTPRoutePathRedirect - - HTTPRoutePathRewrite - - HTTPRoutePortRedirect - - HTTPRouteQueryParamMatching - - HTTPRouteRequestMirror - - HTTPRouteRequestMultipleMirrors - - HTTPRouteRequestTimeout - - HTTPRouteResponseHeaderModification - - HTTPRouteSchemeRedirect - - ReferenceGrant - - TLSRoute gateways: - metadata: creationTimestamp: null diff --git a/internal/cmd/egctl/testdata/translate/out/valid-envoyproxy.all.yaml b/internal/cmd/egctl/testdata/translate/out/valid-envoyproxy.all.yaml index 09fb3051c14c..638390ff4404 100644 --- a/internal/cmd/egctl/testdata/translate/out/valid-envoyproxy.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/valid-envoyproxy.all.yaml @@ -31,29 +31,6 @@ gatewayClass: reason: Accepted status: "True" type: Accepted - supportedFeatures: - - GRPCRoute - - Gateway - - GatewayPort8080 - - HTTPRoute - - HTTPRouteBackendProtocolH2C - - HTTPRouteBackendProtocolWebSocket - - HTTPRouteBackendTimeout - - HTTPRouteDestinationPortMatching - - HTTPRouteHostRewrite - - HTTPRouteMethodMatching - - HTTPRouteParentRefPort - - HTTPRoutePathRedirect - - HTTPRoutePathRewrite - - HTTPRoutePortRedirect - - HTTPRouteQueryParamMatching - - HTTPRouteRequestMirror - - HTTPRouteRequestMultipleMirrors - - HTTPRouteRequestTimeout - - HTTPRouteResponseHeaderModification - - HTTPRouteSchemeRedirect - - ReferenceGrant - - TLSRoute gateways: - metadata: creationTimestamp: null diff --git a/internal/gatewayapi/status/gatewayclass.go b/internal/gatewayapi/status/gatewayclass.go index ad8a032a27fb..490fc61b9fe7 100644 --- a/internal/gatewayapi/status/gatewayclass.go +++ b/internal/gatewayapi/status/gatewayclass.go @@ -37,7 +37,10 @@ const ( // for the provided GatewayClass. func SetGatewayClassAccepted(gc *gwapiv1.GatewayClass, accepted bool, reason, msg string) *gwapiv1.GatewayClass { gc.Status.Conditions = MergeConditions(gc.Status.Conditions, computeGatewayClassAcceptedCondition(gc, accepted, reason, msg)) - gc.Status.SupportedFeatures = GatewaySupportedFeatures + // Disable SupportedFeatures until the field moves from experimental to stable to avoid + // status failures due to changes in the datatype. This can occur because we cannot control + // how a CRD is installed in the cluster + // gc.Status.SupportedFeatures = GatewaySupportedFeatures return gc }