Skip to content

Commit 6eb6b52

Browse files
authored
Update go, simplify some stuff (#15)
1 parent e0f7960 commit 6eb6b52

File tree

10 files changed

+232
-289
lines changed

10 files changed

+232
-289
lines changed

.github/workflows/docker.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ jobs:
2929
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
3030

3131
- name: Checkout
32-
uses: actions/checkout@v2
32+
uses: actions/checkout@v3
3333

34-
- name: Set up Go 1.19
35-
uses: actions/setup-go@v2
34+
- name: Set up Go 1.20
35+
uses: actions/setup-go@v4
3636
with:
37-
go-version: '1.19'
37+
go-version: '1.20'
3838

3939
- name: Lint
40-
uses: golangci/golangci-lint-action@v2
40+
uses: golangci/golangci-lint-action@v3
4141
with:
4242
args: --build-tags integration -p bugs -p unused --timeout=3m
4343

@@ -48,7 +48,7 @@ jobs:
4848
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=latest" >> $GITHUB_ENV || true
4949
5050
- name: Build and push image
51-
uses: docker/build-push-action@v2
51+
uses: docker/build-push-action@v3
5252
with:
5353
context: .
5454
push: true

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM metalstack/builder:latest as builder
1+
FROM ghcr.io/metal-stack/builder:latest as builder
22

3-
FROM alpine:3.16
3+
FROM alpine:3.17
44
RUN apk add --no-cache tini ca-certificates
55
COPY --from=builder /work/bin/metal-image-cache-sync /metal-image-cache-sync
66
CMD ["/metal-image-cache-sync"]

cmd/internal/sync/syncer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func (s *Syncer) download(rootPath string, e api.CacheEntity) error {
241241
case api.Kernel:
242242
case api.LocalFile:
243243
default:
244-
s.logger.Errorw("unexpected entity type for metrics collection: %v", ent)
244+
s.logger.Errorw("unexpected entity type for metrics collection", "entity", ent)
245245
}
246246

247247
err = s.fs.Rename(tmpTargetPath, targetPath)

cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func run() error {
173173
return err
174174
}
175175

176-
mc, _, err := metalgo.NewDriver(c.MetalAPIEndpoint, "", c.MetalAPIHMAC, metalgo.AuthType("Metal-View"))
176+
mc, err := metalgo.NewDriver(c.MetalAPIEndpoint, "", c.MetalAPIHMAC, metalgo.AuthType("Metal-View"))
177177
if err != nil {
178178
logger.Errorw("cannot create metal-api client", "error", err)
179179
return err

go.mod

Lines changed: 58 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,98 @@
11
module github.com/metal-stack/metal-image-cache-sync
22

3-
go 1.18
3+
go 1.20
44

55
require (
6-
github.com/Masterminds/semver/v3 v3.1.1
7-
github.com/aws/aws-sdk-go v1.44.79
8-
github.com/docker/go-units v0.4.0
9-
github.com/go-openapi/strfmt v0.21.3
10-
github.com/go-playground/validator/v10 v10.11.0
11-
github.com/google/go-cmp v0.5.8
12-
github.com/metal-stack/metal-go v0.19.0
6+
github.com/Masterminds/semver/v3 v3.2.0
7+
github.com/aws/aws-sdk-go v1.44.232
8+
github.com/docker/go-units v0.5.0
9+
github.com/go-openapi/strfmt v0.21.7
10+
github.com/go-playground/validator/v10 v10.12.0
11+
github.com/google/go-cmp v0.5.9
12+
github.com/metal-stack/metal-go v0.22.3
1313
github.com/metal-stack/v v1.0.3
1414
github.com/olekukonko/tablewriter v0.0.5
15-
github.com/prometheus/client_golang v1.13.0
15+
github.com/prometheus/client_golang v1.14.0
1616
github.com/robfig/cron/v3 v3.0.1
17-
github.com/spf13/afero v1.9.2
18-
github.com/spf13/cobra v1.5.0
19-
github.com/spf13/viper v1.12.0
20-
github.com/stretchr/testify v1.8.0
21-
go.uber.org/zap v1.22.0
22-
sigs.k8s.io/controller-runtime v0.12.3
17+
github.com/spf13/afero v1.9.5
18+
github.com/spf13/cobra v1.6.1
19+
github.com/spf13/viper v1.15.0
20+
github.com/stretchr/testify v1.8.2
21+
go.uber.org/zap v1.24.0
22+
sigs.k8s.io/controller-runtime v0.14.6
2323
)
2424

2525
require (
26-
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
26+
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
2727
github.com/benbjohnson/clock v1.3.0 // indirect
2828
github.com/beorn7/perks v1.0.1 // indirect
29-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
30-
github.com/coreos/go-oidc/v3 v3.2.0 // indirect
29+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
30+
github.com/coreos/go-oidc/v3 v3.5.0 // indirect
3131
github.com/davecgh/go-spew v1.1.1 // indirect
32-
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
33-
github.com/fsnotify/fsnotify v1.5.4 // indirect
32+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
33+
github.com/fsnotify/fsnotify v1.6.0 // indirect
34+
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
35+
github.com/go-logr/logr v1.2.3 // indirect
36+
github.com/go-logr/stdr v1.2.2 // indirect
3437
github.com/go-openapi/analysis v0.21.4 // indirect
3538
github.com/go-openapi/errors v0.20.3 // indirect
36-
github.com/go-openapi/jsonpointer v0.19.5 // indirect
37-
github.com/go-openapi/jsonreference v0.20.0 // indirect
39+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
40+
github.com/go-openapi/jsonreference v0.20.2 // indirect
3841
github.com/go-openapi/loads v0.21.2 // indirect
39-
github.com/go-openapi/runtime v0.24.1 // indirect
40-
github.com/go-openapi/spec v0.20.7 // indirect
41-
github.com/go-openapi/swag v0.22.1 // indirect
42-
github.com/go-openapi/validate v0.22.0 // indirect
43-
github.com/go-playground/locales v0.14.0 // indirect
44-
github.com/go-playground/universal-translator v0.18.0 // indirect
45-
github.com/goccy/go-json v0.9.10 // indirect
46-
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
47-
github.com/golang/protobuf v1.5.2 // indirect
42+
github.com/go-openapi/runtime v0.25.0 // indirect
43+
github.com/go-openapi/spec v0.20.8 // indirect
44+
github.com/go-openapi/swag v0.22.3 // indirect
45+
github.com/go-openapi/validate v0.22.1 // indirect
46+
github.com/go-playground/locales v0.14.1 // indirect
47+
github.com/go-playground/universal-translator v0.18.1 // indirect
48+
github.com/goccy/go-json v0.10.2 // indirect
49+
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
50+
github.com/golang/protobuf v1.5.3 // indirect
4851
github.com/google/uuid v1.3.0 // indirect
4952
github.com/gorilla/mux v1.8.0 // indirect
5053
github.com/hashicorp/hcl v1.0.0 // indirect
51-
github.com/inconshreveable/mousetrap v1.0.1 // indirect
54+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5255
github.com/jmespath/go-jmespath v0.4.0 // indirect
5356
github.com/josharian/intern v1.0.0 // indirect
54-
github.com/leodido/go-urn v1.2.1 // indirect
57+
github.com/leodido/go-urn v1.2.2 // indirect
5558
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
5659
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
5760
github.com/lestrrat-go/httpcc v1.0.1 // indirect
5861
github.com/lestrrat-go/iter v1.0.2 // indirect
5962
github.com/lestrrat-go/jwx v1.2.25 // indirect
60-
github.com/lestrrat-go/option v1.0.0 // indirect
61-
github.com/magiconair/properties v1.8.6 // indirect
63+
github.com/lestrrat-go/option v1.0.1 // indirect
64+
github.com/magiconair/properties v1.8.7 // indirect
6265
github.com/mailru/easyjson v0.7.7 // indirect
63-
github.com/mattn/go-runewidth v0.0.13 // indirect
64-
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
65-
github.com/metal-stack/masterdata-api v0.8.12 // indirect
66-
github.com/metal-stack/metal-lib v0.10.0 // indirect
67-
github.com/metal-stack/security v0.6.5 // indirect
66+
github.com/mattn/go-runewidth v0.0.14 // indirect
67+
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
68+
github.com/metal-stack/metal-lib v0.11.6 // indirect
69+
github.com/metal-stack/security v0.6.6 // indirect
6870
github.com/mitchellh/mapstructure v1.5.0 // indirect
6971
github.com/oklog/ulid v1.3.1 // indirect
7072
github.com/opentracing/opentracing-go v1.2.0 // indirect
71-
github.com/pelletier/go-toml v1.9.5 // indirect
72-
github.com/pelletier/go-toml/v2 v2.0.3 // indirect
73+
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
7374
github.com/pkg/errors v0.9.1 // indirect
7475
github.com/pmezard/go-difflib v1.0.0 // indirect
75-
github.com/prometheus/client_model v0.2.0 // indirect
76-
github.com/prometheus/common v0.37.0 // indirect
77-
github.com/prometheus/procfs v0.8.0 // indirect
78-
github.com/rivo/uniseg v0.3.4 // indirect
76+
github.com/prometheus/client_model v0.3.0 // indirect
77+
github.com/prometheus/common v0.42.0 // indirect
78+
github.com/prometheus/procfs v0.9.0 // indirect
79+
github.com/rivo/uniseg v0.4.4 // indirect
7980
github.com/spf13/cast v1.5.0 // indirect
8081
github.com/spf13/jwalterweatherman v1.1.0 // indirect
8182
github.com/spf13/pflag v1.0.5 // indirect
82-
github.com/subosito/gotenv v1.4.0 // indirect
83-
go.mongodb.org/mongo-driver v1.10.1 // indirect
83+
github.com/subosito/gotenv v1.4.2 // indirect
84+
go.mongodb.org/mongo-driver v1.11.3 // indirect
85+
go.opentelemetry.io/otel v1.11.1 // indirect
86+
go.opentelemetry.io/otel/trace v1.11.1 // indirect
8487
go.uber.org/atomic v1.10.0 // indirect
85-
go.uber.org/multierr v1.8.0 // indirect
86-
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
87-
golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect
88-
golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7 // indirect
89-
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
90-
golang.org/x/text v0.3.7 // indirect
88+
go.uber.org/multierr v1.11.0 // indirect
89+
golang.org/x/crypto v0.7.0 // indirect
90+
golang.org/x/net v0.8.0 // indirect
91+
golang.org/x/oauth2 v0.6.0 // indirect
92+
golang.org/x/sys v0.6.0 // indirect
93+
golang.org/x/text v0.8.0 // indirect
9194
google.golang.org/appengine v1.6.7 // indirect
92-
google.golang.org/protobuf v1.28.1 // indirect
95+
google.golang.org/protobuf v1.30.0 // indirect
9396
gopkg.in/ini.v1 v1.67.0 // indirect
9497
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
9598
gopkg.in/yaml.v2 v2.4.0 // indirect

0 commit comments

Comments
 (0)