Skip to content

Commit

Permalink
Fix CI and update go version and dependencies. (observatorium#82)
Browse files Browse the repository at this point in the history
* mod: Update to go 1.17 and update dependencies

* bingo: Update linter bin and move to go 1.17

* docker: Build from go 1.17 and use scratch base

* lint: Update config for latest version

* ci: Use go 1.17

* *.: Refactor for updated interfaces and fix lint issues

* make: generate jsonnet
  • Loading branch information
philipgough committed Mar 28, 2022
1 parent 929e575 commit 5ce2593
Show file tree
Hide file tree
Showing 19 changed files with 2,168 additions and 319 deletions.
6 changes: 3 additions & 3 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ $(GOJSONTOYAML): .bingo/gojsontoyaml.mod
@echo "(re)installing $(GOBIN)/gojsontoyaml-v0.0.0-20200602132005-3697ded27e8c"
@cd .bingo && $(GO) build -mod=mod -modfile=gojsontoyaml.mod -o=$(GOBIN)/gojsontoyaml-v0.0.0-20200602132005-3697ded27e8c "github.com/brancz/gojsontoyaml"

GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.32.2
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.45.2
$(GOLANGCI_LINT): .bingo/golangci-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/golangci-lint-v1.32.2"
@cd .bingo && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.32.2 "github.com/golangci/golangci-lint/cmd/golangci-lint"
@echo "(re)installing $(GOBIN)/golangci-lint-v1.45.2"
@cd .bingo && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.45.2 "github.com/golangci/golangci-lint/cmd/golangci-lint"

JB := $(GOBIN)/jb-v0.4.0
$(JB): .bingo/jb.mod
Expand Down
2 changes: 1 addition & 1 deletion .bingo/gojsontoyaml.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.15
go 1.17

require github.com/brancz/gojsontoyaml v0.0.0-20200602132005-3697ded27e8c
4 changes: 2 additions & 2 deletions .bingo/golangci-lint.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.15
go 1.17

require github.com/golangci/golangci-lint v1.32.2 // cmd/golangci-lint
require github.com/golangci/golangci-lint v1.45.2 // cmd/golangci-lint
2 changes: 1 addition & 1 deletion .bingo/jb.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.15
go 1.17

require github.com/jsonnet-bundler/jsonnet-bundler v0.4.0 // cmd/jb
2 changes: 1 addition & 1 deletion .bingo/jsonnet.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.15
go 1.17

require github.com/google/go-jsonnet v0.16.0 // cmd/jsonnet
2 changes: 1 addition & 1 deletion .bingo/jsonnetfmt.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.15
go 1.17

require github.com/google/go-jsonnet v0.16.0 // cmd/jsonnetfmt
2 changes: 1 addition & 1 deletion .bingo/kubeval.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.15
go 1.17

require github.com/instrumenta/kubeval v0.0.0-20201005082916-38668c6c5b23
2 changes: 1 addition & 1 deletion .bingo/promtool.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.15
go 1.17

require github.com/prometheus/prometheus v1.8.2-0.20200213233353-b90be6f32a33 // cmd/promtool
2 changes: 1 addition & 1 deletion .bingo/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi

GOJSONTOYAML="$GOBIN/gojsontoyaml-v0.0.0-20200602132005-3697ded27e8c"

GOLANGCI_LINT="$GOBIN/golangci-lint-v1.32.2"
GOLANGCI_LINT="$GOBIN/golangci-lint-v1.45.2"

JB="$GOBIN/jb-v0.4.0"

Expand Down
8 changes: 4 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ platform:
steps:
- name: test
pull: always
image: golang:1.14.2
image: golang:1.17.8
commands:
- make test

- name: lint
pull: always
image: golang:1.14.2
image: golang:1.17.8
commands:
- make lint
- git diff --exit-code

- name: build
pull: always
image: golang:1.14.2
image: golang:1.17.8
commands:
- make thanos-receive-controller

Expand All @@ -34,7 +34,7 @@ steps:
- git diff --exit-code

- name: tags
image: golang:1.14.2
image: golang:1.17.8
commands:
- echo -n "$(git rev-parse --abbrev-ref HEAD | tr / -)-$(date +%Y-%m-%d)-$(git rev-parse --short HEAD),latest" > .tags
when:
Expand Down
1 change: 0 additions & 1 deletion .errcheck_excludes.txt

This file was deleted.

7 changes: 6 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ linters:
- nolintlint
- testpackage
- wrapcheck
- gomoddirectives
- ireturn
- varnamelen
- paralleltest

linters-settings:
errcheck:
exclude: .errcheck_excludes.txt
exclude-functions:
- '(github.com/go-kit/log.Logger).Log'
lll:
line-length: 200
funlen:
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.16-alpine3.12 as builder
FROM golang:1.17-alpine3.15 as builder

WORKDIR /workspace

Expand All @@ -8,7 +8,7 @@ RUN apk update && apk upgrade && apk add --no-cache alpine-sdk

RUN make thanos-receive-controller

FROM gcr.io/distroless/static:latest
FROM scratch

COPY --from=builder /workspace/thanos-receive-controller /usr/bin/thanos-receive-controller

Expand Down
22 changes: 11 additions & 11 deletions examples/dashboards/receive-controller.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"title": "Rate",
"tooltip": {
"shared": false,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
Expand Down Expand Up @@ -135,7 +135,7 @@
"title": "Errors",
"tooltip": {
"shared": false,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
Expand Down Expand Up @@ -223,7 +223,7 @@
"title": "Rate",
"tooltip": {
"shared": false,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
Expand Down Expand Up @@ -299,7 +299,7 @@
"title": "Errors",
"tooltip": {
"shared": false,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
Expand Down Expand Up @@ -387,7 +387,7 @@
"title": "Rate",
"tooltip": {
"shared": false,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
Expand Down Expand Up @@ -465,7 +465,7 @@
"title": "Errors",
"tooltip": {
"shared": false,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
Expand Down Expand Up @@ -561,7 +561,7 @@
"title": "Nodes per Hashring",
"tooltip": {
"shared": false,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
Expand Down Expand Up @@ -645,7 +645,7 @@
"title": "Tenants per Hashring",
"tooltip": {
"shared": false,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
Expand Down Expand Up @@ -735,7 +735,7 @@
"title": "Last Updated",
"tooltip": {
"shared": false,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "singlestat",
Expand Down Expand Up @@ -813,7 +813,7 @@
"title": "Last Updated",
"tooltip": {
"shared": false,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "singlestat",
Expand Down Expand Up @@ -866,7 +866,7 @@
"value": "default"
},
"hide": 0,
"label": null,
"label": "Data Source",
"name": "datasource",
"options": [ ],
"query": "prometheus",
Expand Down
113 changes: 103 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,111 @@
module github.com/observatorium/thanos-receive-controller

go 1.14
go 1.17

require (
github.com/go-kit/kit v0.9.0
github.com/google/go-cmp v0.5.4
github.com/go-kit/log v0.2.0
github.com/google/go-cmp v0.5.6
github.com/oklog/run v1.1.0
github.com/onsi/ginkgo v1.11.0 // indirect
github.com/onsi/gomega v1.8.1 // indirect
github.com/prometheus/client_golang v1.5.0
github.com/thanos-io/thanos v0.12.0
k8s.io/api v0.0.0-20191115095533-47f6de673b26
k8s.io/apimachinery v0.0.0-20191115015347-3c7067801da2
github.com/prometheus/client_golang v1.12.1
github.com/thanos-io/thanos v0.25.2
k8s.io/api v0.23.5
k8s.io/apimachinery v0.23.5
k8s.io/client-go v12.0.0+incompatible
)

replace k8s.io/client-go => k8s.io/client-go v0.0.0-20190620085101-78d2af792bab
require (
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
github.com/OneOfOne/xxhash v1.2.6 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a // indirect
github.com/armon/go-metrics v0.3.9 // indirect
github.com/aws/aws-sdk-go v1.42.8 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dennwc/varint v1.0.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/edsrzf/mmap-go v1.0.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect
github.com/fatih/color v1.12.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-redis/redis/v8 v8.11.4 // indirect
github.com/gogo/googleapis v1.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gogo/status v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.2.0.20201207153454-9f6bf00c00a7 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v0.16.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/julienschmidt/httprouter v1.3.0 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/miekg/dns v1.1.43 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing-contrib/go-stdlib v1.0.0 // 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.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/common/sigv4 v0.1.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/prometheus v1.8.2-0.20211119115433-692a54649ed7 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.7.0 // indirect
github.com/uber/jaeger-client-go v2.29.1+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/vimeo/galaxycache v0.0.0-20210323154928-b7e5d71c067a // indirect
go.opencensus.io v0.23.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/goleak v1.1.12 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d // indirect
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211021150943-2b146023228c // indirect
google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)

replace (
github.com/vimeo/galaxycache => github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e
k8s.io/client-go => k8s.io/client-go v0.23.5
)
Loading

0 comments on commit 5ce2593

Please sign in to comment.