diff --git a/api/Dockerfile b/api/Dockerfile index 33e198939..ac9834181 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: (C) 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM golang:1.24.1-bookworm as build +FROM golang:1.24.4-bookworm as build ENV GO111MODULE=on ARG MAKE_TARGET=go-build diff --git a/api/VERSION b/api/VERSION index a95a46d9f..2aeaa11ee 100644 --- a/api/VERSION +++ b/api/VERSION @@ -1 +1 @@ -1.34.1 +1.35.0 diff --git a/api/go.mod b/api/go.mod index deb262ad1..0f50b241c 100644 --- a/api/go.mod +++ b/api/go.mod @@ -3,7 +3,7 @@ module github.com/open-edge-platform/infra-core/api -go 1.24.1 +go 1.24.4 require ( github.com/getkin/kin-openapi v0.132.0 diff --git a/apiv2/Dockerfile b/apiv2/Dockerfile index 3ea04c11e..43dced979 100644 --- a/apiv2/Dockerfile +++ b/apiv2/Dockerfile @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: (C) 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM golang:1.24.1-bookworm AS build +FROM golang:1.24.4-bookworm AS build ENV GO111MODULE=on ARG MAKE_TARGET=go-build diff --git a/apiv2/VERSION b/apiv2/VERSION index cd57a8b95..ccbccc3dc 100644 --- a/apiv2/VERSION +++ b/apiv2/VERSION @@ -1 +1 @@ -2.1.5 +2.2.0 diff --git a/apiv2/go.mod b/apiv2/go.mod index aaa71aa67..233ac8efb 100644 --- a/apiv2/go.mod +++ b/apiv2/go.mod @@ -3,7 +3,7 @@ module github.com/open-edge-platform/infra-core/apiv2/v2 -go 1.24.1 +go 1.24.4 replace github.com/open-edge-platform/infra-core/inventory/v2 => ../inventory diff --git a/bulk-import-tools/VERSION b/bulk-import-tools/VERSION index 06bb45291..bd8bf882d 100644 --- a/bulk-import-tools/VERSION +++ b/bulk-import-tools/VERSION @@ -1 +1 @@ -1.6.1-dev +1.7.0 diff --git a/bulk-import-tools/go.mod b/bulk-import-tools/go.mod index 8a91b0b72..f8992e38a 100644 --- a/bulk-import-tools/go.mod +++ b/bulk-import-tools/go.mod @@ -3,7 +3,7 @@ module github.com/open-edge-platform/infra-core/bulk-import-tools -go 1.24.1 +go 1.24.4 require ( github.com/google/uuid v1.6.0 diff --git a/exporters-inventory/Dockerfile b/exporters-inventory/Dockerfile index 8d9842b36..dce4d9b13 100644 --- a/exporters-inventory/Dockerfile +++ b/exporters-inventory/Dockerfile @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: (C) 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM golang:1.24.1-bookworm as build +FROM golang:1.24.4-bookworm as build ENV GO111MODULE=on ARG MAKE_TARGET=go-build diff --git a/exporters-inventory/VERSION b/exporters-inventory/VERSION index eca4cfe1f..398935591 100644 --- a/exporters-inventory/VERSION +++ b/exporters-inventory/VERSION @@ -1 +1 @@ -1.19.1-dev +1.20.0 diff --git a/exporters-inventory/go.mod b/exporters-inventory/go.mod index 1670c5250..9a99f47f0 100644 --- a/exporters-inventory/go.mod +++ b/exporters-inventory/go.mod @@ -3,7 +3,7 @@ module github.com/open-edge-platform/infra-core/exporters-inventory -go 1.24.1 +go 1.24.4 require ( github.com/onosproject/onos-lib-go v0.10.29-0.20241209125119-55579ffad35f diff --git a/inventory/Dockerfile b/inventory/Dockerfile index ec7c66ebc..c2eef36c2 100644 --- a/inventory/Dockerfile +++ b/inventory/Dockerfile @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: (C) 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM golang:1.24.1-bookworm as build +FROM golang:1.24.4-bookworm as build ARG OPA_VERSION ARG OPA_SHA ARG ATLAS_VERSION diff --git a/inventory/VERSION b/inventory/VERSION index a5f3e61bd..90efbd4e3 100644 --- a/inventory/VERSION +++ b/inventory/VERSION @@ -1 +1 @@ -2.27.0 +2.28.0 diff --git a/inventory/go.mod b/inventory/go.mod index 709d2316c..aae3b273a 100644 --- a/inventory/go.mod +++ b/inventory/go.mod @@ -3,7 +3,7 @@ module github.com/open-edge-platform/infra-core/inventory/v2 -go 1.24.1 +go 1.24.4 require ( ariga.io/atlas v0.33.0 diff --git a/inventory/pkg/util/collections/collections.go b/inventory/pkg/util/collections/collections.go index 359971bed..22a0bdfe7 100644 --- a/inventory/pkg/util/collections/collections.go +++ b/inventory/pkg/util/collections/collections.go @@ -3,7 +3,12 @@ package collections -import "github.com/open-edge-platform/infra-core/inventory/v2/pkg/util/function" +import ( + "sort" + "strings" + + "github.com/open-edge-platform/infra-core/inventory/v2/pkg/util/function" +) // MapSlice converts each element of `a` by applying function `f`. func MapSlice[T any, M any](a []T, f func(T) M) []M { @@ -41,3 +46,30 @@ func ForEach[T any](c []T, f func(T)) { f(e) } } + +// ConcatMapValuesSorted takes a map of string keys and values, sorts the keys alphabetically, +// concatenates the corresponding non-empty values using the specified delimiter, and returns +// the resulting string. If the map is empty or all values are empty, it returns an empty string. +func ConcatMapValuesSorted(m map[string]string, delimiter string) string { + if len(m) == 0 { + return "" + } + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + // Sort keys alphabetically + sort.Strings(keys) + values := make([]string, 0, len(keys)) + for _, k := range keys { + if m[k] != "" { + values = append(values, m[k]) + } + } + + if len(values) == 0 { + return "" + } + + return strings.Join(values, delimiter) +} diff --git a/inventory/pkg/util/util_test.go b/inventory/pkg/util/util_test.go index 803dabc4c..8e275b629 100644 --- a/inventory/pkg/util/util_test.go +++ b/inventory/pkg/util/util_test.go @@ -1264,3 +1264,70 @@ func TestGetResourceKeyFromResource(t *testing.T) { assert.Equal(t, "", resourceID) } } + +func TestConcatMapValuesSorted(t *testing.T) { + tests := []struct { + name string + input map[string]string + expected string + }{ + { + name: "NilMap", + input: nil, + expected: "", + }, + { + name: "EmptyMap", + input: map[string]string{}, + expected: "", + }, + { + name: "SingleKeyValue", + input: map[string]string{ + "a": "foo", + }, + expected: "foo", + }, + { + name: "SingleKeyEmptyValue", + input: map[string]string{ + "a": "", + }, + expected: "", + }, + { + name: "MultipleKeysSorted", + input: map[string]string{ + "b": "bar", + "a": "foo", + "c": "baz", + }, + expected: "foo\x1fbar\x1fbaz", + }, + { + name: "KeysWithEmptyValue", + input: map[string]string{ + "a": "", + "b": "bar", + }, + expected: "bar", + }, + { + name: "KeysWithInterspersedEmptyValue", + input: map[string]string{ + "a": "foo", + "b": "", + "c": "baz", + }, + expected: "foo\x1fbaz", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := collections.ConcatMapValuesSorted(tt.input, "\x1f") + if got != tt.expected { + t.Errorf("ConcatMapValuesSorted() = %q, want %q", got, tt.expected) + } + }) + } +} diff --git a/tenant-controller/Dockerfile b/tenant-controller/Dockerfile index d684270ca..29668403a 100644 --- a/tenant-controller/Dockerfile +++ b/tenant-controller/Dockerfile @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: (C) 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -FROM golang:1.24.1-bookworm as build +FROM golang:1.24.4-bookworm as build SHELL ["/bin/bash", "-euo", "pipefail", "-c"] diff --git a/tenant-controller/VERSION b/tenant-controller/VERSION index 124846b48..1cf0537c3 100644 --- a/tenant-controller/VERSION +++ b/tenant-controller/VERSION @@ -1 +1 @@ -0.18.1-dev +0.19.0 diff --git a/tenant-controller/go.mod b/tenant-controller/go.mod index d1c5f734c..04a02a3c6 100644 --- a/tenant-controller/go.mod +++ b/tenant-controller/go.mod @@ -3,7 +3,7 @@ module github.com/open-edge-platform/infra-core/tenant-controller -go 1.24.1 +go 1.24.4 require ( github.com/cenkalti/backoff/v4 v4.3.0 diff --git a/version.mk b/version.mk index 709bf01ed..62b98aa06 100644 --- a/version.mk +++ b/version.mk @@ -9,7 +9,7 @@ GOJUNITREPORTVERSION_HAVE := $(shell go-junit-report -version | sed s/.*" v"// GOJUNITREPORTVERSION_REQ := 2.1.0 OPAVERSION_HAVE := $(shell opa version | grep "Version:" | grep -v "Go" | sed 's/.*Version: //') OPAVERSION_REQ := 1.5.0 -GOVERSION_REQ := 1.24.1 +GOVERSION_REQ := 1.24.4 GOVERSION_HAVE := $(shell go version | sed 's/.*version go//' | sed 's/ .*//') MOCKGENVERSION_HAVE := $(shell mockgen -version | sed s/.*"v"// | sed 's/ .*//') MOCKGENVERSION_REQ := 1.6.0