diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dd4fe31..c78d0c97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ ddog-gov.com, us3.datadoghq.com, us5.datadoghq.com]` ~~`[, https]`~~ → `[https]` - Add `ServiceIntegration` field `datadog.datadog_pgbouncer_enabled`, type `boolean`: Enable Datadog PgBouncer Metric Tracking +- Remove `ClickhouseUser` webhook. Doesn't do any validation or mutation ## v0.19.0 - 2024-04-18 diff --git a/PROJECT b/PROJECT index 5e3df5d6..80daca7e 100644 --- a/PROJECT +++ b/PROJECT @@ -31,10 +31,6 @@ resources: kind: ClickhouseUser path: github.com/aiven/aiven-operator/api/v1alpha1 version: v1alpha1 - webhooks: - defaulting: true - validation: true - webhookVersion: v1 - api: crdVersion: v1 namespaced: true diff --git a/api/v1alpha1/clickhouseuser_webhook.go b/api/v1alpha1/clickhouseuser_webhook.go deleted file mode 100644 index e8ac69be..00000000 --- a/api/v1alpha1/clickhouseuser_webhook.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -var clickhouseuserlog = logf.Log.WithName("clickhouseuser-resource") - -func (in *ClickhouseUser) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(in). - Complete() -} - -//+kubebuilder:webhook:path=/mutate-aiven-io-v1alpha1-clickhouseuser,mutating=true,failurePolicy=fail,sideEffects=None,groups=aiven.io,resources=clickhouseusers,verbs=create;update,versions=v1alpha1,name=mclickhouseuser.kb.io,admissionReviewVersions=v1 - -var _ webhook.Defaulter = &ClickhouseUser{} - -// Default implements webhook.Defaulter so a webhook will be registered for the type -func (in *ClickhouseUser) Default() { - clickhouseuserlog.Info("default", "name", in.Name) -} - -//+kubebuilder:webhook:path=/validate-aiven-io-v1alpha1-clickhouseuser,mutating=false,failurePolicy=fail,sideEffects=None,groups=aiven.io,resources=clickhouseusers,verbs=create;update,versions=v1alpha1,name=vclickhouseuser.kb.io,admissionReviewVersions=v1 - -var _ webhook.Validator = &ClickhouseUser{} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type -func (in *ClickhouseUser) ValidateCreate() error { - clickhouseuserlog.Info("validate create", "name", in.Name) - return nil -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type -func (in *ClickhouseUser) ValidateUpdate(old runtime.Object) error { - clickhouseuserlog.Info("validate update", "name", in.Name) - - return nil -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type -func (in *ClickhouseUser) ValidateDelete() error { - clickhouseuserlog.Info("validate delete", "name", in.Name) - - return nil -} diff --git a/api/v1alpha1/setup_webhooks.go b/api/v1alpha1/setup_webhooks.go index 2e6d7bf5..040892e1 100644 --- a/api/v1alpha1/setup_webhooks.go +++ b/api/v1alpha1/setup_webhooks.go @@ -55,9 +55,6 @@ func SetupWebhooks(mgr ctrl.Manager) error { if err := (&Clickhouse{}).SetupWebhookWithManager(mgr); err != nil { return fmt.Errorf("webhook Clickhouse: %w", err) } - if err := (&ClickhouseUser{}).SetupWebhookWithManager(mgr); err != nil { - return fmt.Errorf("webhook ClickhouseUser: %w", err) - } if err := (&MySQL{}).SetupWebhookWithManager(mgr); err != nil { return fmt.Errorf("webhook MySQL: %w", err) } diff --git a/charts/aiven-operator/templates/mutating_webhook_configuration.yaml b/charts/aiven-operator/templates/mutating_webhook_configuration.yaml index e3b9fca2..10924fd0 100644 --- a/charts/aiven-operator/templates/mutating_webhook_configuration.yaml +++ b/charts/aiven-operator/templates/mutating_webhook_configuration.yaml @@ -49,26 +49,6 @@ webhooks: resources: - clickhouses sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: {{ include "aiven-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-operator.namespace" . }} - path: /mutate-aiven-io-v1alpha1-clickhouseuser - failurePolicy: Fail - name: mclickhouseuser.kb.io - rules: - - apiGroups: - - aiven.io - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - clickhouseusers - sideEffects: None - admissionReviewVersions: - v1 clientConfig: diff --git a/charts/aiven-operator/templates/validating_webhook_configuration.yaml b/charts/aiven-operator/templates/validating_webhook_configuration.yaml index 1296ce37..72894624 100644 --- a/charts/aiven-operator/templates/validating_webhook_configuration.yaml +++ b/charts/aiven-operator/templates/validating_webhook_configuration.yaml @@ -51,26 +51,6 @@ webhooks: resources: - clickhouses sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: {{ include "aiven-operator.fullname" . }}-webhook-service - namespace: {{ include "aiven-operator.namespace" . }} - path: /validate-aiven-io-v1alpha1-clickhouseuser - failurePolicy: Fail - name: vclickhouseuser.kb.io - rules: - - apiGroups: - - aiven.io - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - clickhouseusers - sideEffects: None - admissionReviewVersions: - v1 clientConfig: diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 59f1b24c..c07e8e6b 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -32,7 +32,6 @@ patchesStrategicMerge: # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. # patches here are for enabling the conversion webhook for each CRD - patches/webhook_in_clickhouses.yaml - - patches/webhook_in_clickhouseusers.yaml - patches/webhook_in_connectionpools.yaml - patches/webhook_in_databases.yaml - patches/webhook_in_kafkas.yaml @@ -56,7 +55,6 @@ patchesStrategicMerge: # [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. # patches here are for enabling the CA injection for each CRD - patches/cainjection_in_clickhouses.yaml - - patches/cainjection_in_clickhouseusers.yaml - patches/cainjection_in_connectionpools.yaml - patches/cainjection_in_databases.yaml - patches/cainjection_in_kafkas.yaml diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index ec5fe76a..c1951bb3 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -45,26 +45,6 @@ webhooks: resources: - clickhouses sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /mutate-aiven-io-v1alpha1-clickhouseuser - failurePolicy: Fail - name: mclickhouseuser.kb.io - rules: - - apiGroups: - - aiven.io - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - clickhouseusers - sideEffects: None - admissionReviewVersions: - v1 clientConfig: @@ -454,26 +434,6 @@ webhooks: resources: - clickhouses sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: webhook-service - namespace: system - path: /validate-aiven-io-v1alpha1-clickhouseuser - failurePolicy: Fail - name: vclickhouseuser.kb.io - rules: - - apiGroups: - - aiven.io - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - clickhouseusers - sideEffects: None - admissionReviewVersions: - v1 clientConfig: diff --git a/docs/docs/api-reference/opensearch.md b/docs/docs/api-reference/opensearch.md index dc66e461..636b4c87 100644 --- a/docs/docs/api-reference/opensearch.md +++ b/docs/docs/api-reference/opensearch.md @@ -26,7 +26,7 @@ title: "OpenSearch" project: my-aiven-project cloudName: google-europe-west1 plan: startup-4 - disk_space: 80gib + disk_space: 80GiB maintenanceWindowDow: friday maintenanceWindowTime: 23:00:00