Skip to content

Commit

Permalink
Update golangci-lint to v1.48.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpollet committed Aug 16, 2022
1 parent dc45a9a commit d8d913a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .golangci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
[linters]
enable-all = true
disable = [
"ifshort", # Deprecated
"interfacer", # Deprecated
"golint", # Deprecated
"maligned", # Deprecated
Expand All @@ -56,13 +57,16 @@
"noctx", # Too strict
"exhaustive", # Too strict
"exhaustivestruct", # Too strict
"exhaustruct", # Duplicate of exhaustivestruct
"nlreturn", # Too strict
"ireturn", # Not relevant
"varnamelen", # Not relevant
"nilnil", # Not relevant
"testpackage", # Does not allow testing private funcs
"tparallel", # Not relevant
"paralleltest", # Not relevant
"forcetypeassert", # Too strict
"nonamedreturns", # Not relevant
"funlen",
]

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ 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.43.0
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.48.0

ENV GO111MODULE on
COPY go.mod go.sum ./
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io"
"net"
"net/http"
"time"

Expand Down Expand Up @@ -203,7 +204,7 @@ func (a *API) getMeshNodeConfiguration(w http.ResponseWriter, r *http.Request) {
return
}

resp, err := http.Get(fmt.Sprintf("http://%s:8080/api/rawdata", pod.Status.PodIP))
resp, err := http.Get(fmt.Sprintf("http://%s/api/rawdata", net.JoinHostPort(pod.Status.PodIP, "8080")))
if err != nil {
a.log.Errorf("Unable to get configuration from pod %q: %v", pod.Name, err)
http.Error(w, "", http.StatusBadGateway)
Expand Down
12 changes: 6 additions & 6 deletions pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ type PortFinder interface {

// When multiple Traefik Routers listen to the same entrypoint and have the same Rule, the chosen router is the one
// with the highest priority. There are a few cases where this priority is crucial when building the dynamic configuration:
// - When a TrafficSplit is set on a k8s service, 2 Traefik Routers are created. One for accessing the k8s service
// endpoints and one for accessing the services endpoints mentioned in the TrafficSplit. They both have the same Rule
// but we should always prioritize the TrafficSplit. Therefore, TrafficSplit Routers should always have a higher priority.
// - When a TrafficTarget Destination targets pods of a k8s service and a TrafficSplit is set on this service. This
// creates 2 Traefik Routers. One for the TrafficSplit and one for the TrafficTarget. We should always prioritize
// TrafficSplits Routers and TrafficSplit Routers should always have a higher priority than TrafficTarget Routers.
// - When a TrafficSplit is set on a k8s service, 2 Traefik Routers are created. One for accessing the k8s service
// endpoints and one for accessing the services endpoints mentioned in the TrafficSplit. They both have the same Rule
// but we should always prioritize the TrafficSplit. Therefore, TrafficSplit Routers should always have a higher priority.
// - When a TrafficTarget Destination targets pods of a k8s service and a TrafficSplit is set on this service. This
// creates 2 Traefik Routers. One for the TrafficSplit and one for the TrafficTarget. We should always prioritize
// TrafficSplits Routers and TrafficSplit Routers should always have a higher priority than TrafficTarget Routers.
const (
priorityService = iota + 1
priorityTrafficTargetDirect
Expand Down

0 comments on commit d8d913a

Please sign in to comment.