Skip to content

Commit a3e6cb4

Browse files
support az aware endpoints with multiple sts in one hashring (#1)
## What changes are proposed in this pull request? 1. Support az aware hashring in Thanos v0.32+ https://thanos.io/tip/components/receive.md/#az-aware-ketama-hashring-experimental, 2. also supported multiple sts in one hashring config 3. fix lint and go dependency issues OSS PR: #129 ## How is this tested? main_test.go, Make thanos-receive-controller pending test in deployment
2 parents c57219e + 26f12fd commit a3e6cb4

21 files changed

+3558
-1483
lines changed

.bingo/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# But not these files:
66
!.gitignore
77
!*.mod
8+
!*.sum
89
!README.md
910
!Variables.mk
1011
!variables.env

.bingo/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ This is directory which stores Go modules with pinned buildable package that is
55
* Run `bingo get` to install all tools having each own module file in this directory.
66
* Run `bingo get <tool>` to install <tool> that have own module file in this directory.
77
* For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $(<upper case tool name>) variable where <tool> is the .bingo/<tool>.mod.
8-
* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool
8+
* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool.
9+
* For go: Import `.bingo/variables.go` to for variable names.
910
* See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies.
1011

1112
## Requirements

.bingo/Variables.mk

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.3. DO NOT EDIT.
1+
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.9. DO NOT EDIT.
22
# All tools are designed to be build inside $GOBIN.
3+
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
34
GOPATH ?= $(shell go env GOPATH)
45
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin
56
GO ?= $(shell which go)
67

7-
# Bellow generated variables ensure that every time a tool under each variable is invoked, the correct version
8+
# Below generated variables ensure that every time a tool under each variable is invoked, the correct version
89
# will be used; reinstalling only if needed.
910
# For example for gojsontoyaml variable:
1011
#
@@ -17,44 +18,44 @@ GO ?= $(shell which go)
1718
# @$(GOJSONTOYAML) <flags/args..>
1819
#
1920
GOJSONTOYAML := $(GOBIN)/gojsontoyaml-v0.0.0-20200602132005-3697ded27e8c
20-
$(GOJSONTOYAML): .bingo/gojsontoyaml.mod
21+
$(GOJSONTOYAML): $(BINGO_DIR)/gojsontoyaml.mod
2122
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
2223
@echo "(re)installing $(GOBIN)/gojsontoyaml-v0.0.0-20200602132005-3697ded27e8c"
23-
@cd .bingo && $(GO) build -mod=mod -modfile=gojsontoyaml.mod -o=$(GOBIN)/gojsontoyaml-v0.0.0-20200602132005-3697ded27e8c "github.com/brancz/gojsontoyaml"
24+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=gojsontoyaml.mod -o=$(GOBIN)/gojsontoyaml-v0.0.0-20200602132005-3697ded27e8c "github.com/brancz/gojsontoyaml"
2425

25-
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.45.2
26-
$(GOLANGCI_LINT): .bingo/golangci-lint.mod
26+
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.55.2
27+
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
2728
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
28-
@echo "(re)installing $(GOBIN)/golangci-lint-v1.45.2"
29-
@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"
29+
@echo "(re)installing $(GOBIN)/golangci-lint-v1.55.2"
30+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.55.2 "github.com/golangci/golangci-lint/cmd/golangci-lint"
3031

3132
JB := $(GOBIN)/jb-v0.4.0
32-
$(JB): .bingo/jb.mod
33+
$(JB): $(BINGO_DIR)/jb.mod
3334
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
3435
@echo "(re)installing $(GOBIN)/jb-v0.4.0"
35-
@cd .bingo && $(GO) build -mod=mod -modfile=jb.mod -o=$(GOBIN)/jb-v0.4.0 "github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb"
36+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=jb.mod -o=$(GOBIN)/jb-v0.4.0 "github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb"
3637

3738
JSONNET := $(GOBIN)/jsonnet-v0.16.0
38-
$(JSONNET): .bingo/jsonnet.mod
39+
$(JSONNET): $(BINGO_DIR)/jsonnet.mod
3940
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
4041
@echo "(re)installing $(GOBIN)/jsonnet-v0.16.0"
41-
@cd .bingo && $(GO) build -mod=mod -modfile=jsonnet.mod -o=$(GOBIN)/jsonnet-v0.16.0 "github.com/google/go-jsonnet/cmd/jsonnet"
42+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=jsonnet.mod -o=$(GOBIN)/jsonnet-v0.16.0 "github.com/google/go-jsonnet/cmd/jsonnet"
4243

4344
JSONNETFMT := $(GOBIN)/jsonnetfmt-v0.16.0
44-
$(JSONNETFMT): .bingo/jsonnetfmt.mod
45+
$(JSONNETFMT): $(BINGO_DIR)/jsonnetfmt.mod
4546
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
4647
@echo "(re)installing $(GOBIN)/jsonnetfmt-v0.16.0"
47-
@cd .bingo && $(GO) build -mod=mod -modfile=jsonnetfmt.mod -o=$(GOBIN)/jsonnetfmt-v0.16.0 "github.com/google/go-jsonnet/cmd/jsonnetfmt"
48+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=jsonnetfmt.mod -o=$(GOBIN)/jsonnetfmt-v0.16.0 "github.com/google/go-jsonnet/cmd/jsonnetfmt"
4849

4950
KUBEVAL := $(GOBIN)/kubeval-v0.0.0-20201005082916-38668c6c5b23
50-
$(KUBEVAL): .bingo/kubeval.mod
51+
$(KUBEVAL): $(BINGO_DIR)/kubeval.mod
5152
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
5253
@echo "(re)installing $(GOBIN)/kubeval-v0.0.0-20201005082916-38668c6c5b23"
53-
@cd .bingo && $(GO) build -mod=mod -modfile=kubeval.mod -o=$(GOBIN)/kubeval-v0.0.0-20201005082916-38668c6c5b23 "github.com/instrumenta/kubeval"
54+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=kubeval.mod -o=$(GOBIN)/kubeval-v0.0.0-20201005082916-38668c6c5b23 "github.com/instrumenta/kubeval"
5455

5556
PROMTOOL := $(GOBIN)/promtool-v1.8.2-0.20200213233353-b90be6f32a33
56-
$(PROMTOOL): .bingo/promtool.mod
57+
$(PROMTOOL): $(BINGO_DIR)/promtool.mod
5758
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
5859
@echo "(re)installing $(GOBIN)/promtool-v1.8.2-0.20200213233353-b90be6f32a33"
59-
@cd .bingo && $(GO) build -mod=mod -modfile=promtool.mod -o=$(GOBIN)/promtool-v1.8.2-0.20200213233353-b90be6f32a33 "github.com/prometheus/prometheus/cmd/promtool"
60+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=promtool.mod -o=$(GOBIN)/promtool-v1.8.2-0.20200213233353-b90be6f32a33 "github.com/prometheus/prometheus/cmd/promtool"
6061

.bingo/gojsontoyaml.sum

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
github.com/brancz/gojsontoyaml v0.0.0-20200602132005-3697ded27e8c h1:hb6WqfcKQZlNx/vahy51SaIvKnoXD5609Nm0PC4msEM=
2+
github.com/brancz/gojsontoyaml v0.0.0-20200602132005-3697ded27e8c/go.mod h1:+00lOjYXPgMfxHVPvg9GDtc3BX5Xh5aFpB4gMB8gfMo=
3+
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
4+
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
5+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
6+
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
7+
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

.bingo/golangci-lint.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
22

33
go 1.17
44

5-
require github.com/golangci/golangci-lint v1.45.2 // cmd/golangci-lint
5+
require github.com/golangci/golangci-lint v1.55.2 // cmd/golangci-lint

0 commit comments

Comments
 (0)