From 503e3ebf02537daed89f201993104509eee19a54 Mon Sep 17 00:00:00 2001 From: Ward Loos Date: Wed, 16 Jan 2019 09:52:53 +0100 Subject: [PATCH] Add support for auth providers https://github.com/kubernetes/client-go/issues/242 --- Gopkg.lock | 207 +++++++++++++++++++++++++++++++++------------- Gopkg.toml | 23 ++++-- pkg/utils/kube.go | 3 +- 3 files changed, 170 insertions(+), 63 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index a1eeb7c..f9c1dc8 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1,6 +1,36 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. +[[projects]] + digest = "1:5ad08b0e14866764a6d7475eb11c9cf05cad9a52c442593bdfa544703ff77f61" + name = "cloud.google.com/go" + packages = ["compute/metadata"] + pruneopts = "UT" + revision = "0ebda48a7f143b1cce9eb37a8c1106ac762a3430" + version = "v0.34.0" + +[[projects]] + digest = "1:7e11a0a4c2d7792a108629e27c83ff4397b950dede4ccce23f99639bfa84846b" + name = "github.com/Azure/go-autorest" + packages = [ + "autorest", + "autorest/adal", + "autorest/azure", + "autorest/date", + "version", + ] + pruneopts = "UT" + revision = "bca49d5b51a50dc5bb17bbf6204c711c6dbded06" + version = "v10.14.0" + +[[projects]] + digest = "1:76dc72490af7174349349838f2fe118996381b31ea83243812a97e5a0fd5ed55" + name = "github.com/dgrijalva/jwt-go" + packages = ["."] + pruneopts = "UT" + revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e" + version = "v3.2.0" + [[projects]] digest = "1:b498b36dbb2b306d1c5205ee5236c9e60352be8f9eea9bf08186723a9f75b4f3" name = "github.com/emirpasic/gods" @@ -17,31 +47,22 @@ version = "v1.12.0" [[projects]] - digest = "1:2cd7915ab26ede7d95b8749e6b1f933f1c6d5398030684e6505940a10f31cfda" - name = "github.com/ghodss/yaml" - packages = ["."] - pruneopts = "UT" - revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" - version = "v1.0.0" - -[[projects]] - digest = "1:34e709f36fd4f868fb00dbaf8a6cab4c1ae685832d392874ba9d7c5dec2429d1" + digest = "1:b402bb9a24d108a9405a6f34675091b036c8b056aac843bf6ef2389a65c5cf48" name = "github.com/gogo/protobuf" packages = [ "proto", "sortkeys", ] pruneopts = "UT" - revision = "636bf0302bc95575d69441b25a2603156ffdddf1" - version = "v1.1.1" + revision = "4cbf7e384e768b4e01799441fdf2a706a5635ae7" + version = "v1.2.0" [[projects]] - branch = "master" - digest = "1:1ba1d79f2810270045c328ae5d674321db34e3aae468eb4233883b473c5c0467" + digest = "1:2edd2416f89b4e841df0e4a78802ce14d2bc7ad79eba1a45986e39f0f8cb7d87" name = "github.com/golang/glog" packages = ["."] pruneopts = "UT" - revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" + revision = "44145f04b68cf362d9c4df2182967c2275eaefed" [[projects]] digest = "1:4c0989ca0bcd10799064318923b9bc2db6b4d6338dd75f3f2d86c3511aaaf5cf" @@ -74,7 +95,7 @@ revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1" [[projects]] - digest = "1:65c4414eeb350c47b8de71110150d0ea8a281835b1f386eacaa3ad7325929c21" + digest = "1:75eb87381d25cc75212f52358df9c3a2719584eaa9685cd510ce28699122f39d" name = "github.com/googleapis/gnostic" packages = [ "OpenAPIv2", @@ -82,8 +103,22 @@ "extensions", ] pruneopts = "UT" - revision = "7c663266750e7d82587642f65e60bc4083f1f84e" - version = "v0.2.0" + revision = "0c5108395e2debce0d731cf0287ddf7242066aba" + +[[projects]] + digest = "1:32c2c0ff3114a2629e4f1884ad1cbe8a4a76ae789f746c3f3898ac5138ef9f05" + name = "github.com/gophercloud/gophercloud" + packages = [ + ".", + "openstack", + "openstack/identity/v2/tenants", + "openstack/identity/v2/tokens", + "openstack/identity/v3/tokens", + "openstack/utils", + "pagination", + ] + pruneopts = "UT" + revision = "781450b3c4fcb4f5182bcc5133adb4b2e4a09d1d" [[projects]] branch = "master" @@ -98,23 +133,22 @@ revision = "36ee7e946282a3fb1cfecd476ddc9b35d8847e42" [[projects]] - branch = "master" - digest = "1:86c1210529e69d69860f2bb3ee9ccce0b595aa3f9165e7dd1388e5c612915888" + digest = "1:878f0defa9b853f9acfaf4a162ba450a89d0050eff084f9fe7f5bd15948f172a" name = "github.com/gregjones/httpcache" packages = [ ".", "diskcache", ] pruneopts = "UT" - revision = "9cad4c3443a7200dd6400aef47183728de563a38" + revision = "787624de3eb7bd915c329cba748687a3b22666a6" [[projects]] - digest = "1:8eb1de8112c9924d59bf1d3e5c26f5eaa2bfc2a5fcbb92dc1c2e4546d695f277" + digest = "1:3e260afa138eab6492b531a3b3d10ab4cb70512d423faa78b8949dec76e66a21" name = "github.com/imdario/mergo" packages = ["."] pruneopts = "UT" - revision = "9f23e2d6bd2a77f959b2bf6acdbefd708a83a4a4" - version = "v0.3.6" + revision = "9316a62528ac99aaecb4e47eadd6dc8aa6533d58" + version = "v0.3.5" [[projects]] digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" @@ -149,12 +183,12 @@ version = "0.5" [[projects]] - digest = "1:cdb899c199f907ac9fb50495ec71212c95cb5b0e0a8ee0800da0238036091033" + digest = "1:0356f3312c9bd1cbeda81505b7fd437501d8e778ab66998ef69f00d7f9b3a0d7" name = "github.com/mattn/go-runewidth" packages = ["."] pruneopts = "UT" - revision = "ce7b0b5c7b45a81508558cd1dba6bb1e4ddb51bb" - version = "v0.0.3" + revision = "3ee7d812e62a0804a7d0a324e0249ca2db3476d3" + version = "v0.0.4" [[projects]] digest = "1:78bbb1ba5b7c3f2ed0ea1eab57bdd3859aec7e177811563edc41198a760b06af" @@ -229,7 +263,7 @@ version = "v1.0.3" [[projects]] - digest = "1:3681df693b35e7df9937dbd54b9f179aee5b54f4a28f72ad191e87038e6ffcab" + digest = "1:e4ed0afd67bf7be353921665cdac50834c867ff1bba153efc0745b755a7f5905" name = "github.com/src-d/gcfg" packages = [ ".", @@ -238,8 +272,8 @@ "types", ] pruneopts = "UT" - revision = "f187355171c936ac84a82793659ebb4936bc1c23" - version = "v1.3.0" + revision = "1ac3a1ac202429a54835fe8408a92880156b489d" + version = "v1.4.0" [[projects]] digest = "1:afc0b8068986a01e2d8f449917829753a54f6bd4d1265c2b4ad9cba75560020f" @@ -251,7 +285,7 @@ [[projects]] branch = "master" - digest = "1:f74f6af5b1bcbe0ac1f1ca1a4f1de91918c842a58d4c30e16d3652168c8d0e0a" + digest = "1:e5c75a66104635dd368c793f0e405589b0a41a809065991b5720aec14e437f04" name = "golang.org/x/crypto" packages = [ "cast5", @@ -273,11 +307,11 @@ "ssh/terminal", ] pruneopts = "UT" - revision = "a92615f3c49003920a58dedcf32cf55022cefb8d" + revision = "ff983b9c42bc9fbf91556e191cc8efb585c16908" [[projects]] branch = "master" - digest = "1:b41f13f4d5dbbd63abe9bf646575e4f83d2637ca243b97ea79b7807242518e8c" + digest = "1:ca38c104c734524967fbd5142db26f55febff8fb6fbe92ff4c0f95dae6bcc265" name = "golang.org/x/net" packages = [ "context", @@ -287,18 +321,31 @@ "idna", ] pruneopts = "UT" - revision = "49bb7cea24b1df9410e1712aa6433dae904ff66a" + revision = "915654e7eabcea33ae277abbecf52f0d8b7a9fdc" + +[[projects]] + digest = "1:ad764db92ed977f803ff0f59a7a957bf65cc4e8ae9dfd08228e1f54ea40392e0" + name = "golang.org/x/oauth2" + packages = [ + ".", + "google", + "internal", + "jws", + "jwt", + ] + pruneopts = "UT" + revision = "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" [[projects]] branch = "master" - digest = "1:f5aa274a0377f85735edc7fedfb0811d3cbc20af91633797cb359e29c3272271" + digest = "1:0150ad9329793acacd98bcbd88492d9e4731824b5d3fbc73a8a1b45eb21acf6b" name = "golang.org/x/sys" packages = [ "unix", "windows", ] pruneopts = "UT" - revision = "fa43e7bc11baaae89f3f902b2b4d832b68234844" + revision = "a457fd036447854c0c02e89ea439481bdcf941a2" [[projects]] digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18" @@ -324,12 +371,30 @@ version = "v0.3.0" [[projects]] - branch = "master" - digest = "1:c9e7a4b4d47c0ed205d257648b0e5b0440880cb728506e318f8ac7cd36270bc4" + digest = "1:d37b0ef2944431fe9e8ef35c6fffc8990d9e2ca300588df94a6890f3649ae365" name = "golang.org/x/time" packages = ["rate"] pruneopts = "UT" - revision = "fbb02b2291d28baffd63558aa44b4b56f178d650" + revision = "f51c12702a4d776e4c1fa9b0fabab841babae631" + +[[projects]] + digest = "1:fa026a5c59bd2df343ec4a3538e6288dcf4e2ec5281d743ae82c120affe6926a" + 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 = "e9657d882bb81064595ca3b56cbe2546bbabf7b1" + version = "v1.4.0" [[projects]] digest = "1:2d1fbdc6777e5408cabeb02bf336305e724b925ff4546ded0fa8715a7267922a" @@ -354,7 +419,7 @@ version = "v4.3.0" [[projects]] - digest = "1:336779a462e14e1802fef62517172dee311db2224f62391167f969cea6637a7d" + digest = "1:1ea7acba0f88007ecacda272a1414bffb529c2da8dbdac647139d2d1590d8354" name = "gopkg.in/src-d/go-git.v4" packages = [ ".", @@ -399,8 +464,8 @@ "utils/merkletrie/noder", ] pruneopts = "UT" - revision = "d3cec13ac0b195bfb897ed038a08b5130ab9969e" - version = "v4.7.0" + revision = "3dbfb89e0f5bce0008724e547b999fe3af9f60db" + version = "v4.8.1" [[projects]] digest = "1:78d374b493e747afa9fbb2119687e3740a7fb8d0ebabddfef0a012593aaecbb3" @@ -411,15 +476,16 @@ version = "v0.1.2" [[projects]] - digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" + digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96" name = "gopkg.in/yaml.v2" packages = ["."] pruneopts = "UT" - revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" - version = "v2.2.1" + revision = "51d6538a90f86fe93ac480b35f37b2be17fef232" + version = "v2.2.2" [[projects]] - digest = "1:34ffbf9ed5e63a11e4e0aaab597dc36c552da8b5b6bd49d8f73dadd4afd7e677" + branch = "master" + digest = "1:5d9a48e3144dfc06d3c5218b38164102f62300e83ffdd9a2d87b3c0b4135612f" name = "k8s.io/api" packages = [ "admissionregistration/v1alpha1", @@ -433,10 +499,12 @@ "authorization/v1beta1", "autoscaling/v1", "autoscaling/v2beta1", + "autoscaling/v2beta2", "batch/v1", "batch/v1beta1", "batch/v2alpha1", "certificates/v1beta1", + "coordination/v1beta1", "core/v1", "events/v1beta1", "extensions/v1beta1", @@ -453,11 +521,11 @@ "storage/v1beta1", ] pruneopts = "UT" - revision = "2d6f90ab1293a1fb871cf149423ebb72aa7423aa" - version = "kubernetes-1.11.2" + revision = "173ce66c1e39d1d0f56e0b3347ff2988068aecd0" [[projects]] - digest = "1:29d5abc33d8cbec19b4cd032a87d28010dd615578dd695a655fc3d5ec3ab86b6" + branch = "master" + digest = "1:a83d3d972031f693922d119afbcca180fa521a3c7bb5f3e70e288ce6a601168a" name = "k8s.io/apimachinery" packages = [ "pkg/api/errors", @@ -485,23 +553,22 @@ "pkg/util/framer", "pkg/util/intstr", "pkg/util/json", + "pkg/util/naming", "pkg/util/net", "pkg/util/runtime", "pkg/util/sets", "pkg/util/validation", "pkg/util/validation/field", - "pkg/util/wait", "pkg/util/yaml", "pkg/version", "pkg/watch", "third_party/forked/golang/reflect", ] pruneopts = "UT" - revision = "103fd098999dc9c0c88536f5c9ad2e5da39373ae" - version = "kubernetes-1.11.2" + revision = "fa6ddc151d63306b3540a37d910a07b181e4a474" [[projects]] - digest = "1:23583b6bb74c1e6399f4d9239560d36529b2ed43f2730f6a64e6e23521753bb5" + digest = "1:63f1dd4b853d891b2459875cd38c86a99bc11d839e5c2dbb703cdeb6f0bcaf6c" name = "k8s.io/client-go" packages = [ "discovery", @@ -518,10 +585,12 @@ "kubernetes/typed/authorization/v1beta1", "kubernetes/typed/autoscaling/v1", "kubernetes/typed/autoscaling/v2beta1", + "kubernetes/typed/autoscaling/v2beta2", "kubernetes/typed/batch/v1", "kubernetes/typed/batch/v1beta1", "kubernetes/typed/batch/v2alpha1", "kubernetes/typed/certificates/v1beta1", + "kubernetes/typed/coordination/v1beta1", "kubernetes/typed/core/v1", "kubernetes/typed/events/v1beta1", "kubernetes/typed/extensions/v1beta1", @@ -540,9 +609,15 @@ "pkg/apis/clientauthentication/v1alpha1", "pkg/apis/clientauthentication/v1beta1", "pkg/version", + "plugin/pkg/client/auth", + "plugin/pkg/client/auth/azure", "plugin/pkg/client/auth/exec", + "plugin/pkg/client/auth/gcp", + "plugin/pkg/client/auth/oidc", + "plugin/pkg/client/auth/openstack", "rest", "rest/watch", + "third_party/forked/golang/template", "tools/auth", "tools/clientcmd", "tools/clientcmd/api", @@ -556,21 +631,38 @@ "util/flowcontrol", "util/homedir", "util/integer", + "util/jsonpath", ] pruneopts = "UT" - revision = "1f13a808da65775f22cbf47862c4e5898d8f4ca1" - version = "kubernetes-1.11.2" + revision = "1638f8970cefaa404ff3a62950f88b08292b2696" + version = "v9.0.0" [[projects]] - digest = "1:4c74e095b939554d54bdf7a3160c56e7caa564ae09c482ca2c492437d94e9dd4" + digest = "1:303f22e5b5ab305620ce5bdf7d47c3b8524c97b883e245339b99781aebee306e" name = "k8s.io/helm" packages = [ "pkg/proto/hapi/chart", "pkg/proto/hapi/release", ] pruneopts = "UT" - revision = "2e55dbe1fdb5fdb96b75ff144a339489417b146b" - version = "v2.11.0" + revision = "7d2b0c73d734f6586ed222a567c5d103fed435be" + version = "v2.12.2" + +[[projects]] + digest = "1:e2999bf1bb6eddc2a6aa03fe5e6629120a53088926520ca3b4765f77d7ff7eab" + name = "k8s.io/klog" + packages = ["."] + pruneopts = "UT" + revision = "a5bc97fbc634d635061f3146511332c7e313a55a" + version = "v0.1.0" + +[[projects]] + digest = "1:7719608fe0b52a4ece56c2dde37bedd95b938677d1ab0f84b8a7852e4c59f849" + name = "sigs.k8s.io/yaml" + packages = ["."] + pruneopts = "UT" + revision = "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" + version = "v1.1.0" [solve-meta] analyzer-name = "dep" @@ -586,6 +678,7 @@ "k8s.io/api/core/v1", "k8s.io/apimachinery/pkg/apis/meta/v1", "k8s.io/client-go/kubernetes", + "k8s.io/client-go/plugin/pkg/client/auth", "k8s.io/client-go/rest", "k8s.io/client-go/tools/clientcmd", "k8s.io/helm/pkg/proto/hapi/release", diff --git a/Gopkg.toml b/Gopkg.toml index dc152b6..1907907 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -24,29 +24,42 @@ # go-tests = true # unused-packages = true + +[[constraint]] + name = "github.com/golang/protobuf" + version = "1.2.0" + +[[constraint]] + branch = "master" + name = "github.com/gosuri/uitable" + [[constraint]] name = "github.com/spf13/cobra" version = "0.0.3" [[constraint]] name = "gopkg.in/src-d/go-git.v4" - version = "4.6.0" + version = "4.8.1" [[constraint]] name = "gopkg.in/yaml.v2" - version = "2.2.1" + version = "2.2.2" [[constraint]] + branch = "master" name = "k8s.io/api" - version = "kubernetes-1.11.2" [[constraint]] + branch = "master" name = "k8s.io/apimachinery" - version = "kubernetes-1.11.2" [[constraint]] name = "k8s.io/client-go" - version = "kubernetes-1.11.2" + version = "9.0.0" + +[[constraint]] + name = "k8s.io/helm" + version = "2.12.2" [prune] go-tests = true diff --git a/pkg/utils/kube.go b/pkg/utils/kube.go index 9b48895..d25b6c6 100644 --- a/pkg/utils/kube.go +++ b/pkg/utils/kube.go @@ -6,9 +6,10 @@ import ( "os" "path/filepath" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" + _ "k8s.io/client-go/plugin/pkg/client/auth" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" )