diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 89bee171..41a0b509 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,582 +1,582 @@ { - "ImportPath": "k8s.io/client-go", - "GoVersion": "go1.9", - "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": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" - }, - { - "ImportPath": "github.com/Azure/go-autorest/autorest/adal", - "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" - }, - { - "ImportPath": "github.com/Azure/go-autorest/autorest/azure", - "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" - }, - { - "ImportPath": "github.com/Azure/go-autorest/autorest/date", - "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" - }, - { - "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/ghodss/yaml", - "Rev": "73d445a93680fa1a78ae23a5839bad48f32ba1ee" - }, - { - "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": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes", - "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/any", - "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/duration", - "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/timestamp", - "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" - }, - { - "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": "6da026c32e2d622cc242d32984259c77237aefe1" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack", - "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants", - "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens", - "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens", - "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/openstack/utils", - "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" - }, - { - "ImportPath": "github.com/gophercloud/gophercloud/pagination", - "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" - }, - { - "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/json-iterator/go", - "Rev": "13f86432b882000a51c6e610c620974462691a97" - }, - { - "ImportPath": "github.com/pmezard/go-difflib/difflib", - "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" - }, - { - "ImportPath": "github.com/spf13/pflag", - "Rev": "4c012f6dcd9546820e378d0bdda4d8fc772cdfea" - }, - { - "ImportPath": "github.com/stretchr/testify/assert", - "Rev": "f6abca593680b2315d2075e0f5e2a9751e3f431a" - }, - { - "ImportPath": "golang.org/x/crypto/ssh/terminal", - "Rev": "81e90905daefcd6fd217b62423c0908922eadb30" - }, - { - "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": "95c6576299259db960f6c5b9b69ea52422860fce" - }, - { - "ImportPath": "golang.org/x/sys/windows", - "Rev": "95c6576299259db960f6c5b9b69ea52422860fce" - }, - { - "ImportPath": "golang.org/x/text/secure/bidirule", - "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/time/rate", - "Rev": "f51c12702a4d776e4c1fa9b0fabab841babae631" - }, - { - "ImportPath": "gopkg.in/inf.v0", - "Rev": "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" - }, - { - "ImportPath": "gopkg.in/yaml.v2", - "Rev": "670d4cfef0544295bc27a114dbac37980d83185a" - }, - { - "ImportPath": "k8s.io/api/admissionregistration/v1alpha1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/admissionregistration/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/apps/v1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/apps/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/apps/v1beta2", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/authentication/v1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/authentication/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/authorization/v1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/authorization/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/autoscaling/v1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/autoscaling/v2beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/batch/v1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/batch/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/batch/v2alpha1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/certificates/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/core/v1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/events/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/extensions/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/imagepolicy/v1alpha1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/networking/v1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/policy/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/rbac/v1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/rbac/v1alpha1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/rbac/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/scheduling/v1alpha1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/settings/v1alpha1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/storage/v1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/storage/v1alpha1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/api/storage/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/equality", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/errors", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/testing", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apimachinery", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/cache", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/clock", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/version", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "a07b7bbb58e7fdc5144f8d7046331d29fc9ad3b3" - } - ] + "ImportPath": "k8s.io/client-go", + "GoVersion": "go1.9", + "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": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" + }, + { + "ImportPath": "github.com/Azure/go-autorest/autorest/adal", + "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" + }, + { + "ImportPath": "github.com/Azure/go-autorest/autorest/azure", + "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" + }, + { + "ImportPath": "github.com/Azure/go-autorest/autorest/date", + "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" + }, + { + "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/ghodss/yaml", + "Rev": "73d445a93680fa1a78ae23a5839bad48f32ba1ee" + }, + { + "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": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" + }, + { + "ImportPath": "github.com/golang/protobuf/ptypes", + "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" + }, + { + "ImportPath": "github.com/golang/protobuf/ptypes/any", + "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" + }, + { + "ImportPath": "github.com/golang/protobuf/ptypes/duration", + "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" + }, + { + "ImportPath": "github.com/golang/protobuf/ptypes/timestamp", + "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" + }, + { + "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": "6da026c32e2d622cc242d32984259c77237aefe1" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/openstack", + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants", + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens", + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens", + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/openstack/utils", + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" + }, + { + "ImportPath": "github.com/gophercloud/gophercloud/pagination", + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" + }, + { + "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/json-iterator/go", + "Rev": "13f86432b882000a51c6e610c620974462691a97" + }, + { + "ImportPath": "github.com/pmezard/go-difflib/difflib", + "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" + }, + { + "ImportPath": "github.com/spf13/pflag", + "Rev": "4c012f6dcd9546820e378d0bdda4d8fc772cdfea" + }, + { + "ImportPath": "github.com/stretchr/testify/assert", + "Rev": "f6abca593680b2315d2075e0f5e2a9751e3f431a" + }, + { + "ImportPath": "golang.org/x/crypto/ssh/terminal", + "Rev": "81e90905daefcd6fd217b62423c0908922eadb30" + }, + { + "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": "95c6576299259db960f6c5b9b69ea52422860fce" + }, + { + "ImportPath": "golang.org/x/sys/windows", + "Rev": "95c6576299259db960f6c5b9b69ea52422860fce" + }, + { + "ImportPath": "golang.org/x/text/secure/bidirule", + "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/time/rate", + "Rev": "f51c12702a4d776e4c1fa9b0fabab841babae631" + }, + { + "ImportPath": "gopkg.in/inf.v0", + "Rev": "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" + }, + { + "ImportPath": "gopkg.in/yaml.v2", + "Rev": "670d4cfef0544295bc27a114dbac37980d83185a" + }, + { + "ImportPath": "k8s.io/api/admissionregistration/v1alpha1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/admissionregistration/v1beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/apps/v1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/apps/v1beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/apps/v1beta2", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/authentication/v1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/authentication/v1beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/authorization/v1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/authorization/v1beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/autoscaling/v1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/autoscaling/v2beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/batch/v1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/batch/v1beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/batch/v2alpha1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/certificates/v1beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/core/v1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/events/v1beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/extensions/v1beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/imagepolicy/v1alpha1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/networking/v1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/policy/v1beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/rbac/v1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/rbac/v1alpha1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/rbac/v1beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/scheduling/v1alpha1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/settings/v1alpha1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/storage/v1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/storage/v1alpha1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/api/storage/v1beta1", + "Rev": "0406a944760b00b7a75b559f642673d7bb07b48a" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/api/equality", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/api/errors", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/api/meta", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/api/resource", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/api/testing", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/apimachinery", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/conversion", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/fields", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/labels", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/selection", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/types", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/cache", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/clock", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/diff", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/errors", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/framer", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/json", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/net", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/sets", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/validation", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/wait", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/version", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/watch", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", + "Rev": "bf4c8d907ba9e7fee82a73bad5346aeebff5d06e" + }, + { + "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", + "Rev": "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" + } + ] } diff --git a/discovery/discovery_client.go b/discovery/discovery_client.go index 24c11f33..3c685a95 100644 --- a/discovery/discovery_client.go +++ b/discovery/discovery_client.go @@ -36,8 +36,12 @@ import ( restclient "k8s.io/client-go/rest" ) -// defaultRetries is the number of times a resource discovery is repeated if an api group disappears on the fly (e.g. ThirdPartyResources). -const defaultRetries = 2 +const ( + // defaultRetries is the number of times a resource discovery is repeated if an api group disappears on the fly (e.g. ThirdPartyResources). + defaultRetries = 2 + // protobuf mime type + mimePb = "application/com.github.proto-openapi.spec.v2@v1.0+protobuf" +) // DiscoveryInterface holds the methods that discover server-supported API groups, // versions and resources. @@ -329,9 +333,18 @@ func (d *DiscoveryClient) ServerVersion() (*version.Info, error) { // OpenAPISchema fetches the open api schema using a rest client and parses the proto. func (d *DiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { - data, err := d.restClient.Get().AbsPath("/swagger-2.0.0.pb-v1").Do().Raw() + data, err := d.restClient.Get().AbsPath("/openapi/v2").SetHeader("Accept", mimePb).Do().Raw() if err != nil { - return nil, err + if errors.IsForbidden(err) || errors.IsNotFound(err) { + // single endpoint not found/registered in old server, try to fetch old endpoint + // TODO(roycaihw): remove this in 1.11 + data, err = d.restClient.Get().AbsPath("/swagger-2.0.0.pb-v1").Do().Raw() + if err != nil { + return nil, err + } + } else { + return nil, err + } } document := &openapi_v2.Document{} err = proto.Unmarshal(data, document) diff --git a/discovery/discovery_client_test.go b/discovery/discovery_client_test.go index 64249c88..ad855139 100644 --- a/discovery/discovery_client_test.go +++ b/discovery/discovery_client_test.go @@ -326,9 +326,14 @@ var returnedOpenAPI = openapi_v2.Document{ }, } -func openapiSchemaFakeServer() (*httptest.Server, error) { +func openapiSchemaDeprecatedFakeServer() (*httptest.Server, error) { var sErr error server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + // old server returns 403 on new endpoint request + if req.URL.Path == "/openapi/v2" { + w.WriteHeader(http.StatusForbidden) + return + } if req.URL.Path != "/swagger-2.0.0.pb-v1" { sErr = fmt.Errorf("Unexpected url %v", req.URL) } @@ -349,6 +354,33 @@ func openapiSchemaFakeServer() (*httptest.Server, error) { return server, sErr } +func openapiSchemaFakeServer() (*httptest.Server, error) { + var sErr error + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + if req.URL.Path != "/openapi/v2" { + sErr = fmt.Errorf("Unexpected url %v", req.URL) + } + if req.Method != "GET" { + sErr = fmt.Errorf("Unexpected method %v", req.Method) + } + decipherableFormat := req.Header.Get("Accept") + if decipherableFormat != "application/com.github.proto-openapi.spec.v2@v1.0+protobuf" { + sErr = fmt.Errorf("Unexpected accept mime type %v", decipherableFormat) + } + + mime.AddExtensionType(".pb-v1", "application/com.github.googleapis.gnostic.OpenAPIv2@68f4ded+protobuf") + + output, err := proto.Marshal(&returnedOpenAPI) + if err != nil { + sErr = err + return + } + w.WriteHeader(http.StatusOK) + w.Write(output) + })) + return server, sErr +} + func TestGetOpenAPISchema(t *testing.T) { server, err := openapiSchemaFakeServer() if err != nil { @@ -366,6 +398,23 @@ func TestGetOpenAPISchema(t *testing.T) { } } +func TestGetOpenAPISchemaFallback(t *testing.T) { + server, err := openapiSchemaDeprecatedFakeServer() + if err != nil { + t.Errorf("unexpected error starting fake server: %v", err) + } + defer server.Close() + + client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) + got, err := client.OpenAPISchema() + if err != nil { + t.Fatalf("unexpected error getting openapi: %v", err) + } + if e, a := returnedOpenAPI, *got; !reflect.DeepEqual(e, a) { + t.Errorf("expected %v, got %v", e, a) + } +} + func TestServerPreferredResources(t *testing.T) { stable := metav1.APIResourceList{ GroupVersion: "v1",