Skip to content

Commit

Permalink
Dependency updates and linter fixes. (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Apr 16, 2024
1 parent 1d22706 commit b7453ba
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 374 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,26 @@ jobs:

steps:
- name: Log in to the container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go 1.21
uses: actions/setup-go@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version-file: 'go.mod'
cache: false

- name: Install libpcap-dev
run: sudo apt-get install -y libpcap-dev

- name: Lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
args: --build-tags client -p bugs -p unused --timeout=3m

Expand All @@ -50,7 +51,7 @@ jobs:
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=latest" >> $GITHUB_ENV || true
- name: Build and push image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21-alpine3.18 as builder
FROM golang:1.22-alpine3.19 as builder
WORKDIR /work
COPY . .
RUN apk add \
Expand All @@ -11,7 +11,7 @@ RUN apk add \
dbus-libs
RUN make

FROM alpine:3.18
FROM alpine:3.19

RUN apk add \
libpcap \
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ CGO_ENABLED := 1

SHA := $(shell git rev-parse --short=8 HEAD)
GITVERSION := $(shell git describe --long --all)
BUILDDATE := $(shell GO111MODULE=off go run ${COMMONDIR}/time.go)
# gnu date format iso-8601 is parsable with Go RFC3339
BUILDDATE := $(shell date --iso-8601=seconds)
VERSION := $(or ${VERSION},$(shell git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git rev-parse --short HEAD))

in-docker: gofmt test all;
Expand Down Expand Up @@ -35,7 +36,7 @@ test:

.PHONY: lint
lint:
golangci-lint run --build-tags client -p bugs -p unused
golangci-lint run --build-tags client -p bugs -p unused

.PHONY: gofmt
gofmt:
Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/switcher/sonic/sonic.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Sonic struct {
}

type PortInfo struct {
Alias string
Alias string `json:"alias"`
}

func New(log *slog.Logger, frrTplFile string) (*Sonic, error) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/switcher/templates/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func readConf(t *testing.T, i string) types.Conf {
b, err := os.ReadFile(i)
require.NoError(t, err, "unexpected error when reading testing input")

err = yaml.Unmarshal(b, &c)
err = yaml.Unmarshal(b, &c) // nolint:musttag
require.NoError(t, err, "unexpected error when unmarshalling testing input")
return c
}
Expand Down
1 change: 0 additions & 1 deletion cmd/internal/switcher/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package types
import "fmt"

// Conf holds the switch configuration
// nolint:musttag
type Conf struct {
Name string
LogLevel string
Expand Down
105 changes: 50 additions & 55 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,88 +1,83 @@
module github.com/metal-stack/metal-core

go 1.21
go 1.22

require (
github.com/avast/retry-go/v4 v4.5.0
github.com/avast/retry-go/v4 v4.5.1
github.com/coreos/go-systemd/v22 v22.5.0
github.com/go-redis/redismock/v9 v9.0.3
github.com/google/go-cmp v0.5.9
github.com/go-openapi/errors v0.22.0
github.com/go-openapi/strfmt v0.23.0
github.com/go-openapi/swag v0.23.0
github.com/go-openapi/validate v0.24.0
github.com/go-redis/redismock/v9 v9.2.0
github.com/google/go-cmp v0.6.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/metal-stack/go-lldpd v0.4.5
github.com/metal-stack/metal-api v0.23.2
github.com/metal-stack/metal-go v0.23.2
github.com/metal-stack/go-lldpd v0.4.7
github.com/metal-stack/metal-api v0.28.4
github.com/metal-stack/metal-go v0.28.4
github.com/metal-stack/v v1.0.3
github.com/prometheus/client_golang v1.16.0
github.com/redis/go-redis/v9 v9.1.0
github.com/stretchr/testify v1.8.4
github.com/prometheus/client_golang v1.19.0
github.com/redis/go-redis/v9 v9.5.1
github.com/stretchr/testify v1.9.0
github.com/vishvananda/netlink v1.2.1-beta.2
golang.org/x/text v0.12.0
google.golang.org/grpc v1.57.0
google.golang.org/protobuf v1.31.0
golang.org/x/text v0.14.0
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-oidc/v3 v3.6.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/coreos/go-oidc/v3 v3.10.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.20.4 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/runtime v0.26.0 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/strfmt v0.21.7 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/validate v0.22.1 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/loads v0.22.0 // indirect
github.com/go-openapi/runtime v0.28.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.5 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx v1.2.26 // indirect
github.com/lestrrat-go/jwx/v2 v2.0.21 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 // indirect
github.com/mdlayher/lldp v0.0.0-20150915211757-afd9f83164c5 // indirect
github.com/metal-stack/metal-lib v0.13.2 // indirect
github.com/metal-stack/security v0.6.7 // indirect
github.com/metal-stack/metal-lib v0.16.2 // indirect
github.com/metal-stack/security v0.8.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.50.0 // indirect
github.com/prometheus/procfs v0.13.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
go.mongodb.org/mongo-driver v1.12.1 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/sys v0.11.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230726155614-23370e0ffb3e // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/oauth2 v0.19.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.19.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
)
Loading

0 comments on commit b7453ba

Please sign in to comment.