Skip to content

Commit

Permalink
fix(k8s): clone annotations before modyfing (backport of #12338) (#12341
Browse files Browse the repository at this point in the history
)

Automatic cherry-pick of #12338 for branch release-2.6

Generated by
[action](https://github.com/kumahq/kuma/actions/runs/12413909832)

cherry-picked commit 8248765

Signed-off-by: Lukasz Dziedziak <[email protected]>
Co-authored-by: Lukasz Dziedziak <[email protected]>
  • Loading branch information
kumahq[bot] and lukidzi authored Dec 19, 2024
1 parent f9d453b commit 0e34794
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/plugins/runtime/k8s/controllers/service_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package controllers
import (
"context"
"fmt"
"maps"

"github.com/go-logr/logr"
"github.com/pkg/errors"
Expand Down Expand Up @@ -68,7 +69,7 @@ func (r *ServiceReconciler) Reconcile(ctx context.Context, req kube_ctrl.Request
}

log.Info("annotating service which is part of the mesh", "annotation", fmt.Sprintf("%s=%s", metadata.IngressServiceUpstream, metadata.AnnotationTrue))
annotations := metadata.Annotations(svc.Annotations)
annotations := metadata.Annotations(maps.Clone(svc.Annotations))
if annotations == nil {
annotations = metadata.Annotations{}
}
Expand Down

0 comments on commit 0e34794

Please sign in to comment.