From 029b6fbcd60bc733bd8992f78a1f8f1c3052ebaf Mon Sep 17 00:00:00 2001 From: disaster37 Date: Thu, 2 Jul 2026 08:47:36 +0000 Subject: [PATCH] fix: fix issue #1668 about auto renew certificat on mutating / validation deployment --- webhook/workspace/mutating_cfg.go | 5 +++++ webhook/workspace/validating_cfg.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/webhook/workspace/mutating_cfg.go b/webhook/workspace/mutating_cfg.go index c7433c8c4..fb05594d8 100644 --- a/webhook/workspace/mutating_cfg.go +++ b/webhook/workspace/mutating_cfg.go @@ -16,6 +16,8 @@ package workspace import ( + "fmt" + admregv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -155,6 +157,9 @@ func BuildMutateWebhookCfg(namespace string) *admregv1.MutatingWebhookConfigurat ObjectMeta: metav1.ObjectMeta{ Name: MutateWebhookCfgName, Labels: server.WebhookServerAppLabels(), + Annotations: map[string]string{ + "cert-manager.io/inject-ca-from": fmt.Sprintf("%s/devworkspace-controller-serving-cert", namespace), + }, }, Webhooks: []admregv1.MutatingWebhook{ workspaceMutateWebhook, diff --git a/webhook/workspace/validating_cfg.go b/webhook/workspace/validating_cfg.go index 86c22f15b..e3e3f02aa 100644 --- a/webhook/workspace/validating_cfg.go +++ b/webhook/workspace/validating_cfg.go @@ -16,6 +16,8 @@ package workspace import ( + "fmt" + admregv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -36,6 +38,9 @@ func buildValidatingWebhookCfg(namespace string) *admregv1.ValidatingWebhookConf ObjectMeta: metav1.ObjectMeta{ Name: ValidateWebhookCfgName, Labels: server.WebhookServerAppLabels(), + Annotations: map[string]string{ + "cert-manager.io/inject-ca-from": fmt.Sprintf("%s/devworkspace-controller-serving-cert", namespace), + }, }, Webhooks: []admregv1.ValidatingWebhook{ {