Skip to content

Commit 87c8f34

Browse files
authored
Merge pull request #56 from PDOK/wr/disable-v2beta1
disable v2beta1 webhooks and crd generation
2 parents 5065f5a + ab48381 commit 87c8f34

File tree

5 files changed

+3
-357
lines changed

5 files changed

+3
-357
lines changed

api/v2beta1/atom_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type AtomStatus struct {
5959
}
6060

6161
// +kubebuilder:object:root=true
62-
// +kubebuilder:subresource:status
62+
// +kubebuilder:skipversion
6363
// versionName=v2beta1
6464

6565
// Atom is the Schema for the atoms API.

cmd/main.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ import (
4343
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
4444
"sigs.k8s.io/controller-runtime/pkg/webhook"
4545

46-
pdoknlv2beta1 "github.com/pdok/atom-operator/api/v2beta1"
4746
pdoknlv3 "github.com/pdok/atom-operator/api/v3"
4847
"github.com/pdok/atom-operator/internal/controller"
49-
webhookpdoknlv2beta1 "github.com/pdok/atom-operator/internal/webhook/v2beta1"
5048
webhookpdoknlv3 "github.com/pdok/atom-operator/internal/webhook/v3"
5149
// +kubebuilder:scaffold:imports
5250
)
@@ -65,7 +63,6 @@ func init() {
6563
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
6664

6765
utilruntime.Must(pdoknlv3.AddToScheme(scheme))
68-
utilruntime.Must(pdoknlv2beta1.AddToScheme(scheme))
6966
utilruntime.Must(traefikiov1alpha1.AddToScheme(scheme))
7067
utilruntime.Must(smoothoperatorv1.AddToScheme(scheme))
7168

@@ -198,10 +195,6 @@ func main() {
198195
}
199196

200197
if os.Getenv("ENABLE_WEBHOOKS") != "false" {
201-
if err = webhookpdoknlv2beta1.SetupAtomWebhookWithManager(mgr); err != nil {
202-
setupLog.Error(err, "unable to create webhook", "webhook", "Atom")
203-
os.Exit(1)
204-
}
205198

206199
if err = webhookpdoknlv3.SetupAtomWebhookWithManager(mgr); err != nil {
207200
setupLog.Error(err, "unable to create webhook", "webhook", "Atom")

config/crd/bases/pdok.nl_atoms.yaml

Lines changed: 0 additions & 307 deletions
Original file line numberDiff line numberDiff line change
@@ -16,313 +16,6 @@ spec:
1616
singular: atom
1717
scope: Namespaced
1818
versions:
19-
- name: v2beta1
20-
schema:
21-
openAPIV3Schema:
22-
description: Atom is the Schema for the atoms API.
23-
properties:
24-
apiVersion:
25-
description: |-
26-
APIVersion defines the versioned schema of this representation of an object.
27-
Servers should convert recognized schemas to the latest internal value, and
28-
may reject unrecognized values.
29-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
30-
type: string
31-
kind:
32-
description: |-
33-
Kind is a string value representing the REST resource this object represents.
34-
Servers may infer this from the endpoint the client submits requests to.
35-
Cannot be updated.
36-
In CamelCase.
37-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
38-
type: string
39-
metadata:
40-
type: object
41-
spec:
42-
description: AtomSpec defines the desired state of Atom.
43-
properties:
44-
general:
45-
description: General is the struct with all generic fields for the
46-
crds
47-
properties:
48-
dataVersion:
49-
type: string
50-
dataset:
51-
type: string
52-
datasetOwner:
53-
type: string
54-
serviceVersion:
55-
type: string
56-
theme:
57-
type: string
58-
required:
59-
- dataset
60-
- datasetOwner
61-
type: object
62-
kubernetes:
63-
description: Kubernetes is the struct with all fields that can be
64-
defined in kubernetes fields in the crds
65-
properties:
66-
autoscaling:
67-
description: Autoscaling is the struct with all fields to configure
68-
autoscalers for the crs
69-
properties:
70-
averageCpuUtilization:
71-
type: integer
72-
maxReplicas:
73-
type: integer
74-
minReplicas:
75-
type: integer
76-
type: object
77-
healthCheck:
78-
description: HealthCheck is the struct with all fields to configure
79-
healthchecks for the crs
80-
properties:
81-
boundingbox:
82-
type: string
83-
mimetype:
84-
type: string
85-
querystring:
86-
type: string
87-
type: object
88-
lifecycle:
89-
description: Lifecycle is the struct with the fields to configure
90-
lifecycle settings for the resources
91-
properties:
92-
ttlInDays:
93-
type: integer
94-
type: object
95-
resources:
96-
description: ResourceRequirements describes the compute resource
97-
requirements.
98-
properties:
99-
claims:
100-
description: |-
101-
Claims lists the names of resources, defined in spec.resourceClaims,
102-
that are used by this container.
103-
104-
This is an alpha field and requires enabling the
105-
DynamicResourceAllocation feature gate.
106-
107-
This field is immutable. It can only be set for containers.
108-
items:
109-
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
110-
properties:
111-
name:
112-
description: |-
113-
Name must match the name of one entry in pod.spec.resourceClaims of
114-
the Pod where this field is used. It makes that resource available
115-
inside a container.
116-
type: string
117-
request:
118-
description: |-
119-
Request is the name chosen for a request in the referenced claim.
120-
If empty, everything from the claim is made available, otherwise
121-
only the result of this request.
122-
type: string
123-
required:
124-
- name
125-
type: object
126-
type: array
127-
x-kubernetes-list-map-keys:
128-
- name
129-
x-kubernetes-list-type: map
130-
limits:
131-
additionalProperties:
132-
anyOf:
133-
- type: integer
134-
- type: string
135-
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
136-
x-kubernetes-int-or-string: true
137-
description: |-
138-
Limits describes the maximum amount of compute resources allowed.
139-
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
140-
type: object
141-
requests:
142-
additionalProperties:
143-
anyOf:
144-
- type: integer
145-
- type: string
146-
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
147-
x-kubernetes-int-or-string: true
148-
description: |-
149-
Requests describes the minimum amount of compute resources required.
150-
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
151-
otherwise to an implementation-defined value. Requests cannot exceed Limits.
152-
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
153-
type: object
154-
type: object
155-
type: object
156-
service:
157-
description: AtomService is the struct for all service level fields
158-
properties:
159-
author:
160-
description: Author is the struct with the input for the author
161-
field of an atom
162-
properties:
163-
email:
164-
type: string
165-
name:
166-
type: string
167-
required:
168-
- email
169-
- name
170-
type: object
171-
datasets:
172-
items:
173-
description: Dataset is the struct for all dataset level fields
174-
properties:
175-
bbox:
176-
description: Bbox is the struct for the bounding box extent
177-
of an atom
178-
properties:
179-
maxx:
180-
type: number
181-
maxy:
182-
type: number
183-
minx:
184-
type: number
185-
miny:
186-
type: number
187-
required:
188-
- maxx
189-
- maxy
190-
- minx
191-
- miny
192-
type: object
193-
downloads:
194-
items:
195-
description: Download is the struct for the download level
196-
fields
197-
properties:
198-
content:
199-
type: string
200-
links:
201-
items:
202-
description: Link represents a link in a download
203-
entry
204-
properties:
205-
bbox:
206-
description: Bbox is the struct for the bounding
207-
box extent of an atom
208-
properties:
209-
maxx:
210-
type: number
211-
maxy:
212-
type: number
213-
minx:
214-
type: number
215-
miny:
216-
type: number
217-
required:
218-
- maxx
219-
- maxy
220-
- minx
221-
- miny
222-
type: object
223-
blobKey:
224-
type: string
225-
rel:
226-
type: string
227-
updated:
228-
type: string
229-
version:
230-
type: string
231-
required:
232-
- blobKey
233-
type: object
234-
type: array
235-
name:
236-
type: string
237-
srs:
238-
description: Srs is the struct with the information
239-
for the srs field of an atom
240-
properties:
241-
code:
242-
type: string
243-
uri:
244-
type: string
245-
required:
246-
- code
247-
- uri
248-
type: object
249-
title:
250-
type: string
251-
updated:
252-
type: string
253-
required:
254-
- name
255-
- srs
256-
type: object
257-
type: array
258-
links:
259-
items:
260-
description: OtherLink represents any type of link that
261-
is not a download link related to the data (see Link)
262-
properties:
263-
contentType:
264-
type: string
265-
language:
266-
type: string
267-
type:
268-
type: string
269-
uri:
270-
type: string
271-
required:
272-
- type
273-
- uri
274-
type: object
275-
type: array
276-
metadataIdentifier:
277-
type: string
278-
name:
279-
type: string
280-
sourceIdentifier:
281-
type: string
282-
subtitle:
283-
type: string
284-
title:
285-
type: string
286-
required:
287-
- bbox
288-
- downloads
289-
- metadataIdentifier
290-
- name
291-
- sourceIdentifier
292-
- subtitle
293-
- title
294-
type: object
295-
type: array
296-
metadataIdentifier:
297-
type: string
298-
rights:
299-
type: string
300-
subtitle:
301-
type: string
302-
title:
303-
type: string
304-
updated:
305-
type: string
306-
required:
307-
- author
308-
- datasets
309-
- metadataIdentifier
310-
- rights
311-
- subtitle
312-
- title
313-
type: object
314-
required:
315-
- general
316-
- service
317-
type: object
318-
status:
319-
description: AtomStatus defines the observed state of Atom.
320-
type: object
321-
type: object
322-
served: true
323-
storage: false
324-
subresources:
325-
status: {}
32619
- name: v3
32720
schema:
32821
openAPIV3Schema:

config/crd/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ configMapGenerator:
1010
files:
1111
- CSP=content-security-policy.txt
1212

13-
patches:
13+
# patches:
1414
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
1515
# patches here are for enabling the conversion webhook for each CRD
16-
- path: patches/webhook_in_atoms.yaml
16+
# - path: patches/webhook_in_atoms.yaml
1717
# +kubebuilder:scaffold:crdkustomizewebhookpatch
1818

1919
# [WEBHOOK] To enable webhook, uncomment the following section

0 commit comments

Comments
 (0)