Skip to content

Commit 241c4a0

Browse files
authored
removing required markder for Code (#630)
Signed-off-by: Jaydip Gabani <[email protected]>
1 parent e0aa3a7 commit 241c4a0

File tree

3 files changed

+38
-24
lines changed

3 files changed

+38
-24
lines changed

constraint/config/crds/templates.gatekeeper.sh_constrainttemplates.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ spec:
109109
type: string
110110
target:
111111
type: string
112-
required:
113-
- code
114112
type: object
115113
type: array
116114
type: object

constraint/deploy/crds.yaml

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ spec:
1717
- name: v1
1818
schema:
1919
openAPIV3Schema:
20-
description: ConstraintTemplate is the Schema for the constrainttemplates API
20+
description: ConstraintTemplate is the Schema for the constrainttemplates
21+
API
2122
properties:
2223
apiVersion:
2324
description: |-
@@ -75,7 +76,8 @@ spec:
7576
items:
7677
properties:
7778
engine:
78-
description: 'The engine used to evaluate the code. Example: "Rego". Required.'
79+
description: 'The engine used to evaluate the code. Example:
80+
"Rego". Required.'
7981
type: string
8082
source:
8183
description: The source code for the template. Required.
@@ -107,8 +109,6 @@ spec:
107109
type: string
108110
target:
109111
type: string
110-
required:
111-
- code
112112
type: object
113113
type: array
114114
type: object
@@ -123,7 +123,8 @@ spec:
123123
properties:
124124
errors:
125125
items:
126-
description: CreateCRDError represents a single error caught during parsing, compiling, etc.
126+
description: CreateCRDError represents a single error caught
127+
during parsing, compiling, etc.
127128
properties:
128129
code:
129130
type: string
@@ -137,7 +138,8 @@ spec:
137138
type: object
138139
type: array
139140
id:
140-
description: a unique identifier for the pod that wrote the status
141+
description: a unique identifier for the pod that wrote the
142+
status
141143
type: string
142144
observedGeneration:
143145
format: int64
@@ -156,7 +158,8 @@ spec:
156158
- name: v1alpha1
157159
schema:
158160
openAPIV3Schema:
159-
description: ConstraintTemplate is the Schema for the constrainttemplates API
161+
description: ConstraintTemplate is the Schema for the constrainttemplates
162+
API
160163
properties:
161164
apiVersion:
162165
description: |-
@@ -214,7 +217,8 @@ spec:
214217
items:
215218
properties:
216219
engine:
217-
description: 'The engine used to evaluate the code. Example: "Rego". Required.'
220+
description: 'The engine used to evaluate the code. Example:
221+
"Rego". Required.'
218222
type: string
219223
source:
220224
description: The source code for the template. Required.
@@ -260,7 +264,8 @@ spec:
260264
properties:
261265
errors:
262266
items:
263-
description: CreateCRDError represents a single error caught during parsing, compiling, etc.
267+
description: CreateCRDError represents a single error caught
268+
during parsing, compiling, etc.
264269
properties:
265270
code:
266271
type: string
@@ -274,7 +279,8 @@ spec:
274279
type: object
275280
type: array
276281
id:
277-
description: a unique identifier for the pod that wrote the status
282+
description: a unique identifier for the pod that wrote the
283+
status
278284
type: string
279285
observedGeneration:
280286
format: int64
@@ -293,7 +299,8 @@ spec:
293299
- name: v1beta1
294300
schema:
295301
openAPIV3Schema:
296-
description: ConstraintTemplate is the Schema for the constrainttemplates API
302+
description: ConstraintTemplate is the Schema for the constrainttemplates
303+
API
297304
properties:
298305
apiVersion:
299306
description: |-
@@ -351,7 +358,8 @@ spec:
351358
items:
352359
properties:
353360
engine:
354-
description: 'The engine used to evaluate the code. Example: "Rego". Required.'
361+
description: 'The engine used to evaluate the code. Example:
362+
"Rego". Required.'
355363
type: string
356364
source:
357365
description: The source code for the template. Required.
@@ -397,7 +405,8 @@ spec:
397405
properties:
398406
errors:
399407
items:
400-
description: CreateCRDError represents a single error caught during parsing, compiling, etc.
408+
description: CreateCRDError represents a single error caught
409+
during parsing, compiling, etc.
401410
properties:
402411
code:
403412
type: string
@@ -411,7 +420,8 @@ spec:
411420
type: object
412421
type: array
413422
id:
414-
description: a unique identifier for the pod that wrote the status
423+
description: a unique identifier for the pod that wrote the
424+
status
415425
type: string
416426
observedGeneration:
417427
format: int64
@@ -444,7 +454,8 @@ spec:
444454
scope: Cluster
445455
versions:
446456
- deprecated: true
447-
deprecationWarning: externaldata.gatekeeper.sh/v1alpha1 is deprecated. Use externaldata.gatekeeper.sh/v1beta1 instead.
457+
deprecationWarning: externaldata.gatekeeper.sh/v1alpha1 is deprecated. Use externaldata.gatekeeper.sh/v1beta1
458+
instead.
448459
name: v1alpha1
449460
schema:
450461
openAPIV3Schema:
@@ -479,7 +490,8 @@ spec:
479490
description: Timeout is the timeout when querying the provider.
480491
type: integer
481492
url:
482-
description: URL is the url for the provider. URL is prefixed with https://.
493+
description: URL is the url for the provider. URL is prefixed with
494+
https://.
483495
type: string
484496
type: object
485497
status:
@@ -488,13 +500,15 @@ spec:
488500
byPod:
489501
description: ByPod is the status of the provider by pod
490502
items:
491-
description: ProviderPodStatusStatus defines the observed state of ProviderPodStatus.
503+
description: ProviderPodStatusStatus defines the observed state
504+
of ProviderPodStatus.
492505
properties:
493506
active:
494507
type: boolean
495508
errors:
496509
items:
497-
description: ProviderError represents a single error caught while managing providers.
510+
description: ProviderError represents a single error caught
511+
while managing providers.
498512
properties:
499513
errorTimestamp:
500514
format: date-time
@@ -575,7 +589,8 @@ spec:
575589
description: Timeout is the timeout when querying the provider.
576590
type: integer
577591
url:
578-
description: URL is the url for the provider. URL is prefixed with https://.
592+
description: URL is the url for the provider. URL is prefixed with
593+
https://.
579594
type: string
580595
type: object
581596
status:
@@ -584,13 +599,15 @@ spec:
584599
byPod:
585600
description: ByPod is the status of the provider by pod
586601
items:
587-
description: ProviderPodStatusStatus defines the observed state of ProviderPodStatus.
602+
description: ProviderPodStatusStatus defines the observed state
603+
of ProviderPodStatus.
588604
properties:
589605
active:
590606
type: boolean
591607
errors:
592608
items:
593-
description: ProviderError represents a single error caught while managing providers.
609+
description: ProviderError represents a single error caught
610+
while managing providers.
594611
properties:
595612
errorTimestamp:
596613
format: date-time

constraint/pkg/apis/templates/v1/constrainttemplate_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ type Target struct {
6464
// be specified in one place (either here or in the "rego" field)
6565
// +listType=map
6666
// +listMapKey=engine
67-
// +kubebuilder:validation:Required
6867
Code []Code `json:"code,omitempty"`
6968

7069
// +kubebuilder:validation:items:Enum=*;CREATE;DELETE;UPDATE;CONNECT

0 commit comments

Comments
 (0)