Skip to content

Commit cf2ca12

Browse files
vishal-chdhryeddycharly
authored andcommitted
chore: bump controller gen to 0.14.0 (kyverno#9953)
* chore: update controller-gen version and cmd controller gen throws an error when multiple instances of the same generator 'crd' in this case is specified. See: kubernetes-sigs/controller-tools#829 Signed-off-by: Vishal Choudhary <[email protected]> * chore: generate code Signed-off-by: Vishal Choudhary <[email protected]> --------- Signed-off-by: Vishal Choudhary <[email protected]> Co-authored-by: Charles-Edouard Brétéché <[email protected]>
1 parent 7bd03df commit cf2ca12

35 files changed

+58083
-72776
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ TOOLS_DIR ?= $(PWD)/.tools
3636
KIND ?= $(TOOLS_DIR)/kind
3737
KIND_VERSION ?= v0.21.0
3838
CONTROLLER_GEN ?= $(TOOLS_DIR)/controller-gen
39-
CONTROLLER_GEN_VERSION ?= v0.12.0
39+
CONTROLLER_GEN_VERSION ?= v0.14.0
4040
CLIENT_GEN ?= $(TOOLS_DIR)/client-gen
4141
LISTER_GEN ?= $(TOOLS_DIR)/lister-gen
4242
INFORMER_GEN ?= $(TOOLS_DIR)/informer-gen
@@ -497,25 +497,25 @@ codegen-client-all: codegen-register codegen-defaulters codegen-applyconfigurati
497497
codegen-crds-kyverno: $(CONTROLLER_GEN) ## Generate kyverno CRDs
498498
@echo Generate kyverno crds... >&2
499499
@rm -rf $(CRDS_PATH)/kyverno && mkdir -p $(CRDS_PATH)/kyverno
500-
@$(CONTROLLER_GEN) crd paths=./api/kyverno/... crd:crdVersions=v1 output:dir=$(CRDS_PATH)/kyverno
500+
@$(CONTROLLER_GEN) paths=./api/kyverno/... crd:crdVersions=v1 output:dir=$(CRDS_PATH)/kyverno
501501

502502
.PHONY: codegen-crds-policyreport
503503
codegen-crds-policyreport: $(CONTROLLER_GEN) ## Generate policy reports CRDs
504504
@echo Generate policy reports crds... >&2
505505
@rm -rf $(CRDS_PATH)/policyreport && mkdir -p $(CRDS_PATH)/policyreport
506-
@$(CONTROLLER_GEN) crd paths=./api/policyreport/... crd:crdVersions=v1 output:dir=$(CRDS_PATH)/policyreport
506+
@$(CONTROLLER_GEN) paths=./api/policyreport/... crd:crdVersions=v1 output:dir=$(CRDS_PATH)/policyreport
507507

508508
.PHONY: codegen-crds-reports
509509
codegen-crds-reports: $(CONTROLLER_GEN) ## Generate reports CRDs
510510
@echo Generate reports crds... >&2
511511
@rm -rf $(CRDS_PATH)/reports && mkdir -p $(CRDS_PATH)/reports
512-
@$(CONTROLLER_GEN) crd paths=./api/reports/... crd:crdVersions=v1 output:dir=$(CRDS_PATH)/reports
512+
@$(CONTROLLER_GEN) paths=./api/reports/... crd:crdVersions=v1 output:dir=$(CRDS_PATH)/reports
513513

514514
.PHONY: codegen-crds-cli
515515
codegen-crds-cli: $(CONTROLLER_GEN) ## Generate CLI CRDs
516516
@echo Generate cli crds... >&2
517517
@rm -rf ${PWD}/cmd/cli/kubectl-kyverno/config/crds && mkdir -p ${PWD}/cmd/cli/kubectl-kyverno/config/crds
518-
@$(CONTROLLER_GEN) crd paths=./cmd/cli/kubectl-kyverno/apis/... crd:crdVersions=v1 output:dir=${PWD}/cmd/cli/kubectl-kyverno/config/crds
518+
@$(CONTROLLER_GEN) paths=./cmd/cli/kubectl-kyverno/apis/... crd:crdVersions=v1 output:dir=${PWD}/cmd/cli/kubectl-kyverno/config/crds
519519

520520
.PHONY: codegen-crds-all
521521
codegen-crds-all: codegen-crds-kyverno codegen-crds-policyreport codegen-crds-reports codegen-cli-crds ## Generate all CRDs

charts/kyverno/charts/crds/templates/kyverno.io/kyverno.io_admissionreports.yaml

Lines changed: 201 additions & 181 deletions
Large diffs are not rendered by default.

charts/kyverno/charts/crds/templates/kyverno.io/kyverno.io_backgroundscanreports.yaml

Lines changed: 165 additions & 161 deletions
Large diffs are not rendered by default.

charts/kyverno/charts/crds/templates/kyverno.io/kyverno.io_cleanuppolicies.yaml

Lines changed: 1225 additions & 1354 deletions
Large diffs are not rendered by default.

charts/kyverno/charts/crds/templates/kyverno.io/kyverno.io_clusteradmissionreports.yaml

Lines changed: 201 additions & 181 deletions
Large diffs are not rendered by default.

charts/kyverno/charts/crds/templates/kyverno.io/kyverno.io_clusterbackgroundscanreports.yaml

Lines changed: 165 additions & 161 deletions
Large diffs are not rendered by default.

charts/kyverno/charts/crds/templates/kyverno.io/kyverno.io_clustercleanuppolicies.yaml

Lines changed: 1225 additions & 1354 deletions
Large diffs are not rendered by default.

charts/kyverno/charts/crds/templates/kyverno.io/kyverno.io_clusterpolicies.yaml

Lines changed: 5511 additions & 7252 deletions
Large diffs are not rendered by default.

charts/kyverno/charts/crds/templates/kyverno.io/kyverno.io_globalcontextentries.yaml

Lines changed: 81 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
{{- with .Values.annotations }}
1010
{{- toYaml . | nindent 4 }}
1111
{{- end }}
12-
controller-gen.kubebuilder.io/version: v0.12.0
12+
controller-gen.kubebuilder.io/version: v0.14.0
1313
name: globalcontextentries.kyverno.io
1414
spec:
1515
group: kyverno.io
@@ -43,32 +43,38 @@ spec:
4343
description: GlobalContextEntry declares resources to be cached.
4444
properties:
4545
apiVersion:
46-
description: 'APIVersion defines the versioned schema of this representation
47-
of an object. Servers should convert recognized schemas to the latest
48-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
46+
description: |-
47+
APIVersion defines the versioned schema of this representation of an object.
48+
Servers should convert recognized schemas to the latest internal value, and
49+
may reject unrecognized values.
50+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
4951
type: string
5052
kind:
51-
description: 'Kind is a string value representing the REST resource this
52-
object represents. Servers may infer this from the endpoint the client
53-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
53+
description: |-
54+
Kind is a string value representing the REST resource this object represents.
55+
Servers may infer this from the endpoint the client submits requests to.
56+
Cannot be updated.
57+
In CamelCase.
58+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
5459
type: string
5560
metadata:
5661
type: object
5762
spec:
5863
description: Spec declares policy exception behaviors.
5964
properties:
6065
apiCall:
61-
description: 'Stores results from an API call which will be cached.
62-
Mutually exclusive with KubernetesResource. This can be used to
63-
make calls to external (non-Kubernetes API server) services. It
64-
can also be used to make calls to the Kubernetes API server in such
65-
cases: 1. A POST is needed to create a resource. 2. Finer-grained
66-
control is needed. Example: To restrict the number of resources
67-
cached.'
66+
description: |-
67+
Stores results from an API call which will be cached.
68+
Mutually exclusive with KubernetesResource.
69+
This can be used to make calls to external (non-Kubernetes API server) services.
70+
It can also be used to make calls to the Kubernetes API server in such cases:
71+
1. A POST is needed to create a resource.
72+
2. Finer-grained control is needed. Example: To restrict the number of resources cached.
6873
properties:
6974
data:
70-
description: The data object specifies the POST data sent to the
71-
server. Only applicable when the method field is set to POST.
75+
description: |-
76+
The data object specifies the POST data sent to the server.
77+
Only applicable when the method field is set to POST.
7278
items:
7379
description: RequestData contains the HTTP POST data
7480
properties:
@@ -93,54 +99,58 @@ spec:
9399
type: string
94100
refreshInterval:
95101
default: 10m
96-
description: RefreshInterval defines the interval in duration
97-
at which to poll the APICall. The duration is a sequence of
98-
decimal numbers, each with optional fraction and a unit suffix,
99-
such as "300ms", "1.5h" or "2h45m". Valid time units are "ns",
100-
"us" (or "µs"), "ms", "s", "m", "h".
102+
description: |-
103+
RefreshInterval defines the interval in duration at which to poll the APICall.
104+
The duration is a sequence of decimal numbers, each with optional fraction and a unit suffix,
105+
such as "300ms", "1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
101106
format: duration
102107
type: string
103108
service:
104-
description: Service is an API call to a JSON web service. This
105-
is used for non-Kubernetes API server calls. It's mutually exclusive
106-
with the URLPath field.
109+
description: |-
110+
Service is an API call to a JSON web service.
111+
This is used for non-Kubernetes API server calls.
112+
It's mutually exclusive with the URLPath field.
107113
properties:
108114
caBundle:
109-
description: CABundle is a PEM encoded CA bundle which will
110-
be used to validate the server certificate.
115+
description: |-
116+
CABundle is a PEM encoded CA bundle which will be used to validate
117+
the server certificate.
111118
type: string
112119
url:
113-
description: URL is the JSON web service URL. A typical form
114-
is `https://{service}.{namespace}:{port}/{path}`.
120+
description: |-
121+
URL is the JSON web service URL. A typical form is
122+
`https://{service}.{namespace}:{port}/{path}`.
115123
type: string
116124
required:
117125
- url
118126
type: object
119127
urlPath:
120-
description: URLPath is the URL path to be used in the HTTP GET
121-
or POST request to the Kubernetes API server (e.g. "/api/v1/namespaces"
122-
or "/apis/apps/v1/deployments"). The format required is the
123-
same format used by the `kubectl get --raw` command. See https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
124-
for details. It's mutually exclusive with the Service field.
128+
description: |-
129+
URLPath is the URL path to be used in the HTTP GET or POST request to the
130+
Kubernetes API server (e.g. "/api/v1/namespaces" or "/apis/apps/v1/deployments").
131+
The format required is the same format used by the `kubectl get --raw` command.
132+
See https://kyverno.io/docs/writing-policies/external-data-sources/#variables-from-kubernetes-api-server-calls
133+
for details.
134+
It's mutually exclusive with the Service field.
125135
type: string
126136
type: object
127137
kubernetesResource:
128-
description: Stores a list of Kubernetes resources which will be cached.
138+
description: |-
139+
Stores a list of Kubernetes resources which will be cached.
129140
Mutually exclusive with APICall.
130141
properties:
131142
group:
132143
description: Group defines the group of the resource.
133144
type: string
134145
namespace:
135-
description: Namespace defines the namespace of the resource.
136-
Leave empty for cluster scoped resources. If left empty for
137-
namespaced resources, all resources from all namespaces will
138-
be cached.
146+
description: |-
147+
Namespace defines the namespace of the resource. Leave empty for cluster scoped resources.
148+
If left empty for namespaced resources, all resources from all namespaces will be cached.
139149
type: string
140150
resource:
141-
description: Resource defines the type of the resource. Requires
142-
the pluralized form of the resource kind in lowercase. (Ex.,
143-
"deployments")
151+
description: |-
152+
Resource defines the type of the resource.
153+
Requires the pluralized form of the resource kind in lowercase. (Ex., "deployments")
144154
type: string
145155
version:
146156
description: Version defines the version of the resource.
@@ -157,42 +167,42 @@ spec:
157167
conditions:
158168
items:
159169
description: "Condition contains details for one aspect of the current
160-
state of this API Resource. --- This struct is intended for direct
161-
use as an array at the field path .status.conditions. For example,
162-
\n type FooStatus struct{ // Represents the observations of a
163-
foo's current state. // Known .status.conditions.type are: \"Available\",
164-
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
165-
// +listType=map // +listMapKey=type Conditions []metav1.Condition
166-
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
167-
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
170+
state of this API Resource.\n---\nThis struct is intended for
171+
direct use as an array at the field path .status.conditions. For
172+
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
173+
observations of a foo's current state.\n\t // Known .status.conditions.type
174+
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
175+
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
176+
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
177+
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
178+
\ // other fields\n\t}"
168179
properties:
169180
lastTransitionTime:
170-
description: lastTransitionTime is the last time the condition
171-
transitioned from one status to another. This should be when
172-
the underlying condition changed. If that is not known, then
173-
using the time when the API field changed is acceptable.
181+
description: |-
182+
lastTransitionTime is the last time the condition transitioned from one status to another.
183+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
174184
format: date-time
175185
type: string
176186
message:
177-
description: message is a human readable message indicating
178-
details about the transition. This may be an empty string.
187+
description: |-
188+
message is a human readable message indicating details about the transition.
189+
This may be an empty string.
179190
maxLength: 32768
180191
type: string
181192
observedGeneration:
182-
description: observedGeneration represents the .metadata.generation
183-
that the condition was set based upon. For instance, if .metadata.generation
184-
is currently 12, but the .status.conditions[x].observedGeneration
185-
is 9, the condition is out of date with respect to the current
186-
state of the instance.
193+
description: |-
194+
observedGeneration represents the .metadata.generation that the condition was set based upon.
195+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
196+
with respect to the current state of the instance.
187197
format: int64
188198
minimum: 0
189199
type: integer
190200
reason:
191-
description: reason contains a programmatic identifier indicating
192-
the reason for the condition's last transition. Producers
193-
of specific condition types may define expected values and
194-
meanings for this field, and whether the values are considered
195-
a guaranteed API. The value should be a CamelCase string.
201+
description: |-
202+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
203+
Producers of specific condition types may define expected values and meanings for this field,
204+
and whether the values are considered a guaranteed API.
205+
The value should be a CamelCase string.
196206
This field may not be empty.
197207
maxLength: 1024
198208
minLength: 1
@@ -206,11 +216,12 @@ spec:
206216
- Unknown
207217
type: string
208218
type:
209-
description: type of condition in CamelCase or in foo.example.com/CamelCase.
210-
--- Many .condition.type values are consistent across resources
211-
like Available, but because arbitrary conditions can be useful
212-
(see .node.status.conditions), the ability to deconflict is
213-
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
219+
description: |-
220+
type of condition in CamelCase or in foo.example.com/CamelCase.
221+
---
222+
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
223+
useful (see .node.status.conditions), the ability to deconflict is important.
224+
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
214225
maxLength: 316
215226
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
216227
type: string

0 commit comments

Comments
 (0)