Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Traefik v2.10, go1.21 and alpine 3.18 #842

Open
wants to merge 10 commits into
base: v1.4
Choose a base branch
from
Open
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
32 changes: 30 additions & 2 deletions .golangci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,33 @@
"github.com/mailgun/minheap",
]

[linters-settings.depguard]
[linters-settings.depguard.rules]
[linters-settings.depguard.rules.main]
[[linters-settings.depguard.rules.main.deny]]
pkg = "github.com/instana/testify"
desc = "not allowed"

[[linters-settings.depguard.rules.main.deny]]
pkg = "github.com/pkg/errors"
desc = "Should be replaced by standard lib errors package"

[linters-settings.tagalign]
align = false
sort = true
order = [
"description",
"json",
"toml",
"yaml",
"yml",
"label",
"label-slice-as-struct",
"file",
"kv",
"export"
]

[linters]
enable-all = true
disable = [
Expand Down Expand Up @@ -77,6 +104,7 @@
max-per-linter = 0
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",
"Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*printf?|os\\.(Un)?Setenv|\\(k8s\\.io/client-go/tools/cache\\.SharedInformer\\)\\.AddEventHandler). is not checked",
"package-comments: should have a package comment",
"unused-parameter: parameter '[^']+' seems to be unused, consider removing or renaming it as _",
]
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
11 changes: 6 additions & 5 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,26 +21,27 @@ 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.55.1

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

COPY --from=base-image /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=maker /go/src/github.com/traefik/mesh/dist/traefik-mesh /app/
COPY --from=maker --chown=1000:1000 /go/src/github.com/traefik/mesh/dist/traefik-mesh /app/
USER app

ENTRYPOINT ["/app/traefik-mesh"]
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -102,7 +102,7 @@ tidy:
go mod tidy

k3d:
@command -v k3d >/dev/null 2>&1 || curl -s https://raw.githubusercontent.com/rancher/k3d/v5.4.4/install.sh | TAG=v5.4.4 bash
@command -v k3d >/dev/null 2>&1 || curl -s https://raw.githubusercontent.com/rancher/k3d/v5.6.0/install.sh | TAG=v5.6.0 bash

docs-package:
mkdir -p $(CURDIR)/pages
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
10 changes: 5 additions & 5 deletions docs/content/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
serviceAccount: whoami-server
containers:
- name: whoami
image: traefik/whoami:v1.6.0
image: traefik/whoami:v1.10.1
imagePullPolicy: IfNotPresent

---
Expand All @@ -77,7 +77,7 @@ spec:
serviceAccount: whoami-server
containers:
- name: whoami-tcp
image: traefik/whoamitcp:v0.1.0
image: traefik/whoamitcp:v0.3.0
imagePullPolicy: IfNotPresent

---
Expand Down Expand Up @@ -122,7 +122,7 @@ spec:
serviceAccountName: whoami-client
containers:
- name: whoami-client
image: giantswarm/tiny-tools:3.9
image: giantswarm/tiny-tools:3.12
command:
- "sleep"
- "3600"
Expand Down Expand Up @@ -164,7 +164,7 @@ IP: 5.6.7.8
RemoteAddr: 1.2.3.4:12345
GET / HTTP/1.1
Host: whoami.whoami.svc.cluster.local
User-Agent: curl/7.64.0
User-Agent: curl/7.69.1
Accept: */*
```

Expand Down Expand Up @@ -239,7 +239,7 @@ IP: 5.6.7.8
RemoteAddr: 1.2.3.4:12345
GET / HTTP/1.1
Host: whoami.whoami.traefik.mesh
User-Agent: curl/7.64.0
User-Agent: curl/7.69.1
Accept: */*
X-Forwarded-For: 3.4.5.6
```
Expand Down
4 changes: 2 additions & 2 deletions docs/content/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ spec:
spec:
containers:
- name: server
image: traefik/whoami:v1.6.0
image: traefik/whoami:v1.10.1
ports:
- containerPort: 80
---
Expand Down Expand Up @@ -116,7 +116,7 @@ spec:
spec:
containers:
- name: client
image: giantswarm/tiny-tools:3.9
image: giantswarm/tiny-tools:3.12
imagePullPolicy: IfNotPresent
command:
- "sleep"
Expand Down
100 changes: 57 additions & 43 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,69 +1,83 @@
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.4.0
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.10.5
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.26.10
k8s.io/apimachinery v0.26.10
k8s.io/client-go v0.26.10
)

require (
github.com/BurntSushi/toml v1.1.0 // indirect
github.com/BurntSushi/toml v1.3.2 // 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.1 // 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
github.com/go-logr/logr v0.4.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/go-acme/lego/v4 v4.14.2 // indirect
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.6.0 // 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/imdario/mergo v0.3.12 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/miekg/dns v1.1.56 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.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/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/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
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
sigs.k8s.io/yaml v1.2.0 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

// Containous forks
Expand Down
Loading