Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable writing into GatewayClass.Status.SupportedFeatures #3888

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,30 +196,6 @@ gatewayClass:
reason: Accepted
status: "True"
type: Accepted
supportedFeatures:
- GRPCRoute
- Gateway
- GatewayPort8080
- HTTPRoute
- HTTPRouteBackendProtocolH2C
- HTTPRouteBackendProtocolWebSocket
- HTTPRouteBackendRequestHeaderModification
- HTTPRouteBackendTimeout
- HTTPRouteDestinationPortMatching
- HTTPRouteHostRewrite
- HTTPRouteMethodMatching
- HTTPRouteParentRefPort
- HTTPRoutePathRedirect
- HTTPRoutePathRewrite
- HTTPRoutePortRedirect
- HTTPRouteQueryParamMatching
- HTTPRouteRequestMirror
- HTTPRouteRequestMultipleMirrors
- HTTPRouteRequestTimeout
- HTTPRouteResponseHeaderModification
- HTTPRouteSchemeRedirect
- ReferenceGrant
- TLSRoute
gateways:
- metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,6 @@ gatewayClass:
reason: Accepted
status: "True"
type: Accepted
supportedFeatures:
- GRPCRoute
- Gateway
- GatewayPort8080
- HTTPRoute
- HTTPRouteBackendProtocolH2C
- HTTPRouteBackendProtocolWebSocket
- HTTPRouteBackendRequestHeaderModification
- HTTPRouteBackendTimeout
- HTTPRouteDestinationPortMatching
- HTTPRouteHostRewrite
- HTTPRouteMethodMatching
- HTTPRouteParentRefPort
- HTTPRoutePathRedirect
- HTTPRoutePathRewrite
- HTTPRoutePortRedirect
- HTTPRouteQueryParamMatching
- HTTPRouteRequestMirror
- HTTPRouteRequestMultipleMirrors
- HTTPRouteRequestTimeout
- HTTPRouteResponseHeaderModification
- HTTPRouteSchemeRedirect
- ReferenceGrant
- TLSRoute
gateways:
- metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,6 @@
"reason": "Accepted",
"message": "Valid GatewayClass"
}
],
"supportedFeatures": [
"GRPCRoute",
"Gateway",
"GatewayPort8080",
"HTTPRoute",
"HTTPRouteBackendProtocolH2C",
"HTTPRouteBackendProtocolWebSocket",
"HTTPRouteBackendRequestHeaderModification",
"HTTPRouteBackendTimeout",
"HTTPRouteDestinationPortMatching",
"HTTPRouteHostRewrite",
"HTTPRouteMethodMatching",
"HTTPRouteParentRefPort",
"HTTPRoutePathRedirect",
"HTTPRoutePathRewrite",
"HTTPRoutePortRedirect",
"HTTPRouteQueryParamMatching",
"HTTPRouteRequestMirror",
"HTTPRouteRequestMultipleMirrors",
"HTTPRouteRequestTimeout",
"HTTPRouteResponseHeaderModification",
"HTTPRouteSchemeRedirect",
"ReferenceGrant",
"TLSRoute"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,6 @@ gatewayClass:
reason: InvalidParameters
status: "False"
type: Accepted
supportedFeatures:
- GRPCRoute
- Gateway
- GatewayPort8080
- HTTPRoute
- HTTPRouteBackendProtocolH2C
- HTTPRouteBackendProtocolWebSocket
- HTTPRouteBackendRequestHeaderModification
- HTTPRouteBackendTimeout
- HTTPRouteDestinationPortMatching
- HTTPRouteHostRewrite
- HTTPRouteMethodMatching
- HTTPRouteParentRefPort
- HTTPRoutePathRedirect
- HTTPRoutePathRewrite
- HTTPRoutePortRedirect
- HTTPRouteQueryParamMatching
- HTTPRouteRequestMirror
- HTTPRouteRequestMultipleMirrors
- HTTPRouteRequestTimeout
- HTTPRouteResponseHeaderModification
- HTTPRouteSchemeRedirect
- ReferenceGrant
- TLSRoute
gateways:
- metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,6 @@ gatewayClass:
reason: Accepted
status: "True"
type: Accepted
supportedFeatures:
- GRPCRoute
- Gateway
- GatewayPort8080
- HTTPRoute
- HTTPRouteBackendProtocolH2C
- HTTPRouteBackendProtocolWebSocket
- HTTPRouteBackendRequestHeaderModification
- HTTPRouteBackendTimeout
- HTTPRouteDestinationPortMatching
- HTTPRouteHostRewrite
- HTTPRouteMethodMatching
- HTTPRouteParentRefPort
- HTTPRoutePathRedirect
- HTTPRoutePathRewrite
- HTTPRoutePortRedirect
- HTTPRouteQueryParamMatching
- HTTPRouteRequestMirror
- HTTPRouteRequestMultipleMirrors
- HTTPRouteRequestTimeout
- HTTPRouteResponseHeaderModification
- HTTPRouteSchemeRedirect
- ReferenceGrant
- TLSRoute
gateways:
- metadata:
creationTimestamp: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,6 @@ gatewayClass:
reason: Accepted
status: "True"
type: Accepted
supportedFeatures:
- GRPCRoute
- Gateway
- GatewayPort8080
- HTTPRoute
- HTTPRouteBackendProtocolH2C
- HTTPRouteBackendProtocolWebSocket
- HTTPRouteBackendRequestHeaderModification
- HTTPRouteBackendTimeout
- HTTPRouteDestinationPortMatching
- HTTPRouteHostRewrite
- HTTPRouteMethodMatching
- HTTPRouteParentRefPort
- HTTPRoutePathRedirect
- HTTPRoutePathRewrite
- HTTPRoutePortRedirect
- HTTPRouteQueryParamMatching
- HTTPRouteRequestMirror
- HTTPRouteRequestMultipleMirrors
- HTTPRouteRequestTimeout
- HTTPRouteResponseHeaderModification
- HTTPRouteSchemeRedirect
- ReferenceGrant
- TLSRoute
gateways:
- metadata:
creationTimestamp: null
Expand Down
8 changes: 4 additions & 4 deletions internal/cmd/egctl/translate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"

"github.com/envoyproxy/gateway/internal/gatewayapi/status"
"github.com/envoyproxy/gateway/internal/utils/field"
"github.com/envoyproxy/gateway/internal/utils/file"
)
Expand Down Expand Up @@ -360,9 +359,10 @@ func TestTranslate(t *testing.T) {

// Supported features are dynamic, instead of hard-coding them in the output files
// we define them here.
if want.GatewayClass != nil {
want.GatewayClass.Status.SupportedFeatures = status.GatewaySupportedFeatures
}
// Disabled until GatewayClass.Status.SupportedFeatures is stable
// if want.GatewayClass != nil {
// want.GatewayClass.Status.SupportedFeatures = status.GatewaySupportedFeatures
// }

opts := cmpopts.IgnoreFields(metav1.Condition{}, "LastTransitionTime")
require.Empty(t, cmp.Diff(want, got, opts))
Expand Down
5 changes: 4 additions & 1 deletion internal/gatewayapi/status/gatewayclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down