Skip to content

Commit

Permalink
BUILD/MEDIUM: go: increase Go version to 1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
oktalz committed Sep 23, 2024
1 parent b2ae51d commit bda27ee
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables:
KIND: v0.23.0
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
GO_VERSION: "1.22"
GO_VERSION: "1.23"
DOCKER_VERSION: "26.0"
diff:
stage: diff
Expand Down Expand Up @@ -106,7 +106,7 @@ unit-tests:
- if: $CI_PIPELINE_SOURCE == 'push'
stage: unit-tests
image:
name: $CI_REGISTRY_GO/haproxy-alpine:2.7-go$GO_VERSION
name: $CI_REGISTRY_GO/haproxy-alpine:3.0-go$GO_VERSION
entrypoint: [""]
tags:
- go
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ linters:
- mnd
- inamedparam
- err113 # maybe tmp disable
- exportloopref #deprecated
issues:
exclude:
- "tag is not aligned, should be:" # this is harder to read
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PROJECT_PATH=${PWD}
TARGETPLATFORM?=linux/amd64
GOOS?=linux
GOARCH?=amd64
GOLANGCI_LINT_VERSION=1.59.1
GOLANGCI_LINT_VERSION=1.61.0
CHECK_COMMIT=5.0.2

.PHONY: test
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.22-alpine AS builder
FROM golang:1.23-alpine AS builder

RUN apk --no-cache add git openssh

Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.pebble
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.22-alpine AS builder
FROM golang:1.23-alpine AS builder

RUN apk --no-cache add git openssh

Expand Down
2 changes: 1 addition & 1 deletion deploy/tests/images/http-echo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22-alpine AS builder
FROM golang:1.23-alpine AS builder

COPY *.go /src/
COPY go.mod /src/go.mod
Expand Down
2 changes: 1 addition & 1 deletion deploy/tests/images/http-echo/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module echo-http

go 1.22
go 1.23
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/haproxytech/kubernetes-ingress

go 1.22.0
go 1.23

require (
github.com/Masterminds/semver/v3 v3.2.1
Expand Down
2 changes: 1 addition & 1 deletion pkg/gateways/gateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ func (gm GatewayManagerImpl) isTCPRouteAllowedByListener(listener store.Listener
return routeNamespace != gatewayNamespace
}

gkAllowed := listener.AllowedRoutes.Kinds == nil || len(listener.AllowedRoutes.Kinds) == 0
gkAllowed := len(listener.AllowedRoutes.Kinds) == 0
for _, kind := range listener.AllowedRoutes.Kinds {
if (kind.Group != nil && *kind.Group != v1alpha2.GroupName) || kind.Kind != K8S_TCPROUTE_KIND {
continue
Expand Down
4 changes: 2 additions & 2 deletions pkg/haproxy/api/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (c *clientNative) runRaw(runtime runtime.Runtime, sb strings.Builder, backe
pmm.UpdateRuntimeMetrics(metrics.ObjectServer, err)
return err
}
for i := range len(result) {
for i := range result {
if len(result[i]) > 5 {
switch result[i][1:5] {
case "[3]:", "[2]:", "[1]:", "[0]:":
Expand Down Expand Up @@ -138,7 +138,7 @@ func (c *clientNative) SetMapContent(mapFile string, payload []string) error {
err = fmt.Errorf("error getting map path: %w", err)
return err
}
for i := range len(payload) {
for i := range payload {
_, err = runtime.ExecuteRaw(fmt.Sprintf("add map @%s %s <<\n%s\n", mapVer, mapPath, payload[i]))
pmm.UpdateRuntimeMetrics(metrics.ObjectMap, err)
if err != nil {
Expand Down

0 comments on commit bda27ee

Please sign in to comment.