Skip to content

Commit d254323

Browse files
authored
feat: add default namespace selector to ignore webhook namespace (#4)
* feat: add default namespace selector to ignore webhook namespace Signed-off-by: James Petersen <[email protected]> * chore: update chart docs Signed-off-by: James Petersen <[email protected]> * chore: use standard namespace label Signed-off-by: James Petersen <[email protected]> --------- Signed-off-by: James Petersen <[email protected]>
1 parent e06ae7a commit d254323

File tree

6 files changed

+22
-11
lines changed

6 files changed

+22
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "protect-webhook"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
edition = "2021"
55

66
[dependencies]

charts/protect-webhook/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: protect-webhook
33
description: A Helm chart for the Edera Protect Mutating Webhook
44
type: application
5-
version: 0.1.1
6-
appVersion: "0.1.0"
5+
version: 0.1.2
6+
appVersion: "0.1.1"
77
maintainers:
88
- name: "Edera"
99
url: "https://github.com/edera-dev"

charts/protect-webhook/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# protect-webhook
22

3-
![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
3+
![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.1](https://img.shields.io/badge/AppVersion-0.1.1-informational?style=flat-square)
44

55
A Helm chart for the Edera Protect Mutating Webhook
66

@@ -35,8 +35,7 @@ A Helm chart for the Edera Protect Mutating Webhook
3535
| tolerations | list | `[]` | Webhook server tolerations |
3636
| volumeMounts | list | `[]` | Webhook server additional volume mounts |
3737
| volumes | list | `[]` | Webhook server additional volumes |
38-
| webhook | object | `{"objectSelector":{"matchLabels":{"dev.edera/inject-runtime":"true"}}}` | Mutating webhook configuration |
39-
| webhook.objectSelector | object | `{"matchLabels":{"dev.edera/inject-runtime":"true"}}` | This object selector lets you customize which labels you would like to filter on to inject the edera runtime class |
38+
| webhook | object | `{}` | Mutating webhook configuration |
4039

4140
----------------------------------------------
4241
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

charts/protect-webhook/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ spec:
2727
{{- end }}
2828
securityContext:
2929
{{- toYaml .Values.podSecurityContext | nindent 8 }}
30+
{{- if .Values.runtimeClassName }}
31+
runtimeClassName: {{ .Values.runtimeClassName }}
32+
{{- end }}
3033
containers:
3134
- name: {{ .Chart.Name }}
3235
securityContext:

charts/protect-webhook/templates/webhook.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ webhooks:
1515
name: {{ include "protect-webhook.fullname" . }}
1616
namespace: {{ .Values.webhook.serviceNamespace | default .Release.Namespace }}
1717
path: /mutate
18+
# Automatically exclude Edera resources
19+
namespaceSelector:
20+
matchExpressions:
21+
- key: kubernetes.io/metadata.name
22+
operator: NotIn
23+
values: [{{ .Release.Namespace }}]
1824
{{- if .Values.webhook }}
1925
{{- if .Values.webhook.objectSelector }}
2026
objectSelector:

charts/protect-webhook/values.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ imagePullSecrets: []
1616
nameOverride: ""
1717
fullnameOverride: ""
1818

19+
# -- Webhook server runtime class
20+
# runtimeClassName: edera
21+
1922
# -- Webhook server pod annotations
2023
podAnnotations: {}
2124

@@ -65,8 +68,8 @@ tolerations: []
6568
affinity: {}
6669

6770
# -- Mutating webhook configuration
68-
webhook:
69-
# -- This object selector lets you customize which labels you would like to filter on to inject the edera runtime class
70-
objectSelector:
71-
matchLabels:
72-
dev.edera/inject-runtime: "true"
71+
webhook: {}
72+
# This object selector lets you customize which labels you would like to filter on to inject the edera runtime class
73+
# objectSelector:
74+
# matchLabels:
75+
# dev.edera/inject-runtime: "true"

0 commit comments

Comments
 (0)