From 1ceb9f71e100ed8519fd72bbf889f84c4f011550 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Fri, 1 Sep 2017 16:19:00 +0000 Subject: [PATCH 1/6] sync: reset Godeps/Godeps.json --- Godeps/Godeps.json | 1008 ++++++++++++++++---------------------------- 1 file changed, 356 insertions(+), 652 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index a1471fc7..1eccbc05 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,654 +1,358 @@ { - "ImportPath": "k8s.io/client-go", - "GoVersion": "go1.8", - "GodepVersion": "v79", - "Packages": [ - "./..." - ], - "Deps": [ - { - "ImportPath": "cloud.google.com/go/compute/metadata", - "Rev": "3b1ae45394a234c385be014e9a488f2bb6eef821" - }, - { - "ImportPath": "cloud.google.com/go/internal", - "Rev": "3b1ae45394a234c385be014e9a488f2bb6eef821" - }, - { - "ImportPath": "github.com/Azure/go-autorest/autorest", - "Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" - }, - { - "ImportPath": "github.com/Azure/go-autorest/autorest/adal", - "Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" - }, - { - "ImportPath": "github.com/Azure/go-autorest/autorest/azure", - "Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" - }, - { - "ImportPath": "github.com/Azure/go-autorest/autorest/date", - "Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" - }, - { - "ImportPath": "github.com/PuerkitoBio/purell", - "Rev": "8a290539e2e8629dbc4e6bad948158f790ec31f4" - }, - { - "ImportPath": "github.com/PuerkitoBio/urlesc", - "Rev": "5bd2802263f21d8788851d5305584c82a5c75d7e" - }, - { - "ImportPath": "github.com/coreos/go-oidc/http", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/jose", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/key", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/oauth2", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/oidc", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/pkg/health", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" - }, - { - "ImportPath": "github.com/coreos/pkg/httputil", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" - }, - { - "ImportPath": "github.com/coreos/pkg/timeutil", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" - }, - { - "ImportPath": "github.com/davecgh/go-spew/spew", - "Rev": "782f4967f2dc4564575ca782fe2d04090b5faca8" - }, - { - "ImportPath": "github.com/dgrijalva/jwt-go", - "Rev": "01aeca54ebda6e0fbfafd0a524d234159c05ec20" - }, - { - "ImportPath": "github.com/docker/spdystream", - "Rev": "449fdfce4d962303d702fec724ef0ad181c92528" - }, - { - "ImportPath": "github.com/docker/spdystream/spdy", - "Rev": "449fdfce4d962303d702fec724ef0ad181c92528" - }, - { - "ImportPath": "github.com/emicklei/go-restful", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, - { - "ImportPath": "github.com/emicklei/go-restful-swagger12", - "Rev": "dcef7f55730566d41eae5db10e7d6981829720f6" - }, - { - "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "73d445a93680fa1a78ae23a5839bad48f32ba1ee" - }, - { - "ImportPath": "github.com/go-openapi/jsonpointer", - "Rev": "46af16f9f7b149af66e5d1bd010e3574dc06de98" - }, - { - "ImportPath": "github.com/go-openapi/jsonreference", - "Rev": "13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272" - }, - { - "ImportPath": "github.com/go-openapi/spec", - "Rev": "6aced65f8501fe1217321abf0749d354824ba2ff" - }, - { - "ImportPath": "github.com/go-openapi/swag", - "Rev": "1d0bd113de87027671077d3c71eb3ac5d7dbba72" - }, - { - "ImportPath": "github.com/gogo/protobuf/proto", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/gogo/protobuf/sortkeys", - "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" - }, - { - "ImportPath": "github.com/golang/glog", - "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" - }, - { - "ImportPath": "github.com/golang/groupcache/lru", - "Rev": "02826c3e79038b59d737d3b1c0a1d937f71a4433" - }, - { - "ImportPath": "github.com/golang/protobuf/proto", - "Rev": "4bd1920723d7b7c925de087aa32e2187708897f7" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes", - "Rev": "4bd1920723d7b7c925de087aa32e2187708897f7" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/any", - "Rev": "4bd1920723d7b7c925de087aa32e2187708897f7" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/duration", - "Rev": "4bd1920723d7b7c925de087aa32e2187708897f7" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/timestamp", - "Rev": "4bd1920723d7b7c925de087aa32e2187708897f7" - }, - { - "ImportPath": "github.com/google/gofuzz", - "Rev": "44d81051d367757e1c7c6a5a86423ece9afcf63c" - }, - { - "ImportPath": "github.com/googleapis/gnostic/OpenAPIv2", - "Rev": "0c5108395e2debce0d731cf0287ddf7242066aba" - }, - { - "ImportPath": "github.com/googleapis/gnostic/compiler", - "Rev": "0c5108395e2debce0d731cf0287ddf7242066aba" - }, - { - "ImportPath": "github.com/googleapis/gnostic/extensions", - "Rev": "0c5108395e2debce0d731cf0287ddf7242066aba" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud", - "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack", - "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants", - "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens", - "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens", - "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/utils", - "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/pagination", - "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" - }, - { - "ImportPath": "github.com/hashicorp/golang-lru", - "Rev": "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" - }, - { - "ImportPath": "github.com/hashicorp/golang-lru/simplelru", - "Rev": "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" - }, - { - "ImportPath": "github.com/howeyc/gopass", - "Rev": "bf9dde6d0d2c004a008c27aaee91170c786f6db8" - }, - { - "ImportPath": "github.com/imdario/mergo", - "Rev": "6633656539c1639d9d78127b7d47c622b5d7b6dc" - }, - { - "ImportPath": "github.com/jonboulle/clockwork", - "Rev": "72f9bd7c4e0c2a40055ab3d0f09654f730cce982" - }, - { - "ImportPath": "github.com/juju/ratelimit", - "Rev": "5b9ff866471762aa2ab2dced63c9fb6f53921342" - }, - { - "ImportPath": "github.com/mailru/easyjson/buffer", - "Rev": "d5b7844b561a7bc640052f1b935f7b800330d7e0" - }, - { - "ImportPath": "github.com/mailru/easyjson/jlexer", - "Rev": "d5b7844b561a7bc640052f1b935f7b800330d7e0" - }, - { - "ImportPath": "github.com/mailru/easyjson/jwriter", - "Rev": "d5b7844b561a7bc640052f1b935f7b800330d7e0" - }, - { - "ImportPath": "github.com/pmezard/go-difflib/difflib", - "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" - }, - { - "ImportPath": "github.com/spf13/pflag", - "Rev": "9ff6c6923cfffbcd502984b8e0c80539a94968b7" - }, - { - "ImportPath": "github.com/stretchr/testify/assert", - "Rev": "f6abca593680b2315d2075e0f5e2a9751e3f431a" - }, - { - "ImportPath": "github.com/ugorji/go/codec", - "Rev": "ded73eae5db7e7a0ef6f55aace87a2873c5d2b74" - }, - { - "ImportPath": "golang.org/x/crypto/ssh/terminal", - "Rev": "d172538b2cfce0c13cee31e647d0367aa8cd2486" - }, - { - "ImportPath": "golang.org/x/net/context", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/context/ctxhttp", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/http2", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/http2/hpack", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/idna", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/lex/httplex", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/oauth2", - "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" - }, - { - "ImportPath": "golang.org/x/oauth2/google", - "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" - }, - { - "ImportPath": "golang.org/x/oauth2/internal", - "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" - }, - { - "ImportPath": "golang.org/x/oauth2/jws", - "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" - }, - { - "ImportPath": "golang.org/x/oauth2/jwt", - "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" - }, - { - "ImportPath": "golang.org/x/sys/unix", - "Rev": "7a4fde3fda8ef580a89dbae8138c26041be14299" - }, - { - "ImportPath": "golang.org/x/text/cases", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal/tag", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/language", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/runes", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/secure/bidirule", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/secure/precis", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/transform", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/unicode/bidi", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/unicode/norm", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/width", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "gopkg.in/inf.v0", - "Rev": "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" - }, - { - "ImportPath": "gopkg.in/yaml.v2", - "Rev": "53feefa2559fb8dfa8d81baad31be332c97d6c77" - }, - { - "ImportPath": "k8s.io/api/admissionregistration/v1alpha1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/apps/v1beta1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/apps/v1beta2", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/authentication/v1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/authentication/v1beta1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/authorization/v1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/authorization/v1beta1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/autoscaling/v1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/autoscaling/v2alpha1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/batch/v1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/batch/v1beta1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/batch/v2alpha1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/certificates/v1beta1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/core/v1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/extensions/v1beta1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/imagepolicy/v1alpha1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/networking/v1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/policy/v1beta1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/rbac/v1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/rbac/v1alpha1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/rbac/v1beta1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/scheduling/v1alpha1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/settings/v1alpha1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/storage/v1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/api/storage/v1beta1", - "Rev": "f30e293246921de7f4ee46bb65b8762b2f890fc4" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/equality", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/errors", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apimachinery", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/conversion/unstructured", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/cache", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/clock", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/version", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "c6151f358fe618fabe3bcbe3738d83ac61ecd70f" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "80f07ef71bb4f781233c65aa8d0369e4ecafab87" - } - ] + "ImportPath": "k8s.io/client-go", + "GoVersion": "go1.8", + "GodepVersion": "v79", + "Packages": [ + "./..." + ], + "Deps": [ + { + "ImportPath": "cloud.google.com/go/compute/metadata", + "Rev": "3b1ae45394a234c385be014e9a488f2bb6eef821" + }, + { + "ImportPath": "cloud.google.com/go/internal", + "Rev": "3b1ae45394a234c385be014e9a488f2bb6eef821" + }, + { + "ImportPath": "github.com/Azure/go-autorest/autorest", + "Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" + }, + { + "ImportPath": "github.com/Azure/go-autorest/autorest/adal", + "Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" + }, + { + "ImportPath": "github.com/Azure/go-autorest/autorest/azure", + "Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" + }, + { + "ImportPath": "github.com/Azure/go-autorest/autorest/date", + "Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" + }, + { + "ImportPath": "github.com/PuerkitoBio/purell", + "Rev": "8a290539e2e8629dbc4e6bad948158f790ec31f4" + }, + { + "ImportPath": "github.com/PuerkitoBio/urlesc", + "Rev": "5bd2802263f21d8788851d5305584c82a5c75d7e" + }, + { + "ImportPath": "github.com/coreos/go-oidc/http", + "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" + }, + { + "ImportPath": "github.com/coreos/go-oidc/jose", + "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" + }, + { + "ImportPath": "github.com/coreos/go-oidc/key", + "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" + }, + { + "ImportPath": "github.com/coreos/go-oidc/oauth2", + "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" + }, + { + "ImportPath": "github.com/coreos/go-oidc/oidc", + "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" + }, + { + "ImportPath": "github.com/coreos/pkg/health", + "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" + }, + { + "ImportPath": "github.com/coreos/pkg/httputil", + "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" + }, + { + "ImportPath": "github.com/coreos/pkg/timeutil", + "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" + }, + { + "ImportPath": "github.com/davecgh/go-spew/spew", + "Rev": "782f4967f2dc4564575ca782fe2d04090b5faca8" + }, + { + "ImportPath": "github.com/dgrijalva/jwt-go", + "Rev": "01aeca54ebda6e0fbfafd0a524d234159c05ec20" + }, + { + "ImportPath": "github.com/docker/spdystream", + "Rev": "449fdfce4d962303d702fec724ef0ad181c92528" + }, + { + "ImportPath": "github.com/docker/spdystream/spdy", + "Rev": "449fdfce4d962303d702fec724ef0ad181c92528" + }, + { + "ImportPath": "github.com/emicklei/go-restful", + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" + }, + { + "ImportPath": "github.com/emicklei/go-restful-swagger12", + "Rev": "dcef7f55730566d41eae5db10e7d6981829720f6" + }, + { + "ImportPath": "github.com/emicklei/go-restful/log", + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" + }, + { + "ImportPath": "github.com/ghodss/yaml", + "Rev": "73d445a93680fa1a78ae23a5839bad48f32ba1ee" + }, + { + "ImportPath": "github.com/go-openapi/jsonpointer", + "Rev": "46af16f9f7b149af66e5d1bd010e3574dc06de98" + }, + { + "ImportPath": "github.com/go-openapi/jsonreference", + "Rev": "13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272" + }, + { + "ImportPath": "github.com/go-openapi/spec", + "Rev": "6aced65f8501fe1217321abf0749d354824ba2ff" + }, + { + "ImportPath": "github.com/go-openapi/swag", + "Rev": "1d0bd113de87027671077d3c71eb3ac5d7dbba72" + }, + { + "ImportPath": "github.com/gogo/protobuf/proto", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/gogo/protobuf/sortkeys", + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + }, + { + "ImportPath": "github.com/golang/glog", + "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" + }, + { + "ImportPath": "github.com/golang/groupcache/lru", + "Rev": "02826c3e79038b59d737d3b1c0a1d937f71a4433" + }, + { + "ImportPath": "github.com/golang/protobuf/proto", + "Rev": "4bd1920723d7b7c925de087aa32e2187708897f7" + }, + { + "ImportPath": "github.com/golang/protobuf/ptypes", + "Rev": "4bd1920723d7b7c925de087aa32e2187708897f7" + }, + { + "ImportPath": "github.com/golang/protobuf/ptypes/any", + "Rev": "4bd1920723d7b7c925de087aa32e2187708897f7" + }, + { + "ImportPath": "github.com/golang/protobuf/ptypes/duration", + "Rev": "4bd1920723d7b7c925de087aa32e2187708897f7" + }, + { + "ImportPath": "github.com/golang/protobuf/ptypes/timestamp", + "Rev": "4bd1920723d7b7c925de087aa32e2187708897f7" + }, + { + "ImportPath": "github.com/google/gofuzz", + "Rev": "44d81051d367757e1c7c6a5a86423ece9afcf63c" + }, + { + "ImportPath": "github.com/googleapis/gnostic/OpenAPIv2", + "Rev": "0c5108395e2debce0d731cf0287ddf7242066aba" + }, + { + "ImportPath": "github.com/googleapis/gnostic/compiler", + "Rev": "0c5108395e2debce0d731cf0287ddf7242066aba" + }, + { + "ImportPath": "github.com/googleapis/gnostic/extensions", + "Rev": "0c5108395e2debce0d731cf0287ddf7242066aba" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud", + "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/openstack", + "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants", + "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens", + "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens", + "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/openstack/utils", + "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/pagination", + "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" + }, + { + "ImportPath": "github.com/hashicorp/golang-lru", + "Rev": "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" + }, + { + "ImportPath": "github.com/hashicorp/golang-lru/simplelru", + "Rev": "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" + }, + { + "ImportPath": "github.com/howeyc/gopass", + "Rev": "bf9dde6d0d2c004a008c27aaee91170c786f6db8" + }, + { + "ImportPath": "github.com/imdario/mergo", + "Rev": "6633656539c1639d9d78127b7d47c622b5d7b6dc" + }, + { + "ImportPath": "github.com/jonboulle/clockwork", + "Rev": "72f9bd7c4e0c2a40055ab3d0f09654f730cce982" + }, + { + "ImportPath": "github.com/juju/ratelimit", + "Rev": "5b9ff866471762aa2ab2dced63c9fb6f53921342" + }, + { + "ImportPath": "github.com/mailru/easyjson/buffer", + "Rev": "d5b7844b561a7bc640052f1b935f7b800330d7e0" + }, + { + "ImportPath": "github.com/mailru/easyjson/jlexer", + "Rev": "d5b7844b561a7bc640052f1b935f7b800330d7e0" + }, + { + "ImportPath": "github.com/mailru/easyjson/jwriter", + "Rev": "d5b7844b561a7bc640052f1b935f7b800330d7e0" + }, + { + "ImportPath": "github.com/pmezard/go-difflib/difflib", + "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" + }, + { + "ImportPath": "github.com/spf13/pflag", + "Rev": "9ff6c6923cfffbcd502984b8e0c80539a94968b7" + }, + { + "ImportPath": "github.com/stretchr/testify/assert", + "Rev": "f6abca593680b2315d2075e0f5e2a9751e3f431a" + }, + { + "ImportPath": "github.com/ugorji/go/codec", + "Rev": "ded73eae5db7e7a0ef6f55aace87a2873c5d2b74" + }, + { + "ImportPath": "golang.org/x/crypto/ssh/terminal", + "Rev": "d172538b2cfce0c13cee31e647d0367aa8cd2486" + }, + { + "ImportPath": "golang.org/x/net/context", + "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + }, + { + "ImportPath": "golang.org/x/net/context/ctxhttp", + "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + }, + { + "ImportPath": "golang.org/x/net/http2", + "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + }, + { + "ImportPath": "golang.org/x/net/http2/hpack", + "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + }, + { + "ImportPath": "golang.org/x/net/idna", + "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + }, + { + "ImportPath": "golang.org/x/net/lex/httplex", + "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + }, + { + "ImportPath": "golang.org/x/oauth2", + "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" + }, + { + "ImportPath": "golang.org/x/oauth2/google", + "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" + }, + { + "ImportPath": "golang.org/x/oauth2/internal", + "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" + }, + { + "ImportPath": "golang.org/x/oauth2/jws", + "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" + }, + { + "ImportPath": "golang.org/x/oauth2/jwt", + "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" + }, + { + "ImportPath": "golang.org/x/sys/unix", + "Rev": "7a4fde3fda8ef580a89dbae8138c26041be14299" + }, + { + "ImportPath": "golang.org/x/text/cases", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/internal", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/internal/tag", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/language", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/runes", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/secure/bidirule", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/secure/precis", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/transform", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/unicode/bidi", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/unicode/norm", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "golang.org/x/text/width", + "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + }, + { + "ImportPath": "gopkg.in/inf.v0", + "Rev": "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" + }, + { + "ImportPath": "gopkg.in/yaml.v2", + "Rev": "53feefa2559fb8dfa8d81baad31be332c97d6c77" + } + ] } From 928f5804e3b48a4e3057fc383339760c43ed4d7a Mon Sep 17 00:00:00 2001 From: Antoine Pelisse Date: Tue, 8 Aug 2017 15:00:23 -0700 Subject: [PATCH 2/6] Revert "Revert "Merge pull request #47353 from apelisse/http-cache"" This reverts commit 4ee72eb300423772020dd1cf208159058ba7dab5. Kubernetes-commit: 332b681bd1d961e2cee16bca10784088a8d308f1 --- Godeps/Godeps.json | 16 +++++++++ rest/config.go | 4 +++ rest/config_test.go | 1 + rest/transport.go | 1 + tools/clientcmd/client_config.go | 5 +++ tools/clientcmd/overrides.go | 8 +++++ transport/BUILD | 3 ++ transport/config.go | 4 +++ transport/round_trippers.go | 17 +++++++++ transport/round_trippers_test.go | 61 ++++++++++++++++++++++++++++++++ 10 files changed, 120 insertions(+) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 1eccbc05..a0425998 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -154,6 +154,10 @@ "ImportPath": "github.com/golang/protobuf/ptypes/timestamp", "Rev": "4bd1920723d7b7c925de087aa32e2187708897f7" }, + { + "ImportPath": "github.com/google/btree", + "Rev": "7d79101e329e5a3adf994758c578dab82b90c017" + }, { "ImportPath": "github.com/google/gofuzz", "Rev": "44d81051d367757e1c7c6a5a86423ece9afcf63c" @@ -198,6 +202,14 @@ "ImportPath": "github.com/gophercloud/gophercloud/pagination", "Rev": "c0406a133c4a74a838baf0ddff3c2fab21155fba" }, + { + "ImportPath": "github.com/gregjones/httpcache", + "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" + }, + { + "ImportPath": "github.com/gregjones/httpcache/diskcache", + "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" + }, { "ImportPath": "github.com/hashicorp/golang-lru", "Rev": "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" @@ -234,6 +246,10 @@ "ImportPath": "github.com/mailru/easyjson/jwriter", "Rev": "d5b7844b561a7bc640052f1b935f7b800330d7e0" }, + { + "ImportPath": "github.com/peterbourgon/diskv", + "Rev": "5dfcb07a075adbaaa4094cddfd160b1e1c77a043" + }, { "ImportPath": "github.com/pmezard/go-difflib/difflib", "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" diff --git a/rest/config.go b/rest/config.go index dca7333d..627a9cc9 100644 --- a/rest/config.go +++ b/rest/config.go @@ -71,6 +71,10 @@ type Config struct { // TODO: demonstrate an OAuth2 compatible client. BearerToken string + // CacheDir is the directory where we'll store HTTP cached responses. + // If set to empty string, no caching mechanism will be used. + CacheDir string + // Impersonate is the configuration that RESTClient will use for impersonation. Impersonate ImpersonationConfig diff --git a/rest/config_test.go b/rest/config_test.go index f04135a4..f20ed722 100644 --- a/rest/config_test.go +++ b/rest/config_test.go @@ -249,6 +249,7 @@ func TestAnonymousConfig(t *testing.T) { expected.BearerToken = "" expected.Username = "" expected.Password = "" + expected.CacheDir = "" expected.AuthProvider = nil expected.AuthConfigPersister = nil expected.TLSClientConfig.CertData = nil diff --git a/rest/transport.go b/rest/transport.go index ba43752b..4c5b1648 100644 --- a/rest/transport.go +++ b/rest/transport.go @@ -89,6 +89,7 @@ func (c *Config) TransportConfig() (*transport.Config, error) { }, Username: c.Username, Password: c.Password, + CacheDir: c.CacheDir, BearerToken: c.BearerToken, Impersonate: transport.ImpersonationConfig{ UserName: c.Impersonate.UserName, diff --git a/tools/clientcmd/client_config.go b/tools/clientcmd/client_config.go index a8698af2..9646c6b7 100644 --- a/tools/clientcmd/client_config.go +++ b/tools/clientcmd/client_config.go @@ -22,6 +22,7 @@ import ( "io/ioutil" "net/url" "os" + "path/filepath" "strings" "github.com/golang/glog" @@ -31,16 +32,19 @@ import ( restclient "k8s.io/client-go/rest" clientauth "k8s.io/client-go/tools/auth" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" + "k8s.io/client-go/util/homedir" ) var ( // ClusterDefaults has the same behavior as the old EnvVar and DefaultCluster fields // DEPRECATED will be replaced ClusterDefaults = clientcmdapi.Cluster{Server: getDefaultServer()} + cacheDirDefault = filepath.Join(homedir.HomeDir(), ".kube", "http-cache") // DefaultClientConfig represents the legacy behavior of this package for defaulting // DEPRECATED will be replace DefaultClientConfig = DirectClientConfig{*clientcmdapi.NewConfig(), "", &ConfigOverrides{ ClusterDefaults: ClusterDefaults, + CacheDir: cacheDirDefault, }, nil, NewDefaultClientConfigLoadingRules(), promptedCredentials{}} ) @@ -131,6 +135,7 @@ func (config *DirectClientConfig) ClientConfig() (*restclient.Config, error) { clientConfig := &restclient.Config{} clientConfig.Host = configClusterInfo.Server + clientConfig.CacheDir = config.overrides.CacheDir if len(config.overrides.Timeout) > 0 { timeout, err := ParseTimeout(config.overrides.Timeout) diff --git a/tools/clientcmd/overrides.go b/tools/clientcmd/overrides.go index 963ac8fa..25ab1ea1 100644 --- a/tools/clientcmd/overrides.go +++ b/tools/clientcmd/overrides.go @@ -17,11 +17,13 @@ limitations under the License. package clientcmd import ( + "path/filepath" "strconv" "github.com/spf13/pflag" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" + "k8s.io/client-go/util/homedir" ) // ConfigOverrides holds values that should override whatever information is pulled from the actual Config object. You can't @@ -34,6 +36,7 @@ type ConfigOverrides struct { Context clientcmdapi.Context CurrentContext string Timeout string + CacheDir string } // ConfigOverrideFlags holds the flag names to be used for binding command line flags. Notice that this structure tightly @@ -44,6 +47,7 @@ type ConfigOverrideFlags struct { ContextOverrideFlags ContextOverrideFlags CurrentContext FlagInfo Timeout FlagInfo + CacheDir FlagInfo } // AuthOverrideFlags holds the flag names to be used for binding command line flags for AuthInfo objects @@ -146,10 +150,12 @@ const ( FlagUsername = "username" FlagPassword = "password" FlagTimeout = "request-timeout" + FlagCacheDir = "cachedir" ) // RecommendedConfigOverrideFlags is a convenience method to return recommended flag names prefixed with a string of your choosing func RecommendedConfigOverrideFlags(prefix string) ConfigOverrideFlags { + defaultCacheDir := filepath.Join(homedir.HomeDir(), ".kube", "http-cache") return ConfigOverrideFlags{ AuthOverrideFlags: RecommendedAuthOverrideFlags(prefix), ClusterOverrideFlags: RecommendedClusterOverrideFlags(prefix), @@ -157,6 +163,7 @@ func RecommendedConfigOverrideFlags(prefix string) ConfigOverrideFlags { CurrentContext: FlagInfo{prefix + FlagContext, "", "", "The name of the kubeconfig context to use"}, Timeout: FlagInfo{prefix + FlagTimeout, "", "0", "The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests."}, + CacheDir: FlagInfo{prefix + FlagCacheDir, "", defaultCacheDir, "Path to http-cache directory"}, } } @@ -198,6 +205,7 @@ func BindOverrideFlags(overrides *ConfigOverrides, flags *pflag.FlagSet, flagNam BindContextFlags(&overrides.Context, flags, flagNames.ContextOverrideFlags) flagNames.CurrentContext.BindStringFlag(flags, &overrides.CurrentContext) flagNames.Timeout.BindStringFlag(flags, &overrides.Timeout) + flagNames.CacheDir.BindStringFlag(flags, &overrides.CacheDir) } // BindAuthInfoFlags is a convenience method to bind the specified flags to their associated variables diff --git a/transport/BUILD b/transport/BUILD index 56b6256c..c03ed48c 100644 --- a/transport/BUILD +++ b/transport/BUILD @@ -26,6 +26,9 @@ go_library( ], deps = [ "//vendor/github.com/golang/glog:go_default_library", + "//vendor/github.com/gregjones/httpcache:go_default_library", + "//vendor/github.com/gregjones/httpcache/diskcache:go_default_library", + "//vendor/github.com/peterbourgon/diskv:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", ], ) diff --git a/transport/config.go b/transport/config.go index 820594ba..e34d6e8c 100644 --- a/transport/config.go +++ b/transport/config.go @@ -34,6 +34,10 @@ type Config struct { // Bearer token for authentication BearerToken string + // CacheDir is the directory where we'll store HTTP cached responses. + // If set to empty string, no caching mechanism will be used. + CacheDir string + // Impersonate is the config that this Config will impersonate using Impersonate ImpersonationConfig diff --git a/transport/round_trippers.go b/transport/round_trippers.go index c728b187..2394c42c 100644 --- a/transport/round_trippers.go +++ b/transport/round_trippers.go @@ -23,6 +23,9 @@ import ( "time" "github.com/golang/glog" + "github.com/gregjones/httpcache" + "github.com/gregjones/httpcache/diskcache" + "github.com/peterbourgon/diskv" utilnet "k8s.io/apimachinery/pkg/util/net" ) @@ -56,6 +59,9 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip len(config.Impersonate.Extra) > 0 { rt = NewImpersonatingRoundTripper(config.Impersonate, rt) } + if len(config.CacheDir) > 0 { + rt = NewCacheRoundTripper(config.CacheDir, rt) + } return rt, nil } @@ -87,6 +93,17 @@ type authProxyRoundTripper struct { rt http.RoundTripper } +// NewCacheRoundTripper creates a roundtripper that reads the ETag on +// response headers and send the If-None-Match header on subsequent +// corresponding requests. +func NewCacheRoundTripper(cacheDir string, rt http.RoundTripper) http.RoundTripper { + d := diskv.New(diskv.Options{BasePath: cacheDir}) + t := httpcache.NewTransport(diskcache.NewWithDiskv(d)) + t.Transport = rt + + return t +} + // NewAuthProxyRoundTripper provides a roundtripper which will add auth proxy fields to requests for // authentication terminating proxy cases // assuming you pull the user from the context: diff --git a/transport/round_trippers_test.go b/transport/round_trippers_test.go index d5ffc6bd..c1e30c3f 100644 --- a/transport/round_trippers_test.go +++ b/transport/round_trippers_test.go @@ -17,7 +17,11 @@ limitations under the License. package transport import ( + "bytes" + "io/ioutil" "net/http" + "net/url" + "os" "reflect" "strings" "testing" @@ -216,3 +220,60 @@ func TestAuthProxyRoundTripper(t *testing.T) { } } } + +func TestCacheRoundTripper(t *testing.T) { + rt := &testRoundTripper{} + cacheDir, err := ioutil.TempDir("", "cache-rt") + defer os.RemoveAll(cacheDir) + if err != nil { + t.Fatal(err) + } + cache := NewCacheRoundTripper(cacheDir, rt) + + // First call, caches the response + req := &http.Request{ + Method: http.MethodGet, + URL: &url.URL{Host: "localhost"}, + } + rt.Response = &http.Response{ + Header: http.Header{"ETag": []string{`"123456"`}}, + Body: ioutil.NopCloser(bytes.NewReader([]byte("Content"))), + StatusCode: http.StatusOK, + } + resp, err := cache.RoundTrip(req) + if err != nil { + t.Fatal(err) + } + content, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatal(err) + } + if string(content) != "Content" { + t.Errorf(`Expected Body to be "Content", got %q`, string(content)) + } + + // Second call, returns cached response + req = &http.Request{ + Method: http.MethodGet, + URL: &url.URL{Host: "localhost"}, + } + rt.Response = &http.Response{ + StatusCode: http.StatusNotModified, + Body: ioutil.NopCloser(bytes.NewReader([]byte("Other Content"))), + } + + resp, err = cache.RoundTrip(req) + if err != nil { + t.Fatal(err) + } + + // Read body and make sure we have the initial content + content, err = ioutil.ReadAll(resp.Body) + resp.Body.Close() + if err != nil { + t.Fatal(err) + } + if string(content) != "Content" { + t.Errorf("Invalid content read from cache %q", string(content)) + } +} From e3b9d1a520ee0c6fa67b6b36eff3897b0f400ed2 Mon Sep 17 00:00:00 2001 From: Antoine Pelisse Date: Tue, 8 Aug 2017 15:05:16 -0700 Subject: [PATCH 3/6] c-go: Update diskv to get atomic fs cache write Kubernetes-commit: 30325cd580af08e13a0ebc89252842eb955fd94e --- Godeps/Godeps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index a0425998..928d99e0 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -248,7 +248,7 @@ }, { "ImportPath": "github.com/peterbourgon/diskv", - "Rev": "5dfcb07a075adbaaa4094cddfd160b1e1c77a043" + "Rev": "5f041e8faa004a95c88a202771f4cc3e991971e6" }, { "ImportPath": "github.com/pmezard/go-difflib/difflib", From 1429110930f6d4978d453eb91e370da12b7a84cd Mon Sep 17 00:00:00 2001 From: Antoine Pelisse Date: Tue, 22 Aug 2017 14:10:58 -0700 Subject: [PATCH 4/6] c-go cache: Only cache discovery requests Only cache discovery requests, and only for kubectl. Kubernetes-commit: a97a1ba14e06ce9dadf0d1e8ea35083842678576 --- tools/clientcmd/client_config.go | 5 ----- tools/clientcmd/overrides.go | 8 -------- 2 files changed, 13 deletions(-) diff --git a/tools/clientcmd/client_config.go b/tools/clientcmd/client_config.go index 9646c6b7..a8698af2 100644 --- a/tools/clientcmd/client_config.go +++ b/tools/clientcmd/client_config.go @@ -22,7 +22,6 @@ import ( "io/ioutil" "net/url" "os" - "path/filepath" "strings" "github.com/golang/glog" @@ -32,19 +31,16 @@ import ( restclient "k8s.io/client-go/rest" clientauth "k8s.io/client-go/tools/auth" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - "k8s.io/client-go/util/homedir" ) var ( // ClusterDefaults has the same behavior as the old EnvVar and DefaultCluster fields // DEPRECATED will be replaced ClusterDefaults = clientcmdapi.Cluster{Server: getDefaultServer()} - cacheDirDefault = filepath.Join(homedir.HomeDir(), ".kube", "http-cache") // DefaultClientConfig represents the legacy behavior of this package for defaulting // DEPRECATED will be replace DefaultClientConfig = DirectClientConfig{*clientcmdapi.NewConfig(), "", &ConfigOverrides{ ClusterDefaults: ClusterDefaults, - CacheDir: cacheDirDefault, }, nil, NewDefaultClientConfigLoadingRules(), promptedCredentials{}} ) @@ -135,7 +131,6 @@ func (config *DirectClientConfig) ClientConfig() (*restclient.Config, error) { clientConfig := &restclient.Config{} clientConfig.Host = configClusterInfo.Server - clientConfig.CacheDir = config.overrides.CacheDir if len(config.overrides.Timeout) > 0 { timeout, err := ParseTimeout(config.overrides.Timeout) diff --git a/tools/clientcmd/overrides.go b/tools/clientcmd/overrides.go index 25ab1ea1..963ac8fa 100644 --- a/tools/clientcmd/overrides.go +++ b/tools/clientcmd/overrides.go @@ -17,13 +17,11 @@ limitations under the License. package clientcmd import ( - "path/filepath" "strconv" "github.com/spf13/pflag" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - "k8s.io/client-go/util/homedir" ) // ConfigOverrides holds values that should override whatever information is pulled from the actual Config object. You can't @@ -36,7 +34,6 @@ type ConfigOverrides struct { Context clientcmdapi.Context CurrentContext string Timeout string - CacheDir string } // ConfigOverrideFlags holds the flag names to be used for binding command line flags. Notice that this structure tightly @@ -47,7 +44,6 @@ type ConfigOverrideFlags struct { ContextOverrideFlags ContextOverrideFlags CurrentContext FlagInfo Timeout FlagInfo - CacheDir FlagInfo } // AuthOverrideFlags holds the flag names to be used for binding command line flags for AuthInfo objects @@ -150,12 +146,10 @@ const ( FlagUsername = "username" FlagPassword = "password" FlagTimeout = "request-timeout" - FlagCacheDir = "cachedir" ) // RecommendedConfigOverrideFlags is a convenience method to return recommended flag names prefixed with a string of your choosing func RecommendedConfigOverrideFlags(prefix string) ConfigOverrideFlags { - defaultCacheDir := filepath.Join(homedir.HomeDir(), ".kube", "http-cache") return ConfigOverrideFlags{ AuthOverrideFlags: RecommendedAuthOverrideFlags(prefix), ClusterOverrideFlags: RecommendedClusterOverrideFlags(prefix), @@ -163,7 +157,6 @@ func RecommendedConfigOverrideFlags(prefix string) ConfigOverrideFlags { CurrentContext: FlagInfo{prefix + FlagContext, "", "", "The name of the kubeconfig context to use"}, Timeout: FlagInfo{prefix + FlagTimeout, "", "0", "The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests."}, - CacheDir: FlagInfo{prefix + FlagCacheDir, "", defaultCacheDir, "Path to http-cache directory"}, } } @@ -205,7 +198,6 @@ func BindOverrideFlags(overrides *ConfigOverrides, flags *pflag.FlagSet, flagNam BindContextFlags(&overrides.Context, flags, flagNames.ContextOverrideFlags) flagNames.CurrentContext.BindStringFlag(flags, &overrides.CurrentContext) flagNames.Timeout.BindStringFlag(flags, &overrides.Timeout) - flagNames.CacheDir.BindStringFlag(flags, &overrides.CacheDir) } // BindAuthInfoFlags is a convenience method to bind the specified flags to their associated variables From 0b7513368a96423b78972520a7aeaa7f23548e2e Mon Sep 17 00:00:00 2001 From: Antoine Pelisse Date: Mon, 14 Aug 2017 15:09:37 -0700 Subject: [PATCH 5/6] c-go cache: Use diskv TempDir to get atomic write Kubernetes-commit: e58da7bb7c1800ffd4f24cf77c2e3f3cdfcdf906 --- transport/round_trippers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/transport/round_trippers.go b/transport/round_trippers.go index 2394c42c..e6bb84e1 100644 --- a/transport/round_trippers.go +++ b/transport/round_trippers.go @@ -19,6 +19,7 @@ package transport import ( "fmt" "net/http" + "path/filepath" "strings" "time" @@ -97,7 +98,10 @@ type authProxyRoundTripper struct { // response headers and send the If-None-Match header on subsequent // corresponding requests. func NewCacheRoundTripper(cacheDir string, rt http.RoundTripper) http.RoundTripper { - d := diskv.New(diskv.Options{BasePath: cacheDir}) + d := diskv.New(diskv.Options{ + BasePath: cacheDir, + TempDir: filepath.Join(cacheDir, ".diskv-temp"), + }) t := httpcache.NewTransport(diskcache.NewWithDiskv(d)) t.Transport = rt From 2ed3ee45248041f617939b74dd7f25b9647a05a7 Mon Sep 17 00:00:00 2001 From: Antoine Pelisse Date: Wed, 23 Aug 2017 09:34:02 -0700 Subject: [PATCH 6/6] client-go cache: Make caching layer Unwrappable Kubernetes-commit: a804d440c3dfab8820c7f2d231dcaecb201be7b5 --- transport/round_trippers.go | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/transport/round_trippers.go b/transport/round_trippers.go index e6bb84e1..2ee605d7 100644 --- a/transport/round_trippers.go +++ b/transport/round_trippers.go @@ -86,12 +86,8 @@ type requestCanceler interface { CancelRequest(*http.Request) } -type authProxyRoundTripper struct { - username string - groups []string - extra map[string][]string - - rt http.RoundTripper +type cacheRoundTripper struct { + rt *httpcache.Transport } // NewCacheRoundTripper creates a roundtripper that reads the ETag on @@ -105,7 +101,21 @@ func NewCacheRoundTripper(cacheDir string, rt http.RoundTripper) http.RoundTripp t := httpcache.NewTransport(diskcache.NewWithDiskv(d)) t.Transport = rt - return t + return &cacheRoundTripper{rt: t} +} + +func (rt *cacheRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + return rt.rt.RoundTrip(req) +} + +func (rt *cacheRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt.Transport } + +type authProxyRoundTripper struct { + username string + groups []string + extra map[string][]string + + rt http.RoundTripper } // NewAuthProxyRoundTripper provides a roundtripper which will add auth proxy fields to requests for