diff --git a/Gopkg.lock b/Gopkg.lock index 69653aec4e..6b46885c86 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -174,14 +174,6 @@ revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5" version = "v1.2.0" -[[projects]] - branch = "master" - digest = "1:0bfbe13936953a98ae3cfe8ed6670d396ad81edf069a806d2f6515d7bb6950df" - name = "github.com/google/btree" - packages = ["."] - pruneopts = "UT" - revision = "4030bb1f1f0c35b30ca7009e9ebd06849dd45306" - [[projects]] branch = "master" digest = "1:3ee90c0d94da31b442dde97c99635aaafec68d0b8a3c12ee2075c6bdabeec6bb" @@ -218,17 +210,6 @@ pruneopts = "UT" revision = "199db9a3a2bfa55802ab074ab8fed67fce2a2791" -[[projects]] - branch = "master" - digest = "1:86c1210529e69d69860f2bb3ee9ccce0b595aa3f9165e7dd1388e5c612915888" - name = "github.com/gregjones/httpcache" - packages = [ - ".", - "diskcache", - ] - pruneopts = "UT" - revision = "9cad4c3443a7200dd6400aef47183728de563a38" - [[projects]] branch = "master" digest = "1:cf296baa185baae04a9a7004efee8511d08e2f5f51d4cbe5375da89722d681db" @@ -364,22 +345,6 @@ revision = "e790cca94e6cc75c7064b1332e63811d4aae1a53" version = "v1.1" -[[projects]] - branch = "master" - digest = "1:3bf17a6e6eaa6ad24152148a631d18662f7212e21637c2699bff3369b7f00fa2" - name = "github.com/petar/GoLLRB" - packages = ["llrb"] - pruneopts = "UT" - revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" - -[[projects]] - digest = "1:0e7775ebbcf00d8dd28ac663614af924411c868dca3d5aa762af0fae3808d852" - name = "github.com/peterbourgon/diskv" - packages = ["."] - pruneopts = "UT" - revision = "5f041e8faa004a95c88a202771f4cc3e991971e6" - version = "v2.0.1" - [[projects]] digest = "1:20a8a18488bdef471795af0413d9a3c9c35dc24ca93342329b884ba3c15cbaab" name = "github.com/prometheus/client_golang" @@ -612,11 +577,10 @@ version = "v2.2.1" [[projects]] - digest = "1:684a27f12acc943bee24373b4e8f4acde803990add2fc5dde602c27b58207d3b" + digest = "1:baf5a7da864b8f493ff372a9486c2d6a7fae8363699af2dc0ef6dba9a869928f" name = "k8s.io/api" packages = [ "admission/v1beta1", - "admissionregistration/v1alpha1", "admissionregistration/v1beta1", "apps/v1", "apps/v1beta1", @@ -633,15 +597,20 @@ "batch/v1beta1", "batch/v2alpha1", "certificates/v1beta1", + "coordination/v1", "coordination/v1beta1", "core/v1", "events/v1beta1", "extensions/v1beta1", "networking/v1", + "networking/v1beta1", + "node/v1alpha1", + "node/v1beta1", "policy/v1beta1", "rbac/v1", "rbac/v1alpha1", "rbac/v1beta1", + "scheduling/v1", "scheduling/v1alpha1", "scheduling/v1beta1", "settings/v1alpha1", @@ -650,11 +619,11 @@ "storage/v1beta1", ] pruneopts = "UT" - revision = "5cb15d34447165a97c76ed5a60e4e99c8a01ecfe" - version = "kubernetes-1.13.4" + revision = "6e4e0e4f393bf5e8bbff570acd13217aa5a770cd" + version = "kubernetes-1.14.1" [[projects]] - digest = "1:db0e48e58e92eddc9ae08e9efb3dfaa1d61e32de690fff0dae5bccf4b45ebcce" + digest = "1:65226935ef0a84716e327aa46c5a11cf2158ca6d0c79b379202d0b2c2be0e9bc" name = "k8s.io/apiextensions-apiserver" packages = [ "pkg/apis/apiextensions", @@ -664,11 +633,11 @@ "pkg/client/clientset/clientset/typed/apiextensions/v1beta1", ] pruneopts = "UT" - revision = "d002e88f6236312f0289d9d1deab106751718ff0" - version = "kubernetes-1.13.4" + revision = "727a075fdec8319bf095330e344b3ccc668abc73" + version = "kubernetes-1.14.1" [[projects]] - digest = "1:51ab4e2706ef5cde1f05a4d5e13d6ff258f5861bb4edf6143a4b4052884f86d7" + digest = "1:2616411ee46c05b1488f127c171e9204695d15d1e654fe79ea2d204f96f28070" name = "k8s.io/apimachinery" packages = [ "pkg/api/errors", @@ -716,18 +685,17 @@ "third_party/forked/golang/reflect", ] pruneopts = "UT" - revision = "86fb29eff6288413d76bd8506874fddd9fccdff0" - version = "kubernetes-1.13.4" + revision = "6a84e37a896db9780c75367af8d2ed2bb944022e" + version = "kubernetes-1.14.1" [[projects]] - digest = "1:183195874694b27b758577f5aabe8c1e9bb14a3393df14b2ee15f6c2f70f3efd" + digest = "1:00f288473b016529887e152dad2465482cad64b233298d58f1526385505b27db" name = "k8s.io/client-go" packages = [ "discovery", "dynamic", "informers", "informers/admissionregistration", - "informers/admissionregistration/v1alpha1", "informers/admissionregistration/v1beta1", "informers/apps", "informers/apps/v1", @@ -746,6 +714,7 @@ "informers/certificates", "informers/certificates/v1beta1", "informers/coordination", + "informers/coordination/v1", "informers/coordination/v1beta1", "informers/core", "informers/core/v1", @@ -756,6 +725,10 @@ "informers/internalinterfaces", "informers/networking", "informers/networking/v1", + "informers/networking/v1beta1", + "informers/node", + "informers/node/v1alpha1", + "informers/node/v1beta1", "informers/policy", "informers/policy/v1beta1", "informers/rbac", @@ -763,6 +736,7 @@ "informers/rbac/v1alpha1", "informers/rbac/v1beta1", "informers/scheduling", + "informers/scheduling/v1", "informers/scheduling/v1alpha1", "informers/scheduling/v1beta1", "informers/settings", @@ -773,7 +747,6 @@ "informers/storage/v1beta1", "kubernetes", "kubernetes/scheme", - "kubernetes/typed/admissionregistration/v1alpha1", "kubernetes/typed/admissionregistration/v1beta1", "kubernetes/typed/apps/v1", "kubernetes/typed/apps/v1beta1", @@ -790,22 +763,26 @@ "kubernetes/typed/batch/v1beta1", "kubernetes/typed/batch/v2alpha1", "kubernetes/typed/certificates/v1beta1", + "kubernetes/typed/coordination/v1", "kubernetes/typed/coordination/v1beta1", "kubernetes/typed/core/v1", "kubernetes/typed/events/v1beta1", "kubernetes/typed/extensions/v1beta1", "kubernetes/typed/networking/v1", + "kubernetes/typed/networking/v1beta1", + "kubernetes/typed/node/v1alpha1", + "kubernetes/typed/node/v1beta1", "kubernetes/typed/policy/v1beta1", "kubernetes/typed/rbac/v1", "kubernetes/typed/rbac/v1alpha1", "kubernetes/typed/rbac/v1beta1", + "kubernetes/typed/scheduling/v1", "kubernetes/typed/scheduling/v1alpha1", "kubernetes/typed/scheduling/v1beta1", "kubernetes/typed/settings/v1alpha1", "kubernetes/typed/storage/v1", "kubernetes/typed/storage/v1alpha1", "kubernetes/typed/storage/v1beta1", - "listers/admissionregistration/v1alpha1", "listers/admissionregistration/v1beta1", "listers/apps/v1", "listers/apps/v1beta1", @@ -818,15 +795,20 @@ "listers/batch/v1beta1", "listers/batch/v2alpha1", "listers/certificates/v1beta1", + "listers/coordination/v1", "listers/coordination/v1beta1", "listers/core/v1", "listers/events/v1beta1", "listers/extensions/v1beta1", "listers/networking/v1", + "listers/networking/v1beta1", + "listers/node/v1alpha1", + "listers/node/v1beta1", "listers/policy/v1beta1", "listers/rbac/v1", "listers/rbac/v1alpha1", "listers/rbac/v1beta1", + "listers/scheduling/v1", "listers/scheduling/v1alpha1", "listers/scheduling/v1beta1", "listers/settings/v1alpha1", @@ -859,21 +841,21 @@ "tools/metrics", "tools/pager", "tools/record", + "tools/record/util", "tools/reference", "transport", - "util/buffer", "util/cert", "util/connrotation", "util/flowcontrol", "util/homedir", - "util/integer", "util/jsonpath", + "util/keyutil", "util/retry", "util/workqueue", ] pruneopts = "UT" - revision = "b40b2a5939e43f7ffe0028ad67586b7ce50bb675" - version = "kubernetes-1.13.4" + revision = "1a26190bd76a9017e289958b9fba936430aa3704" + version = "kubernetes-1.14.1" [[projects]] digest = "1:e2999bf1bb6eddc2a6aa03fe5e6629120a53088926520ca3b4765f77d7ff7eab" @@ -894,6 +876,18 @@ pruneopts = "UT" revision = "e3762e86a74c878ffed47484592986685639c2cd" +[[projects]] + branch = "master" + digest = "1:14e8a3b53e6d8cb5f44783056b71bb2ca1ac7e333939cc97f3e50b579c920845" + name = "k8s.io/utils" + packages = [ + "buffer", + "integer", + "trace", + ] + pruneopts = "UT" + revision = "21c4ce38f2a793ec01e925ddc31216500183b773" + [[projects]] digest = "1:9070222ca967d09b3966552a161dd4420d62315964bf5e1efd8cc4c7c30ebca8" name = "sigs.k8s.io/testing_frameworks" diff --git a/Gopkg.toml b/Gopkg.toml index 7595abb2a4..81598f106b 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -30,19 +30,19 @@ required = ["sigs.k8s.io/testing_frameworks/integration", [[constraint]] name = "k8s.io/api" - version = "kubernetes-1.13.4" + version = "kubernetes-1.14.1" [[constraint]] name = "k8s.io/apiextensions-apiserver" - version = "kubernetes-1.13.4" + version = "kubernetes-1.14.1" [[constraint]] name = "k8s.io/apimachinery" - version = "kubernetes-1.13.4" + version = "kubernetes-1.14.1" [[constraint]] name = "k8s.io/client-go" - version = "kubernetes-1.13.4" + version = "kubernetes-1.14.1" [[constraint]] name = "sigs.k8s.io/testing_frameworks" diff --git a/go.mod b/go.mod index 442d253eb8..568ccb60da 100644 --- a/go.mod +++ b/go.mod @@ -7,27 +7,22 @@ require ( github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect github.com/evanphx/json-patch v4.1.0+incompatible - github.com/fsnotify/fsnotify v1.4.7 // indirect github.com/go-logr/logr v0.1.0 github.com/go-logr/zapr v0.1.0 github.com/gogo/protobuf v1.1.1 // indirect github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 // indirect - github.com/golang/protobuf v1.2.0 // indirect - github.com/google/btree v1.0.0 // indirect github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect github.com/googleapis/gnostic v0.2.0 // indirect - github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47 // indirect - github.com/hpcloud/tail v1.0.0 // indirect github.com/imdario/mergo v0.3.6 // indirect github.com/json-iterator/go v1.1.5 // indirect + github.com/kr/pretty v0.1.0 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect github.com/onsi/ginkgo v1.6.0 - github.com/onsi/gomega v1.4.1 + github.com/onsi/gomega v1.4.2 github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c // indirect - github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.8.1 // indirect github.com/prometheus/client_golang v0.9.0 github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 @@ -38,23 +33,18 @@ require ( go.uber.org/multierr v1.1.0 // indirect go.uber.org/zap v1.9.1 golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac // indirect - golang.org/x/net v0.0.0-20180821023952-922f4815f713 // indirect golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be // indirect golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect - golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc // indirect - golang.org/x/text v0.3.0 // indirect golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 // indirect google.golang.org/appengine v1.1.0 // indirect - gopkg.in/fsnotify.v1 v1.4.7 // indirect + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - gopkg.in/yaml.v2 v2.2.1 // indirect - k8s.io/api v0.0.0-20190222213804-5cb15d344471 - k8s.io/apiextensions-apiserver v0.0.0-20190228180357-d002e88f6236 - k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628 - k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4 - k8s.io/klog v0.1.0 // indirect + k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b + k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8 + k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d + k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c // indirect + k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5 // indirect sigs.k8s.io/testing_frameworks v0.1.1 sigs.k8s.io/yaml v1.1.0 ) diff --git a/go.sum b/go.sum index 0926a773e8..b5e1bdd0c3 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,7 @@ github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 h1:Kn3rqvbUFqSe github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/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/evanphx/json-patch v4.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -21,14 +22,10 @@ github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 h1:u4bArs140e9+A github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g= github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47 h1:UnszMmmmm5vLwWzDjTFVIkfhvWF1NdrmChl8L2NUDCw= github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= @@ -37,6 +34,11 @@ github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -45,12 +47,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLD github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.1 h1:PZSj/UFNaVp3KxrzHOcS7oyuWA7LoOY/77yCTEFu21U= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.2 h1:3mYCb7aPxS/RU7TI1y4rkEn1oKmPRjNJLNEXgw7MH2I= +github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c h1:MUyE44mTvnI5A0xrxIxaMqoWFzPfQvtE2IWUollMDMs= github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= -github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -63,10 +63,14 @@ github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e h1:n/3MEhJQjQxrO github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273 h1:agujYaXJSxSo18YNX3jzl+4G6Bstwt+kqv47GS12uL0= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= @@ -75,22 +79,24 @@ go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac h1:7d7lG9fHOLdL6jZPtnV4LpI41SbohIJ1Atq7U991dMg= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/net v0.0.0-20180821023952-922f4815f713 h1:rMJUcaDGbG+X967I4zGKCq5laYqcGKJmpB+3jhpOhPw= -golang.org/x/net v0.0.0-20180821023952-922f4815f713/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc h1:MeuS1UDyZyFH++6vVy44PuufTeFF0d0nfI6XB87YGSk= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 h1:+DCIGbF/swA92ohVg0//6X2IVY3KZs6p9mix0ziNYJM= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -99,18 +105,20 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -k8s.io/api v0.0.0-20190222213804-5cb15d344471 h1:MzQGt8qWQCR+39kbYRd0uQqsvSidpYqJLFeWiJ9l4OE= -k8s.io/api v0.0.0-20190222213804-5cb15d344471/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/apiextensions-apiserver v0.0.0-20190228180357-d002e88f6236 h1:JfFtjaElBIgYKCWEtYQkcNrTpW+lMO4GJy8NP6SVQmM= -k8s.io/apiextensions-apiserver v0.0.0-20190228180357-d002e88f6236/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= -k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628 h1:UYfHH+KEF88OTg+GojQUwFTNxbxwmoktLwutUzR0GPg= -k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4 h1:aE8wOCKuoRs2aU0OP/Rz8SXiAB0FTTku3VtGhhrkSmc= -k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/klog v0.1.0 h1:I5HMfc/DtuVaGR1KPwUrTc476K8NCqNBldC7H4dYEzk= -k8s.io/klog v0.1.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b h1:aBGgKJUM9Hk/3AE8WaZIApnTxG35kbuQba2w+SXqezo= +k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= +k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8 h1:q1Qvjzs/iEdXF6A1a8H3AKVFDzJNcJn3nXMs6R6qFtA= +k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= +k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d h1:Jmdtdt1ZnoGfWWIIik61Z7nKYgO3J+swQJtPYsP9wHA= +k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9K8qaUmXINrkXO135kA11/i5Kg1RUydgaMQ= +k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= +k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c h1:3KSCztE7gPitlZmWbNwue/2U0YruD65DqX3INopDAQM= k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= +k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5 h1:VBM/0P5TWxwk+Nw6Z+lAw3DKgO76g90ETOiA6rfLV1Y= +k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/testing_frameworks v0.1.1 h1:cP2l8fkA3O9vekpy5Ks8mmA0NW/F7yBdXf8brkWhVrs= sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= diff --git a/hack/check-everything.sh b/hack/check-everything.sh index fd89d43547..8be828f447 100755 --- a/hack/check-everything.sh +++ b/hack/check-everything.sh @@ -19,7 +19,7 @@ set -e hack_dir=$(dirname ${BASH_SOURCE}) source ${hack_dir}/common.sh -k8s_version=1.13.1 +k8s_version=1.14.1 goarch=amd64 goos="unknown" diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index 5c25de3e24..930e97d9f6 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -1074,7 +1074,7 @@ var _ = Describe("Client", func() { Expect(err).NotTo(HaveOccurred()) By("patching the Deployment with dry-run") - err = cl.Patch(context.TODO(), dep, client.ConstantPatch(types.MergePatchType, mergePatch), client.UpdatePatchWith(client.UpdateDryRunAll())) + err = cl.Patch(context.TODO(), dep, client.ConstantPatch(types.MergePatchType, mergePatch), client.PatchDryRunAll()) Expect(err).NotTo(HaveOccurred()) By("validating patched Deployment doesn't have the new annotation") @@ -1183,7 +1183,7 @@ var _ = Describe("Client", func() { Kind: "Deployment", Version: "v1", }) - err = cl.Patch(context.TODO(), u, client.ConstantPatch(types.MergePatchType, mergePatch), client.UpdatePatchWith(client.UpdateDryRunAll())) + err = cl.Patch(context.TODO(), u, client.ConstantPatch(types.MergePatchType, mergePatch), client.PatchDryRunAll()) Expect(err).NotTo(HaveOccurred()) By("validating patched Deployment does not have the new annotation") @@ -2153,6 +2153,30 @@ var _ = Describe("Client", func() { Expect(co.AsUpdateOptions()).To(Equal(&metav1.UpdateOptions{})) }) }) + + Describe("PatchOptions", func() { + It("should allow setting DryRun to 'all'", func() { + po := &client.PatchOptions{} + client.PatchDryRunAll()(po) + all := []string{metav1.DryRunAll} + Expect(po.AsPatchOptions().DryRun).To(Equal(all)) + }) + + It("should allow setting Force to 'true'", func() { + po := &client.PatchOptions{} + client.PatchWithForce()(po) + mpo := po.AsPatchOptions() + Expect(mpo.Force).NotTo(BeNil()) + Expect(*mpo.Force).To(BeTrue()) + }) + + It("should produce empty metav1.PatchOptions if nil", func() { + var po *client.PatchOptions + Expect(po.AsPatchOptions()).To(Equal(&metav1.PatchOptions{})) + po = &client.PatchOptions{} + Expect(po.AsPatchOptions()).To(Equal(&metav1.PatchOptions{})) + }) + }) }) var _ = Describe("DelegatingReader", func() { diff --git a/pkg/client/fake/client.go b/pkg/client/fake/client.go index 2e9a64a74c..d3e6f747dc 100644 --- a/pkg/client/fake/client.go +++ b/pkg/client/fake/client.go @@ -187,6 +187,15 @@ func (c *fakeClient) Update(ctx context.Context, obj runtime.Object, opts ...cli } func (c *fakeClient) Patch(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOptionFunc) error { + patchOptions := &client.PatchOptions{} + patchOptions.ApplyOptions(opts) + + for _, dryRunOpt := range patchOptions.DryRun { + if dryRunOpt == metav1.DryRunAll { + return nil + } + } + gvr, err := getGVRFromObject(obj, c.scheme) if err != nil { return err diff --git a/pkg/client/interfaces.go b/pkg/client/interfaces.go index 1cf9be68e6..70149a9224 100644 --- a/pkg/client/interfaces.go +++ b/pkg/client/interfaces.go @@ -443,7 +443,20 @@ func UpdateDryRunAll() UpdateOptionFunc { // PatchOptions contains options for patch requests. type PatchOptions struct { - UpdateOptions + // When present, indicates that modifications should not be + // persisted. An invalid or unrecognized dryRun directive will + // result in an error response and no further processing of the + // request. Valid values are: + // - All: all dry run stages will be processed + DryRun []string + // Force is going to "force" Apply requests. It means user will + // re-acquire conflicting fields owned by other people. Force + // flag must be unset for non-apply patch requests. + // +optional + Force *bool + + // Raw represents raw PatchOptions, as passed to the API server. + Raw *metav1.PatchOptions } // ApplyOptions executes the given PatchOptionFuncs, mutating these PatchOptions. @@ -455,19 +468,39 @@ func (o *PatchOptions) ApplyOptions(optFuncs []PatchOptionFunc) *PatchOptions { return o } +// AsPatchOptions returns these options as a metav1.PatchOptions. +// This may mutate the Raw field. +func (o *PatchOptions) AsPatchOptions() *metav1.PatchOptions { + if o == nil { + return &metav1.PatchOptions{} + } + if o.Raw == nil { + o.Raw = &metav1.PatchOptions{} + } + + o.Raw.DryRun = o.DryRun + o.Raw.Force = o.Force + return o.Raw +} + // PatchOptionFunc is a function that mutates a PatchOptions struct. It implements // the functional options pattern. See // https://github.com/tmrts/go-patterns/blob/master/idiom/functional-options.md. type PatchOptionFunc func(*PatchOptions) -// Sadly, we need a separate function to "adapt" PatchOptions to the constituent -// update options, since there's no way to write a function that works for both. +// PatchDryRunAll is a functional option that sets the DryRun +// field of a PatchOptions struct to metav1.DryRunAll. +func PatchDryRunAll() PatchOptionFunc { + return func(opts *PatchOptions) { + opts.DryRun = []string{metav1.DryRunAll} + } +} -// UpdatePatchWith adapts the given UpdateOptionFuncs to be a PatchOptionFunc. -func UpdatePatchWith(optFuncs ...UpdateOptionFunc) PatchOptionFunc { +// PatchWithForce is a functional option that sets the Force +// field of a PatchOptions struct to true. +func PatchWithForce() PatchOptionFunc { + force := true return func(opts *PatchOptions) { - for _, optFunc := range optFuncs { - optFunc(&opts.UpdateOptions) - } + opts.Force = &force } } diff --git a/pkg/client/typed_client.go b/pkg/client/typed_client.go index f23aa8b2d8..50f2817001 100644 --- a/pkg/client/typed_client.go +++ b/pkg/client/typed_client.go @@ -103,7 +103,7 @@ func (c *typedClient) Patch(ctx context.Context, obj runtime.Object, patch Patch NamespaceIfScoped(o.GetNamespace(), o.isNamespaced()). Resource(o.resource()). Name(o.GetName()). - VersionedParams(patchOpts.ApplyOptions(opts).AsUpdateOptions(), c.paramCodec). + VersionedParams(patchOpts.ApplyOptions(opts).AsPatchOptions(), c.paramCodec). Body(data). Context(ctx). Do(). diff --git a/pkg/client/unstructured_client.go b/pkg/client/unstructured_client.go index 49700c14bc..d182bf3552 100644 --- a/pkg/client/unstructured_client.go +++ b/pkg/client/unstructured_client.go @@ -108,7 +108,7 @@ func (uc *unstructuredClient) Patch(_ context.Context, obj runtime.Object, patch } patchOpts := &PatchOptions{} - i, err := r.Patch(u.GetName(), patch.Type(), data, *patchOpts.ApplyOptions(opts).AsUpdateOptions()) + i, err := r.Patch(u.GetName(), patch.Type(), data, *patchOpts.ApplyOptions(opts).AsPatchOptions()) if err != nil { return err } diff --git a/pkg/leaderelection/leader_election.go b/pkg/leaderelection/leader_election.go index fb8019abe1..9e13fd7968 100644 --- a/pkg/leaderelection/leader_election.go +++ b/pkg/leaderelection/leader_election.go @@ -84,6 +84,7 @@ func NewResourceLock(config *rest.Config, recorderProvider recorder.Provider, op options.LeaderElectionNamespace, options.LeaderElectionID, client.CoreV1(), + client.CoordinationV1(), resourcelock.ResourceLockConfig{ Identity: id, EventRecorder: recorderProvider.GetEventRecorderFor(id), diff --git a/pkg/metrics/client_go_adapter.go b/pkg/metrics/client_go_adapter.go index 5dfc120397..3b2c316280 100644 --- a/pkg/metrics/client_go_adapter.go +++ b/pkg/metrics/client_go_adapter.go @@ -20,12 +20,25 @@ import ( "net/url" "time" + "k8s.io/apimachinery/pkg/util/runtime" + "github.com/prometheus/client_golang/prometheus" reflectormetrics "k8s.io/client-go/tools/cache" clientmetrics "k8s.io/client-go/tools/metrics" workqueuemetrics "k8s.io/client-go/util/workqueue" ) +const ( + workQueueSubsystem = "workqueue" + depthKey = "depth" + addsKey = "adds_total" + queueLatencyKey = "queue_duration_seconds" + workDurationKey = "work_duration_seconds" + unfinishedWorkKey = "unfinished_work_seconds" + longestRunningProcessorKey = "longest_running_processor_seconds" + retriesKey = "retries_total" +) + // this file contains setup logic to initialize the myriad of places // that client-go registers metrics. We copy the names and formats // from Kubernetes so that we match the core controllers. @@ -107,54 +120,52 @@ var ( // workqueue metrics - workQueueSubsystem = "workqueue" - depth = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Subsystem: workQueueSubsystem, - Name: "depth", + Name: depthKey, Help: "Current depth of workqueue", }, []string{"name"}) adds = prometheus.NewCounterVec(prometheus.CounterOpts{ Subsystem: workQueueSubsystem, - Name: "adds_total", + Name: addsKey, Help: "Total number of adds handled by workqueue", }, []string{"name"}) latency = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Subsystem: workQueueSubsystem, - Name: "queue_latency_seconds", + Name: queueLatencyKey, Help: "How long in seconds an item stays in workqueue before being requested.", Buckets: prometheus.ExponentialBuckets(10e-9, 10, 10), }, []string{"name"}) workDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Subsystem: workQueueSubsystem, - Name: "work_duration_seconds", + Name: workDurationKey, Help: "How long in seconds processing an item from workqueue takes.", Buckets: prometheus.ExponentialBuckets(10e-9, 10, 10), }, []string{"name"}) - retries = prometheus.NewCounterVec(prometheus.CounterOpts{ + unfinishedWork = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Subsystem: workQueueSubsystem, - Name: "retries_total", - Help: "Total number of retries handled by workqueue", + Name: unfinishedWorkKey, + Help: "How many seconds of work has done that " + + "is in progress and hasn't been observed by work_duration. Large " + + "values indicate stuck threads. One can deduce the number of stuck " + + "threads by observing the rate at which this increases.", }, []string{"name"}) longestRunning = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Subsystem: workQueueSubsystem, - Name: "longest_running_processor_microseconds", - Help: "How many microseconds has the longest running " + + Name: longestRunningProcessorKey, + Help: "How many seconds has the longest running " + "processor for workqueue been running.", }, []string{"name"}) - unfinishedWork = prometheus.NewGaugeVec(prometheus.GaugeOpts{ + retries = prometheus.NewCounterVec(prometheus.CounterOpts{ Subsystem: workQueueSubsystem, - Name: "unfinished_work_seconds", - Help: "How many seconds of work has done that " + - "is in progress and hasn't been observed by work_duration. Large " + - "values indicate stuck threads. One can deduce the number of stuck " + - "threads by observing the rate at which this increases.", + Name: retriesKey, + Help: "Total number of retries handled by workqueue", }, []string{"name"}) ) @@ -278,22 +289,98 @@ func (workqueueMetricsProvider) NewAddsMetric(name string) workqueuemetrics.Coun return adds.WithLabelValues(name) } -func (workqueueMetricsProvider) NewLatencyMetric(name string) workqueuemetrics.SummaryMetric { +func (workqueueMetricsProvider) NewLatencyMetric(name string) workqueuemetrics.HistogramMetric { return latency.WithLabelValues(name) } -func (workqueueMetricsProvider) NewWorkDurationMetric(name string) workqueuemetrics.SummaryMetric { +func (workqueueMetricsProvider) NewWorkDurationMetric(name string) workqueuemetrics.HistogramMetric { return workDuration.WithLabelValues(name) } +func (workqueueMetricsProvider) NewUnfinishedWorkSecondsMetric(name string) workqueuemetrics.SettableGaugeMetric { + return unfinishedWork.WithLabelValues(name) +} + +func (workqueueMetricsProvider) NewLongestRunningProcessorSecondsMetric(name string) workqueuemetrics.SettableGaugeMetric { + return longestRunning.WithLabelValues(name) +} + func (workqueueMetricsProvider) NewRetriesMetric(name string) workqueuemetrics.CounterMetric { return retries.WithLabelValues(name) } -func (workqueueMetricsProvider) NewLongestRunningProcessorMicrosecondsMetric(name string) workqueuemetrics.SettableGaugeMetric { - return longestRunning.WithLabelValues(name) +func (workqueueMetricsProvider) NewDeprecatedDepthMetric(name string) workqueuemetrics.GaugeMetric { + depth := prometheus.NewGauge(prometheus.GaugeOpts{ + Subsystem: name, + Name: "depth", + Help: "Current depth of workqueue: " + name, + }) + runtime.HandleError(Registry.Register(depth)) + return depth } -func (workqueueMetricsProvider) NewUnfinishedWorkSecondsMetric(name string) workqueuemetrics.SettableGaugeMetric { - return unfinishedWork.WithLabelValues(name) +func (workqueueMetricsProvider) NewDeprecatedAddsMetric(name string) workqueuemetrics.CounterMetric { + adds := prometheus.NewCounter(prometheus.CounterOpts{ + Subsystem: name, + Name: "adds", + Help: "Total number of adds handled by workqueue: " + name, + }) + runtime.HandleError(Registry.Register(adds)) + return adds +} + +func (workqueueMetricsProvider) NewDeprecatedLatencyMetric(name string) workqueuemetrics.SummaryMetric { + latency := prometheus.NewSummary(prometheus.SummaryOpts{ + Subsystem: name, + Name: "queue_latency", + Help: "How long an item stays in workqueue" + name + " before being requested.", + ConstLabels: prometheus.Labels{"name": name}, + }) + runtime.HandleError(Registry.Register(latency)) + return latency +} + +func (workqueueMetricsProvider) NewDeprecatedWorkDurationMetric(name string) workqueuemetrics.SummaryMetric { + workDuration := prometheus.NewSummary(prometheus.SummaryOpts{ + Subsystem: name, + Name: "work_duration", + Help: "How long processing an item from workqueue" + name + " takes.", + ConstLabels: prometheus.Labels{"name": name}, + }) + runtime.HandleError(Registry.Register(workDuration)) + return workDuration +} + +func (workqueueMetricsProvider) NewDeprecatedUnfinishedWorkSecondsMetric(name string) workqueuemetrics.SettableGaugeMetric { + unfinishedWork := prometheus.NewGauge(prometheus.GaugeOpts{ + Subsystem: name, + Name: "unfinished_work_seconds", + Help: "How many seconds of work " + name + " has done that " + + "is in progress and hasn't been observed by work_duration. Large " + + "values indicate stuck threads. One can deduce the number of stuck " + + "threads by observing the rate at which this increases.", + }) + runtime.HandleError(Registry.Register(unfinishedWork)) + return unfinishedWork +} + +func (workqueueMetricsProvider) NewDeprecatedLongestRunningProcessorMicrosecondsMetric(name string) workqueuemetrics.SettableGaugeMetric { + longestRunning := prometheus.NewGauge(prometheus.GaugeOpts{ + Subsystem: name, + Name: "longest_running_processor_microseconds", + Help: "How many microseconds has the longest running " + + "processor for " + name + " been running.", + }) + runtime.HandleError(Registry.Register(longestRunning)) + return longestRunning +} + +func (workqueueMetricsProvider) NewDeprecatedRetriesMetric(name string) workqueuemetrics.CounterMetric { + retries := prometheus.NewCounter(prometheus.CounterOpts{ + Subsystem: name, + Name: "retries", + Help: "Total number of retries handled by workqueue: " + name, + }) + runtime.HandleError(Registry.Register(retries)) + return retries } diff --git a/pkg/scheme/scheme_test.go b/pkg/scheme/scheme_test.go index cb7612203f..6efcc72655 100644 --- a/pkg/scheme/scheme_test.go +++ b/pkg/scheme/scheme_test.go @@ -37,11 +37,13 @@ var _ = Describe("Scheme", func() { Build() Expect(err).NotTo(HaveOccurred()) - Expect(s.AllKnownTypes()).To(HaveLen(15)) + Expect(s.AllKnownTypes()).To(HaveLen(16)) Expect(s.AllKnownTypes()[gv.WithKind("Pod")]).To(Equal(reflect.TypeOf(corev1.Pod{}))) Expect(s.AllKnownTypes()[gv.WithKind("PodList")]).To(Equal(reflect.TypeOf(corev1.PodList{}))) // Base types + Expect(s.AllKnownTypes()).To(HaveKey(gv.WithKind("UpdateOptions"))) + Expect(s.AllKnownTypes()).To(HaveKey(gv.WithKind("PatchOptions"))) Expect(s.AllKnownTypes()).To(HaveKey(gv.WithKind("DeleteOptions"))) Expect(s.AllKnownTypes()).To(HaveKey(gv.WithKind("ExportOptions"))) Expect(s.AllKnownTypes()).To(HaveKey(gv.WithKind("GetOptions"))) @@ -71,7 +73,7 @@ var _ = Describe("Scheme", func() { Build() Expect(err).NotTo(HaveOccurred()) - Expect(s.AllKnownTypes()).To(HaveLen(25)) + Expect(s.AllKnownTypes()).To(HaveLen(27)) // Types from b1 Expect(s.AllKnownTypes()[gv1.WithKind("Pod")]).To(Equal(reflect.TypeOf(corev1.Pod{}))) @@ -82,6 +84,8 @@ var _ = Describe("Scheme", func() { Expect(s.AllKnownTypes()[gv2.WithKind("Deployment")]).To(Equal(reflect.TypeOf(appsv1.Deployment{}))) // Base types + Expect(s.AllKnownTypes()).To(HaveKey(gv1.WithKind("UpdateOptions"))) + Expect(s.AllKnownTypes()).To(HaveKey(gv1.WithKind("PatchOptions"))) Expect(s.AllKnownTypes()).To(HaveKey(gv1.WithKind("DeleteOptions"))) Expect(s.AllKnownTypes()).To(HaveKey(gv1.WithKind("ExportOptions"))) Expect(s.AllKnownTypes()).To(HaveKey(gv1.WithKind("GetOptions"))) @@ -91,6 +95,8 @@ var _ = Describe("Scheme", func() { internalGv1 := schema.GroupVersion{Group: "core", Version: "__internal"} Expect(s.AllKnownTypes()).To(HaveKey(internalGv1.WithKind("WatchEvent"))) + Expect(s.AllKnownTypes()).To(HaveKey(gv2.WithKind("UpdateOptions"))) + Expect(s.AllKnownTypes()).To(HaveKey(gv2.WithKind("PatchOptions"))) Expect(s.AllKnownTypes()).To(HaveKey(gv2.WithKind("DeleteOptions"))) Expect(s.AllKnownTypes()).To(HaveKey(gv2.WithKind("ExportOptions"))) Expect(s.AllKnownTypes()).To(HaveKey(gv2.WithKind("GetOptions")))