diff --git a/operator/controllers/common/helperfunctions.go b/operator/controllers/common/helperfunctions.go index 440be47162..7cee03625d 100644 --- a/operator/controllers/common/helperfunctions.go +++ b/operator/controllers/common/helperfunctions.go @@ -6,7 +6,6 @@ import ( klcv1alpha2 "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha2" apicommon "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha2/common" "github.com/keptn/lifecycle-toolkit/operator/controllers/lifecycle/interfaces" - "golang.org/x/exp/maps" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/record" "sigs.k8s.io/controller-runtime/pkg/client" @@ -74,7 +73,7 @@ func setAnnotations(reconcileObject client.Object, phase apicommon.KeptnPhaseTyp piWrapper, err := interfaces.NewEventObjectWrapperFromClientObject(reconcileObject) if err == nil { - maps.Copy(annotations, piWrapper.GetEventAnnotations()) + copyMap(annotations, piWrapper.GetEventAnnotations()) } annotationsObject := reconcileObject.GetAnnotations() @@ -82,3 +81,9 @@ func setAnnotations(reconcileObject client.Object, phase apicommon.KeptnPhaseTyp return annotations } + +func copyMap[M1 ~map[K]V, M2 ~map[K]V, K comparable, V any](dst M1, src M2) { + for k, v := range src { + dst[k] = v + } +} diff --git a/operator/go.mod b/operator/go.mod index 42c9f63a9f..feaee7ee87 100644 --- a/operator/go.mod +++ b/operator/go.mod @@ -26,7 +26,6 @@ require ( go.opentelemetry.io/otel/sdk v1.11.2 go.opentelemetry.io/otel/sdk/metric v0.34.0 go.opentelemetry.io/otel/trace v1.11.2 - golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb google.golang.org/grpc v1.52.3 k8s.io/api v0.26.1 k8s.io/apiextensions-apiserver v0.26.1 diff --git a/operator/go.sum b/operator/go.sum index 2f93637714..04dc79090e 100644 --- a/operator/go.sum +++ b/operator/go.sum @@ -445,8 +445,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb h1:PaBZQdo+iSDyHT053FjUCgZQ/9uqVwPOcl7KSWhKn6w= -golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=