Skip to content

Commit 3a633bf

Browse files
authored
Merge pull request #4017 from paulojmdias/feat/support_objectselector_rolloutoperator
[rollout-operator] Add support for objectSelector into webhooks
2 parents 5d1c59c + aa45b4b commit 3a633bf

File tree

7 files changed

+31
-2
lines changed

7 files changed

+31
-2
lines changed

charts/rollout-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: rollout-operator
33
description: "Grafana rollout-operator"
44
type: application
5-
version: 0.37.1
5+
version: 0.38.0
66
appVersion: v0.32.0
77
home: https://github.com/grafana/rollout-operator
88
kubeVersion: ^1.10.0-0

charts/rollout-operator/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Helm chart for deploying [Grafana rollout-operator](https://github.com/grafana/r
44

55
# rollout-operator
66

7-
![Version: 0.37.1](https://img.shields.io/badge/Version-0.37.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.32.0](https://img.shields.io/badge/AppVersion-v0.32.0-informational?style=flat-square)
7+
![Version: 0.38.0](https://img.shields.io/badge/Version-0.38.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.32.0](https://img.shields.io/badge/AppVersion-v0.32.0-informational?style=flat-square)
88

99
Grafana rollout-operator
1010

@@ -85,4 +85,5 @@ Manually applying these CRDs is only required if upgrading from a chart <= v0.32
8585
| tolerations | list | `[]` | |
8686
| webhooks.enabled | bool | `true` | Enable the rollout-operator webhooks. See https://github.com/grafana/rollout-operator/#webhooks. Note that the webhooks require custom resource definitions. If upgrading, manually apply the files in the `crds` directory. |
8787
| webhooks.failurePolicy | string | `"Fail"` | Validating and mutating webhook failure policy. `Ignore` or `Fail`. |
88+
| webhooks.objectSelector | object | `{}` | objectSelector to filter which objects the webhooks apply to. |
8889
| webhooks.selfSignedCertSecretName | string | `"certificate"` | Secret resource name for the TLS certificate to be used with the webhooks |

charts/rollout-operator/templates/no-downscale-webhook.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ webhooks:
3131
namespaceSelector:
3232
matchLabels:
3333
kubernetes.io/metadata.name: {{ .Release.Namespace | quote }}
34+
{{- with .Values.webhooks.objectSelector }}
35+
objectSelector:
36+
{{- toYaml . | nindent 6 }}
37+
{{- end }}
3438
sideEffects: None
3539
failurePolicy: {{.Values.webhooks.failurePolicy}}
3640
{{- end -}}

charts/rollout-operator/templates/pod-eviction-webhook.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ webhooks:
3030
namespaceSelector:
3131
matchLabels:
3232
kubernetes.io/metadata.name: {{ .Release.Namespace | quote }}
33+
{{- with .Values.webhooks.objectSelector }}
34+
objectSelector:
35+
{{- toYaml . | nindent 6 }}
36+
{{- end }}
3337
sideEffects: None
3438
failurePolicy: {{.Values.webhooks.failurePolicy}}
3539
{{- end -}}

charts/rollout-operator/templates/prepare-downscale-webhook.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ webhooks:
3131
namespaceSelector:
3232
matchLabels:
3333
kubernetes.io/metadata.name: {{ .Release.Namespace | quote }}
34+
{{- with .Values.webhooks.objectSelector }}
35+
objectSelector:
36+
{{- toYaml . | nindent 6 }}
37+
{{- end }}
3438
sideEffects: NoneOnDryRun
3539
matchPolicy: Equivalent
3640
timeoutSeconds: 10

charts/rollout-operator/templates/zone-aware-pod-disruption-budget-validating-webhook.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ webhooks:
3030
namespaceSelector:
3131
matchLabels:
3232
kubernetes.io/metadata.name: {{ .Release.Namespace | quote }}
33+
{{- with .Values.webhooks.objectSelector }}
34+
objectSelector:
35+
{{- toYaml . | nindent 6 }}
36+
{{- end }}
3337
sideEffects: None
3438
failurePolicy: {{.Values.webhooks.failurePolicy}}
3539
{{- end -}}

charts/rollout-operator/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,15 @@ webhooks:
108108
failurePolicy: "Fail"
109109
# -- Secret resource name for the TLS certificate to be used with the webhooks
110110
selfSignedCertSecretName: "certificate"
111+
# -- objectSelector to filter which objects the webhooks apply to.
112+
objectSelector: {}
113+
# See https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-objectselector
114+
# Example:
115+
# objectSelector:
116+
# matchLabels:
117+
# app: loki
118+
# matchExpressions:
119+
# - key: environment
120+
# operator: In
121+
# values:
122+
# - production

0 commit comments

Comments
 (0)