Skip to content

Commit

Permalink
Merge pull request #2323 from robscott/remove-resource-support-levels
Browse files Browse the repository at this point in the history
Removing concept of resource-level support levels
  • Loading branch information
k8s-ci-robot committed Aug 21, 2023
2 parents 70d5c04 + 8113fe0 commit 31957f2
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 53 deletions.
2 changes: 0 additions & 2 deletions apis/v1alpha2/grpcroute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ import (
// for the affected listener with a reason of "UnsupportedProtocol".
// Implementations MAY also accept HTTP/2 connections with an upgrade from
// HTTP/1, i.e. without prior knowledge.
//
// Support: Extended
type GRPCRoute struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 0 additions & 2 deletions apis/v1alpha2/referencegrant_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ import (
// support ReferenceGrant MUST NOT permit cross-namespace references which have
// no grant, and MUST respond to the removal of a grant by revoking the access
// that the grant allowed.
//
// Support: Core
type ReferenceGrant v1beta1.ReferenceGrant

// +kubebuilder:object:root=true
Expand Down
2 changes: 0 additions & 2 deletions apis/v1beta1/referencegrant_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// support ReferenceGrant MUST NOT permit cross-namespace references which have
// no grant, and MUST respond to the removal of a grant by revoking the access
// that the grant allowed.
//
// Support: Core
type ReferenceGrant struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 41 additions & 40 deletions conformance/utils/suite/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,23 @@ import "k8s.io/apimachinery/pkg/util/sets"
type SupportedFeature string

// -----------------------------------------------------------------------------
// Features - Standard (Core)
// Features - Gateway Conformance (Core)
// -----------------------------------------------------------------------------

const (
// This option indicates support for ReferenceGrant (core conformance).
// Opting out of this requires an implementation to have clearly implemented
// and documented equivalent safeguards.
SupportReferenceGrant SupportedFeature = "ReferenceGrant"
// This option indicates support for Gateway (core conformance).
// This option indicates support for Gateway.
// Opting out of this is allowed only for GAMMA-only implementations
SupportGateway SupportedFeature = "Gateway"
)

// StandardCoreFeatures are the features that are required to be conformant with
// the Core API features (e.g. GatewayClass, Gateway, e.t.c.).
//
// TODO: we need clarity for standard vs experimental features.
// See: https://github.com/kubernetes-sigs/gateway-api/issues/1891
var StandardCoreFeatures = sets.New(
SupportReferenceGrant,
// GatewayCoreFeatures are the features that are required to be conformant with
// the Gateway resource.
var GatewayCoreFeatures = sets.New(
SupportGateway,
)

// -----------------------------------------------------------------------------
// Features - Standard (Extended)
// Features - Gateway Conformance (Extended)
// -----------------------------------------------------------------------------

const (
Expand All @@ -61,30 +53,23 @@ const (

// StandardExtendedFeatures are extra generic features that implementations may
// choose to support as an opt-in.
//
// TODO: we need clarity for standard vs experimental features.
// See: https://github.com/kubernetes-sigs/gateway-api/issues/1891
var StandardExtendedFeatures = sets.New(
var GatewayExtendedFeatures = sets.New(
SupportGatewayPort8080,
).Insert(StandardCoreFeatures.UnsortedList()...)
).Insert(GatewayCoreFeatures.UnsortedList()...)

// -----------------------------------------------------------------------------
// Features - Experimental (Extended)
// Features - ReferenceGrant Conformance (Core)
// -----------------------------------------------------------------------------

const (
// This option indicates support for Destination Port matching.
SupportRouteDestinationPortMatching SupportedFeature = "RouteDestinationPortMatching"
// This option indicates support for ReferenceGrant.
SupportReferenceGrant SupportedFeature = "ReferenceGrant"
)

// ExperimentalExtendedFeatures are extra generic features that are currently
// only available in our experimental release channel, and at an extended
// support level.
//
// TODO: we need clarity for standard vs experimental features.
// See: https://github.com/kubernetes-sigs/gateway-api/issues/1891
var ExperimentalExtendedFeatures = sets.New(
SupportRouteDestinationPortMatching,
// ReferenceGrantCoreFeatures includes all SupportedFeatures needed to be
// conformant with the ReferenceGrant resource.
var ReferenceGrantCoreFeatures = sets.New(
SupportReferenceGrant,
)

// -----------------------------------------------------------------------------
Expand All @@ -97,8 +82,8 @@ const (
)

// HTTPCoreFeatures includes all SupportedFeatures needed to be conformant with
// the HTTPRoute.
var HTTPCoreFeatures = sets.New(
// the HTTPRoute resource.
var HTTPRouteCoreFeatures = sets.New(
SupportHTTPRoute,
)

Expand Down Expand Up @@ -138,7 +123,7 @@ const (
// HTTPExtendedFeatures includes all the supported features for HTTPRoute
// conformance and can be used to opt-in to run all HTTPRoute tests, including
// extended features.
var HTTPExtendedFeatures = sets.New(
var HTTPRouteExtendedFeatures = sets.New(
SupportHTTPRouteQueryParamMatching,
SupportHTTPRouteMethodMatching,
SupportHTTPResponseHeaderModification,
Expand All @@ -161,7 +146,7 @@ const (

// TLSCoreFeatures includes all the supported features for the TLSRoute API at
// a Core level of support.
var TLSCoreFeatures = sets.New(
var TLSRouteCoreFeatures = sets.New(
SupportTLSRoute,
)

Expand All @@ -180,6 +165,21 @@ var MeshCoreFeatures = sets.New(
SupportMesh,
)

// -----------------------------------------------------------------------------
// Features - Experimental
// -----------------------------------------------------------------------------

const (
// This option indicates support for Destination Port matching.
SupportRouteDestinationPortMatching SupportedFeature = "RouteDestinationPortMatching"
)

// ExperimentalFeatures are extra generic features that are currently only
// available in our experimental release channel.
var ExperimentalFeatures = sets.New(
SupportRouteDestinationPortMatching,
)

// -----------------------------------------------------------------------------
// Features - Compilations
// -----------------------------------------------------------------------------
Expand All @@ -189,9 +189,10 @@ var MeshCoreFeatures = sets.New(
//
// NOTE: as new feature sets are added they should be inserted into this set.
var AllFeatures = sets.New[SupportedFeature]().
Insert(StandardExtendedFeatures.UnsortedList()...).
Insert(ExperimentalExtendedFeatures.UnsortedList()...).
Insert(HTTPCoreFeatures.UnsortedList()...).
Insert(HTTPExtendedFeatures.UnsortedList()...).
Insert(TLSCoreFeatures.UnsortedList()...).
Insert(MeshCoreFeatures.UnsortedList()...)
Insert(GatewayExtendedFeatures.UnsortedList()...).
Insert(ReferenceGrantCoreFeatures.UnsortedList()...).
Insert(HTTPRouteCoreFeatures.UnsortedList()...).
Insert(HTTPRouteExtendedFeatures.UnsortedList()...).
Insert(TLSRouteCoreFeatures.UnsortedList()...).
Insert(MeshCoreFeatures.UnsortedList()...).
Insert(ExperimentalFeatures.UnsortedList()...)
4 changes: 2 additions & 2 deletions conformance/utils/suite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ func New(s Options) *ConformanceTestSuite {
case s.EnableAllSupportedFeatures == true:
s.SupportedFeatures = AllFeatures
case s.SupportedFeatures == nil:
s.SupportedFeatures = StandardCoreFeatures
s.SupportedFeatures = GatewayCoreFeatures
default:
for feature := range StandardCoreFeatures {
for feature := range GatewayCoreFeatures {
s.SupportedFeatures.Insert(feature)
}
}
Expand Down

0 comments on commit 31957f2

Please sign in to comment.