From 000510d9b73d5be870ebc763ea3606997107172c Mon Sep 17 00:00:00 2001 From: Antoine Pelisse Date: Thu, 31 May 2018 14:00:34 -0700 Subject: [PATCH] Replace openapi Fake with kube-openapi version There are two version of this fake class, let's just use that one version. --- Godeps/Godeps.json | 155 ++++++------- Godeps/LICENSES | 210 ++++++++++++++++++ pkg/kubectl/cmd/util/openapi/BUILD | 2 +- pkg/kubectl/cmd/util/openapi/openapi_test.go | 4 +- pkg/kubectl/cmd/util/openapi/testing/BUILD | 4 +- .../cmd/util/openapi/testing/openapi.go | 48 +--- pkg/kubectl/cmd/util/openapi/validation/BUILD | 2 +- .../openapi/validation/validation_test.go | 4 +- .../Godeps/Godeps.json | 10 +- .../k8s.io/apimachinery/Godeps/Godeps.json | 2 +- .../src/k8s.io/apiserver/Godeps/Godeps.json | 10 +- .../src/k8s.io/client-go/Godeps/Godeps.json | 2 +- .../k8s.io/code-generator/Godeps/Godeps.json | 4 +- .../k8s.io/kube-aggregator/Godeps/Godeps.json | 12 +- staging/src/k8s.io/metrics/Godeps/Godeps.json | 2 +- .../sample-apiserver/Godeps/Godeps.json | 10 +- .../sample-controller/Godeps/Godeps.json | 2 +- .../kube-openapi/pkg/handler/handler.go | 3 - .../k8s.io/kube-openapi/pkg/util/proto/BUILD | 1 + .../kube-openapi/pkg/util/proto/document.go | 74 +++--- .../kube-openapi/pkg/util/proto/openapi.go | 2 +- .../kube-openapi/pkg/util/proto/testing/BUILD | 27 +++ .../pkg/util/proto/testing/openapi.go | 68 ++++++ 23 files changed, 468 insertions(+), 190 deletions(-) create mode 100644 vendor/k8s.io/kube-openapi/pkg/util/proto/testing/BUILD create mode 100644 vendor/k8s.io/kube-openapi/pkg/util/proto/testing/openapi.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index ca14a53b47..c275773013 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -499,47 +499,47 @@ }, { "ImportPath": "github.com/containerd/containerd/api/services/containers/v1", - "Comment": "v1.0.0-beta.2-159-g27d450a", + "Comment": "v1.0.0-beta.2-159-g27d450a0", "Rev": "27d450a01bb533d7ebc5701eb52792565396b084" }, { "ImportPath": "github.com/containerd/containerd/api/services/tasks/v1", - "Comment": "v1.0.0-beta.2-159-g27d450a", + "Comment": "v1.0.0-beta.2-159-g27d450a0", "Rev": "27d450a01bb533d7ebc5701eb52792565396b084" }, { "ImportPath": "github.com/containerd/containerd/api/services/version/v1", - "Comment": "v1.0.0-beta.2-159-g27d450a", + "Comment": "v1.0.0-beta.2-159-g27d450a0", "Rev": "27d450a01bb533d7ebc5701eb52792565396b084" }, { "ImportPath": "github.com/containerd/containerd/api/types", - "Comment": "v1.0.0-beta.2-159-g27d450a", + "Comment": "v1.0.0-beta.2-159-g27d450a0", "Rev": "27d450a01bb533d7ebc5701eb52792565396b084" }, { "ImportPath": "github.com/containerd/containerd/api/types/task", - "Comment": "v1.0.0-beta.2-159-g27d450a", + "Comment": "v1.0.0-beta.2-159-g27d450a0", "Rev": "27d450a01bb533d7ebc5701eb52792565396b084" }, { "ImportPath": "github.com/containerd/containerd/containers", - "Comment": "v1.0.0-beta.2-159-g27d450a", + "Comment": "v1.0.0-beta.2-159-g27d450a0", "Rev": "27d450a01bb533d7ebc5701eb52792565396b084" }, { "ImportPath": "github.com/containerd/containerd/dialer", - "Comment": "v1.0.0-beta.2-159-g27d450a", + "Comment": "v1.0.0-beta.2-159-g27d450a0", "Rev": "27d450a01bb533d7ebc5701eb52792565396b084" }, { "ImportPath": "github.com/containerd/containerd/errdefs", - "Comment": "v1.0.0-beta.2-159-g27d450a", + "Comment": "v1.0.0-beta.2-159-g27d450a0", "Rev": "27d450a01bb533d7ebc5701eb52792565396b084" }, { "ImportPath": "github.com/containerd/containerd/namespaces", - "Comment": "v1.0.0-beta.2-159-g27d450a", + "Comment": "v1.0.0-beta.2-159-g27d450a0", "Rev": "27d450a01bb533d7ebc5701eb52792565396b084" }, { @@ -1019,157 +1019,157 @@ }, { "ImportPath": "github.com/docker/distribution/digestset", - "Comment": "v2.6.0-rc.1-209-gedc3ab2", + "Comment": "v2.6.0-rc.1-209-gedc3ab29", "Rev": "edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c" }, { "ImportPath": "github.com/docker/distribution/reference", - "Comment": "v2.6.0-rc.1-209-gedc3ab2", + "Comment": "v2.6.0-rc.1-209-gedc3ab29", "Rev": "edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c" }, { "ImportPath": "github.com/docker/docker/api", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/blkiodev", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/container", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/events", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/filters", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/image", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/mount", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/network", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/registry", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/strslice", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/swarm", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/swarm/runtime", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/time", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/versions", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/api/types/volume", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/client", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/ioutils", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/jsonlog", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/jsonmessage", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/longpath", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/mount", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/parsers", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/stdcopy", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/sysinfo", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/system", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/term", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/term/windows", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { "ImportPath": "github.com/docker/docker/pkg/tlsconfig", - "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", + "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1", "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" }, { @@ -1194,7 +1194,7 @@ }, { "ImportPath": "github.com/docker/libnetwork/ipvs", - "Comment": "v0.8.0-dev.2-910-gba46b92", + "Comment": "v0.8.0-dev.2-910-gba46b928", "Rev": "ba46b928444931e6865d8618dc03622cac79aa6f" }, { @@ -1240,6 +1240,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", + "Comment": "v3.0.0-23-g94e38aa", "Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b" }, { @@ -1311,132 +1312,132 @@ }, { "ImportPath": "github.com/gogo/protobuf/gogoproto", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/compare", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/defaultcheck", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/description", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/embedcheck", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/enumstringer", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/equal", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/face", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/gostring", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/marshalto", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/oneofcheck", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/populate", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/size", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/stringer", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/testgen", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/union", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/unmarshal", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/proto", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/descriptor", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/generator", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/grpc", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/plugin", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/sortkeys", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/types", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/vanity", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/vanity/command", - "Comment": "v0.4-3-gc0656ed", + "Comment": "v0.4-3-gc0656edd", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { @@ -3334,35 +3335,39 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/aggregator", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/generators", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" + }, + { + "ImportPath": "k8s.io/kube-openapi/pkg/util/proto/testing", + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto/validation", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/utils/clock", diff --git a/Godeps/LICENSES b/Godeps/LICENSES index c2cb197bc2..a960a8256b 100644 --- a/Godeps/LICENSES +++ b/Godeps/LICENSES @@ -102669,6 +102669,216 @@ Apache License ================================================================================ +================================================================================ += vendor/k8s.io/kube-openapi/pkg/util/proto/testing licensed under: = + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + += vendor/k8s.io/kube-openapi/LICENSE 3b83ef96387f14655fc854ddc3c6bd57 +================================================================================ + + ================================================================================ = vendor/k8s.io/kube-openapi/pkg/util/proto/validation licensed under: = diff --git a/pkg/kubectl/cmd/util/openapi/BUILD b/pkg/kubectl/cmd/util/openapi/BUILD index eda5d272a2..22f8f9c737 100644 --- a/pkg/kubectl/cmd/util/openapi/BUILD +++ b/pkg/kubectl/cmd/util/openapi/BUILD @@ -35,7 +35,6 @@ go_test( data = ["//api/openapi-spec:swagger-spec"], deps = [ ":go_default_library", - "//pkg/kubectl/cmd/util/openapi/testing:go_default_library", "//vendor/github.com/googleapis/gnostic/OpenAPIv2:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/config:go_default_library", @@ -43,6 +42,7 @@ go_test( "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/kube-openapi/pkg/util/proto:go_default_library", + "//vendor/k8s.io/kube-openapi/pkg/util/proto/testing:go_default_library", ], ) diff --git a/pkg/kubectl/cmd/util/openapi/openapi_test.go b/pkg/kubectl/cmd/util/openapi/openapi_test.go index 5ee7302f1b..d996a53382 100644 --- a/pkg/kubectl/cmd/util/openapi/openapi_test.go +++ b/pkg/kubectl/cmd/util/openapi/openapi_test.go @@ -24,11 +24,11 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/kube-openapi/pkg/util/proto" + "k8s.io/kube-openapi/pkg/util/proto/testing" "k8s.io/kubernetes/pkg/kubectl/cmd/util/openapi" - tst "k8s.io/kubernetes/pkg/kubectl/cmd/util/openapi/testing" ) -var fakeSchema = tst.Fake{Path: filepath.Join("..", "..", "..", "..", "..", "api", "openapi-spec", "swagger.json")} +var fakeSchema = testing.Fake{Path: filepath.Join("..", "..", "..", "..", "..", "api", "openapi-spec", "swagger.json")} var _ = Describe("Reading apps/v1beta1/Deployment from openAPIData", func() { var resources openapi.Resources diff --git a/pkg/kubectl/cmd/util/openapi/testing/BUILD b/pkg/kubectl/cmd/util/openapi/testing/BUILD index 26a7b34673..ce6ffc739b 100644 --- a/pkg/kubectl/cmd/util/openapi/testing/BUILD +++ b/pkg/kubectl/cmd/util/openapi/testing/BUILD @@ -11,11 +11,9 @@ go_library( importpath = "k8s.io/kubernetes/pkg/kubectl/cmd/util/openapi/testing", deps = [ "//pkg/kubectl/cmd/util/openapi:go_default_library", - "//vendor/github.com/googleapis/gnostic/OpenAPIv2:go_default_library", - "//vendor/github.com/googleapis/gnostic/compiler:go_default_library", - "//vendor/gopkg.in/yaml.v2:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/kube-openapi/pkg/util/proto:go_default_library", + "//vendor/k8s.io/kube-openapi/pkg/util/proto/testing:go_default_library", ], ) diff --git a/pkg/kubectl/cmd/util/openapi/testing/openapi.go b/pkg/kubectl/cmd/util/openapi/testing/openapi.go index 4935e7ad0c..e59e6d3d39 100644 --- a/pkg/kubectl/cmd/util/openapi/testing/openapi.go +++ b/pkg/kubectl/cmd/util/openapi/testing/openapi.go @@ -17,59 +17,17 @@ limitations under the License. package testing import ( - "io/ioutil" - "os" - "sync" - "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/kube-openapi/pkg/util/proto" + "k8s.io/kube-openapi/pkg/util/proto/testing" "k8s.io/kubernetes/pkg/kubectl/cmd/util/openapi" - - yaml "gopkg.in/yaml.v2" - - "github.com/googleapis/gnostic/OpenAPIv2" - "github.com/googleapis/gnostic/compiler" ) -// Fake opens and returns a openapi swagger from a file Path. It will -// parse only once and then return the same copy everytime. -type Fake struct { - Path string - - once sync.Once - document *openapi_v2.Document - err error -} - -// OpenAPISchema returns the openapi document and a potential error. -func (f *Fake) OpenAPISchema() (*openapi_v2.Document, error) { - f.once.Do(func() { - _, err := os.Stat(f.Path) - if err != nil { - f.err = err - return - } - spec, err := ioutil.ReadFile(f.Path) - if err != nil { - f.err = err - return - } - var info yaml.MapSlice - err = yaml.Unmarshal(spec, &info) - if err != nil { - f.err = err - return - } - f.document, f.err = openapi_v2.NewDocument(info, compiler.NewContext("$root", nil)) - }) - return f.document, f.err -} - // FakeResources is a wrapper to directly load the openapi schema from a // file, and get the schema for given GVK. This is only for test since // it's assuming that the file is there and everything will go fine. type FakeResources struct { - fake Fake + fake testing.Fake } var _ openapi.Resources = &FakeResources{} @@ -77,7 +35,7 @@ var _ openapi.Resources = &FakeResources{} // NewFakeResources creates a new FakeResources. func NewFakeResources(path string) *FakeResources { return &FakeResources{ - fake: Fake{Path: path}, + fake: testing.Fake{Path: path}, } } diff --git a/pkg/kubectl/cmd/util/openapi/validation/BUILD b/pkg/kubectl/cmd/util/openapi/validation/BUILD index b1fa6fb0ae..1d1ebb302d 100644 --- a/pkg/kubectl/cmd/util/openapi/validation/BUILD +++ b/pkg/kubectl/cmd/util/openapi/validation/BUILD @@ -31,12 +31,12 @@ go_test( deps = [ "//pkg/api/testapi:go_default_library", "//pkg/kubectl/cmd/util/openapi:go_default_library", - "//pkg/kubectl/cmd/util/openapi/testing:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/config:go_default_library", "//vendor/github.com/onsi/ginkgo/types:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library", + "//vendor/k8s.io/kube-openapi/pkg/util/proto/testing:go_default_library", "//vendor/k8s.io/kube-openapi/pkg/util/proto/validation:go_default_library", ], ) diff --git a/pkg/kubectl/cmd/util/openapi/validation/validation_test.go b/pkg/kubectl/cmd/util/openapi/validation/validation_test.go index 67aad17174..2fb8b528e4 100644 --- a/pkg/kubectl/cmd/util/openapi/validation/validation_test.go +++ b/pkg/kubectl/cmd/util/openapi/validation/validation_test.go @@ -25,12 +25,12 @@ import ( utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/kube-openapi/pkg/util/proto/validation" // This dependency is needed to register API types. + "k8s.io/kube-openapi/pkg/util/proto/testing" _ "k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/kubectl/cmd/util/openapi" - tst "k8s.io/kubernetes/pkg/kubectl/cmd/util/openapi/testing" ) -var fakeSchema = tst.Fake{Path: filepath.Join("..", "..", "..", "..", "..", "..", "api", "openapi-spec", "swagger.json")} +var fakeSchema = testing.Fake{Path: filepath.Join("..", "..", "..", "..", "..", "..", "api", "openapi-spec", "swagger.json")} var _ = Describe("resource validation using OpenAPI Schema", func() { var validator *SchemaValidation diff --git a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json index 9fd2162d97..3d87bef48f 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json @@ -2032,23 +2032,23 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/equality", diff --git a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json index 2de98ffda1..83fbe49aef 100644 --- a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json +++ b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json @@ -180,7 +180,7 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" } ] } diff --git a/staging/src/k8s.io/apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiserver/Godeps/Godeps.json index 8e3d9436a4..b54eeefc97 100644 --- a/staging/src/k8s.io/apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiserver/Godeps/Godeps.json @@ -1760,23 +1760,23 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/client-go/discovery", diff --git a/staging/src/k8s.io/client-go/Godeps/Godeps.json b/staging/src/k8s.io/client-go/Godeps/Godeps.json index f314634d39..b78bebfbb4 100644 --- a/staging/src/k8s.io/client-go/Godeps/Godeps.json +++ b/staging/src/k8s.io/client-go/Godeps/Godeps.json @@ -588,7 +588,7 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" } ] } diff --git a/staging/src/k8s.io/code-generator/Godeps/Godeps.json b/staging/src/k8s.io/code-generator/Godeps/Godeps.json index 15a35e1fe0..a4aca68986 100644 --- a/staging/src/k8s.io/code-generator/Godeps/Godeps.json +++ b/staging/src/k8s.io/code-generator/Godeps/Godeps.json @@ -260,11 +260,11 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/generators", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" } ] } diff --git a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json index 4e684a1612..358dd3d5a2 100644 --- a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json @@ -1680,27 +1680,27 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/aggregator", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" } ] } diff --git a/staging/src/k8s.io/metrics/Godeps/Godeps.json b/staging/src/k8s.io/metrics/Godeps/Godeps.json index e5edd72e25..c44d84845a 100644 --- a/staging/src/k8s.io/metrics/Godeps/Godeps.json +++ b/staging/src/k8s.io/metrics/Godeps/Godeps.json @@ -488,7 +488,7 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" } ] } diff --git a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json index 008ec6a99d..ed5b4c5668 100644 --- a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json @@ -1644,23 +1644,23 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" } ] } diff --git a/staging/src/k8s.io/sample-controller/Godeps/Godeps.json b/staging/src/k8s.io/sample-controller/Godeps/Godeps.json index 7fbae5e9bd..ba9e447f72 100644 --- a/staging/src/k8s.io/sample-controller/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-controller/Godeps/Godeps.json @@ -1072,7 +1072,7 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "86e28c192d2743f0232b9bc5f0a531568ef9f2a5" + "Rev": "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" } ] } diff --git a/vendor/k8s.io/kube-openapi/pkg/handler/handler.go b/vendor/k8s.io/kube-openapi/pkg/handler/handler.go index 63c6f825bd..c4bbc0bff3 100644 --- a/vendor/k8s.io/kube-openapi/pkg/handler/handler.go +++ b/vendor/k8s.io/kube-openapi/pkg/handler/handler.go @@ -58,7 +58,6 @@ type OpenAPIService struct { // rwMutex protects All members of this service. rwMutex sync.RWMutex - orgSpec *spec.Swagger lastModified time.Time specBytes []byte @@ -161,7 +160,6 @@ func (o *OpenAPIService) getSwaggerPbGzBytes() ([]byte, string, time.Time) { } func (o *OpenAPIService) UpdateSpec(openapiSpec *spec.Swagger) (err error) { - orgSpec := openapiSpec specBytes, err := json.MarshalIndent(openapiSpec, " ", " ") if err != nil { return err @@ -181,7 +179,6 @@ func (o *OpenAPIService) UpdateSpec(openapiSpec *spec.Swagger) (err error) { o.rwMutex.Lock() defer o.rwMutex.Unlock() - o.orgSpec = orgSpec o.specBytes = specBytes o.specPb = specPb o.specPbGz = specPbGz diff --git a/vendor/k8s.io/kube-openapi/pkg/util/proto/BUILD b/vendor/k8s.io/kube-openapi/pkg/util/proto/BUILD index 4a1d70b70d..1dc6f53a0a 100644 --- a/vendor/k8s.io/kube-openapi/pkg/util/proto/BUILD +++ b/vendor/k8s.io/kube-openapi/pkg/util/proto/BUILD @@ -26,6 +26,7 @@ filegroup( name = "all-srcs", srcs = [ ":package-srcs", + "//vendor/k8s.io/kube-openapi/pkg/util/proto/testing:all-srcs", "//vendor/k8s.io/kube-openapi/pkg/util/proto/validation:all-srcs", ], tags = ["automanaged"], diff --git a/vendor/k8s.io/kube-openapi/pkg/util/proto/document.go b/vendor/k8s.io/kube-openapi/pkg/util/proto/document.go index 61dbf4fc0e..a57dcd363f 100644 --- a/vendor/k8s.io/kube-openapi/pkg/util/proto/document.go +++ b/vendor/k8s.io/kube-openapi/pkg/util/proto/document.go @@ -21,8 +21,8 @@ import ( "sort" "strings" - openapi_v2 "github.com/googleapis/gnostic/OpenAPIv2" - yaml "gopkg.in/yaml.v2" + "github.com/googleapis/gnostic/OpenAPIv2" + "gopkg.in/yaml.v2" ) func newSchemaError(path *Path, format string, a ...interface{}) error { @@ -126,12 +126,17 @@ func (d *Definitions) parseMap(s *openapi_v2.Schema, path *Path) (Schema, error) if len(s.GetType().GetValue()) != 0 && s.GetType().GetValue()[0] != object { return nil, newSchemaError(path, "invalid object type") } + var sub Schema if s.GetAdditionalProperties().GetSchema() == nil { - return nil, newSchemaError(path, "invalid object doesn't have additional properties") - } - sub, err := d.ParseSchema(s.GetAdditionalProperties().GetSchema(), path) - if err != nil { - return nil, err + sub = &Arbitrary{ + BaseSchema: d.parseBaseSchema(s, path), + } + } else { + var err error + sub, err = d.ParseSchema(s.GetAdditionalProperties().GetSchema(), path) + if err != nil { + return nil, err + } } return &Map{ BaseSchema: d.parseBaseSchema(s, path), @@ -148,12 +153,10 @@ func (d *Definitions) parsePrimitive(s *openapi_v2.Schema, path *Path) (Schema, t = s.GetType().GetValue()[0] } switch t { - case String: - case Number: - case Integer: - case Boolean: - case "": // Some models are completely empty, and can be safely ignored. - // Do nothing + case String: // do nothing + case Number: // do nothing + case Integer: // do nothing + case Boolean: // do nothing default: return nil, newSchemaError(path, "Unknown primitive type: %q", t) } @@ -219,27 +222,38 @@ func (d *Definitions) parseArbitrary(s *openapi_v2.Schema, path *Path) (Schema, // ParseSchema creates a walkable Schema from an openapi schema. While // this function is public, it doesn't leak through the interface. func (d *Definitions) ParseSchema(s *openapi_v2.Schema, path *Path) (Schema, error) { - objectTypes := s.GetType().GetValue() - if len(objectTypes) == 1 { - t := objectTypes[0] - switch t { - case object: - return d.parseMap(s, path) - case array: - return d.parseArray(s, path) - } - - } if s.GetXRef() != "" { return d.parseReference(s, path) } - if s.GetProperties() != nil { - return d.parseKind(s, path) + objectTypes := s.GetType().GetValue() + switch len(objectTypes) { + case 0: + // in the OpenAPI schema served by older k8s versions, object definitions created from structs did not include + // the type:object property (they only included the "properties" property), so we need to handle this case + if s.GetProperties() != nil { + return d.parseKind(s, path) + } else { + // Definition has no type and no properties. Treat it as an arbitrary value + // TODO: what if it has additionalProperties or patternProperties? + return d.parseArbitrary(s, path) + } + case 1: + t := objectTypes[0] + switch t { + case object: + if s.GetProperties() != nil { + return d.parseKind(s, path) + } else { + return d.parseMap(s, path) + } + case array: + return d.parseArray(s, path) + } + return d.parsePrimitive(s, path) + default: + // the OpenAPI generator never generates (nor it ever did in the past) OpenAPI type definitions with multiple types + return nil, newSchemaError(path, "definitions with multiple types aren't supported") } - if len(objectTypes) == 0 || (len(objectTypes) == 1 && objectTypes[0] == "") { - return d.parseArbitrary(s, path) - } - return d.parsePrimitive(s, path) } // LookupModel is public through the interface of Models. It diff --git a/vendor/k8s.io/kube-openapi/pkg/util/proto/openapi.go b/vendor/k8s.io/kube-openapi/pkg/util/proto/openapi.go index b48e62c3bf..f26b5ef881 100644 --- a/vendor/k8s.io/kube-openapi/pkg/util/proto/openapi.go +++ b/vendor/k8s.io/kube-openapi/pkg/util/proto/openapi.go @@ -59,7 +59,7 @@ type SchemaVisitor interface { } // SchemaVisitorArbitrary is an additional visitor interface which handles -// arbitrary types. For backwards compatability, it's a separate interface +// arbitrary types. For backwards compatibility, it's a separate interface // which is checked for at runtime. type SchemaVisitorArbitrary interface { SchemaVisitor diff --git a/vendor/k8s.io/kube-openapi/pkg/util/proto/testing/BUILD b/vendor/k8s.io/kube-openapi/pkg/util/proto/testing/BUILD new file mode 100644 index 0000000000..33d54ccd02 --- /dev/null +++ b/vendor/k8s.io/kube-openapi/pkg/util/proto/testing/BUILD @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["openapi.go"], + importpath = "k8s.io/kube-openapi/pkg/util/proto/testing", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/googleapis/gnostic/OpenAPIv2:go_default_library", + "//vendor/github.com/googleapis/gnostic/compiler:go_default_library", + "//vendor/gopkg.in/yaml.v2:go_default_library", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/k8s.io/kube-openapi/pkg/util/proto/testing/openapi.go b/vendor/k8s.io/kube-openapi/pkg/util/proto/testing/openapi.go new file mode 100644 index 0000000000..bc280a1982 --- /dev/null +++ b/vendor/k8s.io/kube-openapi/pkg/util/proto/testing/openapi.go @@ -0,0 +1,68 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testing + +import ( + "io/ioutil" + "os" + "sync" + + yaml "gopkg.in/yaml.v2" + + "github.com/googleapis/gnostic/OpenAPIv2" + "github.com/googleapis/gnostic/compiler" +) + +// Fake opens and returns a openapi swagger from a file Path. It will +// parse only once and then return the same copy everytime. +type Fake struct { + Path string + + once sync.Once + document *openapi_v2.Document + err error +} + +// OpenAPISchema returns the openapi document and a potential error. +func (f *Fake) OpenAPISchema() (*openapi_v2.Document, error) { + f.once.Do(func() { + _, err := os.Stat(f.Path) + if err != nil { + f.err = err + return + } + spec, err := ioutil.ReadFile(f.Path) + if err != nil { + f.err = err + return + } + var info yaml.MapSlice + err = yaml.Unmarshal(spec, &info) + if err != nil { + f.err = err + return + } + f.document, f.err = openapi_v2.NewDocument(info, compiler.NewContext("$root", nil)) + }) + return f.document, f.err +} + +type Empty struct{} + +func (Empty) OpenAPISchema() (*openapi_v2.Document, error) { + return nil, nil +}