From 82a18154f463fe2f06794faa5db50e747b426b3c Mon Sep 17 00:00:00 2001 From: Marcin Skalski Date: Tue, 2 Jul 2024 07:28:13 +0200 Subject: [PATCH] fix(meshgateway): do not override annotations from deployment (#10698) fix(meshgateway): do not override annotations from deployment, this can cause problems with using kubernetes rollout restart Signed-off-by: Marcin Skalski --- .../runtime/k8s/controllers/gateway_instance_controller.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/plugins/runtime/k8s/controllers/gateway_instance_controller.go b/pkg/plugins/runtime/k8s/controllers/gateway_instance_controller.go index a92b595ead49..91c0afef6fa5 100644 --- a/pkg/plugins/runtime/k8s/controllers/gateway_instance_controller.go +++ b/pkg/plugins/runtime/k8s/controllers/gateway_instance_controller.go @@ -317,6 +317,12 @@ func (r *GatewayInstanceReconciler) createOrUpdateDeployment( metadata.KumaMeshAnnotation: mesh, } + if obj != nil { + for k, v := range obj.(*kube_apps.Deployment).Spec.Template.GetAnnotations() { + podAnnotations[k] = v + } + } + for k, v := range gatewayInstance.Spec.PodTemplate.Metadata.Annotations { podAnnotations[k] = v }