Skip to content

Commit 82f814d

Browse files
hdurand0710oktalz
authored andcommitted
TEST/MEDIUM: add missing CRDs to envtest
Adding the experimental Gateway API CRDs to the envtest setup to remove the current error of missing CRDs during integration tests. Preparing the environment if we wish to add tests for TLSRoutes.
1 parent 154843c commit 82f814d

13 files changed

Lines changed: 17322 additions & 0 deletions

taskfile/envtest.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ tasks:
1313
- cd /{{.TMP}} && csplit --elide-empty-files -f gatewayapicrd- -z --suffix-format='%02d.yaml' standard-install.yaml "/^---$/" "{*}"
1414
- mkdir -p crds
1515
- mv /{{.TMP}}/gatewayapicrd-* {{.OUTDIR}}
16+
- curl -L -o /{{.TMP}}/experimental-install.yaml {{.GATEWAYAPI_EXPERIMENTAL_CRDS_DOWNLOAD_URL}}
17+
- cd /{{.TMP}} && csplit --elide-empty-files -f gatewayapicrdexp- -z --suffix-format='%02d.yaml' experimental-install.yaml "/^---$/" "{*}"
18+
- mkdir -p crds
19+
- mv /{{.TMP}}/gatewayapicrdexp-* {{.OUTDIR}}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2025 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
#
16+
# Gateway API Experimental channel install
17+
#

test/integration/api/gatewayapicrdexp-01.yaml

Lines changed: 651 additions & 0 deletions
Large diffs are not rendered by default.

test/integration/api/gatewayapicrdexp-02.yaml

Lines changed: 520 additions & 0 deletions
Large diffs are not rendered by default.

test/integration/api/gatewayapicrdexp-03.yaml

Lines changed: 2708 additions & 0 deletions
Large diffs are not rendered by default.

test/integration/api/gatewayapicrdexp-04.yaml

Lines changed: 2221 additions & 0 deletions
Large diffs are not rendered by default.

test/integration/api/gatewayapicrdexp-05.yaml

Lines changed: 7282 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
---
2+
#
3+
# config/crd/experimental/gateway.networking.k8s.io_referencegrants.yaml
4+
#
5+
apiVersion: apiextensions.k8s.io/v1
6+
kind: CustomResourceDefinition
7+
metadata:
8+
annotations:
9+
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/3328
10+
gateway.networking.k8s.io/bundle-version: v1.3.0
11+
gateway.networking.k8s.io/channel: experimental
12+
creationTimestamp: null
13+
name: referencegrants.gateway.networking.k8s.io
14+
spec:
15+
group: gateway.networking.k8s.io
16+
names:
17+
categories:
18+
- gateway-api
19+
kind: ReferenceGrant
20+
listKind: ReferenceGrantList
21+
plural: referencegrants
22+
shortNames:
23+
- refgrant
24+
singular: referencegrant
25+
scope: Namespaced
26+
versions:
27+
- additionalPrinterColumns:
28+
- jsonPath: .metadata.creationTimestamp
29+
name: Age
30+
type: date
31+
name: v1beta1
32+
schema:
33+
openAPIV3Schema:
34+
description: |-
35+
ReferenceGrant identifies kinds of resources in other namespaces that are
36+
trusted to reference the specified kinds of resources in the same namespace
37+
as the policy.
38+
39+
Each ReferenceGrant can be used to represent a unique trust relationship.
40+
Additional Reference Grants can be used to add to the set of trusted
41+
sources of inbound references for the namespace they are defined within.
42+
43+
All cross-namespace references in Gateway API (with the exception of cross-namespace
44+
Gateway-route attachment) require a ReferenceGrant.
45+
46+
ReferenceGrant is a form of runtime verification allowing users to assert
47+
which cross-namespace object references are permitted. Implementations that
48+
support ReferenceGrant MUST NOT permit cross-namespace references which have
49+
no grant, and MUST respond to the removal of a grant by revoking the access
50+
that the grant allowed.
51+
properties:
52+
apiVersion:
53+
description: |-
54+
APIVersion defines the versioned schema of this representation of an object.
55+
Servers should convert recognized schemas to the latest internal value, and
56+
may reject unrecognized values.
57+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
58+
type: string
59+
kind:
60+
description: |-
61+
Kind is a string value representing the REST resource this object represents.
62+
Servers may infer this from the endpoint the client submits requests to.
63+
Cannot be updated.
64+
In CamelCase.
65+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
66+
type: string
67+
metadata:
68+
type: object
69+
spec:
70+
description: Spec defines the desired state of ReferenceGrant.
71+
properties:
72+
from:
73+
description: |-
74+
From describes the trusted namespaces and kinds that can reference the
75+
resources described in "To". Each entry in this list MUST be considered
76+
to be an additional place that references can be valid from, or to put
77+
this another way, entries MUST be combined using OR.
78+
79+
Support: Core
80+
items:
81+
description: ReferenceGrantFrom describes trusted namespaces and
82+
kinds.
83+
properties:
84+
group:
85+
description: |-
86+
Group is the group of the referent.
87+
When empty, the Kubernetes core API group is inferred.
88+
89+
Support: Core
90+
maxLength: 253
91+
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
92+
type: string
93+
kind:
94+
description: |-
95+
Kind is the kind of the referent. Although implementations may support
96+
additional resources, the following types are part of the "Core"
97+
support level for this field.
98+
99+
When used to permit a SecretObjectReference:
100+
101+
* Gateway
102+
103+
When used to permit a BackendObjectReference:
104+
105+
* GRPCRoute
106+
* HTTPRoute
107+
* TCPRoute
108+
* TLSRoute
109+
* UDPRoute
110+
maxLength: 63
111+
minLength: 1
112+
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
113+
type: string
114+
namespace:
115+
description: |-
116+
Namespace is the namespace of the referent.
117+
118+
Support: Core
119+
maxLength: 63
120+
minLength: 1
121+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
122+
type: string
123+
required:
124+
- group
125+
- kind
126+
- namespace
127+
type: object
128+
maxItems: 16
129+
minItems: 1
130+
type: array
131+
to:
132+
description: |-
133+
To describes the resources that may be referenced by the resources
134+
described in "From". Each entry in this list MUST be considered to be an
135+
additional place that references can be valid to, or to put this another
136+
way, entries MUST be combined using OR.
137+
138+
Support: Core
139+
items:
140+
description: |-
141+
ReferenceGrantTo describes what Kinds are allowed as targets of the
142+
references.
143+
properties:
144+
group:
145+
description: |-
146+
Group is the group of the referent.
147+
When empty, the Kubernetes core API group is inferred.
148+
149+
Support: Core
150+
maxLength: 253
151+
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
152+
type: string
153+
kind:
154+
description: |-
155+
Kind is the kind of the referent. Although implementations may support
156+
additional resources, the following types are part of the "Core"
157+
support level for this field:
158+
159+
* Secret when used to permit a SecretObjectReference
160+
* Service when used to permit a BackendObjectReference
161+
maxLength: 63
162+
minLength: 1
163+
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
164+
type: string
165+
name:
166+
description: |-
167+
Name is the name of the referent. When unspecified, this policy
168+
refers to all resources of the specified Group and Kind in the local
169+
namespace.
170+
maxLength: 253
171+
minLength: 1
172+
type: string
173+
required:
174+
- group
175+
- kind
176+
type: object
177+
maxItems: 16
178+
minItems: 1
179+
type: array
180+
required:
181+
- from
182+
- to
183+
type: object
184+
type: object
185+
served: true
186+
storage: true
187+
subresources: {}
188+
status:
189+
acceptedNames:
190+
kind: ""
191+
plural: ""
192+
conditions: null
193+
storedVersions: null

0 commit comments

Comments
 (0)