diff --git a/CHANGELOG.md b/CHANGELOG.md index 31f3148..9abfacc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- Now internally using the Kubernetes Scale API for determining replica count and selectors, removing any direct +dependencies on the Kubernetes core types when used in conjunction with the Kubernetes unstructured API. +- Can now install the project by using the `go install` command since replace directives have been removed. ## [v2.4.1] - 2022-02-22 ### Fixed diff --git a/go.mod b/go.mod index ccbf570..31f96ed 100644 --- a/go.mod +++ b/go.mod @@ -3,44 +3,18 @@ module github.com/jthomperoo/custom-pod-autoscaler/v2 go 1.16 require ( - github.com/argoproj/argo-rollouts v1.0.7 github.com/go-chi/chi v4.0.2+incompatible - github.com/go-openapi/spec v0.20.4 // indirect github.com/golang/glog v1.0.0 github.com/google/go-cmp v0.5.5 + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/onsi/ginkgo v1.14.1 // indirect + github.com/onsi/gomega v1.10.2 // indirect + github.com/stretchr/testify v1.7.0 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/appengine v1.6.6 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect k8s.io/api v0.21.8 k8s.io/apimachinery v0.21.8 k8s.io/client-go v0.21.8 - k8s.io/kubernetes v1.21.8 k8s.io/metrics v0.21.8 ) - -replace ( - k8s.io/api => k8s.io/api v0.21.8 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.21.8 - k8s.io/apimachinery => k8s.io/apimachinery v0.21.8 - k8s.io/apiserver => k8s.io/apiserver v0.21.8 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.21.8 - k8s.io/client-go => k8s.io/client-go v0.21.8 - k8s.io/cloud-provider => k8s.io/cloud-provider v0.21.8 - k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.21.8 - k8s.io/code-generator => k8s.io/code-generator v0.21.8 - k8s.io/component-base => k8s.io/component-base v0.21.8 - k8s.io/component-helpers => k8s.io/component-helpers v0.21.8 - k8s.io/controller-manager => k8s.io/controller-manager v0.21.8 - k8s.io/cri-api => k8s.io/cri-api v0.21.8 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.21.8 - k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.21.8 - k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.21.8 - k8s.io/kube-proxy => k8s.io/kube-proxy v0.21.8 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.21.8 - k8s.io/kubectl => k8s.io/kubectl v0.21.8 - k8s.io/kubelet => k8s.io/kubelet v0.21.8 - k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.21.8 - k8s.io/metrics => k8s.io/metrics v0.21.8 - k8s.io/mount-utils => k8s.io/mount-utils v0.21.8 - k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.21.8 - k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.21.8 - k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.21.8 - k8s.io/sample-controller => k8s.io/sample-controller v0.21.8 -) diff --git a/go.sum b/go.sum index 7b45d72..97b137f 100644 --- a/go.sum +++ b/go.sum @@ -1,442 +1,82 @@ -4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a/go.mod h1:wfdC5ZjKSPr7CybKEcgJhUOgeAQW1+7WcyK8OvUilfo= -bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690/go.mod h1:Ulb78X89vxKYgdL24HMTiXYHlyHEvruOj1ZPlqeNEZM= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.55.0/go.mod h1:ZHmoY+/lIMNkN2+fBmuTiqZ4inFhvQad8ft7MT8IV5Y= -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.58.0/go.mod h1:W+9FnSUw6nhVwXlFcp1eL+krq5+HQUJeUogSeJZZiWg= 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/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/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/firestore v1.2.0/go.mod h1:iISCjWnTpnoJT1R287xRdjvQHJrxQOpeah4phb5D3h0= 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/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/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/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= -code.gitea.io/sdk/gitea v0.12.1/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY= -code.gitea.io/sdk/gitea v0.13.1/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/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e5CWqyUk/cLzKnWsOKPVW3no6OTw= -contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE= -contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-amqp-common-go/v3 v3.0.0/go.mod h1:SY08giD/XbhTz07tJdpw1SoxQXHPN30+DI3Z04SYqyg= -github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= -github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= -github.com/Azure/azure-sdk-for-go v37.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v43.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-service-bus-go v0.10.1/go.mod h1:E/FOceuKAFUfpbIJDKWz/May6guE+eGibfGT6q+n1to= -github.com/Azure/azure-storage-blob-go v0.9.0/go.mod h1:8UBPbiOhrMQ4pLPi3gA1tXnpjrS76UYE/fo5A40vf4g= -github.com/Azure/go-amqp v0.12.6/go.mod h1:qApuH6OFTSKZFmCOxccvAv5rLizBQf4v8pRmG138DPo= -github.com/Azure/go-amqp v0.12.7/go.mod h1:qApuH6OFTSKZFmCOxccvAv5rLizBQf4v8pRmG138DPo= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM= -github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= -github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= -github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= -github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/Djarvur/go-err113 v0.0.0-20200511133814-5174e21577d5/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo= -github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20200415212048-7901bc822317/go.mod h1:DF8FZRxMHMGv/vP2lQP6h+dYzzjpuRn24VeRiYn3qjQ= -github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab/go.mod h1:3VYc5hodBMJ5+l/7J4xAyMeuM2PNuepvHlGs8yilUCA= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Masterminds/sprig/v3 v3.1.0/go.mod h1:ONGMf7UfYGAbMXCZmQLy8x3lCDIPrEZE/rU8pmrbihA= -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/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/hcsshim v0.8.10-0.20200715222032-5eafd1556990/go.mod h1:ay/0dTb7NsG8QMDfsRfLHgZo/6xAJShLe1+ePPflihk= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= -github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antonmedv/expr v1.8.9/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apex/log v1.9.0/go.mod h1:m82fZlWIuiWzWP04XCTXmnX0xRkYYbCdYn8jbJeLBEA= -github.com/apex/logs v1.0.0/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo= -github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE= -github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys= -github.com/argoproj/argo-rollouts v1.0.7 h1:cGwkpPN/T40PRWqBayVcTCyfkypxYsGSUHDCQVenrAk= -github.com/argoproj/argo-rollouts v1.0.7/go.mod h1:lSK1l0H/67x3fnBt8GtfQUPJx8DoD9PhchzmDC6nWMI= -github.com/argoproj/pkg v0.9.0/go.mod h1:ra+bQPmbVAoEL+gYSKesuigt4m49i3Qa3mE/xQcjCiA= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7/go.mod h1:LWMyo4iOLWXHGdBki7NIht1kHru/0wM179h+d3g8ATM= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.19.18/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.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.31.13/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.33.16/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.35.24/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.0.0/go.mod h1:smfAbmpW+tcRVuNUjo3MOArSZmW72t62rkCzc2i0TWM= -github.com/aws/aws-sdk-go-v2/config v1.0.0/go.mod h1:WysE/OpUgE37tjtmtJd8GXgT8s1euilE5XtUkRNUQ1w= -github.com/aws/aws-sdk-go-v2/credentials v1.0.0/go.mod h1:/SvsiqBf509hG4Bddigr3NB12MIpfHhZapyBurJe8aY= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.0/go.mod h1:wpMHDCXvOXZxGCRSidyepa8uJHY4vaBGfY2/+oKU/Bc= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.0.0/go.mod h1:n5YmmB7VY/iK0TtXWSUkuO8dx11DXoMeNJ5HrCYJSQs= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.0/go.mod h1:3jExOmpbjgPnz2FJaMOfbSk1heTkZ66aD3yNtVhnjvI= -github.com/aws/aws-sdk-go-v2/service/sts v1.0.0/go.mod h1:5f+cELGATgill5Pu3/vK3Ebuigstc+qYEHW5MvGWZO4= -github.com/aws/smithy-go v1.0.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= -github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115/go.mod h1:zVt7zX3K/aDCk9Tj+VM7YymsX66ERvzCJzw8rFCX2JU= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -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.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= -github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw= -github.com/caddyserver/caddy v1.0.3/go.mod h1:G+ouvOY32gENkJC+jhgl62TyhvqEsFaDiZ4uw0RzP1E= -github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e/go.mod h1:9IOqJGCPMSc6E5ydlp5NIonxObaeu/Iub/X03EKPVYo= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oDpT4efm8tSYHXV5tHSdRvBet/b/QzxZ+XyyPehvm3A= -github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= -github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= -github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= -github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= -github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313/go.mod h1:P1wt9Z3DP8O6W3rvwCt0REIlshg1InHImaLW0t3ObY0= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0= -github.com/container-storage-interface/spec v1.2.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= -github.com/container-storage-interface/spec v1.3.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= -github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/coredns/corefile-migration v1.0.10/go.mod h1:RMy/mXdeDlYwzt0vdMEJvT2hGJ2I86/eO0UdXmH9XNI= -github.com/coredns/corefile-migration v1.0.11/go.mod h1:RMy/mXdeDlYwzt0vdMEJvT2hGJ2I86/eO0UdXmH9XNI= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -github.com/daixiang0/gci v0.0.0-20200727065011-66f1df783cb2/go.mod h1:+AV8KmHTGxxwp/pY84TLQfFKp2vuKXXJVzF3kD/hfR4= -github.com/daixiang0/gci v0.2.4/go.mod h1:+AV8KmHTGxxwp/pY84TLQfFKp2vuKXXJVzF3kD/hfR4= -github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= -github.com/denis-tingajkin/go-header v0.3.1/go.mod h1:sq/2IxMhaZX+RRcgHfCRx/m0M5na0fBt4/CRe7Lrji0= -github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+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 v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emirpasic/gods v1.9.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw= -github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.2.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= -github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= 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= -github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= -github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= -github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I= -github.com/git-chglog/git-chglog v0.0.0-20200414013904-db796966b373/go.mod h1:Dcsy1kii/xFyNad5JqY/d0GO5mu91sungp5xotbm3Yk= -github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-acme/lego v2.5.0+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M= -github.com/go-bindata/go-bindata v3.1.1+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-chi/chi v4.0.2+incompatible h1:maB6vn6FqCxrpz4FqWdh4+lwpyZIQS7YEAUcHlgXVRs= github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-critic/go-critic v0.5.0/go.mod h1:4jeRh3ZAVnRYhuWdOEvwzVqLUpxMSoAT0xZ74JsTPlo= -github.com/go-critic/go-critic v0.5.2/go.mod h1:cc0+HvdE3lFpqLecgqMaJcvWWH77sLdBp+wLGPM1Yyo= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= -github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= -github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= -github.com/go-git/go-git/v5 v5.2.0/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= -github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= -github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= -github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= -github.com/go-ozzo/ozzo-validation v3.5.0+incompatible/go.mod h1:gsEKFIVnabGBt6mXmxK0MoFy+cZoTJY6mu5Ll3LVLBU= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= -github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= -github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg= -github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= -github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU= -github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk= -github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= -github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks= -github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc= -github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= -github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= -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/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= @@ -446,688 +86,131 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= -github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= -github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o= -github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= -github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= -github.com/golangci/golangci-lint v1.30.0/go.mod h1:5t0i3wHlqQc9deBBvZsP+a/4xz7cfjV+zhp5U0Mzp14= -github.com/golangci/golangci-lint v1.31.0/go.mod h1:aMQuNCA+NDU5+4jLL5pEuFHoue0IznKE2+/GsFvvs8A= -github.com/golangci/golangci-lint v1.32.2/go.mod h1:ydr+IqtIVyAh72L16aK0bNdNg/YGa+AEgdbKj9MluzI= -github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= -github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= -github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/cadvisor v0.38.7/go.mod h1:1OFB9sOOMkBdUBGCO/1SArawTnDscgMzTodacVDe8mA= -github.com/google/cadvisor v0.39.0/go.mod h1:rjQFmK4jPCpxeUdLq9bYhNFFsjgGOtpnDmDeap0+nsw= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE= -github.com/google/go-replayers/httpreplay v0.1.0/go.mod h1:YKZViNhiGgqdBlUbI2MwGpq4pXxNmhJLPHQ7cv2b5no= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200507031123-427632fa3b1c/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/rpmpack v0.0.0-20200731134257-3685799e8fdf/go.mod h1:+y9lKiqDhR4zkLl+V9h4q0rdyrYVsWWm6LLCQP33DIk= -github.com/google/rpmpack v0.0.0-20200919095143-1c1eea455332/go.mod h1:+y9lKiqDhR4zkLl+V9h4q0rdyrYVsWWm6LLCQP33DIk= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/wire v0.4.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= -github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/gookit/color v1.2.5/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg= -github.com/gookit/color v1.3.1/go.mod h1:R3ogXq2B9rTbXoSHJ1HyUVAZ3poOJHpd9nQmyGZsfvQ= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/goreleaser/chglog v0.1.1/go.mod h1:xSDa/73C0TxBcLvoT2JHh47QyXpCx5rrNVzJKyeFGPw= -github.com/goreleaser/chglog v0.1.2/go.mod h1:tTZsFuSZK4epDXfjMkxzcGbrIOXprf0JFp47BjIr3B8= -github.com/goreleaser/fileglob v0.3.0/go.mod h1:kNcPrPzjCp+Ox3jmXLU5QEsjhqrtLBm6OnXAif8KRl8= -github.com/goreleaser/goreleaser v0.143.0/go.mod h1:/zq84GQ8WZFnspGTONdZO0Kgf5BzOD3CzufXyw+ut4A= -github.com/goreleaser/goreleaser v0.147.0/go.mod h1:AkI3X+mBaAEc99RDZgUGvjbUEqh/+t+EjNMaqUbd+3w= -github.com/goreleaser/nfpm v1.7.0/go.mod h1:V6xp021JRvYdBYpGFoP6m6YsuedzgB6IO2ub2NNBohs= -github.com/goreleaser/nfpm v1.10.1/go.mod h1:G0vvOjif+gnnTTWBtvYqMBh8nMGM7eNkrZU/W2gdM6o= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.1.0/go.mod h1:dMhHRU9KTiDcuLGdy87/2gTR8WruwYZrKdRq9m1O6uw= -github.com/gostaticanalysis/comment v1.3.0/go.mod h1:xMicKDx7XRXYdVwY9f9wQpDJVnqWxw9wCauCMKp+IBI= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/heketi/heketi v9.0.1-0.20190917153846-c2e2a4ab7ab9+incompatible/go.mod h1:bB9ly3RchcQqsQ9CpyaQwvva7RS5ytVoSoholZQON6o= -github.com/heketi/heketi v10.2.0+incompatible/go.mod h1:bB9ly3RchcQqsQ9CpyaQwvva7RS5ytVoSoholZQON6o= -github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6/go.mod h1:xGMAM8JLi7UkZt1i4FQeQy0R2T8GLUwQhOP5M1gBhy4= -github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/ishidawataru/sctp v0.0.0-20190723014705-7c296d48a2b5/go.mod h1:DM4VvS+hD/kDi1U1QsX2fnZowwBhqD0Dk3bRPKF/Oc8= -github.com/jarcoal/httpmock v1.0.6/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a/go.mod h1:wK6yTYYcgjHE1Z1QtXACPDjcFJyBskHEdagmnq3vsP8= -github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s= -github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.10.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.10.5/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kyoh86/exportloopref v0.1.7/go.mod h1:h1rDl2Kdj97+Kwh4gdz3ujE7XHmH51Q0lUiZ1z4NLj8= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/libopenstorage/openstorage v1.0.0/go.mod h1:Sp1sIObHjat1BeXhfMqLZ14wnOzEhNx2YQedreMcUyc= -github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= -github.com/llorllale/go-gitlint v0.0.0-20190914155841-58c0b8cef0e5/go.mod h1:omoASPlaaf3ECEhTMfLZVS6o550eBWI2YsM/saGEbVA= -github.com/llorllale/go-gitlint v0.0.0-20200802191503-5984945d4b80/go.mod h1:omoASPlaaf3ECEhTMfLZVS6o550eBWI2YsM/saGEbVA= -github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/lpabon/godbc v0.1.1/go.mod h1:Jo9QV0cf3U6jZABgiJ2skINAXb9j8m51r07g4KI92ZA= -github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f/go.mod h1:JpH9J1c9oX6otFSgdUHwUBUizmKlrMjxWnIAjff4m04= -github.com/lucas-clemente/quic-clients v0.1.0/go.mod h1:y5xVIEoObKqULIKivu+gD/LU90pL73bTdtQjPBvtCBk= -github.com/lucas-clemente/quic-go v0.10.2/go.mod h1:hvaRS9IHjFLMq76puFJeWNfmn+H70QZ/CXoxqw9bzao= -github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced/go.mod h1:NCcRLrOTZbzhZvixZLlERbJtDtYsmMw8Jc4vS8Z0g58= -github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s= -github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= -github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= -github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= -github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.6/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-zglob v0.0.3/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mbilski/exhaustivestruct v1.1.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/mholt/certmagic v0.6.2-0.20190624175158-6a42ef9fe8c2/go.mod h1:g4cOPxcjV0oFq3qwpjSA30LReKD8AoIfwAY9VvG35NY= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.3/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.4/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/mindprince/gonvml v0.0.0-20190828220739-9ebdce4bb989/go.mod h1:2eu9pRWp8mo84xCg6KswZ+USQHjwgRhNp06sozOdsTY= -github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= -github.com/minio/minio-go/v7 v7.0.2/go.mod h1:dJ80Mv2HeGkYLH1sqS/ksz07ON6csH3S6JUMSQ2zAns= -github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/moby/ipvs v1.0.1/go.mod h1:2pngiyseZbIKXNv7hsKj3O9UEz30c53MT9005gt2hxQ= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mohae/deepcopy v0.0.0-20170603005431-491d3605edfb/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= -github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= -github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0= -github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mvdan/xurls v1.1.0/go.mod h1:tQlNn3BED8bE/15hnSL2HLkDeLWpNPAwtw7wkEq44oU= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.1/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= -github.com/newrelic/newrelic-client-go v0.49.0/go.mod h1://vEwOJWDi1nsSnmmdZrB8Kab9ibSfGcF0UmnwzoSNQ= -github.com/newrelic/tutone v0.2.5/go.mod h1:Jv8miaLyP2pjx4wqvAdx1nLXMx/Cl7kmsNiKZlCeIds= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nishanths/exhaustive v0.0.0-20200708172631-8866003e3856/go.mod h1:wBEpHwM2OdmeNpdCvRPUlkEbBuaFmcK4Wv8Q7FuGW3c= -github.com/nishanths/exhaustive v0.0.0-20200811152831-6cf413ae40e0/go.mod h1:wBEpHwM2OdmeNpdCvRPUlkEbBuaFmcK4Wv8Q7FuGW3c= -github.com/nishanths/exhaustive v0.1.0/go.mod h1:S1j9110vxV1ECdCudXRkeMnFQ/DQk9ajLT0Uf2MYZQQ= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= -github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4= github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc92/go.mod h1:X1zlU4p7wOlX4+WRCz+hvlRv8phdL7UqbYD+vQwNMmE= -github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= -github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= -github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v0.0.0-20201006195004-351e25ade6e3/go.mod h1:wi9BfjxjF/bwiZ701TzmfKu6UKC357IOAtNr0Td0Lvw= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.21.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/psampaz/go-mod-outdated v0.7.0/go.mod h1:r78NYWd1z+F9Zdsfy70svgXOz363B08BWnTyFSgEESs= -github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= -github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k= -github.com/quasilyte/go-ruleguard v0.2.0/go.mod h1:2RT/tf0Ce0UDj5y243iWKosQogJd8+1G3Rs2fxmlYnw= -github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= -github.com/quobyte/api v0.1.8/go.mod h1:jL7lIHrmqQ7yh05OJ+eEEdHr0u/kmT1Ff9iHd+4H6VI= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= -github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498/go.mod h1:6lkG1x+13OShEf0EaOCaTQYyB7d5nSbb181KtjlS+84= -github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/robfig/cron v1.1.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.6.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= -github.com/russross/blackfriday v0.0.0-20170610170232-067529f716f4/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM= -github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sanity-io/litter v1.2.0/go.mod h1:JF6pZUFgu2Q0sBZ+HSV35P8TVPI1TTzEwyu9FXAw2W4= -github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/securego/gosec/v2 v2.4.0/go.mod h1:0/Q4cjmlFDfDUj1+Fib61sc+U5IQb2w+Iv9/C3wPVko= -github.com/securego/gosec/v2 v2.5.0/go.mod h1:L/CDXVntIff5ypVHIkqPXbtRpJiNCh6c6Amn68jXDjo= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/servicemeshinterface/smi-sdk-go v0.4.1/go.mod h1:9rsLPBNcqfDNmEgyYwpopn93aE9yz46d2EHFBNOYj/w= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= -github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= -github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= -github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/sourcegraph/go-diff v0.5.3/go.mod h1:v9JDtjCE4HHHCZGId75rg8gkKKa98RVjBcBGsVmMmak= -github.com/sourcegraph/go-diff v0.6.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= -github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= -github.com/spaceapegames/go-wavefront v1.8.1/go.mod h1:GtdIjtJ0URkfPmaKx0+7vMSDvT/MON9v+4pbdagA8As= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.3.2/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.4.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= -github.com/ssgreg/nlreturn/v2 v2.0.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/ssgreg/nlreturn/v2 v2.1.0/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/storageos/go-api v2.2.0+incompatible/go.mod h1:ZrLn+e0ZuF3Y65PNF6dIwbJPZqfmtCXxFm9ckv0agOY= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tetafro/godot v0.4.8/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= -github.com/tetafro/godot v0.4.9/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= -github.com/thecodeteam/goscaleio v0.1.0/go.mod h1:68sdkZAsK8bvEwBlbQnlLS+xU+hvLYM/iQ8KXej1AwM= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= -github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0= -github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk= -github.com/tj/go-buffer v1.1.0/go.mod h1:iyiJpfFcR2B9sXu7KvjbT9fpM4mOelRSDTbntVj52Uc= -github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0= -github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao= -github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tomarrell/wrapcheck v0.0.0-20200807122107-df9e8bcb914d/go.mod h1:yiFB6fFoV7saXirUGfuK+cPtUh4NX/Hf5y2WC2lehu0= -github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= -github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE= -github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/undefinedlabs/go-mpatch v1.0.6/go.mod h1:TyJZDQ/5AgyN7FSLiBJ8RO9u2c6wbtRvK827b6AVqY4= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.12.0/go.mod h1:229t1eWu9UXTPmoUkbpN/fctKPBY4IJoFXQnxHGXy6E= -github.com/valyala/fasthttp v1.15.1/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= -github.com/valyala/fasthttp v1.16.0/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/quicktemplate v1.5.1/go.mod h1:v7yYWpBEiutDyNfVaph6oC/yKwejzVyTX/2cwwHxyok= -github.com/valyala/quicktemplate v1.6.2/go.mod h1:mtEJpQtUiBV0SHhMX6RtiJtqxncgrfmjcUy5T68X8TM= -github.com/valyala/quicktemplate v1.6.3/go.mod h1:fwPzK2fHuYEODzJ9pkw0ipCPNHZ2tD5KW4lOuSdPKzY= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= -github.com/xanzy/go-gitlab v0.37.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= -github.com/xanzy/go-gitlab v0.39.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= -github.com/xanzy/ssh-agent v0.2.0/go.mod h1:0NyE30eGUDliuLEHJgYte/zncp2zdTStcOnWhgSqHD8= -github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -gocloud.dev v0.20.0/go.mod h1:+Y/RpSXrJthIOM8uFNzWp6MRu9pFPNFEEZrQMxpkfIc= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= @@ -1135,8 +218,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20210220032938-85be41e4509f/go.mod h1:I6l2HNBLBZEcrOoCpyKLdY2lHoRZ8lI4x60KMCQDft4= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1151,45 +232,27 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190328230028-74de082e2cca/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1197,26 +260,12 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= @@ -1227,89 +276,36 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180606202747-9527bec2660b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200317113312-5766fd39f98d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201109165425-215b40eba54c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201110211018-35f3e6cf4a65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887 h1:dXfMednGJh/SUUFjTLsWJz3P+TQt9qnR11GgeI3vWKs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1322,109 +318,47 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200317043434-63da46f3035e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200321224714-0d839f3cf2ed/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200410194907-79a7a3126eef/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200601175630-2caf76543d99/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200606014950-c42cb6316fb6/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200608174601-1b747fd94509/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200701041122-1837592efa10/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200731060945-b5fad4ed8dd6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201002184944-ecd9fd270d5d/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201007032633-0806396f153e/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201011145850-ed2f50202694/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201013201025-64a9e34f3752/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1432,32 +366,17 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= -gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.1-0.20200106000736-b8fc810ca6b5/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.26.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -1469,8 +388,6 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1479,194 +396,78 @@ google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200317114155-1f3552e48f24/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200325114520-5b2d0af7952b/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200603110839-e855014d5736/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200608115520-7c474a2e3482/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc/examples v0.0.0-20210331235824-f6bb3972ed15/go.mod h1:Ly7ZA/ARzg8fnPU9TyZIxoz33sEUuWX7txiqs8lPTgE= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/AlecAivazis/survey.v1 v1.8.7/go.mod h1:iBNOmqKz/NUbZx3bA+4hAGLRC7fSK7tgtVDT4tB22XA= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/kyokomi/emoji.v1 v1.5.1/go.mod h1:N9AZ6hi1jHOPn34PsbpufQZUcKftSD7WgS2pgpmH4Lg= -gopkg.in/mcuadros/go-syslog.v2 v2.2.1/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm0aKH+5zpt2U= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/src-d/go-billy.v4 v4.2.1/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= -gopkg.in/src-d/go-git-fixtures.v3 v3.1.1/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= -gopkg.in/src-d/go-git.v4 v4.10.0/go.mod h1:Vtut8izDyrM8BUVQnzJ+YvmNcem2J89EmfZYCkLokZk= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/gotestsum v0.6.0/go.mod h1:LEX+ioCVdeWhZc8GYfiBRag360eBhwixWJ62R9eDQtI= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.6/go.mod h1:pyyisuGw24ruLjrr1ddx39WE0y9OooInRzEYLhQB2YY= k8s.io/api v0.21.8 h1:wVK5Jr4RnUIpjejuFnslXminUMdxa31bxi6zaUOILI4= k8s.io/api v0.21.8/go.mod h1:4A6eY7AJ+cAgEws3bGRIP2Wyia6VYmHbwIoQu83yyok= -k8s.io/apiextensions-apiserver v0.21.8/go.mod h1:SJEqqQ63MRDVIE9NNVINCKdLEWxJ/8Q2GnI0BRKo0AE= k8s.io/apimachinery v0.21.8 h1:crvdCfg/ueRHOPWReO+DukFvtGBoxyJdV61xkO6RhJU= k8s.io/apimachinery v0.21.8/go.mod h1:VdCLtKQwpSUQEWDaRsWR5ESDRqqhY2NeVzo9KCQ9uy0= -k8s.io/apiserver v0.21.8 h1:JeBpbz0Hf4/zDCn8X6bZ5d2WOgIVHm84ImaA4SNfJzw= -k8s.io/apiserver v0.21.8/go.mod h1:nnC0gG8nSTQW7Mig4ymKZBMSLzbNqmzPAXQyr1nYuOU= -k8s.io/cli-runtime v0.21.8/go.mod h1:eWa1ebMMB2cRnXnwd5oS18bgjCyD0cgCj8dOq43JgC8= k8s.io/client-go v0.21.8 h1:okz2KT8eM2VrRRXQMqS205hulPOfGE112HdFFvwgy+E= k8s.io/client-go v0.21.8/go.mod h1:FcrKJITUrWtQSX3SCmqswlETK8AcVDTTA5PxDPxNtcg= -k8s.io/cloud-provider v0.21.8/go.mod h1:PVbg45dslB/EvvELseKG/OivAfXbVEfJ3s/pACTIHWU= -k8s.io/cluster-bootstrap v0.21.8/go.mod h1:tG9xoDw4m8HawkMsgBrEArJok87tyJH9kmd7do0ctE8= k8s.io/code-generator v0.21.8/go.mod h1:py8RM46Y1+H0IWM1oO9pOGz60GhD9uW2SFlnXI5jZno= -k8s.io/component-base v0.21.8 h1:BwNeUkb6oeRFm1hQVpI2EWW1DtPO0VIAQ4ZUVUT6Rqc= -k8s.io/component-base v0.21.8/go.mod h1:zOBji2NuEFdYJiko+26cR1TkzcyUdO1rxGbAxqorFFE= -k8s.io/component-helpers v0.21.8/go.mod h1:/krYydh2BZhAXXsChlHC6OQhfErQ1fhmaZiLGv/i64k= -k8s.io/controller-manager v0.21.8/go.mod h1:7k947EiOamxOpNp7+1oh1wKLxe4ZByj4AYaXXUyiZU0= -k8s.io/cri-api v0.21.8/go.mod h1:l5ORpBGDk6YIoYNP0ucmfDM0VDvqSl+zugVJD4PU1kM= -k8s.io/csi-translation-lib v0.21.8/go.mod h1:+NAiJppd4GrWIkGWH0BVRLMVbwx/xVFrRvaIJXi2kMM= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/heapster v1.2.0-beta.1 h1:lUsE/AHOMHpi3MLlBEkaU8Esxm5QhdyCrv1o7ot0s84= -k8s.io/heapster v1.2.0-beta.1/go.mod h1:h1uhptVXMwC8xtZBYsPXKVi8fpdlYkTs6k949KozGrM= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/kube-aggregator v0.21.8/go.mod h1:XJ7z177b1yRF0VLP5xEatPdT7P7fgoh92+FcuOD30/4= -k8s.io/kube-controller-manager v0.21.8/go.mod h1:K6LHrNywGDpSaCdxNkRocKwZBbPBuN6hJYImjXOFeBo= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kube-openapi v0.0.0-20210216185858-15cd8face8d6/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20211110012726-3cc51fd1e909 h1:s77MRc/+/eQjsF89MB12JssAlsoi9mnNoaacRqibeAU= k8s.io/kube-openapi v0.0.0-20211110012726-3cc51fd1e909/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= -k8s.io/kube-proxy v0.21.8/go.mod h1:CjieFEVLjLXFvfM6T/AClEB5v1nCBuoij8CQ1SkfSjw= -k8s.io/kube-scheduler v0.21.8/go.mod h1:zEEMPvvmlUyilMOaDB+OT/+cX/x5g014JOup6LLRu6k= -k8s.io/kubectl v0.21.8/go.mod h1:cr6yOMF3JsuLPt0Z4uo1TQie9mmMjztzb77mN9Bctr0= -k8s.io/kubelet v0.21.8/go.mod h1:M/apjCi+jet1zUaO0eH+EasPANuFZC1L1yNUmngX55A= -k8s.io/kubernetes v1.20.4/go.mod h1:5oh+vhVyWep2o+IH61i3aU4e/Q77Yt96tcKwYOpVbvk= -k8s.io/kubernetes v1.21.8 h1:tClQUK7KyOopy0928otWNjMSh6bSnsGgC4+CqB3xhJU= -k8s.io/kubernetes v1.21.8/go.mod h1:Fm7yqAUkZTbq0O/uwtzMdFY7nmmnxRrVdM2wjng3/2w= -k8s.io/legacy-cloud-providers v0.21.8/go.mod h1:susz3aS9RkJzCOOTdvca3F03xggeqtaE4TqPi+S50lE= k8s.io/metrics v0.21.8 h1:gup3ZCg3dKhy2rLvl5bVIh38LPSTshNszj1bKldpkGo= k8s.io/metrics v0.21.8/go.mod h1:EL6uOMDkCCjXUB25K4VteweC1MQMOWsHCaU3C+3LdFs= -k8s.io/mount-utils v0.21.8/go.mod h1:2vo8bJc16B0RjPGoHbIYroOTfzTbox8de/kMz1xc3lk= -k8s.io/sample-apiserver v0.21.8/go.mod h1:7V8aOi6o1eUkGGqIvzb7gBlNwZ8QI914pW0J5MJnHQQ= -k8s.io/system-validators v1.2.0/go.mod h1:bPldcLgkIUK22ALflnsXk8pvkTEndYdNuaHH6gRrl0Q= -k8s.io/system-validators v1.4.0/go.mod h1:bPldcLgkIUK22ALflnsXk8pvkTEndYdNuaHH6gRrl0Q= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210521133846-da695404a2bc h1:dx6VGe+PnOW/kD/2UV4aUSsRfJGd7+lcqgJ6Xg0HwUs= k8s.io/utils v0.0.0-20210521133846-da695404a2bc/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= -mvdan.cc/gofumpt v0.0.0-20200709182408-4fd085cb6d5f/go.mod h1:9VQ397fNXEnF84t90W4r4TRCQK+pg9f8ugVfyj+S26w= -mvdan.cc/gofumpt v0.0.0-20200802201014-ab5a8192947d/go.mod h1:bzrjFmaD6+xqohD3KYP0H2FEuxknnBmyyOxdhLdaIws= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw= -mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/kustomize/api v0.8.8/go.mod h1:He1zoK0nk43Pc6NlV085xDXDXTNprtcyKZVm3swsdNY= -sigs.k8s.io/kustomize/cmd/config v0.9.10/go.mod h1:Mrby0WnRH7hA6OwOYnYpfpiY0WJIMgYrEDfwOeFdMK0= -sigs.k8s.io/kustomize/kustomize/v4 v4.1.2/go.mod h1:PxBvo4WGYlCLeRPL+ziT64wBXqbgfcalOS/SXa/tcyo= -sigs.k8s.io/kustomize/kyaml v0.10.17/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/internal/api/v1/api.go b/internal/api/v1/api.go index a9e55c0..4f51b2e 100644 --- a/internal/api/v1/api.go +++ b/internal/api/v1/api.go @@ -90,6 +90,15 @@ func (api *API) getMetrics(w http.ResponseWriter, r *http.Request) { return } + scaleResource, err := api.Scaler.GetScaleSubResource(api.Config.ScaleTargetRef.APIVersion, api.Config.ScaleTargetRef.Kind, api.Config.Namespace, api.Config.ScaleTargetRef.Name) + if err != nil { + apiError(w, &apiv1.Error{ + Message: err.Error(), + Code: http.StatusInternalServerError, + }) + return + } + // Set run type runType := config.APIRunType if dryRun { @@ -100,7 +109,7 @@ func (api *API) getMetrics(w http.ResponseWriter, r *http.Request) { metrics, err := api.GetMetricer.GetMetrics(metric.Info{ Resource: resource, RunType: runType, - }) + }, scaleResource) if err != nil { apiError(w, &apiv1.Error{ Message: err.Error(), @@ -147,6 +156,15 @@ func (api *API) getEvaluation(w http.ResponseWriter, r *http.Request) { return } + scaleResource, err := api.Scaler.GetScaleSubResource(api.Config.ScaleTargetRef.APIVersion, api.Config.ScaleTargetRef.Kind, api.Config.Namespace, api.Config.ScaleTargetRef.Name) + if err != nil { + apiError(w, &apiv1.Error{ + Message: err.Error(), + Code: http.StatusInternalServerError, + }) + return + } + // Set run type runType := config.APIRunType if dryRun { @@ -157,7 +175,7 @@ func (api *API) getEvaluation(w http.ResponseWriter, r *http.Request) { metrics, err := api.GetMetricer.GetMetrics(metric.Info{ Resource: resource, RunType: runType, - }) + }, scaleResource) if err != nil { apiError(w, &apiv1.Error{ Message: err.Error(), @@ -190,7 +208,7 @@ func (api *API) getEvaluation(w http.ResponseWriter, r *http.Request) { Namespace: api.Config.Namespace, ScaleTargetRef: api.Config.ScaleTargetRef, RunType: runType, - }) + }, scaleResource) if err != nil { apiError(w, &apiv1.Error{ Message: err.Error(), diff --git a/internal/api/v1/api_test.go b/internal/api/v1/api_test.go index 90dd2bd..318e317 100644 --- a/internal/api/v1/api_test.go +++ b/internal/api/v1/api_test.go @@ -37,20 +37,20 @@ import ( "github.com/jthomperoo/custom-pod-autoscaler/v2/metric" "github.com/jthomperoo/custom-pod-autoscaler/v2/scale" - appsv1 "k8s.io/api/apps/v1" - autoscaling "k8s.io/api/autoscaling/v2beta2" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + autoscalingv1 "k8s.io/api/autoscaling/v1" + autoscalingv2 "k8s.io/api/autoscaling/v2beta2" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) type failGetMetrics struct{} -func (f *failGetMetrics) GetMetrics(info metric.Info) ([]*metric.ResourceMetric, error) { +func (f *failGetMetrics) GetMetrics(info metric.Info, scaleResource *autoscalingv1.Scale) ([]*metric.ResourceMetric, error) { return nil, errors.New("FAIL GET METRICS") } type successGetMetrics struct{} -func (s *successGetMetrics) GetMetrics(info metric.Info) ([]*metric.ResourceMetric, error) { +func (s *successGetMetrics) GetMetrics(info metric.Info, scaleResource *autoscalingv1.Scale) ([]*metric.ResourceMetric, error) { return []*metric.ResourceMetric{ { Value: "SUCCESS", @@ -87,21 +87,21 @@ func TestAPI(t *testing.T) { scaler scaling.Scaler }{ { - "Fail to get resource metric gathering", + "Get metrics fail to get resource", `{"message":"fail getting resource","code":500}`, http.StatusInternalServerError, "GET", "/api/v1/metrics", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { return nil, errors.New("fail getting resource") }, }, @@ -109,6 +109,39 @@ func TestAPI(t *testing.T) { nil, nil, }, + { + "Get metrics fail to get scale subresource", + `{"message":"fail getting scale subresource","code":500}`, + http.StatusInternalServerError, + "GET", + "/api/v1/metrics", + &config.Config{ + Namespace: "test-namespace", + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ + Kind: "deployment", + Name: "test", + APIVersion: "apps/v1", + }, + }, + &fake.ResourceClient{ + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + }, + }, + }, nil + }, + }, + nil, + nil, + &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return nil, errors.New("fail getting scale subresource") + }, + }, + }, { "Get metrics fail metric gathering", `{"message":"FAIL GET METRICS","code":500}`, @@ -117,24 +150,34 @@ func TestAPI(t *testing.T) { "/api/v1/metrics", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + }, }, }, nil }, }, &failGetMetrics{}, nil, - nil, + &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + }, }, { "Get metrics fail invalid dry_run parameter", @@ -156,24 +199,34 @@ func TestAPI(t *testing.T) { "/api/v1/metrics", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + }, }, }, nil }, }, &successGetMetrics{}, nil, - nil, + &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + }, }, { "Get metrics success metric gathering, not dry run, parameter provided", @@ -183,24 +236,34 @@ func TestAPI(t *testing.T) { "/api/v1/metrics?dry_run=false", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + }, }, }, nil }, }, &successGetMetrics{}, nil, - nil, + &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + }, }, { "Get metrics success metric gathering, dry run", @@ -210,24 +273,34 @@ func TestAPI(t *testing.T) { "/api/v1/metrics?dry_run=true", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + }, }, }, nil }, }, &successGetMetrics{}, nil, - nil, + &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + }, }, { "Evaluate fail invalid dry_run parameter", @@ -239,7 +312,15 @@ func TestAPI(t *testing.T) { nil, nil, nil, - nil, + &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + }, }, { "Evaluate fail to get resource", @@ -249,14 +330,14 @@ func TestAPI(t *testing.T) { "/api/v1/evaluation", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { return nil, errors.New("fail to get resource") }, }, @@ -264,6 +345,39 @@ func TestAPI(t *testing.T) { nil, nil, }, + { + "Evaluate fail to get scale subresource", + `{"message":"fail to get subresource","code":500}`, + http.StatusInternalServerError, + "POST", + "/api/v1/evaluation", + &config.Config{ + Namespace: "test-namespace", + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ + Kind: "deployment", + Name: "test", + APIVersion: "apps/v1", + }, + }, + &fake.ResourceClient{ + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + }, + }, + }, nil + }, + }, + nil, + nil, + &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return nil, errors.New("fail to get subresource") + }, + }, + }, { "Evaluate fail to get metrics", `{"message":"FAIL GET METRICS","code":500}`, @@ -272,24 +386,34 @@ func TestAPI(t *testing.T) { "/api/v1/evaluation", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + }, }, }, nil }, }, &failGetMetrics{}, &successGetEvaluation{}, - nil, + &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + }, }, { "Evaluate fail to get evaluation", @@ -299,24 +423,34 @@ func TestAPI(t *testing.T) { "/api/v1/evaluation", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + }, }, }, nil }, }, &successGetMetrics{}, &failGetEvaluation{}, - nil, + &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + }, }, { "Evaluate fail failure scaling", @@ -326,21 +460,21 @@ func TestAPI(t *testing.T) { "/api/v1/evaluation", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - TypeMeta: metav1.TypeMeta{ - Kind: "deployment", - APIVersion: "apps/v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "test", + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "apps/v1", + "kind": "deployment", + "metadata": map[string]interface{}{ + "name": name, + }, }, }, nil }, @@ -348,7 +482,14 @@ func TestAPI(t *testing.T) { &successGetMetrics{}, &successGetEvaluation{}, &fake.Scaler{ - ScaleReactor: func(info scale.Info) (*evaluate.Evaluation, error) { + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + ScaleReactor: func(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error) { return nil, errors.New("FAILURE SCALING") }, }, @@ -361,17 +502,19 @@ func TestAPI(t *testing.T) { "/api/v1/evaluation", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + }, }, }, nil }, @@ -379,7 +522,14 @@ func TestAPI(t *testing.T) { &successGetMetrics{}, &successGetEvaluation{}, &fake.Scaler{ - ScaleReactor: func(info scale.Info) (*evaluate.Evaluation, error) { + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + ScaleReactor: func(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error) { return &evaluate.Evaluation{ TargetReplicas: 1, }, nil @@ -394,17 +544,19 @@ func TestAPI(t *testing.T) { "/api/v1/evaluation?dry_run=false", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + }, }, }, nil }, @@ -412,7 +564,14 @@ func TestAPI(t *testing.T) { &successGetMetrics{}, &successGetEvaluation{}, &fake.Scaler{ - ScaleReactor: func(info scale.Info) (*evaluate.Evaluation, error) { + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + ScaleReactor: func(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error) { return &evaluate.Evaluation{ TargetReplicas: 1, }, nil @@ -427,24 +586,34 @@ func TestAPI(t *testing.T) { "/api/v1/evaluation?dry_run=true", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", }, }, &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + }, }, }, nil }, }, &successGetMetrics{}, &successGetEvaluation{}, - nil, + &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + }, }, { "Non existent endpoint", @@ -454,7 +623,7 @@ func TestAPI(t *testing.T) { "/api/v1/non_existent", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", @@ -473,7 +642,7 @@ func TestAPI(t *testing.T) { "/api/v1/metrics", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", @@ -492,7 +661,7 @@ func TestAPI(t *testing.T) { "/api/v1/evaluation", &config.Config{ Namespace: "test-namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", diff --git a/internal/autoscaler/autoscaler.go b/internal/autoscaler/autoscaler.go index 40aaf82..dddd106 100644 --- a/internal/autoscaler/autoscaler.go +++ b/internal/autoscaler/autoscaler.go @@ -54,11 +54,18 @@ func (s *Scaler) Scale() error { } glog.V(2).Infof("Managed resource retrieved: %+v", resource) + glog.V(2).Infoln("Attempting to get scale subresource") + scaleResource, err := s.Scaler.GetScaleSubResource(s.Config.ScaleTargetRef.APIVersion, s.Config.ScaleTargetRef.Kind, s.Config.Namespace, s.Config.ScaleTargetRef.Name) + if err != nil { + return fmt.Errorf("failed to get scale subresource: %w", err) + } + glog.V(2).Infof("Managed scale subresource retrieved: %+v", scaleResource) + glog.V(2).Infoln("Attempting to get resource metrics") metrics, err := s.GetMetricer.GetMetrics(metric.Info{ Resource: resource, RunType: config.ScalerRunType, - }) + }, scaleResource) if err != nil { return fmt.Errorf("failed to get metrics: %w", err) } @@ -85,7 +92,7 @@ func (s *Scaler) Scale() error { Namespace: s.Config.Namespace, ScaleTargetRef: s.Config.ScaleTargetRef, RunType: config.ScalerRunType, - }) + }, scaleResource) if err != nil { return fmt.Errorf("failed to scale resource: %w", err) } diff --git a/internal/autoscaler/autoscaler_test.go b/internal/autoscaler/autoscaler_test.go index e0b5159..71a4dff 100644 --- a/internal/autoscaler/autoscaler_test.go +++ b/internal/autoscaler/autoscaler_test.go @@ -27,17 +27,17 @@ import ( "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/fake" "github.com/jthomperoo/custom-pod-autoscaler/v2/metric" "github.com/jthomperoo/custom-pod-autoscaler/v2/scale" - appsv1 "k8s.io/api/apps/v1" - autoscaling "k8s.io/api/autoscaling/v2beta2" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + autoscalingv1 "k8s.io/api/autoscaling/v1" + autoscalingv2 "k8s.io/api/autoscaling/v2beta2" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) type fakeGetMetric struct { - getMetrics func(info metric.Info) ([]*metric.ResourceMetric, error) + getMetrics func(info metric.Info, scaleResource *autoscalingv1.Scale) ([]*metric.ResourceMetric, error) } -func (m *fakeGetMetric) GetMetrics(info metric.Info) ([]*metric.ResourceMetric, error) { - return m.getMetrics(info) +func (m *fakeGetMetric) GetMetrics(info metric.Info, scaleResource *autoscalingv1.Scale) ([]*metric.ResourceMetric, error) { + return m.getMetrics(info, scaleResource) } type fakeGetEvaluation struct { @@ -66,13 +66,13 @@ func TestScaler(t *testing.T) { errors.New(`failed to get managed resource: fail to get resource`), autoscaler.Scaler{ Client: &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { return nil, errors.New("fail to get resource") }, }, Config: &config.Config{ Namespace: "test namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", @@ -80,23 +80,56 @@ func TestScaler(t *testing.T) { }, }, }, + { + "Get scale subresource fail", + errors.New(`failed to get scale subresource: fail to get scale subresource`), + autoscaler.Scaler{ + Client: &fake.ResourceClient{ + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + "namespace": namespace, + }, + }, + }, nil + }, + }, + Config: &config.Config{ + Namespace: "test namespace", + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ + Kind: "deployment", + Name: "test", + APIVersion: "apps/v1", + }, + }, + Scaler: &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return nil, errors.New("fail to get scale subresource") + }, + }, + }, + }, { "Gather metric fail", errors.New("failed to get metrics: fail to get metric"), autoscaler.Scaler{ Client: &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + "namespace": namespace, + }, }, }, nil }, }, Config: &config.Config{ Namespace: "test namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", @@ -104,11 +137,20 @@ func TestScaler(t *testing.T) { }, GetMetricer: func() *fakeGetMetric { getMetric := fakeGetMetric{} - getMetric.getMetrics = func(spec metric.Info) ([]*metric.ResourceMetric, error) { + getMetric.getMetrics = func(spec metric.Info, scaleResource *autoscalingv1.Scale) ([]*metric.ResourceMetric, error) { return nil, errors.New("fail to get metric") } return &getMetric }(), + Scaler: &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + }, }, }, { @@ -116,18 +158,20 @@ func TestScaler(t *testing.T) { errors.New("failed get evaluation: fail to evaluate"), autoscaler.Scaler{ Client: &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + "namespace": namespace, + }, }, }, nil }, }, Config: &config.Config{ Namespace: "test namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", @@ -135,7 +179,7 @@ func TestScaler(t *testing.T) { }, GetMetricer: func() *fakeGetMetric { getMetric := fakeGetMetric{} - getMetric.getMetrics = func(spec metric.Info) ([]*metric.ResourceMetric, error) { + getMetric.getMetrics = func(spec metric.Info, scaleResource *autoscalingv1.Scale) ([]*metric.ResourceMetric, error) { return []*metric.ResourceMetric{}, nil } return &getMetric @@ -147,6 +191,15 @@ func TestScaler(t *testing.T) { } return &getEvaluation }(), + Scaler: &fake.Scaler{ + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, + }, }, }, { @@ -154,27 +207,35 @@ func TestScaler(t *testing.T) { errors.New("failed to scale resource: fail to scale"), autoscaler.Scaler{ Client: &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - replicas := int32(2) - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - Namespace: "test namespace", - }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + "namespace": namespace, + }, + "spec": map[string]interface{}{ + "replicas": 2, + }, }, }, nil }, }, Scaler: &fake.Scaler{ - ScaleReactor: func(info scale.Info) (*evaluate.Evaluation, error) { + ScaleReactor: func(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error) { return nil, errors.New("fail to scale") }, + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, }, Config: &config.Config{ Namespace: "test namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", @@ -182,7 +243,7 @@ func TestScaler(t *testing.T) { }, GetMetricer: func() *fakeGetMetric { getMetric := fakeGetMetric{} - getMetric.getMetrics = func(info metric.Info) ([]*metric.ResourceMetric, error) { + getMetric.getMetrics = func(info metric.Info, scaleResource *autoscalingv1.Scale) ([]*metric.ResourceMetric, error) { return []*metric.ResourceMetric{}, nil } return &getMetric @@ -201,29 +262,37 @@ func TestScaler(t *testing.T) { nil, autoscaler.Scaler{ Client: &fake.ResourceClient{ - GetReactor: func(apiVersion, kind, name, namespace string) (metav1.Object, error) { - replicas := int32(1) - return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - Namespace: "test namespace", - }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, + GetReactor: func(apiVersion, kind, name, namespace string) (*unstructured.Unstructured, error) { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": name, + "namespace": namespace, + }, + "spec": map[string]interface{}{ + "replicas": 1, + }, }, }, nil }, }, Scaler: &fake.Scaler{ - ScaleReactor: func(info scale.Info) (*evaluate.Evaluation, error) { + ScaleReactor: func(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error) { return &evaluate.Evaluation{ TargetReplicas: 2, }, nil }, + GetScaleSubResourceReactor: func(apiVersion, kind, namespace, name string) (*autoscalingv1.Scale, error) { + return &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, nil + }, }, Config: &config.Config{ Namespace: "test namespace", - ScaleTargetRef: &autoscaling.CrossVersionObjectReference{ + ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", APIVersion: "apps/v1", @@ -231,7 +300,7 @@ func TestScaler(t *testing.T) { }, GetMetricer: func() *fakeGetMetric { getMetric := fakeGetMetric{} - getMetric.getMetrics = func(spec metric.Info) ([]*metric.ResourceMetric, error) { + getMetric.getMetrics = func(spec metric.Info, scaleResource *autoscalingv1.Scale) ([]*metric.ResourceMetric, error) { return []*metric.ResourceMetric{}, nil } return &getMetric diff --git a/internal/fake/client.go b/internal/fake/client.go index 316f809..c808c32 100644 --- a/internal/fake/client.go +++ b/internal/fake/client.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Custom Pod Autoscaler Authors. +Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,32 +19,32 @@ package fake import ( "time" - autoscaling "k8s.io/api/autoscaling/v2beta2" + "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/podmetrics" + autoscalingv2 "k8s.io/api/autoscaling/v2beta2" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) // MetricClient (fake) provides a way to insert functionality into a MetricClient type MetricClient struct { - GetResourceMetricReactor func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) - GetRawMetricReactor func(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error) - GetObjectMetricReactor func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) + GetResourceMetricReactor func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) + GetRawMetricReactor func(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) + GetObjectMetricReactor func(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) GetExternalMetricReactor func(metricName string, namespace string, selector labels.Selector) ([]int64, time.Time, error) } // GetResourceMetric calls the fake MetricClient function -func (f *MetricClient) GetResourceMetric(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { - return f.GetResourceMetricReactor(resource, namespace, selector, container) +func (f *MetricClient) GetResourceMetric(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { + return f.GetResourceMetricReactor(resource, namespace, selector) } // GetRawMetric calls the fake MetricClient function -func (f *MetricClient) GetRawMetric(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error) { +func (f *MetricClient) GetRawMetric(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { return f.GetRawMetricReactor(metricName, namespace, selector, metricSelector) } // GetObjectMetric calls the fake MetricClient function -func (f *MetricClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { +func (f *MetricClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { return f.GetObjectMetricReactor(metricName, namespace, objectRef, metricSelector) } diff --git a/internal/fake/gather.go b/internal/fake/gather.go index 2e809b8..f0eabfc 100644 --- a/internal/fake/gather.go +++ b/internal/fake/gather.go @@ -23,6 +23,7 @@ import ( "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/object" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/pods" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/resource" + autoscalingv1 "k8s.io/api/autoscaling/v1" autoscaling "k8s.io/api/autoscaling/v2beta2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -31,12 +32,12 @@ import ( // Gather (fake) provides a way to insert functionality into a Gatherer type Gather struct { - GetMetricsReactor func(resource metav1.Object, specs []config.K8sMetricSpec, namespace string) ([]*k8smetric.Metric, error) + GetMetricsReactor func(resource metav1.Object, specs []config.K8sMetricSpec, namespace string, scaleResource *autoscalingv1.Scale) ([]*k8smetric.Metric, error) } // GetMetrics calls the fake Gather function -func (f *Gather) GetMetrics(resource metav1.Object, specs []config.K8sMetricSpec, namespace string) ([]*k8smetric.Metric, error) { - return f.GetMetricsReactor(resource, specs, namespace) +func (f *Gather) GetMetrics(resource metav1.Object, specs []config.K8sMetricSpec, namespace string, scaleResource *autoscalingv1.Scale) ([]*k8smetric.Metric, error) { + return f.GetMetricsReactor(resource, specs, namespace, scaleResource) } // ExternalGatherer (fake) provides a way to insert functionality into an ExternalGatherer diff --git a/internal/fake/resourceclient.go b/internal/fake/resourceclient.go index 7c651f7..2220586 100644 --- a/internal/fake/resourceclient.go +++ b/internal/fake/resourceclient.go @@ -16,14 +16,14 @@ limitations under the License. package fake -import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +import "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" // ResourceClient (fake) allows inserting logic into a resource client for testing type ResourceClient struct { - GetReactor func(apiVersion string, kind string, name string, namespace string) (metav1.Object, error) + GetReactor func(apiVersion string, kind string, name string, namespace string) (*unstructured.Unstructured, error) } // Get calls the fake ResourceClient reactor method provided -func (u *ResourceClient) Get(apiVersion string, kind string, name string, namespace string) (metav1.Object, error) { +func (u *ResourceClient) Get(apiVersion string, kind string, name string, namespace string) (*unstructured.Unstructured, error) { return u.GetReactor(apiVersion, kind, name, namespace) } diff --git a/internal/fake/scaler.go b/internal/fake/scaler.go index cdcffbd..a63d611 100644 --- a/internal/fake/scaler.go +++ b/internal/fake/scaler.go @@ -19,14 +19,21 @@ package fake import ( "github.com/jthomperoo/custom-pod-autoscaler/v2/evaluate" "github.com/jthomperoo/custom-pod-autoscaler/v2/scale" + autoscalingv1 "k8s.io/api/autoscaling/v1" ) // Scaler (fake) allows inserting logic into a scaler for testing type Scaler struct { - ScaleReactor func(info scale.Info) (*evaluate.Evaluation, error) + ScaleReactor func(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error) + GetScaleSubResourceReactor func(apiVersion string, kind string, namespace string, name string) (*autoscalingv1.Scale, error) } // Scale calls the fake Scaler reactor method provided -func (s *Scaler) Scale(info scale.Info) (*evaluate.Evaluation, error) { - return s.ScaleReactor(info) +func (s *Scaler) Scale(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error) { + return s.ScaleReactor(info, scaleResource) +} + +// GetScaleSubResource calls the fake GetScaleSubResource reactor method provided +func (s *Scaler) GetScaleSubResource(apiVersion string, kind string, namespace string, name string) (*autoscalingv1.Scale, error) { + return s.GetScaleSubResourceReactor(apiVersion, kind, namespace, name) } diff --git a/internal/k8smetricget/externalget/externalget.go b/internal/k8smetricget/externalget/externalget.go index f64d97a..fdfe9b2 100644 --- a/internal/k8smetricget/externalget/externalget.go +++ b/internal/k8smetricget/externalget/externalget.go @@ -13,7 +13,7 @@ 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. -Modifications Copyright 2021 The Custom Pod Autoscaler Authors. +Modifications Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -35,8 +35,8 @@ import ( "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/value" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metricsclient "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" "k8s.io/apimachinery/pkg/labels" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) // Gatherer (External) allows retrieval of external metrics. @@ -47,7 +47,7 @@ type Gatherer interface { // Gather (External) provides functionality for retrieving metrics for external metric specs. type Gather struct { - MetricsClient metricsclient.MetricsClient + MetricsClient metricsclient.Client PodReadyCounter podutil.PodReadyCounter } diff --git a/internal/k8smetricget/externalget/externalget_test.go b/internal/k8smetricget/externalget/externalget_test.go index 819cfae..255ef60 100644 --- a/internal/k8smetricget/externalget/externalget_test.go +++ b/internal/k8smetricget/externalget/externalget_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Custom Pod Autoscaler Authors. +Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,12 +24,12 @@ import ( "github.com/google/go-cmp/cmp" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/fake" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/externalget" + metricsclient "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/podutil" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/external" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/value" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) func int64Ptr(i int64) *int64 { @@ -48,7 +48,7 @@ func TestGetMetric(t *testing.T) { description string expected *external.Metric expectedErr error - metricsClient metricsclient.MetricsClient + metricsClient metricsclient.Client podReadyCounter podutil.PodReadyCounter metricName string namespace string @@ -161,7 +161,7 @@ func TestGetPerPodMetric(t *testing.T) { description string expected *external.Metric expectedErr error - metricsClient metricsclient.MetricsClient + metricsClient metricsclient.Client podReadyCounter podutil.PodReadyCounter metricName string namespace string diff --git a/internal/k8smetricget/k8smetricget.go b/internal/k8smetricget/k8smetricget.go index 3f0b3f3..009a2a6 100644 --- a/internal/k8smetricget/k8smetricget.go +++ b/internal/k8smetricget/k8smetricget.go @@ -33,26 +33,24 @@ import ( "fmt" "time" - argov1alpha1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" "github.com/jthomperoo/custom-pod-autoscaler/v2/config" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/externalget" + metricsclient "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/objectget" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/podsget" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/podutil" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/resourceget" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric" - appsv1 "k8s.io/api/apps/v1" - autoscaling "k8s.io/api/autoscaling/v2beta2" - corev1 "k8s.io/api/core/v1" + autoscalingv1 "k8s.io/api/autoscaling/v1" + autoscalingv2 "k8s.io/api/autoscaling/v2beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" corelisters "k8s.io/client-go/listers/core/v1" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) // Gatherer allows retrieval of metrics. type Gatherer interface { - GetMetrics(resource metav1.Object, specs []config.K8sMetricSpec, namespace string) ([]*k8smetric.Metric, error) + GetMetrics(resource metav1.Object, specs []config.K8sMetricSpec, namespace string, scaleResource *autoscalingv1.Scale) ([]*k8smetric.Metric, error) } // Gather provides functionality for retrieving metrics on supplied metric specs. @@ -65,7 +63,7 @@ type Gather struct { // NewGather sets up a new Metric Gatherer func NewGather( - metricsClient metricsclient.MetricsClient, + metricsClient metricsclient.Client, podlister corelisters.PodLister, cpuInitializationPeriod time.Duration, delayOfInitialReadinessStatus time.Duration) *Gather { @@ -99,20 +97,13 @@ func NewGather( // GetMetrics processes each MetricSpec provided, calculating metric values for each and combining them into a slice before returning them. // Error will only be returned if all metrics are invalid, otherwise it will return the valid metrics. -func (c *Gather) GetMetrics(resource metav1.Object, specs []config.K8sMetricSpec, namespace string) ([]*k8smetric.Metric, error) { +func (c *Gather) GetMetrics(resource metav1.Object, specs []config.K8sMetricSpec, namespace string, scaleResource *autoscalingv1.Scale) ([]*k8smetric.Metric, error) { var combinedMetrics []*k8smetric.Metric var invalidMetricError error invalidMetricsCount := 0 - currentReplicas := int32(0) - resourceReplicas, err := getReplicaCount(resource) - if err != nil { - return nil, fmt.Errorf("failed to get replica count for resource: %w", err) - } - if resourceReplicas != nil { - currentReplicas = *resourceReplicas - } + currentReplicas := scaleResource.Spec.Replicas for _, spec := range specs { - specSelector, err := getSelector(resource) + specSelector, err := labels.Parse(scaleResource.Status.Selector) if err != nil { if invalidMetricsCount <= 0 { invalidMetricError = err @@ -142,14 +133,14 @@ func (c *Gather) GetMetrics(resource metav1.Object, specs []config.K8sMetricSpec func (c *Gather) getMetric(currentReplicas int32, spec config.K8sMetricSpec, namespace string, selector labels.Selector) (*k8smetric.Metric, error) { switch spec.Type { - case autoscaling.ObjectMetricSourceType: + case autoscalingv2.ObjectMetricSourceType: metricSelector, err := metav1.LabelSelectorAsSelector(spec.Object.Metric.Selector) if err != nil { return nil, fmt.Errorf("failed to get object metric: %w", err) } switch spec.Object.Target.Type { - case autoscaling.ValueMetricType: + case autoscalingv2.ValueMetricType: objectMetric, err := c.Object.GetMetric(spec.Object.Metric.Name, namespace, &spec.Object.DescribedObject, selector, metricSelector) if err != nil { return nil, fmt.Errorf("failed to get object metric: %w", err) @@ -159,7 +150,7 @@ func (c *Gather) getMetric(currentReplicas int32, spec config.K8sMetricSpec, nam Spec: spec, Object: objectMetric, }, nil - case autoscaling.AverageValueMetricType: + case autoscalingv2.AverageValueMetricType: objectMetric, err := c.Object.GetPerPodMetric(spec.Object.Metric.Name, namespace, &spec.Object.DescribedObject, selector) if err != nil { return nil, fmt.Errorf("failed to get object metric: %w", err) @@ -172,13 +163,13 @@ func (c *Gather) getMetric(currentReplicas int32, spec config.K8sMetricSpec, nam default: return nil, fmt.Errorf("invalid object metric source: must be either value or average value") } - case autoscaling.PodsMetricSourceType: + case autoscalingv2.PodsMetricSourceType: metricSelector, err := metav1.LabelSelectorAsSelector(spec.Pods.Metric.Selector) if err != nil { return nil, fmt.Errorf("failed to get pods metric: %w", err) } - if spec.Pods.Target.Type != autoscaling.AverageValueMetricType { + if spec.Pods.Target.Type != autoscalingv2.AverageValueMetricType { return nil, fmt.Errorf("invalid pods metric source: must be average value") } @@ -191,9 +182,9 @@ func (c *Gather) getMetric(currentReplicas int32, spec config.K8sMetricSpec, nam Spec: spec, Pods: podsMetric, }, nil - case autoscaling.ResourceMetricSourceType: + case autoscalingv2.ResourceMetricSourceType: switch spec.Resource.Target.Type { - case autoscaling.AverageValueMetricType: + case autoscalingv2.AverageValueMetricType: resourceMetric, err := c.Resource.GetRawMetric(spec.Resource.Name, namespace, selector) if err != nil { return nil, fmt.Errorf("failed to get resource metric: %w", err) @@ -203,7 +194,7 @@ func (c *Gather) getMetric(currentReplicas int32, spec config.K8sMetricSpec, nam Spec: spec, Resource: resourceMetric, }, nil - case autoscaling.UtilizationMetricType: + case autoscalingv2.UtilizationMetricType: resourceMetric, err := c.Resource.GetMetric(spec.Resource.Name, namespace, selector) if err != nil { return nil, fmt.Errorf("failed to get resource metric: %w", err) @@ -217,9 +208,9 @@ func (c *Gather) getMetric(currentReplicas int32, spec config.K8sMetricSpec, nam return nil, fmt.Errorf("invalid resource metric source: must be either average value or average utilization") } - case autoscaling.ExternalMetricSourceType: + case autoscalingv2.ExternalMetricSourceType: switch spec.External.Target.Type { - case autoscaling.AverageValueMetricType: + case autoscalingv2.AverageValueMetricType: externalMetric, err := c.External.GetPerPodMetric(spec.External.Metric.Name, namespace, spec.External.Metric.Selector) if err != nil { return nil, fmt.Errorf("failed to get external metric: %w", err) @@ -229,7 +220,7 @@ func (c *Gather) getMetric(currentReplicas int32, spec config.K8sMetricSpec, nam Spec: spec, External: externalMetric, }, nil - case autoscaling.ValueMetricType: + case autoscalingv2.ValueMetricType: externalMetric, err := c.External.GetMetric(spec.External.Metric.Name, namespace, spec.External.Metric.Selector, selector) if err != nil { return nil, fmt.Errorf("failed to get external metric: %w", err) @@ -247,37 +238,3 @@ func (c *Gather) getMetric(currentReplicas int32, spec config.K8sMetricSpec, nam return nil, fmt.Errorf("unknown metric source type %q", string(spec.Type)) } } - -func getReplicaCount(resource metav1.Object) (*int32, error) { - switch v := resource.(type) { - case *appsv1.Deployment: - return v.Spec.Replicas, nil - case *appsv1.ReplicaSet: - return v.Spec.Replicas, nil - case *appsv1.StatefulSet: - return v.Spec.Replicas, nil - case *corev1.ReplicationController: - return v.Spec.Replicas, nil - case *argov1alpha1.Rollout: - return v.Spec.Replicas, nil - default: - return nil, fmt.Errorf("unsupported resource of type %T", v) - } -} - -func getSelector(resource metav1.Object) (labels.Selector, error) { - switch v := resource.(type) { - case *appsv1.Deployment: - return metav1.LabelSelectorAsSelector(v.Spec.Selector) - case *appsv1.ReplicaSet: - return metav1.LabelSelectorAsSelector(v.Spec.Selector) - case *appsv1.StatefulSet: - return metav1.LabelSelectorAsSelector(v.Spec.Selector) - case *corev1.ReplicationController: - return labels.Set(v.Spec.Selector).AsSelector(), nil - case *argov1alpha1.Rollout: - return metav1.LabelSelectorAsSelector(v.Spec.Selector) - default: - return nil, fmt.Errorf("unsupported resource of type %T", v) - } -} diff --git a/internal/k8smetricget/k8smetricget_test.go b/internal/k8smetricget/k8smetricget_test.go index 99ee535..7e65c82 100644 --- a/internal/k8smetricget/k8smetricget_test.go +++ b/internal/k8smetricget/k8smetricget_test.go @@ -21,12 +21,12 @@ import ( "testing" "time" - argov1alpha1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" "github.com/google/go-cmp/cmp" "github.com/jthomperoo/custom-pod-autoscaler/v2/config" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/fake" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/externalget" + metricsclient "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/objectget" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/podsget" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/podutil" @@ -34,17 +34,19 @@ import ( "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/external" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/object" + "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/podmetrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/pods" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/resource" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/value" appsv1 "k8s.io/api/apps/v1" + autoscalingv1 "k8s.io/api/autoscaling/v1" autoscaling "k8s.io/api/autoscaling/v2beta2" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" corelisters "k8s.io/client-go/listers/core/v1" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) func int32Ptr(i int32) *int32 { @@ -64,33 +66,18 @@ func TestGetMetrics(t *testing.T) { }) var tests = []struct { - description string - expected []*k8smetric.Metric - expectedErr error - resource resourceget.Gatherer - object objectget.Gatherer - pods podsget.Gatherer - external externalget.Gatherer - deployment metav1.Object - specs []config.K8sMetricSpec - namespace string + description string + expected []*k8smetric.Metric + expectedErr error + resource resourceget.Gatherer + object objectget.Gatherer + pods podsget.Gatherer + external externalget.Gatherer + deployment metav1.Object + specs []config.K8sMetricSpec + namespace string + scaleResource *autoscalingv1.Scale }{ - { - "Single invalid resource type", - nil, - errors.New(`failed to get replica count for resource: unsupported resource of type *v1.DaemonSet`), - nil, - nil, - nil, - nil, - &appsv1.DaemonSet{}, - []config.K8sMetricSpec{ - { - Type: "invalid", - }, - }, - "test-namespace", - }, { "Single unknown metric type", nil, @@ -110,6 +97,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single object metric, fail to convert label", @@ -119,11 +111,7 @@ func TestGetMetrics(t *testing.T) { nil, nil, nil, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(1), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ObjectMetricSourceType, @@ -141,6 +129,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single object metric, invalid target", @@ -150,11 +143,7 @@ func TestGetMetrics(t *testing.T) { nil, nil, nil, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(1), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ObjectMetricSourceType, @@ -166,6 +155,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single object metric, value metric, fail to get metric", @@ -179,11 +173,7 @@ func TestGetMetrics(t *testing.T) { }, nil, nil, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(1), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ObjectMetricSourceType, @@ -195,6 +185,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single object metric, deployment, value metric, success", @@ -238,7 +233,6 @@ func TestGetMetrics(t *testing.T) { "test": "test", }, }, - Replicas: int32Ptr(1), }, }, []config.K8sMetricSpec{ @@ -252,6 +246,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, }, { "Single object metric, argo rollout, value metric, success", @@ -288,14 +287,16 @@ func TestGetMetrics(t *testing.T) { }, nil, nil, - &argov1alpha1.Rollout{ - Spec: argov1alpha1.RolloutSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "test": "test", + &unstructured.Unstructured{ + Object: map[string]interface{}{ + "spec": map[string]interface{}{ + "selector": map[string]interface{}{ + "matchLabels": map[string]string{ + "test": "test", + }, }, + "replicas": 1, }, - Replicas: int32Ptr(1), }, }, []config.K8sMetricSpec{ @@ -309,6 +310,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, }, { "Single object metric, replicaset, average value metric, fail to get metric", @@ -322,11 +328,7 @@ func TestGetMetrics(t *testing.T) { }, nil, nil, - &appsv1.ReplicaSet{ - Spec: appsv1.ReplicaSetSpec{ - Replicas: int32Ptr(1), - }, - }, + &appsv1.ReplicaSet{}, []config.K8sMetricSpec{ { Type: autoscaling.ObjectMetricSourceType, @@ -338,6 +340,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single object metric, statefulset, average value metric, success", @@ -395,6 +402,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { @@ -405,11 +417,7 @@ func TestGetMetrics(t *testing.T) { nil, nil, nil, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(1), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.PodsMetricSourceType, @@ -427,6 +435,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single pods metric, fail to get metric, non average value", @@ -436,11 +449,7 @@ func TestGetMetrics(t *testing.T) { nil, &fake.PodsGatherer{}, nil, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(1), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.PodsMetricSourceType, @@ -455,6 +464,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single pods metric, fail to get metric", @@ -468,11 +482,7 @@ func TestGetMetrics(t *testing.T) { }, }, nil, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(1), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.PodsMetricSourceType, @@ -487,6 +497,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single pods metric, replicationcontroller, success", @@ -505,7 +520,7 @@ func TestGetMetrics(t *testing.T) { }, }, Pods: &pods.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, ReadyPodCount: 3, TotalPods: 5, MissingPods: sets.String{ @@ -520,7 +535,7 @@ func TestGetMetrics(t *testing.T) { &fake.PodsGatherer{ GetMetricReactor: func(metricName, namespace string, selector, metricSelector labels.Selector) (*pods.Metric, error) { return &pods.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, ReadyPodCount: 3, TotalPods: 5, MissingPods: sets.String{ @@ -535,7 +550,6 @@ func TestGetMetrics(t *testing.T) { Selector: map[string]string{ "test": "test", }, - Replicas: int32Ptr(8), }, }, []config.K8sMetricSpec{ @@ -552,6 +566,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 8, + }, + }, }, { "Single resource metric, invalid target", @@ -561,11 +580,7 @@ func TestGetMetrics(t *testing.T) { nil, nil, nil, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(3), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ResourceMetricSourceType, @@ -578,6 +593,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single resource metric, average value, fail to get metric", @@ -591,11 +611,7 @@ func TestGetMetrics(t *testing.T) { nil, nil, nil, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(1), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ResourceMetricSourceType, @@ -608,6 +624,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single resource metric, average metric, success", @@ -624,7 +645,7 @@ func TestGetMetrics(t *testing.T) { }, }, Resource: &resource.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, ReadyPodCount: 3, TotalPods: 5, MissingPods: sets.String{ @@ -643,7 +664,7 @@ func TestGetMetrics(t *testing.T) { &fake.ResourceGatherer{ GetRawMetricReactor: func(res v1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error) { return &resource.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, ReadyPodCount: 3, TotalPods: 5, MissingPods: sets.String{ @@ -661,11 +682,7 @@ func TestGetMetrics(t *testing.T) { nil, nil, nil, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(9), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ResourceMetricSourceType, @@ -678,6 +695,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 9, + }, + }, }, { "Single resource metric, average utilisation, fail to get metric", @@ -691,11 +713,7 @@ func TestGetMetrics(t *testing.T) { nil, nil, nil, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(1), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ResourceMetricSourceType, @@ -708,6 +726,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single resource metric, average utilisation, success", @@ -724,7 +747,7 @@ func TestGetMetrics(t *testing.T) { }, }, Resource: &resource.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, ReadyPodCount: 3, TotalPods: 5, MissingPods: sets.String{ @@ -740,7 +763,7 @@ func TestGetMetrics(t *testing.T) { &fake.ResourceGatherer{ GetMetricReactor: func(res v1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error) { return &resource.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, ReadyPodCount: 3, TotalPods: 5, MissingPods: sets.String{ @@ -762,7 +785,6 @@ func TestGetMetrics(t *testing.T) { "test": "test", }, }, - Replicas: int32Ptr(9), }, }, []config.K8sMetricSpec{ @@ -777,6 +799,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 9, + }, + }, }, { "Single external metric, invalid target", @@ -786,11 +813,7 @@ func TestGetMetrics(t *testing.T) { nil, nil, nil, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(3), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ExternalMetricSourceType, @@ -806,6 +829,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single external metric, average value, fail to get metric", @@ -819,11 +847,7 @@ func TestGetMetrics(t *testing.T) { return nil, errors.New("fail to get metric") }, }, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(2), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ExternalMetricSourceType, @@ -839,6 +863,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single external metric, average metric, success", @@ -886,7 +915,6 @@ func TestGetMetrics(t *testing.T) { "test": "test", }, }, - Replicas: int32Ptr(2), }, }, []config.K8sMetricSpec{ @@ -904,6 +932,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 2, + }, + }, }, { "Single external metric, value, fail to get metric", @@ -917,11 +950,7 @@ func TestGetMetrics(t *testing.T) { return nil, errors.New("fail to get metric") }, }, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(7), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ExternalMetricSourceType, @@ -937,6 +966,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Single external metric, value, success", @@ -984,7 +1018,6 @@ func TestGetMetrics(t *testing.T) { "test": "test", }, }, - Replicas: int32Ptr(7), }, }, []config.K8sMetricSpec{ @@ -1002,6 +1035,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 7, + }, + }, }, { "One of each metric, all failure", @@ -1027,11 +1065,7 @@ func TestGetMetrics(t *testing.T) { return nil, errors.New("fail to get external metric") }, }, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(4), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ExternalMetricSourceType, @@ -1076,6 +1110,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "One of each metric, 2 success, 2 invalid", @@ -1116,7 +1155,7 @@ func TestGetMetrics(t *testing.T) { }, }, Pods: &pods.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, ReadyPodCount: 3, IgnoredPods: sets.String{ "ignored-pod": {}, @@ -1142,7 +1181,7 @@ func TestGetMetrics(t *testing.T) { &fake.PodsGatherer{ GetMetricReactor: func(metricName, namespace string, selector, metricSelector labels.Selector) (*pods.Metric, error) { return &pods.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, ReadyPodCount: 3, IgnoredPods: sets.String{ "ignored-pod": {}, @@ -1164,11 +1203,7 @@ func TestGetMetrics(t *testing.T) { }, nil }, }, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(4), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ExternalMetricSourceType, @@ -1213,6 +1248,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 4, + }, + }, }, { "One of each metric, all success", @@ -1253,7 +1293,7 @@ func TestGetMetrics(t *testing.T) { }, }, Pods: &pods.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, ReadyPodCount: 3, IgnoredPods: sets.String{ "ignored-pod": {}, @@ -1293,7 +1333,7 @@ func TestGetMetrics(t *testing.T) { }, }, Resource: &resource.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, Requests: map[string]int64{"pod-1": 1, "pod-2": 3, "pod-3": 4}, ReadyPodCount: 4, TotalPods: 6, @@ -1306,7 +1346,7 @@ func TestGetMetrics(t *testing.T) { &fake.ResourceGatherer{ GetRawMetricReactor: func(res v1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error) { return &resource.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, Requests: map[string]int64{"pod-1": 1, "pod-2": 3, "pod-3": 4}, ReadyPodCount: 4, TotalPods: 6, @@ -1328,7 +1368,7 @@ func TestGetMetrics(t *testing.T) { &fake.PodsGatherer{ GetMetricReactor: func(metricName, namespace string, selector, metricSelector labels.Selector) (*pods.Metric, error) { return &pods.Metric{ - PodMetricsInfo: metricsclient.PodMetricsInfo{}, + PodMetricsInfo: podmetrics.MetricsInfo{}, ReadyPodCount: 3, IgnoredPods: sets.String{ "ignored-pod": {}, @@ -1350,11 +1390,7 @@ func TestGetMetrics(t *testing.T) { }, nil }, }, - &appsv1.Deployment{ - Spec: appsv1.DeploymentSpec{ - Replicas: int32Ptr(4), - }, - }, + &appsv1.Deployment{}, []config.K8sMetricSpec{ { Type: autoscaling.ExternalMetricSourceType, @@ -1399,6 +1435,11 @@ func TestGetMetrics(t *testing.T) { }, }, "test-namespace", + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 4, + }, + }, }, } for _, test := range tests { @@ -1409,7 +1450,7 @@ func TestGetMetrics(t *testing.T) { Object: test.object, External: test.external, } - metrics, err := gatherer.GetMetrics(test.deployment, test.specs, test.namespace) + metrics, err := gatherer.GetMetrics(test.deployment, test.specs, test.namespace, test.scaleResource) if !cmp.Equal(&err, &test.expectedErr, equateErrorMessage) { t.Errorf("error mismatch (-want +got):\n%s", cmp.Diff(test.expectedErr, err, equateErrorMessage)) return @@ -1425,7 +1466,7 @@ func TestNewGather(t *testing.T) { var tests = []struct { description string expected k8smetricget.Gatherer - metricsClient metricsclient.MetricsClient + metricsClient metricsclient.Client podlister corelisters.PodLister cpuInitializationPeriod time.Duration delayOfInitialReadinessStatus time.Duration diff --git a/internal/k8smetricget/metrics/metrics.go b/internal/k8smetricget/metrics/metrics.go new file mode 100644 index 0000000..622d57d --- /dev/null +++ b/internal/k8smetricget/metrics/metrics.go @@ -0,0 +1,167 @@ +/* +Copyright 2022 The Custom Pod Autoscaler 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 metrics + +import ( + "context" + "fmt" + "time" + + "github.com/golang/glog" + "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/podmetrics" + autoscalingv2 "k8s.io/api/autoscaling/v2beta2" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + custommetricsv1 "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2" + metricsv1beta1 "k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1" + "k8s.io/metrics/pkg/client/custom_metrics" + "k8s.io/metrics/pkg/client/external_metrics" +) + +const ( + metricServerDefaultMetricWindow = time.Minute +) + +// Client allows for retrieval of Kubernetes metrics +type Client interface { + GetResourceMetric(resource v1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) + GetRawMetric(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) + GetObjectMetric(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) + GetExternalMetric(metricName, namespace string, selector labels.Selector) ([]int64, time.Time, error) +} + +// RESTClient retrieves Kubernetes metrics through the Kubernetes REST API +type RESTClient struct { + Client metricsv1beta1.MetricsV1beta1Interface + ExternalMetricsClient external_metrics.ExternalMetricsClient + CustomMetricsClient custom_metrics.CustomMetricsClient +} + +// GetResourceMetric gets the given resource metric (and an associated oldest timestamp) +// for all pods matching the specified selector in the given namespace +func (c *RESTClient) GetResourceMetric(resource v1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { + metrics, err := c.Client.PodMetricses(namespace).List(context.Background(), metav1.ListOptions{LabelSelector: selector.String()}) + if err != nil { + return nil, time.Time{}, fmt.Errorf("unable to fetch metrics from resource metrics API: %v", err) + } + + if len(metrics.Items) == 0 { + return nil, time.Time{}, fmt.Errorf("no metrics returned from resource metrics API") + } + + res := make(podmetrics.MetricsInfo, len(metrics.Items)) + for _, m := range metrics.Items { + podSum := int64(0) + missing := len(m.Containers) == 0 + for _, c := range m.Containers { + resValue, found := c.Usage[resource] + if !found { + missing = true + glog.V(4).Infof("missing resource metric %v for %s/%s", resource, m.Namespace, m.Name) + break + } + podSum += resValue.MilliValue() + } + if !missing { + res[m.Name] = podmetrics.Metric{ + Timestamp: m.Timestamp.Time, + Window: m.Window.Duration, + Value: podSum, + } + } + } + + timestamp := metrics.Items[0].Timestamp.Time + + return res, timestamp, nil +} + +// GetRawMetric gets the given metric (and an associated oldest timestamp) +// for all pods matching the specified selector in the given namespace +func (c *RESTClient) GetRawMetric(metricName string, namespace string, selector labels.Selector, metricSelector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { + metrics, err := c.CustomMetricsClient.NamespacedMetrics(namespace).GetForObjects(schema.GroupKind{Kind: "Pod"}, selector, metricName, metricSelector) + if err != nil { + return nil, time.Time{}, fmt.Errorf("unable to fetch metrics from custom metrics API: %v", err) + } + + if len(metrics.Items) == 0 { + return nil, time.Time{}, fmt.Errorf("no metrics returned from custom metrics API") + } + + res := make(podmetrics.MetricsInfo, len(metrics.Items)) + for _, m := range metrics.Items { + window := metricServerDefaultMetricWindow + if m.WindowSeconds != nil { + window = time.Duration(*m.WindowSeconds) * time.Second + } + res[m.DescribedObject.Name] = podmetrics.Metric{ + Timestamp: m.Timestamp.Time, + Window: window, + Value: int64(m.Value.MilliValue()), + } + + m.Value.MilliValue() + } + + timestamp := metrics.Items[0].Timestamp.Time + + return res, timestamp, nil +} + +// GetObjectMetric gets the given metric (and an associated timestamp) for the given +// object in the given namespace +func (c *RESTClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { + gvk := schema.FromAPIVersionAndKind(objectRef.APIVersion, objectRef.Kind) + var metricValue *custommetricsv1.MetricValue + var err error + if gvk.Kind == "Namespace" && gvk.Group == "" { + // handle namespace separately + // NB: we ignore namespace name here, since CrossVersionObjectReference isn't + // supposed to allow you to escape your namespace + metricValue, err = c.CustomMetricsClient.RootScopedMetrics().GetForObject(gvk.GroupKind(), namespace, metricName, metricSelector) + } else { + metricValue, err = c.CustomMetricsClient.NamespacedMetrics(namespace).GetForObject(gvk.GroupKind(), objectRef.Name, metricName, metricSelector) + } + + if err != nil { + return 0, time.Time{}, fmt.Errorf("unable to fetch metrics from custom metrics API: %v", err) + } + + return metricValue.Value.MilliValue(), metricValue.Timestamp.Time, nil +} + +// GetExternalMetric gets all the values of a given external metric +// that match the specified selector. +func (c *RESTClient) GetExternalMetric(metricName, namespace string, selector labels.Selector) ([]int64, time.Time, error) { + metrics, err := c.ExternalMetricsClient.NamespacedMetrics(namespace).List(metricName, selector) + if err != nil { + return []int64{}, time.Time{}, fmt.Errorf("unable to fetch metrics from external metrics API: %v", err) + } + + if len(metrics.Items) == 0 { + return nil, time.Time{}, fmt.Errorf("no metrics returned from external metrics API") + } + + res := make([]int64, 0) + for _, m := range metrics.Items { + res = append(res, m.Value.MilliValue()) + } + timestamp := metrics.Items[0].Timestamp.Time + return res, timestamp, nil +} diff --git a/internal/k8smetricget/metrics/metrics_test.go b/internal/k8smetricget/metrics/metrics_test.go new file mode 100644 index 0000000..63968ce --- /dev/null +++ b/internal/k8smetricget/metrics/metrics_test.go @@ -0,0 +1,918 @@ +/* +Copyright 2022 The Custom Pod Autoscaler 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 metrics_test + +import ( + "errors" + "testing" + "time" + + "github.com/google/go-cmp/cmp" + "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" + "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/podmetrics" + autoscalingv2 "k8s.io/api/autoscaling/v2beta2" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + k8stesting "k8s.io/client-go/testing" + custom_metricsv1beta2 "k8s.io/metrics/pkg/apis/custom_metrics/v1beta2" + external_metricsv1beta1 "k8s.io/metrics/pkg/apis/external_metrics/v1beta1" + metricsv1beta1 "k8s.io/metrics/pkg/apis/metrics/v1beta1" + metricsv1beta1fake "k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1/fake" + custom_metricsfake "k8s.io/metrics/pkg/client/custom_metrics/fake" + external_metricsfake "k8s.io/metrics/pkg/client/external_metrics/fake" +) + +func int64Ptr(i int64) *int64 { + return &i +} + +func TestGetResourceMetric(t *testing.T) { + equateErrorMessage := cmp.Comparer(func(x, y error) bool { + if x == nil || y == nil { + return x == nil && y == nil + } + return x.Error() == y.Error() + }) + + var tests = []struct { + description string + expectedInfo podmetrics.MetricsInfo + expectedTime time.Time + expectedErr error + client metrics.RESTClient + resource v1.ResourceName + namespace string + selector labels.Selector + }{ + { + description: "Fail, fail to fetch metrics", + expectedInfo: nil, + expectedTime: time.Time{}, + expectedErr: errors.New("unable to fetch metrics from resource metrics API: fail to get pod metrics"), + client: metrics.RESTClient{ + Client: &metricsv1beta1fake.FakeMetricsV1beta1{ + Fake: &k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "pods", + Verb: "list", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, errors.New("fail to get pod metrics") + }, + }, + }, + }, + }, + }, + resource: v1.ResourceCPU, + namespace: "test", + selector: labels.Everything(), + }, + { + description: "Fail, no metrics found", + expectedInfo: nil, + expectedTime: time.Time{}, + expectedErr: errors.New("no metrics returned from resource metrics API"), + client: metrics.RESTClient{ + Client: &metricsv1beta1fake.FakeMetricsV1beta1{ + Fake: &k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "pods", + Verb: "list", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &metricsv1beta1.PodMetricsList{ + Items: []metricsv1beta1.PodMetrics{}, + }, nil + }, + }, + }, + }, + }, + }, + resource: v1.ResourceCPU, + namespace: "test", + selector: labels.Everything(), + }, + { + description: "Success, one metric, no containers", + expectedInfo: podmetrics.MetricsInfo{}, + expectedTime: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + expectedErr: nil, + client: metrics.RESTClient{ + Client: &metricsv1beta1fake.FakeMetricsV1beta1{ + Fake: &k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "pods", + Verb: "list", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &metricsv1beta1.PodMetricsList{ + Items: []metricsv1beta1.PodMetrics{ + { + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + }, + }, + }, + }, nil + }, + }, + }, + }, + }, + }, + resource: v1.ResourceCPU, + namespace: "test", + selector: labels.Everything(), + }, + { + description: "Success, one metric, one container, desired metric not found", + expectedInfo: podmetrics.MetricsInfo{}, + expectedTime: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + expectedErr: nil, + client: metrics.RESTClient{ + Client: &metricsv1beta1fake.FakeMetricsV1beta1{ + Fake: &k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "pods", + Verb: "list", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &metricsv1beta1.PodMetricsList{ + Items: []metricsv1beta1.PodMetrics{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "test", + }, + Containers: []metricsv1beta1.ContainerMetrics{ + { + Usage: v1.ResourceList{ + v1.ResourceName("test"): *resource.NewQuantity(10, resource.DecimalSI), + }, + }, + }, + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + }, + }, + }, + }, nil + }, + }, + }, + }, + }, + }, + resource: v1.ResourceCPU, + namespace: "test", + selector: labels.Everything(), + }, + { + description: "Success, one metric, one container, desired metric found", + expectedInfo: podmetrics.MetricsInfo{ + "test": podmetrics.Metric{ + Timestamp: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + Value: 10000, + }, + }, + expectedTime: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + expectedErr: nil, + client: metrics.RESTClient{ + Client: &metricsv1beta1fake.FakeMetricsV1beta1{ + Fake: &k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "pods", + Verb: "list", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &metricsv1beta1.PodMetricsList{ + Items: []metricsv1beta1.PodMetrics{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "test", + }, + Containers: []metricsv1beta1.ContainerMetrics{ + { + Usage: v1.ResourceList{ + v1.ResourceCPU: *resource.NewQuantity(10, resource.DecimalSI), + }, + }, + }, + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + }, + }, + }, + }, nil + }, + }, + }, + }, + }, + }, + resource: v1.ResourceCPU, + namespace: "test", + selector: labels.Everything(), + }, + { + description: "Success, three metrics, two containers each, desired metric found", + expectedInfo: podmetrics.MetricsInfo{ + "test1": podmetrics.Metric{ + Timestamp: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + Value: 10000, + }, + "test3": podmetrics.Metric{ + Timestamp: time.Date(2000, 3, 7, 10, 30, 0, 5, time.UTC), + Value: 15000, + }, + }, + expectedTime: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + expectedErr: nil, + client: metrics.RESTClient{ + Client: &metricsv1beta1fake.FakeMetricsV1beta1{ + Fake: &k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "pods", + Verb: "list", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &metricsv1beta1.PodMetricsList{ + Items: []metricsv1beta1.PodMetrics{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: "test1", + }, + Containers: []metricsv1beta1.ContainerMetrics{ + { + Usage: v1.ResourceList{ + v1.ResourceCPU: *resource.NewQuantity(10, resource.DecimalSI), + v1.ResourceMemory: *resource.NewQuantity(20, resource.DecimalSI), + }, + }, + }, + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Name: "test2", + }, + Containers: []metricsv1beta1.ContainerMetrics{ + { + Usage: v1.ResourceList{ + v1.ResourceName("test"): *resource.NewQuantity(3, resource.DecimalSI), + }, + }, + }, + Timestamp: metav1.Time{ + Time: time.Date(1999, 3, 7, 10, 30, 0, 5, time.UTC), + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Name: "test3", + }, + Containers: []metricsv1beta1.ContainerMetrics{ + { + Usage: v1.ResourceList{ + v1.ResourceCPU: *resource.NewQuantity(15, resource.DecimalSI), + }, + }, + }, + Timestamp: metav1.Time{ + Time: time.Date(2000, 3, 7, 10, 30, 0, 5, time.UTC), + }, + }, + }, + }, nil + }, + }, + }, + }, + }, + }, + resource: v1.ResourceCPU, + namespace: "test", + selector: labels.Everything(), + }, + } + for _, test := range tests { + t.Run(test.description, func(t *testing.T) { + info, time, err := test.client.GetResourceMetric(test.resource, test.namespace, test.selector) + if !cmp.Equal(&err, &test.expectedErr, equateErrorMessage) { + t.Errorf("error mismatch (-want +got):\n%s", cmp.Diff(test.expectedErr, err, equateErrorMessage)) + return + } + if !cmp.Equal(test.expectedInfo, info) { + t.Errorf("info mismatch (-want +got):\n%s", cmp.Diff(test.expectedInfo, info)) + } + if !cmp.Equal(test.expectedTime, time) { + t.Errorf("time mismatch (-want +got):\n%s", cmp.Diff(test.expectedTime, time)) + } + }) + } +} + +func Test_GetRawMetric(t *testing.T) { + equateErrorMessage := cmp.Comparer(func(x, y error) bool { + if x == nil || y == nil { + return x == nil && y == nil + } + return x.Error() == y.Error() + }) + + var tests = []struct { + description string + expectedInfo podmetrics.MetricsInfo + expectedTime time.Time + expectedErr error + client metrics.RESTClient + metricName string + namespace string + selector labels.Selector + metricSelector labels.Selector + }{ + { + description: "Fail, fail to fetch metrics", + expectedInfo: nil, + expectedTime: time.Time{}, + expectedErr: errors.New("unable to fetch metrics from custom metrics API: fail to get pod metrics"), + client: metrics.RESTClient{ + CustomMetricsClient: &custom_metricsfake.FakeCustomMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "pods", + Verb: "get", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, errors.New("fail to get pod metrics") + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + selector: labels.Everything(), + metricSelector: labels.Everything(), + }, + { + description: "Fail, no metrics returned", + expectedInfo: nil, + expectedTime: time.Time{}, + expectedErr: errors.New("no metrics returned from custom metrics API"), + client: metrics.RESTClient{ + CustomMetricsClient: &custom_metricsfake.FakeCustomMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "pods", + Verb: "get", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &custom_metricsv1beta2.MetricValueList{}, nil + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + selector: labels.Everything(), + metricSelector: labels.Everything(), + }, + { + description: "Success, single metric", + expectedInfo: podmetrics.MetricsInfo{ + "test": podmetrics.Metric{ + Timestamp: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + Value: 10000, + Window: time.Second * 90, + }, + }, + expectedTime: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + expectedErr: nil, + client: metrics.RESTClient{ + CustomMetricsClient: &custom_metricsfake.FakeCustomMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "pods", + Verb: "get", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &custom_metricsv1beta2.MetricValueList{ + Items: []custom_metricsv1beta2.MetricValue{ + { + DescribedObject: v1.ObjectReference{ + Name: "test", + }, + WindowSeconds: int64Ptr(90), + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + }, + Value: *resource.NewQuantity(10, resource.DecimalSI), + }, + }, + }, nil + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + selector: labels.Everything(), + metricSelector: labels.Everything(), + }, + { + description: "Success, single metric, window not provided", + expectedInfo: podmetrics.MetricsInfo{ + "test": podmetrics.Metric{ + Timestamp: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + Value: 10000, + Window: time.Second * 60, + }, + }, + expectedTime: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + expectedErr: nil, + client: metrics.RESTClient{ + CustomMetricsClient: &custom_metricsfake.FakeCustomMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "pods", + Verb: "get", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &custom_metricsv1beta2.MetricValueList{ + Items: []custom_metricsv1beta2.MetricValue{ + { + DescribedObject: v1.ObjectReference{ + Name: "test", + }, + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + }, + Value: *resource.NewQuantity(10, resource.DecimalSI), + }, + }, + }, nil + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + selector: labels.Everything(), + metricSelector: labels.Everything(), + }, + { + description: "Success, multiple metric", + expectedInfo: podmetrics.MetricsInfo{ + "test1": podmetrics.Metric{ + Timestamp: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + Value: 10000, + Window: time.Second * 60, + }, + "test2": podmetrics.Metric{ + Timestamp: time.Date(1998, 3, 8, 10, 30, 0, 5, time.UTC), + Value: 15000, + Window: time.Second * 90, + }, + "test3": podmetrics.Metric{ + Timestamp: time.Date(1998, 3, 9, 10, 30, 0, 5, time.UTC), + Value: 20000, + Window: time.Second * 60, + }, + }, + expectedTime: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + expectedErr: nil, + client: metrics.RESTClient{ + CustomMetricsClient: &custom_metricsfake.FakeCustomMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "pods", + Verb: "get", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &custom_metricsv1beta2.MetricValueList{ + Items: []custom_metricsv1beta2.MetricValue{ + { + DescribedObject: v1.ObjectReference{ + Name: "test1", + }, + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + }, + Value: *resource.NewQuantity(10, resource.DecimalSI), + }, + { + DescribedObject: v1.ObjectReference{ + Name: "test2", + }, + WindowSeconds: int64Ptr(90), + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 8, 10, 30, 0, 5, time.UTC), + }, + Value: *resource.NewQuantity(15, resource.DecimalSI), + }, + { + DescribedObject: v1.ObjectReference{ + Name: "test3", + }, + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 9, 10, 30, 0, 5, time.UTC), + }, + Value: *resource.NewQuantity(20, resource.DecimalSI), + }, + }, + }, nil + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + selector: labels.Everything(), + metricSelector: labels.Everything(), + }, + } + for _, test := range tests { + t.Run(test.description, func(t *testing.T) { + info, time, err := test.client.GetRawMetric(test.metricName, test.namespace, test.selector, test.metricSelector) + if !cmp.Equal(&err, &test.expectedErr, equateErrorMessage) { + t.Errorf("error mismatch (-want +got):\n%s", cmp.Diff(test.expectedErr, err, equateErrorMessage)) + return + } + if !cmp.Equal(test.expectedInfo, info) { + t.Errorf("info mismatch (-want +got):\n%s", cmp.Diff(test.expectedInfo, info)) + } + if !cmp.Equal(test.expectedTime, time) { + t.Errorf("time mismatch (-want +got):\n%s", cmp.Diff(test.expectedTime, time)) + } + }) + } +} + +func Test_GetObjectMetric(t *testing.T) { + equateErrorMessage := cmp.Comparer(func(x, y error) bool { + if x == nil || y == nil { + return x == nil && y == nil + } + return x.Error() == y.Error() + }) + + var tests = []struct { + description string + expectedMetric int64 + expectedTime time.Time + expectedErr error + client metrics.RESTClient + metricName string + namespace string + objectRef *autoscalingv2.CrossVersionObjectReference + metricSelector labels.Selector + }{ + { + description: "Fail, fail to fetch namespaced metrics", + expectedMetric: 0, + expectedTime: time.Time{}, + expectedErr: errors.New("unable to fetch metrics from custom metrics API: fail to get deployment metrics"), + client: metrics.RESTClient{ + CustomMetricsClient: &custom_metricsfake.FakeCustomMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "*", + Verb: "get", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, errors.New("fail to get deployment metrics") + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + objectRef: &autoscalingv2.CrossVersionObjectReference{ + APIVersion: "apps/v1", + Kind: "Deployment", + Name: "test", + }, + metricSelector: labels.Everything(), + }, + { + description: "Fail, fail to fetch root scoped metrics", + expectedMetric: 0, + expectedTime: time.Time{}, + expectedErr: errors.New("unable to fetch metrics from custom metrics API: fail to get deployment metrics"), + client: metrics.RESTClient{ + CustomMetricsClient: &custom_metricsfake.FakeCustomMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "*", + Verb: "get", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, errors.New("fail to get deployment metrics") + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + objectRef: &autoscalingv2.CrossVersionObjectReference{ + APIVersion: "v1", + Kind: "Namespace", + Name: "test", + }, + metricSelector: labels.Everything(), + }, + { + description: "Success, return namespaced metric", + expectedMetric: 10000, + expectedTime: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + expectedErr: nil, + client: metrics.RESTClient{ + CustomMetricsClient: &custom_metricsfake.FakeCustomMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "*", + Verb: "get", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &custom_metricsv1beta2.MetricValueList{ + Items: []custom_metricsv1beta2.MetricValue{ + { + DescribedObject: v1.ObjectReference{ + Name: "test", + }, + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + }, + Value: *resource.NewQuantity(10, resource.DecimalSI), + }, + }, + }, nil + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + objectRef: &autoscalingv2.CrossVersionObjectReference{ + APIVersion: "apps/v1", + Kind: "Deployment", + Name: "test", + }, + metricSelector: labels.Everything(), + }, + { + description: "Success, return root scoped metric", + expectedMetric: 10000, + expectedTime: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + expectedErr: nil, + client: metrics.RESTClient{ + CustomMetricsClient: &custom_metricsfake.FakeCustomMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "*", + Verb: "get", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &custom_metricsv1beta2.MetricValueList{ + Items: []custom_metricsv1beta2.MetricValue{ + { + DescribedObject: v1.ObjectReference{ + Name: "test", + }, + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + }, + Value: *resource.NewQuantity(10, resource.DecimalSI), + }, + }, + }, nil + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + objectRef: &autoscalingv2.CrossVersionObjectReference{ + APIVersion: "v1", + Kind: "Namespace", + Name: "test", + }, + metricSelector: labels.Everything(), + }, + } + for _, test := range tests { + t.Run(test.description, func(t *testing.T) { + metric, time, err := test.client.GetObjectMetric(test.metricName, test.namespace, test.objectRef, test.metricSelector) + if !cmp.Equal(&err, &test.expectedErr, equateErrorMessage) { + t.Errorf("error mismatch (-want +got):\n%s", cmp.Diff(test.expectedErr, err, equateErrorMessage)) + return + } + if !cmp.Equal(test.expectedMetric, metric) { + t.Errorf("info mismatch (-want +got):\n%s", cmp.Diff(test.expectedMetric, metric)) + } + if !cmp.Equal(test.expectedTime, time) { + t.Errorf("time mismatch (-want +got):\n%s", cmp.Diff(test.expectedTime, time)) + } + }) + } +} + +func Test_GetExternalMetric(t *testing.T) { + equateErrorMessage := cmp.Comparer(func(x, y error) bool { + if x == nil || y == nil { + return x == nil && y == nil + } + return x.Error() == y.Error() + }) + + var tests = []struct { + description string + expectedMetrics []int64 + expectedTime time.Time + expectedErr error + client metrics.RESTClient + metricName string + namespace string + selector labels.Selector + }{ + { + description: "Fail, fail to fetch metrics", + expectedMetrics: []int64{}, + expectedTime: time.Time{}, + expectedErr: errors.New("unable to fetch metrics from external metrics API: Fail to get external metrics"), + client: metrics.RESTClient{ + ExternalMetricsClient: &external_metricsfake.FakeExternalMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "*", + Verb: "*", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, errors.New("Fail to get external metrics") + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + selector: labels.Everything(), + }, + { + description: "Fail, no metrics returned", + expectedMetrics: nil, + expectedTime: time.Time{}, + expectedErr: errors.New("no metrics returned from external metrics API"), + client: metrics.RESTClient{ + ExternalMetricsClient: &external_metricsfake.FakeExternalMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "*", + Verb: "*", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &external_metricsv1beta1.ExternalMetricValueList{}, nil + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + selector: labels.Everything(), + }, + { + description: "Success, single metric", + expectedMetrics: []int64{10000}, + expectedTime: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + expectedErr: nil, + client: metrics.RESTClient{ + ExternalMetricsClient: &external_metricsfake.FakeExternalMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "*", + Verb: "*", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &external_metricsv1beta1.ExternalMetricValueList{ + Items: []external_metricsv1beta1.ExternalMetricValue{ + { + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + }, + Value: *resource.NewQuantity(10, resource.DecimalSI), + }, + }, + }, nil + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + selector: labels.Everything(), + }, + { + description: "Success, single metric", + expectedMetrics: []int64{10000, 15000, 20000}, + expectedTime: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + expectedErr: nil, + client: metrics.RESTClient{ + ExternalMetricsClient: &external_metricsfake.FakeExternalMetricsClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "*", + Verb: "*", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &external_metricsv1beta1.ExternalMetricValueList{ + Items: []external_metricsv1beta1.ExternalMetricValue{ + { + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 7, 10, 30, 0, 5, time.UTC), + }, + Value: *resource.NewQuantity(10, resource.DecimalSI), + }, + { + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 8, 10, 30, 0, 5, time.UTC), + }, + Value: *resource.NewQuantity(15, resource.DecimalSI), + }, + { + Timestamp: metav1.Time{ + Time: time.Date(1998, 3, 9, 10, 30, 0, 5, time.UTC), + }, + Value: *resource.NewQuantity(20, resource.DecimalSI), + }, + }, + }, nil + }, + }, + }, + }, + }, + }, + metricName: "test", + namespace: "test", + selector: labels.Everything(), + }, + } + for _, test := range tests { + t.Run(test.description, func(t *testing.T) { + metrics, time, err := test.client.GetExternalMetric(test.metricName, test.namespace, test.selector) + if !cmp.Equal(&err, &test.expectedErr, equateErrorMessage) { + t.Errorf("error mismatch (-want +got):\n%s", cmp.Diff(test.expectedErr, err, equateErrorMessage)) + return + } + if !cmp.Equal(test.expectedMetrics, metrics) { + t.Errorf("info mismatch (-want +got):\n%s", cmp.Diff(test.expectedMetrics, metrics)) + } + if !cmp.Equal(test.expectedTime, time) { + t.Errorf("time mismatch (-want +got):\n%s", cmp.Diff(test.expectedTime, time)) + } + }) + } +} diff --git a/internal/k8smetricget/objectget/objectget.go b/internal/k8smetricget/objectget/objectget.go index efac4d4..92b2a09 100644 --- a/internal/k8smetricget/objectget/objectget.go +++ b/internal/k8smetricget/objectget/objectget.go @@ -30,12 +30,12 @@ package objectget import ( "fmt" + metricsclient "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/podutil" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/object" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/value" autoscaling "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/labels" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) // Gatherer (Object) allows retrieval of object metrics. @@ -46,7 +46,7 @@ type Gatherer interface { // Gather (Object) provides functionality for retrieving metrics for object metric specs. type Gather struct { - MetricsClient metricsclient.MetricsClient + MetricsClient metricsclient.Client PodReadyCounter podutil.PodReadyCounter } diff --git a/internal/k8smetricget/objectget/objectget_test.go b/internal/k8smetricget/objectget/objectget_test.go index 25c8b41..4f0e34a 100644 --- a/internal/k8smetricget/objectget/objectget_test.go +++ b/internal/k8smetricget/objectget/objectget_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Custom Pod Autoscaler Authors. +Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,14 +23,13 @@ import ( "github.com/google/go-cmp/cmp" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/fake" + metricsclient "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/objectget" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/podutil" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/object" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/value" - "k8s.io/api/autoscaling/v2beta2" - autoscaling "k8s.io/api/autoscaling/v2beta2" + autoscalingv2 "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/labels" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) func int64Ptr(i int64) *int64 { @@ -49,11 +48,11 @@ func TestGetMetric(t *testing.T) { description string expected *object.Metric expectedErr error - metricsClient metricsclient.MetricsClient + metricsClient metricsclient.Client podReadyCounter podutil.PodReadyCounter metricName string namespace string - objectRef *v2beta2.CrossVersionObjectReference + objectRef *autoscalingv2.CrossVersionObjectReference selector labels.Selector metricSelector labels.Selector }{ @@ -62,14 +61,14 @@ func TestGetMetric(t *testing.T) { nil, errors.New("unable to get metric test-metric: on test-namespace : fail to get metric"), &fake.MetricClient{ - GetObjectMetricReactor: func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { + GetObjectMetricReactor: func(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { return 0, time.Time{}, errors.New("fail to get metric") }, }, nil, "test-metric", "test-namespace", - &autoscaling.CrossVersionObjectReference{}, + &autoscalingv2.CrossVersionObjectReference{}, nil, nil, }, @@ -78,7 +77,7 @@ func TestGetMetric(t *testing.T) { nil, errors.New("unable to calculate ready pods: fail to get ready pods"), &fake.MetricClient{ - GetObjectMetricReactor: func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { + GetObjectMetricReactor: func(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { return 0, time.Time{}, nil }, }, @@ -89,7 +88,7 @@ func TestGetMetric(t *testing.T) { }, "test-metric", "test-namespace", - &autoscaling.CrossVersionObjectReference{}, + &autoscalingv2.CrossVersionObjectReference{}, nil, nil, }, @@ -103,7 +102,7 @@ func TestGetMetric(t *testing.T) { }, nil, &fake.MetricClient{ - GetObjectMetricReactor: func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { + GetObjectMetricReactor: func(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { return 5, time.Time{}, nil }, }, @@ -114,7 +113,7 @@ func TestGetMetric(t *testing.T) { }, "test-metric", "test-namespace", - &autoscaling.CrossVersionObjectReference{}, + &autoscalingv2.CrossVersionObjectReference{}, nil, nil, }, @@ -149,11 +148,11 @@ func TestGetPerPodMetric(t *testing.T) { description string expected *object.Metric expectedErr error - metricsClient metricsclient.MetricsClient + metricsClient metricsclient.Client podReadyCounter podutil.PodReadyCounter metricName string namespace string - objectRef *v2beta2.CrossVersionObjectReference + objectRef *autoscalingv2.CrossVersionObjectReference metricSelector labels.Selector }{ { @@ -161,14 +160,14 @@ func TestGetPerPodMetric(t *testing.T) { nil, errors.New("unable to get metric test-metric: on test-namespace /fail to get metric"), &fake.MetricClient{ - GetObjectMetricReactor: func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { + GetObjectMetricReactor: func(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { return 0, time.Time{}, errors.New("fail to get metric") }, }, nil, "test-metric", "test-namespace", - &autoscaling.CrossVersionObjectReference{}, + &autoscalingv2.CrossVersionObjectReference{}, nil, }, { @@ -180,14 +179,14 @@ func TestGetPerPodMetric(t *testing.T) { }, nil, &fake.MetricClient{ - GetObjectMetricReactor: func(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { + GetObjectMetricReactor: func(metricName string, namespace string, objectRef *autoscalingv2.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) { return 5, time.Time{}, nil }, }, nil, "test-metric", "test-namespace", - &autoscaling.CrossVersionObjectReference{}, + &autoscalingv2.CrossVersionObjectReference{}, nil, }, } diff --git a/internal/k8smetricget/podsget/pods.go b/internal/k8smetricget/podsget/podsget.go similarity index 91% rename from internal/k8smetricget/podsget/pods.go rename to internal/k8smetricget/podsget/podsget.go index c1ff85f..68e4276 100644 --- a/internal/k8smetricget/podsget/pods.go +++ b/internal/k8smetricget/podsget/podsget.go @@ -13,7 +13,7 @@ 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. -Modifications Copyright 2021 The Custom Pod Autoscaler Authors. +Modifications Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -30,12 +30,12 @@ package podsget import ( "fmt" + metricsclient "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/podutil" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/pods" - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" corelisters "k8s.io/client-go/listers/core/v1" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) // Gatherer (Pods) allows retrieval of pods metrics. @@ -45,7 +45,7 @@ type Gatherer interface { // Gather (Pods) provides functionality for retrieving metrics for pods metric specs. type Gather struct { - MetricsClient metricsclient.MetricsClient + MetricsClient metricsclient.Client PodLister corelisters.PodLister } @@ -73,7 +73,7 @@ func (c *Gather) GetMetric(metricName string, namespace string, selector labels. } // Remove missing pod metrics - readyPodCount, _, missingPods := podutil.GroupPods(podList, metrics, v1.ResourceName(""), 0, 0) + readyPodCount, _, missingPods := podutil.GroupPods(podList, metrics, corev1.ResourceName(""), 0, 0) return &pods.Metric{ PodMetricsInfo: metrics, diff --git a/internal/k8smetricget/podsget/pods_test.go b/internal/k8smetricget/podsget/podsget_test.go similarity index 83% rename from internal/k8smetricget/podsget/pods_test.go rename to internal/k8smetricget/podsget/podsget_test.go index b1979e5..a5acfd8 100644 --- a/internal/k8smetricget/podsget/pods_test.go +++ b/internal/k8smetricget/podsget/podsget_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Custom Pod Autoscaler Authors. +Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,14 +23,15 @@ import ( "github.com/google/go-cmp/cmp" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/fake" + metricsclient "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/podsget" + "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/podmetrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/pods" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" corelisters "k8s.io/client-go/listers/core/v1" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) func TestGetMetric(t *testing.T) { @@ -45,7 +46,7 @@ func TestGetMetric(t *testing.T) { description string expected *pods.Metric expectedErr error - metricsClient metricsclient.MetricsClient + metricsClient metricsclient.Client podLister corelisters.PodLister metricName string namespace string @@ -57,7 +58,7 @@ func TestGetMetric(t *testing.T) { nil, errors.New("unable to get metric test-metric: fail to get metric"), &fake.MetricClient{ - GetRawMetricReactor: func(metricName, namespace string, selector, metricSelector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error) { + GetRawMetricReactor: func(metricName, namespace string, selector, metricSelector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { return nil, time.Time{}, errors.New("fail to get metric") }, }, @@ -72,7 +73,7 @@ func TestGetMetric(t *testing.T) { nil, errors.New("unable to get pods while calculating replica count: fail to get pods"), &fake.MetricClient{ - GetRawMetricReactor: func(metricName, namespace string, selector, metricSelector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error) { + GetRawMetricReactor: func(metricName, namespace string, selector, metricSelector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { return nil, time.Time{}, nil }, }, @@ -99,9 +100,9 @@ func TestGetMetric(t *testing.T) { }, nil, &fake.MetricClient{ - GetRawMetricReactor: func(metricName, namespace string, selector, metricSelector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error) { - return metricsclient.PodMetricsInfo{ - "test-pod": metricsclient.PodMetric{}, + GetRawMetricReactor: func(metricName, namespace string, selector, metricSelector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { + return podmetrics.MetricsInfo{ + "test-pod": podmetrics.Metric{}, }, time.Time{}, nil }, }, @@ -128,19 +129,19 @@ func TestGetMetric(t *testing.T) { "missing-pod-1": {}, "missing-pod-2": {}, }, - PodMetricsInfo: metricsclient.PodMetricsInfo{ - "ready-pod-1": metricsclient.PodMetric{}, - "ready-pod-2": metricsclient.PodMetric{}, - "ready-pod-3": metricsclient.PodMetric{}, + PodMetricsInfo: podmetrics.MetricsInfo{ + "ready-pod-1": podmetrics.Metric{}, + "ready-pod-2": podmetrics.Metric{}, + "ready-pod-3": podmetrics.Metric{}, }, }, nil, &fake.MetricClient{ - GetRawMetricReactor: func(metricName, namespace string, selector, metricSelector labels.Selector) (metricsclient.PodMetricsInfo, time.Time, error) { - return metricsclient.PodMetricsInfo{ - "ready-pod-1": metricsclient.PodMetric{}, - "ready-pod-2": metricsclient.PodMetric{}, - "ready-pod-3": metricsclient.PodMetric{}, + GetRawMetricReactor: func(metricName, namespace string, selector, metricSelector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { + return podmetrics.MetricsInfo{ + "ready-pod-1": podmetrics.Metric{}, + "ready-pod-2": podmetrics.Metric{}, + "ready-pod-3": podmetrics.Metric{}, }, time.Time{}, nil }, }, diff --git a/internal/k8smetricget/podutil/podutil.go b/internal/k8smetricget/podutil/podutil.go index b41200b..2a45429 100644 --- a/internal/k8smetricget/podutil/podutil.go +++ b/internal/k8smetricget/podutil/podutil.go @@ -13,7 +13,7 @@ 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. -Modifications Copyright 2021 The Custom Pod Autoscaler Authors. +Modifications Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -31,12 +31,11 @@ import ( "fmt" "time" - v1 "k8s.io/api/core/v1" + "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/podmetrics" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" corelisters "k8s.io/client-go/listers/core/v1" - podutil "k8s.io/kubernetes/pkg/api/v1/pod" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) // PodReadyCounter provides a way to count number of ready pods @@ -60,7 +59,7 @@ func (c *PodReadyCount) GetReadyPodsCount(namespace string, selector labels.Sele // Count number of ready pods readyPodCount := int64(0) for _, pod := range podList { - if pod.Status.Phase == v1.PodRunning && podutil.IsPodReady(pod) { + if pod.Status.Phase == corev1.PodRunning && isPodReady(pod) { readyPodCount++ } } @@ -69,15 +68,15 @@ func (c *PodReadyCount) GetReadyPodsCount(namespace string, selector labels.Sele } // GroupPods groups pods into ready, missing and ignored based on PodMetricsInfo and resource provided -func GroupPods(pods []*v1.Pod, metrics metricsclient.PodMetricsInfo, resource v1.ResourceName, cpuInitializationPeriod, delayOfInitialReadinessStatus time.Duration) (readyPodCount int, ignoredPods sets.String, missingPods sets.String) { +func GroupPods(pods []*corev1.Pod, metrics podmetrics.MetricsInfo, resource corev1.ResourceName, cpuInitializationPeriod, delayOfInitialReadinessStatus time.Duration) (readyPodCount int, ignoredPods sets.String, missingPods sets.String) { missingPods = sets.NewString() ignoredPods = sets.NewString() for _, pod := range pods { - if pod.DeletionTimestamp != nil || pod.Status.Phase == v1.PodFailed { + if pod.DeletionTimestamp != nil || pod.Status.Phase == corev1.PodFailed { continue } // Pending pods are ignored. - if pod.Status.Phase == v1.PodPending { + if pod.Status.Phase == corev1.PodPending { ignoredPods.Insert(pod.Name) continue } @@ -88,19 +87,19 @@ func GroupPods(pods []*v1.Pod, metrics metricsclient.PodMetricsInfo, resource v1 continue } // Unready pods are ignored. - if resource == v1.ResourceCPU { + if resource == corev1.ResourceCPU { var ignorePod bool - _, condition := podutil.GetPodCondition(&pod.Status, v1.PodReady) + _, condition := getPodCondition(pod.Status, corev1.PodReady) if condition == nil || pod.Status.StartTime == nil { ignorePod = true } else { // Pod still within possible initialisation period. if pod.Status.StartTime.Add(cpuInitializationPeriod).After(time.Now()) { // Ignore sample if pod is unready or one window of metric wasn't collected since last state transition. - ignorePod = condition.Status == v1.ConditionFalse || metric.Timestamp.Before(condition.LastTransitionTime.Time.Add(metric.Window)) + ignorePod = condition.Status == corev1.ConditionFalse || metric.Timestamp.Before(condition.LastTransitionTime.Time.Add(metric.Window)) } else { // Ignore metric if pod is unready and it has never been ready. - ignorePod = condition.Status == v1.ConditionFalse && pod.Status.StartTime.Add(delayOfInitialReadinessStatus).After(condition.LastTransitionTime.Time) + ignorePod = condition.Status == corev1.ConditionFalse && pod.Status.StartTime.Add(delayOfInitialReadinessStatus).After(condition.LastTransitionTime.Time) } } if ignorePod { @@ -114,7 +113,7 @@ func GroupPods(pods []*v1.Pod, metrics metricsclient.PodMetricsInfo, resource v1 } // CalculatePodRequests calculates pod resource requests for a slice of pods -func CalculatePodRequests(pods []*v1.Pod, resource v1.ResourceName) (map[string]int64, error) { +func CalculatePodRequests(pods []*corev1.Pod, resource corev1.ResourceName) (map[string]int64, error) { requests := make(map[string]int64, len(pods)) for _, pod := range pods { podSum := int64(0) @@ -131,8 +130,29 @@ func CalculatePodRequests(pods []*v1.Pod, resource v1.ResourceName) (map[string] } // RemoveMetricsForPods removes the pods provided from the PodMetricsInfo provided -func RemoveMetricsForPods(metrics metricsclient.PodMetricsInfo, pods sets.String) { +func RemoveMetricsForPods(metrics podmetrics.MetricsInfo, pods sets.String) { for _, pod := range pods.UnsortedList() { delete(metrics, pod) } } + +// IsPodReady returns true if a pod is ready; false otherwise. +func isPodReady(pod *corev1.Pod) bool { + _, condition := getPodCondition(pod.Status, corev1.PodReady) + return condition != nil && condition.Status == corev1.ConditionTrue +} + +// GetPodCondition extracts the provided condition from the given status and returns that. +// Returns nil and -1 if the condition is not present, and the index of the located condition. +func getPodCondition(status corev1.PodStatus, conditionType corev1.PodConditionType) (int, *corev1.PodCondition) { + conditions := status.Conditions + if conditions == nil { + return -1, nil + } + for i := range conditions { + if conditions[i].Type == conditionType { + return i, &conditions[i] + } + } + return -1, nil +} diff --git a/internal/k8smetricget/podutil/podutil_test.go b/internal/k8smetricget/podutil/podutil_test.go index 7963560..93d6f3e 100644 --- a/internal/k8smetricget/podutil/podutil_test.go +++ b/internal/k8smetricget/podutil/podutil_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Custom Pod Autoscaler Authors. +Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,14 +24,13 @@ import ( "github.com/google/go-cmp/cmp" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/fake" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/podutil" + "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/podmetrics" corev1 "k8s.io/api/core/v1" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" corelisters "k8s.io/client-go/listers/core/v1" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) func TestPodReadyCount_GetReadyPodsCount(t *testing.T) { @@ -199,6 +198,40 @@ func TestPodReadyCount_GetReadyPodsCount(t *testing.T) { "test-namespace", nil, }, + { + "1 ready pod, 1 no status provided, success", + 1, + nil, + &fake.PodLister{ + PodsReactor: func(namespace string) corelisters.PodNamespaceLister { + return &fake.PodNamespaceLister{ + ListReactor: func(selector labels.Selector) (ret []*corev1.Pod, err error) { + return []*corev1.Pod{ + { + Status: corev1.PodStatus{ + Phase: corev1.PodRunning, + Conditions: []corev1.PodCondition{ + { + Type: corev1.PodReady, + Status: corev1.ConditionTrue, + }, + }, + }, + }, + { + Status: corev1.PodStatus{ + Phase: corev1.PodRunning, + Conditions: []corev1.PodCondition{}, + }, + }, + }, nil + }, + } + }, + }, + "test-namespace", + nil, + }, } for _, test := range tests { t.Run(test.description, func(t *testing.T) { @@ -221,7 +254,7 @@ func TestGroupPods(t *testing.T) { tests := []struct { name string pods []*corev1.Pod - metrics metricsclient.PodMetricsInfo + metrics podmetrics.MetricsInfo resource corev1.ResourceName expectReadyPodCount int expectIgnoredPods sets.String @@ -230,7 +263,7 @@ func TestGroupPods(t *testing.T) { { "void", []*corev1.Pod{}, - metricsclient.PodMetricsInfo{}, + podmetrics.MetricsInfo{}, corev1.ResourceCPU, 0, sets.NewString(), @@ -248,8 +281,8 @@ func TestGroupPods(t *testing.T) { }, }, }, - metricsclient.PodMetricsInfo{ - "bentham": metricsclient.PodMetric{Value: 1, Timestamp: time.Now(), Window: time.Minute}, + podmetrics.MetricsInfo{ + "bentham": podmetrics.Metric{Value: 1, Timestamp: time.Now(), Window: time.Minute}, }, corev1.ResourceMemory, 1, @@ -271,8 +304,8 @@ func TestGroupPods(t *testing.T) { }, }, }, - metricsclient.PodMetricsInfo{ - "lucretius": metricsclient.PodMetric{Value: 1}, + podmetrics.MetricsInfo{ + "lucretius": podmetrics.Metric{Value: 1}, }, corev1.ResourceCPU, 0, @@ -286,7 +319,7 @@ func TestGroupPods(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "bentham", }, - Status: v1.PodStatus{ + Status: corev1.PodStatus{ Phase: corev1.PodSucceeded, StartTime: &metav1.Time{ Time: time.Now().Add(-1 * time.Minute), @@ -301,8 +334,8 @@ func TestGroupPods(t *testing.T) { }, }, }, - metricsclient.PodMetricsInfo{ - "bentham": metricsclient.PodMetric{Value: 1, Timestamp: time.Now(), Window: 30 * time.Second}, + podmetrics.MetricsInfo{ + "bentham": podmetrics.Metric{Value: 1, Timestamp: time.Now(), Window: 30 * time.Second}, }, corev1.ResourceCPU, 1, @@ -331,8 +364,8 @@ func TestGroupPods(t *testing.T) { }, }, }, - metricsclient.PodMetricsInfo{ - "bentham": metricsclient.PodMetric{Value: 1, Timestamp: time.Now(), Window: 60 * time.Second}, + podmetrics.MetricsInfo{ + "bentham": podmetrics.Metric{Value: 1, Timestamp: time.Now(), Window: 60 * time.Second}, }, corev1.ResourceCPU, 0, @@ -361,10 +394,10 @@ func TestGroupPods(t *testing.T) { }, }, }, - metricsclient.PodMetricsInfo{ - "lucretius": metricsclient.PodMetric{Value: 1}, + podmetrics.MetricsInfo{ + "lucretius": podmetrics.Metric{Value: 1}, }, - v1.ResourceCPU, + corev1.ResourceCPU, 0, sets.NewString("lucretius"), sets.NewString(), @@ -381,7 +414,7 @@ func TestGroupPods(t *testing.T) { StartTime: &metav1.Time{ Time: time.Now().Add(-3 * time.Minute), }, - Conditions: []v1.PodCondition{ + Conditions: []corev1.PodCondition{ { Type: corev1.PodReady, LastTransitionTime: metav1.Time{Time: time.Now().Add(-3 * time.Minute)}, @@ -391,8 +424,8 @@ func TestGroupPods(t *testing.T) { }, }, }, - metricsclient.PodMetricsInfo{ - "bentham": metricsclient.PodMetric{Value: 1, Timestamp: time.Now().Add(-2 * time.Minute), Window: time.Minute}, + podmetrics.MetricsInfo{ + "bentham": podmetrics.Metric{Value: 1, Timestamp: time.Now().Add(-2 * time.Minute), Window: time.Minute}, }, corev1.ResourceCPU, 1, @@ -422,8 +455,8 @@ func TestGroupPods(t *testing.T) { }, }, }, - metricsclient.PodMetricsInfo{ - "lucretius": metricsclient.PodMetric{Value: 1}, + podmetrics.MetricsInfo{ + "lucretius": podmetrics.Metric{Value: 1}, }, corev1.ResourceCPU, 1, @@ -452,8 +485,8 @@ func TestGroupPods(t *testing.T) { }, }, }, - metricsclient.PodMetricsInfo{ - "lucretius": metricsclient.PodMetric{Value: 1}, + podmetrics.MetricsInfo{ + "lucretius": podmetrics.Metric{Value: 1}, }, corev1.ResourceCPU, 1, @@ -475,8 +508,8 @@ func TestGroupPods(t *testing.T) { }, }, }, - metricsclient.PodMetricsInfo{}, - v1.ResourceCPU, + podmetrics.MetricsInfo{}, + corev1.ResourceCPU, 0, sets.NewString(), sets.NewString("epicurus"), @@ -525,11 +558,11 @@ func TestGroupPods(t *testing.T) { }, }, }, - metricsclient.PodMetricsInfo{ - "lucretius": metricsclient.PodMetric{Value: 1}, - "niccolo": metricsclient.PodMetric{Value: 1}, + podmetrics.MetricsInfo{ + "lucretius": podmetrics.Metric{Value: 1}, + "niccolo": podmetrics.Metric{Value: 1}, }, - v1.ResourceCPU, + corev1.ResourceCPU, 1, sets.NewString("lucretius"), sets.NewString("epicurus"), @@ -546,7 +579,7 @@ func TestGroupPods(t *testing.T) { }, }, }, - metrics: metricsclient.PodMetricsInfo{}, + metrics: podmetrics.MetricsInfo{}, resource: corev1.ResourceCPU, expectReadyPodCount: 0, expectIgnoredPods: sets.NewString("unscheduled"), @@ -561,7 +594,7 @@ func TestGroupPods(t *testing.T) { }, }, }, - metrics: metricsclient.PodMetricsInfo{}, + metrics: podmetrics.MetricsInfo{}, resource: corev1.ResourceCPU, expectReadyPodCount: 0, expectIgnoredPods: sets.NewString(), @@ -728,32 +761,32 @@ func TestCalculatePodRequests(t *testing.T) { func TestRemoveMetricsForPods(t *testing.T) { var tests = []struct { description string - expected metricsclient.PodMetricsInfo - metrics metricsclient.PodMetricsInfo + expected podmetrics.MetricsInfo + metrics podmetrics.MetricsInfo pods sets.String }{ { "No pods to remove", - metricsclient.PodMetricsInfo{ - "test": metricsclient.PodMetric{}, + podmetrics.MetricsInfo{ + "test": podmetrics.Metric{}, }, - metricsclient.PodMetricsInfo{ - "test": metricsclient.PodMetric{}, + podmetrics.MetricsInfo{ + "test": podmetrics.Metric{}, }, nil, }, { "Remove 3 pods, leave 2", - metricsclient.PodMetricsInfo{ - "test3": metricsclient.PodMetric{}, - "test4": metricsclient.PodMetric{}, - }, - metricsclient.PodMetricsInfo{ - "test": metricsclient.PodMetric{}, - "test1": metricsclient.PodMetric{}, - "test2": metricsclient.PodMetric{}, - "test3": metricsclient.PodMetric{}, - "test4": metricsclient.PodMetric{}, + podmetrics.MetricsInfo{ + "test3": podmetrics.Metric{}, + "test4": podmetrics.Metric{}, + }, + podmetrics.MetricsInfo{ + "test": podmetrics.Metric{}, + "test1": podmetrics.Metric{}, + "test2": podmetrics.Metric{}, + "test3": podmetrics.Metric{}, + "test4": podmetrics.Metric{}, }, sets.String{ "test": {}, diff --git a/internal/k8smetricget/resourceget/resourceget.go b/internal/k8smetricget/resourceget/resourceget.go index 03377ec..e0131c2 100644 --- a/internal/k8smetricget/resourceget/resourceget.go +++ b/internal/k8smetricget/resourceget/resourceget.go @@ -13,7 +13,7 @@ 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. -Modifications Copyright 2021 The Custom Pod Autoscaler Authors. +Modifications Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -31,12 +31,12 @@ import ( "fmt" "time" + metricsclient "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/podutil" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/resource" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" corelisters "k8s.io/client-go/listers/core/v1" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) // Gatherer (Resource) allows retrieval of resource metrics. @@ -47,7 +47,7 @@ type Gatherer interface { // Gather (Resource) provides functionality for retrieving metrics for resource metric specs. type Gather struct { - MetricsClient metricsclient.MetricsClient + MetricsClient metricsclient.Client PodLister corelisters.PodLister CPUInitializationPeriod time.Duration DelayOfInitialReadinessStatus time.Duration @@ -56,7 +56,7 @@ type Gather struct { // GetMetric retrieves a resource metric func (c *Gather) GetMetric(resourceName corev1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error) { // Get metrics - metrics, timestamp, err := c.MetricsClient.GetResourceMetric(resourceName, namespace, selector, "") + metrics, timestamp, err := c.MetricsClient.GetResourceMetric(resourceName, namespace, selector) if err != nil { return nil, fmt.Errorf("unable to get metrics for resource %s: %w", resourceName, err) } @@ -69,7 +69,7 @@ func (c *Gather) GetMetric(resourceName corev1.ResourceName, namespace string, s totalPods := len(podList) if totalPods == 0 { - return nil, fmt.Errorf("No pods returned by selector while calculating replica count") + return nil, fmt.Errorf("no pods returned by selector while calculating replica count") } // Remove missing pod metrics @@ -96,7 +96,7 @@ func (c *Gather) GetMetric(resourceName corev1.ResourceName, namespace string, s // GetRawMetric retrieves a a raw resource metric func (c *Gather) GetRawMetric(resourceName corev1.ResourceName, namespace string, selector labels.Selector) (*resource.Metric, error) { // Get metrics - metrics, timestamp, err := c.MetricsClient.GetResourceMetric(resourceName, namespace, selector, "") + metrics, timestamp, err := c.MetricsClient.GetResourceMetric(resourceName, namespace, selector) if err != nil { return nil, fmt.Errorf("unable to get metrics for resource %s: %w", resourceName, err) } diff --git a/internal/k8smetricget/resourceget/resourceget_test.go b/internal/k8smetricget/resourceget/resourceget_test.go index 3a6f7ee..bf42175 100644 --- a/internal/k8smetricget/resourceget/resourceget_test.go +++ b/internal/k8smetricget/resourceget/resourceget_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Custom Pod Autoscaler Authors. +Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,7 +23,9 @@ import ( "github.com/google/go-cmp/cmp" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/fake" + metricsclient "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/resourceget" + "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/podmetrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/resource" corev1 "k8s.io/api/core/v1" k8sresource "k8s.io/apimachinery/pkg/api/resource" @@ -31,7 +33,6 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" corelisters "k8s.io/client-go/listers/core/v1" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) func TestGetMetric(t *testing.T) { @@ -46,7 +47,7 @@ func TestGetMetric(t *testing.T) { description string expected *resource.Metric expectedErr error - metricsClient metricsclient.MetricsClient + metricsClient metricsclient.Client podLister corelisters.PodLister cpuInitializationPeriod time.Duration delayOfInitialReadinessStatus time.Duration @@ -59,7 +60,7 @@ func TestGetMetric(t *testing.T) { nil, errors.New("unable to get metrics for resource test-metric: fail to get metric"), &fake.MetricClient{ - GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { + GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { return nil, time.Time{}, errors.New("fail to get metric") }, }, @@ -75,7 +76,7 @@ func TestGetMetric(t *testing.T) { nil, errors.New("unable to get pods while calculating replica count: fail to get pods"), &fake.MetricClient{ - GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { + GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { return nil, time.Time{}, nil }, }, @@ -97,9 +98,9 @@ func TestGetMetric(t *testing.T) { { "Fail no pods", nil, - errors.New("No pods returned by selector while calculating replica count"), + errors.New("no pods returned by selector while calculating replica count"), &fake.MetricClient{ - GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { + GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { return nil, time.Time{}, nil }, }, @@ -123,7 +124,7 @@ func TestGetMetric(t *testing.T) { nil, errors.New("missing request for test-metric"), &fake.MetricClient{ - GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { + GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { return nil, time.Time{}, nil }, }, @@ -171,29 +172,29 @@ func TestGetMetric(t *testing.T) { "ready-pod-2": 0, "ready-pod-3": 0, }, - PodMetricsInfo: metricsclient.PodMetricsInfo{ - "ready-pod-1": metricsclient.PodMetric{ + PodMetricsInfo: podmetrics.MetricsInfo{ + "ready-pod-1": podmetrics.Metric{ Value: 1, }, - "ready-pod-2": metricsclient.PodMetric{ + "ready-pod-2": podmetrics.Metric{ Value: 2, }, - "ready-pod-3": metricsclient.PodMetric{ + "ready-pod-3": podmetrics.Metric{ Value: 3, }, }, }, nil, &fake.MetricClient{ - GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { - return metricsclient.PodMetricsInfo{ - "ready-pod-1": metricsclient.PodMetric{ + GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { + return podmetrics.MetricsInfo{ + "ready-pod-1": podmetrics.Metric{ Value: 1, }, - "ready-pod-2": metricsclient.PodMetric{ + "ready-pod-2": podmetrics.Metric{ Value: 2, }, - "ready-pod-3": metricsclient.PodMetric{ + "ready-pod-3": podmetrics.Metric{ Value: 3, }, }, time.Time{}, nil @@ -273,35 +274,35 @@ func TestGetMetric(t *testing.T) { "ignore-pod-1": 0, "ignore-pod-2": 0, }, - PodMetricsInfo: metricsclient.PodMetricsInfo{ - "ready-pod-1": metricsclient.PodMetric{ + PodMetricsInfo: podmetrics.MetricsInfo{ + "ready-pod-1": podmetrics.Metric{ Value: 1, }, - "ready-pod-2": metricsclient.PodMetric{ + "ready-pod-2": podmetrics.Metric{ Value: 2, }, - "ready-pod-3": metricsclient.PodMetric{ + "ready-pod-3": podmetrics.Metric{ Value: 3, }, }, }, nil, &fake.MetricClient{ - GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { - return metricsclient.PodMetricsInfo{ - "ready-pod-1": metricsclient.PodMetric{ + GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { + return podmetrics.MetricsInfo{ + "ready-pod-1": podmetrics.Metric{ Value: 1, }, - "ready-pod-2": metricsclient.PodMetric{ + "ready-pod-2": podmetrics.Metric{ Value: 2, }, - "ready-pod-3": metricsclient.PodMetric{ + "ready-pod-3": podmetrics.Metric{ Value: 3, }, - "ignore-pod-1": metricsclient.PodMetric{ + "ignore-pod-1": podmetrics.Metric{ Value: 4, }, - "ignore-pod-2": metricsclient.PodMetric{ + "ignore-pod-2": podmetrics.Metric{ Value: 5, }, }, time.Time{}, nil @@ -426,7 +427,7 @@ func TestGetRawMetric(t *testing.T) { description string expected *resource.Metric expectedErr error - metricsClient metricsclient.MetricsClient + metricsClient metricsclient.Client podLister corelisters.PodLister cpuInitializationPeriod time.Duration delayOfInitialReadinessStatus time.Duration @@ -439,7 +440,7 @@ func TestGetRawMetric(t *testing.T) { nil, errors.New("unable to get metrics for resource test-metric: fail to get metric"), &fake.MetricClient{ - GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { + GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { return nil, time.Time{}, errors.New("fail to get metric") }, }, @@ -455,7 +456,7 @@ func TestGetRawMetric(t *testing.T) { nil, errors.New("unable to get pods while calculating replica count: fail to get pods"), &fake.MetricClient{ - GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { + GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { return nil, time.Time{}, nil }, }, @@ -479,7 +480,7 @@ func TestGetRawMetric(t *testing.T) { nil, errors.New("No pods returned by selector while calculating replica count"), &fake.MetricClient{ - GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { + GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { return nil, time.Time{}, nil }, }, @@ -507,29 +508,29 @@ func TestGetRawMetric(t *testing.T) { "missing-pod-1": {}, "missing-pod-2": {}, }, - PodMetricsInfo: metricsclient.PodMetricsInfo{ - "ready-pod-1": metricsclient.PodMetric{ + PodMetricsInfo: podmetrics.MetricsInfo{ + "ready-pod-1": podmetrics.Metric{ Value: 1, }, - "ready-pod-2": metricsclient.PodMetric{ + "ready-pod-2": podmetrics.Metric{ Value: 2, }, - "ready-pod-3": metricsclient.PodMetric{ + "ready-pod-3": podmetrics.Metric{ Value: 3, }, }, }, nil, &fake.MetricClient{ - GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { - return metricsclient.PodMetricsInfo{ - "ready-pod-1": metricsclient.PodMetric{ + GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { + return podmetrics.MetricsInfo{ + "ready-pod-1": podmetrics.Metric{ Value: 1, }, - "ready-pod-2": metricsclient.PodMetric{ + "ready-pod-2": podmetrics.Metric{ Value: 2, }, - "ready-pod-3": metricsclient.PodMetric{ + "ready-pod-3": podmetrics.Metric{ Value: 3, }, }, time.Time{}, nil @@ -600,35 +601,35 @@ func TestGetRawMetric(t *testing.T) { "ignore-pod-1": {}, "ignore-pod-2": {}, }, - PodMetricsInfo: metricsclient.PodMetricsInfo{ - "ready-pod-1": metricsclient.PodMetric{ + PodMetricsInfo: podmetrics.MetricsInfo{ + "ready-pod-1": podmetrics.Metric{ Value: 1, }, - "ready-pod-2": metricsclient.PodMetric{ + "ready-pod-2": podmetrics.Metric{ Value: 2, }, - "ready-pod-3": metricsclient.PodMetric{ + "ready-pod-3": podmetrics.Metric{ Value: 3, }, }, }, nil, &fake.MetricClient{ - GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector, container string) (metricsclient.PodMetricsInfo, time.Time, error) { - return metricsclient.PodMetricsInfo{ - "ready-pod-1": metricsclient.PodMetric{ + GetResourceMetricReactor: func(resource corev1.ResourceName, namespace string, selector labels.Selector) (podmetrics.MetricsInfo, time.Time, error) { + return podmetrics.MetricsInfo{ + "ready-pod-1": podmetrics.Metric{ Value: 1, }, - "ready-pod-2": metricsclient.PodMetric{ + "ready-pod-2": podmetrics.Metric{ Value: 2, }, - "ready-pod-3": metricsclient.PodMetric{ + "ready-pod-3": podmetrics.Metric{ Value: 3, }, - "ignore-pod-1": metricsclient.PodMetric{ + "ignore-pod-1": podmetrics.Metric{ Value: 4, }, - "ignore-pod-2": metricsclient.PodMetric{ + "ignore-pod-2": podmetrics.Metric{ Value: 5, }, }, time.Time{}, nil diff --git a/internal/metricget/metricget.go b/internal/metricget/metricget.go index 5fe3f31..3315702 100644 --- a/internal/metricget/metricget.go +++ b/internal/metricget/metricget.go @@ -23,14 +23,12 @@ import ( "encoding/json" "fmt" - argov1alpha1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" "github.com/golang/glog" "github.com/jthomperoo/custom-pod-autoscaler/v2/config" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/execute" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget" "github.com/jthomperoo/custom-pod-autoscaler/v2/metric" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" + autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/kubernetes" @@ -38,7 +36,7 @@ import ( // GetMetricer provides methods for retrieving metrics type GetMetricer interface { - GetMetrics(info metric.Info) ([]*metric.ResourceMetric, error) + GetMetrics(info metric.Info, scaleResource *autoscalingv1.Scale) ([]*metric.ResourceMetric, error) } // Gatherer handles triggering the metric gathering logic to gather metrics for a resource @@ -50,12 +48,12 @@ type Gatherer struct { } // GetMetrics gathers metrics for the resource supplied -func (m *Gatherer) GetMetrics(info metric.Info) ([]*metric.ResourceMetric, error) { +func (m *Gatherer) GetMetrics(info metric.Info, scaleResource *autoscalingv1.Scale) ([]*metric.ResourceMetric, error) { // Query metrics server if requested if m.Config.KubernetesMetricSpecs != nil { glog.V(3).Infoln("K8s Metrics specs provided, attempting to query the K8s metrics server") - k8sMetricSpec, err := m.K8sMetricGatherer.GetMetrics(info.Resource, m.Config.KubernetesMetricSpecs, m.Config.Namespace) + k8sMetricSpec, err := m.K8sMetricGatherer.GetMetrics(info.Resource, m.Config.KubernetesMetricSpecs, m.Config.Namespace, scaleResource) if err != nil { if m.Config.RequireKubernetesMetrics { return nil, fmt.Errorf("failed to get required Kubernetes metrics: %w", err) @@ -70,11 +68,11 @@ func (m *Gatherer) GetMetrics(info metric.Info) ([]*metric.ResourceMetric, error switch m.Config.RunMode { case config.PerPodRunMode: - return m.getMetricsForPods(info) + return m.getMetricsForPods(info, scaleResource) case config.PerResourceRunMode: return m.getMetricsForResource(info) default: - return nil, fmt.Errorf("Unknown run mode: %s", m.Config.RunMode) + return nil, fmt.Errorf("unknown run mode: %s", m.Config.RunMode) } } @@ -128,18 +126,18 @@ func (m *Gatherer) getMetricsForResource(info metric.Info) ([]*metric.ResourceMe return info.Metrics, nil } -func (m *Gatherer) getMetricsForPods(info metric.Info) ([]*metric.ResourceMetric, error) { +func (m *Gatherer) getMetricsForPods(info metric.Info, scaleResource *autoscalingv1.Scale) ([]*metric.ResourceMetric, error) { glog.V(3).Infoln("Gathering metrics in per-pod mode") glog.V(3).Infoln("Attempting to get pod selector from managed resource") - labels, err := m.getPodSelectorForResource(info.Resource) + labels, err := labels.Parse(scaleResource.Status.Selector) if err != nil { return nil, fmt.Errorf("failed to get pod selector of managed resource: %w", err) } glog.V(3).Infof("Label selector retrieved: %+v", labels) glog.V(3).Infoln("Attempting to get pods being managed") - pods, err := m.Clientset.CoreV1().Pods(m.Config.Namespace).List(context.Background(), metav1.ListOptions{LabelSelector: labels}) + pods, err := m.Clientset.CoreV1().Pods(m.Config.Namespace).List(context.Background(), metav1.ListOptions{LabelSelector: labels.String()}) if err != nil { return nil, fmt.Errorf("failed to get pods being managed: %w", err) } @@ -208,36 +206,3 @@ func (m *Gatherer) getMetricsForPods(info metric.Info) ([]*metric.ResourceMetric return metrics, nil } - -func (m *Gatherer) getPodSelectorForResource(resource metav1.Object) (string, error) { - switch v := resource.(type) { - case *appsv1.Deployment: - selector, err := metav1.LabelSelectorAsMap(v.Spec.Selector) - if err != nil { - return "", err - } - return labels.SelectorFromSet(selector).String(), nil - case *appsv1.ReplicaSet: - selector, err := metav1.LabelSelectorAsMap(v.Spec.Selector) - if err != nil { - return "", err - } - return labels.SelectorFromSet(selector).String(), nil - case *appsv1.StatefulSet: - selector, err := metav1.LabelSelectorAsMap(v.Spec.Selector) - if err != nil { - return "", err - } - return labels.SelectorFromSet(selector).String(), nil - case *corev1.ReplicationController: - return labels.SelectorFromSet(v.Spec.Selector).String(), nil - case *argov1alpha1.Rollout: - selector, err := metav1.LabelSelectorAsMap(v.Spec.Selector) - if err != nil { - return "", err - } - return labels.SelectorFromSet(selector).String(), nil - default: - return "", fmt.Errorf("unsupported resource of type %T", v) - } -} diff --git a/internal/metricget/metricget_test.go b/internal/metricget/metricget_test.go index f667722..5982ba0 100644 --- a/internal/metricget/metricget_test.go +++ b/internal/metricget/metricget_test.go @@ -20,7 +20,6 @@ import ( "errors" "testing" - argov1alpha1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" "github.com/google/go-cmp/cmp" "github.com/jthomperoo/custom-pod-autoscaler/v2/config" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/fake" @@ -28,10 +27,12 @@ import ( "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric" "github.com/jthomperoo/custom-pod-autoscaler/v2/metric" appsv1 "k8s.io/api/apps/v1" + autoscalingv1 "k8s.io/api/autoscaling/v1" "k8s.io/api/autoscaling/v2beta2" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" k8sfake "k8s.io/client-go/kubernetes/fake" fakeappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1/fake" @@ -47,15 +48,16 @@ func TestGetMetrics(t *testing.T) { }) var tests = []struct { - description string - expectedErr error - expected []*metric.ResourceMetric - spec metric.Info - gatherer metricget.Gatherer + description string + expectedErr error + expected []*metric.ResourceMetric + spec metric.Info + gatherer metricget.Gatherer + scaleResource *autoscalingv1.Scale }{ { "Invalid run mode", - errors.New("Unknown run mode: invalid"), + errors.New("unknown run mode: invalid"), nil, metric.Info{ Resource: &appsv1.Deployment{ @@ -79,30 +81,11 @@ func TestGetMetrics(t *testing.T) { return clientset }(), }, - }, - { - "Per pod unsupported resource selector", - errors.New("failed to get pod selector of managed resource: unsupported resource of type *v1.DaemonSet"), nil, - metric.Info{ - Resource: &appsv1.DaemonSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test deployment", - Namespace: "test namespace", - }, - }, - RunType: config.ScalerRunType, - }, - metricget.Gatherer{ - Config: &config.Config{ - Namespace: "test namespace", - RunMode: config.PerPodRunMode, - }, - }, }, { "Per pod fail to get deployment selector", - errors.New(`failed to get pod selector of managed resource: "invalid" is not a valid selector operator`), + errors.New(`failed to get pod selector of managed resource: unable to parse requirement: found '!', expected: '=', '!=', '==', 'in', notin'`), nil, metric.Info{ Resource: &appsv1.Deployment{ @@ -110,73 +93,6 @@ func TestGetMetrics(t *testing.T) { Name: "test deployment", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Selector: &metav1.LabelSelector{ - MatchExpressions: []metav1.LabelSelectorRequirement{ - { - Operator: "invalid", - }, - }, - }, - }, - }, - RunType: config.ScalerRunType, - }, - metricget.Gatherer{ - Config: &config.Config{ - Namespace: "test namespace", - RunMode: config.PerPodRunMode, - }, - }, - }, - { - "Per pod fail to get replicaset selector", - errors.New(`failed to get pod selector of managed resource: "invalid" is not a valid selector operator`), - nil, - metric.Info{ - Resource: &appsv1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test deployment", - Namespace: "test namespace", - }, - Spec: appsv1.ReplicaSetSpec{ - Selector: &metav1.LabelSelector{ - MatchExpressions: []metav1.LabelSelectorRequirement{ - { - Operator: "invalid", - }, - }, - }, - }, - }, - RunType: config.ScalerRunType, - }, - metricget.Gatherer{ - Config: &config.Config{ - Namespace: "test namespace", - RunMode: config.PerPodRunMode, - }, - }, - }, - { - "Per pod fail to get statefulset selector", - errors.New(`failed to get pod selector of managed resource: "invalid" is not a valid selector operator`), - nil, - metric.Info{ - Resource: &appsv1.StatefulSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test deployment", - Namespace: "test namespace", - }, - Spec: appsv1.StatefulSetSpec{ - Selector: &metav1.LabelSelector{ - MatchExpressions: []metav1.LabelSelectorRequirement{ - { - Operator: "invalid", - }, - }, - }, - }, }, RunType: config.ScalerRunType, }, @@ -186,33 +102,9 @@ func TestGetMetrics(t *testing.T) { RunMode: config.PerPodRunMode, }, }, - }, - { - "Per pod fail to get argo rollout selector", - errors.New(`failed to get pod selector of managed resource: "invalid" is not a valid selector operator`), - nil, - metric.Info{ - Resource: &argov1alpha1.Rollout{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test deployment", - Namespace: "test namespace", - }, - Spec: argov1alpha1.RolloutSpec{ - Selector: &metav1.LabelSelector{ - MatchExpressions: []metav1.LabelSelectorRequirement{ - { - Operator: "invalid", - }, - }, - }, - }, - }, - RunType: config.ScalerRunType, - }, - metricget.Gatherer{ - Config: &config.Config{ - Namespace: "test namespace", - RunMode: config.PerPodRunMode, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "invalid!", }, }, }, @@ -242,6 +134,11 @@ func TestGetMetrics(t *testing.T) { return clientset }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod pre-metric hook fail", @@ -288,6 +185,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod single pod single deployment shell execute fail", @@ -331,6 +233,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod no resources", @@ -354,6 +261,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod post-metric hook fail", @@ -406,6 +318,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod no pod in managed deployment, but pod in other deployment with different name in same namespace", @@ -449,6 +366,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod no pod in managed deployment, but pod in other deployment with same name in different namespace", @@ -492,6 +414,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod single pod single deployment shell execute success", @@ -540,6 +467,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod single pod single deployment shell execute success with pre-metric hook", @@ -594,6 +526,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod single pod single deployment shell execute success with post-metric hook", @@ -648,6 +585,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod single pod, single replicaset success", @@ -696,6 +638,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod single pod, single statefulset success", @@ -744,6 +691,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod single pod, single replicationcontroller success", @@ -790,6 +742,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per pod multiple pod single deployment shell execute success", @@ -849,6 +806,11 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, { "Per resource shell execute fail", @@ -877,6 +839,7 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + nil, }, { "Per resource pre-metric hook fail", @@ -908,6 +871,7 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + nil, }, { "Per resource post-metric hook fail", @@ -945,6 +909,7 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + nil, }, { "Per resource shell execute success", @@ -978,6 +943,7 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + nil, }, { "Per resource shell execute success with pre-metric hook", @@ -1014,6 +980,7 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + nil, }, { "Per resource shell execute success with post-metric hook", @@ -1050,6 +1017,7 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + nil, }, { "Per resource shell execute success with K8s metrics", @@ -1097,7 +1065,7 @@ func TestGetMetrics(t *testing.T) { return &execute }(), K8sMetricGatherer: &fake.Gather{ - GetMetricsReactor: func(resource metav1.Object, specs []config.K8sMetricSpec, namespace string) ([]*k8smetric.Metric, error) { + GetMetricsReactor: func(resource metav1.Object, specs []config.K8sMetricSpec, namespace string, scaleResource *autoscalingv1.Scale) ([]*k8smetric.Metric, error) { return []*k8smetric.Metric{ { CurrentReplicas: 3, @@ -1106,6 +1074,7 @@ func TestGetMetrics(t *testing.T) { }, }, }, + &autoscalingv1.Scale{}, }, { "Per resource shell execute success, fail to get K8s metrics, but RequireKubernetesMetrics: false", @@ -1154,11 +1123,12 @@ func TestGetMetrics(t *testing.T) { return &execute }(), K8sMetricGatherer: &fake.Gather{ - GetMetricsReactor: func(resource metav1.Object, specs []config.K8sMetricSpec, namespace string) ([]*k8smetric.Metric, error) { + GetMetricsReactor: func(resource metav1.Object, specs []config.K8sMetricSpec, namespace string, scaleResource *autoscalingv1.Scale) ([]*k8smetric.Metric, error) { return nil, errors.New("fail to get K8s metrics!") }, }, }, + &autoscalingv1.Scale{}, }, { "Per resource shell execute failure, fail to get K8s metrics, RequireKubernetesMetrics: true", @@ -1202,11 +1172,12 @@ func TestGetMetrics(t *testing.T) { return &execute }(), K8sMetricGatherer: &fake.Gather{ - GetMetricsReactor: func(resource metav1.Object, specs []config.K8sMetricSpec, namespace string) ([]*k8smetric.Metric, error) { + GetMetricsReactor: func(resource metav1.Object, specs []config.K8sMetricSpec, namespace string, scaleResource *autoscalingv1.Scale) ([]*k8smetric.Metric, error) { return nil, errors.New("fail to get K8s metrics!") }, }, }, + &autoscalingv1.Scale{}, }, { "Per pod single pod, single Argo Rollout success", @@ -1218,15 +1189,15 @@ func TestGetMetrics(t *testing.T) { }, }, metric.Info{ - Resource: &argov1alpha1.Rollout{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test deployment", - Namespace: "test namespace", - }, - Spec: argov1alpha1.RolloutSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "app": "test", + Resource: &unstructured.Unstructured{ + Object: map[string]interface{}{ + "name": "test deployment", + "namespace": "test namespace", + "spec": map[string]interface{}{ + "selector": map[string]interface{}{ + "matchLabels": map[string]string{ + "test": "test", + }, }, }, }, @@ -1255,12 +1226,17 @@ func TestGetMetrics(t *testing.T) { return &execute }(), }, + &autoscalingv1.Scale{ + Status: autoscalingv1.ScaleStatus{ + Selector: "app==test", + }, + }, }, } for _, test := range tests { t.Run(test.description, func(t *testing.T) { - metrics, err := test.gatherer.GetMetrics(test.spec) + metrics, err := test.gatherer.GetMetrics(test.spec, test.scaleResource) if !cmp.Equal(&err, &test.expectedErr, equateErrorMessage) { t.Errorf("error mismatch (-want +got):\n%s", cmp.Diff(test.expectedErr, err, equateErrorMessage)) return diff --git a/internal/resourceclient/resourceclient.go b/internal/resourceclient/resourceclient.go index 551afd5..0e1a0cb 100644 --- a/internal/resourceclient/resourceclient.go +++ b/internal/resourceclient/resourceclient.go @@ -23,28 +23,26 @@ import ( "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic" ) -// Client provides methods for retrieving arbitrary Kubernetes resources, returned as generalised metav1.Object, which can be converted -// to concrete types, and allows for retrieving common and shared data (namespaces, names etc.) +// Client provides methods for retrieving arbitrary Kubernetes resources, returned as generalised metav1.Object, which +// can be converted to concrete types, and allows for retrieving common and shared data (namespaces, names etc.) type Client interface { - Get(apiVersion string, kind string, name string, namespace string) (metav1.Object, error) + Get(apiVersion string, kind string, name string, namespace string) (*unstructured.Unstructured, error) } -// UnstructuredClient is an implementation of the arbitrary resource client that uses a dynamic Kubernetes interface, retrieving -// unstructured k8s objects and converting them to metav1.Object +// UnstructuredClient is an implementation of the arbitrary resource client that uses a dynamic Kubernetes interface, +// retrieving unstructured k8s objects and converting them to metav1.Object type UnstructuredClient struct { - Scheme *runtime.Scheme - Dynamic dynamic.Interface - UnstructuredConverter runtime.UnstructuredConverter + Dynamic dynamic.Interface } -// Get takes descriptors of a Kubernetes object (api version, kind, name, namespace) and fetches the matching object, returning it -// as a metav1.Object -func (u *UnstructuredClient) Get(apiVersion string, kind string, name string, namespace string) (metav1.Object, error) { +// Get takes descriptors of a Kubernetes object (api version, kind, name, namespace) and fetches the matching object, +// returning it as an unstructured Kubernetes resource +func (u *UnstructuredClient) Get(apiVersion string, kind string, name string, namespace string) (*unstructured.Unstructured, error) { // TODO: update this to be less hacky // Convert to plural and lowercase kindPlural := fmt.Sprintf("%ss", strings.ToLower(kind)) @@ -55,9 +53,6 @@ func (u *UnstructuredClient) Get(apiVersion string, kind string, name string, na return nil, err } - // Build GVK - resourceGVK := schema.FromAPIVersionAndKind(apiVersion, kind) - // Build GVR resourceGVR := schema.GroupVersionResource{ Group: resourceGV.Group, @@ -71,15 +66,5 @@ func (u *UnstructuredClient) Get(apiVersion string, kind string, name string, na return nil, err } - resourceMeta, err := u.Scheme.New(resourceGVK) - if err != nil { - return nil, err - } - - err = u.UnstructuredConverter.FromUnstructured(resource.Object, resourceMeta) - if err != nil { - return nil, err - } - - return resourceMeta.(metav1.Object), nil + return resource, nil } diff --git a/internal/resourceclient/resourceclient_test.go b/internal/resourceclient/resourceclient_test.go index cf6205b..b485593 100644 --- a/internal/resourceclient/resourceclient_test.go +++ b/internal/resourceclient/resourceclient_test.go @@ -18,53 +18,18 @@ package resourceclient_test import ( "errors" - "fmt" - "runtime" "testing" - argov1alpha1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" "github.com/google/go-cmp/cmp" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/resourceclient" - appsv1 "k8s.io/api/apps/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" k8sruntime "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/dynamic" "k8s.io/client-go/dynamic/fake" - clientsetscheme "k8s.io/client-go/kubernetes/scheme" k8stesting "k8s.io/client-go/testing" ) -type fakeUnstructuredConverter struct { - ToUnstructuredReactor func(obj interface{}) (map[string]interface{}, error) - FromUnstructuredReactor func(u map[string]interface{}, obj interface{}) error -} - -func (f *fakeUnstructuredConverter) ToUnstructured(obj interface{}) (map[string]interface{}, error) { - return f.ToUnstructuredReactor(obj) -} - -func (f *fakeUnstructuredConverter) FromUnstructured(u map[string]interface{}, obj interface{}) error { - return f.FromUnstructuredReactor(u, obj) -} - -func defaultScheme() *k8sruntime.Scheme { - scheme := k8sruntime.NewScheme() - schemeBuilder := k8sruntime.NewSchemeBuilder(argov1alpha1.AddToScheme) - schemeBuilder.Register(clientsetscheme.AddToScheme) - err := schemeBuilder.AddToScheme(scheme) - if err != nil { - panic(err) - } - return scheme -} - -// This is a little bit hacky, but the scheme errors print the line of the scheme that was used to create it, in these -// tests it's the function above, so line 51, but if this is changed this number will need manually updated -const schemeLineNumber = 52 - func TestClient_Get(t *testing.T) { - _, filename, _, _ := runtime.Caller(0) equateErrorMessage := cmp.Comparer(func(x, y error) bool { if x == nil || y == nil { return x == nil && y == nil @@ -74,9 +39,8 @@ func TestClient_Get(t *testing.T) { var tests = []struct { description string - expected metav1.Object + expected *unstructured.Unstructured expectedErr error - scheme *k8sruntime.Scheme dynamic dynamic.Interface unstructuredConverter k8sruntime.UnstructuredConverter apiVersion string @@ -90,7 +54,6 @@ func TestClient_Get(t *testing.T) { errors.New(`unexpected GroupVersion string: /invalid/`), nil, nil, - nil, "/invalid/", "", "", @@ -100,7 +63,6 @@ func TestClient_Get(t *testing.T) { "Fail to get resource", nil, errors.New(`fail to get resource`), - defaultScheme(), func() *fake.FakeDynamicClient { client := fake.NewSimpleDynamicClient(k8sruntime.NewScheme()) client.PrependReactor("get", "tests", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { @@ -114,70 +76,19 @@ func TestClient_Get(t *testing.T) { "testname", "testnamespace", }, - { - "Fail to create new object using schema", - nil, - fmt.Errorf(`no kind "unknown" is registered for version "unknown/v1" in scheme "%s:%d"`, filename, schemeLineNumber), - defaultScheme(), - fake.NewSimpleDynamicClient(k8sruntime.NewScheme(), - &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "unknown/v1", - "kind": "unknown", - "metadata": map[string]interface{}{ - "namespace": "testnamespace", - "name": "testname", - }, - }, - }, - ), - nil, - "unknown/v1", - "unknown", - "testname", - "testnamespace", - }, - { - "Fail to convert from unstructured to object", - nil, - errors.New(`fail to convert from unstructured`), - defaultScheme(), - fake.NewSimpleDynamicClient(k8sruntime.NewScheme(), - &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "apps/v1", - "kind": "Deployment", - "metadata": map[string]interface{}{ - "namespace": "testnamespace", - "name": "testname", - }, - }, - }, - ), - &fakeUnstructuredConverter{ - FromUnstructuredReactor: func(u map[string]interface{}, obj interface{}) error { - return errors.New("fail to convert from unstructured") - }, - }, - "apps/v1", - "Deployment", - "testname", - "testnamespace", - }, { "Success, Deployment", - &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "testname", - Namespace: "testnamespace", - }, - TypeMeta: metav1.TypeMeta{ - Kind: "Deployment", - APIVersion: "apps/v1", + &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": "testname", + "namespace": "testnamespace", + }, + "apiVersion": "apps/v1", + "kind": "Deployment", }, }, nil, - defaultScheme(), fake.NewSimpleDynamicClient(k8sruntime.NewScheme(), &unstructured.Unstructured{ Object: map[string]interface{}{ @@ -198,18 +109,17 @@ func TestClient_Get(t *testing.T) { }, { "Success, Argo Rollout", - &argov1alpha1.Rollout{ - ObjectMeta: metav1.ObjectMeta{ - Name: "testname", - Namespace: "testnamespace", - }, - TypeMeta: metav1.TypeMeta{ - Kind: "Rollout", - APIVersion: "argoproj.io/v1alpha1", + &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": "testname", + "namespace": "testnamespace", + }, + "apiVersion": "argoproj.io/v1alpha1", + "kind": "Rollout", }, }, nil, - defaultScheme(), fake.NewSimpleDynamicClient(k8sruntime.NewScheme(), &unstructured.Unstructured{ Object: map[string]interface{}{ @@ -233,9 +143,7 @@ func TestClient_Get(t *testing.T) { for _, test := range tests { t.Run(test.description, func(t *testing.T) { scaler := &resourceclient.UnstructuredClient{ - Scheme: test.scheme, - Dynamic: test.dynamic, - UnstructuredConverter: test.unstructuredConverter, + Dynamic: test.dynamic, } result, err := scaler.Get(test.apiVersion, test.kind, test.name, test.namespace) if !cmp.Equal(&err, &test.expectedErr, equateErrorMessage) { diff --git a/internal/scaling/scaling.go b/internal/scaling/scaling.go index 3e9a664..4f0505e 100644 --- a/internal/scaling/scaling.go +++ b/internal/scaling/scaling.go @@ -24,14 +24,12 @@ import ( "fmt" "time" - argov1alpha1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" "github.com/golang/glog" "github.com/jthomperoo/custom-pod-autoscaler/v2/config" "github.com/jthomperoo/custom-pod-autoscaler/v2/evaluate" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/execute" "github.com/jthomperoo/custom-pod-autoscaler/v2/scale" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" + autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" k8sscale "k8s.io/client-go/scale" @@ -39,7 +37,8 @@ import ( // Scaler abstracts interactions with the Kubernetes scale API, allowing scaling based on an evaluation provided type Scaler interface { - Scale(info scale.Info) (*evaluate.Evaluation, error) + Scale(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error) + GetScaleSubResource(apiVersion string, kind string, namespace string, name string) (*autoscalingv1.Scale, error) } // Scale interacts with the Kubernetes API to allow scaling on evaluations @@ -59,18 +58,8 @@ type TimestampedEvaluation struct { // Scale takes an evaluation and uses it to interact with the Kubernetes scaling API, // to scale up/down, or keep the same number of replicas for a resource -func (s *Scale) Scale(info scale.Info) (*evaluate.Evaluation, error) { - glog.V(3).Infof("Determining replica count for resource '%s'", info.Resource.GetName()) - currentReplicas := int32(1) - resourceReplicas, err := s.getReplicaCount(info.Resource) - if err != nil { - return nil, fmt.Errorf("failed to get replica count for resource: %w", err) - } - if resourceReplicas != nil { - currentReplicas = *resourceReplicas - } - glog.V(3).Infof("Replica count determined: %d", currentReplicas) - +func (s *Scale) Scale(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error) { + currentReplicas := scaleResource.Spec.Replicas targetReplicas := currentReplicas if info.Evaluation.TargetReplicas < info.MinReplicas { glog.V(1).Infof("Scale target less than min at %d replicas, setting target to min %d replicas", targetReplicas, info.MinReplicas) @@ -153,16 +142,9 @@ func (s *Scale) Scale(info scale.Info) (*evaluate.Evaluation, error) { Resource: info.ScaleTargetRef.Kind, } - glog.V(3).Infoln("Attempting to get scale subresource for managed resource") - scale, err := s.Scaler.Scales(info.Namespace).Get(context.Background(), targetGR, info.ScaleTargetRef.Name, metav1.GetOptions{}) - if err != nil { - return nil, fmt.Errorf("failed to get scale subresource for resource: %w", err) - } - glog.V(3).Infof("Scale subresource retrieved: %+v", scale) - glog.V(3).Infoln("Attempting to apply scaling changes to resource") - scale.Spec.Replicas = targetReplicas - _, err = s.Scaler.Scales(info.Namespace).Update(context.Background(), targetGR, scale, metav1.UpdateOptions{}) + scaleResource.Spec.Replicas = targetReplicas + _, err = s.Scaler.Scales(info.Namespace).Update(context.Background(), targetGR, scaleResource, metav1.UpdateOptions{}) if err != nil { return nil, fmt.Errorf("failed to apply scaling changes to resource: %w", err) } @@ -183,19 +165,25 @@ func (s *Scale) Scale(info scale.Info) (*evaluate.Evaluation, error) { return &info.Evaluation, nil } -func (s *Scale) getReplicaCount(resource metav1.Object) (*int32, error) { - switch v := resource.(type) { - case *appsv1.Deployment: - return v.Spec.Replicas, nil - case *appsv1.ReplicaSet: - return v.Spec.Replicas, nil - case *appsv1.StatefulSet: - return v.Spec.Replicas, nil - case *corev1.ReplicationController: - return v.Spec.Replicas, nil - case *argov1alpha1.Rollout: - return v.Spec.Replicas, nil - default: - return nil, fmt.Errorf("unsupported resource of type %T", v) +// GetScaleSubResource returns the scale subresource from the K8s scale API +func (s *Scale) GetScaleSubResource(apiVersion string, kind string, namespace string, name string) (*autoscalingv1.Scale, error) { + glog.V(3).Infoln("Attempting to get scale subresource for managed resource") + + resourceGV, err := schema.ParseGroupVersion(apiVersion) + if err != nil { + return nil, err + } + glog.V(3).Infof("Group version parsed: %+v", resourceGV) + + targetGR := schema.GroupResource{ + Group: resourceGV.Group, + Resource: kind, } + + scale, err := s.Scaler.Scales(namespace).Get(context.Background(), targetGR, name, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to get scale subresource for resource: %w", err) + } + + return scale, nil } diff --git a/internal/scaling/scaling_test.go b/internal/scaling/scaling_test.go index 4604f42..d233ae8 100644 --- a/internal/scaling/scaling_test.go +++ b/internal/scaling/scaling_test.go @@ -18,10 +18,10 @@ package scaling_test import ( "errors" + "fmt" "testing" "time" - argov1alpha1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" "github.com/google/go-cmp/cmp" "github.com/jthomperoo/custom-pod-autoscaler/v2/config" "github.com/jthomperoo/custom-pod-autoscaler/v2/evaluate" @@ -33,6 +33,7 @@ import ( autoscalingv2 "k8s.io/api/autoscaling/v2beta2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" scaleFake "k8s.io/client-go/scale/fake" k8stesting "k8s.io/client-go/testing" @@ -47,83 +48,26 @@ func TestScale_Scale(t *testing.T) { }) var tests = []struct { - description string - expected *evaluate.Evaluation - expectedErr error - scaler scaling.Scaler - info scale.Info + description string + expected *evaluate.Evaluation + expectedErr error + scaler scaling.Scaler + info scale.Info + scaleResource *autoscalingv1.Scale }{ { - "Unsupported resource", - nil, - errors.New(`failed to get replica count for resource: unsupported resource of type *v1.DaemonSet`), - &scaling.Scale{ - nil, - &config.Config{}, - nil, - nil, - }, - scale.Info{ - Evaluation: evaluate.Evaluation{}, - Resource: &appsv1.DaemonSet{}, - MinReplicas: 1, - MaxReplicas: 10, - ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ - Kind: "daemonset", - Name: "test", - APIVersion: "apps/v1", - }, - Namespace: "test", - RunType: config.ScalerRunType, - }, - }, - { - "Fail to parse group version", - nil, - errors.New("unexpected GroupVersion string: /invalid/"), - &scaling.Scale{ - nil, - &config.Config{}, - nil, - nil, - }, - scale.Info{ - Evaluation: evaluate.Evaluation{ - TargetReplicas: int32(3), - }, - Resource: &appsv1.Deployment{ - TypeMeta: metav1.TypeMeta{ - Kind: "deployment", - APIVersion: "/invalid/", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - }, - MinReplicas: 1, - MaxReplicas: 10, - ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ - Kind: "deployment", - Name: "test", - APIVersion: "/invalid/", - }, - Namespace: "test", - RunType: config.ScalerRunType, - }, - }, - { - "Fail to get scale for resource", + "Fail to update scale for resource", nil, - errors.New("failed to get scale subresource for resource: fail to get resource"), + errors.New("failed to apply scaling changes to resource: fail to update resource"), &scaling.Scale{ &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ &k8stesting.SimpleReactor{ Resource: "deployment", - Verb: "get", + Verb: "update", Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, nil, errors.New("fail to get resource") + return true, nil, errors.New("fail to update resource") }, }, }, @@ -135,17 +79,16 @@ func TestScale_Scale(t *testing.T) { }, scale.Info{ Evaluation: evaluate.Evaluation{ - TargetReplicas: int32(3), - }, - Resource: &appsv1.Deployment{ - TypeMeta: metav1.TypeMeta{ - Kind: "deployment", - APIVersion: "apps/v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, + TargetReplicas: int32(1), }, + Resource: func() *appsv1.Deployment { + return &appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test", + Namespace: "test namespace", + }, + } + }(), MinReplicas: 1, MaxReplicas: 10, ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ @@ -156,27 +99,20 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { - "Fail to update scale for resource", + "Fail to parse invalid API version", nil, - errors.New("failed to apply scaling changes to resource: fail to update resource"), + errors.New("unexpected GroupVersion string: invalid/invalid/invalid"), &scaling.Scale{ - &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "deployment", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 3, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "deployment", Verb: "update", @@ -196,15 +132,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(1), }, Resource: func() *appsv1.Deployment { - replicas := int32(3) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -212,11 +144,16 @@ func TestScale_Scale(t *testing.T) { ScaleTargetRef: &autoscalingv2.CrossVersionObjectReference{ Kind: "deployment", Name: "test", - APIVersion: "apps/v1", + APIVersion: "invalid/invalid/invalid", }, Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Fail to run pre-scaling hook", @@ -241,15 +178,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(3), }, Resource: func() *appsv1.Deployment { - replicas := int32(2) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -262,6 +195,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 2, + }, + }, }, { "Fail to run post-scaling hook", @@ -286,15 +224,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(3), }, Resource: func() *appsv1.Deployment { - replicas := int32(3) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -307,6 +241,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Success, deployment, autoscaling disabled", @@ -325,15 +264,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(3), }, Resource: func() *appsv1.Deployment { - replicas := int32(0) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -346,6 +281,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 0, + }, + }, }, { "Success, deployment, scale to 0", @@ -357,17 +297,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "deployment", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 0, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "deployment", Verb: "update", @@ -387,15 +316,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(0), }, Resource: func() *appsv1.Deployment { - replicas := int32(5) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 0, @@ -408,6 +333,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 5, + }, + }, }, { "Success, deployment, scale from 0", @@ -419,17 +349,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "deployment", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 3, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "deployment", Verb: "update", @@ -449,15 +368,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(3), }, Resource: func() *appsv1.Deployment { - replicas := int32(0) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 0, @@ -470,6 +385,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 0, + }, + }, }, { "Success, deployment, autoscaling disabled, run pre-scaling hook", @@ -496,15 +416,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(3), }, Resource: func() *appsv1.Deployment { - replicas := int32(0) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -517,6 +433,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 0, + }, + }, }, { "Success, deployment, no change in scale", @@ -535,15 +456,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(3), }, Resource: func() *appsv1.Deployment { - replicas := int32(3) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -556,6 +473,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Success, deployment, evaluation above max replicas, scale to max replicas", @@ -567,17 +489,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "deployment", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 3, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "deployment", Verb: "update", @@ -597,15 +508,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(10), }, Resource: func() *appsv1.Deployment { - replicas := int32(2) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -618,6 +525,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 2, + }, + }, }, { "Success, deployment, evaluation below min replicas, scale to min replicas", @@ -629,17 +541,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "deployment", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 2, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "deployment", Verb: "update", @@ -659,15 +560,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(1), }, Resource: func() *appsv1.Deployment { - replicas := int32(5) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 2, @@ -680,6 +577,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 5, + }, + }, }, { "Success, deployment, evaluation within min-max bounds, scale to evaluation", @@ -691,17 +593,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "deployment", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 7, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "deployment", Verb: "update", @@ -721,15 +612,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(7), }, Resource: func() *appsv1.Deployment { - replicas := int32(5) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -742,6 +629,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 5, + }, + }, }, { "Success, deployment, evaluation within min-max bounds, scale to evaluation, run post-scale hook", @@ -753,17 +645,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "deployment", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 7, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "deployment", Verb: "update", @@ -791,15 +672,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(7), }, Resource: func() *appsv1.Deployment { - replicas := int32(5) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -812,6 +689,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 5, + }, + }, }, { "Success, deployment, evaluation within min-max bounds, scale to evaluation, run pre and post-scale hooks", @@ -823,17 +705,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "deployment", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 7, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "deployment", Verb: "update", @@ -864,15 +735,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(7), }, Resource: func() *appsv1.Deployment { - replicas := int32(5) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -885,6 +752,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 5, + }, + }, }, { "Success, replicaset, evaluation within min-max bounds, scale to evaluation", @@ -896,17 +768,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "replicaset", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 4, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "replicaset", Verb: "update", @@ -926,15 +787,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(7), }, Resource: func() *appsv1.ReplicaSet { - replicas := int32(3) return &appsv1.ReplicaSet{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.ReplicaSetSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -947,6 +804,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Success, argo rollout, evaluation within min-max bounds, scale to evaluation", @@ -958,17 +820,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "rollout", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 4, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "rollout", Verb: "update", @@ -987,15 +838,11 @@ func TestScale_Scale(t *testing.T) { Evaluation: evaluate.Evaluation{ TargetReplicas: int32(7), }, - Resource: func() *argov1alpha1.Rollout { - replicas := int32(3) - return &argov1alpha1.Rollout{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - Namespace: "test namespace", - }, - Spec: argov1alpha1.RolloutSpec{ - Replicas: &replicas, + Resource: func() *unstructured.Unstructured { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "name": "test", + "namespace": "test namespace", }, } }(), @@ -1009,6 +856,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, }, { "Success, replicationcontroller, evaluation within min-max bounds, scale to evaluation", @@ -1020,17 +872,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "replicationcontroller", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 4, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "replicationcontroller", Verb: "update", @@ -1050,15 +891,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(7), }, Resource: func() *corev1.ReplicationController { - replicas := int32(8) return &corev1.ReplicationController{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: corev1.ReplicationControllerSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -1071,6 +908,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 8, + }, + }, }, { "Success, statefulset, evaluation within min-max bounds, scale to evaluation", @@ -1082,17 +924,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "statefulset", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 10, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "statefulset", Verb: "update", @@ -1112,15 +943,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(7), }, Resource: func() *appsv1.StatefulSet { - replicas := int32(1) return &appsv1.StatefulSet{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.StatefulSetSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -1133,6 +960,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 1, + }, + }, }, { "Success, deployment, 3 values within downscale stabilization window, 2 values pruned, previous max", @@ -1144,17 +976,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "deployment", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 5, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "deployment", Verb: "update", @@ -1207,15 +1028,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(2), }, Resource: func() *appsv1.Deployment { - replicas := int32(5) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -1228,6 +1045,11 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 5, + }, + }, }, { "Success, deployment, 3 values within downscale stabilization window, 2 values pruned, latest max", @@ -1239,17 +1061,6 @@ func TestScale_Scale(t *testing.T) { &scaleFake.FakeScaleClient{ Fake: k8stesting.Fake{ ReactionChain: []k8stesting.Reactor{ - &k8stesting.SimpleReactor{ - Resource: "deployment", - Verb: "get", - Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &autoscalingv1.Scale{ - Spec: autoscalingv1.ScaleSpec{ - Replicas: 5, - }, - }, nil - }, - }, &k8stesting.SimpleReactor{ Resource: "deployment", Verb: "update", @@ -1302,15 +1113,11 @@ func TestScale_Scale(t *testing.T) { TargetReplicas: int32(3), }, Resource: func() *appsv1.Deployment { - replicas := int32(5) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: "test", Namespace: "test namespace", }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - }, } }(), MinReplicas: 1, @@ -1323,12 +1130,113 @@ func TestScale_Scale(t *testing.T) { Namespace: "test", RunType: config.ScalerRunType, }, + &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 5, + }, + }, }, } for _, test := range tests { t.Run(test.description, func(t *testing.T) { - result, err := test.scaler.Scale(test.info) + result, err := test.scaler.Scale(test.info, test.scaleResource) + if !cmp.Equal(&err, &test.expectedErr, equateErrorMessage) { + t.Errorf("error mismatch (-want +got):\n%s", cmp.Diff(test.expectedErr, err, equateErrorMessage)) + return + } + if !cmp.Equal(test.expected, result) { + t.Errorf("metrics mismatch (-want +got):\n%s", cmp.Diff(test.expected, result)) + } + }) + } +} + +func TestGetScaleSubResource(t *testing.T) { + equateErrorMessage := cmp.Comparer(func(x, y error) bool { + if x == nil || y == nil { + return x == nil && y == nil + } + return x.Error() == y.Error() + }) + + tests := []struct { + name string + expected *autoscalingv1.Scale + expectedErr error + scale *scaling.Scale + apiVersion string + kind string + namespace string + resourceName string + }{ + { + name: "Invalid api version", + expected: nil, + expectedErr: fmt.Errorf("unexpected GroupVersion string: invalid/invalid/invalid"), + scale: &scaling.Scale{}, + apiVersion: "invalid/invalid/invalid", + }, + { + name: "Fail to get scale subresource", + expected: nil, + expectedErr: fmt.Errorf("failed to get scale subresource for resource: fail to get scale subresource"), + scale: &scaling.Scale{ + Scaler: &scaleFake.FakeScaleClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "test", + Verb: "get", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, errors.New("fail to get scale subresource") + }, + }, + }, + }, + }, + }, + apiVersion: "test/v1", + kind: "test", + namespace: "test", + resourceName: "test", + }, + { + name: "Success", + expected: &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, + expectedErr: nil, + scale: &scaling.Scale{ + Scaler: &scaleFake.FakeScaleClient{ + Fake: k8stesting.Fake{ + ReactionChain: []k8stesting.Reactor{ + &k8stesting.SimpleReactor{ + Resource: "test", + Verb: "get", + Reaction: func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { + return true, &autoscalingv1.Scale{ + Spec: autoscalingv1.ScaleSpec{ + Replicas: 3, + }, + }, nil + }, + }, + }, + }, + }, + }, + apiVersion: "test/v1", + kind: "test", + namespace: "test", + resourceName: "test", + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + result, err := test.scale.GetScaleSubResource(test.apiVersion, test.kind, test.namespace, test.resourceName) if !cmp.Equal(&err, &test.expectedErr, equateErrorMessage) { t.Errorf("error mismatch (-want +got):\n%s", cmp.Diff(test.expectedErr, err, equateErrorMessage)) return diff --git a/k8smetric/podmetrics/podmetrics.go b/k8smetric/podmetrics/podmetrics.go new file mode 100644 index 0000000..ae72c59 --- /dev/null +++ b/k8smetric/podmetrics/podmetrics.go @@ -0,0 +1,29 @@ +/* +Copyright 2022 The Custom Pod Autoscaler 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 podmetrics + +import "time" + +// Metric contains pod metric value (the metric values are expected to be the metric as a milli-value) +type Metric struct { + Timestamp time.Time + Window time.Duration + Value int64 +} + +// MetricsInfo contains pod metrics as a map from pod names to MetricsInfo +type MetricsInfo map[string]Metric diff --git a/k8smetric/pods/pods.go b/k8smetric/pods/pods.go index a82d48e..4cb79de 100644 --- a/k8smetric/pods/pods.go +++ b/k8smetric/pods/pods.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Custom Pod Autoscaler Authors. +Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,17 +19,17 @@ package pods import ( "time" + "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/podmetrics" "k8s.io/apimachinery/pkg/util/sets" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) // Metric (Pods) is a metric describing each pod in the current scale target (for example, // transactions-processed-per-second). The values will be averaged together before being compared to the target value. type Metric struct { - PodMetricsInfo metricsclient.PodMetricsInfo `json:"pod_metrics_info"` - ReadyPodCount int64 `json:"ready_pod_count"` - IgnoredPods sets.String `json:"ignored_pods"` - MissingPods sets.String `json:"missing_pods"` - TotalPods int `json:"total_pods"` - Timestamp time.Time `json:"timestamp,omitempty"` + PodMetricsInfo podmetrics.MetricsInfo `json:"pod_metrics_info"` + ReadyPodCount int64 `json:"ready_pod_count"` + IgnoredPods sets.String `json:"ignored_pods"` + MissingPods sets.String `json:"missing_pods"` + TotalPods int `json:"total_pods"` + Timestamp time.Time `json:"timestamp,omitempty"` } diff --git a/k8smetric/resource/resource.go b/k8smetric/resource/resource.go index 26e3bbf..f5f40c2 100644 --- a/k8smetric/resource/resource.go +++ b/k8smetric/resource/resource.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Custom Pod Autoscaler Authors. +Copyright 2022 The Custom Pod Autoscaler Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,19 +19,19 @@ package resource import ( "time" + "github.com/jthomperoo/custom-pod-autoscaler/v2/k8smetric/podmetrics" "k8s.io/apimachinery/pkg/util/sets" - metricsclient "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" ) // Metric (Resource) is a resource metric known to Kubernetes, as specified in requests and limits, describing each pod // in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling // options on top of those available to normal per-pod metrics (the "pods" source). type Metric struct { - PodMetricsInfo metricsclient.PodMetricsInfo `json:"pod_metrics_info"` - Requests map[string]int64 `json:"requests"` - ReadyPodCount int64 `json:"ready_pod_count"` - IgnoredPods sets.String `json:"ignored_pods"` - MissingPods sets.String `json:"missing_pods"` - TotalPods int `json:"total_pods"` - Timestamp time.Time `json:"timestamp,omitempty"` + PodMetricsInfo podmetrics.MetricsInfo `json:"pod_metrics_info"` + Requests map[string]int64 `json:"requests"` + ReadyPodCount int64 `json:"ready_pod_count"` + IgnoredPods sets.String `json:"ignored_pods"` + MissingPods sets.String `json:"missing_pods"` + TotalPods int `json:"total_pods"` + Timestamp time.Time `json:"timestamp,omitempty"` } diff --git a/main.go b/main.go index 981124b..af637a1 100644 --- a/main.go +++ b/main.go @@ -37,7 +37,6 @@ import ( "syscall" "time" - argov1alpha1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" "github.com/go-chi/chi" "github.com/golang/glog" v1 "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/api/v1" @@ -48,19 +47,17 @@ import ( "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/execute/http" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/execute/shell" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget" + metricsclient "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/k8smetricget/metrics" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/metricget" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/podclient" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/resourceclient" "github.com/jthomperoo/custom-pod-autoscaler/v2/internal/scaling" - "k8s.io/apimachinery/pkg/runtime" cacheddiscovery "k8s.io/client-go/discovery/cached" "k8s.io/client-go/dynamic" "k8s.io/client-go/kubernetes" - clientsetscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/restmapper" k8sscale "k8s.io/client-go/scale" - "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" k8sresourceclient "k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1" customclient "k8s.io/metrics/pkg/client/custom_metrics" externalclient "k8s.io/metrics/pkg/client/external_metrics" @@ -113,15 +110,6 @@ func main() { glog.Fatalf("Fail to parse configuration: %s", err) } - // Set up Kubernetes resource scheme - scheme := runtime.NewScheme() - schemeBuilder := runtime.NewSchemeBuilder(argov1alpha1.AddToScheme) - schemeBuilder.Register(clientsetscheme.AddToScheme) - err = schemeBuilder.AddToScheme(scheme) - if err != nil { - glog.Fatalf("Fail to create Kubernetes resource scheme config: %s", err) - } - // Create the in-cluster Kubernetes config clusterConfig, err := rest.InClusterConfig() if err != nil { @@ -155,14 +143,9 @@ func main() { glog.V(0).Infof("Custom Pod Autoscaler version: %s", Version) glog.V(1).Infoln("Setting up resources and clients") - // Unstructured converter - unstructuredConverted := runtime.DefaultUnstructuredConverter - // Set up resource client resourceClient := &resourceclient.UnstructuredClient{ - Scheme: scheme, - Dynamic: dynamicClient, - UnstructuredConverter: unstructuredConverted, + Dynamic: dynamicClient, } scaleClient := k8sscale.New( @@ -175,15 +158,15 @@ func main() { ) // Create K8s metric gatherer, with required clients and configuration - gatherer := k8smetricget.NewGather(metrics.NewRESTMetricsClient( - k8sresourceclient.NewForConfigOrDie(clusterConfig), - customclient.NewForConfig( + gatherer := k8smetricget.NewGather(&metricsclient.RESTClient{ + Client: k8sresourceclient.NewForConfigOrDie(clusterConfig), + ExternalMetricsClient: externalclient.NewForConfigOrDie(clusterConfig), + CustomMetricsClient: customclient.NewForConfig( clusterConfig, restmapper.NewDeferredDiscoveryRESTMapper(cacheddiscovery.NewMemCacheClient(clientset.Discovery())), customclient.NewAvailableAPIsGetter(clientset.Discovery()), ), - externalclient.NewForConfigOrDie(clusterConfig), - ), &podclient.OnDemandPodLister{ + }, &podclient.OnDemandPodLister{ Clientset: clientset, }, time.Duration(loadedConfig.CPUInitializationPeriod)*time.Second, time.Duration(loadedConfig.InitialReadinessDelay)*time.Second)