Skip to content

Commit

Permalink
chore: remove golang exp dependency (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
mowies committed Feb 28, 2023
1 parent 81cd1f2 commit c5c3fdf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
9 changes: 7 additions & 2 deletions operator/controllers/common/helperfunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -74,11 +73,17 @@ 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()
annotations["traceparent"] = annotationsObject["traceparent"]

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
}
}
1 change: 0 additions & 1 deletion operator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions operator/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit c5c3fdf

Please sign in to comment.