-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci(smoketest): Pin promtool version in GHA #14954
Conversation
.github/workflows/smoke-test.yaml
Outdated
@@ -134,7 +134,7 @@ jobs: | |||
cilium_pod=$(kubectl -n kube-system get po -o name --field-selector=status.phase==Running -l 'k8s-app=cilium' -o jsonpath='{.items[0].metadata.name}' ) | |||
kubectl -n kube-system exec $cilium_pod -- sh -c "apt update && apt install curl -y" | |||
kubectl -n kube-system exec $cilium_pod -- curl http://localhost:9090/metrics > metrics.prom | |||
go get -u github.com/prometheus/prometheus/cmd/promtool | |||
GO111MODULE=on go get github.com/prometheus/prometheus/cmd/promtool@e4487274853c587717006eeda8804e597d120340 # v2.24.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sayboras my suggestion was to import github.com/prometheus/prometheus/cmd/promtool
directly so that we have all dependencies versions being stored in a single place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, I think that Gilberto mentioned this in slack as well, having this in tools.go so that the version will be pinned in go.mod is fine to me.
I haven't tried it yet, but I have unpleasant experience with prometheus/client_golang packages as they are quite bulky and lead to a lot of conflicts/replace directive statements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually it's not too bad, below is the diff for your info.
go.mod diff
diff --git a/go.mod b/go.mod
index da24d15b3..9c2d4af06 100644
--- a/go.mod
+++ b/go.mod
@@ -9,7 +9,6 @@ require (
github.com/Azure/go-autorest/autorest/adal v0.9.10
github.com/Azure/go-autorest/autorest/azure/auth v0.5.6
github.com/Azure/go-autorest/autorest/to v0.4.0
- github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef
github.com/aws/aws-sdk-go-v2 v1.1.0
github.com/aws/aws-sdk-go-v2/config v1.0.0
@@ -26,9 +25,7 @@ require (
github.com/containernetworking/cni v0.8.0
github.com/containernetworking/plugins v0.9.0
github.com/davecgh/go-spew v1.1.1
- github.com/docker/distribution v2.7.1+incompatible // indirect
- github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0
- github.com/docker/go-connections v0.4.0 // indirect
+ github.com/docker/docker v20.10.1+incompatible
github.com/docker/libnetwork v0.0.0-20190128195551-d8d4c8cf03d7
github.com/fsnotify/fsnotify v1.4.10-0.20200417215612-7f4cf4dd2b52
github.com/go-bindata/go-bindata/v3 v3.1.3
@@ -47,7 +44,7 @@ require (
github.com/google/renameio v1.0.0
github.com/google/uuid v1.2.0
github.com/gorilla/mux v1.8.0
- github.com/hashicorp/consul/api v1.3.0
+ github.com/hashicorp/consul/api v1.8.1
github.com/hashicorp/go-immutable-radix v1.3.0
github.com/hashicorp/golang-lru v0.5.4
// must be bound to this old version not to break libnetwork
@@ -56,17 +53,14 @@ require (
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351
github.com/kr/pretty v0.2.1
github.com/mattn/go-shellwords v1.0.10
- github.com/miekg/dns v1.0.14
- github.com/morikuni/aec v1.0.0 // indirect
+ github.com/miekg/dns v1.1.35
github.com/onsi/ginkgo v1.12.1
github.com/onsi/gomega v1.10.5
- github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
- github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/optiopay/kafka v0.0.0-00010101000000-000000000000
github.com/pmezard/go-difflib v1.0.0
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/client_model v0.2.1-0.20200623203004-60555c9708c7
- github.com/prometheus/prometheus v1.8.2-0.20210119214810-e4487274853c // indirect
+ github.com/prometheus/prometheus v1.8.2-0.20210119214810-e4487274853c
github.com/russross/blackfriday/v2 v2.1.0
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa
github.com/servak/go-fastping v0.0.0-20160802140958-5718d12e20a0
@@ -84,10 +78,10 @@ require (
golang.org/x/net v0.0.0-20210119194325-5f4716e94777
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
golang.org/x/sys v0.0.0-20210110051926-789bb1bd4061
- golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
+ golang.org/x/time v0.0.0-20201208040808-7e3f01d25324
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e
google.golang.org/genproto v0.0.0-20210111234610-22ae2b108f89
- google.golang.org/grpc v1.29.1
+ google.golang.org/grpc v1.33.2
google.golang.org/protobuf v1.25.0
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
gopkg.in/ini.v1 v1.62.0
@@ -117,6 +111,9 @@ replace (
github.com/miekg/dns => github.com/cilium/dns v1.1.4-0.20190417235132-8e25ec9a0ff3
github.com/optiopay/kafka => github.com/cilium/kafka v0.0.0-20180809090225-01ce283b732b
+ google.golang.org/grpc => google.golang.org/grpc v1.29.1
+
// Using private fork of controller-tools. See commit msg for more context
// as to why we are using a private fork.
sigs.k8s.io/controller-tools => github.com/christarazi/controller-tools v0.3.1-0.20200911184030-7e668c1fb4c2
c33b09b
to
139e5a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sayboras I think I take it back. I understimated how bad it would be to directly import prometheus into our code base 🤯 🤯 🤯
haha no worry, all good, let me revert back the commit. |
This commit is to pin the promtool, also avoid using -u in go get command. Closes cilium#14950 Signed-off-by: Tam Mach <sayboras@yahoo.com>
139e5a1
to
53e75fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Same issue is happening on v1.9: https://github.com/cilium/cilium/pull/14961/checks?check_run_id=1888105879. We need to backport. |
This commit is to pin the promtool in tools.go
Closes #14950
Signed-off-by: Tam Mach sayboras@yahoo.com