From 107864f06eed68598bcede46eb8349d18e3764c2 Mon Sep 17 00:00:00 2001 From: mblos Date: Tue, 7 Apr 2026 15:40:37 +0200 Subject: [PATCH 1/2] pin Go toolchain to go1.26.1 for reproducible lint behavior Without a toolchain directive, golangci-lint uses whatever Go version is installed locally to analyze code. --- go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.mod b/go.mod index 2aa5950e6..681a42920 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/cobaltcore-dev/cortex go 1.26 +toolchain go1.26.1 + require ( github.com/cobaltcore-dev/openstack-hypervisor-operator v1.0.2-0.20260402091752-888f1313a307 github.com/go-gorp/gorp v2.2.0+incompatible From 01054bac36ae22f6b4476a6ce4bac8ac49aefb5a Mon Sep 17 00:00:00 2001 From: mblos Date: Thu, 9 Apr 2026 09:39:40 +0200 Subject: [PATCH 2/2] renovate updates Makefile --- .github/renovate.json | 20 +++++++++++++++++++ go.mod | 2 -- .../commitments/api_change_commitments.go | 4 ++-- .../reservations/commitments/state.go | 2 +- tools/logs/parser.go | 2 +- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index 65083e8fa..efd17ea12 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -22,6 +22,26 @@ "gomodTidy", "gomodUpdateImportPaths" ], + "regexManagers": [ + { + "fileMatch": ["^Makefile$"], + "matchStrings": ["CONTROLLER_TOOLS_VERSION \\?= (?v[\\d.]+)"], + "depNameTemplate": "sigs.k8s.io/controller-tools", + "datasourceTemplate": "go" + }, + { + "fileMatch": ["^Makefile$"], + "matchStrings": ["GOLANGCI_LINT_VERSION \\?= (?v[\\d.]+)"], + "depNameTemplate": "github.com/golangci/golangci-lint/v2", + "datasourceTemplate": "go" + }, + { + "fileMatch": ["^Makefile$"], + "matchStrings": ["GOTESTSUM_VERSION \\?= (?v[\\d.]+)"], + "depNameTemplate": "gotest.tools/gotestsum", + "datasourceTemplate": "go" + } + ], "packageRules": [ { "matchPackageNames": [ diff --git a/go.mod b/go.mod index 681a42920..2aa5950e6 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/cobaltcore-dev/cortex go 1.26 -toolchain go1.26.1 - require ( github.com/cobaltcore-dev/openstack-hypervisor-operator v1.0.2-0.20260402091752-888f1313a307 github.com/go-gorp/gorp v2.2.0+incompatible diff --git a/internal/scheduling/reservations/commitments/api_change_commitments.go b/internal/scheduling/reservations/commitments/api_change_commitments.go index 5c2436267..8fc4c075f 100644 --- a/internal/scheduling/reservations/commitments/api_change_commitments.go +++ b/internal/scheduling/reservations/commitments/api_change_commitments.go @@ -294,9 +294,9 @@ ProcessLoop: // Build rejection reason from failed commitments if len(failedCommitments) > 0 { var reasonBuilder strings.Builder - reasonBuilder.WriteString(fmt.Sprintf("%d commitment(s) failed to apply: ", len(failedCommitments))) + fmt.Fprintf(&reasonBuilder, "%d commitment(s) failed to apply: ", len(failedCommitments)) for commitmentUUID, reason := range failedCommitments { - reasonBuilder.WriteString(fmt.Sprintf("\n- commitment %s: %s", commitmentUUID, reason)) + fmt.Fprintf(&reasonBuilder, "\n- commitment %s: %s", commitmentUUID, reason) } resp.RejectionReason = reasonBuilder.String() } diff --git a/internal/scheduling/reservations/commitments/state.go b/internal/scheduling/reservations/commitments/state.go index 61ca1ff10..1bfd47691 100644 --- a/internal/scheduling/reservations/commitments/state.go +++ b/internal/scheduling/reservations/commitments/state.go @@ -194,7 +194,7 @@ func FromChangeCommitmentTargetState( smallestFlavorMemoryBytes := int64(smallestFlavor.MemoryMB) * 1024 * 1024 //nolint:gosec // flavor memory from specs, realistically bounded // Amount represents multiples of the smallest flavor in the group - totalMemoryBytes := int64(amountMultiple) * smallestFlavorMemoryBytes //nolint:gosec // commitment amount from Limes API, bounded by quota limits + totalMemoryBytes := int64(amountMultiple) * smallestFlavorMemoryBytes //nolint:gosec // commitment amount from Limes API, realistically bounded return &CommitmentState{ CommitmentUUID: string(commitment.UUID), diff --git a/tools/logs/parser.go b/tools/logs/parser.go index 6540e78b3..2b32401d7 100644 --- a/tools/logs/parser.go +++ b/tools/logs/parser.go @@ -450,7 +450,7 @@ func formatWeightMapFullColorized(weights map[string]float64, indent int) string if i%4 == 0 { sb.WriteString(indentStr) } - sb.WriteString(fmt.Sprintf("%s: %.4f", colorizeHost(hw.host), hw.weight)) + fmt.Fprintf(&sb, "%s: %.4f", colorizeHost(hw.host), hw.weight) if i < len(sorted)-1 { sb.WriteString(", ") }