Skip to content

Commit 753907a

Browse files
committed
WIP: Add webhook annotations config
Signed-off-by: Todd Short <[email protected]>
1 parent 8cee857 commit 753907a

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

hack/tools/patch-base-for-helm.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ catalogd_webhook_filelist=(
3636
for f in "${catalogd_webhook_filelist[@]}"; do
3737
yq -i '.metadata.labels["app.kubernetes.io/name"] = "catalogd"' "${f}"
3838
yq -i '.metadata.name = "catalogd-mutating-webhook-configuration"' "${f}"
39-
# This really only applies to cert-manager configs, but it's an annotation
40-
yq -i '.metadata.annotations["cert-manager.io/inject-ca-from-secret"] = "cert-manager/olmv1-ca"' "${f}"
39+
yq -i '.metadata.annotations["catalogd-webhook-annotations"] = "replaceMe"' "${f}"
4140
yq -i '.webhooks[0].clientConfig.service.namespace = "olmv1-system"' "${f}"
4241
yq -i '.webhooks[0].clientConfig.service.name = "catalogd-service"' "${f}"
4342
yq -i '.webhooks[0].clientConfig.service.port = 9443' "${f}"
@@ -65,6 +64,7 @@ for f in "${filelist[@]}"; do
6564
yq -i '.metadata.labels.replaceMe = "labels"' "${f}"
6665
# Replace with helm template - must be done last or yq will complain about the file format
6766
sed -i.bak 's/replaceMe: annotations/{{- include "olmv1.annotations" . | nindent 4 }}/g' "${f}"
67+
sed -i.bak 's/catalogd-webhook-annotations: replaceMe/{{- include "olmv1.catalogd.webhook.annotations" . | nindent 4 }}/g' "${f}"
6868
sed -i.bak 's/replaceMe: labels/{{- include "olmv1.labels" . | nindent 4 }}/g' "${f}"
6969
sed -i.bak 's/olmv1-system/{{ .Values.namespaces.olmv1.name }}/g' "${f}"
7070
sed -i.bak 's/- replaceMe: catalogd-role-rules/{{- include "olmv1.catalogd.role.rules" . | nindent 2 }}/g' "${f}"

helm/olmv1/base/catalogd/webhook/experimental/manifests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
app.kubernetes.io/name: catalogd
88
{{- include "olmv1.labels" . | nindent 4 }}
99
annotations:
10-
cert-manager.io/inject-ca-from-secret: cert-manager/olmv1-ca
10+
{{- include "olmv1.catalogd.webhook.annotations" . | nindent 4 }}
1111
{{- include "olmv1.annotations" . | nindent 4 }}
1212
webhooks:
1313
- admissionReviewVersions:

helm/olmv1/base/catalogd/webhook/standard/manifests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
app.kubernetes.io/name: catalogd
88
{{- include "olmv1.labels" . | nindent 4 }}
99
annotations:
10-
cert-manager.io/inject-ca-from-secret: cert-manager/olmv1-ca
10+
{{- include "olmv1.catalogd.webhook.annotations" . | nindent 4 }}
1111
{{- include "olmv1.annotations" . | nindent 4 }}
1212
webhooks:
1313
- admissionReviewVersions:

helm/olmv1/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ Common annoations
4343
olm.operatorframework.io/feature-set: {{ .Values.featureSet -}}{{- if .Values.components.e2e.enabled -}}-e2e{{- end -}}
4444
{{- end }}
4545

46+
{{/*
47+
Annotations for Catalogd Webhooks
48+
*/}}
49+
{{- define "olmv1.catalogd.webhook.annotations" -}}
50+
cert-manager.io/inject-ca-from-secret: cert-manager/olmv1-ca
51+
{{- end }}
52+
4653
{{/*
4754
Insertion of additional rules for RBAC
4855
*/}}

helm/olmv1/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ components:
4646
rules: []
4747
role:
4848
rules: []
49+
webhook:
50+
annotations:
51+
cert-manager.io/inject-ca-from-secret: cert-manager/olmv1-ca
4952
certManager:
5053
enabled: true
5154
e2e:

0 commit comments

Comments
 (0)