Skip to content

Commit cf69624

Browse files
fix: remove deprecated spec.preserveUnknownFields (#644)
* fix: remove deprecated spec.preserveUnknownFields The preserveUnknownFields field is deprecated in CRD v1 and defaults to false. Explicitly setting it is unnecessary and triggers deprecation warnings. Signed-off-by: meskinemohamed <mohamed.meskine@dataiku.com> * chore: regenerate manifests and yaml_constant.go Run make manifests && make generate to update generated files after removing deprecated spec.preserveUnknownFields. Signed-off-by: meskinemohamed <mohamed.meskine@dataiku.com> --------- Signed-off-by: meskinemohamed <mohamed.meskine@dataiku.com> Co-authored-by: Jaydip Gabani <gabanijaydip@gmail.com>
1 parent a6875f5 commit cf69624

File tree

3 files changed

+26
-27
lines changed

3 files changed

+26
-27
lines changed
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
13
resources:
24
- templates.gatekeeper.sh_constrainttemplates.yaml
35
- externaldata.gatekeeper.sh_providers.yaml
4-
5-
apiVersion: kustomize.config.k8s.io/v1beta1
6-
kind: Kustomization
7-
patches:
8-
- patch: |-
9-
apiVersion: apiextensions.k8s.io/v1
10-
kind: CustomResourceDefinition
11-
metadata:
12-
name: constrainttemplates.templates.gatekeeper.sh
13-
spec:
14-
preserveUnknownFields: false

constraint/deploy/crds.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ spec:
1111
listKind: ConstraintTemplateList
1212
plural: constrainttemplates
1313
singular: constrainttemplate
14-
preserveUnknownFields: false
1514
scope: Cluster
1615
versions:
1716
- name: v1

constraint/pkg/schema/yaml_constant.go

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ spec:
1616
listKind: ConstraintTemplateList
1717
plural: constrainttemplates
1818
singular: constrainttemplate
19-
preserveUnknownFields: false
2019
scope: Cluster
2120
versions:
2221
- name: v1
2322
schema:
2423
openAPIV3Schema:
25-
description: ConstraintTemplate is the Schema for the constrainttemplates API
24+
description: ConstraintTemplate is the Schema for the constrainttemplates
25+
API
2626
properties:
2727
apiVersion:
2828
description: |-
@@ -80,7 +80,8 @@ spec:
8080
items:
8181
properties:
8282
engine:
83-
description: 'The engine used to evaluate the code. Example: "Rego". Required.'
83+
description: 'The engine used to evaluate the code. Example:
84+
"Rego". Required.'
8485
type: string
8586
source:
8687
description: The source code for the template. Required.
@@ -112,8 +113,6 @@ spec:
112113
type: string
113114
target:
114115
type: string
115-
required:
116-
- code
117116
type: object
118117
type: array
119118
type: object
@@ -128,7 +127,8 @@ spec:
128127
properties:
129128
errors:
130129
items:
131-
description: CreateCRDError represents a single error caught during parsing, compiling, etc.
130+
description: CreateCRDError represents a single error caught
131+
during parsing, compiling, etc.
132132
properties:
133133
code:
134134
type: string
@@ -142,7 +142,8 @@ spec:
142142
type: object
143143
type: array
144144
id:
145-
description: a unique identifier for the pod that wrote the status
145+
description: a unique identifier for the pod that wrote the
146+
status
146147
type: string
147148
observedGeneration:
148149
format: int64
@@ -161,7 +162,8 @@ spec:
161162
- name: v1alpha1
162163
schema:
163164
openAPIV3Schema:
164-
description: ConstraintTemplate is the Schema for the constrainttemplates API
165+
description: ConstraintTemplate is the Schema for the constrainttemplates
166+
API
165167
properties:
166168
apiVersion:
167169
description: |-
@@ -219,7 +221,8 @@ spec:
219221
items:
220222
properties:
221223
engine:
222-
description: 'The engine used to evaluate the code. Example: "Rego". Required.'
224+
description: 'The engine used to evaluate the code. Example:
225+
"Rego". Required.'
223226
type: string
224227
source:
225228
description: The source code for the template. Required.
@@ -265,7 +268,8 @@ spec:
265268
properties:
266269
errors:
267270
items:
268-
description: CreateCRDError represents a single error caught during parsing, compiling, etc.
271+
description: CreateCRDError represents a single error caught
272+
during parsing, compiling, etc.
269273
properties:
270274
code:
271275
type: string
@@ -279,7 +283,8 @@ spec:
279283
type: object
280284
type: array
281285
id:
282-
description: a unique identifier for the pod that wrote the status
286+
description: a unique identifier for the pod that wrote the
287+
status
283288
type: string
284289
observedGeneration:
285290
format: int64
@@ -298,7 +303,8 @@ spec:
298303
- name: v1beta1
299304
schema:
300305
openAPIV3Schema:
301-
description: ConstraintTemplate is the Schema for the constrainttemplates API
306+
description: ConstraintTemplate is the Schema for the constrainttemplates
307+
API
302308
properties:
303309
apiVersion:
304310
description: |-
@@ -356,7 +362,8 @@ spec:
356362
items:
357363
properties:
358364
engine:
359-
description: 'The engine used to evaluate the code. Example: "Rego". Required.'
365+
description: 'The engine used to evaluate the code. Example:
366+
"Rego". Required.'
360367
type: string
361368
source:
362369
description: The source code for the template. Required.
@@ -402,7 +409,8 @@ spec:
402409
properties:
403410
errors:
404411
items:
405-
description: CreateCRDError represents a single error caught during parsing, compiling, etc.
412+
description: CreateCRDError represents a single error caught
413+
during parsing, compiling, etc.
406414
properties:
407415
code:
408416
type: string
@@ -416,7 +424,8 @@ spec:
416424
type: object
417425
type: array
418426
id:
419-
description: a unique identifier for the pod that wrote the status
427+
description: a unique identifier for the pod that wrote the
428+
status
420429
type: string
421430
observedGeneration:
422431
format: int64

0 commit comments

Comments
 (0)