diff --git a/go.mod b/go.mod index 71621981aac..020ebc390a8 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,6 @@ require ( github.com/pelletier/go-toml v1.8.0 github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 github.com/pkg/errors v0.9.1 - github.com/prometheus/common v0.9.1 github.com/rickb777/date v1.13.0 github.com/robfig/cron/v3 v3.0.1 github.com/rogpeppe/fastuuid v1.2.0 diff --git a/go.sum b/go.sum index aa7529f9eff..ab2512846f3 100644 --- a/go.sum +++ b/go.sum @@ -24,32 +24,27 @@ cloud.google.com/go v0.55.0/go.mod h1:ZHmoY+/lIMNkN2+fBmuTiqZ4inFhvQad8ft7MT8IV5 cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.60.0/go.mod h1:yw2G51M9IfRboUH61Us8GqCeF1PzPblB823Mn2q2eAU= -cloud.google.com/go v0.61.0 h1:NLQf5e1OMspfNT1RAHOB3ublr1TW3YTXO8OiWwVjK2U= cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= cloud.google.com/go v0.62.0 h1:RmDygqvj27Zf3fCQjQRtLyC7KwFcHkeJitcO0OoGOcA= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/logging v1.0.0/go.mod h1:V1cc3ogwobYzQq5f2R7DS/GvRIrI4FKj01Gs5glwAls= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/pubsub v1.4.0/go.mod h1:LFrqilwgdw4X2cJS9ALgzYmMu+ULyrUN6IHV3CPK4TM= cloud.google.com/go/pubsub v1.6.1/go.mod h1:kvW9rcn9OLEx6eTIzMBbWbpB8YsK3vu9jxgPolVz+p4= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0 h1:UDpwYIwla4jHGzZJaEJYx1tOejbgSoNqsAfHAUYe2r8= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.9.0/go.mod h1:m+/etGaqZbylxaNT876QGXqEHp4PR2Rq5GMqICWb9bU= @@ -57,13 +52,11 @@ cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09 cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY= contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA= -contrib.go.opencensus.io/exporter/ocagent v0.4.12 h1:jGFvw3l57ViIVEPKKEUXPcLYIXJmQxLUh6ey1eJhwyc= contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0= contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs= contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200615190824-f8c219d2d895 h1:bXMXgHq+WAIkI2dQivk1yMyKVVqMj8emLmhEqQghPWw= contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200615190824-f8c219d2d895/go.mod h1:IshRmMJBhDfFj5Y67nVhMYTTIze91RUeT73ipWKs/GY= -contrib.go.opencensus.io/exporter/prometheus v0.1.0 h1:SByaIoWwNgMdPSgl5sMqM2KDE5H/ukPWBRo314xiDvg= contrib.go.opencensus.io/exporter/prometheus v0.1.0/go.mod h1:cGFniUXGZlKRjzOyuZJ6mgB+PgBcCIa79kEKR8YCW+A= contrib.go.opencensus.io/exporter/prometheus v0.2.1-0.20200609204449-6bcf6f8577f0 h1:2O3c1g5CzMc1+Uah4Waot9Obm0yw70VXJzWaP6Fz3nw= contrib.go.opencensus.io/exporter/prometheus v0.2.1-0.20200609204449-6bcf6f8577f0/go.mod h1:MjHoxkI7Ny27toPeFkRbXbzVjzIGkwOAptrAy8Mxtm8= @@ -152,7 +145,6 @@ github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0 github.com/Masterminds/sprig/v3 v3.0.2/go.mod h1:oesJ8kPONMONaZgtiHNzUShJbksypC5kWczhZAf6+aU= github.com/Masterminds/vcs v1.13.1/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -210,7 +202,6 @@ github.com/aws/aws-sdk-go v1.16.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.19.45/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.23.20 h1:2CBuL21P0yKdZN5urf2NxKa1ha8fhnY+A3pBCHFeZoA= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.23.22/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -218,7 +209,6 @@ github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.29.32/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= github.com/aws/aws-sdk-go v1.29.34/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= github.com/aws/aws-sdk-go v1.30.4/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.30.5 h1:i+sSesaMrSxiUt3NJddOApe2mXK+VNBgfcmRTvNFrXM= github.com/aws/aws-sdk-go v1.30.5/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.30.16/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= @@ -228,7 +218,6 @@ github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U github.com/bazelbuild/buildtools v0.0.0-20190917191645-69366ca98f89/go.mod h1:5JP0TXzWDHXv8qvxRC4InIazwdyDseBDbzESUMKk1yU= github.com/benbjohnson/clock v1.0.0/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -237,7 +226,6 @@ github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngE github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.0+incompatible h1:CGxCgetQ64DKk7rdZ++Vfnb1+ogGNnB17OJKJXD2Cfs= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= @@ -327,7 +315,6 @@ github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492/go.mod h1:JLrzqnKDaYBop github.com/docker/cli v0.0.0-20200210162036-a4bedce16568/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v0.0.0-20191216044856-a8371794149d/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= @@ -373,7 +360,6 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.8.1/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -477,7 +463,6 @@ github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2 github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= -github.com/gobuffalo/envy v1.6.5 h1:X3is06x7v0nW2xiy2yFbbIjwHz57CD6z6MkvqULTCm8= github.com/gobuffalo/envy v1.6.5/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= github.com/gobuffalo/envy v1.7.1 h1:OQl5ys5MBea7OGCdvPbBJWRgnhC/fGona6QKfvFeau8= @@ -624,7 +609,6 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/googleapis/gnostic v0.4.0 h1:BXDUo8p/DaxC+4FJY/SSx3gvnx9C1VdHNgaUkiEL5mk= github.com/googleapis/gnostic v0.4.0/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= diff --git a/pkg/adapter/mtping/adapter.go b/pkg/adapter/mtping/adapter.go index 461c158e01c..33065b4e8ae 100644 --- a/pkg/adapter/mtping/adapter.go +++ b/pkg/adapter/mtping/adapter.go @@ -18,18 +18,21 @@ package mtping import ( "context" + "fmt" + "log" "os" "strconv" - - "knative.dev/pkg/controller" + "sync" cloudevents "github.com/cloudevents/sdk-go/v2" - "github.com/prometheus/common/log" + "github.com/robfig/cron/v3" "go.uber.org/zap" kubeclient "knative.dev/pkg/client/injection/kube/client" + "knative.dev/pkg/controller" "knative.dev/pkg/logging" "knative.dev/eventing/pkg/adapter/v2" + "knative.dev/eventing/pkg/apis/sources/v1beta1" ) const ( @@ -38,10 +41,17 @@ const ( // mtpingAdapter implements the PingSource mt adapter to sinks type mtpingAdapter struct { - logger *zap.SugaredLogger - runner *cronJobsRunner + logger *zap.SugaredLogger + runner *cronJobsRunner + entryidMu sync.RWMutex + entryids map[string]cron.EntryID // key: resource namespace/name } +var ( + _ adapter.Adapter = (*mtpingAdapter)(nil) + _ MTAdapter = (*mtpingAdapter)(nil) +) + func NewEnvConfig() adapter.EnvConfigAccessor { return &adapter.EnvConfig{} } @@ -51,14 +61,16 @@ func NewAdapter(ctx context.Context, _ adapter.EnvConfigAccessor, ceClient cloud runner := NewCronJobsRunner(ceClient, kubeclient.Get(ctx), logging.FromContext(ctx)) return &mtpingAdapter{ - logger: logger, - runner: runner, + logger: logger, + runner: runner, + entryidMu: sync.RWMutex{}, + entryids: make(map[string]cron.EntryID), } } // Start implements adapter.Adapter func (a *mtpingAdapter) Start(ctx context.Context) error { - ctrl := NewController(ctx, a.runner) + ctrl := NewController(ctx, a) a.logger.Info("Starting controllers...") go controller.StartAll(ctx, ctrl) @@ -76,10 +88,48 @@ func GetNoShutDownAfterValue() int { if str != "" { second, err := strconv.Atoi(str) if err != nil || second < 0 || second > 59 { - log.Warnf("%s environment value is invalid. It must be a integer between 0 and 59. (got %s)", EnvNoShutdownAfter, str) + log.Printf("%s environment value is invalid. It must be a integer between 0 and 59. (got %s)", EnvNoShutdownAfter, str) } else { return second } } return 55 // seems a reasonable default } + +// Implements MTAdapter + +func (a *mtpingAdapter) Update(ctx context.Context, source *v1beta1.PingSource) { + logging.FromContext(ctx).Info("Synchronizing schedule") + + key := fmt.Sprintf("%s/%s", source.Namespace, source.Name) + // Is the schedule already cached? + a.entryidMu.RLock() + id, ok := a.entryids[key] + a.entryidMu.RUnlock() + + if ok { + a.runner.RemoveSchedule(id) + } + + id = a.runner.AddSchedule(source) + + a.entryidMu.Lock() + a.entryids[key] = id + a.entryidMu.Unlock() +} + +func (a *mtpingAdapter) Remove(ctx context.Context, source *v1beta1.PingSource) { + key := fmt.Sprintf("%s/%s", source.Namespace, source.Name) + + a.entryidMu.RLock() + id, ok := a.entryids[key] + a.entryidMu.RUnlock() + + if ok { + a.runner.RemoveSchedule(id) + + a.entryidMu.Lock() + delete(a.entryids, key) + a.entryidMu.Unlock() + } +} diff --git a/pkg/adapter/mtping/config.go b/pkg/adapter/mtping/config.go deleted file mode 100644 index d24f9fc38ef..00000000000 --- a/pkg/adapter/mtping/config.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright 2020 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mtping - -import ( - corev1 "k8s.io/api/core/v1" - - "knative.dev/eventing/pkg/apis/eventing" - "knative.dev/eventing/pkg/apis/sources/v1beta1" -) - -type PingConfig struct { - corev1.ObjectReference `json:",inline"` - - // Schedule is the cronjob schedule. Defaults to `* * * * *`. - Schedule string `json:"schedule"` - - // JsonData is json encoded data used as the body of the event posted to - // the sink. Default is empty. If set, datacontenttype will also be set - // to "application/json". - // +optional - JsonData string `json:"jsonData,omitempty"` - - // Extensions specify what attribute are added or overridden on the - // outbound event. Each `Extensions` key-value pair are set on the event as - // an attribute extension independently. - // +optional - Extensions map[string]string `json:"extensions,omitempty"` - - // SinkURI is the current active sink URI that has been configured for the - // Source. - SinkURI string `json:"sinkUri,omitempty"` -} - -type PingConfigs map[string]PingConfig - -// Project creates a PingConfig for the given source -func Project(i interface{}) interface{} { - obj := i.(*v1beta1.PingSource) - - if scope, ok := obj.Annotations[eventing.ScopeAnnotationKey]; ok && scope != eventing.ScopeCluster { - return nil - } - - cfg := &PingConfig{ - ObjectReference: corev1.ObjectReference{ - Name: obj.Name, - Namespace: obj.Namespace, - UID: obj.UID, - ResourceVersion: obj.ResourceVersion, - }, - Schedule: obj.Spec.Schedule, - JsonData: obj.Spec.JsonData, - SinkURI: obj.Status.SinkURI.String(), - } - if obj.Spec.CloudEventOverrides != nil { - cfg.Extensions = obj.Spec.CloudEventOverrides.Extensions - } - return cfg -} diff --git a/pkg/adapter/mtping/config_test.go b/pkg/adapter/mtping/config_test.go deleted file mode 100644 index a176697d7c8..00000000000 --- a/pkg/adapter/mtping/config_test.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright 2020 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mtping - -import ( - "testing" - - "knative.dev/pkg/apis" - - "github.com/google/go-cmp/cmp" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - duckv1 "knative.dev/pkg/apis/duck/v1" - - sourcesv1beta1 "knative.dev/eventing/pkg/apis/sources/v1beta1" -) - -func TestProject(t *testing.T) { - testCases := map[string]struct { - source sourcesv1beta1.PingSource - expected PingConfig - }{ - "TestAddRunRemoveSchedule": { - source: sourcesv1beta1.PingSource{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-name", - Namespace: "test-ns"}, - - Spec: sourcesv1beta1.PingSourceSpec{ - SourceSpec: duckv1.SourceSpec{ - CloudEventOverrides: nil, - }, - Schedule: "* * * * ?", - JsonData: "some data", - }, - Status: sourcesv1beta1.PingSourceStatus{ - SourceStatus: duckv1.SourceStatus{ - SinkURI: &apis.URL{ - Host: "asink", - }, - }, - }, - }, - expected: PingConfig{ - ObjectReference: corev1.ObjectReference{ - Name: "test-name", - Namespace: "test-ns", - }, - Schedule: "* * * * ?", - JsonData: "some data", - SinkURI: "//asink", - }}, - "TestAddRunRemoveScheduleWithExtensionOverride": { - source: sourcesv1beta1.PingSource{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-name", - Namespace: "test-ns"}, - Spec: sourcesv1beta1.PingSourceSpec{ - SourceSpec: duckv1.SourceSpec{ - Sink: duckv1.Destination{}, - CloudEventOverrides: &duckv1.CloudEventOverrides{ - Extensions: map[string]string{"1": "one", "2": "two"}, - }, - }, - Schedule: "* * * * ?", - JsonData: "some data", - }, - Status: sourcesv1beta1.PingSourceStatus{ - SourceStatus: duckv1.SourceStatus{ - SinkURI: &apis.URL{Host: "anothersink"}, - }, - }, - }, - expected: PingConfig{ - ObjectReference: corev1.ObjectReference{ - Name: "test-name", - Namespace: "test-ns", - }, - Schedule: "* * * * ?", - JsonData: "some data", - Extensions: map[string]string{"1": "one", "2": "two"}, - SinkURI: "//anothersink", - }}, - } - for n, tc := range testCases { - t.Run(n, func(t *testing.T) { - got := Project(&tc.source) - if diff := cmp.Diff(&tc.expected, got); diff != "" { - t.Errorf("unexpected projection (-want, +got) = %v", diff) - } - }) - } -} diff --git a/pkg/adapter/mtping/controller.go b/pkg/adapter/mtping/controller.go index b657f5ea89b..b09f51cc616 100644 --- a/pkg/adapter/mtping/controller.go +++ b/pkg/adapter/mtping/controller.go @@ -18,36 +18,56 @@ package mtping import ( "context" - "sync" - - "github.com/robfig/cron/v3" "knative.dev/pkg/controller" "knative.dev/pkg/logging" + "knative.dev/eventing/pkg/adapter/v2" + "knative.dev/eventing/pkg/apis/sources/v1beta1" pingsourceinformer "knative.dev/eventing/pkg/client/injection/informers/sources/v1beta1/pingsource" pingsourcereconciler "knative.dev/eventing/pkg/client/injection/reconciler/sources/v1beta1/pingsource" ) -// NewController initializes the controller and is called by the generated code. -// Registers event handlers to enqueue events. -func NewController(ctx context.Context, cronRunner *cronJobsRunner) *controller.Impl { - logger := logging.FromContext(ctx) +// TODO: code generation - pingsourceInformer := pingsourceinformer.Get(ctx) +// MTAdapter is the interface the multi-tenant PingSource adapter must implement +type MTAdapter interface { + // Update is called when the source is ready and when the specification and/or status has changed. + Update(ctx context.Context, source *v1beta1.PingSource) - r := &Reconciler{ - entryidMu: sync.RWMutex{}, - entryids: make(map[string]cron.EntryID), - cronRunner: cronRunner, - } + // Remove is called when the source has been deleted. + Remove(ctx context.Context, source *v1beta1.PingSource) +} - impl := pingsourcereconciler.NewImpl(ctx, r) +// NewController initializes the controller. This is called by the shared adapter Main +// Registers event handlers to enqueue events. +func NewController(ctx context.Context, adapter adapter.Adapter) *controller.Impl { + mtadapter, ok := adapter.(MTAdapter) + if !ok { + logging.FromContext(ctx).Fatal("Multi-tenant adapters must implement the MTAdapter interface") + } - logger.Info("Setting up event handlers") + r := &Reconciler{mtadapter} - // Watch for pingsource objects - pingsourceInformer.Informer().AddEventHandler(controller.HandleAll(impl.Enqueue)) + // TODO: need pkg#1683 + // lister := pingsourceinformer.Get(ctx).Lister() + //opts := func(impl *controller.Impl) controller.Options { + // return controller.Options{ + // DemoteFunc: func(b reconciler.Bucket) { + // all, _ := lister.List(labels.Everything()) + // // TODO: demote with error + // //if err != nil { + // // return err + // //} + // for _, elt := range all { + // mtadapter.Remove(ctx, elt) + // } + // }, + // } + //} + impl := pingsourcereconciler.NewImpl(ctx, r) + logging.FromContext(ctx).Info("Setting up event handlers") + pingsourceinformer.Get(ctx).Informer().AddEventHandler(controller.HandleAll(impl.Enqueue)) return impl } diff --git a/pkg/adapter/mtping/controller_test.go b/pkg/adapter/mtping/controller_test.go index 97562cf14a5..232f26ffa99 100644 --- a/pkg/adapter/mtping/controller_test.go +++ b/pkg/adapter/mtping/controller_test.go @@ -17,20 +17,35 @@ limitations under the License. package mtping import ( + "context" "testing" . "knative.dev/pkg/reconciler/testing" // Fake injection informers _ "knative.dev/eventing/pkg/client/injection/informers/sources/v1beta1/pingsource/fake" + + "knative.dev/eventing/pkg/apis/sources/v1beta1" ) +type dummyAdapter struct{} + func TestNew(t *testing.T) { ctx, _ := SetupFakeContext(t) - c := NewController(ctx, nil) + c := NewController(ctx, &dummyAdapter{}) if c == nil { t.Fatal("Expected NewController to return a non-nil value") } } + +func (dummyAdapter) Start(ctx context.Context) error { + return nil +} + +func (dummyAdapter) Update(ctx context.Context, source *v1beta1.PingSource) { +} + +func (dummyAdapter) Remove(ctx context.Context, source *v1beta1.PingSource) { +} diff --git a/pkg/adapter/mtping/pingsource.go b/pkg/adapter/mtping/pingsource.go index 278f3d4be3b..33f63867df9 100644 --- a/pkg/adapter/mtping/pingsource.go +++ b/pkg/adapter/mtping/pingsource.go @@ -19,23 +19,18 @@ package mtping import ( "context" "fmt" - "sync" - "github.com/robfig/cron/v3" - "go.uber.org/zap" - corev1 "k8s.io/api/core/v1" - "knative.dev/pkg/logging" - pkgreconciler "knative.dev/pkg/reconciler" + "knative.dev/pkg/reconciler" "knative.dev/eventing/pkg/apis/sources/v1beta1" pingsourcereconciler "knative.dev/eventing/pkg/client/injection/reconciler/sources/v1beta1/pingsource" ) +// TODO: code generation + // Reconciler reconciles PingSources type Reconciler struct { - cronRunner *cronJobsRunner - entryidMu sync.RWMutex - entryids map[string]cron.EntryID // key: resource namespace/name + mtadapter MTAdapter } // Check that our Reconciler implements ReconcileKind. @@ -44,70 +39,24 @@ var _ pingsourcereconciler.Interface = (*Reconciler)(nil) // Check that our Reconciler implements FinalizeKind. var _ pingsourcereconciler.Finalizer = (*Reconciler)(nil) -func (r *Reconciler) ReconcileKind(ctx context.Context, source *v1beta1.PingSource) pkgreconciler.Event { +func (r *Reconciler) ReconcileKind(ctx context.Context, source *v1beta1.PingSource) reconciler.Event { if !source.Status.IsReady() { - return fmt.Errorf("PingSource is not ready. Cannot configure the cron jobs runner") - } - - reconcileErr := r.reconcile(ctx, source) - if reconcileErr != nil { - logging.FromContext(ctx).Errorw("Error reconciling PingSource", zap.Error(reconcileErr)) - } else { - logging.FromContext(ctx).Debug("PingSource reconciled") - } - return reconcileErr -} - -func (r *Reconciler) reconcile(ctx context.Context, source *v1beta1.PingSource) error { - logging.FromContext(ctx).Info("synchronizing schedule") - - key := fmt.Sprintf("%s/%s", source.Namespace, source.Name) - // Is the schedule already cached? - r.entryidMu.RLock() - id, ok := r.entryids[key] - r.entryidMu.RUnlock() - - if ok { - r.cronRunner.RemoveSchedule(id) - } - - config := PingConfig{ - ObjectReference: corev1.ObjectReference{ - Namespace: source.Namespace, - Name: source.Name, - }, - Schedule: source.Spec.Schedule, - JsonData: source.Spec.JsonData, + // The source might have been previously ready + // Make sure the adapter does not handle it + r.mtadapter.Remove(ctx, source) - SinkURI: source.Status.SinkURI.String(), + return fmt.Errorf("PingSource is not ready") } - if source.Spec.CloudEventOverrides != nil { - config.Extensions = source.Spec.CloudEventOverrides.Extensions - } - - id = r.cronRunner.AddSchedule(config) - r.entryidMu.Lock() - r.entryids[key] = id - r.entryidMu.Unlock() + // Update the adapter state + r.mtadapter.Update(ctx, source) return nil } -func (r *Reconciler) FinalizeKind(ctx context.Context, source *v1beta1.PingSource) pkgreconciler.Event { - key := fmt.Sprintf("%s/%s", source.Namespace, source.Name) - - r.entryidMu.RLock() - id, ok := r.entryids[key] - r.entryidMu.RUnlock() - - if ok { - r.cronRunner.RemoveSchedule(id) - - r.entryidMu.Lock() - delete(r.entryids, key) - r.entryidMu.Unlock() - } +func (r *Reconciler) FinalizeKind(ctx context.Context, source *v1beta1.PingSource) reconciler.Event { + // Update the adapter state + r.mtadapter.Remove(ctx, source) return nil } diff --git a/pkg/adapter/mtping/pingsource_test.go b/pkg/adapter/mtping/pingsource_test.go index 795c9bc9a05..0858864894c 100644 --- a/pkg/adapter/mtping/pingsource_test.go +++ b/pkg/adapter/mtping/pingsource_test.go @@ -18,16 +18,12 @@ package mtping import ( "context" - "sync" "testing" - "github.com/robfig/cron/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - testclient "k8s.io/client-go/kubernetes/fake" clientgotesting "k8s.io/client-go/testing" - adaptertesting "knative.dev/eventing/pkg/adapter/v2/test" sourcesv1beta1 "knative.dev/eventing/pkg/apis/sources/v1beta1" fakeeventingclient "knative.dev/eventing/pkg/client/injection/client/fake" "knative.dev/eventing/pkg/client/injection/reconciler/sources/v1beta1/pingsource" @@ -170,15 +166,9 @@ func TestAllCases(t *testing.T) { } logger := logtesting.TestLogger(t) - ce := adaptertesting.NewTestClient() table.Test(t, MakeFactory(func(ctx context.Context, listers *Listers, cmw configmap.Watcher) controller.Reconciler { - r := &Reconciler{ - pingsourceLister: listers.GetPingSourceV1beta1Lister(), - cronRunner: NewCronJobsRunner(ce, testclient.NewSimpleClientset(), logger), - entryidMu: sync.RWMutex{}, - entryids: make(map[string]cron.EntryID), - } + r := &Reconciler{mtadapter: dummyAdapter{}} return pingsource.NewReconciler(ctx, logging.FromContext(ctx), fakeeventingclient.Get(ctx), listers.GetPingSourceV1beta1Lister(), controller.GetEventRecorder(ctx), r) diff --git a/pkg/adapter/mtping/runner.go b/pkg/adapter/mtping/runner.go index 2e267f63da2..4f9d20e7926 100644 --- a/pkg/adapter/mtping/runner.go +++ b/pkg/adapter/mtping/runner.go @@ -63,34 +63,35 @@ func NewCronJobsRunner(ceClient cloudevents.Client, kubeClient kubernetes.Interf } } -func (a *cronJobsRunner) AddSchedule(cfg PingConfig) cron.EntryID { +func (a *cronJobsRunner) AddSchedule(source *sourcesv1beta1.PingSource) cron.EntryID { event := cloudevents.NewEvent() event.SetType(sourcesv1beta1.PingSourceEventType) - event.SetSource(sourcesv1beta1.PingSourceSource(cfg.Namespace, cfg.Name)) - event.SetData(cloudevents.ApplicationJSON, message(cfg.JsonData)) - if cfg.Extensions != nil { - for key, override := range cfg.Extensions { + event.SetSource(sourcesv1beta1.PingSourceSource(source.Namespace, source.Name)) + event.SetData(cloudevents.ApplicationJSON, message(source.Spec.JsonData)) + if source.Spec.CloudEventOverrides != nil && source.Spec.CloudEventOverrides.Extensions != nil { + for key, override := range source.Spec.CloudEventOverrides.Extensions { event.SetExtension(key, override) } } ctx := context.Background() - ctx = cloudevents.ContextWithTarget(ctx, cfg.SinkURI) + ctx = cloudevents.ContextWithTarget(ctx, source.Status.SinkURI.String()) - var kubeEventSink record.EventSink = &typedcorev1.EventSinkImpl{Interface: a.kubeClient.CoreV1().Events(cfg.Namespace)} - ctx = crstatusevent.ContextWithCRStatus(ctx, &kubeEventSink, "ping-source-mt-adapter", &cfg.ObjectReference, a.Logger.Infof) + var kubeEventSink record.EventSink = &typedcorev1.EventSinkImpl{Interface: a.kubeClient.CoreV1().Events(source.Namespace)} + ctx = crstatusevent.ContextWithCRStatus(ctx, &kubeEventSink, "ping-source-mt-adapter", source, a.Logger.Infof) // Simple retry configuration to be less than 1mn. // We might want to retry more times for less-frequent schedule. ctx = cloudevents.ContextWithRetriesExponentialBackoff(ctx, 50*time.Millisecond, 5) metricTag := &kncloudevents.MetricTag{ - Namespace: cfg.Namespace, - Name: cfg.Name, + Namespace: source.Namespace, + Name: source.Name, ResourceGroup: resourceGroup, } + ctx = kncloudevents.ContextWithMetricTag(ctx, metricTag) - id, _ := a.cron.AddFunc(cfg.Schedule, a.cronTick(ctx, event)) + id, _ := a.cron.AddFunc(source.Spec.Schedule, a.cronTick(ctx, event)) return id } @@ -113,7 +114,6 @@ func (a *cronJobsRunner) Stop() { func (a *cronJobsRunner) cronTick(ctx context.Context, event cloudevents.Event) func() { return func() { - event := event.Clone() event.SetID(uuid.New().String()) // provide an ID here so we can track it with logging target := cecontext.TargetFrom(ctx).String() diff --git a/pkg/adapter/mtping/runner_test.go b/pkg/adapter/mtping/runner_test.go index 0e1192d19d6..33af953ccf3 100644 --- a/pkg/adapter/mtping/runner_test.go +++ b/pkg/adapter/mtping/runner_test.go @@ -22,44 +22,65 @@ import ( "testing" "time" - corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "knative.dev/pkg/apis" + duckv1 "knative.dev/pkg/apis/duck/v1" kubeclient "knative.dev/pkg/client/injection/kube/client" _ "knative.dev/pkg/client/injection/kube/client/fake" "knative.dev/pkg/logging" rectesting "knative.dev/pkg/reconciler/testing" adaptertesting "knative.dev/eventing/pkg/adapter/v2/test" + sourcesv1beta1 "knative.dev/eventing/pkg/apis/sources/v1beta1" ) const threeSecondsTillNextMinCronJob = 60 - 3 func TestAddRunRemoveSchedules(t *testing.T) { testCases := map[string]struct { - cfg PingConfig + src *sourcesv1beta1.PingSource delay time.Duration }{ "TestAddRunRemoveSchedule": { - cfg: PingConfig{ - ObjectReference: corev1.ObjectReference{ + src: &sourcesv1beta1.PingSource{ + ObjectMeta: metav1.ObjectMeta{ Name: "test-name", Namespace: "test-ns", }, - Schedule: "* * * * ?", - JsonData: "some data", - Extensions: nil, - SinkURI: "a sink", + Spec: sourcesv1beta1.PingSourceSpec{ + SourceSpec: duckv1.SourceSpec{ + CloudEventOverrides: &duckv1.CloudEventOverrides{}, + }, + Schedule: "* * * * ?", + JsonData: "some data", + }, + Status: sourcesv1beta1.PingSourceStatus{ + SourceStatus: duckv1.SourceStatus{ + SinkURI: &apis.URL{Path: "a sink"}, + }, + }, }, }, "TestAddRunRemoveScheduleWithExtensionOverride": { - cfg: PingConfig{ - ObjectReference: corev1.ObjectReference{ + src: &sourcesv1beta1.PingSource{ + ObjectMeta: metav1.ObjectMeta{ Name: "test-name", Namespace: "test-ns", }, - Schedule: "* * * * ?", - JsonData: "some data", - Extensions: map[string]string{"1": "one", "2": "two"}, - SinkURI: "a sink", + Spec: sourcesv1beta1.PingSourceSpec{ + SourceSpec: duckv1.SourceSpec{ + CloudEventOverrides: &duckv1.CloudEventOverrides{ + Extensions: map[string]string{"1": "one", "2": "two"}, + }, + }, + Schedule: "* * * * ?", + JsonData: "some data", + }, + Status: sourcesv1beta1.PingSourceStatus{ + SourceStatus: duckv1.SourceStatus{ + SinkURI: &apis.URL{Path: "a sink"}, + }, + }, }, }, } @@ -70,7 +91,7 @@ func TestAddRunRemoveSchedules(t *testing.T) { ce := adaptertesting.NewTestClient() runner := NewCronJobsRunner(ce, kubeclient.Get(ctx), logger) - entryId := runner.AddSchedule(tc.cfg) + entryId := runner.AddSchedule(tc.src) entry := runner.cron.Entry(entryId) if entry.ID != entryId { @@ -79,7 +100,7 @@ func TestAddRunRemoveSchedules(t *testing.T) { entry.Job.Run() - validateSent(t, ce, `{"body":"some data"}`, tc.cfg.Extensions) + validateSent(t, ce, `{"body":"some data"}`, tc.src.Spec.CloudEventOverrides.Extensions) runner.RemoveSchedule(entryId) @@ -113,7 +134,6 @@ func TestStartStopCron(t *testing.T) { t.Fatal("expected cron to be stopped after 2 seconds") case <-wctx.Done(): } - } func TestStartStopCronDelayWait(t *testing.T) { @@ -132,17 +152,26 @@ func TestStartStopCronDelayWait(t *testing.T) { defer cancel() go func() { - runner.AddSchedule(PingConfig{ - ObjectReference: corev1.ObjectReference{ - Name: "test-name", - Namespace: "test-ns", - }, - Schedule: "* * * * *", - JsonData: "some delayed data", - SinkURI: "a delayed sink", - }) + runner.AddSchedule( + &sourcesv1beta1.PingSource{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-name", + Namespace: "test-ns", + }, + Spec: sourcesv1beta1.PingSourceSpec{ + SourceSpec: duckv1.SourceSpec{ + CloudEventOverrides: &duckv1.CloudEventOverrides{}, + }, + Schedule: "* * * * *", + JsonData: "some delayed data", + }, + Status: sourcesv1beta1.PingSourceStatus{ + SourceStatus: duckv1.SourceStatus{ + SinkURI: &apis.URL{Path: "a delayed sink"}, + }, + }, + }) runner.Start(ctx.Done()) - }() tn = time.Now() diff --git a/pkg/adapter/v2/main.go b/pkg/adapter/v2/main.go index f3fe71bf92e..2811280e4f7 100644 --- a/pkg/adapter/v2/main.go +++ b/pkg/adapter/v2/main.go @@ -44,6 +44,7 @@ import ( "knative.dev/eventing/pkg/leaderelection" ) +// Adapter is the interface receive adapters are expected to implement type Adapter interface { Start(ctx context.Context) error } diff --git a/vendor/modules.txt b/vendor/modules.txt index 107ec45f7b5..fadb69e23bd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -256,7 +256,6 @@ github.com/prometheus/client_golang/prometheus/promhttp # github.com/prometheus/client_model v0.2.0 github.com/prometheus/client_model/go # github.com/prometheus/common v0.9.1 -## explicit github.com/prometheus/common/expfmt github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg github.com/prometheus/common/log