Skip to content

Commit c89f194

Browse files
author
Per Goncalves da Silva
committed
Add webhook-operator bundle and catalog entry
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent 5f5142d commit c89f194

File tree

5 files changed

+381
-0
lines changed

5 files changed

+381
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
creationTimestamp: null
5+
name: webhook-operator-metrics-reader
6+
rules:
7+
- nonResourceURLs:
8+
- /metrics
9+
verbs:
10+
- get
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
apiVersion: operators.coreos.com/v1alpha1
2+
kind: ClusterServiceVersion
3+
metadata:
4+
annotations:
5+
alm-examples: |-
6+
[
7+
{
8+
"apiVersion": "webhook.operators.coreos.io/v1",
9+
"kind": "WebhookTest",
10+
"metadata": {
11+
"name": "webhooktest-sample",
12+
"namespace": "webhook-operator-system"
13+
},
14+
"spec": {
15+
"valid": true
16+
}
17+
}
18+
]
19+
capabilities: Basic Install
20+
operators.operatorframework.io/builder: operator-sdk-v1.0.0
21+
operators.operatorframework.io/project_layout: go
22+
name: webhook-operator.v0.0.1
23+
namespace: placeholder
24+
spec:
25+
apiservicedefinitions: {}
26+
customresourcedefinitions:
27+
owned:
28+
- kind: WebhookTest
29+
name: webhooktests.webhook.operators.coreos.io
30+
version: v1
31+
description: Webhook Operator description. TODO.
32+
displayName: Webhook Operator
33+
icon:
34+
- base64data: ""
35+
mediatype: ""
36+
install:
37+
spec:
38+
clusterPermissions:
39+
- rules:
40+
- apiGroups:
41+
- webhook.operators.coreos.io
42+
resources:
43+
- webhooktests
44+
verbs:
45+
- create
46+
- delete
47+
- get
48+
- list
49+
- patch
50+
- update
51+
- watch
52+
- apiGroups:
53+
- webhook.operators.coreos.io
54+
resources:
55+
- webhooktests/status
56+
verbs:
57+
- get
58+
- patch
59+
- update
60+
- apiGroups:
61+
- authentication.k8s.io
62+
resources:
63+
- tokenreviews
64+
verbs:
65+
- create
66+
- apiGroups:
67+
- authorization.k8s.io
68+
resources:
69+
- subjectaccessreviews
70+
verbs:
71+
- create
72+
serviceAccountName: default
73+
deployments:
74+
- name: webhook-operator-webhook
75+
spec:
76+
replicas: 1
77+
selector:
78+
matchLabels:
79+
control-plane: controller-manager
80+
strategy: {}
81+
template:
82+
metadata:
83+
labels:
84+
control-plane: controller-manager
85+
spec:
86+
containers:
87+
- args:
88+
- --secure-listen-address=0.0.0.0:8443
89+
- --upstream=http://127.0.0.1:8080/
90+
- --logtostderr=true
91+
- --v=10
92+
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
93+
name: kube-rbac-proxy
94+
ports:
95+
- containerPort: 8443
96+
name: https
97+
resources: {}
98+
- args:
99+
- --metrics-addr=127.0.0.1:8080
100+
- --enable-leader-election
101+
command:
102+
- /manager
103+
image: quay.io/olmtest/webhook-operator:0.0.3
104+
name: manager
105+
ports:
106+
- containerPort: 9443
107+
name: webhook-server
108+
protocol: TCP
109+
resources:
110+
limits:
111+
cpu: 100m
112+
memory: 30Mi
113+
requests:
114+
cpu: 100m
115+
memory: 20Mi
116+
terminationGracePeriodSeconds: 10
117+
permissions:
118+
- rules:
119+
- apiGroups:
120+
- ""
121+
resources:
122+
- configmaps
123+
verbs:
124+
- get
125+
- list
126+
- watch
127+
- create
128+
- update
129+
- patch
130+
- delete
131+
- apiGroups:
132+
- ""
133+
resources:
134+
- configmaps/status
135+
verbs:
136+
- get
137+
- update
138+
- patch
139+
- apiGroups:
140+
- ""
141+
resources:
142+
- events
143+
verbs:
144+
- create
145+
serviceAccountName: default
146+
strategy: deployment
147+
installModes:
148+
- supported: false
149+
type: OwnNamespace
150+
- supported: false
151+
type: SingleNamespace
152+
- supported: false
153+
type: MultiNamespace
154+
- supported: true
155+
type: AllNamespaces
156+
keywords:
157+
- webhook-operator
158+
links:
159+
- name: Webhook Operator
160+
url: https://webhook-operator.domain
161+
maintainers:
162+
163+
name: Maintainer Name
164+
maturity: alpha
165+
provider:
166+
name: Provider Name
167+
url: https://your.domain
168+
version: 0.0.1
169+
webhookdefinitions:
170+
- admissionReviewVersions:
171+
- v1beta1
172+
- v1
173+
containerPort: 443
174+
targetPort: 4343
175+
deploymentName: webhook-operator-webhook
176+
failurePolicy: Fail
177+
generateName: vwebhooktest.kb.io
178+
rules:
179+
- apiGroups:
180+
- webhook.operators.coreos.io
181+
apiVersions:
182+
- v1
183+
operations:
184+
- CREATE
185+
- UPDATE
186+
resources:
187+
- webhooktests
188+
sideEffects: None
189+
type: ValidatingAdmissionWebhook
190+
webhookPath: /validate-webhook-operators-coreos-io-v1-webhooktest
191+
- admissionReviewVersions:
192+
- v1beta1
193+
- v1
194+
containerPort: 443
195+
targetPort: 4343
196+
deploymentName: webhook-operator-webhook
197+
failurePolicy: Fail
198+
generateName: mwebhooktest.kb.io
199+
rules:
200+
- apiGroups:
201+
- webhook.operators.coreos.io
202+
apiVersions:
203+
- v1
204+
operations:
205+
- CREATE
206+
- UPDATE
207+
resources:
208+
- webhooktests
209+
sideEffects: None
210+
type: MutatingAdmissionWebhook
211+
webhookPath: /mutate-webhook-operators-coreos-io-v1-webhooktest
212+
- admissionReviewVersions:
213+
- v1beta1
214+
- v1
215+
containerPort: 443
216+
targetPort: 4343
217+
deploymentName: webhook-operator-webhook
218+
failurePolicy: Fail
219+
generateName: cwebhooktest.kb.io
220+
rules:
221+
- apiGroups:
222+
- webhook.operators.coreos.io
223+
apiVersions:
224+
- v1
225+
operations:
226+
- CREATE
227+
- UPDATE
228+
resources:
229+
- webhooktests
230+
sideEffects: None
231+
type: ConversionWebhook
232+
webhookPath: /convert
233+
conversionCRDs:
234+
- webhooktests.webhook.operators.coreos.io
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: v0.3.0
6+
creationTimestamp: null
7+
name: webhooktests.webhook.operators.coreos.io
8+
spec:
9+
preserveUnknownFields: false
10+
group: webhook.operators.coreos.io
11+
names:
12+
kind: WebhookTest
13+
listKind: WebhookTestList
14+
plural: webhooktests
15+
singular: webhooktest
16+
scope: Namespaced
17+
version: v1
18+
versions:
19+
- name: v1
20+
schema:
21+
openAPIV3Schema:
22+
description: WebhookTest is the Schema for the webhooktests API
23+
properties:
24+
apiVersion:
25+
description: 'APIVersion defines the versioned schema of this representation
26+
of an object. Servers should convert recognized schemas to the latest
27+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
28+
type: string
29+
kind:
30+
description: 'Kind is a string value representing the REST resource this
31+
object represents. Servers may infer this from the endpoint the client
32+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
33+
type: string
34+
metadata:
35+
type: object
36+
spec:
37+
description: WebhookTestSpec defines the desired state of WebhookTest
38+
properties:
39+
mutate:
40+
description: Mutate is a field that will be set to true by the mutating
41+
webhook.
42+
type: boolean
43+
valid:
44+
description: Valid must be set to true or the validation webhook will
45+
reject the resource.
46+
type: boolean
47+
required:
48+
- valid
49+
type: object
50+
status:
51+
description: WebhookTestStatus defines the observed state of WebhookTest
52+
type: object
53+
type: object
54+
served: true
55+
storage: true
56+
- name: v2
57+
schema:
58+
openAPIV3Schema:
59+
description: WebhookTest is the Schema for the webhooktests API
60+
properties:
61+
apiVersion:
62+
description: 'APIVersion defines the versioned schema of this representation
63+
of an object. Servers should convert recognized schemas to the latest
64+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
65+
type: string
66+
kind:
67+
description: 'Kind is a string value representing the REST resource this
68+
object represents. Servers may infer this from the endpoint the client
69+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
70+
type: string
71+
metadata:
72+
type: object
73+
spec:
74+
description: WebhookTestSpec defines the desired state of WebhookTest
75+
properties:
76+
conversion:
77+
description: Conversion is an example field of WebhookTest. Edit WebhookTest_types.go
78+
to remove/update
79+
properties:
80+
mutate:
81+
description: Mutate is a field that will be set to true by the
82+
mutating webhook.
83+
type: boolean
84+
valid:
85+
description: Valid must be set to true or the validation webhook
86+
will reject the resource.
87+
type: boolean
88+
required:
89+
- valid
90+
type: object
91+
required:
92+
- conversion
93+
type: object
94+
status:
95+
description: WebhookTestStatus defines the observed state of WebhookTest
96+
type: object
97+
type: object
98+
served: true
99+
storage: false
100+
status:
101+
acceptedNames:
102+
kind: ""
103+
plural: ""
104+
conditions: []
105+
storedVersions: []
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
annotations:
2+
operators.operatorframework.io.bundle.channel.default.v1: ""
3+
operators.operatorframework.io.bundle.channels.v1: alpha
4+
operators.operatorframework.io.bundle.manifests.v1: manifests/
5+
operators.operatorframework.io.bundle.mediatype.v1: registry+v1
6+
operators.operatorframework.io.bundle.metadata.v1: metadata/
7+
operators.operatorframework.io.bundle.package.v1: webhook-operator
8+
operators.operatorframework.io.metrics.builder: operator-sdk-v1.0.0
9+
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
10+
operators.operatorframework.io.metrics.project_layout: go
11+
operators.operatorframework.io.test.config.v1: tests/scorecard/
12+
operators.operatorframework.io.test.mediatype.v1: scorecard+v1

testdata/images/catalogs/test-catalog/v1/configs/catalog.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,23 @@ properties:
8989
value:
9090
packageName: dynamic
9191
version: 1.2.0
92+
---
93+
schema: olm.package
94+
name: webhook-operator
95+
defaultChannel: alpha
96+
---
97+
schema: olm.channel
98+
name: alpha
99+
package: webhook-operator
100+
entries:
101+
- name: webhook-operator.v0.0.1
102+
---
103+
schema: olm.bundle
104+
name: webhook-operator.v0.0.1
105+
package: webhook-operator
106+
image: docker-registry.operator-controller-e2e.svc.cluster.local:5000/bundles/registry-v1/webhook-operator:v0.0.1
107+
properties:
108+
- type: olm.package
109+
value:
110+
packageName: webhook-operator
111+
version: 0.0.1

0 commit comments

Comments
 (0)