Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.34.1
1.35.0
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apiv2/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion apiv2/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.5
2.2.0
2 changes: 1 addition & 1 deletion apiv2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion bulk-import-tools/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.1-dev
1.7.0
2 changes: 1 addition & 1 deletion bulk-import-tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion exporters-inventory/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion exporters-inventory/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.19.1-dev
1.20.0
2 changes: 1 addition & 1 deletion exporters-inventory/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion inventory/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion inventory/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.27.0
2.28.0
2 changes: 1 addition & 1 deletion inventory/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 33 additions & 1 deletion inventory/pkg/util/collections/collections.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
67 changes: 67 additions & 0 deletions inventory/pkg/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
}
}
2 changes: 1 addition & 1 deletion tenant-controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

Expand Down
2 changes: 1 addition & 1 deletion tenant-controller/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.18.1-dev
0.19.0
2 changes: 1 addition & 1 deletion tenant-controller/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading