Skip to content

Commit 6fe6de1

Browse files
authored
Update Go to 1.27.x (#1053)
* Update Go to 1.27.x Also sync Makefile.common and .github/workflows/golangci-lint.yml from prometheus. Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Replace deprecated gomodguard linter with v2 Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Add more deprecation ignore lines Stop-gap while we consider doing things differently. Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * Fix gomodguard_v2 config Signed-off-by: Bryan Boreham <bjboreham@gmail.com> --------- Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
1 parent 5ea89b9 commit 6fe6de1

7 files changed

Lines changed: 39 additions & 23 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
container:
1919
# Whenever the Go version is updated here, .promu.yml
2020
# should also be updated.
21-
image: quay.io/prometheus/golang-builder:1.26-base
21+
image: quay.io/prometheus/golang-builder:1.27-base
2222
steps:
2323
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2424
with:
@@ -31,7 +31,7 @@ jobs:
3131
container:
3232
# Whenever the Go version is updated here, .promu.yml
3333
# should also be updated.
34-
image: quay.io/prometheus/golang-builder:1.26-base
34+
image: quay.io/prometheus/golang-builder:1.27-base
3535
steps:
3636
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3737
with:

‎.github/workflows/golangci-lint.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
with:
3131
persist-credentials: false
3232
- name: Install Go
33-
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
33+
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
3434
with:
35-
go-version: 1.26.x
35+
go-version: 1.27.x
3636
- name: Install snmp_exporter/generator dependencies
3737
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
3838
if: github.repository == 'prometheus/snmp_exporter'

‎.golangci.yml‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ issues:
1212
linters:
1313
enable:
1414
- errorlint
15-
- gomodguard
15+
- gomodguard_v2
1616
- misspell
1717
- revive
1818
- whitespace
@@ -28,13 +28,12 @@ linters:
2828
- std-error-handling
2929
warn-unused: true
3030
settings:
31-
gomodguard:
31+
gomodguard_v2:
3232
blocked:
33-
modules:
34-
- github.com/pkg/errors:
35-
recommendations:
36-
- errors
37-
- fmt
33+
- module: github.com/pkg/errors
34+
recommendations:
35+
- errors
36+
- fmt
3837
revive:
3938
rules:
4039
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md

‎.promu.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
go:
2-
# Whenever the Go version is updated here, .travis.yml and
3-
# .circle/config.yml should also be updated if in use.
4-
version: 1.26
2+
# Whenever the Go version is updated here, .github/workflows/ci.yml
3+
# should also be updated if in use.
4+
version: 1.27
55
repository:
66
path: github.com/prometheus/test-infra
77
build:

‎Makefile.common‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
6161
SKIP_GOLANGCI_LINT :=
6262
GOLANGCI_LINT :=
6363
GOLANGCI_LINT_OPTS ?=
64-
GOLANGCI_LINT_VERSION ?= v2.12.2
64+
GOLANGCI_LINT_VERSION ?= v2.13.1
6565
GOLANGCI_FMT_OPTS ?=
6666
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
6767
# windows isn't included here because of the path separator being different.
@@ -247,6 +247,11 @@ common-docker-repo-name:
247247

248248
.PHONY: common-docker $(BUILD_DOCKER_ARCHS)
249249
common-docker: $(BUILD_DOCKER_ARCHS)
250+
251+
.PHONY: common-docker-current-arch
252+
common-docker-current-arch:
253+
$(MAKE) common-docker-$(GOHOSTARCH)
254+
250255
# DOCKER_ARCHS holds promu architecture names, which are not OCI platform strings.
251256
$(BUILD_DOCKER_ARCHS): common-docker-%:
252257
@for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \

‎pkg/provider/gke/gke.go‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,11 @@ func (c *GKE) clusterDeleted(req *containerpb.DeleteClusterRequest) (bool, error
288288
// clusterRunning checks whether a cluster is in a running state.
289289
func (c *GKE) clusterRunning(zone, projectID, clusterID string) (bool, error) {
290290
req := &containerpb.GetClusterRequest{
291+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
291292
ProjectId: projectID,
292-
Zone: zone,
293+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
294+
Zone: zone,
295+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
293296
ClusterId: clusterID,
294297
}
295298
cluster, err := c.clientGKE.GetCluster(c.ctx, req)
@@ -397,8 +400,10 @@ func (c *GKE) NodePoolDelete(*kingpin.ParseContext) error {
397400
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
398401
ProjectId: reqC.ProjectId,
399402
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
400-
Zone: reqC.Zone,
401-
ClusterId: reqC.Cluster.Name,
403+
Zone: reqC.Zone,
404+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
405+
ClusterId: reqC.Cluster.Name,
406+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
402407
NodePoolId: node.Name,
403408
}
404409
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
@@ -444,9 +449,13 @@ func (c *GKE) nodePoolDeleted(req *containerpb.DeleteNodePoolRequest) (bool, err
444449
// nodePoolRunning checks whether a nodepool has been created and is running.
445450
func (c *GKE) nodePoolRunning(zone, projectID, clusterID, poolName string) (bool, error) {
446451
req := &containerpb.GetNodePoolRequest{
447-
ProjectId: projectID,
448-
Zone: zone,
449-
ClusterId: clusterID,
452+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
453+
ProjectId: projectID,
454+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
455+
Zone: zone,
456+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
457+
ClusterId: clusterID,
458+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
450459
NodePoolId: poolName,
451460
}
452461
rep, err := c.clientGKE.GetNodePool(c.ctx, req)
@@ -526,8 +535,11 @@ func (c *GKE) AllNodepoolsDeleted(*kingpin.ParseContext) error {
526535
func (c *GKE) NewK8sProvider(*kingpin.ParseContext) error {
527536
// Get the authentication certificate for the cluster using the GKE client.
528537
req := &containerpb.GetClusterRequest{
538+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
529539
ProjectId: c.DeploymentVars["GKE_PROJECT_ID"],
530-
Zone: c.DeploymentVars["ZONE"],
540+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
541+
Zone: c.DeploymentVars["ZONE"],
542+
//nolint:staticcheck // SA1019 - Ignore "Do not use.".
531543
ClusterId: c.DeploymentVars["CLUSTER_NAME"],
532544
}
533545
rep, err := c.clientGKE.GetCluster(c.ctx, req)

‎tools/prometheus-builder/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM quay.io/prometheus/golang-builder:1.26-base
1+
FROM quay.io/prometheus/golang-builder:1.27-base
22

33
RUN mkdir -p /go/src/github.com
44

0 commit comments

Comments
 (0)