1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-15 00:36:28 +00:00
prometheus-operator/example/alertmanager-crd-conversion/patch.json

31 lines
802 B
JSON
Raw Normal View History

*: add v1beta1 for AlertmanagerConfig CRD (#4709) * *: add v1beta1 for AlertmanagerConfig CRD Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: implement conversion webhook for AlertmanagerConfig Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: add jsonnet support for CRD conversion webhook Signed-off-by: Simon Pasquier <spasquie@redhat.com> * test: configure conversion webhook for AlertmanagerConfig Signed-off-by: Simon Pasquier <spasquie@redhat.com> * test/e2e: add test for v1alpha1<->v1beta1 conversion Signed-off-by: Simon Pasquier <spasquie@redhat.com> * Documentation: update webhook documentation Signed-off-by: Simon Pasquier <spasquie@redhat.com> * pkg/apis/monitoring/v1beta1: remove Regex field from Matcher type Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: rename muteTimeIntervals field to timeIntervals (v1beta1) Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: restore short name for AlertmanagerConfig Signed-off-by: Simon Pasquier <spasquie@redhat.com> * pkg/admission: add unit test for conversion webhook Signed-off-by: Simon Pasquier <spasquie@redhat.com> * pkg/apis/monitoring/v1beta1: replace v1.SecretKeySelector by SecretKeySelector v1.SecretKeySelector has an `Optional` field which doesn't make sense in the context of the AlertmanagerConfig CRD. Not depending on an external type also means that we can enforce that key and name values are not empty. Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: regenerate Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: make AlertmanagerConfig v1beta1 an opt-in choice Enabling by default AlertmanagerConfig v1beta1 by default means that users would have to configure the conversion webhook and it must be performed in advance or at the same time users upgrade to the latest operator version. To offer a smoother transition, we offer AlertmanagerConfig v1beta1 as an opt-in feature: it's neither included in the bundle.yaml file nor in the example/prometheus-operator-crd/ manifests. People that want to enable v1beta1 should use the example/prometheus-operator-crd-full manifests. For jsonnet users, the Prometheus operator jsonnet library has a new `enableAlertmanagerConfigV1beta1` configuration option that can be set to `true`. Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: add Telegram support in v1beta1 Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: synchronize with latest main changes Signed-off-by: Simon Pasquier <spasquie@redhat.com> * Documentation/user-guides/webhook.md: clarify mutation webhook Signed-off-by: Simon Pasquier <spasquie@redhat.com> * example: regenerate Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-05-31 11:11:00 +02:00
{
"apiVersion": "apiextensions.k8s.io/v1",
"kind": "CustomResourceDefinition",
"metadata": {
"annotations": {
"controller-gen.kubebuilder.io/version": "v0.16.5",
"operator.prometheus.io/version": "0.79.2"
*: add v1beta1 for AlertmanagerConfig CRD (#4709) * *: add v1beta1 for AlertmanagerConfig CRD Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: implement conversion webhook for AlertmanagerConfig Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: add jsonnet support for CRD conversion webhook Signed-off-by: Simon Pasquier <spasquie@redhat.com> * test: configure conversion webhook for AlertmanagerConfig Signed-off-by: Simon Pasquier <spasquie@redhat.com> * test/e2e: add test for v1alpha1<->v1beta1 conversion Signed-off-by: Simon Pasquier <spasquie@redhat.com> * Documentation: update webhook documentation Signed-off-by: Simon Pasquier <spasquie@redhat.com> * pkg/apis/monitoring/v1beta1: remove Regex field from Matcher type Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: rename muteTimeIntervals field to timeIntervals (v1beta1) Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: restore short name for AlertmanagerConfig Signed-off-by: Simon Pasquier <spasquie@redhat.com> * pkg/admission: add unit test for conversion webhook Signed-off-by: Simon Pasquier <spasquie@redhat.com> * pkg/apis/monitoring/v1beta1: replace v1.SecretKeySelector by SecretKeySelector v1.SecretKeySelector has an `Optional` field which doesn't make sense in the context of the AlertmanagerConfig CRD. Not depending on an external type also means that we can enforce that key and name values are not empty. Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: regenerate Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: make AlertmanagerConfig v1beta1 an opt-in choice Enabling by default AlertmanagerConfig v1beta1 by default means that users would have to configure the conversion webhook and it must be performed in advance or at the same time users upgrade to the latest operator version. To offer a smoother transition, we offer AlertmanagerConfig v1beta1 as an opt-in feature: it's neither included in the bundle.yaml file nor in the example/prometheus-operator-crd/ manifests. People that want to enable v1beta1 should use the example/prometheus-operator-crd-full manifests. For jsonnet users, the Prometheus operator jsonnet library has a new `enableAlertmanagerConfigV1beta1` configuration option that can be set to `true`. Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: add Telegram support in v1beta1 Signed-off-by: Simon Pasquier <spasquie@redhat.com> * *: synchronize with latest main changes Signed-off-by: Simon Pasquier <spasquie@redhat.com> * Documentation/user-guides/webhook.md: clarify mutation webhook Signed-off-by: Simon Pasquier <spasquie@redhat.com> * example: regenerate Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-05-31 11:11:00 +02:00
},
"name": "alertmanagerconfigs.monitoring.coreos.com"
},
"spec": {
"conversion": {
"strategy": "Webhook",
"webhook": {
"clientConfig": {
"service": {
"name": "prometheus-operator-admission-webhook",
"namespace": "default",
"path": "/convert",
"port": 8443
}
},
"conversionReviewVersions": [
"v1beta1",
"v1alpha1"
]
}
}
}
}