Skip to content

Commit

Permalink
Update to go1.21 and alpine 3.18
Browse files Browse the repository at this point in the history
  • Loading branch information
reneleonhardt committed Oct 14, 2023
1 parent eab0211 commit e38b637
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 92 deletions.
6 changes: 5 additions & 1 deletion .golangci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,9 @@
max-same-issues = 0
exclude = [
"Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*printf?|os\\.(Un)?Setenv). is not checked",
"should have a package comment, unless it's in another file for this package",
"package-comments: should have a package comment",
"import '[^']+' is not allowed from list 'Main'",
"if-return: redundant if ...; err != nil check, just return error instead.",
"unused-parameter: parameter '[^']+' seems to be unused, consider removing or renaming it as _",
"tag is not aligned, should be: description:",
]
4 changes: 2 additions & 2 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Traefik Mesh Pipeline
agent:
machine:
type: e1-standard-4
os_image: ubuntu1804
os_image: ubuntu2004

auto_cancel:
running:
Expand All @@ -20,7 +20,7 @@ global_job_config:
prologue:
commands:
- curl -sSfL https://raw.githubusercontent.com/ldez/semgo/master/godownloader.sh | sudo sh -s -- -b "/usr/local/bin"
- sudo semgo go1.19
- sudo semgo go1.21
- echo "${DOCKERHUB_PASSWORD}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
- checkout

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-alpine AS base-image
FROM golang:1.21-alpine AS base-image

# Package dependencies
RUN apk --no-cache --no-progress add \
Expand All @@ -21,21 +21,21 @@ WORKDIR /go/src/github.com/traefik/mesh
RUN curl -sfL https://gist.githubusercontent.com/traefiker/6d7ac019c11d011e4f131bb2cca8900e/raw/goreleaser.sh | sh

# Download golangci-lint binary to bin folder in $GOPATH
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.48.0
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$GOPATH/bin" v1.54.2

ENV GO111MODULE on
COPY go.mod go.sum ./
RUN go mod download
COPY . .

FROM base-image as maker
FROM base-image AS maker

ARG MAKE_TARGET=local-build

RUN make ${MAKE_TARGET}

## IMAGE
FROM alpine:3.15
FROM alpine:3.18

RUN addgroup -g 1000 -S app && \
adduser -u 1000 -S app -G app
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ check: $(DIST_DIR)
"$(DOCKER_IMAGE_NAME):check" golangci-lint run --config .golangci.toml

publish-images: build
seihon publish -v "$(VERSION)" -v "latest" --image-name ${DOCKER_IMAGE_NAME} --dry-run=false --base-runtime-image=alpine:3.15
seihon publish -v "$(VERSION)" -v "latest" --image-name ${DOCKER_IMAGE_NAME} --dry-run=false --base-runtime-image=alpine:3.18

## Create packages for the release
release-packages: vendor build
Expand Down
2 changes: 1 addition & 1 deletion docs/check.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.15
FROM alpine:3.18

# The "build-dependencies" virtual package provides build tools for html-proofer installation.
# It compile ruby-nokogiri, because alpine native version is always out of date
Expand Down
10 changes: 5 additions & 5 deletions docs/content/contributing/building-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ $ make
Successfully tagged traefik/mesh:latest
docker run --name=build -t "traefik/mesh:latest" version
version:
version : d6947526
commit : d6947526
build date : 2022-03-16_03:19:22PM
go version : go1.19
version : 019a39d
commit : 019a39d
build date : 2023-10-14_02:17:49PM
go version : go1.21.3
go compiler : gc
platform : linux/amd64
#[...]
Expand Down Expand Up @@ -55,7 +55,7 @@ version:
version : dev
commit : I don't remember exactly
build date : I don't remember exactly
go version : go1.19
go version : go1.21
go compiler : gc
platform : linux/amd64
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.15
FROM alpine:3.18

ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin

Expand Down
50 changes: 26 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
module github.com/traefik/mesh

go 1.19
go 1.21

toolchain go1.21.3

require (
github.com/cenkalti/backoff/v4 v4.1.1
github.com/go-check/check v0.0.0-20180628173108-788fd7840127
github.com/google/uuid v1.3.0
github.com/cenkalti/backoff/v4 v4.2.1
github.com/go-check/check v0.0.0-20201130134442-10cb98267c6c
github.com/google/uuid v1.3.1
github.com/gorilla/mux v1.8.0
github.com/hashicorp/go-version v1.3.0
github.com/servicemeshinterface/smi-sdk-go v0.4.1
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.8.0
github.com/traefik/paerser v0.1.8
github.com/traefik/traefik/v2 v2.8.3
github.com/hashicorp/go-version v1.6.0
github.com/servicemeshinterface/smi-sdk-go v0.5.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.4
github.com/traefik/paerser v0.2.0
github.com/traefik/traefik/v2 v2.8.8
github.com/vdemeester/shakers v0.1.0
k8s.io/api v0.22.5
k8s.io/apimachinery v0.22.5
k8s.io/client-go v0.22.5
k8s.io/api v0.22.17
k8s.io/apimachinery v0.22.17
k8s.io/client-go v0.22.17
)

require (
github.com/BurntSushi/toml v1.1.0 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
github.com/go-acme/lego/v4 v4.7.0 // indirect
Expand All @@ -33,7 +35,7 @@ require (
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/huandu/xstrings v1.3.1 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
Expand All @@ -46,12 +48,12 @@ require (
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f // indirect
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect
golang.org/x/crypto v0.3.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/term v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
Expand All @@ -61,8 +63,8 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.10.0 // indirect
k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c // indirect
k8s.io/utils v0.0.0-20210820185131-d34e5cb4466e // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)

Expand Down
Loading

0 comments on commit e38b637

Please sign in to comment.