diff --git a/.github/workflows/build-fork.yaml b/.github/workflows/build-fork.yaml index 6699ac5..bf131d0 100644 --- a/.github/workflows/build-fork.yaml +++ b/.github/workflows/build-fork.yaml @@ -31,7 +31,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '1.21.0' + go-version: 1.22 - name: Install dependencies if: matrix.os == 'macos-latest' diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8c860a4..9570be1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -31,7 +31,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '1.21.0' + go-version: 1.22 - name: Install dependencies if: matrix.os == 'macos-latest' diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index e7642d6..fa1af63 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.21 + go-version: 1.22 - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/release-tag.yaml b/.github/workflows/release-tag.yaml index 3d6bc88..1f70f64 100644 --- a/.github/workflows/release-tag.yaml +++ b/.github/workflows/release-tag.yaml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.21 + go-version: 1.22 cache: true @@ -85,7 +85,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: 1.22 cache: true - name: GCP auth diff --git a/go.mod b/go.mod index c6deff5..ec8dba2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/otterize/otterize-cli -go 1.21 +go 1.22 require ( aqwari.net/xml v0.0.0-20210331023308-d9421b293817 diff --git a/src/pkg/intentsoutput/transform.go b/src/pkg/intentsoutput/transform.go index 863bd06..dcc2e19 100644 --- a/src/pkg/intentsoutput/transform.go +++ b/src/pkg/intentsoutput/transform.go @@ -1,14 +1,15 @@ package intentsoutput import ( + "cmp" "fmt" "github.com/amit7itz/goset" "github.com/otterize/intents-operator/src/operator/api/v1alpha3" "github.com/otterize/otterize-cli/src/pkg/consts" "github.com/otterize/otterize-cli/src/pkg/mapperclient" "github.com/samber/lo" - "golang.org/x/exp/slices" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "slices" ) type ServiceKey struct { @@ -62,27 +63,27 @@ func removeUntypedIntentsIfTypedIntentExistsForServer(intents map[ServiceKey]v1a } func sortIntents(intents []v1alpha3.ClientIntents) { - slices.SortFunc(intents, func(intenta, intentb v1alpha3.ClientIntents) bool { + slices.SortFunc(intents, func(intenta, intentb v1alpha3.ClientIntents) int { namea, nameb := intenta.Name, intentb.Name namespacea, namespaceb := intenta.Namespace, intentb.Namespace if namea != nameb { - return namea < nameb + return cmp.Compare(namea, nameb) } - return namespacea < namespaceb + return cmp.Compare(namespacea, namespaceb) }) for _, clientIntents := range intents { - slices.SortFunc(clientIntents.Spec.Calls, func(intenta, intentb v1alpha3.Intent) bool { + slices.SortFunc(clientIntents.Spec.Calls, func(intenta, intentb v1alpha3.Intent) int { namea, nameb := intenta.GetTargetServerName(), intentb.GetTargetServerName() namespacea, namespaceb := intenta.GetTargetServerNamespace(clientIntents.Namespace), intentb.GetTargetServerNamespace(clientIntents.Namespace) if namea != nameb { - return namea < nameb + return cmp.Compare(namea, nameb) } - return namespacea < namespaceb + return cmp.Compare(namespacea, namespaceb) }) } }