From 0c32b44df03c80ab564d92e7bcfc687a87192625 Mon Sep 17 00:00:00 2001 From: Johannes Kohnen Date: Sat, 21 Jul 2018 09:04:06 +0000 Subject: [PATCH 1/2] Upgrade dependencies: go-client v8.0.0, k8s v1.11 * Add dependency to apimachinery; use it for ListOptions * Change code to reflect breaking changes of go-client v5.0.0: + Enforced explicit references to API group client interfaces in clientsets to avoid ambiguity. + Moved pkg/api and pkg/apis to k8s.io/api See https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md#v500 * Rename package imports that have API version as their last label to better reflect which API they represent * Migrate objects to newer API versions: Some k8s objects have migrated to newer apiVersions like apps/v1, core/v1. --- Gopkg.lock | 511 +++++++++++++++++++++++------------------------ Gopkg.toml | 28 ++- kube/resource.go | 135 ++++++------- 3 files changed, 344 insertions(+), 330 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index d04e2ab..ef32459 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,377 +2,327 @@ [[projects]] - name = "cloud.google.com/go" - packages = ["compute/metadata"] - revision = "44bcd0b2078ba5e7fedbeb36808d1ed893534750" - version = "v0.11.0" - -[[projects]] - name = "github.com/PuerkitoBio/purell" - packages = ["."] - revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4" - version = "v1.1.0" - -[[projects]] - branch = "master" - name = "github.com/PuerkitoBio/urlesc" - packages = ["."] - revision = "de5bf2ad457846296e2031421a34e2568e304e35" - -[[projects]] - name = "github.com/blang/semver" - packages = ["."] - revision = "2ee87856327ba09384cabd113bc6b5d174e9ec0f" - version = "v3.5.1" - -[[projects]] - branch = "master" + digest = "1:3b74e38513b3fa3e50d77f1b4976cd5eac1d8415a25536c83072530d1c104eaa" name = "github.com/c-bata/go-prompt" packages = [ ".", - "completer" - ] - revision = "536e34532a12f0ec10fad595138094ed93ec03ce" - -[[projects]] - branch = "master" - name = "github.com/coreos/go-oidc" - packages = [ - "http", - "jose", - "key", - "oauth2", - "oidc" - ] - revision = "a4973d9a4225417aecf5d450a9522f00c1f7130f" - -[[projects]] - name = "github.com/coreos/pkg" - packages = [ - "health", - "httputil", - "timeutil" - ] - revision = "3ac0863d7acf3bc44daf49afef8919af12f704ef" - version = "v3" - -[[projects]] - name = "github.com/davecgh/go-spew" - packages = ["spew"] - revision = "346938d642f2ec3594ed81d874461961cd0faa76" - version = "v1.1.0" - -[[projects]] - name = "github.com/docker/distribution" - packages = [ - "digest", - "reference" - ] - revision = "48294d928ced5dd9b378f7fd7c6f5da3ff3f2c89" - version = "v2.6.2" - -[[projects]] - name = "github.com/emicklei/go-restful" - packages = [ - ".", - "log", - "swagger" + "completer", ] - revision = "777bb3f19bcafe2575ffb2a3e46af92509ae9594" - version = "v1.2" + pruneopts = "UT" + revision = "c52492ff1b386e5c0ba5271b5eaad165fab09eca" + version = "v0.2.2" [[projects]] + digest = "1:2cd7915ab26ede7d95b8749e6b1f933f1c6d5398030684e6505940a10f31cfda" name = "github.com/ghodss/yaml" packages = ["."] + pruneopts = "UT" revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" version = "v1.0.0" [[projects]] - branch = "master" - name = "github.com/go-openapi/jsonpointer" - packages = ["."] - revision = "779f45308c19820f1a69e9a4cd965f496e0da10f" - -[[projects]] - branch = "master" - name = "github.com/go-openapi/jsonreference" - packages = ["."] - revision = "36d33bfe519efae5632669801b180bf1a245da3b" - -[[projects]] - branch = "master" - name = "github.com/go-openapi/spec" - packages = ["."] - revision = "3faa0055dbbf2110abc1f3b4e3adbb22721e96e7" - -[[projects]] - branch = "master" - name = "github.com/go-openapi/swag" - packages = ["."] - revision = "f3f9494671f93fcff853e3c6e9e948b3eb71e590" - -[[projects]] + digest = "1:3c5fa2da8cbfa81f2811f5164a60801f4b6fdb0160636da2b228cbbdec4da098" name = "github.com/gogo/protobuf" packages = [ "proto", - "sortkeys" + "sortkeys", ] - revision = "100ba4e885062801d56799d78530b73b178a78f3" - version = "v0.4" + pruneopts = "UT" + revision = "636bf0302bc95575d69441b25a2603156ffdddf1" + version = "v1.1.1" [[projects]] branch = "master" + digest = "1:1ba1d79f2810270045c328ae5d674321db34e3aae468eb4233883b473c5c0467" name = "github.com/golang/glog" packages = ["."] + pruneopts = "UT" revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" [[projects]] - branch = "master" + digest = "1:cb22af0ed7c72d495d8be1106233ee553898950f15fd3f5404406d44c2e86888" name = "github.com/golang/protobuf" - packages = ["proto"] - revision = "ab9f9a6dab164b7d1246e0e688b0ab7b94d8553e" + packages = [ + "proto", + "ptypes", + "ptypes/any", + "ptypes/duration", + "ptypes/timestamp", + ] + pruneopts = "UT" + revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" + version = "v1.1.0" [[projects]] branch = "master" - name = "github.com/google/gofuzz" + digest = "1:9887333bbef17574b1db5f9893ea137ac44107235d624408a3ac9e0b98fbb2cb" + name = "github.com/google/btree" packages = ["."] - revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1" + pruneopts = "UT" + revision = "e89373fe6b4a7413d7acd6da1725b83ef713e6e4" [[projects]] branch = "master" - name = "github.com/howeyc/gopass" + digest = "1:3ee90c0d94da31b442dde97c99635aaafec68d0b8a3c12ee2075c6bdabeec6bb" + name = "github.com/google/gofuzz" packages = ["."] - revision = "bf9dde6d0d2c004a008c27aaee91170c786f6db8" + pruneopts = "UT" + revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1" [[projects]] - name = "github.com/imdario/mergo" - packages = ["."] - revision = "3e95a51e0639b4cf372f2ccf74c86749d747fbdc" - version = "0.2.2" + digest = "1:a6a3cf96c8f626d50c11f5ab6c6a92e3ccde777aafe091dd305224c85d3c0030" + name = "github.com/googleapis/gnostic" + packages = [ + "OpenAPIv2", + "compiler", + "extensions", + ] + pruneopts = "UT" + revision = "7c663266750e7d82587642f65e60bc4083f1f84e" + version = "v0.2.0" [[projects]] - name = "github.com/jonboulle/clockwork" - packages = ["."] - revision = "2eee05ed794112d45db504eb05aa693efd2b8b09" - version = "v0.1.0" + branch = "master" + digest = "1:d9221e54176cdc408f6cb9cc35626743e8728fd7e69e5b0df075df15e4bec895" + name = "github.com/gregjones/httpcache" + packages = [ + ".", + "diskcache", + ] + pruneopts = "UT" + revision = "9cad4c3443a7200dd6400aef47183728de563a38" [[projects]] - branch = "master" - name = "github.com/juju/ratelimit" + digest = "1:3e260afa138eab6492b531a3b3d10ab4cb70512d423faa78b8949dec76e66a21" + name = "github.com/imdario/mergo" packages = ["."] - revision = "5b9ff866471762aa2ab2dced63c9fb6f53921342" + pruneopts = "UT" + revision = "9316a62528ac99aaecb4e47eadd6dc8aa6533d58" + version = "v0.3.5" [[projects]] - branch = "master" - name = "github.com/mailru/easyjson" - packages = [ - "buffer", - "jlexer", - "jwriter" - ] - revision = "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" + digest = "1:eaefc85d32c03e5f0c2b88ea2f79fce3d993e2c78316d21319575dd4ea9153ca" + name = "github.com/json-iterator/go" + packages = ["."] + pruneopts = "UT" + revision = "ab8a2e0c74be9d3be70b3184d9acc634935ded82" + version = "1.1.4" [[projects]] + digest = "1:c658e84ad3916da105a761660dcaeb01e63416c8ec7bc62256a9b411a05fcd67" name = "github.com/mattn/go-colorable" packages = ["."] + pruneopts = "UT" revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072" version = "v0.0.9" [[projects]] + digest = "1:d4d17353dbd05cb52a2a52b7fe1771883b682806f68db442b436294926bbfafb" name = "github.com/mattn/go-isatty" packages = ["."] + pruneopts = "UT" revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39" version = "v0.0.3" [[projects]] branch = "master" + digest = "1:cdb899c199f907ac9fb50495ec71212c95cb5b0e0a8ee0800da0238036091033" name = "github.com/mattn/go-runewidth" packages = ["."] + pruneopts = "UT" revision = "ce7b0b5c7b45a81508558cd1dba6bb1e4ddb51bb" [[projects]] branch = "master" + digest = "1:d775613e6db40f54d34cc8b319ee5c2df56752f9f5e55e2f6004d11684bdc8fd" name = "github.com/mattn/go-tty" packages = ["."] - revision = "3f2ec5c5d422363dc174b78b1615415fef224055" + pruneopts = "UT" + revision = "931426f7535ac39720c8909d70ece5a41a2502a6" + +[[projects]] + digest = "1:33422d238f147d247752996a26574ac48dcf472976eda7f5134015f06bf16563" + name = "github.com/modern-go/concurrent" + packages = ["."] + pruneopts = "UT" + revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94" + version = "1.0.3" [[projects]] - name = "github.com/pborman/uuid" + digest = "1:e32bdbdb7c377a07a9a46378290059822efdce5c8d96fe71940d87cb4f918855" + name = "github.com/modern-go/reflect2" packages = ["."] - revision = "e790cca94e6cc75c7064b1332e63811d4aae1a53" - version = "v1.1" + pruneopts = "UT" + revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" + version = "1.0.1" [[projects]] branch = "master" - name = "github.com/pkg/term" - packages = ["termios"] - revision = "b1f72af2d63057363398bec5873d16a98b453312" + digest = "1:3bf17a6e6eaa6ad24152148a631d18662f7212e21637c2699bff3369b7f00fa2" + name = "github.com/petar/GoLLRB" + packages = ["llrb"] + pruneopts = "UT" + revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" [[projects]] - name = "github.com/spf13/pflag" + digest = "1:0e7775ebbcf00d8dd28ac663614af924411c868dca3d5aa762af0fae3808d852" + name = "github.com/peterbourgon/diskv" packages = ["."] - revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66" - version = "v1.0.0" + pruneopts = "UT" + revision = "5f041e8faa004a95c88a202771f4cc3e991971e6" + version = "v2.0.1" [[projects]] branch = "master" - name = "github.com/ugorji/go" - packages = ["codec"] - revision = "5efa3251c7f7d05e5d9704a69a984ec9f1386a40" + digest = "1:4f43b3c1b7e44980a5f3c593f8bf0e18844dc44f451a071c93e77e28cf990db6" + name = "github.com/pkg/term" + packages = ["termios"] + pruneopts = "UT" + revision = "cda20d4ac917ad418d86e151eff439648b06185b" + +[[projects]] + digest = "1:9424f440bba8f7508b69414634aef3b2b3a877e522d8a4624692412805407bb7" + name = "github.com/spf13/pflag" + packages = ["."] + pruneopts = "UT" + revision = "583c0c0531f06d5278b7d917446061adc344b5cd" + version = "v1.0.1" [[projects]] branch = "master" + digest = "1:3f3a05ae0b95893d90b9b3b5afdb79a9b3d96e4e36e099d841ae602e4aca0da8" name = "golang.org/x/crypto" packages = ["ssh/terminal"] - revision = "eb71ad9bd329b5ac0fd0148dd99bd62e8be8e035" + pruneopts = "UT" + revision = "a2144134853fc9a27a7b1e3eb4f19f1a76df13c9" [[projects]] branch = "master" + digest = "1:f794603640683e0aad4867a2ad4d145483730147d27230d8568eac7213097005" name = "golang.org/x/net" packages = [ "context", - "context/ctxhttp", + "http/httpguts", "http2", "http2/hpack", "idna", - "lex/httplex" ] - revision = "1c05540f6879653db88113bc4a2b70aec4bd491f" - -[[projects]] - branch = "master" - name = "golang.org/x/oauth2" - packages = [ - ".", - "google", - "internal", - "jws", - "jwt" - ] - revision = "9a379c6b3e95a790ffc43293c2a78dee0d7b6e20" + pruneopts = "UT" + revision = "a680a1efc54dd51c040b3b5ce4939ea3cf2ea0d1" [[projects]] branch = "master" + digest = "1:72d6244a51be9611f08994aca19677fcc31676b3e7b742c37e129e6ece4ad8fc" name = "golang.org/x/sys" packages = [ "unix", - "windows" + "windows", ] - revision = "07c182904dbd53199946ba614a412c61d3c548f5" + pruneopts = "UT" + revision = "ac767d655b305d4e9612f5f6e33120b9176c4ad4" [[projects]] - branch = "master" + digest = "1:7509ba4347d1f8de6ae9be8818b0cd1abc3deeffe28aeaf4be6d4b6b5178d9ca" name = "golang.org/x/text" packages = [ + "collate", + "collate/build", + "internal/colltab", "internal/gen", + "internal/tag", "internal/triegen", "internal/ucd", + "language", "secure/bidirule", "transform", "unicode/bidi", "unicode/cldr", "unicode/norm", "unicode/rangetable", - "width" ] - revision = "e56139fd9c5bc7244c76116c68e500765bb6db6b" + pruneopts = "UT" + revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" + version = "v0.3.0" [[projects]] - name = "google.golang.org/appengine" - packages = [ - ".", - "internal", - "internal/app_identity", - "internal/base", - "internal/datastore", - "internal/log", - "internal/modules", - "internal/remote_api", - "internal/urlfetch", - "urlfetch" - ] - revision = "150dc57a1b433e64154302bdc40b6bb8aefa313a" - version = "v1.0.0" + branch = "master" + digest = "1:c9e7a4b4d47c0ed205d257648b0e5b0440880cb728506e318f8ac7cd36270bc4" + name = "golang.org/x/time" + packages = ["rate"] + pruneopts = "UT" + revision = "fbb02b2291d28baffd63558aa44b4b56f178d650" [[projects]] + digest = "1:2d1fbdc6777e5408cabeb02bf336305e724b925ff4546ded0fa8715a7267922a" name = "gopkg.in/inf.v0" packages = ["."] - revision = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" - version = "v0.9.0" + pruneopts = "UT" + revision = "d2d2541c53f18d2a059457998ce2876cc8e67cbf" + version = "v0.9.1" [[projects]] - branch = "v2" + digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" name = "gopkg.in/yaml.v2" packages = ["."] - revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f" + pruneopts = "UT" + revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" + version = "v2.2.1" [[projects]] - name = "k8s.io/client-go" + digest = "1:ac38d38fc6250739eaea79a76df5d93892717bc2b55c8798178e726dae8472b2" + name = "k8s.io/api" + packages = [ + "admissionregistration/v1alpha1", + "admissionregistration/v1beta1", + "apps/v1", + "apps/v1beta1", + "apps/v1beta2", + "authentication/v1", + "authentication/v1beta1", + "authorization/v1", + "authorization/v1beta1", + "autoscaling/v1", + "autoscaling/v2beta1", + "batch/v1", + "batch/v1beta1", + "batch/v2alpha1", + "certificates/v1beta1", + "core/v1", + "events/v1beta1", + "extensions/v1beta1", + "networking/v1", + "policy/v1beta1", + "rbac/v1", + "rbac/v1alpha1", + "rbac/v1beta1", + "scheduling/v1alpha1", + "scheduling/v1beta1", + "settings/v1alpha1", + "storage/v1", + "storage/v1alpha1", + "storage/v1beta1", + ] + pruneopts = "UT" + revision = "072894a440bdee3a891dea811fe42902311cd2a3" + version = "kubernetes-1.11.0" + +[[projects]] + branch = "release-1.11" + digest = "1:06e9534bc87028cd2888b7d7b8693003bfd5ae01ae5c17d81e0822dd55622baf" + name = "k8s.io/apimachinery" packages = [ - "discovery", - "kubernetes", - "kubernetes/typed/apps/v1beta1", - "kubernetes/typed/authentication/v1beta1", - "kubernetes/typed/authorization/v1beta1", - "kubernetes/typed/autoscaling/v1", - "kubernetes/typed/batch/v1", - "kubernetes/typed/batch/v2alpha1", - "kubernetes/typed/certificates/v1alpha1", - "kubernetes/typed/core/v1", - "kubernetes/typed/extensions/v1beta1", - "kubernetes/typed/policy/v1beta1", - "kubernetes/typed/rbac/v1alpha1", - "kubernetes/typed/storage/v1beta1", - "pkg/api", "pkg/api/errors", - "pkg/api/install", "pkg/api/meta", - "pkg/api/meta/metatypes", "pkg/api/resource", - "pkg/api/unversioned", - "pkg/api/v1", - "pkg/api/validation/path", - "pkg/apimachinery", - "pkg/apimachinery/announced", - "pkg/apimachinery/registered", - "pkg/apis/apps", - "pkg/apis/apps/install", - "pkg/apis/apps/v1beta1", - "pkg/apis/authentication", - "pkg/apis/authentication/install", - "pkg/apis/authentication/v1beta1", - "pkg/apis/authorization", - "pkg/apis/authorization/install", - "pkg/apis/authorization/v1beta1", - "pkg/apis/autoscaling", - "pkg/apis/autoscaling/install", - "pkg/apis/autoscaling/v1", - "pkg/apis/batch", - "pkg/apis/batch/install", - "pkg/apis/batch/v1", - "pkg/apis/batch/v2alpha1", - "pkg/apis/certificates", - "pkg/apis/certificates/install", - "pkg/apis/certificates/v1alpha1", - "pkg/apis/extensions", - "pkg/apis/extensions/install", - "pkg/apis/extensions/v1beta1", - "pkg/apis/policy", - "pkg/apis/policy/install", - "pkg/apis/policy/v1beta1", - "pkg/apis/rbac", - "pkg/apis/rbac/install", - "pkg/apis/rbac/v1alpha1", - "pkg/apis/storage", - "pkg/apis/storage/install", - "pkg/apis/storage/v1beta1", - "pkg/auth/user", + "pkg/apis/meta/v1", + "pkg/apis/meta/v1/unstructured", + "pkg/apis/meta/v1beta1", "pkg/conversion", "pkg/conversion/queryparams", "pkg/fields", - "pkg/genericapiserver/openapi/common", "pkg/labels", "pkg/runtime", + "pkg/runtime/schema", "pkg/runtime/serializer", "pkg/runtime/serializer/json", "pkg/runtime/serializer/protobuf", @@ -380,52 +330,99 @@ "pkg/runtime/serializer/streaming", "pkg/runtime/serializer/versioning", "pkg/selection", - "pkg/third_party/forked/golang/reflect", - "pkg/third_party/forked/golang/template", "pkg/types", - "pkg/util", - "pkg/util/cert", "pkg/util/clock", "pkg/util/errors", - "pkg/util/flowcontrol", "pkg/util/framer", - "pkg/util/homedir", - "pkg/util/integer", "pkg/util/intstr", "pkg/util/json", - "pkg/util/jsonpath", - "pkg/util/labels", "pkg/util/net", - "pkg/util/parsers", - "pkg/util/rand", "pkg/util/runtime", "pkg/util/sets", - "pkg/util/uuid", "pkg/util/validation", "pkg/util/validation/field", "pkg/util/wait", "pkg/util/yaml", "pkg/version", "pkg/watch", - "pkg/watch/versioned", - "plugin/pkg/client/auth", - "plugin/pkg/client/auth/gcp", - "plugin/pkg/client/auth/oidc", + "third_party/forked/golang/reflect", + ] + pruneopts = "UT" + revision = "103fd098999dc9c0c88536f5c9ad2e5da39373ae" + +[[projects]] + digest = "1:a330cde2ac61f51321345cd0aee5b5789fd439e350f19b7db7424bce37ebefca" + name = "k8s.io/client-go" + packages = [ + "discovery", + "kubernetes", + "kubernetes/scheme", + "kubernetes/typed/admissionregistration/v1alpha1", + "kubernetes/typed/admissionregistration/v1beta1", + "kubernetes/typed/apps/v1", + "kubernetes/typed/apps/v1beta1", + "kubernetes/typed/apps/v1beta2", + "kubernetes/typed/authentication/v1", + "kubernetes/typed/authentication/v1beta1", + "kubernetes/typed/authorization/v1", + "kubernetes/typed/authorization/v1beta1", + "kubernetes/typed/autoscaling/v1", + "kubernetes/typed/autoscaling/v2beta1", + "kubernetes/typed/batch/v1", + "kubernetes/typed/batch/v1beta1", + "kubernetes/typed/batch/v2alpha1", + "kubernetes/typed/certificates/v1beta1", + "kubernetes/typed/core/v1", + "kubernetes/typed/events/v1beta1", + "kubernetes/typed/extensions/v1beta1", + "kubernetes/typed/networking/v1", + "kubernetes/typed/policy/v1beta1", + "kubernetes/typed/rbac/v1", + "kubernetes/typed/rbac/v1alpha1", + "kubernetes/typed/rbac/v1beta1", + "kubernetes/typed/scheduling/v1alpha1", + "kubernetes/typed/scheduling/v1beta1", + "kubernetes/typed/settings/v1alpha1", + "kubernetes/typed/storage/v1", + "kubernetes/typed/storage/v1alpha1", + "kubernetes/typed/storage/v1beta1", + "pkg/apis/clientauthentication", + "pkg/apis/clientauthentication/v1alpha1", + "pkg/apis/clientauthentication/v1beta1", + "pkg/version", + "plugin/pkg/client/auth/exec", "rest", + "rest/watch", "tools/auth", "tools/clientcmd", "tools/clientcmd/api", "tools/clientcmd/api/latest", "tools/clientcmd/api/v1", "tools/metrics", - "transport" + "tools/reference", + "transport", + "util/cert", + "util/connrotation", + "util/flowcontrol", + "util/homedir", + "util/integer", ] - revision = "e121606b0d09b2e1c467183ee46217fa85a6b672" - version = "v2.0.0" + pruneopts = "UT" + revision = "7d04d0e2a0a1a4d4a1cd6baa432a2301492e4e65" + version = "v8.0.0" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "e77fe24aa2a5b94b387be1ab37aecb16b9cb14a2430be73aa86e6934e21f4438" + input-imports = [ + "github.com/c-bata/go-prompt", + "github.com/c-bata/go-prompt/completer", + "k8s.io/api/apps/v1", + "k8s.io/api/core/v1", + "k8s.io/api/policy/v1beta1", + "k8s.io/apimachinery/pkg/apis/meta/v1", + "k8s.io/client-go/kubernetes", + "k8s.io/client-go/tools/clientcmd", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 9b9c91f..70e33e7 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -1,7 +1,6 @@ - # Gopkg.toml example # -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html # for detailed Gopkg.toml documentation. # # required = ["github.com/user/thing/cmd/thing"] @@ -17,14 +16,31 @@ # source = "github.com/myfork/project2" # # [[override]] -# name = "github.com/x/y" -# version = "2.4.0" +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true [[constraint]] name = "github.com/c-bata/go-prompt" - branch = "master" + version = "0.2.2" + +[[constraint]] + name = "k8s.io/api" + version = "kubernetes-1.11.0" + +[[constraint]] + name = "k8s.io/apimachinery" + branch = "release-1.11" [[constraint]] name = "k8s.io/client-go" - version = "2.0.0" + version = "8.0.0" + +[prune] + go-tests = true + unused-packages = true diff --git a/kube/resource.go b/kube/resource.go index d72324d..0f36a78 100644 --- a/kube/resource.go +++ b/kube/resource.go @@ -10,9 +10,10 @@ import ( "time" "github.com/c-bata/go-prompt" - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/v1" - "k8s.io/client-go/pkg/apis/extensions/v1beta1" + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + policyv1beta1 "k8s.io/api/policy/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const thresholdFetchInterval = 10 * time.Second @@ -122,14 +123,14 @@ func fetchComponentStatusList() { if !shouldFetch(key) { return } - l, _ := getClient().ComponentStatuses().List(v1.ListOptions{}) + l, _ := getClient().CoreV1().ComponentStatuses().List(metav1.ListOptions{}) componentStatusList.Store(l) updateLastFetchedAt(key) } func getComponentStatusCompletions() []prompt.Suggest { go fetchComponentStatusList() - l, ok := componentStatusList.Load().(*v1.ComponentStatusList) + l, ok := componentStatusList.Load().(*corev1.ComponentStatusList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -154,13 +155,13 @@ func fetchConfigMapList(namespace string) { return } updateLastFetchedAt(key) - l, _ := getClient().ConfigMaps(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().ConfigMaps(namespace).List(metav1.ListOptions{}) configMapsList.Store(l) } func getConfigMapSuggestions() []prompt.Suggest { - go fetchConfigMapList(api.NamespaceAll) - l, ok := configMapsList.Load().(*v1.ConfigMapList) + go fetchConfigMapList(metav1.NamespaceAll) + l, ok := configMapsList.Load().(*corev1.ConfigMapList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -220,18 +221,18 @@ func fetchPods(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().Pods(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().Pods(namespace).List(metav1.ListOptions{}) podList.Store(namespace, l) } func getPodSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchPods(namespace) x, ok := podList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.PodList) + l, ok := x.(*corev1.PodList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -245,22 +246,22 @@ func getPodSuggestions() []prompt.Suggest { return s } -func getPod(podName string) (v1.Pod, bool) { - namespace := api.NamespaceAll +func getPod(podName string) (corev1.Pod, bool) { + namespace := metav1.NamespaceAll x, ok := podList.Load(namespace) if !ok { - return v1.Pod{}, false + return corev1.Pod{}, false } - l, ok := x.(*v1.PodList) + l, ok := x.(*corev1.PodList) if !ok || len(l.Items) == 0 { - return v1.Pod{}, false + return corev1.Pod{}, false } for i := range l.Items { if podName == l.Items[i].Name { return l.Items[i], true } } - return v1.Pod{}, false + return corev1.Pod{}, false } func getPortsFromPodName(podName string) []prompt.Suggest { @@ -308,19 +309,19 @@ func fetchDaemonSetList(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().DaemonSets(namespace).List(v1.ListOptions{}) + l, _ := getClient().AppsV1().DaemonSets(namespace).List(metav1.ListOptions{}) daemonSetList.Store(namespace, l) return } func getDaemonSetSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchDaemonSetList(namespace) x, ok := daemonSetList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1beta1.DaemonSetList) + l, ok := x.(appsv1.DaemonSetList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -346,19 +347,19 @@ func fetchDeployments(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().Deployments(namespace).List(v1.ListOptions{}) + l, _ := getClient().AppsV1().Deployments(namespace).List(metav1.ListOptions{}) deploymentList.Store(namespace, l) return } func getDeploymentSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchDeployments(namespace) x, ok := deploymentList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1beta1.DeploymentList) + l, ok := x.(*appsv1.DeploymentList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -384,19 +385,19 @@ func fetchEndpoints(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().Endpoints(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().Endpoints(namespace).List(metav1.ListOptions{}) endpointList.Store(key, l) return } func getEndpointsSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchEndpoints(namespace) x, ok := endpointList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.EndpointsList) + l, ok := x.(*corev1.EndpointsList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -422,19 +423,19 @@ func fetchEvents(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().Events(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().Events(namespace).List(metav1.ListOptions{}) eventList.Store(namespace, l) return } func getEventsSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchEvents(namespace) x, ok := eventList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.EventList) + l, ok := x.(*corev1.EventList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -460,14 +461,14 @@ func fetchNodeList() { } updateLastFetchedAt(key) - l, _ := getClient().Nodes().List(v1.ListOptions{}) + l, _ := getClient().CoreV1().Nodes().List(metav1.ListOptions{}) nodeList.Store(l) return } func getNodeSuggestions() []prompt.Suggest { go fetchNodeList() - l, ok := nodeList.Load().(*v1.NodeList) + l, ok := nodeList.Load().(*corev1.NodeList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -493,19 +494,19 @@ func fetchSecretList(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().Secrets(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().Secrets(namespace).List(metav1.ListOptions{}) secretList.Store(namespace, l) return } func getSecretSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchSecretList(namespace) x, ok := secretList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.SecretList) + l, ok := x.(*corev1.SecretList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -531,20 +532,20 @@ func fetchIngressList(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().Ingresses(namespace).List(v1.ListOptions{}) + l, _ := getClient().ExtensionsV1beta1().Ingresses(namespace).List(metav1.ListOptions{}) ingressList.Store(namespace, l) return } func getIngressSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchIngressList(namespace) x, ok := ingressList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.NamespaceList) + l, ok := x.(*corev1.NamespaceList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -570,19 +571,19 @@ func fetchLimitRangeList(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().LimitRanges(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().LimitRanges(namespace).List(metav1.ListOptions{}) limitRangeList.Store(namespace, l) return } func getLimitRangeSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchLimitRangeList(namespace) x, ok := limitRangeList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.NamespaceList) + l, ok := x.(*corev1.NamespaceList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -608,14 +609,14 @@ func fetchNameSpaceList() { } updateLastFetchedAt(key) - l, _ := getClient().Namespaces().List(v1.ListOptions{}) + l, _ := getClient().CoreV1().Namespaces().List(metav1.ListOptions{}) namespaceList.Store(l) return } func getNameSpaceSuggestions() []prompt.Suggest { go fetchNameSpaceList() - l, ok := namespaceList.Load().(*v1.NamespaceList) + l, ok := namespaceList.Load().(*corev1.NamespaceList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -641,19 +642,19 @@ func fetchPersistentVolumeClaimsList(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().PersistentVolumeClaims(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().PersistentVolumeClaims(namespace).List(metav1.ListOptions{}) persistentVolumeClaimsList.Store(namespace, l) return } func getPersistentVolumeClaimSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchPersistentVolumeClaimsList(namespace) x, ok := persistentVolumeClaimsList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.PersistentVolumeClaimList) + l, ok := x.(*corev1.PersistentVolumeClaimList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -679,14 +680,14 @@ func fetchPersistentVolumeList() { } updateLastFetchedAt(key) - l, _ := getClient().PersistentVolumes().List(v1.ListOptions{}) + l, _ := getClient().CoreV1().PersistentVolumes().List(metav1.ListOptions{}) persistentVolumesList.Store(l) return } func getPersistentVolumeSuggestions() []prompt.Suggest { go fetchPersistentVolumeList() - l, ok := persistentVolumesList.Load().(*v1.PersistentVolumeList) + l, ok := persistentVolumesList.Load().(*corev1.PersistentVolumeList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -712,14 +713,14 @@ func fetchPodSecurityPolicyList() { } updateLastFetchedAt(key) - l, _ := getClient().PodSecurityPolicies().List(v1.ListOptions{}) + l, _ := getClient().ExtensionsV1beta1().PodSecurityPolicies().List(metav1.ListOptions{}) podSecurityPolicyList.Store(l) return } func getPodSecurityPolicySuggestions() []prompt.Suggest { go fetchPodSecurityPolicyList() - l, ok := podSecurityPolicyList.Load().(*v1beta1.PodSecurityPolicyList) + l, ok := podSecurityPolicyList.Load().(policyv1beta1.PodSecurityPolicyList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -745,19 +746,19 @@ func fetchPodTemplateList(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().PodTemplates(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().PodTemplates(namespace).List(metav1.ListOptions{}) podTemplateList.Store(namespace, l) return } func getPodTemplateSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchPodTemplateList(namespace) x, ok := podTemplateList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.PodTemplateList) + l, ok := x.(*corev1.PodTemplateList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -783,19 +784,19 @@ func fetchReplicaSetList(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().ReplicaSets(namespace).List(v1.ListOptions{}) + l, _ := getClient().AppsV1beta2().ReplicaSets(namespace).List(metav1.ListOptions{}) replicaSetList.Store(namespace, l) return } func getReplicaSetSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchReplicaSetList(namespace) x, ok := replicaSetList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1beta1.ReplicaSetList) + l, ok := x.(appsv1.ReplicaSetList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -821,19 +822,19 @@ func fetchReplicationControllerList(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().ReplicationControllers(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().ReplicationControllers(namespace).List(metav1.ListOptions{}) replicationControllerList.Store(namespace, l) return } func getReplicationControllerSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchReplicationControllerList(namespace) x, ok := replicationControllerList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.ReplicationControllerList) + l, ok := x.(*corev1.ReplicationControllerList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -859,19 +860,19 @@ func fetchResourceQuotaList(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().ResourceQuotas(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().ResourceQuotas(namespace).List(metav1.ListOptions{}) resourceQuotaList.Store(namespace, l) return } func getResourceQuotasSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchResourceQuotaList(namespace) x, ok := resourceQuotaList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.ResourceQuotaList) + l, ok := x.(*corev1.ResourceQuotaList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -897,19 +898,19 @@ func fetchServiceAccountList(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().ServiceAccounts(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().ServiceAccounts(namespace).List(metav1.ListOptions{}) serviceAccountList.Store(namespace, l) return } func getServiceAccountSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchServiceAccountList(namespace) x, ok := serviceAccountList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.ServiceAccountList) + l, ok := x.(*corev1.ServiceAccountList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } @@ -935,19 +936,19 @@ func fetchServiceList(namespace string) { } updateLastFetchedAt(key) - l, _ := getClient().Services(namespace).List(v1.ListOptions{}) + l, _ := getClient().CoreV1().Services(namespace).List(metav1.ListOptions{}) serviceList.Store(namespace, l) return } func getServiceSuggestions() []prompt.Suggest { - namespace := api.NamespaceAll + namespace := metav1.NamespaceAll go fetchServiceList(namespace) x, ok := serviceList.Load(namespace) if !ok { return []prompt.Suggest{} } - l, ok := x.(*v1.ServiceAccountList) + l, ok := x.(*corev1.ServiceAccountList) if !ok || len(l.Items) == 0 { return []prompt.Suggest{} } From e33b82cdfc331683dd1ba121f5f7abb794288b51 Mon Sep 17 00:00:00 2001 From: Johannes Kohnen Date: Sun, 22 Jul 2018 17:50:26 +0000 Subject: [PATCH 2/2] Register gcp auth helper --- Gopkg.lock | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- kube/client.go | 1 + 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index ef32459..2892cd3 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1,6 +1,14 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. +[[projects]] + digest = "1:5c3894b2aa4d6bead0ceeea6831b305d62879c871780e7b76296ded1b004bc57" + name = "cloud.google.com/go" + packages = ["compute/metadata"] + pruneopts = "UT" + revision = "aad3f485ee528456e0768f20397b4d9dd941e755" + version = "v0.25.0" + [[projects]] digest = "1:3b74e38513b3fa3e50d77f1b4976cd5eac1d8415a25536c83072530d1c104eaa" name = "github.com/c-bata/go-prompt" @@ -198,10 +206,11 @@ [[projects]] branch = "master" - digest = "1:f794603640683e0aad4867a2ad4d145483730147d27230d8568eac7213097005" + digest = "1:7749cf7f99fdb28e9de5dd8f12c78ce5ac52e3a1925012482e36db91f25e3e8a" name = "golang.org/x/net" packages = [ "context", + "context/ctxhttp", "http/httpguts", "http2", "http2/hpack", @@ -210,6 +219,20 @@ pruneopts = "UT" revision = "a680a1efc54dd51c040b3b5ce4939ea3cf2ea0d1" +[[projects]] + branch = "master" + digest = "1:05fcb1ce27666bec824043afa2a11806ebf02aec86a1bc497a8c5372df6a4c09" + name = "golang.org/x/oauth2" + packages = [ + ".", + "google", + "internal", + "jws", + "jwt", + ] + pruneopts = "UT" + revision = "ef147856a6ddbb60760db74283d2424e98c87bff" + [[projects]] branch = "master" digest = "1:72d6244a51be9611f08994aca19677fcc31676b3e7b742c37e129e6ece4ad8fc" @@ -252,6 +275,25 @@ pruneopts = "UT" revision = "fbb02b2291d28baffd63558aa44b4b56f178d650" +[[projects]] + digest = "1:10eab6a94bbd813a6f162c1a89676b62b2d6c214190d1529ae2ebbde3c9e24b9" + name = "google.golang.org/appengine" + packages = [ + ".", + "internal", + "internal/app_identity", + "internal/base", + "internal/datastore", + "internal/log", + "internal/modules", + "internal/remote_api", + "internal/urlfetch", + "urlfetch", + ] + pruneopts = "UT" + revision = "b1f26356af11148e710935ed1ac8a7f5702c7612" + version = "v1.1.0" + [[projects]] digest = "1:2d1fbdc6777e5408cabeb02bf336305e724b925ff4546ded0fa8715a7267922a" name = "gopkg.in/inf.v0" @@ -351,7 +393,7 @@ revision = "103fd098999dc9c0c88536f5c9ad2e5da39373ae" [[projects]] - digest = "1:a330cde2ac61f51321345cd0aee5b5789fd439e350f19b7db7424bce37ebefca" + digest = "1:66e89b416718f4ad635fbc474477596ef64e9a159cb391b63c9e4d13f92c5de2" name = "k8s.io/client-go" packages = [ "discovery", @@ -391,8 +433,10 @@ "pkg/apis/clientauthentication/v1beta1", "pkg/version", "plugin/pkg/client/auth/exec", + "plugin/pkg/client/auth/gcp", "rest", "rest/watch", + "third_party/forked/golang/template", "tools/auth", "tools/clientcmd", "tools/clientcmd/api", @@ -406,6 +450,7 @@ "util/flowcontrol", "util/homedir", "util/integer", + "util/jsonpath", ] pruneopts = "UT" revision = "7d04d0e2a0a1a4d4a1cd6baa432a2301492e4e65" @@ -422,6 +467,7 @@ "k8s.io/api/policy/v1beta1", "k8s.io/apimachinery/pkg/apis/meta/v1", "k8s.io/client-go/kubernetes", + "k8s.io/client-go/plugin/pkg/client/auth/gcp", "k8s.io/client-go/tools/clientcmd", ] solver-name = "gps-cdcl" diff --git a/kube/client.go b/kube/client.go index acb9987..21a5587 100644 --- a/kube/client.go +++ b/kube/client.go @@ -2,6 +2,7 @@ package kube import ( "k8s.io/client-go/kubernetes" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // register gcp auth helper "k8s.io/client-go/tools/clientcmd" )