Skip to content

Commit 77a2cd4

Browse files
committed
fix(webhook): ignore failures and filter out pods from cache registry
closes #15
1 parent 7493323 commit 77a2cd4

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
helm/cache-registry/charts/*.tgz
2-
2+
values.yaml
33

44
# Binaries for programs and plugins
55
*.exe

helm/cache-registry/templates/_helpers.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Common labels
3535
*/}}
3636
{{- define "cache-registry.labels" -}}
3737
helm.sh/chart: {{ include "cache-registry.chart" . }}
38+
cache-registry.enix.io/image-caching-policy: ignore
3839
{{ include "cache-registry.selectorLabels" . }}
3940
{{- if .Chart.AppVersion }}
4041
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}

helm/cache-registry/templates/mutatingwebhookconfiguration.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ webhooks:
1313
name: dcr-webhook-service
1414
namespace: {{ .Release.Namespace }}
1515
path: /mutate-core-v1-pod
16-
failurePolicy: Fail
16+
failurePolicy: Ignore
17+
objectSelector:
18+
matchExpressions:
19+
- key: cache-registry.enix.io/image-caching-policy
20+
operator: NotIn
21+
values:
22+
- ignore
23+
{{- .Values.proxy.webhook.objectSelector.matchExpressions | toYaml | nindent 4 }}
1724
name: mpod.kb.io
1825
rules:
1926
- apiGroups:

helm/cache-registry/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ proxy:
3131
certificateIssuerRef:
3232
kind: Issuer
3333
name: dcr-selfsigned-issuer
34+
objectSelector:
35+
matchExpressions: []
3436

3537
registry:
3638
image:

0 commit comments

Comments
 (0)