Skip to content

Commit a0caa6d

Browse files
shaneuttk8s-ci-robot
authored andcommitted
chore: move features into separate file
A bit of maintenance to remove clutter from the test suite file.
1 parent 0c3a454 commit a0caa6d

File tree

2 files changed

+73
-70
lines changed

2 files changed

+73
-70
lines changed

conformance/utils/suite/features.go

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package suite
2+
3+
import "k8s.io/apimachinery/pkg/util/sets"
4+
5+
// SupportedFeature allows opting in to additional conformance tests at an
6+
// individual feature granularity.
7+
type SupportedFeature string
8+
9+
const (
10+
// This option indicates support for ReferenceGrant (core conformance).
11+
// Opting out of this requires an implementation to have clearly implemented
12+
// and documented equivalent safeguards.
13+
SupportReferenceGrant SupportedFeature = "ReferenceGrant"
14+
15+
// This option indicates support for TLSRoute (extended conformance).
16+
SupportTLSRoute SupportedFeature = "TLSRoute"
17+
18+
// This option indicates support for HTTPRoute query param matching (extended conformance).
19+
SupportHTTPRouteQueryParamMatching SupportedFeature = "HTTPRouteQueryParamMatching"
20+
21+
// This option indicates support for HTTPRoute method matching (extended conformance).
22+
SupportHTTPRouteMethodMatching SupportedFeature = "HTTPRouteMethodMatching"
23+
24+
// This option indicates support for HTTPRoute response header modification (extended conformance).
25+
SupportHTTPResponseHeaderModification SupportedFeature = "HTTPResponseHeaderModification"
26+
27+
// This option indicates support for Destination Port matching (extended conformance).
28+
SupportRouteDestinationPortMatching SupportedFeature = "RouteDestinationPortMatching"
29+
30+
// This option indicates GatewayClass will update the observedGeneration in it's conditions when reconciling
31+
SupportGatewayClassObservedGenerationBump SupportedFeature = "GatewayClassObservedGenerationBump"
32+
33+
// This option indicates support for HTTPRoute port redirect (extended conformance).
34+
SupportHTTPRoutePortRedirect SupportedFeature = "HTTPRoutePortRedirect"
35+
36+
// This option indicates support for HTTPRoute scheme redirect (extended conformance).
37+
SupportHTTPRouteSchemeRedirect SupportedFeature = "HTTPRouteSchemeRedirect"
38+
39+
// This option indicates support for HTTPRoute path redirect (experimental conformance).
40+
SupportHTTPRoutePathRedirect SupportedFeature = "HTTPRoutePathRedirect"
41+
42+
// This option indicates support for HTTPRoute host rewrite (experimental conformance)
43+
SupportHTTPRouteHostRewrite SupportedFeature = "HTTPRouteHostRewrite"
44+
45+
// This option indicates support for HTTPRoute path rewrite (experimental conformance)
46+
SupportHTTPRoutePathRewrite SupportedFeature = "HTTPRoutePathRewrite"
47+
)
48+
49+
// StandardCoreFeatures are the features that are required to be conformant with
50+
// the Core API features that are part of the Standard release channel.
51+
var StandardCoreFeatures = sets.New(
52+
SupportReferenceGrant,
53+
)
54+
55+
// AllFeatures contains all the supported features and can be used to run all
56+
// conformance tests with `all-features` flag.
57+
//
58+
// Note that the AllFeatures must in sync with defined features when the
59+
// feature constants change.
60+
var AllFeatures = sets.New(
61+
SupportReferenceGrant,
62+
SupportTLSRoute,
63+
SupportHTTPRouteQueryParamMatching,
64+
SupportHTTPRouteMethodMatching,
65+
SupportHTTPResponseHeaderModification,
66+
SupportRouteDestinationPortMatching,
67+
SupportGatewayClassObservedGenerationBump,
68+
SupportHTTPRoutePortRedirect,
69+
SupportHTTPRouteSchemeRedirect,
70+
SupportHTTPRoutePathRedirect,
71+
SupportHTTPRouteHostRewrite,
72+
SupportHTTPRoutePathRewrite,
73+
)

conformance/utils/suite/suite.go

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -28,76 +28,6 @@ import (
2828
"sigs.k8s.io/gateway-api/conformance/utils/roundtripper"
2929
)
3030

31-
// SupportedFeature allows opting in to additional conformance tests at an
32-
// individual feature granularity.
33-
type SupportedFeature string
34-
35-
const (
36-
// This option indicates support for ReferenceGrant (core conformance).
37-
// Opting out of this requires an implementation to have clearly implemented
38-
// and documented equivalent safeguards.
39-
SupportReferenceGrant SupportedFeature = "ReferenceGrant"
40-
41-
// This option indicates support for TLSRoute (extended conformance).
42-
SupportTLSRoute SupportedFeature = "TLSRoute"
43-
44-
// This option indicates support for HTTPRoute query param matching (extended conformance).
45-
SupportHTTPRouteQueryParamMatching SupportedFeature = "HTTPRouteQueryParamMatching"
46-
47-
// This option indicates support for HTTPRoute method matching (extended conformance).
48-
SupportHTTPRouteMethodMatching SupportedFeature = "HTTPRouteMethodMatching"
49-
50-
// This option indicates support for HTTPRoute response header modification (extended conformance).
51-
SupportHTTPResponseHeaderModification SupportedFeature = "HTTPResponseHeaderModification"
52-
53-
// This option indicates support for Destination Port matching (extended conformance).
54-
SupportRouteDestinationPortMatching SupportedFeature = "RouteDestinationPortMatching"
55-
56-
// This option indicates GatewayClass will update the observedGeneration in it's conditions when reconciling
57-
SupportGatewayClassObservedGenerationBump SupportedFeature = "GatewayClassObservedGenerationBump"
58-
59-
// This option indicates support for HTTPRoute port redirect (extended conformance).
60-
SupportHTTPRoutePortRedirect SupportedFeature = "HTTPRoutePortRedirect"
61-
62-
// This option indicates support for HTTPRoute scheme redirect (extended conformance).
63-
SupportHTTPRouteSchemeRedirect SupportedFeature = "HTTPRouteSchemeRedirect"
64-
65-
// This option indicates support for HTTPRoute path redirect (experimental conformance).
66-
SupportHTTPRoutePathRedirect SupportedFeature = "HTTPRoutePathRedirect"
67-
68-
// This option indicates support for HTTPRoute host rewrite (experimental conformance)
69-
SupportHTTPRouteHostRewrite SupportedFeature = "HTTPRouteHostRewrite"
70-
71-
// This option indicates support for HTTPRoute path rewrite (experimental conformance)
72-
SupportHTTPRoutePathRewrite SupportedFeature = "HTTPRoutePathRewrite"
73-
)
74-
75-
// StandardCoreFeatures are the features that are required to be conformant with
76-
// the Core API features that are part of the Standard release channel.
77-
var StandardCoreFeatures = sets.New(
78-
SupportReferenceGrant,
79-
)
80-
81-
// AllFeatures contains all the supported features and can be used to run all
82-
// conformance tests with `all-features` flag.
83-
//
84-
// Note that the AllFeatures must in sync with defined features when the
85-
// feature constants change.
86-
var AllFeatures = sets.New(
87-
SupportReferenceGrant,
88-
SupportTLSRoute,
89-
SupportHTTPRouteQueryParamMatching,
90-
SupportHTTPRouteMethodMatching,
91-
SupportHTTPResponseHeaderModification,
92-
SupportRouteDestinationPortMatching,
93-
SupportGatewayClassObservedGenerationBump,
94-
SupportHTTPRoutePortRedirect,
95-
SupportHTTPRouteSchemeRedirect,
96-
SupportHTTPRoutePathRedirect,
97-
SupportHTTPRouteHostRewrite,
98-
SupportHTTPRoutePathRewrite,
99-
)
100-
10131
// ConformanceTestSuite defines the test suite used to run Gateway API
10232
// conformance tests.
10333
type ConformanceTestSuite struct {

0 commit comments

Comments
 (0)