diff --git a/Gopkg.lock b/Gopkg.lock index d397613f4..bb9cb79e4 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,183 +2,151 @@ [[projects]] - digest = "1:93147eb1d6f08d39f2c0efe3d29ee043bda72be7a8b3b367eb08c72c18524638" name = "github.com/container-storage-interface/spec" packages = ["lib/go/csi"] - pruneopts = "" revision = "ed0bb0e1557548aa028307f48728767cfe8f6345" version = "v1.0.0" [[projects]] - digest = "1:b13707423743d41665fd23f0c36b2f37bb49c30e94adb813319c44188a51ba22" name = "github.com/ghodss/yaml" packages = ["."] - pruneopts = "" revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" version = "v1.0.0" [[projects]] - digest = "1:0a3f6a0c68ab8f3d455f8892295503b179e571b7fefe47cc6c556405d1f83411" name = "github.com/gogo/protobuf" packages = [ "gogoproto", "proto", "protoc-gen-gogo/descriptor", - "sortkeys", + "sortkeys" ] - pruneopts = "" revision = "1adfc126b41513cc696b209667c8656ea7aac67c" version = "v1.0.0" [[projects]] branch = "master" - digest = "1:107b233e45174dbab5b1324201d092ea9448e58243ab9f039e4c0f332e121e3a" name = "github.com/golang/glog" packages = ["."] - pruneopts = "" revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" [[projects]] - digest = "1:73a7106c799f98af4f3da7552906efc6a2570329f4cd2d2f5fb8f9d6c053ff2f" name = "github.com/golang/mock" packages = ["gomock"] - pruneopts = "" revision = "c34cdb4725f4c3844d095133c6e40e448b86589b" version = "v1.1.1" [[projects]] - digest = "1:f958a1c137db276e52f0b50efee41a1a389dcdded59a69711f3e872757dab34b" name = "github.com/golang/protobuf" packages = [ + "descriptor", "proto", "protoc-gen-go/descriptor", "ptypes", "ptypes/any", "ptypes/duration", "ptypes/timestamp", - "ptypes/wrappers", + "ptypes/wrappers" ] - pruneopts = "" revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" version = "v1.1.0" [[projects]] branch = "master" - digest = "1:be28c0531a755f2178acf1e327e6f5a8a3968feb5f2567cdc968064253141751" name = "github.com/google/btree" packages = ["."] - pruneopts = "" revision = "e89373fe6b4a7413d7acd6da1725b83ef713e6e4" [[projects]] branch = "master" - digest = "1:754f77e9c839b24778a4b64422236d38515301d2baeb63113aa3edc42e6af692" name = "github.com/google/gofuzz" packages = ["."] - pruneopts = "" revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1" [[projects]] - digest = "1:2a131706ff80636629ab6373f2944569b8252ecc018cda8040931b05d32e3c16" name = "github.com/googleapis/gnostic" packages = [ "OpenAPIv2", "compiler", - "extensions", + "extensions" ] - pruneopts = "" revision = "ee43cbb60db7bd22502942cccbc39059117352ab" version = "v0.1.0" [[projects]] branch = "master" - digest = "1:009a1928b8c096338b68b5822d838a72b4d8520715c1463614476359f3282ec8" name = "github.com/gregjones/httpcache" packages = [ ".", - "diskcache", + "diskcache" ] - pruneopts = "" revision = "9cad4c3443a7200dd6400aef47183728de563a38" [[projects]] - digest = "1:23bc0b496ba341c6e3ba24d6358ff4a40a704d9eb5f9a3bd8e8fbd57ad869013" name = "github.com/imdario/mergo" packages = ["."] - pruneopts = "" revision = "163f41321a19dd09362d4c63cc2489db2015f1f4" version = "0.3.2" [[projects]] - digest = "1:b79fc583e4dc7055ed86742e22164ac41bf8c0940722dbcb600f1a3ace1a8cb5" name = "github.com/json-iterator/go" packages = ["."] - pruneopts = "" revision = "1624edc4454b8682399def8740d46db5e4362ba4" version = "v1.1.5" [[projects]] - digest = "1:491e5159e6acd10a49649c18b80ad4e84d704933908f7a9ad80725e6b2a827f1" + name = "github.com/kubernetes-csi/csi-lib-utils" + packages = ["protosanitizer"] + revision = "1628ab5351eafa4fc89a96862a08a891e601e03a" + version = "v0.1.0" + +[[projects]] name = "github.com/kubernetes-csi/csi-test" packages = [ "driver", - "utils", + "utils" ] - pruneopts = "" revision = "42947e04c4a0d2087448841a1dc3ccb20fb903b1" version = "v1.0.0-rc2" [[projects]] - digest = "1:76a22f13ffa6d5d0b91beecdcec5c7651a42d3c5fcc12757e578808826fe4b0a" name = "github.com/modern-go/concurrent" packages = ["."] - pruneopts = "" revision = "938152ca6a933f501bb238954eebd3cbcbf489ff" version = "1.0.2" [[projects]] - digest = "1:e32bdbdb7c377a07a9a46378290059822efdce5c8d96fe71940d87cb4f918855" name = "github.com/modern-go/reflect2" packages = ["."] - pruneopts = "" revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" version = "1.0.1" [[projects]] branch = "master" - digest = "1:c24598ffeadd2762552269271b3b1510df2d83ee6696c1e543a0ff653af494bc" name = "github.com/petar/GoLLRB" packages = ["llrb"] - pruneopts = "" revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" [[projects]] - digest = "1:b46305723171710475f2dd37547edd57b67b9de9f2a6267cafdd98331fd6897f" name = "github.com/peterbourgon/diskv" packages = ["."] - pruneopts = "" revision = "5f041e8faa004a95c88a202771f4cc3e991971e6" version = "v2.0.1" [[projects]] - digest = "1:261bc565833ef4f02121450d74eb88d5ae4bd74bfe5d0e862cddb8550ec35000" name = "github.com/spf13/pflag" packages = ["."] - pruneopts = "" revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66" version = "v1.0.0" [[projects]] branch = "master" - digest = "1:79b763a59bc081a752605854f75ac04d4b8fba22bab9bbb11689efd2de255864" name = "golang.org/x/crypto" packages = ["ssh/terminal"] - pruneopts = "" revision = "91a49db82a88618983a78a06c1cbd4e00ab749ab" [[projects]] branch = "master" - digest = "1:4a65e28058fde372f1febbf1bca01ee4aed7472569fd1bc81db9e91bf105f7c8" name = "golang.org/x/net" packages = [ "context", @@ -188,35 +156,29 @@ "idna", "internal/timeseries", "lex/httplex", - "trace", + "trace" ] - pruneopts = "" revision = "22ae77b79946ea320088417e4d50825671d82d57" [[projects]] branch = "master" - digest = "1:b697592485cb412be4188c08ca0beed9aab87f36b86418e21acc4a3998f63734" name = "golang.org/x/oauth2" packages = [ ".", - "internal", + "internal" ] - pruneopts = "" revision = "d2e6202438beef2727060aa7cabdd924d92ebfd9" [[projects]] branch = "master" - digest = "1:0a0c73aced706c77f4f128971976b0ee94db7bdcc95b6088bda9e72594598634" name = "golang.org/x/sys" packages = [ "unix", - "windows", + "windows" ] - pruneopts = "" revision = "dd2ff4accc098aceecb86b36eaa7829b2a17b1c9" [[projects]] - digest = "1:5acd3512b047305d49e8763eef7ba423901e85d5dd2fd1e71778a0ea8de10bd4" name = "golang.org/x/text" packages = [ "collate", @@ -232,22 +194,18 @@ "unicode/bidi", "unicode/cldr", "unicode/norm", - "unicode/rangetable", + "unicode/rangetable" ] - pruneopts = "" revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" version = "v0.3.0" [[projects]] branch = "master" - digest = "1:55a681cb66f28755765fa5fa5104cbd8dc85c55c02d206f9f89566451e3fe1aa" name = "golang.org/x/time" packages = ["rate"] - pruneopts = "" revision = "fbb02b2291d28baffd63558aa44b4b56f178d650" [[projects]] - digest = "1:c1771ca6060335f9768dff6558108bc5ef6c58506821ad43377ee23ff059e472" name = "google.golang.org/appengine" packages = [ "internal", @@ -256,22 +214,18 @@ "internal/log", "internal/remote_api", "internal/urlfetch", - "urlfetch", + "urlfetch" ] - pruneopts = "" revision = "b1f26356af11148e710935ed1ac8a7f5702c7612" version = "v1.1.0" [[projects]] branch = "master" - digest = "1:02b227168a215a14f7f16af45ca649b7c1efc33919ce27a03996dfb54dcf556c" name = "google.golang.org/genproto" packages = ["googleapis/rpc/status"] - pruneopts = "" revision = "2c5e7ac708aaa719366570dd82bda44541ca2a63" [[projects]] - digest = "1:d2dc833c73202298c92b63a7e180e2b007b5a3c3c763e3b9fe1da249b5c7f5b9" name = "google.golang.org/grpc" packages = [ ".", @@ -298,31 +252,25 @@ "stats", "status", "tap", - "transport", + "transport" ] - pruneopts = "" revision = "8e4536a86ab602859c20df5ebfd0bd4228d08655" version = "v1.10.0" [[projects]] - digest = "1:e5d1fb981765b6f7513f793a3fcaac7158408cca77f75f7311ac82cc88e9c445" name = "gopkg.in/inf.v0" packages = ["."] - pruneopts = "" revision = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" version = "v0.9.0" [[projects]] - digest = "1:5fe876313b07628905b2181e537faabe45032cb9c79c01b49b51c25a0a40040d" name = "gopkg.in/yaml.v2" packages = ["."] - pruneopts = "" revision = "7f97868eec74b32b0982dd158a51a446d1da7eb5" version = "v2.1.1" [[projects]] branch = "master" - digest = "1:911f8355f11581ccef1d7a3cc8141bfe209ebf570ffc4574034044933cedce36" name = "k8s.io/api" packages = [ "admissionregistration/v1alpha1", @@ -355,27 +303,11 @@ "settings/v1alpha1", "storage/v1", "storage/v1alpha1", - "storage/v1beta1", + "storage/v1beta1" ] - pruneopts = "" revision = "f456898a08e4bbc5891694118f3819f324de12ff" [[projects]] - branch = "master" - digest = "1:0efe8571c4a62d81627e5055aa435b332132015de77ad6aec5344ed342b75f2c" - name = "k8s.io/apiextensions-apiserver" - packages = [ - "pkg/apis/apiextensions", - "pkg/apis/apiextensions/v1beta1", - "pkg/client/clientset/clientset", - "pkg/client/clientset/clientset/scheme", - "pkg/client/clientset/clientset/typed/apiextensions/v1beta1", - ] - pruneopts = "" - revision = "d65f4428c04f2d28f924a47d1d2177d0cbf45a16" - -[[projects]] - digest = "1:7aa037a4df5432be2820d164f378d7c22335e5cbba124e90e42114757ebd11ac" name = "k8s.io/apimachinery" packages = [ "pkg/api/errors", @@ -413,14 +345,12 @@ "pkg/util/yaml", "pkg/version", "pkg/watch", - "third_party/forked/golang/reflect", + "third_party/forked/golang/reflect" ] - pruneopts = "" revision = "6dd46049f39503a1fc8d65de4bd566829e95faff" version = "kubernetes-1.12.0" [[projects]] - digest = "1:5d4153d12c3aed2c90a94262520d2498d5afa4d692554af55e65a7c5af0bc399" name = "k8s.io/client-go" packages = [ "discovery", @@ -477,59 +407,20 @@ "util/flowcontrol", "util/homedir", "util/integer", - "util/retry", + "util/retry" ] - pruneopts = "" revision = "1638f8970cefaa404ff3a62950f88b08292b2696" version = "kubernetes-1.12.0" [[projects]] - digest = "1:6b29915b728f47c182c1992c15c508e4ac9945c0f3457b1173b813708638e571" - name = "k8s.io/csi-api" - packages = [ - "pkg/apis/csi/v1alpha1", - "pkg/client/clientset/versioned", - "pkg/client/clientset/versioned/scheme", - "pkg/client/clientset/versioned/typed/csi/v1alpha1", - "pkg/crd", - ] - pruneopts = "" - revision = "daa9d551756f72a51f887db9485ec2b2575f47e4" - version = "kubernetes-1.12.0" - -[[projects]] - digest = "1:d9c0b011a765fe7853b7c7fcd3aa2394ca4ff17f3f771e8f647e5fd95321e6ba" name = "k8s.io/kubernetes" packages = ["pkg/kubelet/apis/pluginregistration/v1alpha1"] - pruneopts = "" revision = "be2cfcf9e44b5162a294e977329d6c8194748c4e" version = "v1.11.0-beta.2" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - input-imports = [ - "github.com/container-storage-interface/spec/lib/go/csi", - "github.com/golang/glog", - "github.com/golang/mock/gomock", - "github.com/kubernetes-csi/csi-test/driver", - "golang.org/x/sys/unix", - "google.golang.org/grpc", - "google.golang.org/grpc/codes", - "google.golang.org/grpc/connectivity", - "google.golang.org/grpc/status", - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset", - "k8s.io/apimachinery/pkg/api/errors", - "k8s.io/apimachinery/pkg/apis/meta/v1", - "k8s.io/client-go/kubernetes", - "k8s.io/client-go/kubernetes/typed/core/v1", - "k8s.io/client-go/rest", - "k8s.io/client-go/tools/clientcmd", - "k8s.io/client-go/util/retry", - "k8s.io/csi-api/pkg/apis/csi/v1alpha1", - "k8s.io/csi-api/pkg/client/clientset/versioned", - "k8s.io/csi-api/pkg/crd", - "k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1alpha1", - ] + inputs-digest = "96cf6cb8426f8dd3166acd8b7df5bef5f005162da3f6a5c8b5365b72a415d401" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 2ceaf52a8..ef9a04de7 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -50,3 +50,7 @@ [[override]] name = "github.com/json-iterator/go" version = "1.1.4" + +[[constraint]] + name = "github.com/kubernetes-csi/csi-lib-utils" + version = "0.1.0" diff --git a/pkg/connection/connection.go b/pkg/connection/connection.go index b3472f7fe..2a76acdfb 100644 --- a/pkg/connection/connection.go +++ b/pkg/connection/connection.go @@ -25,6 +25,7 @@ import ( "github.com/container-storage-interface/spec/lib/go/csi" "github.com/golang/glog" + "github.com/kubernetes-csi/csi-lib-utils/protosanitizer" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" @@ -134,9 +135,9 @@ func (c *csiConnection) Close() error { func logGRPC(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { glog.V(5).Infof("GRPC call: %s", method) - glog.V(5).Infof("GRPC request: %+v", req) + glog.V(5).Infof("GRPC request: %s", protosanitizer.StripSecrets(req)) err := invoker(ctx, method, req, reply, cc, opts...) - glog.V(5).Infof("GRPC response: %+v", reply) + glog.V(5).Infof("GRPC response: %s", protosanitizer.StripSecrets(reply)) glog.V(5).Infof("GRPC error: %v", err) return err } diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/CONTRIBUTING.md b/vendor/github.com/kubernetes-csi/csi-lib-utils/CONTRIBUTING.md new file mode 100644 index 000000000..de4711513 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing Guidelines + +Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md). Here is an excerpt: + +_As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._ + +## Getting Started + +We have full documentation on how to get started contributing here: + + + +- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests +- [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing) +- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet.md) - Common resources for existing developers + +## Mentorship + +- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers! + + diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/Gopkg.lock b/vendor/github.com/kubernetes-csi/csi-lib-utils/Gopkg.lock new file mode 100644 index 000000000..8cf7c078e --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/Gopkg.lock @@ -0,0 +1,154 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + digest = "1:94ffc0947c337d618b6ff5ed9abaddc1217b090c1b3a1ae4739b35b7b25851d5" + name = "github.com/container-storage-interface/spec" + packages = ["lib/go/csi"] + pruneopts = "UT" + revision = "ed0bb0e1557548aa028307f48728767cfe8f6345" + version = "v1.0.0" + +[[projects]] + digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" + name = "github.com/davecgh/go-spew" + packages = ["spew"] + pruneopts = "UT" + revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" + version = "v1.1.1" + +[[projects]] + digest = "1:9cab16c200148edbdc9f314f69bf71987085f618ec107385bd6634be21d1aae8" + name = "github.com/golang/protobuf" + packages = [ + "descriptor", + "proto", + "protoc-gen-go/descriptor", + "ptypes", + "ptypes/any", + "ptypes/duration", + "ptypes/timestamp", + "ptypes/wrappers", + ] + pruneopts = "UT" + revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5" + version = "v1.2.0" + +[[projects]] + digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" + name = "github.com/pmezard/go-difflib" + packages = ["difflib"] + pruneopts = "UT" + revision = "792786c7400a136282c1664665ae0a8db921c6c2" + version = "v1.0.0" + +[[projects]] + digest = "1:18752d0b95816a1b777505a97f71c7467a8445b8ffb55631a7bf779f6ba4fa83" + name = "github.com/stretchr/testify" + packages = ["assert"] + pruneopts = "UT" + revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" + version = "v1.2.2" + +[[projects]] + branch = "master" + digest = "1:6ca51c5d8a610b3da56856df7a8f8f3e075eba8d5f7a4acbadd79b2d2a368054" + name = "golang.org/x/net" + packages = [ + "context", + "http/httpguts", + "http2", + "http2/hpack", + "idna", + "internal/timeseries", + "trace", + ] + pruneopts = "UT" + revision = "fae4c4e3ad76c295c3d6d259f898136b4bf833a8" + +[[projects]] + branch = "master" + digest = "1:8775d8a768d9e65e8b659172804aac5db1fc8d563ba766470a6c2698c57c61a7" + name = "golang.org/x/sys" + packages = ["unix"] + pruneopts = "UT" + revision = "4ed8d59d0b35e1e29334a206d1b3f38b1e5dfb31" + +[[projects]] + digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18" + name = "golang.org/x/text" + packages = [ + "collate", + "collate/build", + "internal/colltab", + "internal/gen", + "internal/tag", + "internal/triegen", + "internal/ucd", + "language", + "secure/bidirule", + "transform", + "unicode/bidi", + "unicode/cldr", + "unicode/norm", + "unicode/rangetable", + ] + pruneopts = "UT" + revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" + version = "v0.3.0" + +[[projects]] + branch = "master" + digest = "1:56b0bca90b7e5d1facf5fbdacba23e4e0ce069d25381b8e2f70ef1e7ebfb9c1a" + name = "google.golang.org/genproto" + packages = ["googleapis/rpc/status"] + pruneopts = "UT" + revision = "31ac5d88444a9e7ad18077db9a165d793ad06a2e" + +[[projects]] + digest = "1:c3ad9841823db6da420a5625b367913b4ff54bbe60e8e3c98bd20e243e62e2d2" + name = "google.golang.org/grpc" + packages = [ + ".", + "balancer", + "balancer/base", + "balancer/roundrobin", + "codes", + "connectivity", + "credentials", + "encoding", + "encoding/proto", + "grpclog", + "internal", + "internal/backoff", + "internal/channelz", + "internal/envconfig", + "internal/grpcrand", + "internal/transport", + "keepalive", + "metadata", + "naming", + "peer", + "resolver", + "resolver/dns", + "resolver/passthrough", + "stats", + "status", + "tap", + ] + pruneopts = "UT" + revision = "2e463a05d100327ca47ac218281906921038fd95" + version = "v1.16.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + input-imports = [ + "github.com/container-storage-interface/spec/lib/go/csi", + "github.com/golang/protobuf/descriptor", + "github.com/golang/protobuf/proto", + "github.com/golang/protobuf/protoc-gen-go/descriptor", + "github.com/stretchr/testify/assert", + ] + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/Gopkg.toml b/vendor/github.com/kubernetes-csi/csi-lib-utils/Gopkg.toml new file mode 100644 index 000000000..2922e60b6 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/Gopkg.toml @@ -0,0 +1,6 @@ +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html +# for detailed Gopkg.toml documentation. + +[prune] + go-tests = true + unused-packages = true diff --git a/vendor/k8s.io/csi-api/LICENSE b/vendor/github.com/kubernetes-csi/csi-lib-utils/LICENSE similarity index 100% rename from vendor/k8s.io/csi-api/LICENSE rename to vendor/github.com/kubernetes-csi/csi-lib-utils/LICENSE diff --git a/vendor/k8s.io/apiextensions-apiserver/artifacts/simple-image/Dockerfile b/vendor/github.com/kubernetes-csi/csi-lib-utils/Makefile similarity index 50% rename from vendor/k8s.io/apiextensions-apiserver/artifacts/simple-image/Dockerfile rename to vendor/github.com/kubernetes-csi/csi-lib-utils/Makefile index c41affec9..8bfef97e8 100644 --- a/vendor/k8s.io/apiextensions-apiserver/artifacts/simple-image/Dockerfile +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/Makefile @@ -1,4 +1,4 @@ -# Copyright 2017 The Kubernetes Authors. +# Copyright 2018 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. @@ -12,6 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM fedora -ADD apiextensions-apiserver / -ENTRYPOINT ["/apiextensions-apiserver"] +.PHONY: all clean test + +ifdef V +TESTARGS = -v +else +TESTARGS = +endif + +all: + go build `go list ./... | grep -v 'vendor'` + +clean: + true + +test: + go test `go list ./... | grep -v ^vendor` $(TESTARGS) + go vet `go list ./... | grep -v ^vendor` + diff="$$(gofmt -d $$(find . -name '*.go' | grep -v ^./vendor))" && \ + ( [ -z "$$diff" ] || ( \ + echo "\nvvvvvv formatting errors, fix with patch -p1 vvvvvvvvvv\n$$diff\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"; \ + false ) ) diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/OWNERS b/vendor/github.com/kubernetes-csi/csi-lib-utils/OWNERS new file mode 100644 index 000000000..2a442eb60 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/OWNERS @@ -0,0 +1,4 @@ +# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md + +approvers: + - saad-ali diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/README.md b/vendor/github.com/kubernetes-csi/csi-lib-utils/README.md new file mode 100644 index 000000000..86b84d335 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/README.md @@ -0,0 +1,19 @@ +# csi-lib-utils + +TBD + +## Community, discussion, contribution, and support + +Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/). + +You can reach the maintainers of this project at: + +- [Slack](http://slack.k8s.io/) +- [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-dev) + +### Code of conduct + +Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md). + +[owners]: https://git.k8s.io/community/contributors/guide/owners.md +[Creative Commons 4.0]: https://git.k8s.io/website/LICENSE diff --git a/vendor/k8s.io/csi-api/SECURITY_CONTACTS b/vendor/github.com/kubernetes-csi/csi-lib-utils/SECURITY_CONTACTS similarity index 98% rename from vendor/k8s.io/csi-api/SECURITY_CONTACTS rename to vendor/github.com/kubernetes-csi/csi-lib-utils/SECURITY_CONTACTS index b51da450f..585f480fe 100644 --- a/vendor/k8s.io/csi-api/SECURITY_CONTACTS +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/SECURITY_CONTACTS @@ -10,4 +10,4 @@ # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE # INSTRUCTIONS AT https://kubernetes.io/security/ -saadali \ No newline at end of file +saad-ali diff --git a/vendor/k8s.io/apiextensions-apiserver/code-of-conduct.md b/vendor/github.com/kubernetes-csi/csi-lib-utils/code-of-conduct.md similarity index 100% rename from vendor/k8s.io/apiextensions-apiserver/code-of-conduct.md rename to vendor/github.com/kubernetes-csi/csi-lib-utils/code-of-conduct.md diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer.go b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer.go new file mode 100644 index 000000000..d75e0e212 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer.go @@ -0,0 +1,138 @@ +/* +Copyright 2018 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 protosanitizer supports logging of gRPC messages without +// accidentally revealing sensitive fields. +package protosanitizer + +import ( + "encoding/json" + "fmt" + "reflect" + "strings" + + "github.com/container-storage-interface/spec/lib/go/csi" + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor" +) + +// StripSecrets returns a wrapper around the original CSI gRPC message +// which has a Stringer implementation that serializes the message +// as one-line JSON, but without including secret information. +// Instead of the secret value(s), the string "***stripped***" is +// included in the result. +// +// StripSecrets itself is fast and therefore it is cheap to pass the +// result to logging functions which may or may not end up serializing +// the parameter depending on the current log level. +func StripSecrets(msg interface{}) fmt.Stringer { + return &stripSecrets{msg} +} + +type stripSecrets struct { + msg interface{} +} + +func (s *stripSecrets) String() string { + // First convert to a generic representation. That's less efficient + // than using reflect directly, but easier to work with. + var parsed interface{} + b, err := json.Marshal(s.msg) + if err != nil { + return fmt.Sprintf("<>", s.msg, err) + } + if err := json.Unmarshal(b, &parsed); err != nil { + return fmt.Sprintf("<>", s.msg, err) + } + + // Now remove secrets from the generic representation of the message. + strip(parsed, s.msg) + + // Re-encoded the stripped representation and return that. + b, err = json.Marshal(parsed) + if err != nil { + return fmt.Sprintf("<>", s.msg, err) + } + return string(b) +} + +func strip(parsed interface{}, msg interface{}) { + protobufMsg, ok := msg.(descriptor.Message) + if !ok { + // Not a protobuf message, so we are done. + return + } + + // The corresponding map in the parsed JSON representation. + parsedFields, ok := parsed.(map[string]interface{}) + if !ok { + // Probably nil. + return + } + + // Walk through all fields and replace those with ***stripped*** that + // are marked as secret. This relies on protobuf adding "json:" tags + // on each field where the name matches the field name in the protobuf + // spec (like volume_capabilities). The field.GetJsonName() method returns + // a different name (volumeCapabilities) which we don't use. + _, md := descriptor.ForMessage(protobufMsg) + fields := md.GetField() + if fields != nil { + for _, field := range fields { + ex, err := proto.GetExtension(field.Options, csi.E_CsiSecret) + if err == nil && ex != nil && *ex.(*bool) { + // Overwrite only if already set. + if _, ok := parsedFields[field.GetName()]; ok { + parsedFields[field.GetName()] = "***stripped***" + } + } else if field.GetType() == protobuf.FieldDescriptorProto_TYPE_MESSAGE { + // When we get here, + // the type name is something like ".csi.v1.CapacityRange" (leading dot!) + // and looking up "csi.v1.CapacityRange" + // returns the type of a pointer to a pointer + // to CapacityRange. We need a pointer to such + // a value for recursive stripping. + typeName := field.GetTypeName() + if strings.HasPrefix(typeName, ".") { + typeName = typeName[1:] + } + t := proto.MessageType(typeName) + if t == nil || t.Kind() != reflect.Ptr { + // Shouldn't happen, but + // better check anyway instead + // of panicking. + continue + } + v := reflect.New(t.Elem()) + + // Recursively strip the message(s) that + // the field contains. + i := v.Interface() + entry := parsedFields[field.GetName()] + if slice, ok := entry.([]interface{}); ok { + // Array of values, like VolumeCapabilities in CreateVolumeRequest. + for _, entry := range slice { + strip(entry, i) + } + } else { + // Single value. + strip(entry, i) + } + } + } + } +} diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer_test.go b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer_test.go new file mode 100644 index 000000000..d869524ac --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer_test.go @@ -0,0 +1,160 @@ +/* +Copyright 2018 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 protosanitizer + +import ( + "fmt" + "testing" + + "github.com/container-storage-interface/spec/lib/go/csi" + "github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest" + "github.com/stretchr/testify/assert" +) + +func TestStripSecrets(t *testing.T) { + secretName := "secret-abc" + secretValue := "123" + createVolume := &csi.CreateVolumeRequest{ + AccessibilityRequirements: &csi.TopologyRequirement{ + Requisite: []*csi.Topology{ + &csi.Topology{ + Segments: map[string]string{ + "foo": "bar", + "x": "y", + }, + }, + &csi.Topology{ + Segments: map[string]string{ + "a": "b", + }, + }, + }, + }, + Name: "foo", + VolumeCapabilities: []*csi.VolumeCapability{ + &csi.VolumeCapability{ + AccessType: &csi.VolumeCapability_Mount{ + Mount: &csi.VolumeCapability_MountVolume{ + FsType: "ext4", + }, + }, + }, + }, + CapacityRange: &csi.CapacityRange{ + RequiredBytes: 1024, + }, + Secrets: map[string]string{ + secretName: secretValue, + "secret-xyz": "987", + }, + } + + cases := []struct { + original, stripped interface{} + }{ + {nil, "null"}, + {1, "1"}, + {"hello world", `"hello world"`}, + {true, "true"}, + {false, "false"}, + {&csi.CreateVolumeRequest{}, `{}`}, + // Test case from https://github.com/kubernetes-csi/csi-lib-utils/pull/1#pullrequestreview-180126394. + {&csi.CreateVolumeRequest{ + Name: "test-volume", + CapacityRange: &csi.CapacityRange{ + RequiredBytes: int64(1024), + LimitBytes: int64(1024), + }, + VolumeCapabilities: []*csi.VolumeCapability{ + &csi.VolumeCapability{ + AccessType: &csi.VolumeCapability_Mount{ + Mount: &csi.VolumeCapability_MountVolume{ + FsType: "ext4", + MountFlags: []string{"flag1", "flag2", "flag3"}, + }, + }, + AccessMode: &csi.VolumeCapability_AccessMode{ + Mode: csi.VolumeCapability_AccessMode_MULTI_NODE_MULTI_WRITER, + }, + }, + }, + Secrets: map[string]string{"secret1": "secret1", "secret2": "secret2"}, + Parameters: map[string]string{"param1": "param1", "param2": "param2"}, + VolumeContentSource: &csi.VolumeContentSource{}, + AccessibilityRequirements: &csi.TopologyRequirement{}, + }, `{"accessibility_requirements":{},"capacity_range":{"limit_bytes":1024,"required_bytes":1024},"name":"test-volume","parameters":{"param1":"param1","param2":"param2"},"secrets":"***stripped***","volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4","mount_flags":["flag1","flag2","flag3"]}},"access_mode":{"mode":5}}],"volume_content_source":{"Type":null}}`}, + {createVolume, `{"accessibility_requirements":{"requisite":[{"segments":{"foo":"bar","x":"y"}},{"segments":{"a":"b"}}]},"capacity_range":{"required_bytes":1024},"name":"foo","secrets":"***stripped***","volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4"}}}]}`}, + {&csitest.CreateVolumeRequest{}, `{}`}, + {&csitest.CreateVolumeRequest{ + CapacityRange: &csitest.CapacityRange{ + RequiredBytes: 1024, + }, + MaybeSecretMap: map[int64]*csitest.VolumeCapability{ + 1: &csitest.VolumeCapability{ArraySecret: "aaa"}, + 2: &csitest.VolumeCapability{ArraySecret: "bbb"}, + }, + Name: "foo", + NewSecretInt: 42, + Seecreets: map[string]string{ + secretName: secretValue, + "secret-xyz": "987", + }, + VolumeCapabilities: []*csitest.VolumeCapability{ + &csitest.VolumeCapability{ + AccessType: &csitest.VolumeCapability_Mount{ + Mount: &csitest.VolumeCapability_MountVolume{ + FsType: "ext4", + }, + }, + ArraySecret: "knock knock", + }, + &csitest.VolumeCapability{ + ArraySecret: "Who's there?", + }, + }, + VolumeContentSource: &csitest.VolumeContentSource{ + Type: &csitest.VolumeContentSource_Volume{ + Volume: &csitest.VolumeContentSource_VolumeSource{ + VolumeId: "abc", + OneofSecretField: "hello", + }, + }, + NestedSecretField: "world", + }, + }, + // Secrets are *not* removed from all fields yet. This will have to be fixed one way or another + // before the CSI spec can start using secrets there (currently it doesn't). + // The test is still useful because it shows that also complicated fields get serialized. + // `{"capacity_range":{"required_bytes":1024},"maybe_secret_map":{"1":{"AccessType":null,"array_secret":"***stripped***"},"2":{"AccessType":null,"array_secret":"***stripped***"}},"name":"foo","new_secret_int":"***stripped***","seecreets":"***stripped***","volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4"}},"array_secret":"***stripped***"},{"AccessType":null,"array_secret":"***stripped***"}],"volume_content_source":{"Type":{"Volume":{"oneof_secret_field":"***stripped***","volume_id":"abc"}},"nested_secret_field":"***stripped***"}}`, + `{"capacity_range":{"required_bytes":1024},"maybe_secret_map":{"1":{"AccessType":null,"array_secret":"aaa"},"2":{"AccessType":null,"array_secret":"bbb"}},"name":"foo","new_secret_int":"***stripped***","seecreets":"***stripped***","volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4"}},"array_secret":"***stripped***"},{"AccessType":null,"array_secret":"***stripped***"}],"volume_content_source":{"Type":{"Volume":{"oneof_secret_field":"hello","volume_id":"abc"}},"nested_secret_field":"***stripped***"}}`, + }, + } + + for _, c := range cases { + before := fmt.Sprint(c.original) + stripped := StripSecrets(c.original) + if assert.Equal(t, c.stripped, fmt.Sprintf("%s", stripped), "unexpected result for fmt s of %s", c.original) { + assert.Equal(t, c.stripped, fmt.Sprintf("%v", stripped), "unexpected result for fmt v of %s", c.original) + } + assert.Equal(t, before, fmt.Sprint(c.original), "original value modified") + } + + // The secret is hidden because StripSecrets is a struct referencing it. + dump := fmt.Sprintf("%#v", StripSecrets(createVolume)) + assert.NotContains(t, dump, secretName) + assert.NotContains(t, dump, secretValue) +} diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/.gitignore b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/.gitignore new file mode 100644 index 000000000..77d72bc23 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/.gitignore @@ -0,0 +1,5 @@ +/protoc +/protoc-gen-go +/csi.a +/.protoc +.build diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/Makefile b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/Makefile new file mode 100644 index 000000000..a2a87fede --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/Makefile @@ -0,0 +1,136 @@ +all: build + +######################################################################## +## GOLANG ## +######################################################################## + +# If GOPATH isn't defined then set its default location. +ifeq (,$(strip $(GOPATH))) +GOPATH := $(HOME)/go +else +# If GOPATH is already set then update GOPATH to be its own +# first element. +GOPATH := $(word 1,$(subst :, ,$(GOPATH))) +endif +export GOPATH + + +######################################################################## +## PROTOC ## +######################################################################## + +# Only set PROTOC_VER if it has an empty value. +ifeq (,$(strip $(PROTOC_VER))) +PROTOC_VER := 3.5.1 +endif + +PROTOC_OS := $(shell uname -s) +ifeq (Darwin,$(PROTOC_OS)) +PROTOC_OS := osx +endif + +PROTOC_ARCH := $(shell uname -m) +ifeq (i386,$(PROTOC_ARCH)) +PROTOC_ARCH := x86_32 +endif + +PROTOC := ./protoc +PROTOC_ZIP := protoc-$(PROTOC_VER)-$(PROTOC_OS)-$(PROTOC_ARCH).zip +PROTOC_URL := https://github.com/google/protobuf/releases/download/v$(PROTOC_VER)/$(PROTOC_ZIP) +PROTOC_TMP_DIR := .protoc +PROTOC_TMP_BIN := $(PROTOC_TMP_DIR)/bin/protoc + +$(PROTOC): + -mkdir -p "$(PROTOC_TMP_DIR)" && \ + curl -L $(PROTOC_URL) -o "$(PROTOC_TMP_DIR)/$(PROTOC_ZIP)" && \ + unzip "$(PROTOC_TMP_DIR)/$(PROTOC_ZIP)" -d "$(PROTOC_TMP_DIR)" && \ + chmod 0755 "$(PROTOC_TMP_BIN)" && \ + cp -f "$(PROTOC_TMP_BIN)" "$@" + stat "$@" > /dev/null 2>&1 + + +######################################################################## +## PROTOC-GEN-GO ## +######################################################################## + +# This is the recipe for getting and installing the go plug-in +# for protoc +PROTOC_GEN_GO_PKG := github.com/golang/protobuf/protoc-gen-go +PROTOC_GEN_GO := protoc-gen-go +$(PROTOC_GEN_GO): PROTOBUF_PKG := $(dir $(PROTOC_GEN_GO_PKG)) +$(PROTOC_GEN_GO): PROTOBUF_VERSION := v1.2.0 +$(PROTOC_GEN_GO): + mkdir -p $(dir $(GOPATH)/src/$(PROTOBUF_PKG)) + test -d $(GOPATH)/src/$(PROTOBUF_PKG)/.git || git clone https://$(PROTOBUF_PKG) $(GOPATH)/src/$(PROTOBUF_PKG) + (cd $(GOPATH)/src/$(PROTOBUF_PKG) && \ + (test "$$(git describe --tags | head -1)" = "$(PROTOBUF_VERSION)" || \ + (git fetch && git checkout tags/$(PROTOBUF_VERSION)))) + (cd $(GOPATH)/src/$(PROTOBUF_PKG) && go get -v -d $$(go list -f '{{ .ImportPath }}' ./...)) && \ + go build -o "$@" $(PROTOC_GEN_GO_PKG) + + +######################################################################## +## PATH ## +######################################################################## + +# Update PATH with the current directory. This enables the protoc +# binary to discover the protoc-gen-go binary, built inside this +# directory. +export PATH := $(shell pwd):$(PATH) + + +######################################################################## +## BUILD ## +######################################################################## +CSI_PROTO := ./csitest.proto +CSI_PKG_ROOT := github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test +CSI_PKG_SUB := $(shell cat $(CSI_PROTO) | sed -n -e 's/^package.\([^;]*\).v[0-9]\+;$$/\1/p'|tr '.' '/') +CSI_BUILD := $(CSI_PKG_SUB)/.build +CSI_GO := $(CSI_PKG_SUB)/csitest.pb.go +CSI_A := csi.a +CSI_GO_TMP := $(CSI_BUILD)/$(CSI_PKG_ROOT)/csitest.pb.go + +# This recipe generates the go language bindings to a temp area. +$(CSI_GO_TMP): HERE := $(shell pwd) +$(CSI_GO_TMP): PTYPES_PKG := github.com/golang/protobuf/ptypes +$(CSI_GO_TMP): GO_OUT := plugins=grpc +$(CSI_GO_TMP): GO_OUT := $(GO_OUT),Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor +$(CSI_GO_TMP): GO_OUT := $(GO_OUT),Mgoogle/protobuf/wrappers.proto=$(PTYPES_PKG)/wrappers +$(CSI_GO_TMP): GO_OUT := $(GO_OUT):"$(HERE)/$(CSI_BUILD)" +$(CSI_GO_TMP): INCLUDE := -I$(GOPATH)/src -I$(HERE)/$(PROTOC_TMP_DIR)/include +$(CSI_GO_TMP): $(CSI_PROTO) | $(PROTOC) $(PROTOC_GEN_GO) + @mkdir -p "$(@D)" + (cd "$(GOPATH)/src" && \ + $(HERE)/$(PROTOC) $(INCLUDE) --go_out=$(GO_OUT) "$(CSI_PKG_ROOT)/$( /dev/null 2>&1 || cp -f "$?" "$@" +endif + +# This recipe builds the Go archive from the sources in three steps: +# +# 1. Go get any missing dependencies. +# 2. Cache the packages. +# 3. Build the archive file. +$(CSI_A): $(CSI_GO) + go get -v -d ./... + go install ./$(CSI_PKG_SUB) + go build -o "$@" ./$(CSI_PKG_SUB) + +build: $(CSI_A) + +clean: + go clean -i ./... + rm -rf "$(CSI_A)" "$(CSI_GO)" "$(CSI_BUILD)" + +clobber: clean + rm -fr "$(PROTOC)" "$(PROTOC_GEN_GO)" "$(CSI_PKG_SUB)" "$(PROTOC_TMP_DIR)" + +.PHONY: clean clobber diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/README.md b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/README.md new file mode 100644 index 000000000..259214e1c --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/README.md @@ -0,0 +1,2 @@ +This is a *modified* version of the CSI 1.0.0 spec. It's only purpose is +to test the stripping of secret fields. diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csi.proto b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csi.proto new file mode 100644 index 000000000..5a6dddbc6 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csi.proto @@ -0,0 +1,1203 @@ +// Code generated by make; DO NOT EDIT. +syntax = "proto3"; +package csi.v1; + +import "google/protobuf/descriptor.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "csi"; + +extend google.protobuf.FieldOptions { + // Indicates that a field MAY contain information that is sensitive + // and MUST be treated as such (e.g. not logged). + bool csi_secret = 1059; +} +service Identity { + rpc GetPluginInfo(GetPluginInfoRequest) + returns (GetPluginInfoResponse) {} + + rpc GetPluginCapabilities(GetPluginCapabilitiesRequest) + returns (GetPluginCapabilitiesResponse) {} + + rpc Probe (ProbeRequest) + returns (ProbeResponse) {} +} + +service Controller { + rpc CreateVolume (CreateVolumeRequest) + returns (CreateVolumeResponse) {} + + rpc DeleteVolume (DeleteVolumeRequest) + returns (DeleteVolumeResponse) {} + + rpc ControllerPublishVolume (ControllerPublishVolumeRequest) + returns (ControllerPublishVolumeResponse) {} + + rpc ControllerUnpublishVolume (ControllerUnpublishVolumeRequest) + returns (ControllerUnpublishVolumeResponse) {} + + rpc ValidateVolumeCapabilities (ValidateVolumeCapabilitiesRequest) + returns (ValidateVolumeCapabilitiesResponse) {} + + rpc ListVolumes (ListVolumesRequest) + returns (ListVolumesResponse) {} + + rpc GetCapacity (GetCapacityRequest) + returns (GetCapacityResponse) {} + + rpc ControllerGetCapabilities (ControllerGetCapabilitiesRequest) + returns (ControllerGetCapabilitiesResponse) {} + + rpc CreateSnapshot (CreateSnapshotRequest) + returns (CreateSnapshotResponse) {} + + rpc DeleteSnapshot (DeleteSnapshotRequest) + returns (DeleteSnapshotResponse) {} + + rpc ListSnapshots (ListSnapshotsRequest) + returns (ListSnapshotsResponse) {} +} + +service Node { + rpc NodeStageVolume (NodeStageVolumeRequest) + returns (NodeStageVolumeResponse) {} + + rpc NodeUnstageVolume (NodeUnstageVolumeRequest) + returns (NodeUnstageVolumeResponse) {} + + rpc NodePublishVolume (NodePublishVolumeRequest) + returns (NodePublishVolumeResponse) {} + + rpc NodeUnpublishVolume (NodeUnpublishVolumeRequest) + returns (NodeUnpublishVolumeResponse) {} + + rpc NodeGetVolumeStats (NodeGetVolumeStatsRequest) + returns (NodeGetVolumeStatsResponse) {} + + rpc NodeGetCapabilities (NodeGetCapabilitiesRequest) + returns (NodeGetCapabilitiesResponse) {} + + rpc NodeGetInfo (NodeGetInfoRequest) + returns (NodeGetInfoResponse) {} +} +message GetPluginInfoRequest { + // Intentionally empty. +} + +message GetPluginInfoResponse { + // The name MUST follow domain name notation format + // (https://tools.ietf.org/html/rfc1035#section-2.3.1). It SHOULD + // include the plugin's host company name and the plugin name, + // to minimize the possibility of collisions. It MUST be 63 + // characters or less, beginning and ending with an alphanumeric + // character ([a-z0-9A-Z]) with dashes (-), dots (.), and + // alphanumerics between. This field is REQUIRED. + string name = 1; + + // This field is REQUIRED. Value of this field is opaque to the CO. + string vendor_version = 2; + + // This field is OPTIONAL. Values are opaque to the CO. + map manifest = 3; +} +message GetPluginCapabilitiesRequest { + // Intentionally empty. +} + +message GetPluginCapabilitiesResponse { + // All the capabilities that the controller service supports. This + // field is OPTIONAL. + repeated PluginCapability capabilities = 1; +} + +// Specifies a capability of the plugin. +message PluginCapability { + message Service { + enum Type { + UNKNOWN = 0; + + // CONTROLLER_SERVICE indicates that the Plugin provides RPCs for + // the ControllerService. Plugins SHOULD provide this capability. + // In rare cases certain plugins MAY wish to omit the + // ControllerService entirely from their implementation, but such + // SHOULD NOT be the common case. + // The presence of this capability determines whether the CO will + // attempt to invoke the REQUIRED ControllerService RPCs, as well + // as specific RPCs as indicated by ControllerGetCapabilities. + CONTROLLER_SERVICE = 1; + + // VOLUME_ACCESSIBILITY_CONSTRAINTS indicates that the volumes for + // this plugin MAY NOT be equally accessible by all nodes in the + // cluster. The CO MUST use the topology information returned by + // CreateVolumeRequest along with the topology information + // returned by NodeGetInfo to ensure that a given volume is + // accessible from a given node when scheduling workloads. + VOLUME_ACCESSIBILITY_CONSTRAINTS = 2; + } + Type type = 1; + } + + oneof type { + // Service that the plugin supports. + Service service = 1; + } +} +message ProbeRequest { + // Intentionally empty. +} + +message ProbeResponse { + // Readiness allows a plugin to report its initialization status back + // to the CO. Initialization for some plugins MAY be time consuming + // and it is important for a CO to distinguish between the following + // cases: + // + // 1) The plugin is in an unhealthy state and MAY need restarting. In + // this case a gRPC error code SHALL be returned. + // 2) The plugin is still initializing, but is otherwise perfectly + // healthy. In this case a successful response SHALL be returned + // with a readiness value of `false`. Calls to the plugin's + // Controller and/or Node services MAY fail due to an incomplete + // initialization state. + // 3) The plugin has finished initializing and is ready to service + // calls to its Controller and/or Node services. A successful + // response is returned with a readiness value of `true`. + // + // This field is OPTIONAL. If not present, the caller SHALL assume + // that the plugin is in a ready state and is accepting calls to its + // Controller and/or Node services (according to the plugin's reported + // capabilities). + .google.protobuf.BoolValue ready = 1; +} +message CreateVolumeRequest { + // The suggested name for the storage space. This field is REQUIRED. + // It serves two purposes: + // 1) Idempotency - This name is generated by the CO to achieve + // idempotency. The Plugin SHOULD ensure that multiple + // `CreateVolume` calls for the same name do not result in more + // than one piece of storage provisioned corresponding to that + // name. If a Plugin is unable to enforce idempotency, the CO's + // error recovery logic could result in multiple (unused) volumes + // being provisioned. + // In the case of error, the CO MUST handle the gRPC error codes + // per the recovery behavior defined in the "CreateVolume Errors" + // section below. + // The CO is responsible for cleaning up volumes it provisioned + // that it no longer needs. If the CO is uncertain whether a volume + // was provisioned or not when a `CreateVolume` call fails, the CO + // MAY call `CreateVolume` again, with the same name, to ensure the + // volume exists and to retrieve the volume's `volume_id` (unless + // otherwise prohibited by "CreateVolume Errors"). + // 2) Suggested name - Some storage systems allow callers to specify + // an identifier by which to refer to the newly provisioned + // storage. If a storage system supports this, it can optionally + // use this name as the identifier for the new volume. + // Any Unicode string that conforms to the length limit is allowed + // except those containing the following banned characters: + // U+0000-U+0008, U+000B, U+000C, U+000E-U+001F, U+007F-U+009F. + // (These are control characters other than commonly used whitespace.) + string name = 1; + + // This field is OPTIONAL. This allows the CO to specify the capacity + // requirement of the volume to be provisioned. If not specified, the + // Plugin MAY choose an implementation-defined capacity range. If + // specified it MUST always be honored, even when creating volumes + // from a source; which MAY force some backends to internally extend + // the volume after creating it. + CapacityRange capacity_range = 2; + + // The capabilities that the provisioned volume MUST have. SP MUST + // provision a volume that will satisfy ALL of the capabilities + // specified in this list. Otherwise SP MUST return the appropriate + // gRPC error code. + // The Plugin MUST assume that the CO MAY use the provisioned volume + // with ANY of the capabilities specified in this list. + // For example, a CO MAY specify two volume capabilities: one with + // access mode SINGLE_NODE_WRITER and another with access mode + // MULTI_NODE_READER_ONLY. In this case, the SP MUST verify that the + // provisioned volume can be used in either mode. + // This also enables the CO to do early validation: If ANY of the + // specified volume capabilities are not supported by the SP, the call + // MUST return the appropriate gRPC error code. + // This field is REQUIRED. + repeated VolumeCapability volume_capabilities = 3; + + // Plugin specific parameters passed in as opaque key-value pairs. + // This field is OPTIONAL. The Plugin is responsible for parsing and + // validating these parameters. COs will treat these as opaque. + map parameters = 4; + + // Secrets required by plugin to complete volume creation request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 5 [(csi_secret) = true]; + + // If specified, the new volume will be pre-populated with data from + // this source. This field is OPTIONAL. + VolumeContentSource volume_content_source = 6; + + // Specifies where (regions, zones, racks, etc.) the provisioned + // volume MUST be accessible from. + // An SP SHALL advertise the requirements for topological + // accessibility information in documentation. COs SHALL only specify + // topological accessibility information supported by the SP. + // This field is OPTIONAL. + // This field SHALL NOT be specified unless the SP has the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability. + // If this field is not specified and the SP has the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability, the SP MAY + // choose where the provisioned volume is accessible from. + TopologyRequirement accessibility_requirements = 7; +} + +// Specifies what source the volume will be created from. One of the +// type fields MUST be specified. +message VolumeContentSource { + message SnapshotSource { + // Contains identity information for the existing source snapshot. + // This field is REQUIRED. Plugin is REQUIRED to support creating + // volume from snapshot if it supports the capability + // CREATE_DELETE_SNAPSHOT. + string snapshot_id = 1; + } + + message VolumeSource { + // Contains identity information for the existing source volume. + // This field is REQUIRED. Plugins reporting CLONE_VOLUME + // capability MUST support creating a volume from another volume. + string volume_id = 1; + } + + oneof type { + SnapshotSource snapshot = 1; + VolumeSource volume = 2; + } +} + +message CreateVolumeResponse { + // Contains all attributes of the newly created volume that are + // relevant to the CO along with information required by the Plugin + // to uniquely identify the volume. This field is REQUIRED. + Volume volume = 1; +} + +// Specify a capability of a volume. +message VolumeCapability { + // Indicate that the volume will be accessed via the block device API. + message BlockVolume { + // Intentionally empty, for now. + } + + // Indicate that the volume will be accessed via the filesystem API. + message MountVolume { + // The filesystem type. This field is OPTIONAL. + // An empty string is equal to an unspecified field value. + string fs_type = 1; + + // The mount options that can be used for the volume. This field is + // OPTIONAL. `mount_flags` MAY contain sensitive information. + // Therefore, the CO and the Plugin MUST NOT leak this information + // to untrusted entities. The total size of this repeated field + // SHALL NOT exceed 4 KiB. + repeated string mount_flags = 2; + } + + // Specify how a volume can be accessed. + message AccessMode { + enum Mode { + UNKNOWN = 0; + + // Can only be published once as read/write on a single node, at + // any given time. + SINGLE_NODE_WRITER = 1; + + // Can only be published once as readonly on a single node, at + // any given time. + SINGLE_NODE_READER_ONLY = 2; + + // Can be published as readonly at multiple nodes simultaneously. + MULTI_NODE_READER_ONLY = 3; + + // Can be published at multiple nodes simultaneously. Only one of + // the node can be used as read/write. The rest will be readonly. + MULTI_NODE_SINGLE_WRITER = 4; + + // Can be published as read/write at multiple nodes + // simultaneously. + MULTI_NODE_MULTI_WRITER = 5; + } + + // This field is REQUIRED. + Mode mode = 1; + } + + // Specifies what API the volume will be accessed using. One of the + // following fields MUST be specified. + oneof access_type { + BlockVolume block = 1; + MountVolume mount = 2; + } + + // This is a REQUIRED field. + AccessMode access_mode = 3; +} + +// The capacity of the storage space in bytes. To specify an exact size, +// `required_bytes` and `limit_bytes` SHALL be set to the same value. At +// least one of the these fields MUST be specified. +message CapacityRange { + // Volume MUST be at least this big. This field is OPTIONAL. + // A value of 0 is equal to an unspecified field value. + // The value of this field MUST NOT be negative. + int64 required_bytes = 1; + + // Volume MUST not be bigger than this. This field is OPTIONAL. + // A value of 0 is equal to an unspecified field value. + // The value of this field MUST NOT be negative. + int64 limit_bytes = 2; +} + +// Information about a specific volume. +message Volume { + // The capacity of the volume in bytes. This field is OPTIONAL. If not + // set (value of 0), it indicates that the capacity of the volume is + // unknown (e.g., NFS share). + // The value of this field MUST NOT be negative. + int64 capacity_bytes = 1; + + // The identifier for this volume, generated by the plugin. + // This field is REQUIRED. + // This field MUST contain enough information to uniquely identify + // this specific volume vs all other volumes supported by this plugin. + // This field SHALL be used by the CO in subsequent calls to refer to + // this volume. + // The SP is NOT responsible for global uniqueness of volume_id across + // multiple SPs. + string volume_id = 2; + + // Opaque static properties of the volume. SP MAY use this field to + // ensure subsequent volume validation and publishing calls have + // contextual information. + // The contents of this field SHALL be opaque to a CO. + // The contents of this field SHALL NOT be mutable. + // The contents of this field SHALL be safe for the CO to cache. + // The contents of this field SHOULD NOT contain sensitive + // information. + // The contents of this field SHOULD NOT be used for uniquely + // identifying a volume. The `volume_id` alone SHOULD be sufficient to + // identify the volume. + // A volume uniquely identified by `volume_id` SHALL always report the + // same volume_context. + // This field is OPTIONAL and when present MUST be passed to volume + // validation and publishing calls. + map volume_context = 3; + + // If specified, indicates that the volume is not empty and is + // pre-populated with data from the specified source. + // This field is OPTIONAL. + VolumeContentSource content_source = 4; + + // Specifies where (regions, zones, racks, etc.) the provisioned + // volume is accessible from. + // A plugin that returns this field MUST also set the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability. + // An SP MAY specify multiple topologies to indicate the volume is + // accessible from multiple locations. + // COs MAY use this information along with the topology information + // returned by NodeGetInfo to ensure that a given volume is accessible + // from a given node when scheduling workloads. + // This field is OPTIONAL. If it is not specified, the CO MAY assume + // the volume is equally accessible from all nodes in the cluster and + // MAY schedule workloads referencing the volume on any available + // node. + // + // Example 1: + // accessible_topology = {"region": "R1", "zone": "Z2"} + // Indicates a volume accessible only from the "region" "R1" and the + // "zone" "Z2". + // + // Example 2: + // accessible_topology = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"} + // Indicates a volume accessible from both "zone" "Z2" and "zone" "Z3" + // in the "region" "R1". + repeated Topology accessible_topology = 5; +} + +message TopologyRequirement { + // Specifies the list of topologies the provisioned volume MUST be + // accessible from. + // This field is OPTIONAL. If TopologyRequirement is specified either + // requisite or preferred or both MUST be specified. + // + // If requisite is specified, the provisioned volume MUST be + // accessible from at least one of the requisite topologies. + // + // Given + // x = number of topologies provisioned volume is accessible from + // n = number of requisite topologies + // The CO MUST ensure n >= 1. The SP MUST ensure x >= 1 + // If x==n, then the SP MUST make the provisioned volume available to + // all topologies from the list of requisite topologies. If it is + // unable to do so, the SP MUST fail the CreateVolume call. + // For example, if a volume should be accessible from a single zone, + // and requisite = + // {"region": "R1", "zone": "Z2"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and the "zone" "Z2". + // Similarly, if a volume should be accessible from two zones, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and both "zone" "Z2" and "zone" "Z3". + // + // If xn, then the SP MUST make the provisioned volume available from + // all topologies from the list of requisite topologies and MAY choose + // the remaining x-n unique topologies from the list of all possible + // topologies. If it is unable to do so, the SP MUST fail the + // CreateVolume call. + // For example, if a volume should be accessible from two zones, and + // requisite = + // {"region": "R1", "zone": "Z2"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and the "zone" "Z2" and the SP may select the second zone + // independently, e.g. "R1/Z4". + repeated Topology requisite = 1; + + // Specifies the list of topologies the CO would prefer the volume to + // be provisioned in. + // + // This field is OPTIONAL. If TopologyRequirement is specified either + // requisite or preferred or both MUST be specified. + // + // An SP MUST attempt to make the provisioned volume available using + // the preferred topologies in order from first to last. + // + // If requisite is specified, all topologies in preferred list MUST + // also be present in the list of requisite topologies. + // + // If the SP is unable to to make the provisioned volume available + // from any of the preferred topologies, the SP MAY choose a topology + // from the list of requisite topologies. + // If the list of requisite topologies is not specified, then the SP + // MAY choose from the list of all possible topologies. + // If the list of requisite topologies is specified and the SP is + // unable to to make the provisioned volume available from any of the + // requisite topologies it MUST fail the CreateVolume call. + // + // Example 1: + // Given a volume should be accessible from a single zone, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"} + // preferred = + // {"region": "R1", "zone": "Z3"} + // then the the SP SHOULD first attempt to make the provisioned volume + // available from "zone" "Z3" in the "region" "R1" and fall back to + // "zone" "Z2" in the "region" "R1" if that is not possible. + // + // Example 2: + // Given a volume should be accessible from a single zone, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"}, + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z5"} + // preferred = + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z2"} + // then the the SP SHOULD first attempt to make the provisioned volume + // accessible from "zone" "Z4" in the "region" "R1" and fall back to + // "zone" "Z2" in the "region" "R1" if that is not possible. If that + // is not possible, the SP may choose between either the "zone" + // "Z3" or "Z5" in the "region" "R1". + // + // Example 3: + // Given a volume should be accessible from TWO zones (because an + // opaque parameter in CreateVolumeRequest, for example, specifies + // the volume is accessible from two zones, aka synchronously + // replicated), and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"}, + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z5"} + // preferred = + // {"region": "R1", "zone": "Z5"}, + // {"region": "R1", "zone": "Z3"} + // then the the SP SHOULD first attempt to make the provisioned volume + // accessible from the combination of the two "zones" "Z5" and "Z3" in + // the "region" "R1". If that's not possible, it should fall back to + // a combination of "Z5" and other possibilities from the list of + // requisite. If that's not possible, it should fall back to a + // combination of "Z3" and other possibilities from the list of + // requisite. If that's not possible, it should fall back to a + // combination of other possibilities from the list of requisite. + repeated Topology preferred = 2; +} + +// Topology is a map of topological domains to topological segments. +// A topological domain is a sub-division of a cluster, like "region", +// "zone", "rack", etc. +// A topological segment is a specific instance of a topological domain, +// like "zone3", "rack3", etc. +// For example {"com.company/zone": "Z1", "com.company/rack": "R3"} +// Valid keys have two segments: an OPTIONAL prefix and name, separated +// by a slash (/), for example: "com.company.example/zone". +// The key name segment is REQUIRED. The prefix is OPTIONAL. +// The key name MUST be 63 characters or less, begin and end with an +// alphanumeric character ([a-z0-9A-Z]), and contain only dashes (-), +// underscores (_), dots (.), or alphanumerics in between, for example +// "zone". +// The key prefix MUST be 63 characters or less, begin and end with a +// lower-case alphanumeric character ([a-z0-9]), contain only +// dashes (-), dots (.), or lower-case alphanumerics in between, and +// follow domain name notation format +// (https://tools.ietf.org/html/rfc1035#section-2.3.1). +// The key prefix SHOULD include the plugin's host company name and/or +// the plugin name, to minimize the possibility of collisions with keys +// from other plugins. +// If a key prefix is specified, it MUST be identical across all +// topology keys returned by the SP (across all RPCs). +// Keys MUST be case-insensitive. Meaning the keys "Zone" and "zone" +// MUST not both exist. +// Each value (topological segment) MUST contain 1 or more strings. +// Each string MUST be 63 characters or less and begin and end with an +// alphanumeric character with '-', '_', '.', or alphanumerics in +// between. +message Topology { + map segments = 1; +} +message DeleteVolumeRequest { + // The ID of the volume to be deprovisioned. + // This field is REQUIRED. + string volume_id = 1; + + // Secrets required by plugin to complete volume deletion request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 2 [(csi_secret) = true]; +} + +message DeleteVolumeResponse { + // Intentionally empty. +} +message ControllerPublishVolumeRequest { + // The ID of the volume to be used on a node. + // This field is REQUIRED. + string volume_id = 1; + + // The ID of the node. This field is REQUIRED. The CO SHALL set this + // field to match the node ID returned by `NodeGetInfo`. + string node_id = 2; + + // Volume capability describing how the CO intends to use this volume. + // SP MUST ensure the CO can use the published volume as described. + // Otherwise SP MUST return the appropriate gRPC error code. + // This is a REQUIRED field. + VolumeCapability volume_capability = 3; + + // Indicates SP MUST publish the volume in readonly mode. + // CO MUST set this field to false if SP does not have the + // PUBLISH_READONLY controller capability. + // This is a REQUIRED field. + bool readonly = 4; + + // Secrets required by plugin to complete controller publish volume + // request. This field is OPTIONAL. Refer to the + // `Secrets Requirements` section on how to use this field. + map secrets = 5 [(csi_secret) = true]; + + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + map volume_context = 6; +} + +message ControllerPublishVolumeResponse { + // Opaque static publish properties of the volume. SP MAY use this + // field to ensure subsequent `NodeStageVolume` or `NodePublishVolume` + // calls calls have contextual information. + // The contents of this field SHALL be opaque to a CO. + // The contents of this field SHALL NOT be mutable. + // The contents of this field SHALL be safe for the CO to cache. + // The contents of this field SHOULD NOT contain sensitive + // information. + // The contents of this field SHOULD NOT be used for uniquely + // identifying a volume. The `volume_id` alone SHOULD be sufficient to + // identify the volume. + // This field is OPTIONAL and when present MUST be passed to + // subsequent `NodeStageVolume` or `NodePublishVolume` calls + map publish_context = 1; +} +message ControllerUnpublishVolumeRequest { + // The ID of the volume. This field is REQUIRED. + string volume_id = 1; + + // The ID of the node. This field is OPTIONAL. The CO SHOULD set this + // field to match the node ID returned by `NodeGetInfo` or leave it + // unset. If the value is set, the SP MUST unpublish the volume from + // the specified node. If the value is unset, the SP MUST unpublish + // the volume from all nodes it is published to. + string node_id = 2; + + // Secrets required by plugin to complete controller unpublish volume + // request. This SHOULD be the same secrets passed to the + // ControllerPublishVolume call for the specified volume. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 3 [(csi_secret) = true]; +} + +message ControllerUnpublishVolumeResponse { + // Intentionally empty. +} +message ValidateVolumeCapabilitiesRequest { + // The ID of the volume to check. This field is REQUIRED. + string volume_id = 1; + + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + map volume_context = 2; + + // The capabilities that the CO wants to check for the volume. This + // call SHALL return "confirmed" only if all the volume capabilities + // specified below are supported. This field is REQUIRED. + repeated VolumeCapability volume_capabilities = 3; + + // See CreateVolumeRequest.parameters. + // This field is OPTIONAL. + map parameters = 4; + + // Secrets required by plugin to complete volume validation request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 5 [(csi_secret) = true]; +} + +message ValidateVolumeCapabilitiesResponse { + message Confirmed { + // Volume context validated by the plugin. + // This field is OPTIONAL. + map volume_context = 1; + + // Volume capabilities supported by the plugin. + // This field is REQUIRED. + repeated VolumeCapability volume_capabilities = 2; + + // The volume creation parameters validated by the plugin. + // This field is OPTIONAL. + map parameters = 3; + } + + // Confirmed indicates to the CO the set of capabilities that the + // plugin has validated. This field SHALL only be set to a non-empty + // value for successful validation responses. + // For successful validation responses, the CO SHALL compare the + // fields of this message to the originally requested capabilities in + // order to guard against an older plugin reporting "valid" for newer + // capability fields that it does not yet understand. + // This field is OPTIONAL. + Confirmed confirmed = 1; + + // Message to the CO if `confirmed` above is empty. This field is + // OPTIONAL. + // An empty string is equal to an unspecified field value. + string message = 2; +} +message ListVolumesRequest { + // If specified (non-zero value), the Plugin MUST NOT return more + // entries than this number in the response. If the actual number of + // entries is more than this number, the Plugin MUST set `next_token` + // in the response which can be used to get the next page of entries + // in the subsequent `ListVolumes` call. This field is OPTIONAL. If + // not specified (zero value), it means there is no restriction on the + // number of entries that can be returned. + // The value of this field MUST NOT be negative. + int32 max_entries = 1; + + // A token to specify where to start paginating. Set this field to + // `next_token` returned by a previous `ListVolumes` call to get the + // next page of entries. This field is OPTIONAL. + // An empty string is equal to an unspecified field value. + string starting_token = 2; +} + +message ListVolumesResponse { + message Entry { + Volume volume = 1; + } + + repeated Entry entries = 1; + + // This token allows you to get the next page of entries for + // `ListVolumes` request. If the number of entries is larger than + // `max_entries`, use the `next_token` as a value for the + // `starting_token` field in the next `ListVolumes` request. This + // field is OPTIONAL. + // An empty string is equal to an unspecified field value. + string next_token = 2; +} +message GetCapacityRequest { + // If specified, the Plugin SHALL report the capacity of the storage + // that can be used to provision volumes that satisfy ALL of the + // specified `volume_capabilities`. These are the same + // `volume_capabilities` the CO will use in `CreateVolumeRequest`. + // This field is OPTIONAL. + repeated VolumeCapability volume_capabilities = 1; + + // If specified, the Plugin SHALL report the capacity of the storage + // that can be used to provision volumes with the given Plugin + // specific `parameters`. These are the same `parameters` the CO will + // use in `CreateVolumeRequest`. This field is OPTIONAL. + map parameters = 2; + + // If specified, the Plugin SHALL report the capacity of the storage + // that can be used to provision volumes that in the specified + // `accessible_topology`. This is the same as the + // `accessible_topology` the CO returns in a `CreateVolumeResponse`. + // This field is OPTIONAL. This field SHALL NOT be set unless the + // plugin advertises the VOLUME_ACCESSIBILITY_CONSTRAINTS capability. + Topology accessible_topology = 3; +} + +message GetCapacityResponse { + // The available capacity, in bytes, of the storage that can be used + // to provision volumes. If `volume_capabilities` or `parameters` is + // specified in the request, the Plugin SHALL take those into + // consideration when calculating the available capacity of the + // storage. This field is REQUIRED. + // The value of this field MUST NOT be negative. + int64 available_capacity = 1; +} +message ControllerGetCapabilitiesRequest { + // Intentionally empty. +} + +message ControllerGetCapabilitiesResponse { + // All the capabilities that the controller service supports. This + // field is OPTIONAL. + repeated ControllerServiceCapability capabilities = 1; +} + +// Specifies a capability of the controller service. +message ControllerServiceCapability { + message RPC { + enum Type { + UNKNOWN = 0; + CREATE_DELETE_VOLUME = 1; + PUBLISH_UNPUBLISH_VOLUME = 2; + LIST_VOLUMES = 3; + GET_CAPACITY = 4; + // Currently the only way to consume a snapshot is to create + // a volume from it. Therefore plugins supporting + // CREATE_DELETE_SNAPSHOT MUST support creating volume from + // snapshot. + CREATE_DELETE_SNAPSHOT = 5; + LIST_SNAPSHOTS = 6; + // Plugins supporting volume cloning at the storage level MAY + // report this capability. The source volume MUST be managed by + // the same plugin. Not all volume sources and parameters + // combinations MAY work. + CLONE_VOLUME = 7; + // Indicates the SP supports ControllerPublishVolume.readonly + // field. + PUBLISH_READONLY = 8; + } + + Type type = 1; + } + + oneof type { + // RPC that the controller supports. + RPC rpc = 1; + } +} +message CreateSnapshotRequest { + // The ID of the source volume to be snapshotted. + // This field is REQUIRED. + string source_volume_id = 1; + + // The suggested name for the snapshot. This field is REQUIRED for + // idempotency. + // Any Unicode string that conforms to the length limit is allowed + // except those containing the following banned characters: + // U+0000-U+0008, U+000B, U+000C, U+000E-U+001F, U+007F-U+009F. + // (These are control characters other than commonly used whitespace.) + string name = 2; + + // Secrets required by plugin to complete snapshot creation request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 3 [(csi_secret) = true]; + + // Plugin specific parameters passed in as opaque key-value pairs. + // This field is OPTIONAL. The Plugin is responsible for parsing and + // validating these parameters. COs will treat these as opaque. + // Use cases for opaque parameters: + // - Specify a policy to automatically clean up the snapshot. + // - Specify an expiration date for the snapshot. + // - Specify whether the snapshot is readonly or read/write. + // - Specify if the snapshot should be replicated to some place. + // - Specify primary or secondary for replication systems that + // support snapshotting only on primary. + map parameters = 4; +} + +message CreateSnapshotResponse { + // Contains all attributes of the newly created snapshot that are + // relevant to the CO along with information required by the Plugin + // to uniquely identify the snapshot. This field is REQUIRED. + Snapshot snapshot = 1; +} + +// Information about a specific snapshot. +message Snapshot { + // This is the complete size of the snapshot in bytes. The purpose of + // this field is to give CO guidance on how much space is needed to + // create a volume from this snapshot. The size of the volume MUST NOT + // be less than the size of the source snapshot. This field is + // OPTIONAL. If this field is not set, it indicates that this size is + // unknown. The value of this field MUST NOT be negative and a size of + // zero means it is unspecified. + int64 size_bytes = 1; + + // The identifier for this snapshot, generated by the plugin. + // This field is REQUIRED. + // This field MUST contain enough information to uniquely identify + // this specific snapshot vs all other snapshots supported by this + // plugin. + // This field SHALL be used by the CO in subsequent calls to refer to + // this snapshot. + // The SP is NOT responsible for global uniqueness of snapshot_id + // across multiple SPs. + string snapshot_id = 2; + + // Identity information for the source volume. Note that creating a + // snapshot from a snapshot is not supported here so the source has to + // be a volume. This field is REQUIRED. + string source_volume_id = 3; + + // Timestamp when the point-in-time snapshot is taken on the storage + // system. This field is REQUIRED. + .google.protobuf.Timestamp creation_time = 4; + + // Indicates if a snapshot is ready to use as a + // `volume_content_source` in a `CreateVolumeRequest`. The default + // value is false. This field is REQUIRED. + bool ready_to_use = 5; +} +message DeleteSnapshotRequest { + // The ID of the snapshot to be deleted. + // This field is REQUIRED. + string snapshot_id = 1; + + // Secrets required by plugin to complete snapshot deletion request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 2 [(csi_secret) = true]; +} + +message DeleteSnapshotResponse {} +// List all snapshots on the storage system regardless of how they were +// created. +message ListSnapshotsRequest { + // If specified (non-zero value), the Plugin MUST NOT return more + // entries than this number in the response. If the actual number of + // entries is more than this number, the Plugin MUST set `next_token` + // in the response which can be used to get the next page of entries + // in the subsequent `ListSnapshots` call. This field is OPTIONAL. If + // not specified (zero value), it means there is no restriction on the + // number of entries that can be returned. + // The value of this field MUST NOT be negative. + int32 max_entries = 1; + + // A token to specify where to start paginating. Set this field to + // `next_token` returned by a previous `ListSnapshots` call to get the + // next page of entries. This field is OPTIONAL. + // An empty string is equal to an unspecified field value. + string starting_token = 2; + + // Identity information for the source volume. This field is OPTIONAL. + // It can be used to list snapshots by volume. + string source_volume_id = 3; + + // Identity information for a specific snapshot. This field is + // OPTIONAL. It can be used to list only a specific snapshot. + // ListSnapshots will return with current snapshot information + // and will not block if the snapshot is being processed after + // it is cut. + string snapshot_id = 4; +} + +message ListSnapshotsResponse { + message Entry { + Snapshot snapshot = 1; + } + + repeated Entry entries = 1; + + // This token allows you to get the next page of entries for + // `ListSnapshots` request. If the number of entries is larger than + // `max_entries`, use the `next_token` as a value for the + // `starting_token` field in the next `ListSnapshots` request. This + // field is OPTIONAL. + // An empty string is equal to an unspecified field value. + string next_token = 2; +} +message NodeStageVolumeRequest { + // The ID of the volume to publish. This field is REQUIRED. + string volume_id = 1; + + // The CO SHALL set this field to the value returned by + // `ControllerPublishVolume` if the corresponding Controller Plugin + // has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be + // left unset if the corresponding Controller Plugin does not have + // this capability. This is an OPTIONAL field. + map publish_context = 2; + + // The path to which the volume MAY be staged. It MUST be an + // absolute path in the root filesystem of the process serving this + // request, and MUST be a directory. The CO SHALL ensure that there + // is only one `staging_target_path` per volume. The CO SHALL ensure + // that the path is directory and that the process serving the + // request has `read` and `write` permission to that directory. The + // CO SHALL be responsible for creating the directory if it does not + // exist. + // This is a REQUIRED field. + string staging_target_path = 3; + + // Volume capability describing how the CO intends to use this volume. + // SP MUST ensure the CO can use the staged volume as described. + // Otherwise SP MUST return the appropriate gRPC error code. + // This is a REQUIRED field. + VolumeCapability volume_capability = 4; + + // Secrets required by plugin to complete node stage volume request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 5 [(csi_secret) = true]; + + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + map volume_context = 6; +} + +message NodeStageVolumeResponse { + // Intentionally empty. +} +message NodeUnstageVolumeRequest { + // The ID of the volume. This field is REQUIRED. + string volume_id = 1; + + // The path at which the volume was staged. It MUST be an absolute + // path in the root filesystem of the process serving this request. + // This is a REQUIRED field. + string staging_target_path = 2; +} + +message NodeUnstageVolumeResponse { + // Intentionally empty. +} +message NodePublishVolumeRequest { + // The ID of the volume to publish. This field is REQUIRED. + string volume_id = 1; + + // The CO SHALL set this field to the value returned by + // `ControllerPublishVolume` if the corresponding Controller Plugin + // has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be + // left unset if the corresponding Controller Plugin does not have + // this capability. This is an OPTIONAL field. + map publish_context = 2; + + // The path to which the volume was staged by `NodeStageVolume`. + // It MUST be an absolute path in the root filesystem of the process + // serving this request. + // It MUST be set if the Node Plugin implements the + // `STAGE_UNSTAGE_VOLUME` node capability. + // This is an OPTIONAL field. + string staging_target_path = 3; + + // The path to which the volume will be published. It MUST be an + // absolute path in the root filesystem of the process serving this + // request. The CO SHALL ensure uniqueness of target_path per volume. + // The CO SHALL ensure that the parent directory of this path exists + // and that the process serving the request has `read` and `write` + // permissions to that parent directory. + // For volumes with an access type of block, the SP SHALL place the + // block device at target_path. + // For volumes with an access type of mount, the SP SHALL place the + // mounted directory at target_path. + // Creation of target_path is the responsibility of the SP. + // This is a REQUIRED field. + string target_path = 4; + + // Volume capability describing how the CO intends to use this volume. + // SP MUST ensure the CO can use the published volume as described. + // Otherwise SP MUST return the appropriate gRPC error code. + // This is a REQUIRED field. + VolumeCapability volume_capability = 5; + + // Indicates SP MUST publish the volume in readonly mode. + // This field is REQUIRED. + bool readonly = 6; + + // Secrets required by plugin to complete node publish volume request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 7 [(csi_secret) = true]; + + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + map volume_context = 8; +} + +message NodePublishVolumeResponse { + // Intentionally empty. +} +message NodeUnpublishVolumeRequest { + // The ID of the volume. This field is REQUIRED. + string volume_id = 1; + + // The path at which the volume was published. It MUST be an absolute + // path in the root filesystem of the process serving this request. + // The SP MUST delete the file or directory it created at this path. + // This is a REQUIRED field. + string target_path = 2; +} + +message NodeUnpublishVolumeResponse { + // Intentionally empty. +} +message NodeGetVolumeStatsRequest { + // The ID of the volume. This field is REQUIRED. + string volume_id = 1; + + // It can be any valid path where volume was previously + // staged or published. + // It MUST be an absolute path in the root filesystem of + // the process serving this request. + // This is a REQUIRED field. + string volume_path = 2; +} + +message NodeGetVolumeStatsResponse { + // This field is OPTIONAL. + repeated VolumeUsage usage = 1; +} + +message VolumeUsage { + enum Unit { + UNKNOWN = 0; + BYTES = 1; + INODES = 2; + } + // The available capacity in specified Unit. This field is OPTIONAL. + // The value of this field MUST NOT be negative. + int64 available = 1; + + // The total capacity in specified Unit. This field is REQUIRED. + // The value of this field MUST NOT be negative. + int64 total = 2; + + // The used capacity in specified Unit. This field is OPTIONAL. + // The value of this field MUST NOT be negative. + int64 used = 3; + + // Units by which values are measured. This field is REQUIRED. + Unit unit = 4; +} +message NodeGetCapabilitiesRequest { + // Intentionally empty. +} + +message NodeGetCapabilitiesResponse { + // All the capabilities that the node service supports. This field + // is OPTIONAL. + repeated NodeServiceCapability capabilities = 1; +} + +// Specifies a capability of the node service. +message NodeServiceCapability { + message RPC { + enum Type { + UNKNOWN = 0; + STAGE_UNSTAGE_VOLUME = 1; + // If Plugin implements GET_VOLUME_STATS capability + // then it MUST implement NodeGetVolumeStats RPC + // call for fetching volume statistics. + GET_VOLUME_STATS = 2; + } + + Type type = 1; + } + + oneof type { + // RPC that the controller supports. + RPC rpc = 1; + } +} +message NodeGetInfoRequest { +} + +message NodeGetInfoResponse { + // The identifier of the node as understood by the SP. + // This field is REQUIRED. + // This field MUST contain enough information to uniquely identify + // this specific node vs all other nodes supported by this plugin. + // This field SHALL be used by the CO in subsequent calls, including + // `ControllerPublishVolume`, to refer to this node. + // The SP is NOT responsible for global uniqueness of node_id across + // multiple SPs. + string node_id = 1; + + // Maximum number of volumes that controller can publish to the node. + // If value is not set or zero CO SHALL decide how many volumes of + // this type can be published by the controller to the node. The + // plugin MUST NOT set negative values here. + // This field is OPTIONAL. + int64 max_volumes_per_node = 2; + + // Specifies where (regions, zones, racks, etc.) the node is + // accessible from. + // A plugin that returns this field MUST also set the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability. + // COs MAY use this information along with the topology information + // returned in CreateVolumeResponse to ensure that a given volume is + // accessible from a given node when scheduling workloads. + // This field is OPTIONAL. If it is not specified, the CO MAY assume + // the node is not subject to any topological constraint, and MAY + // schedule workloads that reference any volume V, such that there are + // no topological constraints declared for V. + // + // Example 1: + // accessible_topology = + // {"region": "R1", "zone": "R2"} + // Indicates the node exists within the "region" "R1" and the "zone" + // "Z2". + Topology accessible_topology = 3; +} diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest.proto b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest.proto new file mode 100644 index 000000000..7d8fccc75 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest.proto @@ -0,0 +1,1217 @@ +// Code generated by make; DO NOT EDIT. +syntax = "proto3"; +package csitest.v1; + +option go_package = "csitest"; + +import "google/protobuf/descriptor.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csi.proto"; // required for csi_secret + +service Identity { + rpc GetPluginInfo(GetPluginInfoRequest) + returns (GetPluginInfoResponse) {} + + rpc GetPluginCapabilities(GetPluginCapabilitiesRequest) + returns (GetPluginCapabilitiesResponse) {} + + rpc Probe (ProbeRequest) + returns (ProbeResponse) {} +} + +service Controller { + rpc CreateVolume (CreateVolumeRequest) + returns (CreateVolumeResponse) {} + + rpc DeleteVolume (DeleteVolumeRequest) + returns (DeleteVolumeResponse) {} + + rpc ControllerPublishVolume (ControllerPublishVolumeRequest) + returns (ControllerPublishVolumeResponse) {} + + rpc ControllerUnpublishVolume (ControllerUnpublishVolumeRequest) + returns (ControllerUnpublishVolumeResponse) {} + + rpc ValidateVolumeCapabilities (ValidateVolumeCapabilitiesRequest) + returns (ValidateVolumeCapabilitiesResponse) {} + + rpc ListVolumes (ListVolumesRequest) + returns (ListVolumesResponse) {} + + rpc GetCapacity (GetCapacityRequest) + returns (GetCapacityResponse) {} + + rpc ControllerGetCapabilities (ControllerGetCapabilitiesRequest) + returns (ControllerGetCapabilitiesResponse) {} + + rpc CreateSnapshot (CreateSnapshotRequest) + returns (CreateSnapshotResponse) {} + + rpc DeleteSnapshot (DeleteSnapshotRequest) + returns (DeleteSnapshotResponse) {} + + rpc ListSnapshots (ListSnapshotsRequest) + returns (ListSnapshotsResponse) {} +} + +service Node { + rpc NodeStageVolume (NodeStageVolumeRequest) + returns (NodeStageVolumeResponse) {} + + rpc NodeUnstageVolume (NodeUnstageVolumeRequest) + returns (NodeUnstageVolumeResponse) {} + + rpc NodePublishVolume (NodePublishVolumeRequest) + returns (NodePublishVolumeResponse) {} + + rpc NodeUnpublishVolume (NodeUnpublishVolumeRequest) + returns (NodeUnpublishVolumeResponse) {} + + rpc NodeGetVolumeStats (NodeGetVolumeStatsRequest) + returns (NodeGetVolumeStatsResponse) {} + + rpc NodeGetCapabilities (NodeGetCapabilitiesRequest) + returns (NodeGetCapabilitiesResponse) {} + + rpc NodeGetInfo (NodeGetInfoRequest) + returns (NodeGetInfoResponse) {} +} +message GetPluginInfoRequest { + // Intentionally empty. +} + +message GetPluginInfoResponse { + // The name MUST follow domain name notation format + // (https://tools.ietf.org/html/rfc1035#section-2.3.1). It SHOULD + // include the plugin's host company name and the plugin name, + // to minimize the possibility of collisions. It MUST be 63 + // characters or less, beginning and ending with an alphanumeric + // character ([a-z0-9A-Z]) with dashes (-), dots (.), and + // alphanumerics between. This field is REQUIRED. + string name = 1; + + // This field is REQUIRED. Value of this field is opaque to the CO. + string vendor_version = 2; + + // This field is OPTIONAL. Values are opaque to the CO. + map manifest = 3; +} +message GetPluginCapabilitiesRequest { + // Intentionally empty. +} + +message GetPluginCapabilitiesResponse { + // All the capabilities that the controller service supports. This + // field is OPTIONAL. + repeated PluginCapability capabilities = 1; +} + +// Specifies a capability of the plugin. +message PluginCapability { + message Service { + enum Type { + UNKNOWN = 0; + + // CONTROLLER_SERVICE indicates that the Plugin provides RPCs for + // the ControllerService. Plugins SHOULD provide this capability. + // In rare cases certain plugins MAY wish to omit the + // ControllerService entirely from their implementation, but such + // SHOULD NOT be the common case. + // The presence of this capability determines whether the CO will + // attempt to invoke the REQUIRED ControllerService RPCs, as well + // as specific RPCs as indicated by ControllerGetCapabilities. + CONTROLLER_SERVICE = 1; + + // VOLUME_ACCESSIBILITY_CONSTRAINTS indicates that the volumes for + // this plugin MAY NOT be equally accessible by all nodes in the + // cluster. The CO MUST use the topology information returned by + // CreateVolumeRequest along with the topology information + // returned by NodeGetInfo to ensure that a given volume is + // accessible from a given node when scheduling workloads. + VOLUME_ACCESSIBILITY_CONSTRAINTS = 2; + } + Type type = 1; + } + + oneof type { + // Service that the plugin supports. + Service service = 1; + } +} +message ProbeRequest { + // Intentionally empty. +} + +message ProbeResponse { + // Readiness allows a plugin to report its initialization status back + // to the CO. Initialization for some plugins MAY be time consuming + // and it is important for a CO to distinguish between the following + // cases: + // + // 1) The plugin is in an unhealthy state and MAY need restarting. In + // this case a gRPC error code SHALL be returned. + // 2) The plugin is still initializing, but is otherwise perfectly + // healthy. In this case a successful response SHALL be returned + // with a readiness value of `false`. Calls to the plugin's + // Controller and/or Node services MAY fail due to an incomplete + // initialization state. + // 3) The plugin has finished initializing and is ready to service + // calls to its Controller and/or Node services. A successful + // response is returned with a readiness value of `true`. + // + // This field is OPTIONAL. If not present, the caller SHALL assume + // that the plugin is in a ready state and is accepting calls to its + // Controller and/or Node services (according to the plugin's reported + // capabilities). + .google.protobuf.BoolValue ready = 1; +} +message CreateVolumeRequest { + // The suggested name for the storage space. This field is REQUIRED. + // It serves two purposes: + // 1) Idempotency - This name is generated by the CO to achieve + // idempotency. The Plugin SHOULD ensure that multiple + // `CreateVolume` calls for the same name do not result in more + // than one piece of storage provisioned corresponding to that + // name. If a Plugin is unable to enforce idempotency, the CO's + // error recovery logic could result in multiple (unused) volumes + // being provisioned. + // In the case of error, the CO MUST handle the gRPC error codes + // per the recovery behavior defined in the "CreateVolume Errors" + // section below. + // The CO is responsible for cleaning up volumes it provisioned + // that it no longer needs. If the CO is uncertain whether a volume + // was provisioned or not when a `CreateVolume` call fails, the CO + // MAY call `CreateVolume` again, with the same name, to ensure the + // volume exists and to retrieve the volume's `volume_id` (unless + // otherwise prohibited by "CreateVolume Errors"). + // 2) Suggested name - Some storage systems allow callers to specify + // an identifier by which to refer to the newly provisioned + // storage. If a storage system supports this, it can optionally + // use this name as the identifier for the new volume. + // Any Unicode string that conforms to the length limit is allowed + // except those containing the following banned characters: + // U+0000-U+0008, U+000B, U+000C, U+000E-U+001F, U+007F-U+009F. + // (These are control characters other than commonly used whitespace.) + string name = 1; + + // This field is OPTIONAL. This allows the CO to specify the capacity + // requirement of the volume to be provisioned. If not specified, the + // Plugin MAY choose an implementation-defined capacity range. If + // specified it MUST always be honored, even when creating volumes + // from a source; which MAY force some backends to internally extend + // the volume after creating it. + CapacityRange capacity_range = 2; + + // The capabilities that the provisioned volume MUST have. SP MUST + // provision a volume that will satisfy ALL of the capabilities + // specified in this list. Otherwise SP MUST return the appropriate + // gRPC error code. + // The Plugin MUST assume that the CO MAY use the provisioned volume + // with ANY of the capabilities specified in this list. + // For example, a CO MAY specify two volume capabilities: one with + // access mode SINGLE_NODE_WRITER and another with access mode + // MULTI_NODE_READER_ONLY. In this case, the SP MUST verify that the + // provisioned volume can be used in either mode. + // This also enables the CO to do early validation: If ANY of the + // specified volume capabilities are not supported by the SP, the call + // MUST return the appropriate gRPC error code. + // This field is REQUIRED. + repeated VolumeCapability volume_capabilities = 3; + + // Plugin specific parameters passed in as opaque key-value pairs. + // This field is OPTIONAL. The Plugin is responsible for parsing and + // validating these parameters. COs will treat these as opaque. + map parameters = 4; + + // Secrets required by plugin to complete volume creation request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. Renamed to test whether secret + // stripping is really based on the csi_secret option. + map seecreets = 5 [(csi.v1.csi_secret) = true]; + + // If specified, the new volume will be pre-populated with data from + // this source. This field is OPTIONAL. + VolumeContentSource volume_content_source = 6; + + // Specifies where (regions, zones, racks, etc.) the provisioned + // volume MUST be accessible from. + // An SP SHALL advertise the requirements for topological + // accessibility information in documentation. COs SHALL only specify + // topological accessibility information supported by the SP. + // This field is OPTIONAL. + // This field SHALL NOT be specified unless the SP has the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability. + // If this field is not specified and the SP has the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability, the SP MAY + // choose where the provisioned volume is accessible from. + TopologyRequirement accessibility_requirements = 7; + + // A secret value that isn't a string map. + int64 new_secret_int = 8 [(csi.v1.csi_secret) = true]; + + // We must recurse into maps. + map maybe_secret_map = 9; +} + +// Specifies what source the volume will be created from. One of the +// type fields MUST be specified. +message VolumeContentSource { + message SnapshotSource { + // Contains identity information for the existing source snapshot. + // This field is REQUIRED. Plugin is REQUIRED to support creating + // volume from snapshot if it supports the capability + // CREATE_DELETE_SNAPSHOT. + string snapshot_id = 1; + } + + message VolumeSource { + // Contains identity information for the existing source volume. + // This field is REQUIRED. Plugins reporting CLONE_VOLUME + // capability MUST support creating a volume from another volume. + string volume_id = 1; + + // A secret field that will only get stripped by code that + // can recurse into a oneof field. + string oneof_secret_field = 2 [(csi.v1.csi_secret) = true]; + } + + oneof type { + SnapshotSource snapshot = 1; + VolumeSource volume = 2; + } + + // A secret field that will only get stripped by code that + // can recurse into CreateVolumeRequest. + string nested_secret_field = 3 [(csi.v1.csi_secret) = true]; +} + +message CreateVolumeResponse { + // Contains all attributes of the newly created volume that are + // relevant to the CO along with information required by the Plugin + // to uniquely identify the volume. This field is REQUIRED. + Volume volume = 1; +} + +// Specify a capability of a volume. +message VolumeCapability { + // Indicate that the volume will be accessed via the block device API. + message BlockVolume { + // Intentionally empty, for now. + } + + // Indicate that the volume will be accessed via the filesystem API. + message MountVolume { + // The filesystem type. This field is OPTIONAL. + // An empty string is equal to an unspecified field value. + string fs_type = 1; + + // The mount options that can be used for the volume. This field is + // OPTIONAL. `mount_flags` MAY contain sensitive information. + // Therefore, the CO and the Plugin MUST NOT leak this information + // to untrusted entities. The total size of this repeated field + // SHALL NOT exceed 4 KiB. + repeated string mount_flags = 2; + } + + // Specify how a volume can be accessed. + message AccessMode { + enum Mode { + UNKNOWN = 0; + + // Can only be published once as read/write on a single node, at + // any given time. + SINGLE_NODE_WRITER = 1; + + // Can only be published once as readonly on a single node, at + // any given time. + SINGLE_NODE_READER_ONLY = 2; + + // Can be published as readonly at multiple nodes simultaneously. + MULTI_NODE_READER_ONLY = 3; + + // Can be published at multiple nodes simultaneously. Only one of + // the node can be used as read/write. The rest will be readonly. + MULTI_NODE_SINGLE_WRITER = 4; + + // Can be published as read/write at multiple nodes + // simultaneously. + MULTI_NODE_MULTI_WRITER = 5; + } + + // This field is REQUIRED. + Mode mode = 1; + } + + // Specifies what API the volume will be accessed using. One of the + // following fields MUST be specified. + oneof access_type { + BlockVolume block = 1; + MountVolume mount = 2; + } + + // This is a REQUIRED field. + AccessMode access_mode = 3; + + // A secret inside a field that occurs in an array. + string array_secret = 4 [(csi.v1.csi_secret) = true]; +} + +// The capacity of the storage space in bytes. To specify an exact size, +// `required_bytes` and `limit_bytes` SHALL be set to the same value. At +// least one of the these fields MUST be specified. +message CapacityRange { + // Volume MUST be at least this big. This field is OPTIONAL. + // A value of 0 is equal to an unspecified field value. + // The value of this field MUST NOT be negative. + int64 required_bytes = 1; + + // Volume MUST not be bigger than this. This field is OPTIONAL. + // A value of 0 is equal to an unspecified field value. + // The value of this field MUST NOT be negative. + int64 limit_bytes = 2; +} + +// Information about a specific volume. +message Volume { + // The capacity of the volume in bytes. This field is OPTIONAL. If not + // set (value of 0), it indicates that the capacity of the volume is + // unknown (e.g., NFS share). + // The value of this field MUST NOT be negative. + int64 capacity_bytes = 1; + + // The identifier for this volume, generated by the plugin. + // This field is REQUIRED. + // This field MUST contain enough information to uniquely identify + // this specific volume vs all other volumes supported by this plugin. + // This field SHALL be used by the CO in subsequent calls to refer to + // this volume. + // The SP is NOT responsible for global uniqueness of volume_id across + // multiple SPs. + string volume_id = 2; + + // Opaque static properties of the volume. SP MAY use this field to + // ensure subsequent volume validation and publishing calls have + // contextual information. + // The contents of this field SHALL be opaque to a CO. + // The contents of this field SHALL NOT be mutable. + // The contents of this field SHALL be safe for the CO to cache. + // The contents of this field SHOULD NOT contain sensitive + // information. + // The contents of this field SHOULD NOT be used for uniquely + // identifying a volume. The `volume_id` alone SHOULD be sufficient to + // identify the volume. + // A volume uniquely identified by `volume_id` SHALL always report the + // same volume_context. + // This field is OPTIONAL and when present MUST be passed to volume + // validation and publishing calls. + map volume_context = 3; + + // If specified, indicates that the volume is not empty and is + // pre-populated with data from the specified source. + // This field is OPTIONAL. + VolumeContentSource content_source = 4; + + // Specifies where (regions, zones, racks, etc.) the provisioned + // volume is accessible from. + // A plugin that returns this field MUST also set the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability. + // An SP MAY specify multiple topologies to indicate the volume is + // accessible from multiple locations. + // COs MAY use this information along with the topology information + // returned by NodeGetInfo to ensure that a given volume is accessible + // from a given node when scheduling workloads. + // This field is OPTIONAL. If it is not specified, the CO MAY assume + // the volume is equally accessible from all nodes in the cluster and + // MAY schedule workloads referencing the volume on any available + // node. + // + // Example 1: + // accessible_topology = {"region": "R1", "zone": "Z2"} + // Indicates a volume accessible only from the "region" "R1" and the + // "zone" "Z2". + // + // Example 2: + // accessible_topology = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"} + // Indicates a volume accessible from both "zone" "Z2" and "zone" "Z3" + // in the "region" "R1". + repeated Topology accessible_topology = 5; +} + +message TopologyRequirement { + // Specifies the list of topologies the provisioned volume MUST be + // accessible from. + // This field is OPTIONAL. If TopologyRequirement is specified either + // requisite or preferred or both MUST be specified. + // + // If requisite is specified, the provisioned volume MUST be + // accessible from at least one of the requisite topologies. + // + // Given + // x = number of topologies provisioned volume is accessible from + // n = number of requisite topologies + // The CO MUST ensure n >= 1. The SP MUST ensure x >= 1 + // If x==n, then the SP MUST make the provisioned volume available to + // all topologies from the list of requisite topologies. If it is + // unable to do so, the SP MUST fail the CreateVolume call. + // For example, if a volume should be accessible from a single zone, + // and requisite = + // {"region": "R1", "zone": "Z2"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and the "zone" "Z2". + // Similarly, if a volume should be accessible from two zones, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and both "zone" "Z2" and "zone" "Z3". + // + // If xn, then the SP MUST make the provisioned volume available from + // all topologies from the list of requisite topologies and MAY choose + // the remaining x-n unique topologies from the list of all possible + // topologies. If it is unable to do so, the SP MUST fail the + // CreateVolume call. + // For example, if a volume should be accessible from two zones, and + // requisite = + // {"region": "R1", "zone": "Z2"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and the "zone" "Z2" and the SP may select the second zone + // independently, e.g. "R1/Z4". + repeated Topology requisite = 1; + + // Specifies the list of topologies the CO would prefer the volume to + // be provisioned in. + // + // This field is OPTIONAL. If TopologyRequirement is specified either + // requisite or preferred or both MUST be specified. + // + // An SP MUST attempt to make the provisioned volume available using + // the preferred topologies in order from first to last. + // + // If requisite is specified, all topologies in preferred list MUST + // also be present in the list of requisite topologies. + // + // If the SP is unable to to make the provisioned volume available + // from any of the preferred topologies, the SP MAY choose a topology + // from the list of requisite topologies. + // If the list of requisite topologies is not specified, then the SP + // MAY choose from the list of all possible topologies. + // If the list of requisite topologies is specified and the SP is + // unable to to make the provisioned volume available from any of the + // requisite topologies it MUST fail the CreateVolume call. + // + // Example 1: + // Given a volume should be accessible from a single zone, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"} + // preferred = + // {"region": "R1", "zone": "Z3"} + // then the the SP SHOULD first attempt to make the provisioned volume + // available from "zone" "Z3" in the "region" "R1" and fall back to + // "zone" "Z2" in the "region" "R1" if that is not possible. + // + // Example 2: + // Given a volume should be accessible from a single zone, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"}, + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z5"} + // preferred = + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z2"} + // then the the SP SHOULD first attempt to make the provisioned volume + // accessible from "zone" "Z4" in the "region" "R1" and fall back to + // "zone" "Z2" in the "region" "R1" if that is not possible. If that + // is not possible, the SP may choose between either the "zone" + // "Z3" or "Z5" in the "region" "R1". + // + // Example 3: + // Given a volume should be accessible from TWO zones (because an + // opaque parameter in CreateVolumeRequest, for example, specifies + // the volume is accessible from two zones, aka synchronously + // replicated), and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"}, + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z5"} + // preferred = + // {"region": "R1", "zone": "Z5"}, + // {"region": "R1", "zone": "Z3"} + // then the the SP SHOULD first attempt to make the provisioned volume + // accessible from the combination of the two "zones" "Z5" and "Z3" in + // the "region" "R1". If that's not possible, it should fall back to + // a combination of "Z5" and other possibilities from the list of + // requisite. If that's not possible, it should fall back to a + // combination of "Z3" and other possibilities from the list of + // requisite. If that's not possible, it should fall back to a + // combination of other possibilities from the list of requisite. + repeated Topology preferred = 2; +} + +// Topology is a map of topological domains to topological segments. +// A topological domain is a sub-division of a cluster, like "region", +// "zone", "rack", etc. +// A topological segment is a specific instance of a topological domain, +// like "zone3", "rack3", etc. +// For example {"com.company/zone": "Z1", "com.company/rack": "R3"} +// Valid keys have two segments: an OPTIONAL prefix and name, separated +// by a slash (/), for example: "com.company.example/zone". +// The key name segment is REQUIRED. The prefix is OPTIONAL. +// The key name MUST be 63 characters or less, begin and end with an +// alphanumeric character ([a-z0-9A-Z]), and contain only dashes (-), +// underscores (_), dots (.), or alphanumerics in between, for example +// "zone". +// The key prefix MUST be 63 characters or less, begin and end with a +// lower-case alphanumeric character ([a-z0-9]), contain only +// dashes (-), dots (.), or lower-case alphanumerics in between, and +// follow domain name notation format +// (https://tools.ietf.org/html/rfc1035#section-2.3.1). +// The key prefix SHOULD include the plugin's host company name and/or +// the plugin name, to minimize the possibility of collisions with keys +// from other plugins. +// If a key prefix is specified, it MUST be identical across all +// topology keys returned by the SP (across all RPCs). +// Keys MUST be case-insensitive. Meaning the keys "Zone" and "zone" +// MUST not both exist. +// Each value (topological segment) MUST contain 1 or more strings. +// Each string MUST be 63 characters or less and begin and end with an +// alphanumeric character with '-', '_', '.', or alphanumerics in +// between. +message Topology { + map segments = 1; +} +message DeleteVolumeRequest { + // The ID of the volume to be deprovisioned. + // This field is REQUIRED. + string volume_id = 1; + + // Secrets required by plugin to complete volume deletion request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 2 [(csi.v1.csi_secret) = true]; +} + +message DeleteVolumeResponse { + // Intentionally empty. +} +message ControllerPublishVolumeRequest { + // The ID of the volume to be used on a node. + // This field is REQUIRED. + string volume_id = 1; + + // The ID of the node. This field is REQUIRED. The CO SHALL set this + // field to match the node ID returned by `NodeGetInfo`. + string node_id = 2; + + // Volume capability describing how the CO intends to use this volume. + // SP MUST ensure the CO can use the published volume as described. + // Otherwise SP MUST return the appropriate gRPC error code. + // This is a REQUIRED field. + VolumeCapability volume_capability = 3; + + // Indicates SP MUST publish the volume in readonly mode. + // CO MUST set this field to false if SP does not have the + // PUBLISH_READONLY controller capability. + // This is a REQUIRED field. + bool readonly = 4; + + // Secrets required by plugin to complete controller publish volume + // request. This field is OPTIONAL. Refer to the + // `Secrets Requirements` section on how to use this field. + map secrets = 5 [(csi.v1.csi_secret) = true]; + + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + map volume_context = 6; +} + +message ControllerPublishVolumeResponse { + // Opaque static publish properties of the volume. SP MAY use this + // field to ensure subsequent `NodeStageVolume` or `NodePublishVolume` + // calls calls have contextual information. + // The contents of this field SHALL be opaque to a CO. + // The contents of this field SHALL NOT be mutable. + // The contents of this field SHALL be safe for the CO to cache. + // The contents of this field SHOULD NOT contain sensitive + // information. + // The contents of this field SHOULD NOT be used for uniquely + // identifying a volume. The `volume_id` alone SHOULD be sufficient to + // identify the volume. + // This field is OPTIONAL and when present MUST be passed to + // subsequent `NodeStageVolume` or `NodePublishVolume` calls + map publish_context = 1; +} +message ControllerUnpublishVolumeRequest { + // The ID of the volume. This field is REQUIRED. + string volume_id = 1; + + // The ID of the node. This field is OPTIONAL. The CO SHOULD set this + // field to match the node ID returned by `NodeGetInfo` or leave it + // unset. If the value is set, the SP MUST unpublish the volume from + // the specified node. If the value is unset, the SP MUST unpublish + // the volume from all nodes it is published to. + string node_id = 2; + + // Secrets required by plugin to complete controller unpublish volume + // request. This SHOULD be the same secrets passed to the + // ControllerPublishVolume call for the specified volume. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 3 [(csi.v1.csi_secret) = true]; +} + +message ControllerUnpublishVolumeResponse { + // Intentionally empty. +} +message ValidateVolumeCapabilitiesRequest { + // The ID of the volume to check. This field is REQUIRED. + string volume_id = 1; + + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + map volume_context = 2; + + // The capabilities that the CO wants to check for the volume. This + // call SHALL return "confirmed" only if all the volume capabilities + // specified below are supported. This field is REQUIRED. + repeated VolumeCapability volume_capabilities = 3; + + // See CreateVolumeRequest.parameters. + // This field is OPTIONAL. + map parameters = 4; + + // Secrets required by plugin to complete volume validation request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 5 [(csi.v1.csi_secret) = true]; +} + +message ValidateVolumeCapabilitiesResponse { + message Confirmed { + // Volume context validated by the plugin. + // This field is OPTIONAL. + map volume_context = 1; + + // Volume capabilities supported by the plugin. + // This field is REQUIRED. + repeated VolumeCapability volume_capabilities = 2; + + // The volume creation parameters validated by the plugin. + // This field is OPTIONAL. + map parameters = 3; + } + + // Confirmed indicates to the CO the set of capabilities that the + // plugin has validated. This field SHALL only be set to a non-empty + // value for successful validation responses. + // For successful validation responses, the CO SHALL compare the + // fields of this message to the originally requested capabilities in + // order to guard against an older plugin reporting "valid" for newer + // capability fields that it does not yet understand. + // This field is OPTIONAL. + Confirmed confirmed = 1; + + // Message to the CO if `confirmed` above is empty. This field is + // OPTIONAL. + // An empty string is equal to an unspecified field value. + string message = 2; +} +message ListVolumesRequest { + // If specified (non-zero value), the Plugin MUST NOT return more + // entries than this number in the response. If the actual number of + // entries is more than this number, the Plugin MUST set `next_token` + // in the response which can be used to get the next page of entries + // in the subsequent `ListVolumes` call. This field is OPTIONAL. If + // not specified (zero value), it means there is no restriction on the + // number of entries that can be returned. + // The value of this field MUST NOT be negative. + int32 max_entries = 1; + + // A token to specify where to start paginating. Set this field to + // `next_token` returned by a previous `ListVolumes` call to get the + // next page of entries. This field is OPTIONAL. + // An empty string is equal to an unspecified field value. + string starting_token = 2; +} + +message ListVolumesResponse { + message Entry { + Volume volume = 1; + } + + repeated Entry entries = 1; + + // This token allows you to get the next page of entries for + // `ListVolumes` request. If the number of entries is larger than + // `max_entries`, use the `next_token` as a value for the + // `starting_token` field in the next `ListVolumes` request. This + // field is OPTIONAL. + // An empty string is equal to an unspecified field value. + string next_token = 2; +} +message GetCapacityRequest { + // If specified, the Plugin SHALL report the capacity of the storage + // that can be used to provision volumes that satisfy ALL of the + // specified `volume_capabilities`. These are the same + // `volume_capabilities` the CO will use in `CreateVolumeRequest`. + // This field is OPTIONAL. + repeated VolumeCapability volume_capabilities = 1; + + // If specified, the Plugin SHALL report the capacity of the storage + // that can be used to provision volumes with the given Plugin + // specific `parameters`. These are the same `parameters` the CO will + // use in `CreateVolumeRequest`. This field is OPTIONAL. + map parameters = 2; + + // If specified, the Plugin SHALL report the capacity of the storage + // that can be used to provision volumes that in the specified + // `accessible_topology`. This is the same as the + // `accessible_topology` the CO returns in a `CreateVolumeResponse`. + // This field is OPTIONAL. This field SHALL NOT be set unless the + // plugin advertises the VOLUME_ACCESSIBILITY_CONSTRAINTS capability. + Topology accessible_topology = 3; +} + +message GetCapacityResponse { + // The available capacity, in bytes, of the storage that can be used + // to provision volumes. If `volume_capabilities` or `parameters` is + // specified in the request, the Plugin SHALL take those into + // consideration when calculating the available capacity of the + // storage. This field is REQUIRED. + // The value of this field MUST NOT be negative. + int64 available_capacity = 1; +} +message ControllerGetCapabilitiesRequest { + // Intentionally empty. +} + +message ControllerGetCapabilitiesResponse { + // All the capabilities that the controller service supports. This + // field is OPTIONAL. + repeated ControllerServiceCapability capabilities = 1; +} + +// Specifies a capability of the controller service. +message ControllerServiceCapability { + message RPC { + enum Type { + UNKNOWN = 0; + CREATE_DELETE_VOLUME = 1; + PUBLISH_UNPUBLISH_VOLUME = 2; + LIST_VOLUMES = 3; + GET_CAPACITY = 4; + // Currently the only way to consume a snapshot is to create + // a volume from it. Therefore plugins supporting + // CREATE_DELETE_SNAPSHOT MUST support creating volume from + // snapshot. + CREATE_DELETE_SNAPSHOT = 5; + LIST_SNAPSHOTS = 6; + // Plugins supporting volume cloning at the storage level MAY + // report this capability. The source volume MUST be managed by + // the same plugin. Not all volume sources and parameters + // combinations MAY work. + CLONE_VOLUME = 7; + // Indicates the SP supports ControllerPublishVolume.readonly + // field. + PUBLISH_READONLY = 8; + } + + Type type = 1; + } + + oneof type { + // RPC that the controller supports. + RPC rpc = 1; + } +} +message CreateSnapshotRequest { + // The ID of the source volume to be snapshotted. + // This field is REQUIRED. + string source_volume_id = 1; + + // The suggested name for the snapshot. This field is REQUIRED for + // idempotency. + // Any Unicode string that conforms to the length limit is allowed + // except those containing the following banned characters: + // U+0000-U+0008, U+000B, U+000C, U+000E-U+001F, U+007F-U+009F. + // (These are control characters other than commonly used whitespace.) + string name = 2; + + // Secrets required by plugin to complete snapshot creation request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 3 [(csi.v1.csi_secret) = true]; + + // Plugin specific parameters passed in as opaque key-value pairs. + // This field is OPTIONAL. The Plugin is responsible for parsing and + // validating these parameters. COs will treat these as opaque. + // Use cases for opaque parameters: + // - Specify a policy to automatically clean up the snapshot. + // - Specify an expiration date for the snapshot. + // - Specify whether the snapshot is readonly or read/write. + // - Specify if the snapshot should be replicated to some place. + // - Specify primary or secondary for replication systems that + // support snapshotting only on primary. + map parameters = 4; +} + +message CreateSnapshotResponse { + // Contains all attributes of the newly created snapshot that are + // relevant to the CO along with information required by the Plugin + // to uniquely identify the snapshot. This field is REQUIRED. + Snapshot snapshot = 1; +} + +// Information about a specific snapshot. +message Snapshot { + // This is the complete size of the snapshot in bytes. The purpose of + // this field is to give CO guidance on how much space is needed to + // create a volume from this snapshot. The size of the volume MUST NOT + // be less than the size of the source snapshot. This field is + // OPTIONAL. If this field is not set, it indicates that this size is + // unknown. The value of this field MUST NOT be negative and a size of + // zero means it is unspecified. + int64 size_bytes = 1; + + // The identifier for this snapshot, generated by the plugin. + // This field is REQUIRED. + // This field MUST contain enough information to uniquely identify + // this specific snapshot vs all other snapshots supported by this + // plugin. + // This field SHALL be used by the CO in subsequent calls to refer to + // this snapshot. + // The SP is NOT responsible for global uniqueness of snapshot_id + // across multiple SPs. + string snapshot_id = 2; + + // Identity information for the source volume. Note that creating a + // snapshot from a snapshot is not supported here so the source has to + // be a volume. This field is REQUIRED. + string source_volume_id = 3; + + // Timestamp when the point-in-time snapshot is taken on the storage + // system. This field is REQUIRED. + .google.protobuf.Timestamp creation_time = 4; + + // Indicates if a snapshot is ready to use as a + // `volume_content_source` in a `CreateVolumeRequest`. The default + // value is false. This field is REQUIRED. + bool ready_to_use = 5; +} +message DeleteSnapshotRequest { + // The ID of the snapshot to be deleted. + // This field is REQUIRED. + string snapshot_id = 1; + + // Secrets required by plugin to complete snapshot deletion request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 2 [(csi.v1.csi_secret) = true]; +} + +message DeleteSnapshotResponse {} +// List all snapshots on the storage system regardless of how they were +// created. +message ListSnapshotsRequest { + // If specified (non-zero value), the Plugin MUST NOT return more + // entries than this number in the response. If the actual number of + // entries is more than this number, the Plugin MUST set `next_token` + // in the response which can be used to get the next page of entries + // in the subsequent `ListSnapshots` call. This field is OPTIONAL. If + // not specified (zero value), it means there is no restriction on the + // number of entries that can be returned. + // The value of this field MUST NOT be negative. + int32 max_entries = 1; + + // A token to specify where to start paginating. Set this field to + // `next_token` returned by a previous `ListSnapshots` call to get the + // next page of entries. This field is OPTIONAL. + // An empty string is equal to an unspecified field value. + string starting_token = 2; + + // Identity information for the source volume. This field is OPTIONAL. + // It can be used to list snapshots by volume. + string source_volume_id = 3; + + // Identity information for a specific snapshot. This field is + // OPTIONAL. It can be used to list only a specific snapshot. + // ListSnapshots will return with current snapshot information + // and will not block if the snapshot is being processed after + // it is cut. + string snapshot_id = 4; +} + +message ListSnapshotsResponse { + message Entry { + Snapshot snapshot = 1; + } + + repeated Entry entries = 1; + + // This token allows you to get the next page of entries for + // `ListSnapshots` request. If the number of entries is larger than + // `max_entries`, use the `next_token` as a value for the + // `starting_token` field in the next `ListSnapshots` request. This + // field is OPTIONAL. + // An empty string is equal to an unspecified field value. + string next_token = 2; +} +message NodeStageVolumeRequest { + // The ID of the volume to publish. This field is REQUIRED. + string volume_id = 1; + + // The CO SHALL set this field to the value returned by + // `ControllerPublishVolume` if the corresponding Controller Plugin + // has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be + // left unset if the corresponding Controller Plugin does not have + // this capability. This is an OPTIONAL field. + map publish_context = 2; + + // The path to which the volume MAY be staged. It MUST be an + // absolute path in the root filesystem of the process serving this + // request, and MUST be a directory. The CO SHALL ensure that there + // is only one `staging_target_path` per volume. The CO SHALL ensure + // that the path is directory and that the process serving the + // request has `read` and `write` permission to that directory. The + // CO SHALL be responsible for creating the directory if it does not + // exist. + // This is a REQUIRED field. + string staging_target_path = 3; + + // Volume capability describing how the CO intends to use this volume. + // SP MUST ensure the CO can use the staged volume as described. + // Otherwise SP MUST return the appropriate gRPC error code. + // This is a REQUIRED field. + VolumeCapability volume_capability = 4; + + // Secrets required by plugin to complete node stage volume request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 5 [(csi.v1.csi_secret) = true]; + + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + map volume_context = 6; +} + +message NodeStageVolumeResponse { + // Intentionally empty. +} +message NodeUnstageVolumeRequest { + // The ID of the volume. This field is REQUIRED. + string volume_id = 1; + + // The path at which the volume was staged. It MUST be an absolute + // path in the root filesystem of the process serving this request. + // This is a REQUIRED field. + string staging_target_path = 2; +} + +message NodeUnstageVolumeResponse { + // Intentionally empty. +} +message NodePublishVolumeRequest { + // The ID of the volume to publish. This field is REQUIRED. + string volume_id = 1; + + // The CO SHALL set this field to the value returned by + // `ControllerPublishVolume` if the corresponding Controller Plugin + // has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be + // left unset if the corresponding Controller Plugin does not have + // this capability. This is an OPTIONAL field. + map publish_context = 2; + + // The path to which the volume was staged by `NodeStageVolume`. + // It MUST be an absolute path in the root filesystem of the process + // serving this request. + // It MUST be set if the Node Plugin implements the + // `STAGE_UNSTAGE_VOLUME` node capability. + // This is an OPTIONAL field. + string staging_target_path = 3; + + // The path to which the volume will be published. It MUST be an + // absolute path in the root filesystem of the process serving this + // request. The CO SHALL ensure uniqueness of target_path per volume. + // The CO SHALL ensure that the parent directory of this path exists + // and that the process serving the request has `read` and `write` + // permissions to that parent directory. + // For volumes with an access type of block, the SP SHALL place the + // block device at target_path. + // For volumes with an access type of mount, the SP SHALL place the + // mounted directory at target_path. + // Creation of target_path is the responsibility of the SP. + // This is a REQUIRED field. + string target_path = 4; + + // Volume capability describing how the CO intends to use this volume. + // SP MUST ensure the CO can use the published volume as described. + // Otherwise SP MUST return the appropriate gRPC error code. + // This is a REQUIRED field. + VolumeCapability volume_capability = 5; + + // Indicates SP MUST publish the volume in readonly mode. + // This field is REQUIRED. + bool readonly = 6; + + // Secrets required by plugin to complete node publish volume request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + map secrets = 7 [(csi.v1.csi_secret) = true]; + + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + map volume_context = 8; +} + +message NodePublishVolumeResponse { + // Intentionally empty. +} +message NodeUnpublishVolumeRequest { + // The ID of the volume. This field is REQUIRED. + string volume_id = 1; + + // The path at which the volume was published. It MUST be an absolute + // path in the root filesystem of the process serving this request. + // The SP MUST delete the file or directory it created at this path. + // This is a REQUIRED field. + string target_path = 2; +} + +message NodeUnpublishVolumeResponse { + // Intentionally empty. +} +message NodeGetVolumeStatsRequest { + // The ID of the volume. This field is REQUIRED. + string volume_id = 1; + + // It can be any valid path where volume was previously + // staged or published. + // It MUST be an absolute path in the root filesystem of + // the process serving this request. + // This is a REQUIRED field. + string volume_path = 2; +} + +message NodeGetVolumeStatsResponse { + // This field is OPTIONAL. + repeated VolumeUsage usage = 1; +} + +message VolumeUsage { + enum Unit { + UNKNOWN = 0; + BYTES = 1; + INODES = 2; + } + // The available capacity in specified Unit. This field is OPTIONAL. + // The value of this field MUST NOT be negative. + int64 available = 1; + + // The total capacity in specified Unit. This field is REQUIRED. + // The value of this field MUST NOT be negative. + int64 total = 2; + + // The used capacity in specified Unit. This field is OPTIONAL. + // The value of this field MUST NOT be negative. + int64 used = 3; + + // Units by which values are measured. This field is REQUIRED. + Unit unit = 4; +} +message NodeGetCapabilitiesRequest { + // Intentionally empty. +} + +message NodeGetCapabilitiesResponse { + // All the capabilities that the node service supports. This field + // is OPTIONAL. + repeated NodeServiceCapability capabilities = 1; +} + +// Specifies a capability of the node service. +message NodeServiceCapability { + message RPC { + enum Type { + UNKNOWN = 0; + STAGE_UNSTAGE_VOLUME = 1; + // If Plugin implements GET_VOLUME_STATS capability + // then it MUST implement NodeGetVolumeStats RPC + // call for fetching volume statistics. + GET_VOLUME_STATS = 2; + } + + Type type = 1; + } + + oneof type { + // RPC that the controller supports. + RPC rpc = 1; + } +} +message NodeGetInfoRequest { +} + +message NodeGetInfoResponse { + // The identifier of the node as understood by the SP. + // This field is REQUIRED. + // This field MUST contain enough information to uniquely identify + // this specific node vs all other nodes supported by this plugin. + // This field SHALL be used by the CO in subsequent calls, including + // `ControllerPublishVolume`, to refer to this node. + // The SP is NOT responsible for global uniqueness of node_id across + // multiple SPs. + string node_id = 1; + + // Maximum number of volumes that controller can publish to the node. + // If value is not set or zero CO SHALL decide how many volumes of + // this type can be published by the controller to the node. The + // plugin MUST NOT set negative values here. + // This field is OPTIONAL. + int64 max_volumes_per_node = 2; + + // Specifies where (regions, zones, racks, etc.) the node is + // accessible from. + // A plugin that returns this field MUST also set the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability. + // COs MAY use this information along with the topology information + // returned in CreateVolumeResponse to ensure that a given volume is + // accessible from a given node when scheduling workloads. + // This field is OPTIONAL. If it is not specified, the CO MAY assume + // the node is not subject to any topological constraint, and MAY + // schedule workloads that reference any volume V, such that there are + // no topological constraints declared for V. + // + // Example 1: + // accessible_topology = + // {"region": "R1", "zone": "R2"} + // Indicates the node exists within the "region" "R1" and the "zone" + // "Z2". + Topology accessible_topology = 3; +} diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest/csitest.pb.go b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest/csitest.pb.go new file mode 100644 index 000000000..786c1d414 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest/csitest.pb.go @@ -0,0 +1,5326 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest.proto + +package csitest + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "github.com/golang/protobuf/protoc-gen-go/descriptor" +import timestamp "github.com/golang/protobuf/ptypes/timestamp" +import wrappers "github.com/golang/protobuf/ptypes/wrappers" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type PluginCapability_Service_Type int32 + +const ( + PluginCapability_Service_UNKNOWN PluginCapability_Service_Type = 0 + // CONTROLLER_SERVICE indicates that the Plugin provides RPCs for + // the ControllerService. Plugins SHOULD provide this capability. + // In rare cases certain plugins MAY wish to omit the + // ControllerService entirely from their implementation, but such + // SHOULD NOT be the common case. + // The presence of this capability determines whether the CO will + // attempt to invoke the REQUIRED ControllerService RPCs, as well + // as specific RPCs as indicated by ControllerGetCapabilities. + PluginCapability_Service_CONTROLLER_SERVICE PluginCapability_Service_Type = 1 + // VOLUME_ACCESSIBILITY_CONSTRAINTS indicates that the volumes for + // this plugin MAY NOT be equally accessible by all nodes in the + // cluster. The CO MUST use the topology information returned by + // CreateVolumeRequest along with the topology information + // returned by NodeGetInfo to ensure that a given volume is + // accessible from a given node when scheduling workloads. + PluginCapability_Service_VOLUME_ACCESSIBILITY_CONSTRAINTS PluginCapability_Service_Type = 2 +) + +var PluginCapability_Service_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CONTROLLER_SERVICE", + 2: "VOLUME_ACCESSIBILITY_CONSTRAINTS", +} +var PluginCapability_Service_Type_value = map[string]int32{ + "UNKNOWN": 0, + "CONTROLLER_SERVICE": 1, + "VOLUME_ACCESSIBILITY_CONSTRAINTS": 2, +} + +func (x PluginCapability_Service_Type) String() string { + return proto.EnumName(PluginCapability_Service_Type_name, int32(x)) +} +func (PluginCapability_Service_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{4, 0, 0} +} + +type VolumeCapability_AccessMode_Mode int32 + +const ( + VolumeCapability_AccessMode_UNKNOWN VolumeCapability_AccessMode_Mode = 0 + // Can only be published once as read/write on a single node, at + // any given time. + VolumeCapability_AccessMode_SINGLE_NODE_WRITER VolumeCapability_AccessMode_Mode = 1 + // Can only be published once as readonly on a single node, at + // any given time. + VolumeCapability_AccessMode_SINGLE_NODE_READER_ONLY VolumeCapability_AccessMode_Mode = 2 + // Can be published as readonly at multiple nodes simultaneously. + VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY VolumeCapability_AccessMode_Mode = 3 + // Can be published at multiple nodes simultaneously. Only one of + // the node can be used as read/write. The rest will be readonly. + VolumeCapability_AccessMode_MULTI_NODE_SINGLE_WRITER VolumeCapability_AccessMode_Mode = 4 + // Can be published as read/write at multiple nodes + // simultaneously. + VolumeCapability_AccessMode_MULTI_NODE_MULTI_WRITER VolumeCapability_AccessMode_Mode = 5 +) + +var VolumeCapability_AccessMode_Mode_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SINGLE_NODE_WRITER", + 2: "SINGLE_NODE_READER_ONLY", + 3: "MULTI_NODE_READER_ONLY", + 4: "MULTI_NODE_SINGLE_WRITER", + 5: "MULTI_NODE_MULTI_WRITER", +} +var VolumeCapability_AccessMode_Mode_value = map[string]int32{ + "UNKNOWN": 0, + "SINGLE_NODE_WRITER": 1, + "SINGLE_NODE_READER_ONLY": 2, + "MULTI_NODE_READER_ONLY": 3, + "MULTI_NODE_SINGLE_WRITER": 4, + "MULTI_NODE_MULTI_WRITER": 5, +} + +func (x VolumeCapability_AccessMode_Mode) String() string { + return proto.EnumName(VolumeCapability_AccessMode_Mode_name, int32(x)) +} +func (VolumeCapability_AccessMode_Mode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{10, 2, 0} +} + +type ControllerServiceCapability_RPC_Type int32 + +const ( + ControllerServiceCapability_RPC_UNKNOWN ControllerServiceCapability_RPC_Type = 0 + ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME ControllerServiceCapability_RPC_Type = 1 + ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME ControllerServiceCapability_RPC_Type = 2 + ControllerServiceCapability_RPC_LIST_VOLUMES ControllerServiceCapability_RPC_Type = 3 + ControllerServiceCapability_RPC_GET_CAPACITY ControllerServiceCapability_RPC_Type = 4 + // Currently the only way to consume a snapshot is to create + // a volume from it. Therefore plugins supporting + // CREATE_DELETE_SNAPSHOT MUST support creating volume from + // snapshot. + ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT ControllerServiceCapability_RPC_Type = 5 + ControllerServiceCapability_RPC_LIST_SNAPSHOTS ControllerServiceCapability_RPC_Type = 6 + // Plugins supporting volume cloning at the storage level MAY + // report this capability. The source volume MUST be managed by + // the same plugin. Not all volume sources and parameters + // combinations MAY work. + ControllerServiceCapability_RPC_CLONE_VOLUME ControllerServiceCapability_RPC_Type = 7 + // Indicates the SP supports ControllerPublishVolume.readonly + // field. + ControllerServiceCapability_RPC_PUBLISH_READONLY ControllerServiceCapability_RPC_Type = 8 +) + +var ControllerServiceCapability_RPC_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CREATE_DELETE_VOLUME", + 2: "PUBLISH_UNPUBLISH_VOLUME", + 3: "LIST_VOLUMES", + 4: "GET_CAPACITY", + 5: "CREATE_DELETE_SNAPSHOT", + 6: "LIST_SNAPSHOTS", + 7: "CLONE_VOLUME", + 8: "PUBLISH_READONLY", +} +var ControllerServiceCapability_RPC_Type_value = map[string]int32{ + "UNKNOWN": 0, + "CREATE_DELETE_VOLUME": 1, + "PUBLISH_UNPUBLISH_VOLUME": 2, + "LIST_VOLUMES": 3, + "GET_CAPACITY": 4, + "CREATE_DELETE_SNAPSHOT": 5, + "LIST_SNAPSHOTS": 6, + "CLONE_VOLUME": 7, + "PUBLISH_READONLY": 8, +} + +func (x ControllerServiceCapability_RPC_Type) String() string { + return proto.EnumName(ControllerServiceCapability_RPC_Type_name, int32(x)) +} +func (ControllerServiceCapability_RPC_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{29, 0, 0} +} + +type VolumeUsage_Unit int32 + +const ( + VolumeUsage_UNKNOWN VolumeUsage_Unit = 0 + VolumeUsage_BYTES VolumeUsage_Unit = 1 + VolumeUsage_INODES VolumeUsage_Unit = 2 +) + +var VolumeUsage_Unit_name = map[int32]string{ + 0: "UNKNOWN", + 1: "BYTES", + 2: "INODES", +} +var VolumeUsage_Unit_value = map[string]int32{ + "UNKNOWN": 0, + "BYTES": 1, + "INODES": 2, +} + +func (x VolumeUsage_Unit) String() string { + return proto.EnumName(VolumeUsage_Unit_name, int32(x)) +} +func (VolumeUsage_Unit) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{47, 0} +} + +type NodeServiceCapability_RPC_Type int32 + +const ( + NodeServiceCapability_RPC_UNKNOWN NodeServiceCapability_RPC_Type = 0 + NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME NodeServiceCapability_RPC_Type = 1 + // If Plugin implements GET_VOLUME_STATS capability + // then it MUST implement NodeGetVolumeStats RPC + // call for fetching volume statistics. + NodeServiceCapability_RPC_GET_VOLUME_STATS NodeServiceCapability_RPC_Type = 2 +) + +var NodeServiceCapability_RPC_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "STAGE_UNSTAGE_VOLUME", + 2: "GET_VOLUME_STATS", +} +var NodeServiceCapability_RPC_Type_value = map[string]int32{ + "UNKNOWN": 0, + "STAGE_UNSTAGE_VOLUME": 1, + "GET_VOLUME_STATS": 2, +} + +func (x NodeServiceCapability_RPC_Type) String() string { + return proto.EnumName(NodeServiceCapability_RPC_Type_name, int32(x)) +} +func (NodeServiceCapability_RPC_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{50, 0, 0} +} + +type GetPluginInfoRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetPluginInfoRequest) Reset() { *m = GetPluginInfoRequest{} } +func (m *GetPluginInfoRequest) String() string { return proto.CompactTextString(m) } +func (*GetPluginInfoRequest) ProtoMessage() {} +func (*GetPluginInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{0} +} +func (m *GetPluginInfoRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetPluginInfoRequest.Unmarshal(m, b) +} +func (m *GetPluginInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetPluginInfoRequest.Marshal(b, m, deterministic) +} +func (dst *GetPluginInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPluginInfoRequest.Merge(dst, src) +} +func (m *GetPluginInfoRequest) XXX_Size() int { + return xxx_messageInfo_GetPluginInfoRequest.Size(m) +} +func (m *GetPluginInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetPluginInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPluginInfoRequest proto.InternalMessageInfo + +type GetPluginInfoResponse struct { + // The name MUST follow domain name notation format + // (https://tools.ietf.org/html/rfc1035#section-2.3.1). It SHOULD + // include the plugin's host company name and the plugin name, + // to minimize the possibility of collisions. It MUST be 63 + // characters or less, beginning and ending with an alphanumeric + // character ([a-z0-9A-Z]) with dashes (-), dots (.), and + // alphanumerics between. This field is REQUIRED. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // This field is REQUIRED. Value of this field is opaque to the CO. + VendorVersion string `protobuf:"bytes,2,opt,name=vendor_version,json=vendorVersion,proto3" json:"vendor_version,omitempty"` + // This field is OPTIONAL. Values are opaque to the CO. + Manifest map[string]string `protobuf:"bytes,3,rep,name=manifest,proto3" json:"manifest,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetPluginInfoResponse) Reset() { *m = GetPluginInfoResponse{} } +func (m *GetPluginInfoResponse) String() string { return proto.CompactTextString(m) } +func (*GetPluginInfoResponse) ProtoMessage() {} +func (*GetPluginInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{1} +} +func (m *GetPluginInfoResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetPluginInfoResponse.Unmarshal(m, b) +} +func (m *GetPluginInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetPluginInfoResponse.Marshal(b, m, deterministic) +} +func (dst *GetPluginInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPluginInfoResponse.Merge(dst, src) +} +func (m *GetPluginInfoResponse) XXX_Size() int { + return xxx_messageInfo_GetPluginInfoResponse.Size(m) +} +func (m *GetPluginInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetPluginInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPluginInfoResponse proto.InternalMessageInfo + +func (m *GetPluginInfoResponse) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *GetPluginInfoResponse) GetVendorVersion() string { + if m != nil { + return m.VendorVersion + } + return "" +} + +func (m *GetPluginInfoResponse) GetManifest() map[string]string { + if m != nil { + return m.Manifest + } + return nil +} + +type GetPluginCapabilitiesRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetPluginCapabilitiesRequest) Reset() { *m = GetPluginCapabilitiesRequest{} } +func (m *GetPluginCapabilitiesRequest) String() string { return proto.CompactTextString(m) } +func (*GetPluginCapabilitiesRequest) ProtoMessage() {} +func (*GetPluginCapabilitiesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{2} +} +func (m *GetPluginCapabilitiesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetPluginCapabilitiesRequest.Unmarshal(m, b) +} +func (m *GetPluginCapabilitiesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetPluginCapabilitiesRequest.Marshal(b, m, deterministic) +} +func (dst *GetPluginCapabilitiesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPluginCapabilitiesRequest.Merge(dst, src) +} +func (m *GetPluginCapabilitiesRequest) XXX_Size() int { + return xxx_messageInfo_GetPluginCapabilitiesRequest.Size(m) +} +func (m *GetPluginCapabilitiesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetPluginCapabilitiesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPluginCapabilitiesRequest proto.InternalMessageInfo + +type GetPluginCapabilitiesResponse struct { + // All the capabilities that the controller service supports. This + // field is OPTIONAL. + Capabilities []*PluginCapability `protobuf:"bytes,1,rep,name=capabilities,proto3" json:"capabilities,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetPluginCapabilitiesResponse) Reset() { *m = GetPluginCapabilitiesResponse{} } +func (m *GetPluginCapabilitiesResponse) String() string { return proto.CompactTextString(m) } +func (*GetPluginCapabilitiesResponse) ProtoMessage() {} +func (*GetPluginCapabilitiesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{3} +} +func (m *GetPluginCapabilitiesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetPluginCapabilitiesResponse.Unmarshal(m, b) +} +func (m *GetPluginCapabilitiesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetPluginCapabilitiesResponse.Marshal(b, m, deterministic) +} +func (dst *GetPluginCapabilitiesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPluginCapabilitiesResponse.Merge(dst, src) +} +func (m *GetPluginCapabilitiesResponse) XXX_Size() int { + return xxx_messageInfo_GetPluginCapabilitiesResponse.Size(m) +} +func (m *GetPluginCapabilitiesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetPluginCapabilitiesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPluginCapabilitiesResponse proto.InternalMessageInfo + +func (m *GetPluginCapabilitiesResponse) GetCapabilities() []*PluginCapability { + if m != nil { + return m.Capabilities + } + return nil +} + +// Specifies a capability of the plugin. +type PluginCapability struct { + // Types that are valid to be assigned to Type: + // *PluginCapability_Service_ + Type isPluginCapability_Type `protobuf_oneof:"type"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PluginCapability) Reset() { *m = PluginCapability{} } +func (m *PluginCapability) String() string { return proto.CompactTextString(m) } +func (*PluginCapability) ProtoMessage() {} +func (*PluginCapability) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{4} +} +func (m *PluginCapability) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PluginCapability.Unmarshal(m, b) +} +func (m *PluginCapability) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PluginCapability.Marshal(b, m, deterministic) +} +func (dst *PluginCapability) XXX_Merge(src proto.Message) { + xxx_messageInfo_PluginCapability.Merge(dst, src) +} +func (m *PluginCapability) XXX_Size() int { + return xxx_messageInfo_PluginCapability.Size(m) +} +func (m *PluginCapability) XXX_DiscardUnknown() { + xxx_messageInfo_PluginCapability.DiscardUnknown(m) +} + +var xxx_messageInfo_PluginCapability proto.InternalMessageInfo + +type isPluginCapability_Type interface { + isPluginCapability_Type() +} + +type PluginCapability_Service_ struct { + Service *PluginCapability_Service `protobuf:"bytes,1,opt,name=service,proto3,oneof"` +} + +func (*PluginCapability_Service_) isPluginCapability_Type() {} + +func (m *PluginCapability) GetType() isPluginCapability_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *PluginCapability) GetService() *PluginCapability_Service { + if x, ok := m.GetType().(*PluginCapability_Service_); ok { + return x.Service + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*PluginCapability) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _PluginCapability_OneofMarshaler, _PluginCapability_OneofUnmarshaler, _PluginCapability_OneofSizer, []interface{}{ + (*PluginCapability_Service_)(nil), + } +} + +func _PluginCapability_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*PluginCapability) + // type + switch x := m.Type.(type) { + case *PluginCapability_Service_: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Service); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("PluginCapability.Type has unexpected type %T", x) + } + return nil +} + +func _PluginCapability_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*PluginCapability) + switch tag { + case 1: // type.service + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PluginCapability_Service) + err := b.DecodeMessage(msg) + m.Type = &PluginCapability_Service_{msg} + return true, err + default: + return false, nil + } +} + +func _PluginCapability_OneofSizer(msg proto.Message) (n int) { + m := msg.(*PluginCapability) + // type + switch x := m.Type.(type) { + case *PluginCapability_Service_: + s := proto.Size(x.Service) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type PluginCapability_Service struct { + Type PluginCapability_Service_Type `protobuf:"varint,1,opt,name=type,proto3,enum=csitest.v1.PluginCapability_Service_Type" json:"type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PluginCapability_Service) Reset() { *m = PluginCapability_Service{} } +func (m *PluginCapability_Service) String() string { return proto.CompactTextString(m) } +func (*PluginCapability_Service) ProtoMessage() {} +func (*PluginCapability_Service) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{4, 0} +} +func (m *PluginCapability_Service) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PluginCapability_Service.Unmarshal(m, b) +} +func (m *PluginCapability_Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PluginCapability_Service.Marshal(b, m, deterministic) +} +func (dst *PluginCapability_Service) XXX_Merge(src proto.Message) { + xxx_messageInfo_PluginCapability_Service.Merge(dst, src) +} +func (m *PluginCapability_Service) XXX_Size() int { + return xxx_messageInfo_PluginCapability_Service.Size(m) +} +func (m *PluginCapability_Service) XXX_DiscardUnknown() { + xxx_messageInfo_PluginCapability_Service.DiscardUnknown(m) +} + +var xxx_messageInfo_PluginCapability_Service proto.InternalMessageInfo + +func (m *PluginCapability_Service) GetType() PluginCapability_Service_Type { + if m != nil { + return m.Type + } + return PluginCapability_Service_UNKNOWN +} + +type ProbeRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProbeRequest) Reset() { *m = ProbeRequest{} } +func (m *ProbeRequest) String() string { return proto.CompactTextString(m) } +func (*ProbeRequest) ProtoMessage() {} +func (*ProbeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{5} +} +func (m *ProbeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProbeRequest.Unmarshal(m, b) +} +func (m *ProbeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProbeRequest.Marshal(b, m, deterministic) +} +func (dst *ProbeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProbeRequest.Merge(dst, src) +} +func (m *ProbeRequest) XXX_Size() int { + return xxx_messageInfo_ProbeRequest.Size(m) +} +func (m *ProbeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ProbeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ProbeRequest proto.InternalMessageInfo + +type ProbeResponse struct { + // Readiness allows a plugin to report its initialization status back + // to the CO. Initialization for some plugins MAY be time consuming + // and it is important for a CO to distinguish between the following + // cases: + // + // 1) The plugin is in an unhealthy state and MAY need restarting. In + // this case a gRPC error code SHALL be returned. + // 2) The plugin is still initializing, but is otherwise perfectly + // healthy. In this case a successful response SHALL be returned + // with a readiness value of `false`. Calls to the plugin's + // Controller and/or Node services MAY fail due to an incomplete + // initialization state. + // 3) The plugin has finished initializing and is ready to service + // calls to its Controller and/or Node services. A successful + // response is returned with a readiness value of `true`. + // + // This field is OPTIONAL. If not present, the caller SHALL assume + // that the plugin is in a ready state and is accepting calls to its + // Controller and/or Node services (according to the plugin's reported + // capabilities). + Ready *wrappers.BoolValue `protobuf:"bytes,1,opt,name=ready,proto3" json:"ready,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProbeResponse) Reset() { *m = ProbeResponse{} } +func (m *ProbeResponse) String() string { return proto.CompactTextString(m) } +func (*ProbeResponse) ProtoMessage() {} +func (*ProbeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{6} +} +func (m *ProbeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProbeResponse.Unmarshal(m, b) +} +func (m *ProbeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProbeResponse.Marshal(b, m, deterministic) +} +func (dst *ProbeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProbeResponse.Merge(dst, src) +} +func (m *ProbeResponse) XXX_Size() int { + return xxx_messageInfo_ProbeResponse.Size(m) +} +func (m *ProbeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ProbeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ProbeResponse proto.InternalMessageInfo + +func (m *ProbeResponse) GetReady() *wrappers.BoolValue { + if m != nil { + return m.Ready + } + return nil +} + +type CreateVolumeRequest struct { + // The suggested name for the storage space. This field is REQUIRED. + // It serves two purposes: + // 1) Idempotency - This name is generated by the CO to achieve + // idempotency. The Plugin SHOULD ensure that multiple + // `CreateVolume` calls for the same name do not result in more + // than one piece of storage provisioned corresponding to that + // name. If a Plugin is unable to enforce idempotency, the CO's + // error recovery logic could result in multiple (unused) volumes + // being provisioned. + // In the case of error, the CO MUST handle the gRPC error codes + // per the recovery behavior defined in the "CreateVolume Errors" + // section below. + // The CO is responsible for cleaning up volumes it provisioned + // that it no longer needs. If the CO is uncertain whether a volume + // was provisioned or not when a `CreateVolume` call fails, the CO + // MAY call `CreateVolume` again, with the same name, to ensure the + // volume exists and to retrieve the volume's `volume_id` (unless + // otherwise prohibited by "CreateVolume Errors"). + // 2) Suggested name - Some storage systems allow callers to specify + // an identifier by which to refer to the newly provisioned + // storage. If a storage system supports this, it can optionally + // use this name as the identifier for the new volume. + // Any Unicode string that conforms to the length limit is allowed + // except those containing the following banned characters: + // U+0000-U+0008, U+000B, U+000C, U+000E-U+001F, U+007F-U+009F. + // (These are control characters other than commonly used whitespace.) + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // This field is OPTIONAL. This allows the CO to specify the capacity + // requirement of the volume to be provisioned. If not specified, the + // Plugin MAY choose an implementation-defined capacity range. If + // specified it MUST always be honored, even when creating volumes + // from a source; which MAY force some backends to internally extend + // the volume after creating it. + CapacityRange *CapacityRange `protobuf:"bytes,2,opt,name=capacity_range,json=capacityRange,proto3" json:"capacity_range,omitempty"` + // The capabilities that the provisioned volume MUST have. SP MUST + // provision a volume that will satisfy ALL of the capabilities + // specified in this list. Otherwise SP MUST return the appropriate + // gRPC error code. + // The Plugin MUST assume that the CO MAY use the provisioned volume + // with ANY of the capabilities specified in this list. + // For example, a CO MAY specify two volume capabilities: one with + // access mode SINGLE_NODE_WRITER and another with access mode + // MULTI_NODE_READER_ONLY. In this case, the SP MUST verify that the + // provisioned volume can be used in either mode. + // This also enables the CO to do early validation: If ANY of the + // specified volume capabilities are not supported by the SP, the call + // MUST return the appropriate gRPC error code. + // This field is REQUIRED. + VolumeCapabilities []*VolumeCapability `protobuf:"bytes,3,rep,name=volume_capabilities,json=volumeCapabilities,proto3" json:"volume_capabilities,omitempty"` + // Plugin specific parameters passed in as opaque key-value pairs. + // This field is OPTIONAL. The Plugin is responsible for parsing and + // validating these parameters. COs will treat these as opaque. + Parameters map[string]string `protobuf:"bytes,4,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Secrets required by plugin to complete volume creation request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. Renamed to test whether secret + // stripping is really based on the csi_secret option. + Seecreets map[string]string `protobuf:"bytes,5,rep,name=seecreets,proto3" json:"seecreets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // If specified, the new volume will be pre-populated with data from + // this source. This field is OPTIONAL. + VolumeContentSource *VolumeContentSource `protobuf:"bytes,6,opt,name=volume_content_source,json=volumeContentSource,proto3" json:"volume_content_source,omitempty"` + // Specifies where (regions, zones, racks, etc.) the provisioned + // volume MUST be accessible from. + // An SP SHALL advertise the requirements for topological + // accessibility information in documentation. COs SHALL only specify + // topological accessibility information supported by the SP. + // This field is OPTIONAL. + // This field SHALL NOT be specified unless the SP has the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability. + // If this field is not specified and the SP has the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability, the SP MAY + // choose where the provisioned volume is accessible from. + AccessibilityRequirements *TopologyRequirement `protobuf:"bytes,7,opt,name=accessibility_requirements,json=accessibilityRequirements,proto3" json:"accessibility_requirements,omitempty"` + // A secret value that isn't a string map. + NewSecretInt int64 `protobuf:"varint,8,opt,name=new_secret_int,json=newSecretInt,proto3" json:"new_secret_int,omitempty"` + // We must recurse into maps. + MaybeSecretMap map[int64]*VolumeCapability `protobuf:"bytes,9,rep,name=maybe_secret_map,json=maybeSecretMap,proto3" json:"maybe_secret_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateVolumeRequest) Reset() { *m = CreateVolumeRequest{} } +func (m *CreateVolumeRequest) String() string { return proto.CompactTextString(m) } +func (*CreateVolumeRequest) ProtoMessage() {} +func (*CreateVolumeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{7} +} +func (m *CreateVolumeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateVolumeRequest.Unmarshal(m, b) +} +func (m *CreateVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateVolumeRequest.Marshal(b, m, deterministic) +} +func (dst *CreateVolumeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateVolumeRequest.Merge(dst, src) +} +func (m *CreateVolumeRequest) XXX_Size() int { + return xxx_messageInfo_CreateVolumeRequest.Size(m) +} +func (m *CreateVolumeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateVolumeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateVolumeRequest proto.InternalMessageInfo + +func (m *CreateVolumeRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateVolumeRequest) GetCapacityRange() *CapacityRange { + if m != nil { + return m.CapacityRange + } + return nil +} + +func (m *CreateVolumeRequest) GetVolumeCapabilities() []*VolumeCapability { + if m != nil { + return m.VolumeCapabilities + } + return nil +} + +func (m *CreateVolumeRequest) GetParameters() map[string]string { + if m != nil { + return m.Parameters + } + return nil +} + +func (m *CreateVolumeRequest) GetSeecreets() map[string]string { + if m != nil { + return m.Seecreets + } + return nil +} + +func (m *CreateVolumeRequest) GetVolumeContentSource() *VolumeContentSource { + if m != nil { + return m.VolumeContentSource + } + return nil +} + +func (m *CreateVolumeRequest) GetAccessibilityRequirements() *TopologyRequirement { + if m != nil { + return m.AccessibilityRequirements + } + return nil +} + +func (m *CreateVolumeRequest) GetNewSecretInt() int64 { + if m != nil { + return m.NewSecretInt + } + return 0 +} + +func (m *CreateVolumeRequest) GetMaybeSecretMap() map[int64]*VolumeCapability { + if m != nil { + return m.MaybeSecretMap + } + return nil +} + +// Specifies what source the volume will be created from. One of the +// type fields MUST be specified. +type VolumeContentSource struct { + // Types that are valid to be assigned to Type: + // *VolumeContentSource_Snapshot + // *VolumeContentSource_Volume + Type isVolumeContentSource_Type `protobuf_oneof:"type"` + // A secret field that will only get stripped by code that + // can recurse into CreateVolumeRequest. + NestedSecretField string `protobuf:"bytes,3,opt,name=nested_secret_field,json=nestedSecretField,proto3" json:"nested_secret_field,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VolumeContentSource) Reset() { *m = VolumeContentSource{} } +func (m *VolumeContentSource) String() string { return proto.CompactTextString(m) } +func (*VolumeContentSource) ProtoMessage() {} +func (*VolumeContentSource) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{8} +} +func (m *VolumeContentSource) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VolumeContentSource.Unmarshal(m, b) +} +func (m *VolumeContentSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VolumeContentSource.Marshal(b, m, deterministic) +} +func (dst *VolumeContentSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_VolumeContentSource.Merge(dst, src) +} +func (m *VolumeContentSource) XXX_Size() int { + return xxx_messageInfo_VolumeContentSource.Size(m) +} +func (m *VolumeContentSource) XXX_DiscardUnknown() { + xxx_messageInfo_VolumeContentSource.DiscardUnknown(m) +} + +var xxx_messageInfo_VolumeContentSource proto.InternalMessageInfo + +type isVolumeContentSource_Type interface { + isVolumeContentSource_Type() +} + +type VolumeContentSource_Snapshot struct { + Snapshot *VolumeContentSource_SnapshotSource `protobuf:"bytes,1,opt,name=snapshot,proto3,oneof"` +} + +type VolumeContentSource_Volume struct { + Volume *VolumeContentSource_VolumeSource `protobuf:"bytes,2,opt,name=volume,proto3,oneof"` +} + +func (*VolumeContentSource_Snapshot) isVolumeContentSource_Type() {} + +func (*VolumeContentSource_Volume) isVolumeContentSource_Type() {} + +func (m *VolumeContentSource) GetType() isVolumeContentSource_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *VolumeContentSource) GetSnapshot() *VolumeContentSource_SnapshotSource { + if x, ok := m.GetType().(*VolumeContentSource_Snapshot); ok { + return x.Snapshot + } + return nil +} + +func (m *VolumeContentSource) GetVolume() *VolumeContentSource_VolumeSource { + if x, ok := m.GetType().(*VolumeContentSource_Volume); ok { + return x.Volume + } + return nil +} + +func (m *VolumeContentSource) GetNestedSecretField() string { + if m != nil { + return m.NestedSecretField + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*VolumeContentSource) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _VolumeContentSource_OneofMarshaler, _VolumeContentSource_OneofUnmarshaler, _VolumeContentSource_OneofSizer, []interface{}{ + (*VolumeContentSource_Snapshot)(nil), + (*VolumeContentSource_Volume)(nil), + } +} + +func _VolumeContentSource_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*VolumeContentSource) + // type + switch x := m.Type.(type) { + case *VolumeContentSource_Snapshot: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Snapshot); err != nil { + return err + } + case *VolumeContentSource_Volume: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Volume); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("VolumeContentSource.Type has unexpected type %T", x) + } + return nil +} + +func _VolumeContentSource_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*VolumeContentSource) + switch tag { + case 1: // type.snapshot + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(VolumeContentSource_SnapshotSource) + err := b.DecodeMessage(msg) + m.Type = &VolumeContentSource_Snapshot{msg} + return true, err + case 2: // type.volume + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(VolumeContentSource_VolumeSource) + err := b.DecodeMessage(msg) + m.Type = &VolumeContentSource_Volume{msg} + return true, err + default: + return false, nil + } +} + +func _VolumeContentSource_OneofSizer(msg proto.Message) (n int) { + m := msg.(*VolumeContentSource) + // type + switch x := m.Type.(type) { + case *VolumeContentSource_Snapshot: + s := proto.Size(x.Snapshot) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *VolumeContentSource_Volume: + s := proto.Size(x.Volume) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type VolumeContentSource_SnapshotSource struct { + // Contains identity information for the existing source snapshot. + // This field is REQUIRED. Plugin is REQUIRED to support creating + // volume from snapshot if it supports the capability + // CREATE_DELETE_SNAPSHOT. + SnapshotId string `protobuf:"bytes,1,opt,name=snapshot_id,json=snapshotId,proto3" json:"snapshot_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VolumeContentSource_SnapshotSource) Reset() { *m = VolumeContentSource_SnapshotSource{} } +func (m *VolumeContentSource_SnapshotSource) String() string { return proto.CompactTextString(m) } +func (*VolumeContentSource_SnapshotSource) ProtoMessage() {} +func (*VolumeContentSource_SnapshotSource) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{8, 0} +} +func (m *VolumeContentSource_SnapshotSource) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VolumeContentSource_SnapshotSource.Unmarshal(m, b) +} +func (m *VolumeContentSource_SnapshotSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VolumeContentSource_SnapshotSource.Marshal(b, m, deterministic) +} +func (dst *VolumeContentSource_SnapshotSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_VolumeContentSource_SnapshotSource.Merge(dst, src) +} +func (m *VolumeContentSource_SnapshotSource) XXX_Size() int { + return xxx_messageInfo_VolumeContentSource_SnapshotSource.Size(m) +} +func (m *VolumeContentSource_SnapshotSource) XXX_DiscardUnknown() { + xxx_messageInfo_VolumeContentSource_SnapshotSource.DiscardUnknown(m) +} + +var xxx_messageInfo_VolumeContentSource_SnapshotSource proto.InternalMessageInfo + +func (m *VolumeContentSource_SnapshotSource) GetSnapshotId() string { + if m != nil { + return m.SnapshotId + } + return "" +} + +type VolumeContentSource_VolumeSource struct { + // Contains identity information for the existing source volume. + // This field is REQUIRED. Plugins reporting CLONE_VOLUME + // capability MUST support creating a volume from another volume. + VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // A secret field that will only get stripped by code that + // can recurse into a oneof field. + OneofSecretField string `protobuf:"bytes,2,opt,name=oneof_secret_field,json=oneofSecretField,proto3" json:"oneof_secret_field,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VolumeContentSource_VolumeSource) Reset() { *m = VolumeContentSource_VolumeSource{} } +func (m *VolumeContentSource_VolumeSource) String() string { return proto.CompactTextString(m) } +func (*VolumeContentSource_VolumeSource) ProtoMessage() {} +func (*VolumeContentSource_VolumeSource) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{8, 1} +} +func (m *VolumeContentSource_VolumeSource) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VolumeContentSource_VolumeSource.Unmarshal(m, b) +} +func (m *VolumeContentSource_VolumeSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VolumeContentSource_VolumeSource.Marshal(b, m, deterministic) +} +func (dst *VolumeContentSource_VolumeSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_VolumeContentSource_VolumeSource.Merge(dst, src) +} +func (m *VolumeContentSource_VolumeSource) XXX_Size() int { + return xxx_messageInfo_VolumeContentSource_VolumeSource.Size(m) +} +func (m *VolumeContentSource_VolumeSource) XXX_DiscardUnknown() { + xxx_messageInfo_VolumeContentSource_VolumeSource.DiscardUnknown(m) +} + +var xxx_messageInfo_VolumeContentSource_VolumeSource proto.InternalMessageInfo + +func (m *VolumeContentSource_VolumeSource) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + return "" +} + +func (m *VolumeContentSource_VolumeSource) GetOneofSecretField() string { + if m != nil { + return m.OneofSecretField + } + return "" +} + +type CreateVolumeResponse struct { + // Contains all attributes of the newly created volume that are + // relevant to the CO along with information required by the Plugin + // to uniquely identify the volume. This field is REQUIRED. + Volume *Volume `protobuf:"bytes,1,opt,name=volume,proto3" json:"volume,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateVolumeResponse) Reset() { *m = CreateVolumeResponse{} } +func (m *CreateVolumeResponse) String() string { return proto.CompactTextString(m) } +func (*CreateVolumeResponse) ProtoMessage() {} +func (*CreateVolumeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{9} +} +func (m *CreateVolumeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateVolumeResponse.Unmarshal(m, b) +} +func (m *CreateVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateVolumeResponse.Marshal(b, m, deterministic) +} +func (dst *CreateVolumeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateVolumeResponse.Merge(dst, src) +} +func (m *CreateVolumeResponse) XXX_Size() int { + return xxx_messageInfo_CreateVolumeResponse.Size(m) +} +func (m *CreateVolumeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateVolumeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateVolumeResponse proto.InternalMessageInfo + +func (m *CreateVolumeResponse) GetVolume() *Volume { + if m != nil { + return m.Volume + } + return nil +} + +// Specify a capability of a volume. +type VolumeCapability struct { + // Specifies what API the volume will be accessed using. One of the + // following fields MUST be specified. + // + // Types that are valid to be assigned to AccessType: + // *VolumeCapability_Block + // *VolumeCapability_Mount + AccessType isVolumeCapability_AccessType `protobuf_oneof:"access_type"` + // This is a REQUIRED field. + AccessMode *VolumeCapability_AccessMode `protobuf:"bytes,3,opt,name=access_mode,json=accessMode,proto3" json:"access_mode,omitempty"` + // A secret inside a field that occurs in an array. + ArraySecret string `protobuf:"bytes,4,opt,name=array_secret,json=arraySecret,proto3" json:"array_secret,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VolumeCapability) Reset() { *m = VolumeCapability{} } +func (m *VolumeCapability) String() string { return proto.CompactTextString(m) } +func (*VolumeCapability) ProtoMessage() {} +func (*VolumeCapability) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{10} +} +func (m *VolumeCapability) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VolumeCapability.Unmarshal(m, b) +} +func (m *VolumeCapability) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VolumeCapability.Marshal(b, m, deterministic) +} +func (dst *VolumeCapability) XXX_Merge(src proto.Message) { + xxx_messageInfo_VolumeCapability.Merge(dst, src) +} +func (m *VolumeCapability) XXX_Size() int { + return xxx_messageInfo_VolumeCapability.Size(m) +} +func (m *VolumeCapability) XXX_DiscardUnknown() { + xxx_messageInfo_VolumeCapability.DiscardUnknown(m) +} + +var xxx_messageInfo_VolumeCapability proto.InternalMessageInfo + +type isVolumeCapability_AccessType interface { + isVolumeCapability_AccessType() +} + +type VolumeCapability_Block struct { + Block *VolumeCapability_BlockVolume `protobuf:"bytes,1,opt,name=block,proto3,oneof"` +} + +type VolumeCapability_Mount struct { + Mount *VolumeCapability_MountVolume `protobuf:"bytes,2,opt,name=mount,proto3,oneof"` +} + +func (*VolumeCapability_Block) isVolumeCapability_AccessType() {} + +func (*VolumeCapability_Mount) isVolumeCapability_AccessType() {} + +func (m *VolumeCapability) GetAccessType() isVolumeCapability_AccessType { + if m != nil { + return m.AccessType + } + return nil +} + +func (m *VolumeCapability) GetBlock() *VolumeCapability_BlockVolume { + if x, ok := m.GetAccessType().(*VolumeCapability_Block); ok { + return x.Block + } + return nil +} + +func (m *VolumeCapability) GetMount() *VolumeCapability_MountVolume { + if x, ok := m.GetAccessType().(*VolumeCapability_Mount); ok { + return x.Mount + } + return nil +} + +func (m *VolumeCapability) GetAccessMode() *VolumeCapability_AccessMode { + if m != nil { + return m.AccessMode + } + return nil +} + +func (m *VolumeCapability) GetArraySecret() string { + if m != nil { + return m.ArraySecret + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*VolumeCapability) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _VolumeCapability_OneofMarshaler, _VolumeCapability_OneofUnmarshaler, _VolumeCapability_OneofSizer, []interface{}{ + (*VolumeCapability_Block)(nil), + (*VolumeCapability_Mount)(nil), + } +} + +func _VolumeCapability_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*VolumeCapability) + // access_type + switch x := m.AccessType.(type) { + case *VolumeCapability_Block: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Block); err != nil { + return err + } + case *VolumeCapability_Mount: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Mount); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("VolumeCapability.AccessType has unexpected type %T", x) + } + return nil +} + +func _VolumeCapability_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*VolumeCapability) + switch tag { + case 1: // access_type.block + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(VolumeCapability_BlockVolume) + err := b.DecodeMessage(msg) + m.AccessType = &VolumeCapability_Block{msg} + return true, err + case 2: // access_type.mount + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(VolumeCapability_MountVolume) + err := b.DecodeMessage(msg) + m.AccessType = &VolumeCapability_Mount{msg} + return true, err + default: + return false, nil + } +} + +func _VolumeCapability_OneofSizer(msg proto.Message) (n int) { + m := msg.(*VolumeCapability) + // access_type + switch x := m.AccessType.(type) { + case *VolumeCapability_Block: + s := proto.Size(x.Block) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *VolumeCapability_Mount: + s := proto.Size(x.Mount) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Indicate that the volume will be accessed via the block device API. +type VolumeCapability_BlockVolume struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VolumeCapability_BlockVolume) Reset() { *m = VolumeCapability_BlockVolume{} } +func (m *VolumeCapability_BlockVolume) String() string { return proto.CompactTextString(m) } +func (*VolumeCapability_BlockVolume) ProtoMessage() {} +func (*VolumeCapability_BlockVolume) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{10, 0} +} +func (m *VolumeCapability_BlockVolume) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VolumeCapability_BlockVolume.Unmarshal(m, b) +} +func (m *VolumeCapability_BlockVolume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VolumeCapability_BlockVolume.Marshal(b, m, deterministic) +} +func (dst *VolumeCapability_BlockVolume) XXX_Merge(src proto.Message) { + xxx_messageInfo_VolumeCapability_BlockVolume.Merge(dst, src) +} +func (m *VolumeCapability_BlockVolume) XXX_Size() int { + return xxx_messageInfo_VolumeCapability_BlockVolume.Size(m) +} +func (m *VolumeCapability_BlockVolume) XXX_DiscardUnknown() { + xxx_messageInfo_VolumeCapability_BlockVolume.DiscardUnknown(m) +} + +var xxx_messageInfo_VolumeCapability_BlockVolume proto.InternalMessageInfo + +// Indicate that the volume will be accessed via the filesystem API. +type VolumeCapability_MountVolume struct { + // The filesystem type. This field is OPTIONAL. + // An empty string is equal to an unspecified field value. + FsType string `protobuf:"bytes,1,opt,name=fs_type,json=fsType,proto3" json:"fs_type,omitempty"` + // The mount options that can be used for the volume. This field is + // OPTIONAL. `mount_flags` MAY contain sensitive information. + // Therefore, the CO and the Plugin MUST NOT leak this information + // to untrusted entities. The total size of this repeated field + // SHALL NOT exceed 4 KiB. + MountFlags []string `protobuf:"bytes,2,rep,name=mount_flags,json=mountFlags,proto3" json:"mount_flags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VolumeCapability_MountVolume) Reset() { *m = VolumeCapability_MountVolume{} } +func (m *VolumeCapability_MountVolume) String() string { return proto.CompactTextString(m) } +func (*VolumeCapability_MountVolume) ProtoMessage() {} +func (*VolumeCapability_MountVolume) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{10, 1} +} +func (m *VolumeCapability_MountVolume) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VolumeCapability_MountVolume.Unmarshal(m, b) +} +func (m *VolumeCapability_MountVolume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VolumeCapability_MountVolume.Marshal(b, m, deterministic) +} +func (dst *VolumeCapability_MountVolume) XXX_Merge(src proto.Message) { + xxx_messageInfo_VolumeCapability_MountVolume.Merge(dst, src) +} +func (m *VolumeCapability_MountVolume) XXX_Size() int { + return xxx_messageInfo_VolumeCapability_MountVolume.Size(m) +} +func (m *VolumeCapability_MountVolume) XXX_DiscardUnknown() { + xxx_messageInfo_VolumeCapability_MountVolume.DiscardUnknown(m) +} + +var xxx_messageInfo_VolumeCapability_MountVolume proto.InternalMessageInfo + +func (m *VolumeCapability_MountVolume) GetFsType() string { + if m != nil { + return m.FsType + } + return "" +} + +func (m *VolumeCapability_MountVolume) GetMountFlags() []string { + if m != nil { + return m.MountFlags + } + return nil +} + +// Specify how a volume can be accessed. +type VolumeCapability_AccessMode struct { + // This field is REQUIRED. + Mode VolumeCapability_AccessMode_Mode `protobuf:"varint,1,opt,name=mode,proto3,enum=csitest.v1.VolumeCapability_AccessMode_Mode" json:"mode,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VolumeCapability_AccessMode) Reset() { *m = VolumeCapability_AccessMode{} } +func (m *VolumeCapability_AccessMode) String() string { return proto.CompactTextString(m) } +func (*VolumeCapability_AccessMode) ProtoMessage() {} +func (*VolumeCapability_AccessMode) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{10, 2} +} +func (m *VolumeCapability_AccessMode) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VolumeCapability_AccessMode.Unmarshal(m, b) +} +func (m *VolumeCapability_AccessMode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VolumeCapability_AccessMode.Marshal(b, m, deterministic) +} +func (dst *VolumeCapability_AccessMode) XXX_Merge(src proto.Message) { + xxx_messageInfo_VolumeCapability_AccessMode.Merge(dst, src) +} +func (m *VolumeCapability_AccessMode) XXX_Size() int { + return xxx_messageInfo_VolumeCapability_AccessMode.Size(m) +} +func (m *VolumeCapability_AccessMode) XXX_DiscardUnknown() { + xxx_messageInfo_VolumeCapability_AccessMode.DiscardUnknown(m) +} + +var xxx_messageInfo_VolumeCapability_AccessMode proto.InternalMessageInfo + +func (m *VolumeCapability_AccessMode) GetMode() VolumeCapability_AccessMode_Mode { + if m != nil { + return m.Mode + } + return VolumeCapability_AccessMode_UNKNOWN +} + +// The capacity of the storage space in bytes. To specify an exact size, +// `required_bytes` and `limit_bytes` SHALL be set to the same value. At +// least one of the these fields MUST be specified. +type CapacityRange struct { + // Volume MUST be at least this big. This field is OPTIONAL. + // A value of 0 is equal to an unspecified field value. + // The value of this field MUST NOT be negative. + RequiredBytes int64 `protobuf:"varint,1,opt,name=required_bytes,json=requiredBytes,proto3" json:"required_bytes,omitempty"` + // Volume MUST not be bigger than this. This field is OPTIONAL. + // A value of 0 is equal to an unspecified field value. + // The value of this field MUST NOT be negative. + LimitBytes int64 `protobuf:"varint,2,opt,name=limit_bytes,json=limitBytes,proto3" json:"limit_bytes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CapacityRange) Reset() { *m = CapacityRange{} } +func (m *CapacityRange) String() string { return proto.CompactTextString(m) } +func (*CapacityRange) ProtoMessage() {} +func (*CapacityRange) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{11} +} +func (m *CapacityRange) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CapacityRange.Unmarshal(m, b) +} +func (m *CapacityRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CapacityRange.Marshal(b, m, deterministic) +} +func (dst *CapacityRange) XXX_Merge(src proto.Message) { + xxx_messageInfo_CapacityRange.Merge(dst, src) +} +func (m *CapacityRange) XXX_Size() int { + return xxx_messageInfo_CapacityRange.Size(m) +} +func (m *CapacityRange) XXX_DiscardUnknown() { + xxx_messageInfo_CapacityRange.DiscardUnknown(m) +} + +var xxx_messageInfo_CapacityRange proto.InternalMessageInfo + +func (m *CapacityRange) GetRequiredBytes() int64 { + if m != nil { + return m.RequiredBytes + } + return 0 +} + +func (m *CapacityRange) GetLimitBytes() int64 { + if m != nil { + return m.LimitBytes + } + return 0 +} + +// Information about a specific volume. +type Volume struct { + // The capacity of the volume in bytes. This field is OPTIONAL. If not + // set (value of 0), it indicates that the capacity of the volume is + // unknown (e.g., NFS share). + // The value of this field MUST NOT be negative. + CapacityBytes int64 `protobuf:"varint,1,opt,name=capacity_bytes,json=capacityBytes,proto3" json:"capacity_bytes,omitempty"` + // The identifier for this volume, generated by the plugin. + // This field is REQUIRED. + // This field MUST contain enough information to uniquely identify + // this specific volume vs all other volumes supported by this plugin. + // This field SHALL be used by the CO in subsequent calls to refer to + // this volume. + // The SP is NOT responsible for global uniqueness of volume_id across + // multiple SPs. + VolumeId string `protobuf:"bytes,2,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // Opaque static properties of the volume. SP MAY use this field to + // ensure subsequent volume validation and publishing calls have + // contextual information. + // The contents of this field SHALL be opaque to a CO. + // The contents of this field SHALL NOT be mutable. + // The contents of this field SHALL be safe for the CO to cache. + // The contents of this field SHOULD NOT contain sensitive + // information. + // The contents of this field SHOULD NOT be used for uniquely + // identifying a volume. The `volume_id` alone SHOULD be sufficient to + // identify the volume. + // A volume uniquely identified by `volume_id` SHALL always report the + // same volume_context. + // This field is OPTIONAL and when present MUST be passed to volume + // validation and publishing calls. + VolumeContext map[string]string `protobuf:"bytes,3,rep,name=volume_context,json=volumeContext,proto3" json:"volume_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // If specified, indicates that the volume is not empty and is + // pre-populated with data from the specified source. + // This field is OPTIONAL. + ContentSource *VolumeContentSource `protobuf:"bytes,4,opt,name=content_source,json=contentSource,proto3" json:"content_source,omitempty"` + // Specifies where (regions, zones, racks, etc.) the provisioned + // volume is accessible from. + // A plugin that returns this field MUST also set the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability. + // An SP MAY specify multiple topologies to indicate the volume is + // accessible from multiple locations. + // COs MAY use this information along with the topology information + // returned by NodeGetInfo to ensure that a given volume is accessible + // from a given node when scheduling workloads. + // This field is OPTIONAL. If it is not specified, the CO MAY assume + // the volume is equally accessible from all nodes in the cluster and + // MAY schedule workloads referencing the volume on any available + // node. + // + // Example 1: + // accessible_topology = {"region": "R1", "zone": "Z2"} + // Indicates a volume accessible only from the "region" "R1" and the + // "zone" "Z2". + // + // Example 2: + // accessible_topology = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"} + // Indicates a volume accessible from both "zone" "Z2" and "zone" "Z3" + // in the "region" "R1". + AccessibleTopology []*Topology `protobuf:"bytes,5,rep,name=accessible_topology,json=accessibleTopology,proto3" json:"accessible_topology,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Volume) Reset() { *m = Volume{} } +func (m *Volume) String() string { return proto.CompactTextString(m) } +func (*Volume) ProtoMessage() {} +func (*Volume) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{12} +} +func (m *Volume) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Volume.Unmarshal(m, b) +} +func (m *Volume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Volume.Marshal(b, m, deterministic) +} +func (dst *Volume) XXX_Merge(src proto.Message) { + xxx_messageInfo_Volume.Merge(dst, src) +} +func (m *Volume) XXX_Size() int { + return xxx_messageInfo_Volume.Size(m) +} +func (m *Volume) XXX_DiscardUnknown() { + xxx_messageInfo_Volume.DiscardUnknown(m) +} + +var xxx_messageInfo_Volume proto.InternalMessageInfo + +func (m *Volume) GetCapacityBytes() int64 { + if m != nil { + return m.CapacityBytes + } + return 0 +} + +func (m *Volume) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + return "" +} + +func (m *Volume) GetVolumeContext() map[string]string { + if m != nil { + return m.VolumeContext + } + return nil +} + +func (m *Volume) GetContentSource() *VolumeContentSource { + if m != nil { + return m.ContentSource + } + return nil +} + +func (m *Volume) GetAccessibleTopology() []*Topology { + if m != nil { + return m.AccessibleTopology + } + return nil +} + +type TopologyRequirement struct { + // Specifies the list of topologies the provisioned volume MUST be + // accessible from. + // This field is OPTIONAL. If TopologyRequirement is specified either + // requisite or preferred or both MUST be specified. + // + // If requisite is specified, the provisioned volume MUST be + // accessible from at least one of the requisite topologies. + // + // Given + // x = number of topologies provisioned volume is accessible from + // n = number of requisite topologies + // The CO MUST ensure n >= 1. The SP MUST ensure x >= 1 + // If x==n, then the SP MUST make the provisioned volume available to + // all topologies from the list of requisite topologies. If it is + // unable to do so, the SP MUST fail the CreateVolume call. + // For example, if a volume should be accessible from a single zone, + // and requisite = + // {"region": "R1", "zone": "Z2"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and the "zone" "Z2". + // Similarly, if a volume should be accessible from two zones, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and both "zone" "Z2" and "zone" "Z3". + // + // If xn, then the SP MUST make the provisioned volume available from + // all topologies from the list of requisite topologies and MAY choose + // the remaining x-n unique topologies from the list of all possible + // topologies. If it is unable to do so, the SP MUST fail the + // CreateVolume call. + // For example, if a volume should be accessible from two zones, and + // requisite = + // {"region": "R1", "zone": "Z2"} + // then the provisioned volume MUST be accessible from the "region" + // "R1" and the "zone" "Z2" and the SP may select the second zone + // independently, e.g. "R1/Z4". + Requisite []*Topology `protobuf:"bytes,1,rep,name=requisite,proto3" json:"requisite,omitempty"` + // Specifies the list of topologies the CO would prefer the volume to + // be provisioned in. + // + // This field is OPTIONAL. If TopologyRequirement is specified either + // requisite or preferred or both MUST be specified. + // + // An SP MUST attempt to make the provisioned volume available using + // the preferred topologies in order from first to last. + // + // If requisite is specified, all topologies in preferred list MUST + // also be present in the list of requisite topologies. + // + // If the SP is unable to to make the provisioned volume available + // from any of the preferred topologies, the SP MAY choose a topology + // from the list of requisite topologies. + // If the list of requisite topologies is not specified, then the SP + // MAY choose from the list of all possible topologies. + // If the list of requisite topologies is specified and the SP is + // unable to to make the provisioned volume available from any of the + // requisite topologies it MUST fail the CreateVolume call. + // + // Example 1: + // Given a volume should be accessible from a single zone, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"} + // preferred = + // {"region": "R1", "zone": "Z3"} + // then the the SP SHOULD first attempt to make the provisioned volume + // available from "zone" "Z3" in the "region" "R1" and fall back to + // "zone" "Z2" in the "region" "R1" if that is not possible. + // + // Example 2: + // Given a volume should be accessible from a single zone, and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"}, + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z5"} + // preferred = + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z2"} + // then the the SP SHOULD first attempt to make the provisioned volume + // accessible from "zone" "Z4" in the "region" "R1" and fall back to + // "zone" "Z2" in the "region" "R1" if that is not possible. If that + // is not possible, the SP may choose between either the "zone" + // "Z3" or "Z5" in the "region" "R1". + // + // Example 3: + // Given a volume should be accessible from TWO zones (because an + // opaque parameter in CreateVolumeRequest, for example, specifies + // the volume is accessible from two zones, aka synchronously + // replicated), and + // requisite = + // {"region": "R1", "zone": "Z2"}, + // {"region": "R1", "zone": "Z3"}, + // {"region": "R1", "zone": "Z4"}, + // {"region": "R1", "zone": "Z5"} + // preferred = + // {"region": "R1", "zone": "Z5"}, + // {"region": "R1", "zone": "Z3"} + // then the the SP SHOULD first attempt to make the provisioned volume + // accessible from the combination of the two "zones" "Z5" and "Z3" in + // the "region" "R1". If that's not possible, it should fall back to + // a combination of "Z5" and other possibilities from the list of + // requisite. If that's not possible, it should fall back to a + // combination of "Z3" and other possibilities from the list of + // requisite. If that's not possible, it should fall back to a + // combination of other possibilities from the list of requisite. + Preferred []*Topology `protobuf:"bytes,2,rep,name=preferred,proto3" json:"preferred,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TopologyRequirement) Reset() { *m = TopologyRequirement{} } +func (m *TopologyRequirement) String() string { return proto.CompactTextString(m) } +func (*TopologyRequirement) ProtoMessage() {} +func (*TopologyRequirement) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{13} +} +func (m *TopologyRequirement) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TopologyRequirement.Unmarshal(m, b) +} +func (m *TopologyRequirement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TopologyRequirement.Marshal(b, m, deterministic) +} +func (dst *TopologyRequirement) XXX_Merge(src proto.Message) { + xxx_messageInfo_TopologyRequirement.Merge(dst, src) +} +func (m *TopologyRequirement) XXX_Size() int { + return xxx_messageInfo_TopologyRequirement.Size(m) +} +func (m *TopologyRequirement) XXX_DiscardUnknown() { + xxx_messageInfo_TopologyRequirement.DiscardUnknown(m) +} + +var xxx_messageInfo_TopologyRequirement proto.InternalMessageInfo + +func (m *TopologyRequirement) GetRequisite() []*Topology { + if m != nil { + return m.Requisite + } + return nil +} + +func (m *TopologyRequirement) GetPreferred() []*Topology { + if m != nil { + return m.Preferred + } + return nil +} + +// Topology is a map of topological domains to topological segments. +// A topological domain is a sub-division of a cluster, like "region", +// "zone", "rack", etc. +// A topological segment is a specific instance of a topological domain, +// like "zone3", "rack3", etc. +// For example {"com.company/zone": "Z1", "com.company/rack": "R3"} +// Valid keys have two segments: an OPTIONAL prefix and name, separated +// by a slash (/), for example: "com.company.example/zone". +// The key name segment is REQUIRED. The prefix is OPTIONAL. +// The key name MUST be 63 characters or less, begin and end with an +// alphanumeric character ([a-z0-9A-Z]), and contain only dashes (-), +// underscores (_), dots (.), or alphanumerics in between, for example +// "zone". +// The key prefix MUST be 63 characters or less, begin and end with a +// lower-case alphanumeric character ([a-z0-9]), contain only +// dashes (-), dots (.), or lower-case alphanumerics in between, and +// follow domain name notation format +// (https://tools.ietf.org/html/rfc1035#section-2.3.1). +// The key prefix SHOULD include the plugin's host company name and/or +// the plugin name, to minimize the possibility of collisions with keys +// from other plugins. +// If a key prefix is specified, it MUST be identical across all +// topology keys returned by the SP (across all RPCs). +// Keys MUST be case-insensitive. Meaning the keys "Zone" and "zone" +// MUST not both exist. +// Each value (topological segment) MUST contain 1 or more strings. +// Each string MUST be 63 characters or less and begin and end with an +// alphanumeric character with '-', '_', '.', or alphanumerics in +// between. +type Topology struct { + Segments map[string]string `protobuf:"bytes,1,rep,name=segments,proto3" json:"segments,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Topology) Reset() { *m = Topology{} } +func (m *Topology) String() string { return proto.CompactTextString(m) } +func (*Topology) ProtoMessage() {} +func (*Topology) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{14} +} +func (m *Topology) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Topology.Unmarshal(m, b) +} +func (m *Topology) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Topology.Marshal(b, m, deterministic) +} +func (dst *Topology) XXX_Merge(src proto.Message) { + xxx_messageInfo_Topology.Merge(dst, src) +} +func (m *Topology) XXX_Size() int { + return xxx_messageInfo_Topology.Size(m) +} +func (m *Topology) XXX_DiscardUnknown() { + xxx_messageInfo_Topology.DiscardUnknown(m) +} + +var xxx_messageInfo_Topology proto.InternalMessageInfo + +func (m *Topology) GetSegments() map[string]string { + if m != nil { + return m.Segments + } + return nil +} + +type DeleteVolumeRequest struct { + // The ID of the volume to be deprovisioned. + // This field is REQUIRED. + VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // Secrets required by plugin to complete volume deletion request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + Secrets map[string]string `protobuf:"bytes,2,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteVolumeRequest) Reset() { *m = DeleteVolumeRequest{} } +func (m *DeleteVolumeRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteVolumeRequest) ProtoMessage() {} +func (*DeleteVolumeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{15} +} +func (m *DeleteVolumeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteVolumeRequest.Unmarshal(m, b) +} +func (m *DeleteVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteVolumeRequest.Marshal(b, m, deterministic) +} +func (dst *DeleteVolumeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteVolumeRequest.Merge(dst, src) +} +func (m *DeleteVolumeRequest) XXX_Size() int { + return xxx_messageInfo_DeleteVolumeRequest.Size(m) +} +func (m *DeleteVolumeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteVolumeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteVolumeRequest proto.InternalMessageInfo + +func (m *DeleteVolumeRequest) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + return "" +} + +func (m *DeleteVolumeRequest) GetSecrets() map[string]string { + if m != nil { + return m.Secrets + } + return nil +} + +type DeleteVolumeResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteVolumeResponse) Reset() { *m = DeleteVolumeResponse{} } +func (m *DeleteVolumeResponse) String() string { return proto.CompactTextString(m) } +func (*DeleteVolumeResponse) ProtoMessage() {} +func (*DeleteVolumeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{16} +} +func (m *DeleteVolumeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteVolumeResponse.Unmarshal(m, b) +} +func (m *DeleteVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteVolumeResponse.Marshal(b, m, deterministic) +} +func (dst *DeleteVolumeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteVolumeResponse.Merge(dst, src) +} +func (m *DeleteVolumeResponse) XXX_Size() int { + return xxx_messageInfo_DeleteVolumeResponse.Size(m) +} +func (m *DeleteVolumeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteVolumeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteVolumeResponse proto.InternalMessageInfo + +type ControllerPublishVolumeRequest struct { + // The ID of the volume to be used on a node. + // This field is REQUIRED. + VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // The ID of the node. This field is REQUIRED. The CO SHALL set this + // field to match the node ID returned by `NodeGetInfo`. + NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + // Volume capability describing how the CO intends to use this volume. + // SP MUST ensure the CO can use the published volume as described. + // Otherwise SP MUST return the appropriate gRPC error code. + // This is a REQUIRED field. + VolumeCapability *VolumeCapability `protobuf:"bytes,3,opt,name=volume_capability,json=volumeCapability,proto3" json:"volume_capability,omitempty"` + // Indicates SP MUST publish the volume in readonly mode. + // CO MUST set this field to false if SP does not have the + // PUBLISH_READONLY controller capability. + // This is a REQUIRED field. + Readonly bool `protobuf:"varint,4,opt,name=readonly,proto3" json:"readonly,omitempty"` + // Secrets required by plugin to complete controller publish volume + // request. This field is OPTIONAL. Refer to the + // `Secrets Requirements` section on how to use this field. + Secrets map[string]string `protobuf:"bytes,5,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + VolumeContext map[string]string `protobuf:"bytes,6,rep,name=volume_context,json=volumeContext,proto3" json:"volume_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ControllerPublishVolumeRequest) Reset() { *m = ControllerPublishVolumeRequest{} } +func (m *ControllerPublishVolumeRequest) String() string { return proto.CompactTextString(m) } +func (*ControllerPublishVolumeRequest) ProtoMessage() {} +func (*ControllerPublishVolumeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{17} +} +func (m *ControllerPublishVolumeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ControllerPublishVolumeRequest.Unmarshal(m, b) +} +func (m *ControllerPublishVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ControllerPublishVolumeRequest.Marshal(b, m, deterministic) +} +func (dst *ControllerPublishVolumeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ControllerPublishVolumeRequest.Merge(dst, src) +} +func (m *ControllerPublishVolumeRequest) XXX_Size() int { + return xxx_messageInfo_ControllerPublishVolumeRequest.Size(m) +} +func (m *ControllerPublishVolumeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ControllerPublishVolumeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ControllerPublishVolumeRequest proto.InternalMessageInfo + +func (m *ControllerPublishVolumeRequest) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + return "" +} + +func (m *ControllerPublishVolumeRequest) GetNodeId() string { + if m != nil { + return m.NodeId + } + return "" +} + +func (m *ControllerPublishVolumeRequest) GetVolumeCapability() *VolumeCapability { + if m != nil { + return m.VolumeCapability + } + return nil +} + +func (m *ControllerPublishVolumeRequest) GetReadonly() bool { + if m != nil { + return m.Readonly + } + return false +} + +func (m *ControllerPublishVolumeRequest) GetSecrets() map[string]string { + if m != nil { + return m.Secrets + } + return nil +} + +func (m *ControllerPublishVolumeRequest) GetVolumeContext() map[string]string { + if m != nil { + return m.VolumeContext + } + return nil +} + +type ControllerPublishVolumeResponse struct { + // Opaque static publish properties of the volume. SP MAY use this + // field to ensure subsequent `NodeStageVolume` or `NodePublishVolume` + // calls calls have contextual information. + // The contents of this field SHALL be opaque to a CO. + // The contents of this field SHALL NOT be mutable. + // The contents of this field SHALL be safe for the CO to cache. + // The contents of this field SHOULD NOT contain sensitive + // information. + // The contents of this field SHOULD NOT be used for uniquely + // identifying a volume. The `volume_id` alone SHOULD be sufficient to + // identify the volume. + // This field is OPTIONAL and when present MUST be passed to + // subsequent `NodeStageVolume` or `NodePublishVolume` calls + PublishContext map[string]string `protobuf:"bytes,1,rep,name=publish_context,json=publishContext,proto3" json:"publish_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ControllerPublishVolumeResponse) Reset() { *m = ControllerPublishVolumeResponse{} } +func (m *ControllerPublishVolumeResponse) String() string { return proto.CompactTextString(m) } +func (*ControllerPublishVolumeResponse) ProtoMessage() {} +func (*ControllerPublishVolumeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{18} +} +func (m *ControllerPublishVolumeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ControllerPublishVolumeResponse.Unmarshal(m, b) +} +func (m *ControllerPublishVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ControllerPublishVolumeResponse.Marshal(b, m, deterministic) +} +func (dst *ControllerPublishVolumeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ControllerPublishVolumeResponse.Merge(dst, src) +} +func (m *ControllerPublishVolumeResponse) XXX_Size() int { + return xxx_messageInfo_ControllerPublishVolumeResponse.Size(m) +} +func (m *ControllerPublishVolumeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ControllerPublishVolumeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ControllerPublishVolumeResponse proto.InternalMessageInfo + +func (m *ControllerPublishVolumeResponse) GetPublishContext() map[string]string { + if m != nil { + return m.PublishContext + } + return nil +} + +type ControllerUnpublishVolumeRequest struct { + // The ID of the volume. This field is REQUIRED. + VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // The ID of the node. This field is OPTIONAL. The CO SHOULD set this + // field to match the node ID returned by `NodeGetInfo` or leave it + // unset. If the value is set, the SP MUST unpublish the volume from + // the specified node. If the value is unset, the SP MUST unpublish + // the volume from all nodes it is published to. + NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + // Secrets required by plugin to complete controller unpublish volume + // request. This SHOULD be the same secrets passed to the + // ControllerPublishVolume call for the specified volume. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + Secrets map[string]string `protobuf:"bytes,3,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ControllerUnpublishVolumeRequest) Reset() { *m = ControllerUnpublishVolumeRequest{} } +func (m *ControllerUnpublishVolumeRequest) String() string { return proto.CompactTextString(m) } +func (*ControllerUnpublishVolumeRequest) ProtoMessage() {} +func (*ControllerUnpublishVolumeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{19} +} +func (m *ControllerUnpublishVolumeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ControllerUnpublishVolumeRequest.Unmarshal(m, b) +} +func (m *ControllerUnpublishVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ControllerUnpublishVolumeRequest.Marshal(b, m, deterministic) +} +func (dst *ControllerUnpublishVolumeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ControllerUnpublishVolumeRequest.Merge(dst, src) +} +func (m *ControllerUnpublishVolumeRequest) XXX_Size() int { + return xxx_messageInfo_ControllerUnpublishVolumeRequest.Size(m) +} +func (m *ControllerUnpublishVolumeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ControllerUnpublishVolumeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ControllerUnpublishVolumeRequest proto.InternalMessageInfo + +func (m *ControllerUnpublishVolumeRequest) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + return "" +} + +func (m *ControllerUnpublishVolumeRequest) GetNodeId() string { + if m != nil { + return m.NodeId + } + return "" +} + +func (m *ControllerUnpublishVolumeRequest) GetSecrets() map[string]string { + if m != nil { + return m.Secrets + } + return nil +} + +type ControllerUnpublishVolumeResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ControllerUnpublishVolumeResponse) Reset() { *m = ControllerUnpublishVolumeResponse{} } +func (m *ControllerUnpublishVolumeResponse) String() string { return proto.CompactTextString(m) } +func (*ControllerUnpublishVolumeResponse) ProtoMessage() {} +func (*ControllerUnpublishVolumeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{20} +} +func (m *ControllerUnpublishVolumeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ControllerUnpublishVolumeResponse.Unmarshal(m, b) +} +func (m *ControllerUnpublishVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ControllerUnpublishVolumeResponse.Marshal(b, m, deterministic) +} +func (dst *ControllerUnpublishVolumeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ControllerUnpublishVolumeResponse.Merge(dst, src) +} +func (m *ControllerUnpublishVolumeResponse) XXX_Size() int { + return xxx_messageInfo_ControllerUnpublishVolumeResponse.Size(m) +} +func (m *ControllerUnpublishVolumeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ControllerUnpublishVolumeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ControllerUnpublishVolumeResponse proto.InternalMessageInfo + +type ValidateVolumeCapabilitiesRequest struct { + // The ID of the volume to check. This field is REQUIRED. + VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + VolumeContext map[string]string `protobuf:"bytes,2,rep,name=volume_context,json=volumeContext,proto3" json:"volume_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // The capabilities that the CO wants to check for the volume. This + // call SHALL return "confirmed" only if all the volume capabilities + // specified below are supported. This field is REQUIRED. + VolumeCapabilities []*VolumeCapability `protobuf:"bytes,3,rep,name=volume_capabilities,json=volumeCapabilities,proto3" json:"volume_capabilities,omitempty"` + // See CreateVolumeRequest.parameters. + // This field is OPTIONAL. + Parameters map[string]string `protobuf:"bytes,4,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Secrets required by plugin to complete volume validation request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + Secrets map[string]string `protobuf:"bytes,5,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ValidateVolumeCapabilitiesRequest) Reset() { *m = ValidateVolumeCapabilitiesRequest{} } +func (m *ValidateVolumeCapabilitiesRequest) String() string { return proto.CompactTextString(m) } +func (*ValidateVolumeCapabilitiesRequest) ProtoMessage() {} +func (*ValidateVolumeCapabilitiesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{21} +} +func (m *ValidateVolumeCapabilitiesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ValidateVolumeCapabilitiesRequest.Unmarshal(m, b) +} +func (m *ValidateVolumeCapabilitiesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ValidateVolumeCapabilitiesRequest.Marshal(b, m, deterministic) +} +func (dst *ValidateVolumeCapabilitiesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidateVolumeCapabilitiesRequest.Merge(dst, src) +} +func (m *ValidateVolumeCapabilitiesRequest) XXX_Size() int { + return xxx_messageInfo_ValidateVolumeCapabilitiesRequest.Size(m) +} +func (m *ValidateVolumeCapabilitiesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ValidateVolumeCapabilitiesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidateVolumeCapabilitiesRequest proto.InternalMessageInfo + +func (m *ValidateVolumeCapabilitiesRequest) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + return "" +} + +func (m *ValidateVolumeCapabilitiesRequest) GetVolumeContext() map[string]string { + if m != nil { + return m.VolumeContext + } + return nil +} + +func (m *ValidateVolumeCapabilitiesRequest) GetVolumeCapabilities() []*VolumeCapability { + if m != nil { + return m.VolumeCapabilities + } + return nil +} + +func (m *ValidateVolumeCapabilitiesRequest) GetParameters() map[string]string { + if m != nil { + return m.Parameters + } + return nil +} + +func (m *ValidateVolumeCapabilitiesRequest) GetSecrets() map[string]string { + if m != nil { + return m.Secrets + } + return nil +} + +type ValidateVolumeCapabilitiesResponse struct { + // Confirmed indicates to the CO the set of capabilities that the + // plugin has validated. This field SHALL only be set to a non-empty + // value for successful validation responses. + // For successful validation responses, the CO SHALL compare the + // fields of this message to the originally requested capabilities in + // order to guard against an older plugin reporting "valid" for newer + // capability fields that it does not yet understand. + // This field is OPTIONAL. + Confirmed *ValidateVolumeCapabilitiesResponse_Confirmed `protobuf:"bytes,1,opt,name=confirmed,proto3" json:"confirmed,omitempty"` + // Message to the CO if `confirmed` above is empty. This field is + // OPTIONAL. + // An empty string is equal to an unspecified field value. + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ValidateVolumeCapabilitiesResponse) Reset() { *m = ValidateVolumeCapabilitiesResponse{} } +func (m *ValidateVolumeCapabilitiesResponse) String() string { return proto.CompactTextString(m) } +func (*ValidateVolumeCapabilitiesResponse) ProtoMessage() {} +func (*ValidateVolumeCapabilitiesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{22} +} +func (m *ValidateVolumeCapabilitiesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ValidateVolumeCapabilitiesResponse.Unmarshal(m, b) +} +func (m *ValidateVolumeCapabilitiesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ValidateVolumeCapabilitiesResponse.Marshal(b, m, deterministic) +} +func (dst *ValidateVolumeCapabilitiesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidateVolumeCapabilitiesResponse.Merge(dst, src) +} +func (m *ValidateVolumeCapabilitiesResponse) XXX_Size() int { + return xxx_messageInfo_ValidateVolumeCapabilitiesResponse.Size(m) +} +func (m *ValidateVolumeCapabilitiesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ValidateVolumeCapabilitiesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidateVolumeCapabilitiesResponse proto.InternalMessageInfo + +func (m *ValidateVolumeCapabilitiesResponse) GetConfirmed() *ValidateVolumeCapabilitiesResponse_Confirmed { + if m != nil { + return m.Confirmed + } + return nil +} + +func (m *ValidateVolumeCapabilitiesResponse) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +type ValidateVolumeCapabilitiesResponse_Confirmed struct { + // Volume context validated by the plugin. + // This field is OPTIONAL. + VolumeContext map[string]string `protobuf:"bytes,1,rep,name=volume_context,json=volumeContext,proto3" json:"volume_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Volume capabilities supported by the plugin. + // This field is REQUIRED. + VolumeCapabilities []*VolumeCapability `protobuf:"bytes,2,rep,name=volume_capabilities,json=volumeCapabilities,proto3" json:"volume_capabilities,omitempty"` + // The volume creation parameters validated by the plugin. + // This field is OPTIONAL. + Parameters map[string]string `protobuf:"bytes,3,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ValidateVolumeCapabilitiesResponse_Confirmed) Reset() { + *m = ValidateVolumeCapabilitiesResponse_Confirmed{} +} +func (m *ValidateVolumeCapabilitiesResponse_Confirmed) String() string { + return proto.CompactTextString(m) +} +func (*ValidateVolumeCapabilitiesResponse_Confirmed) ProtoMessage() {} +func (*ValidateVolumeCapabilitiesResponse_Confirmed) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{22, 0} +} +func (m *ValidateVolumeCapabilitiesResponse_Confirmed) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ValidateVolumeCapabilitiesResponse_Confirmed.Unmarshal(m, b) +} +func (m *ValidateVolumeCapabilitiesResponse_Confirmed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ValidateVolumeCapabilitiesResponse_Confirmed.Marshal(b, m, deterministic) +} +func (dst *ValidateVolumeCapabilitiesResponse_Confirmed) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidateVolumeCapabilitiesResponse_Confirmed.Merge(dst, src) +} +func (m *ValidateVolumeCapabilitiesResponse_Confirmed) XXX_Size() int { + return xxx_messageInfo_ValidateVolumeCapabilitiesResponse_Confirmed.Size(m) +} +func (m *ValidateVolumeCapabilitiesResponse_Confirmed) XXX_DiscardUnknown() { + xxx_messageInfo_ValidateVolumeCapabilitiesResponse_Confirmed.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidateVolumeCapabilitiesResponse_Confirmed proto.InternalMessageInfo + +func (m *ValidateVolumeCapabilitiesResponse_Confirmed) GetVolumeContext() map[string]string { + if m != nil { + return m.VolumeContext + } + return nil +} + +func (m *ValidateVolumeCapabilitiesResponse_Confirmed) GetVolumeCapabilities() []*VolumeCapability { + if m != nil { + return m.VolumeCapabilities + } + return nil +} + +func (m *ValidateVolumeCapabilitiesResponse_Confirmed) GetParameters() map[string]string { + if m != nil { + return m.Parameters + } + return nil +} + +type ListVolumesRequest struct { + // If specified (non-zero value), the Plugin MUST NOT return more + // entries than this number in the response. If the actual number of + // entries is more than this number, the Plugin MUST set `next_token` + // in the response which can be used to get the next page of entries + // in the subsequent `ListVolumes` call. This field is OPTIONAL. If + // not specified (zero value), it means there is no restriction on the + // number of entries that can be returned. + // The value of this field MUST NOT be negative. + MaxEntries int32 `protobuf:"varint,1,opt,name=max_entries,json=maxEntries,proto3" json:"max_entries,omitempty"` + // A token to specify where to start paginating. Set this field to + // `next_token` returned by a previous `ListVolumes` call to get the + // next page of entries. This field is OPTIONAL. + // An empty string is equal to an unspecified field value. + StartingToken string `protobuf:"bytes,2,opt,name=starting_token,json=startingToken,proto3" json:"starting_token,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListVolumesRequest) Reset() { *m = ListVolumesRequest{} } +func (m *ListVolumesRequest) String() string { return proto.CompactTextString(m) } +func (*ListVolumesRequest) ProtoMessage() {} +func (*ListVolumesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{23} +} +func (m *ListVolumesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListVolumesRequest.Unmarshal(m, b) +} +func (m *ListVolumesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListVolumesRequest.Marshal(b, m, deterministic) +} +func (dst *ListVolumesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListVolumesRequest.Merge(dst, src) +} +func (m *ListVolumesRequest) XXX_Size() int { + return xxx_messageInfo_ListVolumesRequest.Size(m) +} +func (m *ListVolumesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListVolumesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListVolumesRequest proto.InternalMessageInfo + +func (m *ListVolumesRequest) GetMaxEntries() int32 { + if m != nil { + return m.MaxEntries + } + return 0 +} + +func (m *ListVolumesRequest) GetStartingToken() string { + if m != nil { + return m.StartingToken + } + return "" +} + +type ListVolumesResponse struct { + Entries []*ListVolumesResponse_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` + // This token allows you to get the next page of entries for + // `ListVolumes` request. If the number of entries is larger than + // `max_entries`, use the `next_token` as a value for the + // `starting_token` field in the next `ListVolumes` request. This + // field is OPTIONAL. + // An empty string is equal to an unspecified field value. + NextToken string `protobuf:"bytes,2,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListVolumesResponse) Reset() { *m = ListVolumesResponse{} } +func (m *ListVolumesResponse) String() string { return proto.CompactTextString(m) } +func (*ListVolumesResponse) ProtoMessage() {} +func (*ListVolumesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{24} +} +func (m *ListVolumesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListVolumesResponse.Unmarshal(m, b) +} +func (m *ListVolumesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListVolumesResponse.Marshal(b, m, deterministic) +} +func (dst *ListVolumesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListVolumesResponse.Merge(dst, src) +} +func (m *ListVolumesResponse) XXX_Size() int { + return xxx_messageInfo_ListVolumesResponse.Size(m) +} +func (m *ListVolumesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListVolumesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListVolumesResponse proto.InternalMessageInfo + +func (m *ListVolumesResponse) GetEntries() []*ListVolumesResponse_Entry { + if m != nil { + return m.Entries + } + return nil +} + +func (m *ListVolumesResponse) GetNextToken() string { + if m != nil { + return m.NextToken + } + return "" +} + +type ListVolumesResponse_Entry struct { + Volume *Volume `protobuf:"bytes,1,opt,name=volume,proto3" json:"volume,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListVolumesResponse_Entry) Reset() { *m = ListVolumesResponse_Entry{} } +func (m *ListVolumesResponse_Entry) String() string { return proto.CompactTextString(m) } +func (*ListVolumesResponse_Entry) ProtoMessage() {} +func (*ListVolumesResponse_Entry) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{24, 0} +} +func (m *ListVolumesResponse_Entry) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListVolumesResponse_Entry.Unmarshal(m, b) +} +func (m *ListVolumesResponse_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListVolumesResponse_Entry.Marshal(b, m, deterministic) +} +func (dst *ListVolumesResponse_Entry) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListVolumesResponse_Entry.Merge(dst, src) +} +func (m *ListVolumesResponse_Entry) XXX_Size() int { + return xxx_messageInfo_ListVolumesResponse_Entry.Size(m) +} +func (m *ListVolumesResponse_Entry) XXX_DiscardUnknown() { + xxx_messageInfo_ListVolumesResponse_Entry.DiscardUnknown(m) +} + +var xxx_messageInfo_ListVolumesResponse_Entry proto.InternalMessageInfo + +func (m *ListVolumesResponse_Entry) GetVolume() *Volume { + if m != nil { + return m.Volume + } + return nil +} + +type GetCapacityRequest struct { + // If specified, the Plugin SHALL report the capacity of the storage + // that can be used to provision volumes that satisfy ALL of the + // specified `volume_capabilities`. These are the same + // `volume_capabilities` the CO will use in `CreateVolumeRequest`. + // This field is OPTIONAL. + VolumeCapabilities []*VolumeCapability `protobuf:"bytes,1,rep,name=volume_capabilities,json=volumeCapabilities,proto3" json:"volume_capabilities,omitempty"` + // If specified, the Plugin SHALL report the capacity of the storage + // that can be used to provision volumes with the given Plugin + // specific `parameters`. These are the same `parameters` the CO will + // use in `CreateVolumeRequest`. This field is OPTIONAL. + Parameters map[string]string `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // If specified, the Plugin SHALL report the capacity of the storage + // that can be used to provision volumes that in the specified + // `accessible_topology`. This is the same as the + // `accessible_topology` the CO returns in a `CreateVolumeResponse`. + // This field is OPTIONAL. This field SHALL NOT be set unless the + // plugin advertises the VOLUME_ACCESSIBILITY_CONSTRAINTS capability. + AccessibleTopology *Topology `protobuf:"bytes,3,opt,name=accessible_topology,json=accessibleTopology,proto3" json:"accessible_topology,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetCapacityRequest) Reset() { *m = GetCapacityRequest{} } +func (m *GetCapacityRequest) String() string { return proto.CompactTextString(m) } +func (*GetCapacityRequest) ProtoMessage() {} +func (*GetCapacityRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{25} +} +func (m *GetCapacityRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetCapacityRequest.Unmarshal(m, b) +} +func (m *GetCapacityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetCapacityRequest.Marshal(b, m, deterministic) +} +func (dst *GetCapacityRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetCapacityRequest.Merge(dst, src) +} +func (m *GetCapacityRequest) XXX_Size() int { + return xxx_messageInfo_GetCapacityRequest.Size(m) +} +func (m *GetCapacityRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetCapacityRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetCapacityRequest proto.InternalMessageInfo + +func (m *GetCapacityRequest) GetVolumeCapabilities() []*VolumeCapability { + if m != nil { + return m.VolumeCapabilities + } + return nil +} + +func (m *GetCapacityRequest) GetParameters() map[string]string { + if m != nil { + return m.Parameters + } + return nil +} + +func (m *GetCapacityRequest) GetAccessibleTopology() *Topology { + if m != nil { + return m.AccessibleTopology + } + return nil +} + +type GetCapacityResponse struct { + // The available capacity, in bytes, of the storage that can be used + // to provision volumes. If `volume_capabilities` or `parameters` is + // specified in the request, the Plugin SHALL take those into + // consideration when calculating the available capacity of the + // storage. This field is REQUIRED. + // The value of this field MUST NOT be negative. + AvailableCapacity int64 `protobuf:"varint,1,opt,name=available_capacity,json=availableCapacity,proto3" json:"available_capacity,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetCapacityResponse) Reset() { *m = GetCapacityResponse{} } +func (m *GetCapacityResponse) String() string { return proto.CompactTextString(m) } +func (*GetCapacityResponse) ProtoMessage() {} +func (*GetCapacityResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{26} +} +func (m *GetCapacityResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetCapacityResponse.Unmarshal(m, b) +} +func (m *GetCapacityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetCapacityResponse.Marshal(b, m, deterministic) +} +func (dst *GetCapacityResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetCapacityResponse.Merge(dst, src) +} +func (m *GetCapacityResponse) XXX_Size() int { + return xxx_messageInfo_GetCapacityResponse.Size(m) +} +func (m *GetCapacityResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetCapacityResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetCapacityResponse proto.InternalMessageInfo + +func (m *GetCapacityResponse) GetAvailableCapacity() int64 { + if m != nil { + return m.AvailableCapacity + } + return 0 +} + +type ControllerGetCapabilitiesRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ControllerGetCapabilitiesRequest) Reset() { *m = ControllerGetCapabilitiesRequest{} } +func (m *ControllerGetCapabilitiesRequest) String() string { return proto.CompactTextString(m) } +func (*ControllerGetCapabilitiesRequest) ProtoMessage() {} +func (*ControllerGetCapabilitiesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{27} +} +func (m *ControllerGetCapabilitiesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ControllerGetCapabilitiesRequest.Unmarshal(m, b) +} +func (m *ControllerGetCapabilitiesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ControllerGetCapabilitiesRequest.Marshal(b, m, deterministic) +} +func (dst *ControllerGetCapabilitiesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ControllerGetCapabilitiesRequest.Merge(dst, src) +} +func (m *ControllerGetCapabilitiesRequest) XXX_Size() int { + return xxx_messageInfo_ControllerGetCapabilitiesRequest.Size(m) +} +func (m *ControllerGetCapabilitiesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ControllerGetCapabilitiesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ControllerGetCapabilitiesRequest proto.InternalMessageInfo + +type ControllerGetCapabilitiesResponse struct { + // All the capabilities that the controller service supports. This + // field is OPTIONAL. + Capabilities []*ControllerServiceCapability `protobuf:"bytes,1,rep,name=capabilities,proto3" json:"capabilities,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ControllerGetCapabilitiesResponse) Reset() { *m = ControllerGetCapabilitiesResponse{} } +func (m *ControllerGetCapabilitiesResponse) String() string { return proto.CompactTextString(m) } +func (*ControllerGetCapabilitiesResponse) ProtoMessage() {} +func (*ControllerGetCapabilitiesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{28} +} +func (m *ControllerGetCapabilitiesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ControllerGetCapabilitiesResponse.Unmarshal(m, b) +} +func (m *ControllerGetCapabilitiesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ControllerGetCapabilitiesResponse.Marshal(b, m, deterministic) +} +func (dst *ControllerGetCapabilitiesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ControllerGetCapabilitiesResponse.Merge(dst, src) +} +func (m *ControllerGetCapabilitiesResponse) XXX_Size() int { + return xxx_messageInfo_ControllerGetCapabilitiesResponse.Size(m) +} +func (m *ControllerGetCapabilitiesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ControllerGetCapabilitiesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ControllerGetCapabilitiesResponse proto.InternalMessageInfo + +func (m *ControllerGetCapabilitiesResponse) GetCapabilities() []*ControllerServiceCapability { + if m != nil { + return m.Capabilities + } + return nil +} + +// Specifies a capability of the controller service. +type ControllerServiceCapability struct { + // Types that are valid to be assigned to Type: + // *ControllerServiceCapability_Rpc + Type isControllerServiceCapability_Type `protobuf_oneof:"type"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ControllerServiceCapability) Reset() { *m = ControllerServiceCapability{} } +func (m *ControllerServiceCapability) String() string { return proto.CompactTextString(m) } +func (*ControllerServiceCapability) ProtoMessage() {} +func (*ControllerServiceCapability) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{29} +} +func (m *ControllerServiceCapability) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ControllerServiceCapability.Unmarshal(m, b) +} +func (m *ControllerServiceCapability) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ControllerServiceCapability.Marshal(b, m, deterministic) +} +func (dst *ControllerServiceCapability) XXX_Merge(src proto.Message) { + xxx_messageInfo_ControllerServiceCapability.Merge(dst, src) +} +func (m *ControllerServiceCapability) XXX_Size() int { + return xxx_messageInfo_ControllerServiceCapability.Size(m) +} +func (m *ControllerServiceCapability) XXX_DiscardUnknown() { + xxx_messageInfo_ControllerServiceCapability.DiscardUnknown(m) +} + +var xxx_messageInfo_ControllerServiceCapability proto.InternalMessageInfo + +type isControllerServiceCapability_Type interface { + isControllerServiceCapability_Type() +} + +type ControllerServiceCapability_Rpc struct { + Rpc *ControllerServiceCapability_RPC `protobuf:"bytes,1,opt,name=rpc,proto3,oneof"` +} + +func (*ControllerServiceCapability_Rpc) isControllerServiceCapability_Type() {} + +func (m *ControllerServiceCapability) GetType() isControllerServiceCapability_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *ControllerServiceCapability) GetRpc() *ControllerServiceCapability_RPC { + if x, ok := m.GetType().(*ControllerServiceCapability_Rpc); ok { + return x.Rpc + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ControllerServiceCapability) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ControllerServiceCapability_OneofMarshaler, _ControllerServiceCapability_OneofUnmarshaler, _ControllerServiceCapability_OneofSizer, []interface{}{ + (*ControllerServiceCapability_Rpc)(nil), + } +} + +func _ControllerServiceCapability_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ControllerServiceCapability) + // type + switch x := m.Type.(type) { + case *ControllerServiceCapability_Rpc: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Rpc); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ControllerServiceCapability.Type has unexpected type %T", x) + } + return nil +} + +func _ControllerServiceCapability_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ControllerServiceCapability) + switch tag { + case 1: // type.rpc + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ControllerServiceCapability_RPC) + err := b.DecodeMessage(msg) + m.Type = &ControllerServiceCapability_Rpc{msg} + return true, err + default: + return false, nil + } +} + +func _ControllerServiceCapability_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ControllerServiceCapability) + // type + switch x := m.Type.(type) { + case *ControllerServiceCapability_Rpc: + s := proto.Size(x.Rpc) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type ControllerServiceCapability_RPC struct { + Type ControllerServiceCapability_RPC_Type `protobuf:"varint,1,opt,name=type,proto3,enum=csitest.v1.ControllerServiceCapability_RPC_Type" json:"type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ControllerServiceCapability_RPC) Reset() { *m = ControllerServiceCapability_RPC{} } +func (m *ControllerServiceCapability_RPC) String() string { return proto.CompactTextString(m) } +func (*ControllerServiceCapability_RPC) ProtoMessage() {} +func (*ControllerServiceCapability_RPC) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{29, 0} +} +func (m *ControllerServiceCapability_RPC) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ControllerServiceCapability_RPC.Unmarshal(m, b) +} +func (m *ControllerServiceCapability_RPC) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ControllerServiceCapability_RPC.Marshal(b, m, deterministic) +} +func (dst *ControllerServiceCapability_RPC) XXX_Merge(src proto.Message) { + xxx_messageInfo_ControllerServiceCapability_RPC.Merge(dst, src) +} +func (m *ControllerServiceCapability_RPC) XXX_Size() int { + return xxx_messageInfo_ControllerServiceCapability_RPC.Size(m) +} +func (m *ControllerServiceCapability_RPC) XXX_DiscardUnknown() { + xxx_messageInfo_ControllerServiceCapability_RPC.DiscardUnknown(m) +} + +var xxx_messageInfo_ControllerServiceCapability_RPC proto.InternalMessageInfo + +func (m *ControllerServiceCapability_RPC) GetType() ControllerServiceCapability_RPC_Type { + if m != nil { + return m.Type + } + return ControllerServiceCapability_RPC_UNKNOWN +} + +type CreateSnapshotRequest struct { + // The ID of the source volume to be snapshotted. + // This field is REQUIRED. + SourceVolumeId string `protobuf:"bytes,1,opt,name=source_volume_id,json=sourceVolumeId,proto3" json:"source_volume_id,omitempty"` + // The suggested name for the snapshot. This field is REQUIRED for + // idempotency. + // Any Unicode string that conforms to the length limit is allowed + // except those containing the following banned characters: + // U+0000-U+0008, U+000B, U+000C, U+000E-U+001F, U+007F-U+009F. + // (These are control characters other than commonly used whitespace.) + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Secrets required by plugin to complete snapshot creation request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + Secrets map[string]string `protobuf:"bytes,3,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Plugin specific parameters passed in as opaque key-value pairs. + // This field is OPTIONAL. The Plugin is responsible for parsing and + // validating these parameters. COs will treat these as opaque. + // Use cases for opaque parameters: + // - Specify a policy to automatically clean up the snapshot. + // - Specify an expiration date for the snapshot. + // - Specify whether the snapshot is readonly or read/write. + // - Specify if the snapshot should be replicated to some place. + // - Specify primary or secondary for replication systems that + // support snapshotting only on primary. + Parameters map[string]string `protobuf:"bytes,4,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateSnapshotRequest) Reset() { *m = CreateSnapshotRequest{} } +func (m *CreateSnapshotRequest) String() string { return proto.CompactTextString(m) } +func (*CreateSnapshotRequest) ProtoMessage() {} +func (*CreateSnapshotRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{30} +} +func (m *CreateSnapshotRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateSnapshotRequest.Unmarshal(m, b) +} +func (m *CreateSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateSnapshotRequest.Marshal(b, m, deterministic) +} +func (dst *CreateSnapshotRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateSnapshotRequest.Merge(dst, src) +} +func (m *CreateSnapshotRequest) XXX_Size() int { + return xxx_messageInfo_CreateSnapshotRequest.Size(m) +} +func (m *CreateSnapshotRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateSnapshotRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateSnapshotRequest proto.InternalMessageInfo + +func (m *CreateSnapshotRequest) GetSourceVolumeId() string { + if m != nil { + return m.SourceVolumeId + } + return "" +} + +func (m *CreateSnapshotRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateSnapshotRequest) GetSecrets() map[string]string { + if m != nil { + return m.Secrets + } + return nil +} + +func (m *CreateSnapshotRequest) GetParameters() map[string]string { + if m != nil { + return m.Parameters + } + return nil +} + +type CreateSnapshotResponse struct { + // Contains all attributes of the newly created snapshot that are + // relevant to the CO along with information required by the Plugin + // to uniquely identify the snapshot. This field is REQUIRED. + Snapshot *Snapshot `protobuf:"bytes,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateSnapshotResponse) Reset() { *m = CreateSnapshotResponse{} } +func (m *CreateSnapshotResponse) String() string { return proto.CompactTextString(m) } +func (*CreateSnapshotResponse) ProtoMessage() {} +func (*CreateSnapshotResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{31} +} +func (m *CreateSnapshotResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateSnapshotResponse.Unmarshal(m, b) +} +func (m *CreateSnapshotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateSnapshotResponse.Marshal(b, m, deterministic) +} +func (dst *CreateSnapshotResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateSnapshotResponse.Merge(dst, src) +} +func (m *CreateSnapshotResponse) XXX_Size() int { + return xxx_messageInfo_CreateSnapshotResponse.Size(m) +} +func (m *CreateSnapshotResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateSnapshotResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateSnapshotResponse proto.InternalMessageInfo + +func (m *CreateSnapshotResponse) GetSnapshot() *Snapshot { + if m != nil { + return m.Snapshot + } + return nil +} + +// Information about a specific snapshot. +type Snapshot struct { + // This is the complete size of the snapshot in bytes. The purpose of + // this field is to give CO guidance on how much space is needed to + // create a volume from this snapshot. The size of the volume MUST NOT + // be less than the size of the source snapshot. This field is + // OPTIONAL. If this field is not set, it indicates that this size is + // unknown. The value of this field MUST NOT be negative and a size of + // zero means it is unspecified. + SizeBytes int64 `protobuf:"varint,1,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"` + // The identifier for this snapshot, generated by the plugin. + // This field is REQUIRED. + // This field MUST contain enough information to uniquely identify + // this specific snapshot vs all other snapshots supported by this + // plugin. + // This field SHALL be used by the CO in subsequent calls to refer to + // this snapshot. + // The SP is NOT responsible for global uniqueness of snapshot_id + // across multiple SPs. + SnapshotId string `protobuf:"bytes,2,opt,name=snapshot_id,json=snapshotId,proto3" json:"snapshot_id,omitempty"` + // Identity information for the source volume. Note that creating a + // snapshot from a snapshot is not supported here so the source has to + // be a volume. This field is REQUIRED. + SourceVolumeId string `protobuf:"bytes,3,opt,name=source_volume_id,json=sourceVolumeId,proto3" json:"source_volume_id,omitempty"` + // Timestamp when the point-in-time snapshot is taken on the storage + // system. This field is REQUIRED. + CreationTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` + // Indicates if a snapshot is ready to use as a + // `volume_content_source` in a `CreateVolumeRequest`. The default + // value is false. This field is REQUIRED. + ReadyToUse bool `protobuf:"varint,5,opt,name=ready_to_use,json=readyToUse,proto3" json:"ready_to_use,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Snapshot) Reset() { *m = Snapshot{} } +func (m *Snapshot) String() string { return proto.CompactTextString(m) } +func (*Snapshot) ProtoMessage() {} +func (*Snapshot) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{32} +} +func (m *Snapshot) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Snapshot.Unmarshal(m, b) +} +func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic) +} +func (dst *Snapshot) XXX_Merge(src proto.Message) { + xxx_messageInfo_Snapshot.Merge(dst, src) +} +func (m *Snapshot) XXX_Size() int { + return xxx_messageInfo_Snapshot.Size(m) +} +func (m *Snapshot) XXX_DiscardUnknown() { + xxx_messageInfo_Snapshot.DiscardUnknown(m) +} + +var xxx_messageInfo_Snapshot proto.InternalMessageInfo + +func (m *Snapshot) GetSizeBytes() int64 { + if m != nil { + return m.SizeBytes + } + return 0 +} + +func (m *Snapshot) GetSnapshotId() string { + if m != nil { + return m.SnapshotId + } + return "" +} + +func (m *Snapshot) GetSourceVolumeId() string { + if m != nil { + return m.SourceVolumeId + } + return "" +} + +func (m *Snapshot) GetCreationTime() *timestamp.Timestamp { + if m != nil { + return m.CreationTime + } + return nil +} + +func (m *Snapshot) GetReadyToUse() bool { + if m != nil { + return m.ReadyToUse + } + return false +} + +type DeleteSnapshotRequest struct { + // The ID of the snapshot to be deleted. + // This field is REQUIRED. + SnapshotId string `protobuf:"bytes,1,opt,name=snapshot_id,json=snapshotId,proto3" json:"snapshot_id,omitempty"` + // Secrets required by plugin to complete snapshot deletion request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + Secrets map[string]string `protobuf:"bytes,2,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteSnapshotRequest) Reset() { *m = DeleteSnapshotRequest{} } +func (m *DeleteSnapshotRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteSnapshotRequest) ProtoMessage() {} +func (*DeleteSnapshotRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{33} +} +func (m *DeleteSnapshotRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteSnapshotRequest.Unmarshal(m, b) +} +func (m *DeleteSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteSnapshotRequest.Marshal(b, m, deterministic) +} +func (dst *DeleteSnapshotRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteSnapshotRequest.Merge(dst, src) +} +func (m *DeleteSnapshotRequest) XXX_Size() int { + return xxx_messageInfo_DeleteSnapshotRequest.Size(m) +} +func (m *DeleteSnapshotRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteSnapshotRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteSnapshotRequest proto.InternalMessageInfo + +func (m *DeleteSnapshotRequest) GetSnapshotId() string { + if m != nil { + return m.SnapshotId + } + return "" +} + +func (m *DeleteSnapshotRequest) GetSecrets() map[string]string { + if m != nil { + return m.Secrets + } + return nil +} + +type DeleteSnapshotResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteSnapshotResponse) Reset() { *m = DeleteSnapshotResponse{} } +func (m *DeleteSnapshotResponse) String() string { return proto.CompactTextString(m) } +func (*DeleteSnapshotResponse) ProtoMessage() {} +func (*DeleteSnapshotResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{34} +} +func (m *DeleteSnapshotResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteSnapshotResponse.Unmarshal(m, b) +} +func (m *DeleteSnapshotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteSnapshotResponse.Marshal(b, m, deterministic) +} +func (dst *DeleteSnapshotResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteSnapshotResponse.Merge(dst, src) +} +func (m *DeleteSnapshotResponse) XXX_Size() int { + return xxx_messageInfo_DeleteSnapshotResponse.Size(m) +} +func (m *DeleteSnapshotResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteSnapshotResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteSnapshotResponse proto.InternalMessageInfo + +// List all snapshots on the storage system regardless of how they were +// created. +type ListSnapshotsRequest struct { + // If specified (non-zero value), the Plugin MUST NOT return more + // entries than this number in the response. If the actual number of + // entries is more than this number, the Plugin MUST set `next_token` + // in the response which can be used to get the next page of entries + // in the subsequent `ListSnapshots` call. This field is OPTIONAL. If + // not specified (zero value), it means there is no restriction on the + // number of entries that can be returned. + // The value of this field MUST NOT be negative. + MaxEntries int32 `protobuf:"varint,1,opt,name=max_entries,json=maxEntries,proto3" json:"max_entries,omitempty"` + // A token to specify where to start paginating. Set this field to + // `next_token` returned by a previous `ListSnapshots` call to get the + // next page of entries. This field is OPTIONAL. + // An empty string is equal to an unspecified field value. + StartingToken string `protobuf:"bytes,2,opt,name=starting_token,json=startingToken,proto3" json:"starting_token,omitempty"` + // Identity information for the source volume. This field is OPTIONAL. + // It can be used to list snapshots by volume. + SourceVolumeId string `protobuf:"bytes,3,opt,name=source_volume_id,json=sourceVolumeId,proto3" json:"source_volume_id,omitempty"` + // Identity information for a specific snapshot. This field is + // OPTIONAL. It can be used to list only a specific snapshot. + // ListSnapshots will return with current snapshot information + // and will not block if the snapshot is being processed after + // it is cut. + SnapshotId string `protobuf:"bytes,4,opt,name=snapshot_id,json=snapshotId,proto3" json:"snapshot_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListSnapshotsRequest) Reset() { *m = ListSnapshotsRequest{} } +func (m *ListSnapshotsRequest) String() string { return proto.CompactTextString(m) } +func (*ListSnapshotsRequest) ProtoMessage() {} +func (*ListSnapshotsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{35} +} +func (m *ListSnapshotsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListSnapshotsRequest.Unmarshal(m, b) +} +func (m *ListSnapshotsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListSnapshotsRequest.Marshal(b, m, deterministic) +} +func (dst *ListSnapshotsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListSnapshotsRequest.Merge(dst, src) +} +func (m *ListSnapshotsRequest) XXX_Size() int { + return xxx_messageInfo_ListSnapshotsRequest.Size(m) +} +func (m *ListSnapshotsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListSnapshotsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListSnapshotsRequest proto.InternalMessageInfo + +func (m *ListSnapshotsRequest) GetMaxEntries() int32 { + if m != nil { + return m.MaxEntries + } + return 0 +} + +func (m *ListSnapshotsRequest) GetStartingToken() string { + if m != nil { + return m.StartingToken + } + return "" +} + +func (m *ListSnapshotsRequest) GetSourceVolumeId() string { + if m != nil { + return m.SourceVolumeId + } + return "" +} + +func (m *ListSnapshotsRequest) GetSnapshotId() string { + if m != nil { + return m.SnapshotId + } + return "" +} + +type ListSnapshotsResponse struct { + Entries []*ListSnapshotsResponse_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` + // This token allows you to get the next page of entries for + // `ListSnapshots` request. If the number of entries is larger than + // `max_entries`, use the `next_token` as a value for the + // `starting_token` field in the next `ListSnapshots` request. This + // field is OPTIONAL. + // An empty string is equal to an unspecified field value. + NextToken string `protobuf:"bytes,2,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListSnapshotsResponse) Reset() { *m = ListSnapshotsResponse{} } +func (m *ListSnapshotsResponse) String() string { return proto.CompactTextString(m) } +func (*ListSnapshotsResponse) ProtoMessage() {} +func (*ListSnapshotsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{36} +} +func (m *ListSnapshotsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListSnapshotsResponse.Unmarshal(m, b) +} +func (m *ListSnapshotsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListSnapshotsResponse.Marshal(b, m, deterministic) +} +func (dst *ListSnapshotsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListSnapshotsResponse.Merge(dst, src) +} +func (m *ListSnapshotsResponse) XXX_Size() int { + return xxx_messageInfo_ListSnapshotsResponse.Size(m) +} +func (m *ListSnapshotsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListSnapshotsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListSnapshotsResponse proto.InternalMessageInfo + +func (m *ListSnapshotsResponse) GetEntries() []*ListSnapshotsResponse_Entry { + if m != nil { + return m.Entries + } + return nil +} + +func (m *ListSnapshotsResponse) GetNextToken() string { + if m != nil { + return m.NextToken + } + return "" +} + +type ListSnapshotsResponse_Entry struct { + Snapshot *Snapshot `protobuf:"bytes,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListSnapshotsResponse_Entry) Reset() { *m = ListSnapshotsResponse_Entry{} } +func (m *ListSnapshotsResponse_Entry) String() string { return proto.CompactTextString(m) } +func (*ListSnapshotsResponse_Entry) ProtoMessage() {} +func (*ListSnapshotsResponse_Entry) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{36, 0} +} +func (m *ListSnapshotsResponse_Entry) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListSnapshotsResponse_Entry.Unmarshal(m, b) +} +func (m *ListSnapshotsResponse_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListSnapshotsResponse_Entry.Marshal(b, m, deterministic) +} +func (dst *ListSnapshotsResponse_Entry) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListSnapshotsResponse_Entry.Merge(dst, src) +} +func (m *ListSnapshotsResponse_Entry) XXX_Size() int { + return xxx_messageInfo_ListSnapshotsResponse_Entry.Size(m) +} +func (m *ListSnapshotsResponse_Entry) XXX_DiscardUnknown() { + xxx_messageInfo_ListSnapshotsResponse_Entry.DiscardUnknown(m) +} + +var xxx_messageInfo_ListSnapshotsResponse_Entry proto.InternalMessageInfo + +func (m *ListSnapshotsResponse_Entry) GetSnapshot() *Snapshot { + if m != nil { + return m.Snapshot + } + return nil +} + +type NodeStageVolumeRequest struct { + // The ID of the volume to publish. This field is REQUIRED. + VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // The CO SHALL set this field to the value returned by + // `ControllerPublishVolume` if the corresponding Controller Plugin + // has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be + // left unset if the corresponding Controller Plugin does not have + // this capability. This is an OPTIONAL field. + PublishContext map[string]string `protobuf:"bytes,2,rep,name=publish_context,json=publishContext,proto3" json:"publish_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // The path to which the volume MAY be staged. It MUST be an + // absolute path in the root filesystem of the process serving this + // request, and MUST be a directory. The CO SHALL ensure that there + // is only one `staging_target_path` per volume. The CO SHALL ensure + // that the path is directory and that the process serving the + // request has `read` and `write` permission to that directory. The + // CO SHALL be responsible for creating the directory if it does not + // exist. + // This is a REQUIRED field. + StagingTargetPath string `protobuf:"bytes,3,opt,name=staging_target_path,json=stagingTargetPath,proto3" json:"staging_target_path,omitempty"` + // Volume capability describing how the CO intends to use this volume. + // SP MUST ensure the CO can use the staged volume as described. + // Otherwise SP MUST return the appropriate gRPC error code. + // This is a REQUIRED field. + VolumeCapability *VolumeCapability `protobuf:"bytes,4,opt,name=volume_capability,json=volumeCapability,proto3" json:"volume_capability,omitempty"` + // Secrets required by plugin to complete node stage volume request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + Secrets map[string]string `protobuf:"bytes,5,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + VolumeContext map[string]string `protobuf:"bytes,6,rep,name=volume_context,json=volumeContext,proto3" json:"volume_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeStageVolumeRequest) Reset() { *m = NodeStageVolumeRequest{} } +func (m *NodeStageVolumeRequest) String() string { return proto.CompactTextString(m) } +func (*NodeStageVolumeRequest) ProtoMessage() {} +func (*NodeStageVolumeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{37} +} +func (m *NodeStageVolumeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeStageVolumeRequest.Unmarshal(m, b) +} +func (m *NodeStageVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeStageVolumeRequest.Marshal(b, m, deterministic) +} +func (dst *NodeStageVolumeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeStageVolumeRequest.Merge(dst, src) +} +func (m *NodeStageVolumeRequest) XXX_Size() int { + return xxx_messageInfo_NodeStageVolumeRequest.Size(m) +} +func (m *NodeStageVolumeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NodeStageVolumeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeStageVolumeRequest proto.InternalMessageInfo + +func (m *NodeStageVolumeRequest) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + return "" +} + +func (m *NodeStageVolumeRequest) GetPublishContext() map[string]string { + if m != nil { + return m.PublishContext + } + return nil +} + +func (m *NodeStageVolumeRequest) GetStagingTargetPath() string { + if m != nil { + return m.StagingTargetPath + } + return "" +} + +func (m *NodeStageVolumeRequest) GetVolumeCapability() *VolumeCapability { + if m != nil { + return m.VolumeCapability + } + return nil +} + +func (m *NodeStageVolumeRequest) GetSecrets() map[string]string { + if m != nil { + return m.Secrets + } + return nil +} + +func (m *NodeStageVolumeRequest) GetVolumeContext() map[string]string { + if m != nil { + return m.VolumeContext + } + return nil +} + +type NodeStageVolumeResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeStageVolumeResponse) Reset() { *m = NodeStageVolumeResponse{} } +func (m *NodeStageVolumeResponse) String() string { return proto.CompactTextString(m) } +func (*NodeStageVolumeResponse) ProtoMessage() {} +func (*NodeStageVolumeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{38} +} +func (m *NodeStageVolumeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeStageVolumeResponse.Unmarshal(m, b) +} +func (m *NodeStageVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeStageVolumeResponse.Marshal(b, m, deterministic) +} +func (dst *NodeStageVolumeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeStageVolumeResponse.Merge(dst, src) +} +func (m *NodeStageVolumeResponse) XXX_Size() int { + return xxx_messageInfo_NodeStageVolumeResponse.Size(m) +} +func (m *NodeStageVolumeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NodeStageVolumeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeStageVolumeResponse proto.InternalMessageInfo + +type NodeUnstageVolumeRequest struct { + // The ID of the volume. This field is REQUIRED. + VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // The path at which the volume was staged. It MUST be an absolute + // path in the root filesystem of the process serving this request. + // This is a REQUIRED field. + StagingTargetPath string `protobuf:"bytes,2,opt,name=staging_target_path,json=stagingTargetPath,proto3" json:"staging_target_path,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeUnstageVolumeRequest) Reset() { *m = NodeUnstageVolumeRequest{} } +func (m *NodeUnstageVolumeRequest) String() string { return proto.CompactTextString(m) } +func (*NodeUnstageVolumeRequest) ProtoMessage() {} +func (*NodeUnstageVolumeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{39} +} +func (m *NodeUnstageVolumeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeUnstageVolumeRequest.Unmarshal(m, b) +} +func (m *NodeUnstageVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeUnstageVolumeRequest.Marshal(b, m, deterministic) +} +func (dst *NodeUnstageVolumeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeUnstageVolumeRequest.Merge(dst, src) +} +func (m *NodeUnstageVolumeRequest) XXX_Size() int { + return xxx_messageInfo_NodeUnstageVolumeRequest.Size(m) +} +func (m *NodeUnstageVolumeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NodeUnstageVolumeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeUnstageVolumeRequest proto.InternalMessageInfo + +func (m *NodeUnstageVolumeRequest) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + return "" +} + +func (m *NodeUnstageVolumeRequest) GetStagingTargetPath() string { + if m != nil { + return m.StagingTargetPath + } + return "" +} + +type NodeUnstageVolumeResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeUnstageVolumeResponse) Reset() { *m = NodeUnstageVolumeResponse{} } +func (m *NodeUnstageVolumeResponse) String() string { return proto.CompactTextString(m) } +func (*NodeUnstageVolumeResponse) ProtoMessage() {} +func (*NodeUnstageVolumeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{40} +} +func (m *NodeUnstageVolumeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeUnstageVolumeResponse.Unmarshal(m, b) +} +func (m *NodeUnstageVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeUnstageVolumeResponse.Marshal(b, m, deterministic) +} +func (dst *NodeUnstageVolumeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeUnstageVolumeResponse.Merge(dst, src) +} +func (m *NodeUnstageVolumeResponse) XXX_Size() int { + return xxx_messageInfo_NodeUnstageVolumeResponse.Size(m) +} +func (m *NodeUnstageVolumeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NodeUnstageVolumeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeUnstageVolumeResponse proto.InternalMessageInfo + +type NodePublishVolumeRequest struct { + // The ID of the volume to publish. This field is REQUIRED. + VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // The CO SHALL set this field to the value returned by + // `ControllerPublishVolume` if the corresponding Controller Plugin + // has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be + // left unset if the corresponding Controller Plugin does not have + // this capability. This is an OPTIONAL field. + PublishContext map[string]string `protobuf:"bytes,2,rep,name=publish_context,json=publishContext,proto3" json:"publish_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // The path to which the volume was staged by `NodeStageVolume`. + // It MUST be an absolute path in the root filesystem of the process + // serving this request. + // It MUST be set if the Node Plugin implements the + // `STAGE_UNSTAGE_VOLUME` node capability. + // This is an OPTIONAL field. + StagingTargetPath string `protobuf:"bytes,3,opt,name=staging_target_path,json=stagingTargetPath,proto3" json:"staging_target_path,omitempty"` + // The path to which the volume will be published. It MUST be an + // absolute path in the root filesystem of the process serving this + // request. The CO SHALL ensure uniqueness of target_path per volume. + // The CO SHALL ensure that the parent directory of this path exists + // and that the process serving the request has `read` and `write` + // permissions to that parent directory. + // For volumes with an access type of block, the SP SHALL place the + // block device at target_path. + // For volumes with an access type of mount, the SP SHALL place the + // mounted directory at target_path. + // Creation of target_path is the responsibility of the SP. + // This is a REQUIRED field. + TargetPath string `protobuf:"bytes,4,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"` + // Volume capability describing how the CO intends to use this volume. + // SP MUST ensure the CO can use the published volume as described. + // Otherwise SP MUST return the appropriate gRPC error code. + // This is a REQUIRED field. + VolumeCapability *VolumeCapability `protobuf:"bytes,5,opt,name=volume_capability,json=volumeCapability,proto3" json:"volume_capability,omitempty"` + // Indicates SP MUST publish the volume in readonly mode. + // This field is REQUIRED. + Readonly bool `protobuf:"varint,6,opt,name=readonly,proto3" json:"readonly,omitempty"` + // Secrets required by plugin to complete node publish volume request. + // This field is OPTIONAL. Refer to the `Secrets Requirements` + // section on how to use this field. + Secrets map[string]string `protobuf:"bytes,7,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Volume context as returned by CO in CreateVolumeRequest. This field + // is OPTIONAL and MUST match the volume_context of the volume + // identified by `volume_id`. + VolumeContext map[string]string `protobuf:"bytes,8,rep,name=volume_context,json=volumeContext,proto3" json:"volume_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodePublishVolumeRequest) Reset() { *m = NodePublishVolumeRequest{} } +func (m *NodePublishVolumeRequest) String() string { return proto.CompactTextString(m) } +func (*NodePublishVolumeRequest) ProtoMessage() {} +func (*NodePublishVolumeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{41} +} +func (m *NodePublishVolumeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodePublishVolumeRequest.Unmarshal(m, b) +} +func (m *NodePublishVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodePublishVolumeRequest.Marshal(b, m, deterministic) +} +func (dst *NodePublishVolumeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodePublishVolumeRequest.Merge(dst, src) +} +func (m *NodePublishVolumeRequest) XXX_Size() int { + return xxx_messageInfo_NodePublishVolumeRequest.Size(m) +} +func (m *NodePublishVolumeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NodePublishVolumeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NodePublishVolumeRequest proto.InternalMessageInfo + +func (m *NodePublishVolumeRequest) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + return "" +} + +func (m *NodePublishVolumeRequest) GetPublishContext() map[string]string { + if m != nil { + return m.PublishContext + } + return nil +} + +func (m *NodePublishVolumeRequest) GetStagingTargetPath() string { + if m != nil { + return m.StagingTargetPath + } + return "" +} + +func (m *NodePublishVolumeRequest) GetTargetPath() string { + if m != nil { + return m.TargetPath + } + return "" +} + +func (m *NodePublishVolumeRequest) GetVolumeCapability() *VolumeCapability { + if m != nil { + return m.VolumeCapability + } + return nil +} + +func (m *NodePublishVolumeRequest) GetReadonly() bool { + if m != nil { + return m.Readonly + } + return false +} + +func (m *NodePublishVolumeRequest) GetSecrets() map[string]string { + if m != nil { + return m.Secrets + } + return nil +} + +func (m *NodePublishVolumeRequest) GetVolumeContext() map[string]string { + if m != nil { + return m.VolumeContext + } + return nil +} + +type NodePublishVolumeResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodePublishVolumeResponse) Reset() { *m = NodePublishVolumeResponse{} } +func (m *NodePublishVolumeResponse) String() string { return proto.CompactTextString(m) } +func (*NodePublishVolumeResponse) ProtoMessage() {} +func (*NodePublishVolumeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{42} +} +func (m *NodePublishVolumeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodePublishVolumeResponse.Unmarshal(m, b) +} +func (m *NodePublishVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodePublishVolumeResponse.Marshal(b, m, deterministic) +} +func (dst *NodePublishVolumeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodePublishVolumeResponse.Merge(dst, src) +} +func (m *NodePublishVolumeResponse) XXX_Size() int { + return xxx_messageInfo_NodePublishVolumeResponse.Size(m) +} +func (m *NodePublishVolumeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NodePublishVolumeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NodePublishVolumeResponse proto.InternalMessageInfo + +type NodeUnpublishVolumeRequest struct { + // The ID of the volume. This field is REQUIRED. + VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // The path at which the volume was published. It MUST be an absolute + // path in the root filesystem of the process serving this request. + // The SP MUST delete the file or directory it created at this path. + // This is a REQUIRED field. + TargetPath string `protobuf:"bytes,2,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeUnpublishVolumeRequest) Reset() { *m = NodeUnpublishVolumeRequest{} } +func (m *NodeUnpublishVolumeRequest) String() string { return proto.CompactTextString(m) } +func (*NodeUnpublishVolumeRequest) ProtoMessage() {} +func (*NodeUnpublishVolumeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{43} +} +func (m *NodeUnpublishVolumeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeUnpublishVolumeRequest.Unmarshal(m, b) +} +func (m *NodeUnpublishVolumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeUnpublishVolumeRequest.Marshal(b, m, deterministic) +} +func (dst *NodeUnpublishVolumeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeUnpublishVolumeRequest.Merge(dst, src) +} +func (m *NodeUnpublishVolumeRequest) XXX_Size() int { + return xxx_messageInfo_NodeUnpublishVolumeRequest.Size(m) +} +func (m *NodeUnpublishVolumeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NodeUnpublishVolumeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeUnpublishVolumeRequest proto.InternalMessageInfo + +func (m *NodeUnpublishVolumeRequest) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + return "" +} + +func (m *NodeUnpublishVolumeRequest) GetTargetPath() string { + if m != nil { + return m.TargetPath + } + return "" +} + +type NodeUnpublishVolumeResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeUnpublishVolumeResponse) Reset() { *m = NodeUnpublishVolumeResponse{} } +func (m *NodeUnpublishVolumeResponse) String() string { return proto.CompactTextString(m) } +func (*NodeUnpublishVolumeResponse) ProtoMessage() {} +func (*NodeUnpublishVolumeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{44} +} +func (m *NodeUnpublishVolumeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeUnpublishVolumeResponse.Unmarshal(m, b) +} +func (m *NodeUnpublishVolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeUnpublishVolumeResponse.Marshal(b, m, deterministic) +} +func (dst *NodeUnpublishVolumeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeUnpublishVolumeResponse.Merge(dst, src) +} +func (m *NodeUnpublishVolumeResponse) XXX_Size() int { + return xxx_messageInfo_NodeUnpublishVolumeResponse.Size(m) +} +func (m *NodeUnpublishVolumeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NodeUnpublishVolumeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeUnpublishVolumeResponse proto.InternalMessageInfo + +type NodeGetVolumeStatsRequest struct { + // The ID of the volume. This field is REQUIRED. + VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // It can be any valid path where volume was previously + // staged or published. + // It MUST be an absolute path in the root filesystem of + // the process serving this request. + // This is a REQUIRED field. + VolumePath string `protobuf:"bytes,2,opt,name=volume_path,json=volumePath,proto3" json:"volume_path,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeGetVolumeStatsRequest) Reset() { *m = NodeGetVolumeStatsRequest{} } +func (m *NodeGetVolumeStatsRequest) String() string { return proto.CompactTextString(m) } +func (*NodeGetVolumeStatsRequest) ProtoMessage() {} +func (*NodeGetVolumeStatsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{45} +} +func (m *NodeGetVolumeStatsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeGetVolumeStatsRequest.Unmarshal(m, b) +} +func (m *NodeGetVolumeStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeGetVolumeStatsRequest.Marshal(b, m, deterministic) +} +func (dst *NodeGetVolumeStatsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeGetVolumeStatsRequest.Merge(dst, src) +} +func (m *NodeGetVolumeStatsRequest) XXX_Size() int { + return xxx_messageInfo_NodeGetVolumeStatsRequest.Size(m) +} +func (m *NodeGetVolumeStatsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NodeGetVolumeStatsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeGetVolumeStatsRequest proto.InternalMessageInfo + +func (m *NodeGetVolumeStatsRequest) GetVolumeId() string { + if m != nil { + return m.VolumeId + } + return "" +} + +func (m *NodeGetVolumeStatsRequest) GetVolumePath() string { + if m != nil { + return m.VolumePath + } + return "" +} + +type NodeGetVolumeStatsResponse struct { + // This field is OPTIONAL. + Usage []*VolumeUsage `protobuf:"bytes,1,rep,name=usage,proto3" json:"usage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeGetVolumeStatsResponse) Reset() { *m = NodeGetVolumeStatsResponse{} } +func (m *NodeGetVolumeStatsResponse) String() string { return proto.CompactTextString(m) } +func (*NodeGetVolumeStatsResponse) ProtoMessage() {} +func (*NodeGetVolumeStatsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{46} +} +func (m *NodeGetVolumeStatsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeGetVolumeStatsResponse.Unmarshal(m, b) +} +func (m *NodeGetVolumeStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeGetVolumeStatsResponse.Marshal(b, m, deterministic) +} +func (dst *NodeGetVolumeStatsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeGetVolumeStatsResponse.Merge(dst, src) +} +func (m *NodeGetVolumeStatsResponse) XXX_Size() int { + return xxx_messageInfo_NodeGetVolumeStatsResponse.Size(m) +} +func (m *NodeGetVolumeStatsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NodeGetVolumeStatsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeGetVolumeStatsResponse proto.InternalMessageInfo + +func (m *NodeGetVolumeStatsResponse) GetUsage() []*VolumeUsage { + if m != nil { + return m.Usage + } + return nil +} + +type VolumeUsage struct { + // The available capacity in specified Unit. This field is OPTIONAL. + // The value of this field MUST NOT be negative. + Available int64 `protobuf:"varint,1,opt,name=available,proto3" json:"available,omitempty"` + // The total capacity in specified Unit. This field is REQUIRED. + // The value of this field MUST NOT be negative. + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + // The used capacity in specified Unit. This field is OPTIONAL. + // The value of this field MUST NOT be negative. + Used int64 `protobuf:"varint,3,opt,name=used,proto3" json:"used,omitempty"` + // Units by which values are measured. This field is REQUIRED. + Unit VolumeUsage_Unit `protobuf:"varint,4,opt,name=unit,proto3,enum=csitest.v1.VolumeUsage_Unit" json:"unit,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VolumeUsage) Reset() { *m = VolumeUsage{} } +func (m *VolumeUsage) String() string { return proto.CompactTextString(m) } +func (*VolumeUsage) ProtoMessage() {} +func (*VolumeUsage) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{47} +} +func (m *VolumeUsage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VolumeUsage.Unmarshal(m, b) +} +func (m *VolumeUsage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VolumeUsage.Marshal(b, m, deterministic) +} +func (dst *VolumeUsage) XXX_Merge(src proto.Message) { + xxx_messageInfo_VolumeUsage.Merge(dst, src) +} +func (m *VolumeUsage) XXX_Size() int { + return xxx_messageInfo_VolumeUsage.Size(m) +} +func (m *VolumeUsage) XXX_DiscardUnknown() { + xxx_messageInfo_VolumeUsage.DiscardUnknown(m) +} + +var xxx_messageInfo_VolumeUsage proto.InternalMessageInfo + +func (m *VolumeUsage) GetAvailable() int64 { + if m != nil { + return m.Available + } + return 0 +} + +func (m *VolumeUsage) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *VolumeUsage) GetUsed() int64 { + if m != nil { + return m.Used + } + return 0 +} + +func (m *VolumeUsage) GetUnit() VolumeUsage_Unit { + if m != nil { + return m.Unit + } + return VolumeUsage_UNKNOWN +} + +type NodeGetCapabilitiesRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeGetCapabilitiesRequest) Reset() { *m = NodeGetCapabilitiesRequest{} } +func (m *NodeGetCapabilitiesRequest) String() string { return proto.CompactTextString(m) } +func (*NodeGetCapabilitiesRequest) ProtoMessage() {} +func (*NodeGetCapabilitiesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{48} +} +func (m *NodeGetCapabilitiesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeGetCapabilitiesRequest.Unmarshal(m, b) +} +func (m *NodeGetCapabilitiesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeGetCapabilitiesRequest.Marshal(b, m, deterministic) +} +func (dst *NodeGetCapabilitiesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeGetCapabilitiesRequest.Merge(dst, src) +} +func (m *NodeGetCapabilitiesRequest) XXX_Size() int { + return xxx_messageInfo_NodeGetCapabilitiesRequest.Size(m) +} +func (m *NodeGetCapabilitiesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NodeGetCapabilitiesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeGetCapabilitiesRequest proto.InternalMessageInfo + +type NodeGetCapabilitiesResponse struct { + // All the capabilities that the node service supports. This field + // is OPTIONAL. + Capabilities []*NodeServiceCapability `protobuf:"bytes,1,rep,name=capabilities,proto3" json:"capabilities,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeGetCapabilitiesResponse) Reset() { *m = NodeGetCapabilitiesResponse{} } +func (m *NodeGetCapabilitiesResponse) String() string { return proto.CompactTextString(m) } +func (*NodeGetCapabilitiesResponse) ProtoMessage() {} +func (*NodeGetCapabilitiesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{49} +} +func (m *NodeGetCapabilitiesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeGetCapabilitiesResponse.Unmarshal(m, b) +} +func (m *NodeGetCapabilitiesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeGetCapabilitiesResponse.Marshal(b, m, deterministic) +} +func (dst *NodeGetCapabilitiesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeGetCapabilitiesResponse.Merge(dst, src) +} +func (m *NodeGetCapabilitiesResponse) XXX_Size() int { + return xxx_messageInfo_NodeGetCapabilitiesResponse.Size(m) +} +func (m *NodeGetCapabilitiesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NodeGetCapabilitiesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeGetCapabilitiesResponse proto.InternalMessageInfo + +func (m *NodeGetCapabilitiesResponse) GetCapabilities() []*NodeServiceCapability { + if m != nil { + return m.Capabilities + } + return nil +} + +// Specifies a capability of the node service. +type NodeServiceCapability struct { + // Types that are valid to be assigned to Type: + // *NodeServiceCapability_Rpc + Type isNodeServiceCapability_Type `protobuf_oneof:"type"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeServiceCapability) Reset() { *m = NodeServiceCapability{} } +func (m *NodeServiceCapability) String() string { return proto.CompactTextString(m) } +func (*NodeServiceCapability) ProtoMessage() {} +func (*NodeServiceCapability) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{50} +} +func (m *NodeServiceCapability) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeServiceCapability.Unmarshal(m, b) +} +func (m *NodeServiceCapability) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeServiceCapability.Marshal(b, m, deterministic) +} +func (dst *NodeServiceCapability) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeServiceCapability.Merge(dst, src) +} +func (m *NodeServiceCapability) XXX_Size() int { + return xxx_messageInfo_NodeServiceCapability.Size(m) +} +func (m *NodeServiceCapability) XXX_DiscardUnknown() { + xxx_messageInfo_NodeServiceCapability.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeServiceCapability proto.InternalMessageInfo + +type isNodeServiceCapability_Type interface { + isNodeServiceCapability_Type() +} + +type NodeServiceCapability_Rpc struct { + Rpc *NodeServiceCapability_RPC `protobuf:"bytes,1,opt,name=rpc,proto3,oneof"` +} + +func (*NodeServiceCapability_Rpc) isNodeServiceCapability_Type() {} + +func (m *NodeServiceCapability) GetType() isNodeServiceCapability_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *NodeServiceCapability) GetRpc() *NodeServiceCapability_RPC { + if x, ok := m.GetType().(*NodeServiceCapability_Rpc); ok { + return x.Rpc + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*NodeServiceCapability) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _NodeServiceCapability_OneofMarshaler, _NodeServiceCapability_OneofUnmarshaler, _NodeServiceCapability_OneofSizer, []interface{}{ + (*NodeServiceCapability_Rpc)(nil), + } +} + +func _NodeServiceCapability_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*NodeServiceCapability) + // type + switch x := m.Type.(type) { + case *NodeServiceCapability_Rpc: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Rpc); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("NodeServiceCapability.Type has unexpected type %T", x) + } + return nil +} + +func _NodeServiceCapability_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*NodeServiceCapability) + switch tag { + case 1: // type.rpc + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NodeServiceCapability_RPC) + err := b.DecodeMessage(msg) + m.Type = &NodeServiceCapability_Rpc{msg} + return true, err + default: + return false, nil + } +} + +func _NodeServiceCapability_OneofSizer(msg proto.Message) (n int) { + m := msg.(*NodeServiceCapability) + // type + switch x := m.Type.(type) { + case *NodeServiceCapability_Rpc: + s := proto.Size(x.Rpc) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type NodeServiceCapability_RPC struct { + Type NodeServiceCapability_RPC_Type `protobuf:"varint,1,opt,name=type,proto3,enum=csitest.v1.NodeServiceCapability_RPC_Type" json:"type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeServiceCapability_RPC) Reset() { *m = NodeServiceCapability_RPC{} } +func (m *NodeServiceCapability_RPC) String() string { return proto.CompactTextString(m) } +func (*NodeServiceCapability_RPC) ProtoMessage() {} +func (*NodeServiceCapability_RPC) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{50, 0} +} +func (m *NodeServiceCapability_RPC) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeServiceCapability_RPC.Unmarshal(m, b) +} +func (m *NodeServiceCapability_RPC) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeServiceCapability_RPC.Marshal(b, m, deterministic) +} +func (dst *NodeServiceCapability_RPC) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeServiceCapability_RPC.Merge(dst, src) +} +func (m *NodeServiceCapability_RPC) XXX_Size() int { + return xxx_messageInfo_NodeServiceCapability_RPC.Size(m) +} +func (m *NodeServiceCapability_RPC) XXX_DiscardUnknown() { + xxx_messageInfo_NodeServiceCapability_RPC.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeServiceCapability_RPC proto.InternalMessageInfo + +func (m *NodeServiceCapability_RPC) GetType() NodeServiceCapability_RPC_Type { + if m != nil { + return m.Type + } + return NodeServiceCapability_RPC_UNKNOWN +} + +type NodeGetInfoRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeGetInfoRequest) Reset() { *m = NodeGetInfoRequest{} } +func (m *NodeGetInfoRequest) String() string { return proto.CompactTextString(m) } +func (*NodeGetInfoRequest) ProtoMessage() {} +func (*NodeGetInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{51} +} +func (m *NodeGetInfoRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeGetInfoRequest.Unmarshal(m, b) +} +func (m *NodeGetInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeGetInfoRequest.Marshal(b, m, deterministic) +} +func (dst *NodeGetInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeGetInfoRequest.Merge(dst, src) +} +func (m *NodeGetInfoRequest) XXX_Size() int { + return xxx_messageInfo_NodeGetInfoRequest.Size(m) +} +func (m *NodeGetInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NodeGetInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeGetInfoRequest proto.InternalMessageInfo + +type NodeGetInfoResponse struct { + // The identifier of the node as understood by the SP. + // This field is REQUIRED. + // This field MUST contain enough information to uniquely identify + // this specific node vs all other nodes supported by this plugin. + // This field SHALL be used by the CO in subsequent calls, including + // `ControllerPublishVolume`, to refer to this node. + // The SP is NOT responsible for global uniqueness of node_id across + // multiple SPs. + NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + // Maximum number of volumes that controller can publish to the node. + // If value is not set or zero CO SHALL decide how many volumes of + // this type can be published by the controller to the node. The + // plugin MUST NOT set negative values here. + // This field is OPTIONAL. + MaxVolumesPerNode int64 `protobuf:"varint,2,opt,name=max_volumes_per_node,json=maxVolumesPerNode,proto3" json:"max_volumes_per_node,omitempty"` + // Specifies where (regions, zones, racks, etc.) the node is + // accessible from. + // A plugin that returns this field MUST also set the + // VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability. + // COs MAY use this information along with the topology information + // returned in CreateVolumeResponse to ensure that a given volume is + // accessible from a given node when scheduling workloads. + // This field is OPTIONAL. If it is not specified, the CO MAY assume + // the node is not subject to any topological constraint, and MAY + // schedule workloads that reference any volume V, such that there are + // no topological constraints declared for V. + // + // Example 1: + // accessible_topology = + // {"region": "R1", "zone": "R2"} + // Indicates the node exists within the "region" "R1" and the "zone" + // "Z2". + AccessibleTopology *Topology `protobuf:"bytes,3,opt,name=accessible_topology,json=accessibleTopology,proto3" json:"accessible_topology,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeGetInfoResponse) Reset() { *m = NodeGetInfoResponse{} } +func (m *NodeGetInfoResponse) String() string { return proto.CompactTextString(m) } +func (*NodeGetInfoResponse) ProtoMessage() {} +func (*NodeGetInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_csitest_38acc6c7572d95d8, []int{52} +} +func (m *NodeGetInfoResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeGetInfoResponse.Unmarshal(m, b) +} +func (m *NodeGetInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeGetInfoResponse.Marshal(b, m, deterministic) +} +func (dst *NodeGetInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeGetInfoResponse.Merge(dst, src) +} +func (m *NodeGetInfoResponse) XXX_Size() int { + return xxx_messageInfo_NodeGetInfoResponse.Size(m) +} +func (m *NodeGetInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NodeGetInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeGetInfoResponse proto.InternalMessageInfo + +func (m *NodeGetInfoResponse) GetNodeId() string { + if m != nil { + return m.NodeId + } + return "" +} + +func (m *NodeGetInfoResponse) GetMaxVolumesPerNode() int64 { + if m != nil { + return m.MaxVolumesPerNode + } + return 0 +} + +func (m *NodeGetInfoResponse) GetAccessibleTopology() *Topology { + if m != nil { + return m.AccessibleTopology + } + return nil +} + +func init() { + proto.RegisterType((*GetPluginInfoRequest)(nil), "csitest.v1.GetPluginInfoRequest") + proto.RegisterType((*GetPluginInfoResponse)(nil), "csitest.v1.GetPluginInfoResponse") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.GetPluginInfoResponse.ManifestEntry") + proto.RegisterType((*GetPluginCapabilitiesRequest)(nil), "csitest.v1.GetPluginCapabilitiesRequest") + proto.RegisterType((*GetPluginCapabilitiesResponse)(nil), "csitest.v1.GetPluginCapabilitiesResponse") + proto.RegisterType((*PluginCapability)(nil), "csitest.v1.PluginCapability") + proto.RegisterType((*PluginCapability_Service)(nil), "csitest.v1.PluginCapability.Service") + proto.RegisterType((*ProbeRequest)(nil), "csitest.v1.ProbeRequest") + proto.RegisterType((*ProbeResponse)(nil), "csitest.v1.ProbeResponse") + proto.RegisterType((*CreateVolumeRequest)(nil), "csitest.v1.CreateVolumeRequest") + proto.RegisterMapType((map[int64]*VolumeCapability)(nil), "csitest.v1.CreateVolumeRequest.MaybeSecretMapEntry") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.CreateVolumeRequest.ParametersEntry") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.CreateVolumeRequest.SeecreetsEntry") + proto.RegisterType((*VolumeContentSource)(nil), "csitest.v1.VolumeContentSource") + proto.RegisterType((*VolumeContentSource_SnapshotSource)(nil), "csitest.v1.VolumeContentSource.SnapshotSource") + proto.RegisterType((*VolumeContentSource_VolumeSource)(nil), "csitest.v1.VolumeContentSource.VolumeSource") + proto.RegisterType((*CreateVolumeResponse)(nil), "csitest.v1.CreateVolumeResponse") + proto.RegisterType((*VolumeCapability)(nil), "csitest.v1.VolumeCapability") + proto.RegisterType((*VolumeCapability_BlockVolume)(nil), "csitest.v1.VolumeCapability.BlockVolume") + proto.RegisterType((*VolumeCapability_MountVolume)(nil), "csitest.v1.VolumeCapability.MountVolume") + proto.RegisterType((*VolumeCapability_AccessMode)(nil), "csitest.v1.VolumeCapability.AccessMode") + proto.RegisterType((*CapacityRange)(nil), "csitest.v1.CapacityRange") + proto.RegisterType((*Volume)(nil), "csitest.v1.Volume") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.Volume.VolumeContextEntry") + proto.RegisterType((*TopologyRequirement)(nil), "csitest.v1.TopologyRequirement") + proto.RegisterType((*Topology)(nil), "csitest.v1.Topology") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.Topology.SegmentsEntry") + proto.RegisterType((*DeleteVolumeRequest)(nil), "csitest.v1.DeleteVolumeRequest") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.DeleteVolumeRequest.SecretsEntry") + proto.RegisterType((*DeleteVolumeResponse)(nil), "csitest.v1.DeleteVolumeResponse") + proto.RegisterType((*ControllerPublishVolumeRequest)(nil), "csitest.v1.ControllerPublishVolumeRequest") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.ControllerPublishVolumeRequest.SecretsEntry") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.ControllerPublishVolumeRequest.VolumeContextEntry") + proto.RegisterType((*ControllerPublishVolumeResponse)(nil), "csitest.v1.ControllerPublishVolumeResponse") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.ControllerPublishVolumeResponse.PublishContextEntry") + proto.RegisterType((*ControllerUnpublishVolumeRequest)(nil), "csitest.v1.ControllerUnpublishVolumeRequest") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.ControllerUnpublishVolumeRequest.SecretsEntry") + proto.RegisterType((*ControllerUnpublishVolumeResponse)(nil), "csitest.v1.ControllerUnpublishVolumeResponse") + proto.RegisterType((*ValidateVolumeCapabilitiesRequest)(nil), "csitest.v1.ValidateVolumeCapabilitiesRequest") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.ValidateVolumeCapabilitiesRequest.ParametersEntry") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.ValidateVolumeCapabilitiesRequest.SecretsEntry") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.ValidateVolumeCapabilitiesRequest.VolumeContextEntry") + proto.RegisterType((*ValidateVolumeCapabilitiesResponse)(nil), "csitest.v1.ValidateVolumeCapabilitiesResponse") + proto.RegisterType((*ValidateVolumeCapabilitiesResponse_Confirmed)(nil), "csitest.v1.ValidateVolumeCapabilitiesResponse.Confirmed") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.ValidateVolumeCapabilitiesResponse.Confirmed.ParametersEntry") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.ValidateVolumeCapabilitiesResponse.Confirmed.VolumeContextEntry") + proto.RegisterType((*ListVolumesRequest)(nil), "csitest.v1.ListVolumesRequest") + proto.RegisterType((*ListVolumesResponse)(nil), "csitest.v1.ListVolumesResponse") + proto.RegisterType((*ListVolumesResponse_Entry)(nil), "csitest.v1.ListVolumesResponse.Entry") + proto.RegisterType((*GetCapacityRequest)(nil), "csitest.v1.GetCapacityRequest") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.GetCapacityRequest.ParametersEntry") + proto.RegisterType((*GetCapacityResponse)(nil), "csitest.v1.GetCapacityResponse") + proto.RegisterType((*ControllerGetCapabilitiesRequest)(nil), "csitest.v1.ControllerGetCapabilitiesRequest") + proto.RegisterType((*ControllerGetCapabilitiesResponse)(nil), "csitest.v1.ControllerGetCapabilitiesResponse") + proto.RegisterType((*ControllerServiceCapability)(nil), "csitest.v1.ControllerServiceCapability") + proto.RegisterType((*ControllerServiceCapability_RPC)(nil), "csitest.v1.ControllerServiceCapability.RPC") + proto.RegisterType((*CreateSnapshotRequest)(nil), "csitest.v1.CreateSnapshotRequest") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.CreateSnapshotRequest.ParametersEntry") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.CreateSnapshotRequest.SecretsEntry") + proto.RegisterType((*CreateSnapshotResponse)(nil), "csitest.v1.CreateSnapshotResponse") + proto.RegisterType((*Snapshot)(nil), "csitest.v1.Snapshot") + proto.RegisterType((*DeleteSnapshotRequest)(nil), "csitest.v1.DeleteSnapshotRequest") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.DeleteSnapshotRequest.SecretsEntry") + proto.RegisterType((*DeleteSnapshotResponse)(nil), "csitest.v1.DeleteSnapshotResponse") + proto.RegisterType((*ListSnapshotsRequest)(nil), "csitest.v1.ListSnapshotsRequest") + proto.RegisterType((*ListSnapshotsResponse)(nil), "csitest.v1.ListSnapshotsResponse") + proto.RegisterType((*ListSnapshotsResponse_Entry)(nil), "csitest.v1.ListSnapshotsResponse.Entry") + proto.RegisterType((*NodeStageVolumeRequest)(nil), "csitest.v1.NodeStageVolumeRequest") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.NodeStageVolumeRequest.PublishContextEntry") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.NodeStageVolumeRequest.SecretsEntry") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.NodeStageVolumeRequest.VolumeContextEntry") + proto.RegisterType((*NodeStageVolumeResponse)(nil), "csitest.v1.NodeStageVolumeResponse") + proto.RegisterType((*NodeUnstageVolumeRequest)(nil), "csitest.v1.NodeUnstageVolumeRequest") + proto.RegisterType((*NodeUnstageVolumeResponse)(nil), "csitest.v1.NodeUnstageVolumeResponse") + proto.RegisterType((*NodePublishVolumeRequest)(nil), "csitest.v1.NodePublishVolumeRequest") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.NodePublishVolumeRequest.PublishContextEntry") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.NodePublishVolumeRequest.SecretsEntry") + proto.RegisterMapType((map[string]string)(nil), "csitest.v1.NodePublishVolumeRequest.VolumeContextEntry") + proto.RegisterType((*NodePublishVolumeResponse)(nil), "csitest.v1.NodePublishVolumeResponse") + proto.RegisterType((*NodeUnpublishVolumeRequest)(nil), "csitest.v1.NodeUnpublishVolumeRequest") + proto.RegisterType((*NodeUnpublishVolumeResponse)(nil), "csitest.v1.NodeUnpublishVolumeResponse") + proto.RegisterType((*NodeGetVolumeStatsRequest)(nil), "csitest.v1.NodeGetVolumeStatsRequest") + proto.RegisterType((*NodeGetVolumeStatsResponse)(nil), "csitest.v1.NodeGetVolumeStatsResponse") + proto.RegisterType((*VolumeUsage)(nil), "csitest.v1.VolumeUsage") + proto.RegisterType((*NodeGetCapabilitiesRequest)(nil), "csitest.v1.NodeGetCapabilitiesRequest") + proto.RegisterType((*NodeGetCapabilitiesResponse)(nil), "csitest.v1.NodeGetCapabilitiesResponse") + proto.RegisterType((*NodeServiceCapability)(nil), "csitest.v1.NodeServiceCapability") + proto.RegisterType((*NodeServiceCapability_RPC)(nil), "csitest.v1.NodeServiceCapability.RPC") + proto.RegisterType((*NodeGetInfoRequest)(nil), "csitest.v1.NodeGetInfoRequest") + proto.RegisterType((*NodeGetInfoResponse)(nil), "csitest.v1.NodeGetInfoResponse") + proto.RegisterEnum("csitest.v1.PluginCapability_Service_Type", PluginCapability_Service_Type_name, PluginCapability_Service_Type_value) + proto.RegisterEnum("csitest.v1.VolumeCapability_AccessMode_Mode", VolumeCapability_AccessMode_Mode_name, VolumeCapability_AccessMode_Mode_value) + proto.RegisterEnum("csitest.v1.ControllerServiceCapability_RPC_Type", ControllerServiceCapability_RPC_Type_name, ControllerServiceCapability_RPC_Type_value) + proto.RegisterEnum("csitest.v1.VolumeUsage_Unit", VolumeUsage_Unit_name, VolumeUsage_Unit_value) + proto.RegisterEnum("csitest.v1.NodeServiceCapability_RPC_Type", NodeServiceCapability_RPC_Type_name, NodeServiceCapability_RPC_Type_value) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// IdentityClient is the client API for Identity service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type IdentityClient interface { + GetPluginInfo(ctx context.Context, in *GetPluginInfoRequest, opts ...grpc.CallOption) (*GetPluginInfoResponse, error) + GetPluginCapabilities(ctx context.Context, in *GetPluginCapabilitiesRequest, opts ...grpc.CallOption) (*GetPluginCapabilitiesResponse, error) + Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeResponse, error) +} + +type identityClient struct { + cc *grpc.ClientConn +} + +func NewIdentityClient(cc *grpc.ClientConn) IdentityClient { + return &identityClient{cc} +} + +func (c *identityClient) GetPluginInfo(ctx context.Context, in *GetPluginInfoRequest, opts ...grpc.CallOption) (*GetPluginInfoResponse, error) { + out := new(GetPluginInfoResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Identity/GetPluginInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityClient) GetPluginCapabilities(ctx context.Context, in *GetPluginCapabilitiesRequest, opts ...grpc.CallOption) (*GetPluginCapabilitiesResponse, error) { + out := new(GetPluginCapabilitiesResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Identity/GetPluginCapabilities", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityClient) Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeResponse, error) { + out := new(ProbeResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Identity/Probe", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// IdentityServer is the server API for Identity service. +type IdentityServer interface { + GetPluginInfo(context.Context, *GetPluginInfoRequest) (*GetPluginInfoResponse, error) + GetPluginCapabilities(context.Context, *GetPluginCapabilitiesRequest) (*GetPluginCapabilitiesResponse, error) + Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) +} + +func RegisterIdentityServer(s *grpc.Server, srv IdentityServer) { + s.RegisterService(&_Identity_serviceDesc, srv) +} + +func _Identity_GetPluginInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPluginInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityServer).GetPluginInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Identity/GetPluginInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityServer).GetPluginInfo(ctx, req.(*GetPluginInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Identity_GetPluginCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPluginCapabilitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityServer).GetPluginCapabilities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Identity/GetPluginCapabilities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityServer).GetPluginCapabilities(ctx, req.(*GetPluginCapabilitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Identity_Probe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProbeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityServer).Probe(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Identity/Probe", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityServer).Probe(ctx, req.(*ProbeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Identity_serviceDesc = grpc.ServiceDesc{ + ServiceName: "csitest.v1.Identity", + HandlerType: (*IdentityServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetPluginInfo", + Handler: _Identity_GetPluginInfo_Handler, + }, + { + MethodName: "GetPluginCapabilities", + Handler: _Identity_GetPluginCapabilities_Handler, + }, + { + MethodName: "Probe", + Handler: _Identity_Probe_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest.proto", +} + +// ControllerClient is the client API for Controller service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ControllerClient interface { + CreateVolume(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error) + DeleteVolume(ctx context.Context, in *DeleteVolumeRequest, opts ...grpc.CallOption) (*DeleteVolumeResponse, error) + ControllerPublishVolume(ctx context.Context, in *ControllerPublishVolumeRequest, opts ...grpc.CallOption) (*ControllerPublishVolumeResponse, error) + ControllerUnpublishVolume(ctx context.Context, in *ControllerUnpublishVolumeRequest, opts ...grpc.CallOption) (*ControllerUnpublishVolumeResponse, error) + ValidateVolumeCapabilities(ctx context.Context, in *ValidateVolumeCapabilitiesRequest, opts ...grpc.CallOption) (*ValidateVolumeCapabilitiesResponse, error) + ListVolumes(ctx context.Context, in *ListVolumesRequest, opts ...grpc.CallOption) (*ListVolumesResponse, error) + GetCapacity(ctx context.Context, in *GetCapacityRequest, opts ...grpc.CallOption) (*GetCapacityResponse, error) + ControllerGetCapabilities(ctx context.Context, in *ControllerGetCapabilitiesRequest, opts ...grpc.CallOption) (*ControllerGetCapabilitiesResponse, error) + CreateSnapshot(ctx context.Context, in *CreateSnapshotRequest, opts ...grpc.CallOption) (*CreateSnapshotResponse, error) + DeleteSnapshot(ctx context.Context, in *DeleteSnapshotRequest, opts ...grpc.CallOption) (*DeleteSnapshotResponse, error) + ListSnapshots(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (*ListSnapshotsResponse, error) +} + +type controllerClient struct { + cc *grpc.ClientConn +} + +func NewControllerClient(cc *grpc.ClientConn) ControllerClient { + return &controllerClient{cc} +} + +func (c *controllerClient) CreateVolume(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error) { + out := new(CreateVolumeResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Controller/CreateVolume", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) DeleteVolume(ctx context.Context, in *DeleteVolumeRequest, opts ...grpc.CallOption) (*DeleteVolumeResponse, error) { + out := new(DeleteVolumeResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Controller/DeleteVolume", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) ControllerPublishVolume(ctx context.Context, in *ControllerPublishVolumeRequest, opts ...grpc.CallOption) (*ControllerPublishVolumeResponse, error) { + out := new(ControllerPublishVolumeResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Controller/ControllerPublishVolume", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) ControllerUnpublishVolume(ctx context.Context, in *ControllerUnpublishVolumeRequest, opts ...grpc.CallOption) (*ControllerUnpublishVolumeResponse, error) { + out := new(ControllerUnpublishVolumeResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Controller/ControllerUnpublishVolume", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) ValidateVolumeCapabilities(ctx context.Context, in *ValidateVolumeCapabilitiesRequest, opts ...grpc.CallOption) (*ValidateVolumeCapabilitiesResponse, error) { + out := new(ValidateVolumeCapabilitiesResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Controller/ValidateVolumeCapabilities", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) ListVolumes(ctx context.Context, in *ListVolumesRequest, opts ...grpc.CallOption) (*ListVolumesResponse, error) { + out := new(ListVolumesResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Controller/ListVolumes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) GetCapacity(ctx context.Context, in *GetCapacityRequest, opts ...grpc.CallOption) (*GetCapacityResponse, error) { + out := new(GetCapacityResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Controller/GetCapacity", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) ControllerGetCapabilities(ctx context.Context, in *ControllerGetCapabilitiesRequest, opts ...grpc.CallOption) (*ControllerGetCapabilitiesResponse, error) { + out := new(ControllerGetCapabilitiesResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Controller/ControllerGetCapabilities", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) CreateSnapshot(ctx context.Context, in *CreateSnapshotRequest, opts ...grpc.CallOption) (*CreateSnapshotResponse, error) { + out := new(CreateSnapshotResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Controller/CreateSnapshot", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) DeleteSnapshot(ctx context.Context, in *DeleteSnapshotRequest, opts ...grpc.CallOption) (*DeleteSnapshotResponse, error) { + out := new(DeleteSnapshotResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Controller/DeleteSnapshot", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *controllerClient) ListSnapshots(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (*ListSnapshotsResponse, error) { + out := new(ListSnapshotsResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Controller/ListSnapshots", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ControllerServer is the server API for Controller service. +type ControllerServer interface { + CreateVolume(context.Context, *CreateVolumeRequest) (*CreateVolumeResponse, error) + DeleteVolume(context.Context, *DeleteVolumeRequest) (*DeleteVolumeResponse, error) + ControllerPublishVolume(context.Context, *ControllerPublishVolumeRequest) (*ControllerPublishVolumeResponse, error) + ControllerUnpublishVolume(context.Context, *ControllerUnpublishVolumeRequest) (*ControllerUnpublishVolumeResponse, error) + ValidateVolumeCapabilities(context.Context, *ValidateVolumeCapabilitiesRequest) (*ValidateVolumeCapabilitiesResponse, error) + ListVolumes(context.Context, *ListVolumesRequest) (*ListVolumesResponse, error) + GetCapacity(context.Context, *GetCapacityRequest) (*GetCapacityResponse, error) + ControllerGetCapabilities(context.Context, *ControllerGetCapabilitiesRequest) (*ControllerGetCapabilitiesResponse, error) + CreateSnapshot(context.Context, *CreateSnapshotRequest) (*CreateSnapshotResponse, error) + DeleteSnapshot(context.Context, *DeleteSnapshotRequest) (*DeleteSnapshotResponse, error) + ListSnapshots(context.Context, *ListSnapshotsRequest) (*ListSnapshotsResponse, error) +} + +func RegisterControllerServer(s *grpc.Server, srv ControllerServer) { + s.RegisterService(&_Controller_serviceDesc, srv) +} + +func _Controller_CreateVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateVolumeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).CreateVolume(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Controller/CreateVolume", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).CreateVolume(ctx, req.(*CreateVolumeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller_DeleteVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteVolumeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).DeleteVolume(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Controller/DeleteVolume", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).DeleteVolume(ctx, req.(*DeleteVolumeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller_ControllerPublishVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ControllerPublishVolumeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).ControllerPublishVolume(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Controller/ControllerPublishVolume", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).ControllerPublishVolume(ctx, req.(*ControllerPublishVolumeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller_ControllerUnpublishVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ControllerUnpublishVolumeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).ControllerUnpublishVolume(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Controller/ControllerUnpublishVolume", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).ControllerUnpublishVolume(ctx, req.(*ControllerUnpublishVolumeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller_ValidateVolumeCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateVolumeCapabilitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).ValidateVolumeCapabilities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Controller/ValidateVolumeCapabilities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).ValidateVolumeCapabilities(ctx, req.(*ValidateVolumeCapabilitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller_ListVolumes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListVolumesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).ListVolumes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Controller/ListVolumes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).ListVolumes(ctx, req.(*ListVolumesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller_GetCapacity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCapacityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).GetCapacity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Controller/GetCapacity", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).GetCapacity(ctx, req.(*GetCapacityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller_ControllerGetCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ControllerGetCapabilitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).ControllerGetCapabilities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Controller/ControllerGetCapabilities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).ControllerGetCapabilities(ctx, req.(*ControllerGetCapabilitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller_CreateSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).CreateSnapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Controller/CreateSnapshot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).CreateSnapshot(ctx, req.(*CreateSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller_DeleteSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).DeleteSnapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Controller/DeleteSnapshot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).DeleteSnapshot(ctx, req.(*DeleteSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Controller_ListSnapshots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSnapshotsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerServer).ListSnapshots(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Controller/ListSnapshots", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerServer).ListSnapshots(ctx, req.(*ListSnapshotsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Controller_serviceDesc = grpc.ServiceDesc{ + ServiceName: "csitest.v1.Controller", + HandlerType: (*ControllerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateVolume", + Handler: _Controller_CreateVolume_Handler, + }, + { + MethodName: "DeleteVolume", + Handler: _Controller_DeleteVolume_Handler, + }, + { + MethodName: "ControllerPublishVolume", + Handler: _Controller_ControllerPublishVolume_Handler, + }, + { + MethodName: "ControllerUnpublishVolume", + Handler: _Controller_ControllerUnpublishVolume_Handler, + }, + { + MethodName: "ValidateVolumeCapabilities", + Handler: _Controller_ValidateVolumeCapabilities_Handler, + }, + { + MethodName: "ListVolumes", + Handler: _Controller_ListVolumes_Handler, + }, + { + MethodName: "GetCapacity", + Handler: _Controller_GetCapacity_Handler, + }, + { + MethodName: "ControllerGetCapabilities", + Handler: _Controller_ControllerGetCapabilities_Handler, + }, + { + MethodName: "CreateSnapshot", + Handler: _Controller_CreateSnapshot_Handler, + }, + { + MethodName: "DeleteSnapshot", + Handler: _Controller_DeleteSnapshot_Handler, + }, + { + MethodName: "ListSnapshots", + Handler: _Controller_ListSnapshots_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest.proto", +} + +// NodeClient is the client API for Node service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type NodeClient interface { + NodeStageVolume(ctx context.Context, in *NodeStageVolumeRequest, opts ...grpc.CallOption) (*NodeStageVolumeResponse, error) + NodeUnstageVolume(ctx context.Context, in *NodeUnstageVolumeRequest, opts ...grpc.CallOption) (*NodeUnstageVolumeResponse, error) + NodePublishVolume(ctx context.Context, in *NodePublishVolumeRequest, opts ...grpc.CallOption) (*NodePublishVolumeResponse, error) + NodeUnpublishVolume(ctx context.Context, in *NodeUnpublishVolumeRequest, opts ...grpc.CallOption) (*NodeUnpublishVolumeResponse, error) + NodeGetVolumeStats(ctx context.Context, in *NodeGetVolumeStatsRequest, opts ...grpc.CallOption) (*NodeGetVolumeStatsResponse, error) + NodeGetCapabilities(ctx context.Context, in *NodeGetCapabilitiesRequest, opts ...grpc.CallOption) (*NodeGetCapabilitiesResponse, error) + NodeGetInfo(ctx context.Context, in *NodeGetInfoRequest, opts ...grpc.CallOption) (*NodeGetInfoResponse, error) +} + +type nodeClient struct { + cc *grpc.ClientConn +} + +func NewNodeClient(cc *grpc.ClientConn) NodeClient { + return &nodeClient{cc} +} + +func (c *nodeClient) NodeStageVolume(ctx context.Context, in *NodeStageVolumeRequest, opts ...grpc.CallOption) (*NodeStageVolumeResponse, error) { + out := new(NodeStageVolumeResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Node/NodeStageVolume", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClient) NodeUnstageVolume(ctx context.Context, in *NodeUnstageVolumeRequest, opts ...grpc.CallOption) (*NodeUnstageVolumeResponse, error) { + out := new(NodeUnstageVolumeResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Node/NodeUnstageVolume", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClient) NodePublishVolume(ctx context.Context, in *NodePublishVolumeRequest, opts ...grpc.CallOption) (*NodePublishVolumeResponse, error) { + out := new(NodePublishVolumeResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Node/NodePublishVolume", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClient) NodeUnpublishVolume(ctx context.Context, in *NodeUnpublishVolumeRequest, opts ...grpc.CallOption) (*NodeUnpublishVolumeResponse, error) { + out := new(NodeUnpublishVolumeResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Node/NodeUnpublishVolume", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClient) NodeGetVolumeStats(ctx context.Context, in *NodeGetVolumeStatsRequest, opts ...grpc.CallOption) (*NodeGetVolumeStatsResponse, error) { + out := new(NodeGetVolumeStatsResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Node/NodeGetVolumeStats", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClient) NodeGetCapabilities(ctx context.Context, in *NodeGetCapabilitiesRequest, opts ...grpc.CallOption) (*NodeGetCapabilitiesResponse, error) { + out := new(NodeGetCapabilitiesResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Node/NodeGetCapabilities", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClient) NodeGetInfo(ctx context.Context, in *NodeGetInfoRequest, opts ...grpc.CallOption) (*NodeGetInfoResponse, error) { + out := new(NodeGetInfoResponse) + err := c.cc.Invoke(ctx, "/csitest.v1.Node/NodeGetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NodeServer is the server API for Node service. +type NodeServer interface { + NodeStageVolume(context.Context, *NodeStageVolumeRequest) (*NodeStageVolumeResponse, error) + NodeUnstageVolume(context.Context, *NodeUnstageVolumeRequest) (*NodeUnstageVolumeResponse, error) + NodePublishVolume(context.Context, *NodePublishVolumeRequest) (*NodePublishVolumeResponse, error) + NodeUnpublishVolume(context.Context, *NodeUnpublishVolumeRequest) (*NodeUnpublishVolumeResponse, error) + NodeGetVolumeStats(context.Context, *NodeGetVolumeStatsRequest) (*NodeGetVolumeStatsResponse, error) + NodeGetCapabilities(context.Context, *NodeGetCapabilitiesRequest) (*NodeGetCapabilitiesResponse, error) + NodeGetInfo(context.Context, *NodeGetInfoRequest) (*NodeGetInfoResponse, error) +} + +func RegisterNodeServer(s *grpc.Server, srv NodeServer) { + s.RegisterService(&_Node_serviceDesc, srv) +} + +func _Node_NodeStageVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodeStageVolumeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServer).NodeStageVolume(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Node/NodeStageVolume", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServer).NodeStageVolume(ctx, req.(*NodeStageVolumeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Node_NodeUnstageVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodeUnstageVolumeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServer).NodeUnstageVolume(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Node/NodeUnstageVolume", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServer).NodeUnstageVolume(ctx, req.(*NodeUnstageVolumeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Node_NodePublishVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodePublishVolumeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServer).NodePublishVolume(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Node/NodePublishVolume", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServer).NodePublishVolume(ctx, req.(*NodePublishVolumeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Node_NodeUnpublishVolume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodeUnpublishVolumeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServer).NodeUnpublishVolume(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Node/NodeUnpublishVolume", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServer).NodeUnpublishVolume(ctx, req.(*NodeUnpublishVolumeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Node_NodeGetVolumeStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodeGetVolumeStatsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServer).NodeGetVolumeStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Node/NodeGetVolumeStats", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServer).NodeGetVolumeStats(ctx, req.(*NodeGetVolumeStatsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Node_NodeGetCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodeGetCapabilitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServer).NodeGetCapabilities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Node/NodeGetCapabilities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServer).NodeGetCapabilities(ctx, req.(*NodeGetCapabilitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Node_NodeGetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodeGetInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServer).NodeGetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/csitest.v1.Node/NodeGetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServer).NodeGetInfo(ctx, req.(*NodeGetInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Node_serviceDesc = grpc.ServiceDesc{ + ServiceName: "csitest.v1.Node", + HandlerType: (*NodeServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "NodeStageVolume", + Handler: _Node_NodeStageVolume_Handler, + }, + { + MethodName: "NodeUnstageVolume", + Handler: _Node_NodeUnstageVolume_Handler, + }, + { + MethodName: "NodePublishVolume", + Handler: _Node_NodePublishVolume_Handler, + }, + { + MethodName: "NodeUnpublishVolume", + Handler: _Node_NodeUnpublishVolume_Handler, + }, + { + MethodName: "NodeGetVolumeStats", + Handler: _Node_NodeGetVolumeStats_Handler, + }, + { + MethodName: "NodeGetCapabilities", + Handler: _Node_NodeGetCapabilities_Handler, + }, + { + MethodName: "NodeGetInfo", + Handler: _Node_NodeGetInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest.proto", +} + +func init() { + proto.RegisterFile("github.com/kubernetes-csi/csi-lib-utils/protosanitizer/test/csitest.proto", fileDescriptor_csitest_38acc6c7572d95d8) +} + +var fileDescriptor_csitest_38acc6c7572d95d8 = []byte{ + // 3225 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x3a, 0x4d, 0x6c, 0x1b, 0xc7, + 0xd5, 0x5a, 0xfe, 0xe8, 0xe7, 0x51, 0x62, 0xe8, 0x91, 0x2c, 0xd3, 0x6b, 0xc7, 0x92, 0x37, 0x76, + 0xec, 0x38, 0x31, 0x15, 0xcb, 0xf8, 0xbe, 0x26, 0x69, 0x1d, 0x9b, 0xa2, 0x68, 0x89, 0x35, 0x45, + 0x29, 0xbb, 0x94, 0x52, 0x05, 0x49, 0x16, 0x2b, 0x72, 0x44, 0x2d, 0x4c, 0xee, 0x32, 0xbb, 0x4b, + 0xc5, 0x0a, 0x10, 0xa0, 0xb7, 0x02, 0x3d, 0x16, 0x28, 0x50, 0xa0, 0x87, 0xde, 0x0a, 0xb4, 0xd7, + 0xf6, 0x12, 0xf4, 0x58, 0x14, 0xbd, 0xf5, 0x50, 0xa0, 0xe8, 0xa5, 0xa7, 0x5e, 0x7a, 0x28, 0xd0, + 0x16, 0xbd, 0xb5, 0x01, 0x8a, 0x62, 0x76, 0x66, 0x97, 0x3b, 0xbb, 0xcb, 0x3f, 0xcb, 0x41, 0x0e, + 0x3d, 0x91, 0xfb, 0xe6, 0xbd, 0x37, 0x6f, 0xde, 0xbc, 0xf7, 0xe6, 0xbd, 0x37, 0x03, 0x95, 0x96, + 0xee, 0x9c, 0xf4, 0x8e, 0x0a, 0x0d, 0xb3, 0xb3, 0xf6, 0xb4, 0x77, 0x84, 0x2d, 0x03, 0x3b, 0xd8, + 0xbe, 0xdb, 0xb0, 0xf5, 0xb5, 0x86, 0xad, 0xdf, 0x6d, 0xeb, 0x47, 0x77, 0x7b, 0x8e, 0xde, 0xb6, + 0xd7, 0xba, 0x96, 0xe9, 0x98, 0xb6, 0x66, 0xe8, 0x8e, 0xfe, 0x19, 0xb6, 0xd6, 0x1c, 0x6c, 0x3b, + 0x04, 0x83, 0xfc, 0x16, 0xdc, 0x31, 0x04, 0xde, 0xe7, 0xe9, 0x3d, 0x71, 0xb5, 0x65, 0x9a, 0xad, + 0x36, 0xa6, 0x54, 0x47, 0xbd, 0xe3, 0xb5, 0x26, 0xb6, 0x1b, 0x96, 0xde, 0x75, 0x4c, 0x8b, 0x62, + 0x8b, 0x2b, 0x61, 0x0c, 0x47, 0xef, 0x60, 0xdb, 0xd1, 0x3a, 0x5d, 0x86, 0x70, 0x2d, 0x8c, 0xf0, + 0xa9, 0xa5, 0x75, 0xbb, 0xd8, 0xb2, 0xd9, 0x78, 0xf9, 0x9c, 0x92, 0x53, 0x36, 0xd2, 0x32, 0x2c, + 0x6d, 0x61, 0x67, 0xaf, 0xdd, 0x6b, 0xe9, 0x46, 0xc5, 0x38, 0x36, 0x65, 0xfc, 0x49, 0x0f, 0xdb, + 0x8e, 0xf4, 0x27, 0x01, 0x2e, 0x86, 0x06, 0xec, 0xae, 0x69, 0xd8, 0x18, 0x21, 0x48, 0x19, 0x5a, + 0x07, 0xe7, 0x85, 0x55, 0xe1, 0xf6, 0x9c, 0xec, 0xfe, 0x47, 0x37, 0x21, 0x7b, 0x8a, 0x8d, 0xa6, + 0x69, 0xa9, 0xa7, 0xd8, 0xb2, 0x75, 0xd3, 0xc8, 0x27, 0xdc, 0xd1, 0x05, 0x0a, 0x3d, 0xa0, 0x40, + 0xf4, 0x04, 0x66, 0x3b, 0x9a, 0xa1, 0x1f, 0x63, 0xdb, 0xc9, 0x27, 0x57, 0x93, 0xb7, 0x33, 0xeb, + 0x6b, 0x85, 0xbe, 0xd6, 0x0a, 0xb1, 0xf3, 0x15, 0x76, 0x18, 0x45, 0xd9, 0x70, 0xac, 0x33, 0xd9, + 0x67, 0x20, 0x7e, 0x13, 0x16, 0xb8, 0x21, 0x94, 0x83, 0xe4, 0x53, 0x7c, 0xc6, 0xe4, 0x22, 0x7f, + 0xd1, 0x12, 0xa4, 0x4f, 0xb5, 0x76, 0x0f, 0x33, 0x69, 0xe8, 0xc7, 0x3b, 0x89, 0xb7, 0x04, 0xe9, + 0x1a, 0x5c, 0xf5, 0x67, 0x2b, 0x69, 0x5d, 0xed, 0x48, 0x6f, 0xeb, 0x8e, 0x8e, 0x6d, 0x6f, 0xf9, + 0x1a, 0xbc, 0x3c, 0x60, 0x9c, 0x69, 0xe1, 0x11, 0xcc, 0x37, 0x02, 0xf0, 0xbc, 0xe0, 0x2e, 0xe7, + 0x6a, 0x70, 0x39, 0x21, 0xea, 0x33, 0x99, 0xa3, 0x90, 0xfe, 0x2d, 0x40, 0x2e, 0x8c, 0x82, 0x1e, + 0xc1, 0x8c, 0x8d, 0xad, 0x53, 0xbd, 0x41, 0xf5, 0x9b, 0x59, 0xbf, 0x31, 0x8c, 0x63, 0x41, 0xa1, + 0xb8, 0xdb, 0x53, 0xb2, 0x47, 0x26, 0xfe, 0x58, 0x80, 0x19, 0x06, 0x46, 0x0f, 0x20, 0xe5, 0x9c, + 0x75, 0x29, 0xab, 0xec, 0xfa, 0x6b, 0xe3, 0xb0, 0x2a, 0xd4, 0xcf, 0xba, 0x58, 0x76, 0xc9, 0xa4, + 0xf7, 0x20, 0x45, 0xbe, 0x50, 0x06, 0x66, 0xf6, 0x6b, 0x4f, 0x6a, 0xbb, 0xef, 0xd7, 0x72, 0x53, + 0x68, 0x19, 0x50, 0x69, 0xb7, 0x56, 0x97, 0x77, 0xab, 0xd5, 0xb2, 0xac, 0x2a, 0x65, 0xf9, 0xa0, + 0x52, 0x2a, 0xe7, 0x04, 0x74, 0x03, 0x56, 0x0f, 0x76, 0xab, 0xfb, 0x3b, 0x65, 0xb5, 0x58, 0x2a, + 0x95, 0x15, 0xa5, 0xb2, 0x51, 0xa9, 0x56, 0xea, 0x87, 0x6a, 0x69, 0xb7, 0xa6, 0xd4, 0xe5, 0x62, + 0xa5, 0x56, 0x57, 0x72, 0x89, 0x8d, 0x69, 0x2a, 0x91, 0x94, 0x85, 0xf9, 0x3d, 0xcb, 0x3c, 0xc2, + 0x9e, 0xbe, 0x8b, 0xb0, 0xc0, 0xbe, 0x99, 0x7e, 0xdf, 0x84, 0xb4, 0x85, 0xb5, 0xe6, 0x19, 0x53, + 0x83, 0x58, 0xa0, 0xee, 0x50, 0xf0, 0xdc, 0xa1, 0xb0, 0x61, 0x9a, 0xed, 0x03, 0xb2, 0x9f, 0x32, + 0x45, 0x94, 0xbe, 0x9c, 0x86, 0xc5, 0x92, 0x85, 0x35, 0x07, 0x1f, 0x98, 0xed, 0x5e, 0xc7, 0x63, + 0x1d, 0x6b, 0xaf, 0x8f, 0x20, 0x4b, 0xf6, 0xa2, 0xa1, 0x3b, 0x67, 0xaa, 0xa5, 0x19, 0x2d, 0x6a, + 0x21, 0x99, 0xf5, 0xcb, 0x41, 0x15, 0x95, 0x18, 0x86, 0x4c, 0x10, 0xe4, 0x85, 0x46, 0xf0, 0x13, + 0xed, 0xc0, 0xe2, 0xa9, 0x3b, 0x8d, 0xca, 0x99, 0x41, 0x32, 0x6a, 0x06, 0x54, 0x9a, 0x80, 0x19, + 0xa0, 0x53, 0x1e, 0xa2, 0x63, 0x1b, 0xed, 0x02, 0x74, 0x35, 0x4b, 0xeb, 0x60, 0x07, 0x5b, 0x76, + 0x3e, 0x15, 0xf5, 0x8d, 0x98, 0x95, 0x15, 0xf6, 0x7c, 0x0a, 0xea, 0x1b, 0x01, 0x16, 0xe8, 0x3d, + 0x98, 0xb3, 0x31, 0x6e, 0x58, 0x18, 0x3b, 0x76, 0x3e, 0xed, 0xf2, 0x2b, 0x8c, 0xe2, 0xa7, 0x78, + 0x04, 0x2e, 0xbb, 0x8d, 0xe4, 0x8f, 0x36, 0x04, 0xb9, 0xcf, 0x05, 0x29, 0x70, 0xd1, 0x5b, 0xb2, + 0x69, 0x38, 0xd8, 0x70, 0x54, 0xdb, 0xec, 0x59, 0x0d, 0x9c, 0x9f, 0x76, 0x75, 0xb7, 0x12, 0xb3, + 0x68, 0x8a, 0xa7, 0xb8, 0x68, 0x32, 0x53, 0x18, 0x07, 0x44, 0x1f, 0x83, 0xa8, 0x35, 0x1a, 0xd8, + 0xb6, 0x75, 0xaa, 0x1d, 0xd5, 0xc2, 0x9f, 0xf4, 0x74, 0x0b, 0x77, 0xb0, 0xe1, 0xd8, 0xf9, 0x99, + 0x28, 0xe7, 0xba, 0xd9, 0x35, 0xdb, 0x66, 0xeb, 0x4c, 0xee, 0xe3, 0xc9, 0x97, 0x39, 0x16, 0x81, + 0x11, 0x1b, 0xbd, 0x06, 0x59, 0x03, 0x7f, 0xaa, 0xda, 0x64, 0x11, 0x8e, 0xaa, 0x1b, 0x4e, 0x7e, + 0x76, 0x55, 0xb8, 0x9d, 0xa4, 0x8b, 0x9b, 0x37, 0xf0, 0xa7, 0x8a, 0x3b, 0x52, 0x31, 0x1c, 0xf4, + 0x11, 0xe4, 0x3a, 0xda, 0xd9, 0x11, 0xf6, 0x90, 0x3b, 0x5a, 0x37, 0x3f, 0xe7, 0x6a, 0xee, 0xfe, + 0x28, 0xcd, 0xed, 0x10, 0x3a, 0xca, 0x69, 0x47, 0xeb, 0xd2, 0xdd, 0xc8, 0x76, 0x38, 0xa0, 0xf8, + 0x00, 0x5e, 0x0a, 0x6d, 0xd8, 0x24, 0x11, 0x4b, 0xfc, 0x16, 0x64, 0xf9, 0xfd, 0x99, 0x88, 0x5a, + 0x85, 0xc5, 0x18, 0x19, 0x83, 0x2c, 0x92, 0x94, 0xc5, 0x7a, 0x90, 0xc5, 0x28, 0x4b, 0x0e, 0x04, + 0xd4, 0x2f, 0x13, 0xb0, 0x18, 0xb3, 0xe9, 0xa8, 0x0a, 0xb3, 0xb6, 0xa1, 0x75, 0xed, 0x13, 0xd3, + 0x61, 0xae, 0x5c, 0x18, 0x61, 0x27, 0x05, 0x85, 0xe1, 0xd3, 0xcf, 0xed, 0x29, 0xd9, 0xe7, 0x80, + 0x1e, 0xc3, 0x34, 0x35, 0x22, 0x26, 0xde, 0x1b, 0xa3, 0x78, 0x51, 0x98, 0xcf, 0x89, 0x51, 0xa3, + 0xfb, 0xb0, 0x68, 0x60, 0xdb, 0xc1, 0x4d, 0x6f, 0xaf, 0x8f, 0x75, 0xdc, 0x6e, 0xe6, 0x93, 0x44, + 0x6d, 0xd4, 0x34, 0x2e, 0xd0, 0x71, 0xaa, 0xaf, 0xc7, 0x64, 0x54, 0xbc, 0x07, 0x59, 0x5e, 0x34, + 0xb4, 0x02, 0x19, 0x4f, 0x34, 0x55, 0x6f, 0xb2, 0x9d, 0x00, 0x0f, 0x54, 0x69, 0x8a, 0x1f, 0xc3, + 0x7c, 0x50, 0x02, 0x74, 0x05, 0xe6, 0x98, 0x0b, 0xf9, 0xe8, 0xb3, 0x14, 0x50, 0x69, 0xa2, 0x7b, + 0x80, 0x4c, 0x03, 0x9b, 0xc7, 0xbc, 0x4c, 0x89, 0xbe, 0x4c, 0x39, 0x77, 0x38, 0x20, 0x92, 0x1f, + 0x4e, 0x37, 0x60, 0x89, 0x37, 0x4b, 0x16, 0x45, 0xef, 0xf8, 0xfa, 0xa2, 0xba, 0x47, 0x51, 0x7d, + 0x79, 0x3a, 0x91, 0xfe, 0x9c, 0x82, 0x5c, 0x78, 0x87, 0xd1, 0x23, 0x48, 0x1f, 0xb5, 0xcd, 0xc6, + 0x53, 0x46, 0x7f, 0x7b, 0x98, 0x39, 0x14, 0x36, 0x08, 0x26, 0x85, 0x6e, 0x4f, 0xc9, 0x94, 0x90, + 0x70, 0xe8, 0x98, 0x3d, 0xc3, 0x61, 0x3b, 0x36, 0x9c, 0xc3, 0x0e, 0xc1, 0xec, 0x73, 0x70, 0x09, + 0xd1, 0x36, 0x64, 0xa8, 0x7f, 0xab, 0x1d, 0xb3, 0x89, 0xdd, 0x4d, 0xca, 0xac, 0xdf, 0x1a, 0xca, + 0xa7, 0xe8, 0xe2, 0xef, 0x98, 0x4d, 0x2c, 0x83, 0xe6, 0xff, 0x47, 0xaf, 0xc2, 0xbc, 0x66, 0x59, + 0xda, 0x19, 0xd3, 0x70, 0x3e, 0xd5, 0xd7, 0x6d, 0xc6, 0x1d, 0xa0, 0xba, 0x15, 0x17, 0x20, 0x13, + 0x58, 0x8b, 0xb8, 0x05, 0x99, 0x80, 0x60, 0xe8, 0x12, 0xcc, 0x1c, 0xdb, 0xaa, 0x7f, 0xb0, 0xce, + 0xc9, 0xd3, 0xc7, 0xb6, 0x7b, 0x4e, 0xae, 0x40, 0xc6, 0x95, 0x58, 0x3d, 0x6e, 0x6b, 0x2d, 0x3b, + 0x9f, 0x58, 0x4d, 0x12, 0x73, 0x70, 0x41, 0x8f, 0x09, 0x44, 0xfc, 0x87, 0x00, 0xd0, 0x17, 0x0d, + 0x3d, 0x82, 0x94, 0xbb, 0x22, 0x7a, 0x3c, 0xbf, 0x31, 0xe6, 0x8a, 0x0a, 0xee, 0xb2, 0x5c, 0x4a, + 0xe9, 0x27, 0x02, 0xa4, 0x5c, 0x56, 0xe1, 0x23, 0x5a, 0xa9, 0xd4, 0xb6, 0xaa, 0x65, 0xb5, 0xb6, + 0xbb, 0x59, 0x56, 0xdf, 0x97, 0x2b, 0xf5, 0xb2, 0x9c, 0x13, 0xd0, 0x15, 0xb8, 0x14, 0x84, 0xcb, + 0xe5, 0xe2, 0x66, 0x59, 0x56, 0x77, 0x6b, 0xd5, 0xc3, 0x5c, 0x02, 0x89, 0xb0, 0xbc, 0xb3, 0x5f, + 0xad, 0x57, 0xa2, 0x63, 0x49, 0x74, 0x15, 0xf2, 0x81, 0x31, 0xc6, 0x83, 0xb1, 0x4d, 0x11, 0xb6, + 0x81, 0x51, 0xfa, 0x97, 0x0d, 0xa6, 0x37, 0x16, 0xfc, 0xcd, 0x73, 0x0d, 0xf5, 0x7d, 0x58, 0xe0, + 0x8e, 0x55, 0x92, 0x39, 0xb2, 0x88, 0xdf, 0x54, 0x8f, 0xce, 0x1c, 0x37, 0x93, 0x22, 0xc1, 0x68, + 0xc1, 0x83, 0x6e, 0x10, 0x20, 0x51, 0x6d, 0x5b, 0xef, 0xe8, 0x0e, 0xc3, 0x49, 0xb8, 0x38, 0xe0, + 0x82, 0x5c, 0x04, 0xe9, 0xaf, 0x09, 0x98, 0x66, 0xfb, 0x73, 0x33, 0x70, 0xb8, 0x73, 0x2c, 0x3d, + 0x28, 0x65, 0xc9, 0xf9, 0x62, 0x22, 0xe4, 0x8b, 0x55, 0xc8, 0x06, 0xcf, 0xba, 0x67, 0x5e, 0xbe, + 0x7a, 0x33, 0xba, 0x49, 0xc1, 0xb8, 0xf3, 0x8c, 0x65, 0xa9, 0x0b, 0xa7, 0x41, 0x18, 0x7a, 0x0c, + 0xd9, 0xd0, 0x91, 0x99, 0x1a, 0xef, 0xc8, 0x5c, 0x68, 0x70, 0xc1, 0xb4, 0x0c, 0x8b, 0xde, 0x49, + 0xd7, 0xc6, 0xaa, 0xc3, 0x4e, 0x42, 0x76, 0xbc, 0x2f, 0xc5, 0x9e, 0x92, 0xa8, 0x4f, 0xe0, 0xc1, + 0xc4, 0x47, 0x80, 0xa2, 0x32, 0x4f, 0x94, 0x3e, 0x7f, 0x0e, 0x8b, 0x31, 0xe7, 0x30, 0x5a, 0x87, + 0x39, 0x77, 0xdb, 0x88, 0x1c, 0x2c, 0x23, 0x8e, 0x97, 0xaa, 0x8f, 0x46, 0x68, 0xba, 0x16, 0x3e, + 0xc6, 0x96, 0x85, 0x9b, 0xae, 0xcb, 0x0c, 0xa4, 0xf1, 0xd1, 0xa4, 0xef, 0x09, 0x30, 0xeb, 0xc1, + 0xd1, 0xbb, 0x30, 0x6b, 0xe3, 0x16, 0xcd, 0x17, 0xe8, 0x9c, 0x52, 0x1c, 0x7d, 0x41, 0x61, 0x48, + 0xac, 0x8e, 0xf0, 0x68, 0x48, 0x1d, 0xc1, 0x0d, 0x4d, 0xa4, 0x88, 0x5f, 0x09, 0xb0, 0xb8, 0x89, + 0xdb, 0x38, 0x9c, 0x74, 0x0e, 0x0d, 0xf4, 0x4f, 0x48, 0x92, 0x4f, 0x02, 0x8d, 0xcd, 0x16, 0xcc, + 0xb9, 0x7e, 0x0c, 0xbb, 0x02, 0x8d, 0x4b, 0xc1, 0xbc, 0xcc, 0xe3, 0x20, 0xbe, 0x03, 0xf3, 0xc1, + 0xd1, 0x89, 0xa4, 0x5f, 0x86, 0x25, 0x7e, 0x36, 0x7a, 0x6c, 0x48, 0xff, 0x4a, 0xc2, 0x35, 0x62, + 0x1b, 0x96, 0xd9, 0x6e, 0x63, 0x6b, 0xaf, 0x77, 0xd4, 0xd6, 0xed, 0x93, 0x09, 0x16, 0x78, 0x09, + 0x66, 0x0c, 0xb3, 0x19, 0x70, 0xac, 0x69, 0xf2, 0x59, 0x69, 0xa2, 0x0a, 0x5c, 0x08, 0x67, 0xcd, + 0x67, 0x2c, 0xa0, 0x0f, 0xcf, 0x34, 0x72, 0xa7, 0xe1, 0x93, 0x49, 0x84, 0x59, 0x92, 0xf7, 0x9b, + 0x46, 0xfb, 0xcc, 0xf5, 0xa6, 0x59, 0xd9, 0xff, 0x46, 0x07, 0x7d, 0x05, 0x53, 0xdf, 0xf8, 0x06, + 0x97, 0xc0, 0x0d, 0x5d, 0xd9, 0x10, 0x5d, 0xa3, 0x66, 0x24, 0x2a, 0x4c, 0xbb, 0xec, 0x1f, 0x4c, + 0xc0, 0x7e, 0x64, 0xb4, 0x38, 0xcf, 0x8e, 0xbe, 0x00, 0xd7, 0xfe, 0x9d, 0x00, 0x2b, 0x03, 0x97, + 0xc0, 0xd2, 0x8a, 0x13, 0x78, 0xa9, 0x4b, 0x07, 0x7c, 0x45, 0x50, 0xcf, 0x7b, 0x38, 0x96, 0x22, + 0x58, 0x61, 0xcf, 0xa0, 0x9c, 0x2a, 0xb2, 0x5d, 0x0e, 0x28, 0x16, 0x61, 0x31, 0x06, 0x6d, 0xa2, + 0x05, 0xfd, 0x4d, 0x80, 0xd5, 0xbe, 0x28, 0xfb, 0x46, 0xf7, 0xc5, 0x99, 0xf3, 0x77, 0xfa, 0x76, + 0x46, 0x8f, 0x87, 0xb7, 0xe3, 0xd7, 0x1f, 0x3f, 0xe9, 0x57, 0xe5, 0xd5, 0xaf, 0xc0, 0xf5, 0x21, + 0x53, 0x33, 0x17, 0xff, 0x7b, 0x0a, 0xae, 0x1f, 0x68, 0x6d, 0xbd, 0xe9, 0x27, 0x8d, 0x31, 0x6d, + 0x90, 0xe1, 0x6a, 0x69, 0x45, 0xbc, 0x81, 0x46, 0xb3, 0x47, 0x9c, 0x27, 0x8f, 0x9a, 0x63, 0x8c, + 0xe3, 0xf3, 0x05, 0xd7, 0xda, 0x1f, 0xc5, 0xd4, 0xda, 0x0f, 0x26, 0x93, 0x79, 0x58, 0xe5, 0x7d, + 0x18, 0x0e, 0x3e, 0xef, 0x4c, 0xc6, 0x7b, 0x88, 0x55, 0x9c, 0xdb, 0xbb, 0xcf, 0x5b, 0x84, 0x9e, + 0xc7, 0x2c, 0x7f, 0x9f, 0x02, 0x69, 0xd8, 0xea, 0x59, 0x6c, 0x39, 0x80, 0xb9, 0x86, 0x69, 0x1c, + 0xeb, 0x56, 0x07, 0x37, 0x59, 0xd5, 0xf1, 0xd6, 0xb8, 0x0a, 0x64, 0x81, 0xa5, 0xe4, 0xd1, 0xcb, + 0x7d, 0x56, 0x28, 0x0f, 0x33, 0x1d, 0x6c, 0xdb, 0x5a, 0xcb, 0x13, 0xcd, 0xfb, 0x14, 0xbf, 0x48, + 0xc2, 0x9c, 0x4f, 0x82, 0xac, 0x88, 0x55, 0xd3, 0xd0, 0xf6, 0xe4, 0x79, 0x85, 0x78, 0x7e, 0x03, + 0x4f, 0x3c, 0xa7, 0x81, 0x9f, 0x70, 0x06, 0x4e, 0xdd, 0x64, 0xfb, 0xb9, 0xc5, 0x1f, 0x62, 0xeb, + 0x5f, 0xbb, 0x41, 0x4a, 0x1f, 0x02, 0xaa, 0xea, 0x36, 0xab, 0xcc, 0xfc, 0xb0, 0x45, 0x0a, 0x31, + 0xed, 0x99, 0x8a, 0x0d, 0xc7, 0xd2, 0x59, 0xfa, 0x9f, 0x96, 0xa1, 0xa3, 0x3d, 0x2b, 0x53, 0x08, + 0x29, 0x11, 0x6c, 0x47, 0xb3, 0x1c, 0xdd, 0x68, 0xa9, 0x8e, 0xf9, 0x14, 0xfb, 0xfd, 0x6a, 0x0f, + 0x5a, 0x27, 0x40, 0xe9, 0xe7, 0x02, 0x2c, 0x72, 0xec, 0x99, 0x8d, 0x3e, 0x84, 0x99, 0x3e, 0xef, + 0x48, 0x59, 0x10, 0x43, 0x51, 0xa0, 0xaa, 0xf3, 0xa8, 0xd0, 0xcb, 0x00, 0x06, 0x7e, 0xe6, 0x70, + 0x73, 0xcf, 0x11, 0x88, 0x3b, 0xaf, 0x78, 0x1f, 0xd2, 0x54, 0x15, 0x93, 0xd4, 0xef, 0x5f, 0x24, + 0x00, 0x6d, 0x61, 0xc7, 0x2f, 0xaf, 0x98, 0x2e, 0x06, 0xd8, 0x96, 0xf0, 0x9c, 0xb6, 0x55, 0xe3, + 0x6c, 0x2b, 0x11, 0x6d, 0x2c, 0x46, 0x45, 0x18, 0x1a, 0x2d, 0x07, 0x94, 0x34, 0x34, 0x27, 0x1c, + 0xbf, 0xa4, 0x39, 0xa7, 0x19, 0x6d, 0xc2, 0x22, 0x27, 0x37, 0xdb, 0xe7, 0xbb, 0x80, 0xb4, 0x53, + 0x4d, 0x6f, 0x6b, 0x44, 0x36, 0xaf, 0x7a, 0x64, 0xd5, 0xe4, 0x05, 0x7f, 0xc4, 0x23, 0x93, 0xa4, + 0x60, 0xa2, 0xc1, 0xf8, 0x85, 0x2f, 0x16, 0xba, 0xc1, 0xc3, 0x39, 0x82, 0xc3, 0xe6, 0x7d, 0x12, + 0x7b, 0xb9, 0x70, 0x2b, 0x3e, 0xb9, 0x60, 0x8d, 0xfb, 0x81, 0xf7, 0x0c, 0xff, 0x49, 0xc0, 0x95, + 0x21, 0xd8, 0xe8, 0x21, 0x24, 0xad, 0x6e, 0x83, 0x19, 0xd8, 0xeb, 0x63, 0xce, 0x51, 0x90, 0xf7, + 0x4a, 0xdb, 0x53, 0x32, 0xa1, 0x14, 0x7f, 0x98, 0x80, 0xa4, 0xbc, 0x57, 0x42, 0x9b, 0xdc, 0x6d, + 0xc3, 0x9b, 0x13, 0x70, 0x0a, 0x5e, 0x3a, 0xfc, 0x56, 0x88, 0xbb, 0x75, 0xc8, 0xc3, 0x52, 0x49, + 0x2e, 0x17, 0xeb, 0x65, 0x75, 0xb3, 0x5c, 0x2d, 0xd7, 0xcb, 0x2a, 0xbd, 0x6b, 0xc8, 0x09, 0xe8, + 0x2a, 0xe4, 0xf7, 0xf6, 0x37, 0xaa, 0x15, 0x65, 0x5b, 0xdd, 0xaf, 0x79, 0xff, 0xd8, 0x68, 0x02, + 0xe5, 0x60, 0xbe, 0x5a, 0x51, 0xea, 0x0c, 0xa0, 0xe4, 0x92, 0x04, 0xb2, 0x55, 0xae, 0xab, 0xa5, + 0xe2, 0x5e, 0xb1, 0x54, 0xa9, 0x1f, 0xe6, 0x52, 0x48, 0x84, 0x65, 0x9e, 0xb7, 0x52, 0x2b, 0xee, + 0x29, 0xdb, 0xbb, 0xf5, 0x5c, 0x1a, 0x21, 0xc8, 0xba, 0xf4, 0x1e, 0x48, 0xc9, 0x4d, 0x13, 0x0e, + 0xa5, 0xea, 0x6e, 0xcd, 0x97, 0x61, 0x06, 0x2d, 0x41, 0xce, 0x9b, 0x59, 0x2e, 0x17, 0x37, 0xdd, + 0xae, 0xc9, 0xac, 0xdf, 0x9c, 0xfb, 0x67, 0x02, 0x2e, 0xd2, 0xee, 0x9c, 0xd7, 0x3e, 0xf4, 0x7c, + 0xf3, 0x36, 0xe4, 0x68, 0x3f, 0x40, 0x0d, 0x67, 0x59, 0x59, 0x0a, 0x3f, 0xf0, 0x72, 0x2d, 0xef, + 0x12, 0x23, 0x11, 0xb8, 0xc4, 0xd8, 0x09, 0x67, 0x9f, 0x31, 0x0d, 0xfe, 0xd0, 0x8c, 0xc3, 0x8a, + 0x9b, 0xf7, 0x62, 0xd2, 0xa2, 0x7b, 0xa3, 0x39, 0x0e, 0x3b, 0x1e, 0xce, 0x53, 0xc9, 0x9c, 0xd3, + 0xa3, 0xbf, 0x0d, 0xcb, 0x61, 0x79, 0xfd, 0x9b, 0xa5, 0x70, 0x47, 0x9a, 0x0b, 0x33, 0x3e, 0xbe, + 0x8f, 0x25, 0xfd, 0x51, 0x80, 0x59, 0x0f, 0x4c, 0x42, 0xb7, 0xad, 0x7f, 0x86, 0xb9, 0xce, 0xd2, + 0x1c, 0x81, 0xf8, 0x8d, 0xaa, 0x60, 0x4b, 0x38, 0x11, 0x6e, 0x09, 0xc7, 0xee, 0x79, 0x32, 0x76, + 0xcf, 0x1f, 0xc2, 0x42, 0x83, 0x2c, 0x41, 0x37, 0x0d, 0xd5, 0xd1, 0x3b, 0x5e, 0xd3, 0x28, 0x7a, + 0x15, 0x56, 0xf7, 0xae, 0x8e, 0xe5, 0x79, 0x8f, 0x80, 0x80, 0xd0, 0x2a, 0xcc, 0xbb, 0x57, 0x63, + 0xaa, 0x63, 0xaa, 0x3d, 0x1b, 0xe7, 0xd3, 0x6e, 0x99, 0x0c, 0x2e, 0xac, 0x6e, 0xee, 0xdb, 0x58, + 0xfa, 0xb5, 0x00, 0x17, 0x69, 0x07, 0x20, 0x6c, 0x9a, 0xa3, 0x5a, 0xdb, 0x41, 0xeb, 0x8b, 0x39, + 0x05, 0x62, 0x99, 0x7e, 0x55, 0x05, 0x4f, 0x1e, 0x96, 0xc3, 0xf3, 0xb1, 0x2a, 0xe7, 0x67, 0x02, + 0x2c, 0x91, 0xe3, 0xd8, 0x1b, 0x78, 0xd1, 0x19, 0xc2, 0x04, 0xbb, 0x19, 0x52, 0x68, 0x2a, 0xac, + 0x50, 0xe9, 0x97, 0x02, 0x5c, 0x0c, 0xc9, 0xca, 0x2c, 0xb6, 0x18, 0x4e, 0x37, 0x6e, 0x85, 0xd3, + 0x8d, 0x08, 0xcd, 0x84, 0x09, 0xc7, 0xdb, 0x5e, 0xc2, 0x31, 0xb9, 0x73, 0x7c, 0x37, 0x0d, 0xcb, + 0x35, 0xb3, 0x89, 0x15, 0x47, 0x6b, 0x4d, 0xd2, 0x04, 0x53, 0xa3, 0x3d, 0x04, 0x6a, 0x47, 0xff, + 0x1f, 0x9c, 0x30, 0x9e, 0xf3, 0x38, 0xad, 0x03, 0x54, 0x80, 0x45, 0xdb, 0xd1, 0x5a, 0xee, 0x06, + 0x6a, 0x56, 0x0b, 0x3b, 0x6a, 0x57, 0x73, 0x4e, 0xd8, 0xee, 0x5c, 0x60, 0x43, 0x75, 0x77, 0x64, + 0x4f, 0x73, 0x4e, 0xe2, 0x7b, 0x53, 0xa9, 0xe7, 0xea, 0x4d, 0xd5, 0xc2, 0x25, 0xe0, 0xda, 0x18, + 0x6b, 0x1a, 0x12, 0x9a, 0x3f, 0x1c, 0xd0, 0x77, 0xfa, 0xbf, 0x31, 0xd8, 0x8e, 0xee, 0x37, 0x9d, + 0xbf, 0xc7, 0xf2, 0x35, 0xb7, 0xac, 0x2e, 0xc3, 0xa5, 0xc8, 0xe2, 0x59, 0x00, 0x68, 0x41, 0x9e, + 0x0c, 0xed, 0x1b, 0xf6, 0x84, 0xe6, 0x39, 0xc0, 0x7a, 0x12, 0x03, 0xac, 0x47, 0xba, 0x02, 0x97, + 0x63, 0x26, 0x62, 0x52, 0xfc, 0x26, 0x4d, 0xc5, 0x98, 0xbc, 0x93, 0xaa, 0x0d, 0xf2, 0x92, 0xb7, + 0xc2, 0x5b, 0x1f, 0xdb, 0x6c, 0xfc, 0x2a, 0xfc, 0x64, 0x05, 0x32, 0x41, 0x3c, 0x16, 0xc8, 0x9c, + 0x11, 0x8e, 0x94, 0x3e, 0x77, 0x93, 0x77, 0x3a, 0xd4, 0xe4, 0xdd, 0xeb, 0x3b, 0xd9, 0x4c, 0x34, + 0x59, 0x19, 0xa8, 0x92, 0x21, 0x6e, 0xf6, 0x71, 0xc4, 0xcd, 0x66, 0xa3, 0xdd, 0xe3, 0x81, 0x8c, + 0xff, 0x07, 0x1c, 0x8d, 0x19, 0x79, 0x6c, 0x3b, 0x57, 0xfa, 0x00, 0x44, 0xea, 0x01, 0x93, 0x37, + 0x58, 0x43, 0x26, 0x95, 0x08, 0x9b, 0x94, 0xf4, 0x32, 0x5c, 0x89, 0xe5, 0xcd, 0xa6, 0x3e, 0xa4, + 0x72, 0x6d, 0x61, 0x56, 0x77, 0x2b, 0x8e, 0xe6, 0xd8, 0xe3, 0xce, 0xcc, 0x06, 0x83, 0x33, 0x53, + 0x90, 0x3b, 0xf3, 0x13, 0xba, 0xaa, 0x30, 0x6b, 0xbf, 0x40, 0x4c, 0xf7, 0xdc, 0x96, 0x12, 0x3d, + 0x97, 0x2f, 0x45, 0xcd, 0x7b, 0x9f, 0x0c, 0xcb, 0x14, 0x4b, 0xfa, 0x85, 0x00, 0x99, 0x00, 0x18, + 0x5d, 0x85, 0x39, 0xbf, 0x8a, 0xf4, 0x52, 0x49, 0x1f, 0x40, 0xf6, 0xc1, 0x31, 0x1d, 0xad, 0xcd, + 0x6e, 0x3b, 0xe9, 0x07, 0xa9, 0x04, 0x7a, 0x36, 0xa6, 0x59, 0x46, 0x52, 0x76, 0xff, 0xa3, 0x37, + 0x21, 0xd5, 0x33, 0x74, 0x7a, 0x9f, 0x9d, 0x8d, 0x73, 0x32, 0x77, 0xba, 0xc2, 0xbe, 0xa1, 0x3b, + 0xb2, 0x8b, 0x29, 0xdd, 0x81, 0x14, 0xf9, 0xe2, 0x8b, 0xac, 0x39, 0x48, 0x6f, 0x1c, 0xd6, 0xcb, + 0x4a, 0x4e, 0x40, 0x00, 0xd3, 0x95, 0xda, 0xee, 0x66, 0x59, 0xc9, 0x25, 0xa4, 0xab, 0xbe, 0x0a, + 0xe2, 0x0a, 0xda, 0x26, 0xdd, 0x9a, 0x41, 0xa5, 0x6c, 0x39, 0xb6, 0x94, 0xbd, 0x1e, 0x39, 0xb8, + 0x46, 0x14, 0xb1, 0x7f, 0x11, 0xe0, 0x62, 0x2c, 0x1e, 0x7a, 0x3b, 0x58, 0xbe, 0xde, 0x1c, 0xc9, + 0x37, 0x58, 0xb8, 0x7e, 0x5f, 0xa0, 0x85, 0xeb, 0xbb, 0x5c, 0xe1, 0x7a, 0x67, 0x2c, 0x1e, 0xc1, + 0x92, 0xb5, 0x34, 0xa0, 0x62, 0x55, 0xea, 0xc5, 0xad, 0xb2, 0xba, 0x5f, 0xa3, 0xbf, 0x7e, 0xc5, + 0xba, 0x04, 0x39, 0x52, 0x81, 0xb2, 0xd7, 0x72, 0x4a, 0xbd, 0xc8, 0xbd, 0x8c, 0x5b, 0x02, 0xc4, + 0xf4, 0x19, 0x7c, 0x8e, 0xf9, 0x53, 0x01, 0x16, 0x39, 0x30, 0x53, 0x6f, 0xe0, 0x6a, 0x42, 0xe0, + 0xae, 0x26, 0xd6, 0x60, 0x89, 0x24, 0xb8, 0xd4, 0x92, 0x6d, 0xb5, 0x8b, 0x2d, 0x95, 0x8c, 0x30, + 0x5b, 0xba, 0xd0, 0xd1, 0x9e, 0xb1, 0x16, 0xd5, 0x1e, 0xb6, 0x08, 0xe3, 0x17, 0xd4, 0x88, 0x59, + 0xff, 0x41, 0x02, 0x66, 0x2b, 0x4d, 0x6c, 0x38, 0x64, 0x6f, 0x0e, 0x60, 0x81, 0x7b, 0xd3, 0x89, + 0x56, 0x87, 0x3c, 0xf7, 0x74, 0x17, 0x2a, 0x5e, 0x1f, 0xf9, 0x20, 0x54, 0x9a, 0x42, 0x46, 0xe0, + 0x6d, 0x2a, 0xd7, 0x9d, 0xba, 0x1d, 0x4b, 0x1d, 0x63, 0xb6, 0xe2, 0x6b, 0x63, 0x60, 0xfa, 0xf3, + 0xbd, 0x0b, 0x69, 0xf7, 0x75, 0x22, 0xca, 0x73, 0x4f, 0x28, 0x03, 0x0f, 0x18, 0xc5, 0xcb, 0x31, + 0x23, 0x1e, 0xfd, 0xfa, 0x1f, 0x66, 0x01, 0xfa, 0x2d, 0x10, 0xa4, 0xc0, 0x7c, 0xf0, 0xb5, 0x0e, + 0x5a, 0x19, 0xf1, 0xbc, 0x4c, 0x5c, 0x1d, 0x8c, 0xe0, 0xcb, 0xa8, 0xc0, 0x7c, 0xf0, 0x2e, 0x97, + 0x67, 0x1a, 0x73, 0xa7, 0xcc, 0x33, 0x8d, 0xbd, 0x06, 0x9e, 0x42, 0x0e, 0x5c, 0x1a, 0x70, 0x8b, + 0x87, 0xee, 0x8c, 0x7f, 0xe7, 0x29, 0xbe, 0x3e, 0xc1, 0xb5, 0xa0, 0x34, 0x85, 0x3e, 0x83, 0xcb, + 0x03, 0x2f, 0xb0, 0xd0, 0x1b, 0x93, 0x5c, 0xb1, 0x89, 0x77, 0xc7, 0xc4, 0xf6, 0xe7, 0xfe, 0x1c, + 0xc4, 0xc1, 0xdd, 0x71, 0x74, 0x77, 0xa2, 0xab, 0x1c, 0xb1, 0x30, 0x59, 0xd3, 0x5d, 0x9a, 0x42, + 0x7b, 0x90, 0x09, 0xb4, 0x8f, 0xd1, 0xb5, 0x81, 0x7d, 0x65, 0x3a, 0xc1, 0xca, 0x88, 0xbe, 0x33, + 0xe5, 0x18, 0x68, 0x6d, 0xf2, 0x1c, 0xa3, 0xbd, 0x5a, 0x9e, 0x63, 0x4c, 0x4f, 0x34, 0xbc, 0x3d, + 0xa1, 0xb8, 0x3f, 0x68, 0x7b, 0xe2, 0x0f, 0x8f, 0x41, 0xdb, 0x33, 0xe0, 0x30, 0x91, 0xa6, 0xd0, + 0x21, 0x64, 0xf9, 0xb6, 0x0e, 0xba, 0x3e, 0xb2, 0x45, 0x25, 0x4a, 0xc3, 0x50, 0x82, 0xac, 0xf9, + 0x2e, 0x02, 0xcf, 0x3a, 0xb6, 0xa3, 0xc1, 0xb3, 0x1e, 0xd0, 0x84, 0x98, 0x22, 0x71, 0x90, 0xab, + 0xd2, 0xf9, 0x38, 0x18, 0xd7, 0xa0, 0xe0, 0xe3, 0x60, 0x6c, 0x89, 0x2f, 0x4d, 0xad, 0x7f, 0x91, + 0x86, 0x94, 0x1b, 0xbc, 0x3f, 0x84, 0x97, 0x42, 0x15, 0x10, 0x92, 0x46, 0xd7, 0x86, 0xe2, 0x2b, + 0x43, 0x71, 0x7c, 0xf1, 0x8f, 0xe0, 0x42, 0xa4, 0xb6, 0x41, 0x37, 0xc2, 0xb4, 0x71, 0x35, 0x96, + 0x78, 0x73, 0x04, 0x56, 0x78, 0x0e, 0x3e, 0xc6, 0xdc, 0x18, 0x27, 0xf1, 0x8e, 0xce, 0x31, 0x28, + 0xae, 0x9c, 0xd0, 0x33, 0x34, 0x1c, 0x51, 0x5e, 0x8d, 0xca, 0x18, 0x1b, 0x4b, 0x6e, 0x8d, 0xc4, + 0xf3, 0x67, 0xc2, 0xfe, 0x21, 0x1e, 0xc8, 0x1a, 0x51, 0x44, 0xd0, 0xd8, 0x84, 0x55, 0x7c, 0x75, + 0x14, 0x5a, 0x78, 0x41, 0x61, 0x1f, 0x8c, 0x63, 0x10, 0xe7, 0x7d, 0xb7, 0x46, 0xe2, 0x05, 0xa3, + 0x48, 0x20, 0xfd, 0xe0, 0xa3, 0x48, 0x34, 0x5d, 0xe1, 0xa3, 0x48, 0x4c, 0xde, 0x22, 0x4d, 0x6d, + 0xcc, 0x7d, 0x30, 0xc3, 0x70, 0x8e, 0xa6, 0xdd, 0x4e, 0xe6, 0xfd, 0xff, 0x06, 0x00, 0x00, 0xff, + 0xff, 0xad, 0xaf, 0xe0, 0x83, 0x8d, 0x33, 0x00, 0x00, +} diff --git a/vendor/k8s.io/apiextensions-apiserver/.github/PULL_REQUEST_TEMPLATE.md b/vendor/k8s.io/apiextensions-apiserver/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e559c074b..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,2 +0,0 @@ -Sorry, we do not accept changes directly against this repository. Please see -CONTRIBUTING.md for information on where and how to contribute instead. diff --git a/vendor/k8s.io/apiextensions-apiserver/CONTRIBUTING.md b/vendor/k8s.io/apiextensions-apiserver/CONTRIBUTING.md deleted file mode 100644 index d8ad4d2d3..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/CONTRIBUTING.md +++ /dev/null @@ -1,7 +0,0 @@ -# Contributing guidelines - -Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. - -This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/apiextensions-apiserver](https://git.k8s.io/kubernetes/staging/src/k8s.io/apiextensions-apiserver) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). - -Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/staging.md) for more information diff --git a/vendor/k8s.io/apiextensions-apiserver/Godeps/Godeps.json b/vendor/k8s.io/apiextensions-apiserver/Godeps/Godeps.json deleted file mode 100644 index a4b0c30dc..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/Godeps/Godeps.json +++ /dev/null @@ -1,2186 +0,0 @@ -{ - "ImportPath": "k8s.io/apiextensions-apiserver", - "GoVersion": "go1.10", - "GodepVersion": "v80", - "Packages": [ - "./..." - ], - "Deps": [ - { - "ImportPath": "bitbucket.org/ww/goautoneg", - "Rev": "75cd24fc2f2c2a2088577d12123ddee5f54e0675" - }, - { - "ImportPath": "github.com/Azure/go-ansiterm", - "Rev": "d6e3b3328b783f23731bc4d058875b0371ff8109" - }, - { - "ImportPath": "github.com/Azure/go-ansiterm/winterm", - "Rev": "d6e3b3328b783f23731bc4d058875b0371ff8109" - }, - { - "ImportPath": "github.com/NYTimes/gziphandler", - "Rev": "56545f4a5d46df9a6648819d1664c3a03a13ffdb" - }, - { - "ImportPath": "github.com/PuerkitoBio/purell", - "Rev": "8a290539e2e8629dbc4e6bad948158f790ec31f4" - }, - { - "ImportPath": "github.com/PuerkitoBio/urlesc", - "Rev": "5bd2802263f21d8788851d5305584c82a5c75d7e" - }, - { - "ImportPath": "github.com/asaskevich/govalidator", - "Rev": "593d64559f7600f29581a3ee42177f5dbded27a9" - }, - { - "ImportPath": "github.com/beorn7/perks/quantile", - "Rev": "3ac7bf7a47d159a033b107610db8a1b6575507a4" - }, - { - "ImportPath": "github.com/cockroachdb/cmux", - "Rev": "112f0506e7743d64a6eb8fedbcff13d9979bbf92" - }, - { - "ImportPath": "github.com/coreos/bbolt", - "Rev": "48ea1b39c25fc1bab3506fbc712ecbaa842c4d2d" - }, - { - "ImportPath": "github.com/coreos/etcd/alarm", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/auth", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/auth/authpb", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/client", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/clientv3", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/clientv3/concurrency", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/clientv3/namespace", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/clientv3/naming", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/compactor", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/discovery", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/embed", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/error", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/etcdhttp", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/v2http", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/v2http/httptypes", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3client", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3election", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3election/v3electionpb", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3election/v3electionpb/gw", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3lock", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3lock/v3lockpb", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3lock/v3lockpb/gw", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3rpc", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/auth", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/etcdserverpb", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/etcdserverpb/gw", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/membership", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/etcdserver/stats", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/integration", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/lease", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/lease/leasehttp", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/lease/leasepb", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/mvcc", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/mvcc/backend", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/mvcc/mvccpb", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/adt", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/contention", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/cors", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/cpuutil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/crc", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/debugutil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/fileutil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/httputil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/idutil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/ioutil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/logutil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/monotime", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/netutil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/pathutil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/pbutil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/runtime", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/schedule", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/srv", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/testutil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/tlsutil", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/transport", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/types", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/pkg/wait", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/proxy/grpcproxy", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/proxy/grpcproxy/adapter", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/proxy/grpcproxy/cache", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/raft", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/raft/raftpb", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/rafthttp", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/snap", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/snap/snappb", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/store", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/version", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/wal", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/etcd/wal/walpb", - "Rev": "420a452267a7ce45b3fcbed04d54030d69964fc1" - }, - { - "ImportPath": "github.com/coreos/go-semver/semver", - "Rev": "568e959cd89871e61434c1143528d9162da89ef2" - }, - { - "ImportPath": "github.com/coreos/go-systemd/daemon", - "Rev": "48702e0da86bd25e76cfef347e2adeb434a0d0a6" - }, - { - "ImportPath": "github.com/coreos/go-systemd/journal", - "Rev": "48702e0da86bd25e76cfef347e2adeb434a0d0a6" - }, - { - "ImportPath": "github.com/coreos/pkg/capnslog", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" - }, - { - "ImportPath": "github.com/davecgh/go-spew/spew", - "Rev": "782f4967f2dc4564575ca782fe2d04090b5faca8" - }, - { - "ImportPath": "github.com/dgrijalva/jwt-go", - "Rev": "01aeca54ebda6e0fbfafd0a524d234159c05ec20" - }, - { - "ImportPath": "github.com/docker/docker/pkg/term", - "Rev": "a9fbbdc8dd8794b20af358382ab780559bca589d" - }, - { - "ImportPath": "github.com/docker/docker/pkg/term/windows", - "Rev": "a9fbbdc8dd8794b20af358382ab780559bca589d" - }, - { - "ImportPath": "github.com/elazarl/go-bindata-assetfs", - "Rev": "3dcc96556217539f50599357fb481ac0dc7439b9" - }, - { - "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/evanphx/json-patch", - "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" - }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "73d445a93680fa1a78ae23a5839bad48f32ba1ee" - }, - { - "ImportPath": "github.com/go-openapi/analysis", - "Rev": "b44dc874b601d9e4e2f6e19140e794ba24bead3b" - }, - { - "ImportPath": "github.com/go-openapi/errors", - "Rev": "d24ebc2075bad502fac3a8ae27aa6dd58e1952dc" - }, - { - "ImportPath": "github.com/go-openapi/jsonpointer", - "Rev": "46af16f9f7b149af66e5d1bd010e3574dc06de98" - }, - { - "ImportPath": "github.com/go-openapi/jsonreference", - "Rev": "13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272" - }, - { - "ImportPath": "github.com/go-openapi/loads", - "Rev": "a80dea3052f00e5f032e860dd7355cd0cc67e24d" - }, - { - "ImportPath": "github.com/go-openapi/runtime", - "Rev": "11e322eeecc1032d5a0a96c566ed53f2b5c26e22" - }, - { - "ImportPath": "github.com/go-openapi/spec", - "Rev": "1de3e0542de65ad8d75452a595886fdd0befb363" - }, - { - "ImportPath": "github.com/go-openapi/strfmt", - "Rev": "d65c7fdb29eca313476e529628176fe17e58c488" - }, - { - "ImportPath": "github.com/go-openapi/swag", - "Rev": "f3f9494671f93fcff853e3c6e9e948b3eb71e590" - }, - { - "ImportPath": "github.com/go-openapi/validate", - "Rev": "d509235108fcf6ab4913d2dcb3a2260c0db2108e" - }, - { - "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/jsonpb", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/golang/protobuf/proto", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/golang/protobuf/protoc-gen-go/descriptor", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/any", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/duration", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/struct", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/timestamp", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/google/btree", - "Rev": "7d79101e329e5a3adf994758c578dab82b90c017" - }, - { - "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/gregjones/httpcache", - "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" - }, - { - "ImportPath": "github.com/gregjones/httpcache/diskcache", - "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" - }, - { - "ImportPath": "github.com/grpc-ecosystem/go-grpc-prometheus", - "Rev": "2500245aa6110c562d17020fb31a2c133d737799" - }, - { - "ImportPath": "github.com/grpc-ecosystem/grpc-gateway/runtime", - "Rev": "8cc3a55af3bcf171a1c23a90c4df9cf591706104" - }, - { - "ImportPath": "github.com/grpc-ecosystem/grpc-gateway/runtime/internal", - "Rev": "8cc3a55af3bcf171a1c23a90c4df9cf591706104" - }, - { - "ImportPath": "github.com/grpc-ecosystem/grpc-gateway/utilities", - "Rev": "8cc3a55af3bcf171a1c23a90c4df9cf591706104" - }, - { - "ImportPath": "github.com/hashicorp/golang-lru", - "Rev": "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" - }, - { - "ImportPath": "github.com/hashicorp/golang-lru/simplelru", - "Rev": "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" - }, - { - "ImportPath": "github.com/imdario/mergo", - "Rev": "9316a62528ac99aaecb4e47eadd6dc8aa6533d58" - }, - { - "ImportPath": "github.com/inconshreveable/mousetrap", - "Rev": "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" - }, - { - "ImportPath": "github.com/jonboulle/clockwork", - "Rev": "72f9bd7c4e0c2a40055ab3d0f09654f730cce982" - }, - { - "ImportPath": "github.com/json-iterator/go", - "Rev": "f2b4162afba35581b6d4a50d3b8f34e33c144682" - }, - { - "ImportPath": "github.com/mailru/easyjson/buffer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jlexer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jwriter", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/matttproud/golang_protobuf_extensions/pbutil", - "Rev": "c12348ce28de40eed0136aa2b644d0ee0650e56c" - }, - { - "ImportPath": "github.com/modern-go/concurrent", - "Rev": "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94" - }, - { - "ImportPath": "github.com/modern-go/reflect2", - "Rev": "05fbef0ca5da472bbf96c9322b84a53edc03c9fd" - }, - { - "ImportPath": "github.com/pborman/uuid", - "Rev": "ca53cad383cad2479bbba7f7a1a05797ec1386e4" - }, - { - "ImportPath": "github.com/peterbourgon/diskv", - "Rev": "5f041e8faa004a95c88a202771f4cc3e991971e6" - }, - { - "ImportPath": "github.com/pmezard/go-difflib/difflib", - "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" - }, - { - "ImportPath": "github.com/prometheus/client_golang/prometheus", - "Rev": "e7e903064f5e9eb5da98208bae10b475d4db0f8c" - }, - { - "ImportPath": "github.com/prometheus/client_model/go", - "Rev": "fa8ad6fec33561be4280a8f0514318c79d7f6cb6" - }, - { - "ImportPath": "github.com/prometheus/common/expfmt", - "Rev": "13ba4ddd0caa9c28ca7b7bffe1dfa9ed8d5ef207" - }, - { - "ImportPath": "github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg", - "Rev": "13ba4ddd0caa9c28ca7b7bffe1dfa9ed8d5ef207" - }, - { - "ImportPath": "github.com/prometheus/common/model", - "Rev": "13ba4ddd0caa9c28ca7b7bffe1dfa9ed8d5ef207" - }, - { - "ImportPath": "github.com/prometheus/procfs", - "Rev": "65c1f6f8f0fc1e2185eb9863a3bc751496404259" - }, - { - "ImportPath": "github.com/prometheus/procfs/xfs", - "Rev": "65c1f6f8f0fc1e2185eb9863a3bc751496404259" - }, - { - "ImportPath": "github.com/sirupsen/logrus", - "Rev": "89742aefa4b206dcf400792f3bd35b542998eb3b" - }, - { - "ImportPath": "github.com/spf13/cobra", - "Rev": "c439c4fa093711d42e1b01acb1235b52004753c1" - }, - { - "ImportPath": "github.com/spf13/pflag", - "Rev": "583c0c0531f06d5278b7d917446061adc344b5cd" - }, - { - "ImportPath": "github.com/stretchr/testify/assert", - "Rev": "c679ae2cc0cb27ec3293fea7e254e47386f05d69" - }, - { - "ImportPath": "github.com/stretchr/testify/require", - "Rev": "c679ae2cc0cb27ec3293fea7e254e47386f05d69" - }, - { - "ImportPath": "github.com/ugorji/go/codec", - "Rev": "ded73eae5db7e7a0ef6f55aace87a2873c5d2b74" - }, - { - "ImportPath": "github.com/xiang90/probing", - "Rev": "07dd2e8dfe18522e9c447ba95f2fe95262f63bb2" - }, - { - "ImportPath": "golang.org/x/crypto/bcrypt", - "Rev": "de0752318171da717af4ce24d0a2e8626afaeb11" - }, - { - "ImportPath": "golang.org/x/crypto/blowfish", - "Rev": "de0752318171da717af4ce24d0a2e8626afaeb11" - }, - { - "ImportPath": "golang.org/x/crypto/ssh/terminal", - "Rev": "de0752318171da717af4ce24d0a2e8626afaeb11" - }, - { - "ImportPath": "golang.org/x/net/context", - "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/internal/timeseries", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/lex/httplex", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/trace", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/net/websocket", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/oauth2", - "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" - }, - { - "ImportPath": "golang.org/x/oauth2/internal", - "Rev": "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" - }, - { - "ImportPath": "golang.org/x/sys/unix", - "Rev": "95c6576299259db960f6c5b9b69ea52422860fce" - }, - { - "ImportPath": "golang.org/x/sys/windows", - "Rev": "95c6576299259db960f6c5b9b69ea52422860fce" - }, - { - "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": "golang.org/x/time/rate", - "Rev": "f51c12702a4d776e4c1fa9b0fabab841babae631" - }, - { - "ImportPath": "google.golang.org/genproto/googleapis/api/annotations", - "Rev": "09f6ed296fc66555a25fe4ce95173148778dfa85" - }, - { - "ImportPath": "google.golang.org/genproto/googleapis/rpc/status", - "Rev": "09f6ed296fc66555a25fe4ce95173148778dfa85" - }, - { - "ImportPath": "google.golang.org/grpc", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/balancer", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/codes", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/connectivity", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/credentials", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/grpclb/grpc_lb_v1/messages", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/grpclog", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/health/grpc_health_v1", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/internal", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/keepalive", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/metadata", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/naming", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/peer", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/resolver", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/stats", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/status", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/tap", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "google.golang.org/grpc/transport", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" - }, - { - "ImportPath": "gopkg.in/inf.v0", - "Rev": "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" - }, - { - "ImportPath": "gopkg.in/natefinch/lumberjack.v2", - "Rev": "20b71e5b60d756d3d2f80def009790325acc2b23" - }, - { - "ImportPath": "gopkg.in/yaml.v2", - "Rev": "670d4cfef0544295bc27a114dbac37980d83185a" - }, - { - "ImportPath": "k8s.io/api/admission/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/admissionregistration/v1alpha1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/admissionregistration/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/apps/v1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/apps/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/apps/v1beta2", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/authentication/v1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/authentication/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/authorization/v1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/authorization/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/autoscaling/v1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/autoscaling/v2beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/autoscaling/v2beta2", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/batch/v1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/batch/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/batch/v2alpha1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/certificates/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/coordination/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/core/v1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/events/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/extensions/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/networking/v1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/policy/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/rbac/v1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/rbac/v1alpha1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/rbac/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/scheduling/v1alpha1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/scheduling/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/settings/v1alpha1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/storage/v1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/storage/v1alpha1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/api/storage/v1beta1", - "Rev": "49f236fe119e127d67dec93a9d41ae1c5ed5079e" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/equality", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/errors", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/meta/table", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/validation", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/validation/path", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/validation", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/cache", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/clock", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/duration", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/naming", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/rand", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/uuid", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/waitgroup", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/version", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "99c5fa21f87204c2875a7f7ba977895d79b35c44" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/configuration", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/initializer", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/metrics", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/initialization", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/config", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/errors", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/generic", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/mutating", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/namespace", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/request", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/rules", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/util", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/validating", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/apis/apiserver", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/apis/apiserver/install", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/apis/apiserver/v1alpha1", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/apis/audit", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/apis/audit/install", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/apis/audit/v1", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/apis/audit/v1alpha1", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/apis/audit/v1beta1", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/apis/audit/validation", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/audit", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/audit/policy", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/authenticator", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/authenticatorfactory", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/group", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/request/anonymous", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/request/bearertoken", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/request/headerrequest", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/request/union", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/request/websocket", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/request/x509", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/serviceaccount", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/token/tokenfile", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authentication/user", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authorization/authorizer", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authorization/authorizerfactory", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authorization/path", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/authorization/union", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/endpoints", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/endpoints/discovery", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/endpoints/filters", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/endpoints/handlers", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/endpoints/handlers/negotiation", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/endpoints/handlers/responsewriters", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/endpoints/metrics", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/endpoints/openapi", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/endpoints/request", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/features", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/registry/generic", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/registry/generic/registry", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/registry/generic/testing", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/registry/rest", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/registry/rest/resttest", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/server", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/server/filters", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/server/healthz", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/server/httplog", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/server/mux", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/server/options", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/server/resourceconfig", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/server/routes", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/server/routes/data/swagger", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/server/storage", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/cacher", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/errors", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/etcd", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/etcd/etcdtest", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/etcd/metrics", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/etcd/testing", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/etcd/testing/testingcert", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/etcd/util", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/etcd3", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/names", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/storagebackend", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/storagebackend/factory", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/testing", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/storage/value", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/dryrun", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/feature", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/flag", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/flushwriter", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/logs", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/openapi", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/trace", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/webhook", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/pkg/util/wsstream", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/plugin/pkg/audit/buffered", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/plugin/pkg/audit/log", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/plugin/pkg/audit/truncate", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/plugin/pkg/audit/webhook", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/plugin/pkg/authenticator/token/webhook", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/apiserver/plugin/pkg/authorizer/webhook", - "Rev": "3bfd32753e74188b22f853117029bfc4360272c7" - }, - { - "ImportPath": "k8s.io/client-go/discovery", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/discovery/fake", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/dynamic", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/admissionregistration", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/admissionregistration/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/admissionregistration/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/apps", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/apps/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/apps/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/apps/v1beta2", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/autoscaling", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/autoscaling/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta2", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/batch", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/batch/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/batch/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/batch/v2alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/certificates", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/certificates/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/coordination", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/coordination/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/core", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/core/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/events", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/events/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/extensions", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/extensions/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/internalinterfaces", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/networking", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/networking/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/policy", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/policy/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/rbac", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/rbac/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/rbac/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/rbac/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/scheduling", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/scheduling/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/scheduling/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/settings", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/settings/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/storage", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/storage/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/storage/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/informers/storage/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/scheme", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta2", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v2alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/certificates/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/coordination/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/core/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/events/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/extensions/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/networking/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/policy/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/settings/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/admissionregistration/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/admissionregistration/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/apps/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/apps/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/apps/v1beta2", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/autoscaling/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta2", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/batch/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/batch/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/batch/v2alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/certificates/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/coordination/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/core/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/events/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/extensions/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/networking/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/policy/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/rbac/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/rbac/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/rbac/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/scheduling/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/scheduling/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/settings/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/storage/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/storage/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/listers/storage/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/pkg/apis/clientauthentication", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/pkg/version", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/plugin/pkg/client/auth/exec", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/rest", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/rest/watch", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/restmapper", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/scale", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/scale/scheme", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/scale/scheme/appsint", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/scale/scheme/appsv1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/scale/scheme/appsv1beta2", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/scale/scheme/autoscalingv1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/scale/scheme/extensionsint", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/scale/scheme/extensionsv1beta1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/testing", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/third_party/forked/golang/template", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/tools/auth", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/tools/cache", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/tools/clientcmd", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/tools/clientcmd/api", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/tools/clientcmd/api/latest", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/tools/clientcmd/api/v1", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/tools/metrics", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/tools/pager", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/tools/reference", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/transport", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/util/cert", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/util/connrotation", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/util/flowcontrol", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/util/homedir", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/util/jsonpath", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/util/retry", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/client-go/util/workqueue", - "Rev": "37c3c02ec96533daec0dbda1f39a6b1d68505c79" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "0cf8f7e6ed1d2e3d47d02e3b6e559369af24d803" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "0cf8f7e6ed1d2e3d47d02e3b6e559369af24d803" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "0cf8f7e6ed1d2e3d47d02e3b6e559369af24d803" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "0cf8f7e6ed1d2e3d47d02e3b6e559369af24d803" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "0cf8f7e6ed1d2e3d47d02e3b6e559369af24d803" - } - ] -} diff --git a/vendor/k8s.io/apiextensions-apiserver/Godeps/OWNERS b/vendor/k8s.io/apiextensions-apiserver/Godeps/OWNERS deleted file mode 100644 index 3d49f3060..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/Godeps/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: -- dep-approvers diff --git a/vendor/k8s.io/apiextensions-apiserver/Godeps/Readme b/vendor/k8s.io/apiextensions-apiserver/Godeps/Readme deleted file mode 100644 index 4cdaa53d5..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/Godeps/Readme +++ /dev/null @@ -1,5 +0,0 @@ -This directory tree is generated automatically by godep. - -Please do not edit. - -See https://github.com/tools/godep for more information. diff --git a/vendor/k8s.io/apiextensions-apiserver/LICENSE b/vendor/k8s.io/apiextensions-apiserver/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - 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. diff --git a/vendor/k8s.io/apiextensions-apiserver/OWNERS b/vendor/k8s.io/apiextensions-apiserver/OWNERS deleted file mode 100644 index f76281ad3..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/OWNERS +++ /dev/null @@ -1,11 +0,0 @@ -reviewers: -- deads2k -- sttts -- enisoc -- mbohlool -approvers: -- deads2k -- lavalamp -- sttts -labels: -- sig/api-machinery diff --git a/vendor/k8s.io/apiextensions-apiserver/README.md b/vendor/k8s.io/apiextensions-apiserver/README.md deleted file mode 100644 index be75b9ba4..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# apiextensions-apiserver - -Implements: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/thirdpartyresources.md - -It provides an API for registering `CustomResourceDefinitions`. - -## Purpose - -This API server provides the implementation for `CustomResourceDefinitions` which is included as -delegate server inside of `kube-apiserver`. - - -## Compatibility - -HEAD of this repo will match HEAD of k8s.io/apiserver, k8s.io/apimachinery, and k8s.io/client-go. - -## Where does it come from? - -`apiextensions-apiserver` is synced from https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiextensions-apiserver. -Code changes are made in that location, merged into `k8s.io/kubernetes` and later synced here. diff --git a/vendor/k8s.io/apiextensions-apiserver/SECURITY_CONTACTS b/vendor/k8s.io/apiextensions-apiserver/SECURITY_CONTACTS deleted file mode 100644 index 0648a8ebf..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/SECURITY_CONTACTS +++ /dev/null @@ -1,17 +0,0 @@ -# Defined below are the security contacts for this repo. -# -# They are the contact point for the Product Security Team to reach out -# to for triaging and handling of incoming issues. -# -# The below names agree to abide by the -# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/master/security-release-process-documentation/security-release-process.md#embargo-policy) -# and will be removed and replaced if they violate that agreement. -# -# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE -# INSTRUCTIONS AT https://kubernetes.io/security/ - -cjcullen -jessfraz -liggitt -philips -tallclair diff --git a/vendor/k8s.io/apiextensions-apiserver/artifacts/customresource-01/noxu-apiservice.yaml b/vendor/k8s.io/apiextensions-apiserver/artifacts/customresource-01/noxu-apiservice.yaml deleted file mode 100644 index 44d07f641..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/artifacts/customresource-01/noxu-apiservice.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: apiregistration.k8s.io/v1beta1 -kind: APIService -metadata: - name: v1alpha1.mygroup.example.com -spec: - insecureSkipTLSVerify: true - group: mygroup.example.com - priority: 500 - service: - name: api - namespace: apiextensions - version: v1alpha1 diff --git a/vendor/k8s.io/apiextensions-apiserver/artifacts/customresource-01/noxu-resource-definition.yaml b/vendor/k8s.io/apiextensions-apiserver/artifacts/customresource-01/noxu-resource-definition.yaml deleted file mode 100644 index 86205f9db..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/artifacts/customresource-01/noxu-resource-definition.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: noxus.mygroup.example.com -spec: - group: mygroup.example.com - version: v1alpha1 - scope: Namespaced - names: - plural: noxus - singular: noxu - kind: Noxu - listKind: NoxuList \ No newline at end of file diff --git a/vendor/k8s.io/apiextensions-apiserver/artifacts/customresource-01/noxu.yaml b/vendor/k8s.io/apiextensions-apiserver/artifacts/customresource-01/noxu.yaml deleted file mode 100644 index 3cdda5efe..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/artifacts/customresource-01/noxu.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: mygroup.example.com/v1alpha1 -kind: Noxu -metadata: - name: alfa-noxu -spec: - key: value \ No newline at end of file diff --git a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/apiservice.yaml b/vendor/k8s.io/apiextensions-apiserver/artifacts/example/apiservice.yaml deleted file mode 100644 index 332bb120a..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/apiservice.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: apiregistration.k8s.io/v1beta1 -kind: APIService -metadata: - name: v1alpha1.apiextensions.k8s.io -spec: - insecureSkipTLSVerify: true - group: apiextensions.k8s.io - priority: 100 - service: - name: api - namespace: apiextensions - version: v1alpha1 diff --git a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/auth-delegator.yaml b/vendor/k8s.io/apiextensions-apiserver/artifacts/example/auth-delegator.yaml deleted file mode 100644 index ef608eced..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/auth-delegator.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: apiextensions:system:auth-delegator -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: system:auth-delegator -subjects: -- kind: ServiceAccount - name: apiserver - namespace: apiextensions diff --git a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/auth-reader.yaml b/vendor/k8s.io/apiextensions-apiserver/artifacts/example/auth-reader.yaml deleted file mode 100644 index 4f0f0e2b6..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/auth-reader.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: apiextensions-auth-reader - namespace: kube-system -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: extension-apiserver-authentication-reader -subjects: -- kind: ServiceAccount - name: apiserver - namespace: apiextensions diff --git a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/rc.yaml b/vendor/k8s.io/apiextensions-apiserver/artifacts/example/rc.yaml deleted file mode 100644 index b42d85082..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/rc.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: apiextensions-server - namespace: apiextensions - labels: - apiserver: "true" -spec: - replicas: 1 - selector: - apiserver: "true" - template: - metadata: - labels: - apiserver: "true" - spec: - serviceAccountName: apiserver - containers: - - name: apiextensions-server - image: apiextensions-apiserver:latest - imagePullPolicy: Never - args: - - "--etcd-servers=http://localhost:2379" - - "--audit-log-path=-" - - name: etcd - image: quay.io/coreos/etcd:v3.2.24 diff --git a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/sa.yaml b/vendor/k8s.io/apiextensions-apiserver/artifacts/example/sa.yaml deleted file mode 100644 index 0f2e17f6a..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/sa.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: ServiceAccount -apiVersion: v1 -metadata: - name: apiserver - namespace: apiextensions diff --git a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/service.yaml b/vendor/k8s.io/apiextensions-apiserver/artifacts/example/service.yaml deleted file mode 100644 index 2b66f1d8a..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/artifacts/example/service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: api - namespace: apiextensions -spec: - ports: - - port: 443 - protocol: TCP - targetPort: 443 - selector: - apiserver: "true" diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/README.md b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/README.md deleted file mode 100644 index 1949e5d47..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# Custom Resource Example - -**Note:** CustomResourceDefinition is the successor of the deprecated ThirdPartyResource. - -This particular example demonstrates how to generate a client for CustomResources using [`k8s.io/code-generator`](https://github.com/kubernetes/code-generator). The clientset can -be generated using the `./hack/update-codegen.sh` script. - -The `update-codegen` script will automatically generate the following files and -directories: - -* `pkg/apis/cr/v1/zz_generated.deepcopy.go` -* `pkg/client/` - -The following code-generators are used: - -* `deepcopy-gen` - creates a method `func (t* T) DeepCopy() *T` for each type T -* `client-gen` - creates typed clientsets for CustomResource APIGroups -* `informer-gen` - creates informers for CustomResources which offer an event based -interface to react on changes of CustomResources on the server -* `lister-gen` - creates listers for CustomResources which offer a read-only caching layer for GET and LIST requests. - -Changes should not be made to these files manually, and when creating your own -controller based off of this implementation you should not copy these files and -instead run the `update-codegen` script to generate your own. - -Please see [`k8s.io/sample-controller`](https://github.com/kubernetes/sample-controller) for an example -controller for CustomResources using the generated client. - -## Use Cases - -CustomResourceDefinitions can be used to implement custom resource types for your Kubernetes cluster. -These act like most other Resources in Kubernetes, and may be `kubectl apply`'d, etc. - -Some example use cases: - -* Provisioning/Management of external datastores/databases (eg. CloudSQL/RDS instances) -* Higher level abstractions around Kubernetes primitives (eg. a single Resource to define an etcd cluster, backed by a Service and a ReplicationController) - -## Defining types - -Each instance of your custom resource has an attached Spec, which should be defined via a `struct{}` to provide data format validation. -In practice, this Spec is arbitrary key-value data that specifies the configuration/behavior of your Resource. - -For example, if you were implementing a custom resource for a Database, you might provide a DatabaseSpec like the following: - -``` go -type DatabaseSpec struct { - Databases []string `json:"databases"` - Users []User `json:"users"` - Version string `json:"version"` -} - -type User struct { - Name string `json:"name"` - Password string `json:"password"` -} -``` diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/hack/update-codegen.sh b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/hack/update-codegen.sh deleted file mode 100755 index ea26ad63c..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/hack/update-codegen.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -# 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. - -set -o errexit -set -o nounset -set -o pipefail - -SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. -CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} - -# generate the code with: -# --output-base because this script should also be able to run inside the vendor dir of -# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir -# instead of the $GOPATH directly. For normal projects this can be dropped. -${CODEGEN_PKG}/generate-groups.sh all \ - k8s.io/apiextensions-apiserver/examples/client-go/pkg/client k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis \ - cr:v1 \ - --output-base "$(dirname ${BASH_SOURCE})/../../../../.." - -# To use your own boilerplate text append: -# --go-header-file ${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/hack/verify-codegen.sh b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/hack/verify-codegen.sh deleted file mode 100755 index d02a6fa39..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/hack/verify-codegen.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -# 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. - -set -o errexit -set -o nounset -set -o pipefail - -SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/.. - -DIFFROOT="${SCRIPT_ROOT}/pkg" -TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg" -_tmp="${SCRIPT_ROOT}/_tmp" - -cleanup() { - rm -rf "${_tmp}" -} -trap "cleanup" EXIT SIGINT - -cleanup - -mkdir -p "${TMP_DIFFROOT}" -cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}" - -"${SCRIPT_ROOT}/hack/update-codegen.sh" -echo "diffing ${DIFFROOT} against freshly generated codegen" -ret=0 -diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$? -cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}" -if [[ $ret -eq 0 ]] -then - echo "${DIFFROOT} up to date." -else - echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh" - exit 1 -fi diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/register.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/register.go deleted file mode 100644 index 6eb299eca..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/register.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -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 cr - -const ( - GroupName = "cr.example.apiextensions.k8s.io" -) diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/doc.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/doc.go deleted file mode 100644 index 73d79a45d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -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. -*/ - -// +k8s:deepcopy-gen=package - -// Package v1 is the v1 version of the API. -// +groupName=cr.example.apiextensions.k8s.io -package v1 diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/register.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/register.go deleted file mode 100644 index 65b65fb32..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/register.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -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 v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - - cr "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr" -) - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: cr.GroupName, Version: "v1"} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &Example{}, - &ExampleList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/types.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/types.go deleted file mode 100644 index 274b30f61..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/types.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -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 v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// Example is a specification for an Example resource -type Example struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - - Spec ExampleSpec `json:"spec"` - Status ExampleStatus `json:"status,omitempty"` -} - -// ExampleSpec is the spec for an Example resource -type ExampleSpec struct { - Foo string `json:"foo"` - Bar bool `json:"bar"` -} - -// ExampleStatus is the status for an Example resource -type ExampleStatus struct { - State ExampleState `json:"state,omitempty"` - Message string `json:"message,omitempty"` -} - -type ExampleState string - -const ( - ExampleStateCreated ExampleState = "Created" - ExampleStateProcessed ExampleState = "Processed" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ExampleList is a list of Example resources -type ExampleList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []Example `json:"items"` -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/zz_generated.deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/zz_generated.deepcopy.go deleted file mode 100644 index 50828809d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,118 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 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. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Example) DeepCopyInto(out *Example) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Example. -func (in *Example) DeepCopy() *Example { - if in == nil { - return nil - } - out := new(Example) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Example) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExampleList) DeepCopyInto(out *ExampleList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Example, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExampleList. -func (in *ExampleList) DeepCopy() *ExampleList { - if in == nil { - return nil - } - out := new(ExampleList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ExampleList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExampleSpec) DeepCopyInto(out *ExampleSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExampleSpec. -func (in *ExampleSpec) DeepCopy() *ExampleSpec { - if in == nil { - return nil - } - out := new(ExampleSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExampleStatus) DeepCopyInto(out *ExampleStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExampleStatus. -func (in *ExampleStatus) DeepCopy() *ExampleStatus { - if in == nil { - return nil - } - out := new(ExampleStatus) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/clientset.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/clientset.go deleted file mode 100644 index 92ff15819..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/clientset.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - crv1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - CrV1() crv1.CrV1Interface - // Deprecated: please explicitly pick a version if possible. - Cr() crv1.CrV1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - crV1 *crv1.CrV1Client -} - -// CrV1 retrieves the CrV1Client -func (c *Clientset) CrV1() crv1.CrV1Interface { - return c.crV1 -} - -// Deprecated: Cr retrieves the default version of CrClient. -// Please explicitly pick a version. -func (c *Clientset) Cr() crv1.CrV1Interface { - return c.crV1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.crV1, err = crv1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.crV1 = crv1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.crV1 = crv1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/doc.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/doc.go deleted file mode 100644 index 41721ca52..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/fake/clientset_generated.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/fake/clientset_generated.go deleted file mode 100644 index 28089890d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/fake/clientset_generated.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - clientset "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned" - crv1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1" - fakecrv1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -var _ clientset.Interface = &Clientset{} - -// CrV1 retrieves the CrV1Client -func (c *Clientset) CrV1() crv1.CrV1Interface { - return &fakecrv1.FakeCrV1{Fake: &c.Fake} -} - -// Cr retrieves the CrV1Client -func (c *Clientset) Cr() crv1.CrV1Interface { - return &fakecrv1.FakeCrV1{Fake: &c.Fake} -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/fake/doc.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/fake/doc.go deleted file mode 100644 index 9b99e7167..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/fake/register.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/fake/register.go deleted file mode 100644 index 1260d0d3a..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/fake/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - crv1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - crv1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/scheme/doc.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7dc375616..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/scheme/register.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/scheme/register.go deleted file mode 100644 index 5743937a9..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - crv1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - crv1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/cr_client.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/cr_client.go deleted file mode 100644 index 04e3930e1..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/cr_client.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1" - "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/scheme" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" -) - -type CrV1Interface interface { - RESTClient() rest.Interface - ExamplesGetter -} - -// CrV1Client is used to interact with features provided by the cr.example.apiextensions.k8s.io group. -type CrV1Client struct { - restClient rest.Interface -} - -func (c *CrV1Client) Examples(namespace string) ExampleInterface { - return newExamples(c, namespace) -} - -// NewForConfig creates a new CrV1Client for the given config. -func NewForConfig(c *rest.Config) (*CrV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &CrV1Client{client}, nil -} - -// NewForConfigOrDie creates a new CrV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *CrV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new CrV1Client for the given RESTClient. -func New(c rest.Interface) *CrV1Client { - return &CrV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *CrV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/doc.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/doc.go deleted file mode 100644 index 3af5d054f..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1 diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/example.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/example.go deleted file mode 100644 index b9408f1c5..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/example.go +++ /dev/null @@ -1,157 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1" - scheme "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// ExamplesGetter has a method to return a ExampleInterface. -// A group's client should implement this interface. -type ExamplesGetter interface { - Examples(namespace string) ExampleInterface -} - -// ExampleInterface has methods to work with Example resources. -type ExampleInterface interface { - Create(*v1.Example) (*v1.Example, error) - Update(*v1.Example) (*v1.Example, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Example, error) - List(opts metav1.ListOptions) (*v1.ExampleList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Example, err error) - ExampleExpansion -} - -// examples implements ExampleInterface -type examples struct { - client rest.Interface - ns string -} - -// newExamples returns a Examples -func newExamples(c *CrV1Client, namespace string) *examples { - return &examples{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the example, and returns the corresponding example object, and an error if there is any. -func (c *examples) Get(name string, options metav1.GetOptions) (result *v1.Example, err error) { - result = &v1.Example{} - err = c.client.Get(). - Namespace(c.ns). - Resource("examples"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Examples that match those selectors. -func (c *examples) List(opts metav1.ListOptions) (result *v1.ExampleList, err error) { - result = &v1.ExampleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("examples"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested examples. -func (c *examples) Watch(opts metav1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("examples"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a example and creates it. Returns the server's representation of the example, and an error, if there is any. -func (c *examples) Create(example *v1.Example) (result *v1.Example, err error) { - result = &v1.Example{} - err = c.client.Post(). - Namespace(c.ns). - Resource("examples"). - Body(example). - Do(). - Into(result) - return -} - -// Update takes the representation of a example and updates it. Returns the server's representation of the example, and an error, if there is any. -func (c *examples) Update(example *v1.Example) (result *v1.Example, err error) { - result = &v1.Example{} - err = c.client.Put(). - Namespace(c.ns). - Resource("examples"). - Name(example.Name). - Body(example). - Do(). - Into(result) - return -} - -// Delete takes name of the example and deletes it. Returns an error if one occurs. -func (c *examples) Delete(name string, options *metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("examples"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *examples) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("examples"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched example. -func (c *examples) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Example, err error) { - result = &v1.Example{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("examples"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/doc.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/fake_cr_client.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/fake_cr_client.go deleted file mode 100644 index 5ce902313..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/fake_cr_client.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeCrV1 struct { - *testing.Fake -} - -func (c *FakeCrV1) Examples(namespace string) v1.ExampleInterface { - return &FakeExamples{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeCrV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/fake_example.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/fake_example.go deleted file mode 100644 index f7f5691ee..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/fake/fake_example.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - crv1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeExamples implements ExampleInterface -type FakeExamples struct { - Fake *FakeCrV1 - ns string -} - -var examplesResource = schema.GroupVersionResource{Group: "cr.example.apiextensions.k8s.io", Version: "v1", Resource: "examples"} - -var examplesKind = schema.GroupVersionKind{Group: "cr.example.apiextensions.k8s.io", Version: "v1", Kind: "Example"} - -// Get takes name of the example, and returns the corresponding example object, and an error if there is any. -func (c *FakeExamples) Get(name string, options v1.GetOptions) (result *crv1.Example, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(examplesResource, c.ns, name), &crv1.Example{}) - - if obj == nil { - return nil, err - } - return obj.(*crv1.Example), err -} - -// List takes label and field selectors, and returns the list of Examples that match those selectors. -func (c *FakeExamples) List(opts v1.ListOptions) (result *crv1.ExampleList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(examplesResource, examplesKind, c.ns, opts), &crv1.ExampleList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &crv1.ExampleList{ListMeta: obj.(*crv1.ExampleList).ListMeta} - for _, item := range obj.(*crv1.ExampleList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested examples. -func (c *FakeExamples) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(examplesResource, c.ns, opts)) - -} - -// Create takes the representation of a example and creates it. Returns the server's representation of the example, and an error, if there is any. -func (c *FakeExamples) Create(example *crv1.Example) (result *crv1.Example, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(examplesResource, c.ns, example), &crv1.Example{}) - - if obj == nil { - return nil, err - } - return obj.(*crv1.Example), err -} - -// Update takes the representation of a example and updates it. Returns the server's representation of the example, and an error, if there is any. -func (c *FakeExamples) Update(example *crv1.Example) (result *crv1.Example, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(examplesResource, c.ns, example), &crv1.Example{}) - - if obj == nil { - return nil, err - } - return obj.(*crv1.Example), err -} - -// Delete takes name of the example and deletes it. Returns an error if one occurs. -func (c *FakeExamples) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(examplesResource, c.ns, name), &crv1.Example{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeExamples) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(examplesResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &crv1.ExampleList{}) - return err -} - -// Patch applies the patch and returns the patched example. -func (c *FakeExamples) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *crv1.Example, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(examplesResource, c.ns, name, data, subresources...), &crv1.Example{}) - - if obj == nil { - return nil, err - } - return obj.(*crv1.Example), err -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/generated_expansion.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/generated_expansion.go deleted file mode 100644 index 755021ec4..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -type ExampleExpansion interface{} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/cr/interface.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/cr/interface.go deleted file mode 100644 index 0c633e3ef..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/cr/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package cr - -import ( - v1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/cr/v1" - internalinterfaces "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1 provides access to shared informers for resources in V1. - V1() v1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1 returns a new v1.Interface. -func (g *group) V1() v1.Interface { - return v1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/cr/v1/example.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/cr/v1/example.go deleted file mode 100644 index 2496cd2ce..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/cr/v1/example.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - time "time" - - crv1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1" - versioned "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned" - internalinterfaces "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/internalinterfaces" - v1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/listers/cr/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// ExampleInformer provides access to a shared informer and lister for -// Examples. -type ExampleInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.ExampleLister -} - -type exampleInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewExampleInformer constructs a new informer for Example type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewExampleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredExampleInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredExampleInformer constructs a new informer for Example type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredExampleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.CrV1().Examples(namespace).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.CrV1().Examples(namespace).Watch(options) - }, - }, - &crv1.Example{}, - resyncPeriod, - indexers, - ) -} - -func (f *exampleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredExampleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *exampleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&crv1.Example{}, f.defaultInformer) -} - -func (f *exampleInformer) Lister() v1.ExampleLister { - return v1.NewExampleLister(f.Informer().GetIndexer()) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/cr/v1/interface.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/cr/v1/interface.go deleted file mode 100644 index 96ee1514c..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/cr/v1/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - internalinterfaces "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // Examples returns a ExampleInformer. - Examples() ExampleInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// Examples returns a ExampleInformer. -func (v *version) Examples() ExampleInformer { - return &exampleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/factory.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/factory.go deleted file mode 100644 index 67c55af39..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/factory.go +++ /dev/null @@ -1,180 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - reflect "reflect" - sync "sync" - time "time" - - versioned "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned" - cr "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/cr" - internalinterfaces "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/internalinterfaces" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client versioned.Interface - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc - lock sync.Mutex - defaultResync time.Duration - customResync map[reflect.Type]time.Duration - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - customResync: make(map[reflect.Type]time.Duration), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -// Start initializes all requested informers. -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - go informer.Run(stopCh) - f.startedInformers[informerType] = true - } - } -} - -// WaitForCacheSync waits for all started informers' cache were synced. -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InternalInformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - Cr() cr.Interface -} - -func (f *sharedInformerFactory) Cr() cr.Interface { - return cr.New(f, f.namespace, f.tweakListOptions) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/generic.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/generic.go deleted file mode 100644 index 2bf6c5a47..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/generic.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - "fmt" - - v1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - // Group=cr.example.apiextensions.k8s.io, Version=v1 - case v1.SchemeGroupVersion.WithResource("examples"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Cr().V1().Examples().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go deleted file mode 100644 index 5b81f037b..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalinterfaces - -import ( - time "time" - - versioned "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - cache "k8s.io/client-go/tools/cache" -) - -type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} - -type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/listers/cr/v1/example.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/listers/cr/v1/example.go deleted file mode 100644 index 8a64d09cc..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/listers/cr/v1/example.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ExampleLister helps list Examples. -type ExampleLister interface { - // List lists all Examples in the indexer. - List(selector labels.Selector) (ret []*v1.Example, err error) - // Examples returns an object that can list and get Examples. - Examples(namespace string) ExampleNamespaceLister - ExampleListerExpansion -} - -// exampleLister implements the ExampleLister interface. -type exampleLister struct { - indexer cache.Indexer -} - -// NewExampleLister returns a new ExampleLister. -func NewExampleLister(indexer cache.Indexer) ExampleLister { - return &exampleLister{indexer: indexer} -} - -// List lists all Examples in the indexer. -func (s *exampleLister) List(selector labels.Selector) (ret []*v1.Example, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Example)) - }) - return ret, err -} - -// Examples returns an object that can list and get Examples. -func (s *exampleLister) Examples(namespace string) ExampleNamespaceLister { - return exampleNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// ExampleNamespaceLister helps list and get Examples. -type ExampleNamespaceLister interface { - // List lists all Examples in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1.Example, err error) - // Get retrieves the Example from the indexer for a given namespace and name. - Get(name string) (*v1.Example, error) - ExampleNamespaceListerExpansion -} - -// exampleNamespaceLister implements the ExampleNamespaceLister -// interface. -type exampleNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Examples in the indexer for a given namespace. -func (s exampleNamespaceLister) List(selector labels.Selector) (ret []*v1.Example, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Example)) - }) - return ret, err -} - -// Get retrieves the Example from the indexer for a given namespace and name. -func (s exampleNamespaceLister) Get(name string) (*v1.Example, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("example"), name) - } - return obj.(*v1.Example), nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/listers/cr/v1/expansion_generated.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/listers/cr/v1/expansion_generated.go deleted file mode 100644 index 5291ebaec..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/listers/cr/v1/expansion_generated.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -// ExampleListerExpansion allows custom methods to be added to -// ExampleLister. -type ExampleListerExpansion interface{} - -// ExampleNamespaceListerExpansion allows custom methods to be added to -// ExampleNamespaceLister. -type ExampleNamespaceListerExpansion interface{} diff --git a/vendor/k8s.io/apiextensions-apiserver/hack/boilerplate.go.txt b/vendor/k8s.io/apiextensions-apiserver/hack/boilerplate.go.txt deleted file mode 100644 index b7c650da4..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/hack/boilerplate.go.txt +++ /dev/null @@ -1,16 +0,0 @@ -/* -Copyright 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. -*/ - diff --git a/vendor/k8s.io/apiextensions-apiserver/hack/build-image.sh b/vendor/k8s.io/apiextensions-apiserver/hack/build-image.sh deleted file mode 100755 index d0d129078..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/hack/build-image.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -# 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. - - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../../../../.. -source "${KUBE_ROOT}/hack/lib/util.sh" - -# Register function to be called on EXIT to remove generated binary. -function cleanup { - rm "${KUBE_ROOT}/vendor/k8s.io/apiextensions-apiserver/artifacts/simple-image/apiextensions-apiserver" -} -trap cleanup EXIT - -pushd "${KUBE_ROOT}/vendor/k8s.io/apiextensions-apiserver" -cp -v ../../../../_output/local/bin/linux/amd64/apiextensions-apiserver ./artifacts/simple-image/apiextensions-apiserver -docker build -t apiextensions-apiserver:latest ./artifacts/simple-image -popd diff --git a/vendor/k8s.io/apiextensions-apiserver/hack/update-codegen.sh b/vendor/k8s.io/apiextensions-apiserver/hack/update-codegen.sh deleted file mode 100755 index 0dc83d07f..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/hack/update-codegen.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -# 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. - -set -o errexit -set -o nounset -set -o pipefail - -SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. -CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} - -# generate the code with: -# --output-base because this script should also be able to run inside the vendor dir of -# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir -# instead of the $GOPATH directly. For normal projects this can be dropped. -CLIENTSET_NAME_VERSIONED=clientset \ -CLIENTSET_NAME_INTERNAL=internalclientset \ -${CODEGEN_PKG}/generate-internal-groups.sh all \ - k8s.io/apiextensions-apiserver/pkg/client k8s.io/apiextensions-apiserver/pkg/apis k8s.io/apiextensions-apiserver/pkg/apis \ - "apiextensions:v1beta1" \ - --output-base "$(dirname ${BASH_SOURCE})/../../.." \ - --go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt diff --git a/vendor/k8s.io/apiextensions-apiserver/hack/verify-codegen.sh b/vendor/k8s.io/apiextensions-apiserver/hack/verify-codegen.sh deleted file mode 100755 index ab43ba23d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/hack/verify-codegen.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash - -# 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. - -set -o errexit -set -o nounset -set -o pipefail - -SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/.. -SCRIPT_BASE=${SCRIPT_ROOT}/../.. - -DIFFROOT="${SCRIPT_ROOT}/pkg" -TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg" -_tmp="${SCRIPT_ROOT}/_tmp" - -cleanup() { - rm -rf "${_tmp}" -} -trap "cleanup" EXIT SIGINT - -cleanup - -mkdir -p "${TMP_DIFFROOT}" -cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}" - -"${SCRIPT_ROOT}/hack/update-codegen.sh" -echo "diffing ${DIFFROOT} against freshly generated codegen" -ret=0 -diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$? -cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}" -if [[ $ret -eq 0 ]] -then - echo "${DIFFROOT} up to date." -else - echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh" - exit 1 -fi diff --git a/vendor/k8s.io/apiextensions-apiserver/main.go b/vendor/k8s.io/apiextensions-apiserver/main.go deleted file mode 100644 index 888a04b1a..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/main.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -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 main - -import ( - "flag" - "os" - - "github.com/golang/glog" - - "k8s.io/apiextensions-apiserver/pkg/cmd/server" - genericapiserver "k8s.io/apiserver/pkg/server" - "k8s.io/apiserver/pkg/util/logs" -) - -func main() { - logs.InitLogs() - defer logs.FlushLogs() - - stopCh := genericapiserver.SetupSignalHandler() - cmd := server.NewServerCommand(os.Stdout, os.Stderr, stopCh) - cmd.Flags().AddGoFlagSet(flag.CommandLine) - if err := cmd.Execute(); err != nil { - glog.Fatal(err) - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/deepcopy.go deleted file mode 100644 index 37b4d1df9..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/deepcopy.go +++ /dev/null @@ -1,262 +0,0 @@ -/* -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 apiextensions - -import "k8s.io/apimachinery/pkg/runtime" - -// TODO: Update this after a tag is created for interface fields in DeepCopy -func (in *JSONSchemaProps) DeepCopy() *JSONSchemaProps { - if in == nil { - return nil - } - out := new(JSONSchemaProps) - - *out = *in - - if in.Default != nil { - defaultJSON := JSON(runtime.DeepCopyJSONValue(*(in.Default))) - out.Default = &(defaultJSON) - } else { - out.Default = nil - } - - if in.Example != nil { - exampleJSON := JSON(runtime.DeepCopyJSONValue(*(in.Example))) - out.Example = &(exampleJSON) - } else { - out.Example = nil - } - - if in.Ref != nil { - in, out := &in.Ref, &out.Ref - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } - } - - if in.Maximum != nil { - in, out := &in.Maximum, &out.Maximum - if *in == nil { - *out = nil - } else { - *out = new(float64) - **out = **in - } - } - - if in.Minimum != nil { - in, out := &in.Minimum, &out.Minimum - if *in == nil { - *out = nil - } else { - *out = new(float64) - **out = **in - } - } - - if in.MaxLength != nil { - in, out := &in.MaxLength, &out.MaxLength - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - - if in.MinLength != nil { - in, out := &in.MinLength, &out.MinLength - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - if in.MaxItems != nil { - in, out := &in.MaxItems, &out.MaxItems - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - - if in.MinItems != nil { - in, out := &in.MinItems, &out.MinItems - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - - if in.MultipleOf != nil { - in, out := &in.MultipleOf, &out.MultipleOf - if *in == nil { - *out = nil - } else { - *out = new(float64) - **out = **in - } - } - - if in.Enum != nil { - out.Enum = make([]JSON, len(in.Enum)) - for i := range in.Enum { - out.Enum[i] = runtime.DeepCopyJSONValue(in.Enum[i]) - } - } - - if in.MaxProperties != nil { - in, out := &in.MaxProperties, &out.MaxProperties - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - - if in.MinProperties != nil { - in, out := &in.MinProperties, &out.MinProperties - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - - if in.Required != nil { - in, out := &in.Required, &out.Required - *out = make([]string, len(*in)) - copy(*out, *in) - } - - if in.Items != nil { - in, out := &in.Items, &out.Items - if *in == nil { - *out = nil - } else { - *out = new(JSONSchemaPropsOrArray) - (*in).DeepCopyInto(*out) - } - } - - if in.AllOf != nil { - in, out := &in.AllOf, &out.AllOf - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - - if in.OneOf != nil { - in, out := &in.OneOf, &out.OneOf - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AnyOf != nil { - in, out := &in.AnyOf, &out.AnyOf - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - - if in.Not != nil { - in, out := &in.Not, &out.Not - if *in == nil { - *out = nil - } else { - *out = new(JSONSchemaProps) - (*in).DeepCopyInto(*out) - } - } - - if in.Properties != nil { - in, out := &in.Properties, &out.Properties - *out = make(map[string]JSONSchemaProps, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - - if in.AdditionalProperties != nil { - in, out := &in.AdditionalProperties, &out.AdditionalProperties - if *in == nil { - *out = nil - } else { - *out = new(JSONSchemaPropsOrBool) - (*in).DeepCopyInto(*out) - } - } - - if in.PatternProperties != nil { - in, out := &in.PatternProperties, &out.PatternProperties - *out = make(map[string]JSONSchemaProps, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - - if in.Dependencies != nil { - in, out := &in.Dependencies, &out.Dependencies - *out = make(JSONSchemaDependencies, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - - if in.AdditionalItems != nil { - in, out := &in.AdditionalItems, &out.AdditionalItems - if *in == nil { - *out = nil - } else { - *out = new(JSONSchemaPropsOrBool) - (*in).DeepCopyInto(*out) - } - } - - if in.Definitions != nil { - in, out := &in.Definitions, &out.Definitions - *out = make(JSONSchemaDefinitions, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - - if in.ExternalDocs != nil { - in, out := &in.ExternalDocs, &out.ExternalDocs - if *in == nil { - *out = nil - } else { - *out = new(ExternalDocumentation) - (*in).DeepCopyInto(*out) - } - } - - return out -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/doc.go deleted file mode 100644 index 0517ec6a8..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -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. -*/ - -// +k8s:deepcopy-gen=package - -// Package apiextensions is the internal version of the API. -// +groupName=apiextensions.k8s.io -package apiextensions // import "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/fuzzer/fuzzer.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/fuzzer/fuzzer.go deleted file mode 100644 index ff8cc0334..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/fuzzer/fuzzer.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -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 fuzzer - -import ( - "reflect" - "strings" - - "github.com/google/gofuzz" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" -) - -var swaggerMetadataDescriptions = metav1.ObjectMeta{}.SwaggerDoc() - -// Funcs returns the fuzzer functions for the apiextensions apis. -func Funcs(codecs runtimeserializer.CodecFactory) []interface{} { - return []interface{}{ - func(obj *apiextensions.CustomResourceDefinitionSpec, c fuzz.Continue) { - c.FuzzNoCustom(obj) - - // match our defaulter - if len(obj.Scope) == 0 { - obj.Scope = apiextensions.NamespaceScoped - } - if len(obj.Names.Singular) == 0 { - obj.Names.Singular = strings.ToLower(obj.Names.Kind) - } - if len(obj.Names.ListKind) == 0 && len(obj.Names.Kind) > 0 { - obj.Names.ListKind = obj.Names.Kind + "List" - } - if len(obj.Versions) == 0 && len(obj.Version) != 0 { - obj.Versions = []apiextensions.CustomResourceDefinitionVersion{ - { - Name: obj.Version, - Served: true, - Storage: true, - }, - } - } else if len(obj.Versions) != 0 { - obj.Version = obj.Versions[0].Name - } - if len(obj.AdditionalPrinterColumns) == 0 { - obj.AdditionalPrinterColumns = []apiextensions.CustomResourceColumnDefinition{ - {Name: "Age", Type: "date", Description: swaggerMetadataDescriptions["creationTimestamp"], JSONPath: ".metadata.creationTimestamp"}, - } - } - }, - func(obj *apiextensions.CustomResourceDefinition, c fuzz.Continue) { - c.FuzzNoCustom(obj) - - if len(obj.Status.StoredVersions) == 0 { - for _, v := range obj.Spec.Versions { - if v.Storage && !apiextensions.IsStoredVersion(obj, v.Name) { - obj.Status.StoredVersions = append(obj.Status.StoredVersions, v.Name) - } - } - } - }, - func(obj *apiextensions.JSONSchemaProps, c fuzz.Continue) { - // we cannot use c.FuzzNoCustom because of the interface{} fields. So let's loop with reflection. - vobj := reflect.ValueOf(obj).Elem() - tobj := reflect.TypeOf(obj).Elem() - for i := 0; i < tobj.NumField(); i++ { - field := tobj.Field(i) - switch field.Name { - case "Default", "Enum", "Example", "Ref": - continue - default: - isValue := true - switch field.Type.Kind() { - case reflect.Interface, reflect.Map, reflect.Slice, reflect.Ptr: - isValue = false - } - if isValue || c.Intn(10) == 0 { - c.Fuzz(vobj.Field(i).Addr().Interface()) - } - } - } - if c.RandBool() { - validJSON := apiextensions.JSON(`{"some": {"json": "test"}, "string": 42}`) - obj.Default = &validJSON - } - if c.RandBool() { - obj.Enum = []apiextensions.JSON{c.Float64(), c.RandString(), c.RandBool()} - } - if c.RandBool() { - validJSON := apiextensions.JSON(`"foobarbaz"`) - obj.Example = &validJSON - } - if c.RandBool() { - validRef := "validRef" - obj.Ref = &validRef - } - }, - func(obj *apiextensions.JSONSchemaPropsOrBool, c fuzz.Continue) { - if c.RandBool() { - obj.Allows = true - obj.Schema = &apiextensions.JSONSchemaProps{} - c.Fuzz(obj.Schema) - } else { - obj.Allows = c.RandBool() - } - }, - func(obj *apiextensions.JSONSchemaPropsOrArray, c fuzz.Continue) { - // disallow both Schema and JSONSchemas to be nil. - if c.RandBool() { - obj.Schema = &apiextensions.JSONSchemaProps{} - c.Fuzz(obj.Schema) - } else { - obj.JSONSchemas = make([]apiextensions.JSONSchemaProps, c.Intn(3)+1) - for i := range obj.JSONSchemas { - c.Fuzz(&obj.JSONSchemas[i]) - } - } - }, - func(obj *apiextensions.JSONSchemaPropsOrStringArray, c fuzz.Continue) { - if c.RandBool() { - obj.Schema = &apiextensions.JSONSchemaProps{} - c.Fuzz(obj.Schema) - } else { - c.Fuzz(&obj.Property) - } - }, - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/helpers.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/helpers.go deleted file mode 100644 index 92cad7d9b..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/helpers.go +++ /dev/null @@ -1,149 +0,0 @@ -/* -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 apiextensions - -import ( - "fmt" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// SetCRDCondition sets the status condition. It either overwrites the existing one or -// creates a new one -func SetCRDCondition(crd *CustomResourceDefinition, newCondition CustomResourceDefinitionCondition) { - existingCondition := FindCRDCondition(crd, newCondition.Type) - if existingCondition == nil { - newCondition.LastTransitionTime = metav1.NewTime(time.Now()) - crd.Status.Conditions = append(crd.Status.Conditions, newCondition) - return - } - - if existingCondition.Status != newCondition.Status { - existingCondition.Status = newCondition.Status - existingCondition.LastTransitionTime = newCondition.LastTransitionTime - } - - existingCondition.Reason = newCondition.Reason - existingCondition.Message = newCondition.Message -} - -// RemoveCRDCondition removes the status condition. -func RemoveCRDCondition(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) { - newConditions := []CustomResourceDefinitionCondition{} - for _, condition := range crd.Status.Conditions { - if condition.Type != conditionType { - newConditions = append(newConditions, condition) - } - } - crd.Status.Conditions = newConditions -} - -// FindCRDCondition returns the condition you're looking for or nil -func FindCRDCondition(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) *CustomResourceDefinitionCondition { - for i := range crd.Status.Conditions { - if crd.Status.Conditions[i].Type == conditionType { - return &crd.Status.Conditions[i] - } - } - - return nil -} - -// IsCRDConditionTrue indicates if the condition is present and strictly true -func IsCRDConditionTrue(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) bool { - return IsCRDConditionPresentAndEqual(crd, conditionType, ConditionTrue) -} - -// IsCRDConditionFalse indicates if the condition is present and false true -func IsCRDConditionFalse(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) bool { - return IsCRDConditionPresentAndEqual(crd, conditionType, ConditionFalse) -} - -// IsCRDConditionPresentAndEqual indicates if the condition is present and equal to the arg -func IsCRDConditionPresentAndEqual(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType, status ConditionStatus) bool { - for _, condition := range crd.Status.Conditions { - if condition.Type == conditionType { - return condition.Status == status - } - } - return false -} - -// IsCRDConditionEquivalent returns true if the lhs and rhs are equivalent except for times -func IsCRDConditionEquivalent(lhs, rhs *CustomResourceDefinitionCondition) bool { - if lhs == nil && rhs == nil { - return true - } - if lhs == nil || rhs == nil { - return false - } - - return lhs.Message == rhs.Message && lhs.Reason == rhs.Reason && lhs.Status == rhs.Status && lhs.Type == rhs.Type -} - -// CRDHasFinalizer returns true if the finalizer is in the list -func CRDHasFinalizer(crd *CustomResourceDefinition, needle string) bool { - for _, finalizer := range crd.Finalizers { - if finalizer == needle { - return true - } - } - - return false -} - -// CRDRemoveFinalizer removes the finalizer if present -func CRDRemoveFinalizer(crd *CustomResourceDefinition, needle string) { - newFinalizers := []string{} - for _, finalizer := range crd.Finalizers { - if finalizer != needle { - newFinalizers = append(newFinalizers, finalizer) - } - } - crd.Finalizers = newFinalizers -} - -// HasServedCRDVersion returns true if `version` is in the list of CRD's versions and the Served flag is set. -func HasServedCRDVersion(crd *CustomResourceDefinition, version string) bool { - for _, v := range crd.Spec.Versions { - if v.Name == version { - return v.Served - } - } - return false -} - -// GetCRDStorageVersion returns the storage version for given CRD. -func GetCRDStorageVersion(crd *CustomResourceDefinition) (string, error) { - for _, v := range crd.Spec.Versions { - if v.Storage { - return v.Name, nil - } - } - // This should not happened if crd is valid - return "", fmt.Errorf("invalid CustomResourceDefinition, no storage version") -} - -func IsStoredVersion(crd *CustomResourceDefinition, version string) bool { - for _, v := range crd.Status.StoredVersions { - if version == v { - return true - } - } - return false -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/helpers_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/helpers_test.go deleted file mode 100644 index df58a7cbf..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/helpers_test.go +++ /dev/null @@ -1,421 +0,0 @@ -/* -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 apiextensions - -import ( - "reflect" - "testing" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestCRDHasFinalizer(t *testing.T) { - tests := []struct { - name string - crd *CustomResourceDefinition - finalizerToCheck string - - expected bool - }{ - { - name: "missing", - crd: &CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Finalizers: []string{"not-it"}}, - }, - finalizerToCheck: "it", - expected: false, - }, - { - name: "present", - crd: &CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Finalizers: []string{"not-it", "it"}}, - }, - finalizerToCheck: "it", - expected: true, - }, - } - for _, tc := range tests { - actual := CRDHasFinalizer(tc.crd, tc.finalizerToCheck) - if tc.expected != actual { - t.Errorf("%v expected %v, got %v", tc.name, tc.expected, actual) - } - } -} - -func TestCRDRemoveFinalizer(t *testing.T) { - tests := []struct { - name string - crd *CustomResourceDefinition - finalizerToCheck string - - expected []string - }{ - { - name: "missing", - crd: &CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Finalizers: []string{"not-it"}}, - }, - finalizerToCheck: "it", - expected: []string{"not-it"}, - }, - { - name: "present", - crd: &CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Finalizers: []string{"not-it", "it"}}, - }, - finalizerToCheck: "it", - expected: []string{"not-it"}, - }, - } - for _, tc := range tests { - CRDRemoveFinalizer(tc.crd, tc.finalizerToCheck) - if !reflect.DeepEqual(tc.expected, tc.crd.Finalizers) { - t.Errorf("%v expected %v, got %v", tc.name, tc.expected, tc.crd.Finalizers) - } - } -} - -func TestSetCRDCondition(t *testing.T) { - tests := []struct { - name string - crdCondition []CustomResourceDefinitionCondition - newCondition CustomResourceDefinitionCondition - expectedcrdCondition []CustomResourceDefinitionCondition - }{ - { - name: "test setCRDcondition when one condition", - crdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - }, - newCondition: CustomResourceDefinitionCondition{ - Type: Established, - Status: ConditionFalse, - Reason: "NotAccepted", - Message: "Not accepted", - LastTransitionTime: metav1.Date(2018, 1, 2, 0, 0, 0, 0, time.UTC), - }, - expectedcrdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionFalse, - Reason: "NotAccepted", - Message: "Not accepted", - LastTransitionTime: metav1.Date(2018, 1, 2, 0, 0, 0, 0, time.UTC), - }, - }, - }, - { - name: "test setCRDcondition when two condition", - crdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - { - Type: NamesAccepted, - Status: ConditionTrue, - Reason: "NoConflicts", - Message: "no conflicts found", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - }, - newCondition: CustomResourceDefinitionCondition{ - Type: NamesAccepted, - Status: ConditionFalse, - Reason: "Conflicts", - Message: "conflicts found", - LastTransitionTime: metav1.Date(2018, 1, 2, 0, 0, 0, 0, time.UTC), - }, - expectedcrdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - { - Type: NamesAccepted, - Status: ConditionFalse, - Reason: "Conflicts", - Message: "conflicts found", - LastTransitionTime: metav1.Date(2018, 1, 2, 0, 0, 0, 0, time.UTC), - }, - }, - }, - { - name: "test setCRDcondition when condition needs to be appended", - crdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - }, - newCondition: CustomResourceDefinitionCondition{ - Type: Terminating, - Status: ConditionFalse, - Reason: "NeverEstablished", - Message: "resource was never established", - LastTransitionTime: metav1.Date(2018, 2, 1, 0, 0, 0, 0, time.UTC), - }, - expectedcrdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - { - Type: Terminating, - Status: ConditionFalse, - Reason: "NeverEstablished", - Message: "resource was never established", - LastTransitionTime: metav1.Date(2018, 2, 1, 0, 0, 0, 0, time.UTC), - }, - }, - }, - } - for _, tc := range tests { - crd := generateCRDwithCondition(tc.crdCondition) - SetCRDCondition(crd, tc.newCondition) - if len(tc.expectedcrdCondition) != len(crd.Status.Conditions) { - t.Errorf("%v expected %v, got %v", tc.name, tc.expectedcrdCondition, crd.Status.Conditions) - } - for i := range tc.expectedcrdCondition { - if !IsCRDConditionEquivalent(&tc.expectedcrdCondition[i], &crd.Status.Conditions[i]) { - t.Errorf("%v expected %v, got %v", tc.name, tc.expectedcrdCondition, crd.Status.Conditions) - } - } - } -} - -func TestRemoveCRDCondition(t *testing.T) { - tests := []struct { - name string - crdCondition []CustomResourceDefinitionCondition - conditionType CustomResourceDefinitionConditionType - expectedcrdCondition []CustomResourceDefinitionCondition - }{ - { - name: "test remove CRDCondition when the conditionType meets", - crdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - { - Type: NamesAccepted, - Status: ConditionTrue, - Reason: "NoConflicts", - Message: "no conflicts found", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - }, - conditionType: NamesAccepted, - expectedcrdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2011, 1, 2, 0, 0, 0, 0, time.UTC), - }, - }, - }, - { - name: "test remove CRDCondition when the conditionType not meets", - crdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - { - Type: NamesAccepted, - Status: ConditionTrue, - Reason: "NoConflicts", - Message: "no conflicts found", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - }, - conditionType: Terminating, - expectedcrdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - { - Type: NamesAccepted, - Status: ConditionTrue, - Reason: "NoConflicts", - Message: "no conflicts found", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - }, - }, - } - for _, tc := range tests { - crd := generateCRDwithCondition(tc.crdCondition) - RemoveCRDCondition(crd, tc.conditionType) - if len(tc.expectedcrdCondition) != len(crd.Status.Conditions) { - t.Errorf("%v expected %v, got %v", tc.name, tc.expectedcrdCondition, crd.Status.Conditions) - } - for i := range tc.expectedcrdCondition { - if !IsCRDConditionEquivalent(&tc.expectedcrdCondition[i], &crd.Status.Conditions[i]) { - t.Errorf("%v expected %v, got %v", tc.name, tc.expectedcrdCondition, crd.Status.Conditions) - } - } - } -} - -func TestIsCRDConditionPresentAndEqual(t *testing.T) { - tests := []struct { - name string - crdCondition []CustomResourceDefinitionCondition - conditionType CustomResourceDefinitionConditionType - status ConditionStatus - expectresult bool - }{ - { - name: "test CRDCondition is not Present", - crdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - { - Type: NamesAccepted, - Status: ConditionTrue, - Reason: "NoConflicts", - Message: "no conflicts found", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - }, - conditionType: Terminating, - status: ConditionTrue, - expectresult: false, - }, - { - name: "test CRDCondition is Present but not Equal", - crdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - { - Type: NamesAccepted, - Status: ConditionTrue, - Reason: "NoConflicts", - Message: "no conflicts found", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - }, - conditionType: Established, - status: ConditionFalse, - expectresult: false, - }, - { - name: "test CRDCondition is Present and Equal", - crdCondition: []CustomResourceDefinitionCondition{ - { - Type: Established, - Status: ConditionTrue, - Reason: "Accepted", - Message: "the initial names have been accepted", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - { - Type: NamesAccepted, - Status: ConditionTrue, - Reason: "NoConflicts", - Message: "no conflicts found", - LastTransitionTime: metav1.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC), - }, - }, - conditionType: NamesAccepted, - status: ConditionTrue, - expectresult: true, - }, - } - for _, tc := range tests { - crd := generateCRDwithCondition(tc.crdCondition) - res := IsCRDConditionPresentAndEqual(crd, tc.conditionType, tc.status) - if res != tc.expectresult { - t.Errorf("%v expected %t, got %t", tc.name, tc.expectresult, res) - } - } -} - -func generateCRDwithCondition(conditions []CustomResourceDefinitionCondition) *CustomResourceDefinition { - testCRDObjectMeta := metav1.ObjectMeta{ - Name: "plural.group.com", - ResourceVersion: "12", - } - testCRDSpec := CustomResourceDefinitionSpec{ - Group: "group.com", - Version: "version", - Scope: ResourceScope("Cluster"), - Names: CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - } - testCRDAcceptedNames := CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - } - return &CustomResourceDefinition{ - ObjectMeta: testCRDObjectMeta, - Spec: testCRDSpec, - Status: CustomResourceDefinitionStatus{ - AcceptedNames: testCRDAcceptedNames, - Conditions: conditions, - }, - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install/install.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install/install.go deleted file mode 100644 index 2fd04b77d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install/install.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -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 install - -import ( - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apimachinery/pkg/runtime" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -// Install registers the API group and adds types to a scheme -func Install(scheme *runtime.Scheme) { - utilruntime.Must(apiextensions.AddToScheme(scheme)) - utilruntime.Must(v1beta1.AddToScheme(scheme)) - utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion)) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install/roundtrip_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install/roundtrip_test.go deleted file mode 100644 index f199dd5e5..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install/roundtrip_test.go +++ /dev/null @@ -1,28 +0,0 @@ -/* -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 install - -import ( - "testing" - - apiextensionsfuzzer "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/fuzzer" - "k8s.io/apimachinery/pkg/api/apitesting/roundtrip" -) - -func TestRoundTrip(t *testing.T) { - roundtrip.RoundTripTestForAPIGroup(t, Install, apiextensionsfuzzer.Funcs) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/register.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/register.go deleted file mode 100644 index 273f7f123..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/register.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -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 apiextensions - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const GroupName = "apiextensions.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns back a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &CustomResourceDefinition{}, - &CustomResourceDefinitionList{}, - ) - return nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go deleted file mode 100644 index 6fc75154f..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go +++ /dev/null @@ -1,250 +0,0 @@ -/* -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 apiextensions - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// CustomResourceDefinitionSpec describes how a user wants their resource to appear -type CustomResourceDefinitionSpec struct { - // Group is the group this resource belongs in - Group string - // Version is the version this resource belongs in - // Should be always first item in Versions field if provided. - // Optional, but at least one of Version or Versions must be set. - // Deprecated: Please use `Versions`. - Version string - // Names are the names used to describe this custom resource - Names CustomResourceDefinitionNames - // Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced - Scope ResourceScope - // Validation describes the validation methods for CustomResources - Validation *CustomResourceValidation - // Subresources describes the subresources for CustomResources - Subresources *CustomResourceSubresources - // Versions is the list of all supported versions for this resource. - // If Version field is provided, this field is optional. - // Validation: All versions must use the same validation schema for now. i.e., top - // level Validation field is applied to all of these versions. - // Order: The version name will be used to compute the order. - // If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered - // lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version), - // then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first - // by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing - // major version, then minor version. An example sorted list of versions: - // v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. - Versions []CustomResourceDefinitionVersion - // AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column. - AdditionalPrinterColumns []CustomResourceColumnDefinition -} - -type CustomResourceDefinitionVersion struct { - // Name is the version name, e.g. “v1”, “v2beta1”, etc. - Name string - // Served is a flag enabling/disabling this version from being served via REST APIs - Served bool - // Storage flags the version as storage version. There must be exactly one flagged - // as storage version. - Storage bool -} - -// CustomResourceColumnDefinition specifies a column for server side printing. -type CustomResourceColumnDefinition struct { - // name is a human readable name for the column. - Name string - // type is an OpenAPI type definition for this column. - // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more. - Type string - // format is an optional OpenAPI type definition for this column. The 'name' format is applied - // to the primary identifier column to assist in clients identifying column is the resource name. - // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more. - Format string - // description is a human readable description of this column. - Description string - // priority is an integer defining the relative importance of this column compared to others. Lower - // numbers are considered higher priority. Columns that may be omitted in limited space scenarios - // should be given a higher priority. - Priority int32 - - // JSONPath is a simple JSON path, i.e. without array notation. - JSONPath string -} - -// CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition -type CustomResourceDefinitionNames struct { - // Plural is the plural name of the resource to serve. It must match the name of the CustomResourceDefinition-registration - // too: plural.group and it must be all lowercase. - Plural string - // Singular is the singular name of the resource. It must be all lowercase Defaults to lowercased - Singular string - // ShortNames are short names for the resource. It must be all lowercase. - ShortNames []string - // Kind is the serialized kind of the resource. It is normally CamelCase and singular. - Kind string - // ListKind is the serialized kind of the list for this resource. Defaults to List. - ListKind string - // Categories is a list of grouped resources custom resources belong to (e.g. 'all') - // +optional - Categories []string -} - -// ResourceScope is an enum defining the different scopes available to a custom resource -type ResourceScope string - -const ( - ClusterScoped ResourceScope = "Cluster" - NamespaceScoped ResourceScope = "Namespaced" -) - -type ConditionStatus string - -// These are valid condition statuses. "ConditionTrue" means a resource is in the condition. -// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes -// can't decide if a resource is in the condition or not. In the future, we could add other -// intermediate conditions, e.g. ConditionDegraded. -const ( - ConditionTrue ConditionStatus = "True" - ConditionFalse ConditionStatus = "False" - ConditionUnknown ConditionStatus = "Unknown" -) - -// CustomResourceDefinitionConditionType is a valid value for CustomResourceDefinitionCondition.Type -type CustomResourceDefinitionConditionType string - -const ( - // Established means that the resource has become active. A resource is established when all names are - // accepted without a conflict for the first time. A resource stays established until deleted, even during - // a later NamesAccepted due to changed names. Note that not all names can be changed. - Established CustomResourceDefinitionConditionType = "Established" - // NamesAccepted means the names chosen for this CustomResourceDefinition do not conflict with others in - // the group and are therefore accepted. - NamesAccepted CustomResourceDefinitionConditionType = "NamesAccepted" - // Terminating means that the CustomResourceDefinition has been deleted and is cleaning up. - Terminating CustomResourceDefinitionConditionType = "Terminating" -) - -// CustomResourceDefinitionCondition contains details for the current condition of this pod. -type CustomResourceDefinitionCondition struct { - // Type is the type of the condition. - Type CustomResourceDefinitionConditionType - // Status is the status of the condition. - // Can be True, False, Unknown. - Status ConditionStatus - // Last time the condition transitioned from one status to another. - // +optional - LastTransitionTime metav1.Time - // Unique, one-word, CamelCase reason for the condition's last transition. - // +optional - Reason string - // Human-readable message indicating details about last transition. - // +optional - Message string -} - -// CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition -type CustomResourceDefinitionStatus struct { - // Conditions indicate state for particular aspects of a CustomResourceDefinition - Conditions []CustomResourceDefinitionCondition - - // AcceptedNames are the names that are actually being used to serve discovery - // They may be different than the names in spec. - AcceptedNames CustomResourceDefinitionNames - - // StoredVersions are all versions of CustomResources that were ever persisted. Tracking these - // versions allows a migration path for stored versions in etcd. The field is mutable - // so the migration controller can first finish a migration to another version (i.e. - // that no old objects are left in the storage), and then remove the rest of the - // versions from this list. - // None of the versions in this list can be removed from the spec.Versions field. - StoredVersions []string -} - -// CustomResourceCleanupFinalizer is the name of the finalizer which will delete instances of -// a CustomResourceDefinition -const CustomResourceCleanupFinalizer = "customresourcecleanup.apiextensions.k8s.io" - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format -// <.spec.name>.<.spec.group>. -type CustomResourceDefinition struct { - metav1.TypeMeta - metav1.ObjectMeta - - // Spec describes how the user wants the resources to appear - Spec CustomResourceDefinitionSpec - // Status indicates the actual state of the CustomResourceDefinition - Status CustomResourceDefinitionStatus -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CustomResourceDefinitionList is a list of CustomResourceDefinition objects. -type CustomResourceDefinitionList struct { - metav1.TypeMeta - metav1.ListMeta - - // Items individual CustomResourceDefinitions - Items []CustomResourceDefinition -} - -// CustomResourceValidation is a list of validation methods for CustomResources. -type CustomResourceValidation struct { - // OpenAPIV3Schema is the OpenAPI v3 schema to be validated against. - OpenAPIV3Schema *JSONSchemaProps -} - -// CustomResourceSubresources defines the status and scale subresources for CustomResources. -type CustomResourceSubresources struct { - // Status denotes the status subresource for CustomResources - Status *CustomResourceSubresourceStatus - // Scale denotes the scale subresource for CustomResources - Scale *CustomResourceSubresourceScale -} - -// CustomResourceSubresourceStatus defines how to serve the status subresource for CustomResources. -// Status is represented by the `.status` JSON path inside of a CustomResource. When set, -// * exposes a /status subresource for the custom resource -// * PUT requests to the /status subresource take a custom resource object, and ignore changes to anything except the status stanza -// * PUT/POST/PATCH requests to the custom resource ignore changes to the status stanza -type CustomResourceSubresourceStatus struct{} - -// CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources. -type CustomResourceSubresourceScale struct { - // SpecReplicasPath defines the JSON path inside of a CustomResource that corresponds to Scale.Spec.Replicas. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under .spec. - // If there is no value under the given path in the CustomResource, the /scale subresource will return an error on GET. - SpecReplicasPath string - // StatusReplicasPath defines the JSON path inside of a CustomResource that corresponds to Scale.Status.Replicas. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under .status. - // If there is no value under the given path in the CustomResource, the status replica value in the /scale subresource - // will default to 0. - StatusReplicasPath string - // LabelSelectorPath defines the JSON path inside of a CustomResource that corresponds to Scale.Status.Selector. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under .status. - // Must be set to work with HPA. - // If there is no value under the given path in the CustomResource, the status label selector value in the /scale - // subresource will default to the empty string. - // +optional - LabelSelectorPath *string -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types_jsonschema.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types_jsonschema.go deleted file mode 100644 index 79f34e8bf..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types_jsonschema.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -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 apiextensions - -// JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/). -type JSONSchemaProps struct { - ID string - Schema JSONSchemaURL - Ref *string - Description string - Type string - Format string - Title string - Default *JSON - Maximum *float64 - ExclusiveMaximum bool - Minimum *float64 - ExclusiveMinimum bool - MaxLength *int64 - MinLength *int64 - Pattern string - MaxItems *int64 - MinItems *int64 - UniqueItems bool - MultipleOf *float64 - Enum []JSON - MaxProperties *int64 - MinProperties *int64 - Required []string - Items *JSONSchemaPropsOrArray - AllOf []JSONSchemaProps - OneOf []JSONSchemaProps - AnyOf []JSONSchemaProps - Not *JSONSchemaProps - Properties map[string]JSONSchemaProps - AdditionalProperties *JSONSchemaPropsOrBool - PatternProperties map[string]JSONSchemaProps - Dependencies JSONSchemaDependencies - AdditionalItems *JSONSchemaPropsOrBool - Definitions JSONSchemaDefinitions - ExternalDocs *ExternalDocumentation - Example *JSON -} - -// JSON represents any valid JSON value. -// These types are supported: bool, int64, float64, string, []interface{}, map[string]interface{} and nil. -type JSON interface{} - -// JSONSchemaURL represents a schema url. -type JSONSchemaURL string - -// JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps -// or an array of JSONSchemaProps. Mainly here for serialization purposes. -type JSONSchemaPropsOrArray struct { - Schema *JSONSchemaProps - JSONSchemas []JSONSchemaProps -} - -// JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value. -// Defaults to true for the boolean property. -type JSONSchemaPropsOrBool struct { - Allows bool - Schema *JSONSchemaProps -} - -// JSONSchemaDependencies represent a dependencies property. -type JSONSchemaDependencies map[string]JSONSchemaPropsOrStringArray - -// JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array. -type JSONSchemaPropsOrStringArray struct { - Schema *JSONSchemaProps - Property []string -} - -// JSONSchemaDefinitions contains the models explicitly defined in this spec. -type JSONSchemaDefinitions map[string]JSONSchemaProps - -// ExternalDocumentation allows referencing an external resource for extended documentation. -type ExternalDocumentation struct { - Description string - URL string -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/conversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/conversion.go deleted file mode 100644 index f9951009d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/conversion.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -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 v1beta1 - -import ( - "k8s.io/apimachinery/pkg/conversion" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/json" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" -) - -func addConversionFuncs(scheme *runtime.Scheme) error { - // Add non-generated conversion functions - err := scheme.AddConversionFuncs( - Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps, - Convert_apiextensions_JSON_To_v1beta1_JSON, - Convert_v1beta1_JSON_To_apiextensions_JSON, - ) - if err != nil { - return err - } - return nil -} - -func Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(in *apiextensions.JSONSchemaProps, out *JSONSchemaProps, s conversion.Scope) error { - if err := autoConvert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(in, out, s); err != nil { - return err - } - if in.Default != nil && *(in.Default) == nil { - out.Default = nil - } - if in.Example != nil && *(in.Example) == nil { - out.Example = nil - } - return nil -} - -func Convert_apiextensions_JSON_To_v1beta1_JSON(in *apiextensions.JSON, out *JSON, s conversion.Scope) error { - raw, err := json.Marshal(*in) - if err != nil { - return err - } - out.Raw = raw - return nil -} - -func Convert_v1beta1_JSON_To_apiextensions_JSON(in *JSON, out *apiextensions.JSON, s conversion.Scope) error { - if in != nil { - var i interface{} - if err := json.Unmarshal(in.Raw, &i); err != nil { - return err - } - *out = i - } else { - out = nil - } - return nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/conversion_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/conversion_test.go deleted file mode 100644 index a697dd9e3..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/conversion_test.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -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 v1beta1 - -import ( - "reflect" - "testing" - - "k8s.io/apimachinery/pkg/runtime" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" -) - -func TestJSONConversion(t *testing.T) { - nilJSON := apiextensions.JSON(nil) - nullJSON := apiextensions.JSON("null") - stringJSON := apiextensions.JSON("foo") - boolJSON := apiextensions.JSON(true) - sliceJSON := apiextensions.JSON([]string{"foo", "bar", "baz"}) - - testCases := map[string]struct { - input *apiextensions.JSONSchemaProps - expected *JSONSchemaProps - }{ - "nil": { - input: &apiextensions.JSONSchemaProps{ - Default: nil, - }, - expected: &JSONSchemaProps{}, - }, - "aliased nil": { - input: &apiextensions.JSONSchemaProps{ - Default: &nilJSON, - }, - expected: &JSONSchemaProps{}, - }, - "null": { - input: &apiextensions.JSONSchemaProps{ - Default: &nullJSON, - }, - expected: &JSONSchemaProps{ - Default: &JSON{ - Raw: []byte(`"null"`), - }, - }, - }, - "string": { - input: &apiextensions.JSONSchemaProps{ - Default: &stringJSON, - }, - expected: &JSONSchemaProps{ - Default: &JSON{ - Raw: []byte(`"foo"`), - }, - }, - }, - "bool": { - input: &apiextensions.JSONSchemaProps{ - Default: &boolJSON, - }, - expected: &JSONSchemaProps{ - Default: &JSON{ - Raw: []byte(`true`), - }, - }, - }, - "slice": { - input: &apiextensions.JSONSchemaProps{ - Default: &sliceJSON, - }, - expected: &JSONSchemaProps{ - Default: &JSON{ - Raw: []byte(`["foo","bar","baz"]`), - }, - }, - }, - } - - scheme := runtime.NewScheme() - - // add internal and external types - if err := apiextensions.AddToScheme(scheme); err != nil { - t.Fatal(err) - } - if err := AddToScheme(scheme); err != nil { - t.Fatal(err) - } - - for k, tc := range testCases { - external := &JSONSchemaProps{} - if err := scheme.Convert(tc.input, external, nil); err != nil { - t.Errorf("%s: unexpected error: %v", k, err) - } - - if !reflect.DeepEqual(external, tc.expected) { - t.Errorf("%s: expected\n\t%#v, got \n\t%#v", k, tc.expected, external) - } - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/deepcopy.go deleted file mode 100644 index f6a114e2b..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/deepcopy.go +++ /dev/null @@ -1,238 +0,0 @@ -/* -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 v1beta1 - -// TODO: Update this after a tag is created for interface fields in DeepCopy -func (in *JSONSchemaProps) DeepCopy() *JSONSchemaProps { - if in == nil { - return nil - } - out := new(JSONSchemaProps) - *out = *in - - if in.Ref != nil { - in, out := &in.Ref, &out.Ref - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } - } - - if in.Maximum != nil { - in, out := &in.Maximum, &out.Maximum - if *in == nil { - *out = nil - } else { - *out = new(float64) - **out = **in - } - } - - if in.Minimum != nil { - in, out := &in.Minimum, &out.Minimum - if *in == nil { - *out = nil - } else { - *out = new(float64) - **out = **in - } - } - - if in.MaxLength != nil { - in, out := &in.MaxLength, &out.MaxLength - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - - if in.MinLength != nil { - in, out := &in.MinLength, &out.MinLength - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - if in.MaxItems != nil { - in, out := &in.MaxItems, &out.MaxItems - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - - if in.MinItems != nil { - in, out := &in.MinItems, &out.MinItems - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - - if in.MultipleOf != nil { - in, out := &in.MultipleOf, &out.MultipleOf - if *in == nil { - *out = nil - } else { - *out = new(float64) - **out = **in - } - } - - if in.MaxProperties != nil { - in, out := &in.MaxProperties, &out.MaxProperties - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - - if in.MinProperties != nil { - in, out := &in.MinProperties, &out.MinProperties - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - - if in.Required != nil { - in, out := &in.Required, &out.Required - *out = make([]string, len(*in)) - copy(*out, *in) - } - - if in.Items != nil { - in, out := &in.Items, &out.Items - if *in == nil { - *out = nil - } else { - *out = new(JSONSchemaPropsOrArray) - (*in).DeepCopyInto(*out) - } - } - - if in.AllOf != nil { - in, out := &in.AllOf, &out.AllOf - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - - if in.OneOf != nil { - in, out := &in.OneOf, &out.OneOf - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AnyOf != nil { - in, out := &in.AnyOf, &out.AnyOf - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - - if in.Not != nil { - in, out := &in.Not, &out.Not - if *in == nil { - *out = nil - } else { - *out = new(JSONSchemaProps) - (*in).DeepCopyInto(*out) - } - } - - if in.Properties != nil { - in, out := &in.Properties, &out.Properties - *out = make(map[string]JSONSchemaProps, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - - if in.AdditionalProperties != nil { - in, out := &in.AdditionalProperties, &out.AdditionalProperties - if *in == nil { - *out = nil - } else { - *out = new(JSONSchemaPropsOrBool) - (*in).DeepCopyInto(*out) - } - } - - if in.PatternProperties != nil { - in, out := &in.PatternProperties, &out.PatternProperties - *out = make(map[string]JSONSchemaProps, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - - if in.Dependencies != nil { - in, out := &in.Dependencies, &out.Dependencies - *out = make(JSONSchemaDependencies, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - - if in.AdditionalItems != nil { - in, out := &in.AdditionalItems, &out.AdditionalItems - if *in == nil { - *out = nil - } else { - *out = new(JSONSchemaPropsOrBool) - (*in).DeepCopyInto(*out) - } - } - - if in.Definitions != nil { - in, out := &in.Definitions, &out.Definitions - *out = make(JSONSchemaDefinitions, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - - if in.ExternalDocs != nil { - in, out := &in.ExternalDocs, &out.ExternalDocs - if *in == nil { - *out = nil - } else { - *out = new(ExternalDocumentation) - (*in).DeepCopyInto(*out) - } - } - - return out -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go deleted file mode 100644 index e3235e870..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -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 v1beta1 - -import ( - "strings" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -var swaggerMetadataDescriptions = metav1.ObjectMeta{}.SwaggerDoc() - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&CustomResourceDefinition{}, func(obj interface{}) { SetDefaults_CustomResourceDefinition(obj.(*CustomResourceDefinition)) }) - // TODO figure out why I can't seem to get my defaulter generated - // return RegisterDefaults(scheme) - return nil -} - -func SetDefaults_CustomResourceDefinition(obj *CustomResourceDefinition) { - SetDefaults_CustomResourceDefinitionSpec(&obj.Spec) - if len(obj.Status.StoredVersions) == 0 { - for _, v := range obj.Spec.Versions { - if v.Storage { - obj.Status.StoredVersions = append(obj.Status.StoredVersions, v.Name) - break - } - } - } -} - -func SetDefaults_CustomResourceDefinitionSpec(obj *CustomResourceDefinitionSpec) { - if len(obj.Scope) == 0 { - obj.Scope = NamespaceScoped - } - if len(obj.Names.Singular) == 0 { - obj.Names.Singular = strings.ToLower(obj.Names.Kind) - } - if len(obj.Names.ListKind) == 0 && len(obj.Names.Kind) > 0 { - obj.Names.ListKind = obj.Names.Kind + "List" - } - // If there is no list of versions, create on using deprecated Version field. - if len(obj.Versions) == 0 && len(obj.Version) != 0 { - obj.Versions = []CustomResourceDefinitionVersion{{ - Name: obj.Version, - Storage: true, - Served: true, - }} - } - // For backward compatibility set the version field to the first item in versions list. - if len(obj.Version) == 0 && len(obj.Versions) != 0 { - obj.Version = obj.Versions[0].Name - } - if len(obj.AdditionalPrinterColumns) == 0 { - obj.AdditionalPrinterColumns = []CustomResourceColumnDefinition{ - {Name: "Age", Type: "date", Description: swaggerMetadataDescriptions["creationTimestamp"], JSONPath: ".metadata.creationTimestamp"}, - } - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/doc.go deleted file mode 100644 index 50ab2b54c..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -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. -*/ - -// +k8s:deepcopy-gen=package -// +k8s:conversion-gen=k8s.io/apiextensions-apiserver/pkg/apis/apiextensions -// +k8s:defaulter-gen=TypeMeta - -// Package v1beta1 is the v1beta1 version of the API. -// +groupName=apiextensions.k8s.io -// +k8s:openapi-gen=true -package v1beta1 // import "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go deleted file mode 100644 index c771e61cb..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go +++ /dev/null @@ -1,6022 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by protoc-gen-gogo. -// source: k8s.io/kubernetes/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto -// DO NOT EDIT! - -/* - Package v1beta1 is a generated protocol buffer package. - - It is generated from these files: - k8s.io/kubernetes/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto - - It has these top-level messages: - CustomResourceColumnDefinition - CustomResourceDefinition - CustomResourceDefinitionCondition - CustomResourceDefinitionList - CustomResourceDefinitionNames - CustomResourceDefinitionSpec - CustomResourceDefinitionStatus - CustomResourceDefinitionVersion - CustomResourceSubresourceScale - CustomResourceSubresourceStatus - CustomResourceSubresources - CustomResourceValidation - ExternalDocumentation - JSON - JSONSchemaProps - JSONSchemaPropsOrArray - JSONSchemaPropsOrBool - JSONSchemaPropsOrStringArray -*/ -package v1beta1 - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - -import strings "strings" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package - -func (m *CustomResourceColumnDefinition) Reset() { *m = CustomResourceColumnDefinition{} } -func (*CustomResourceColumnDefinition) ProtoMessage() {} -func (*CustomResourceColumnDefinition) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{0} -} - -func (m *CustomResourceDefinition) Reset() { *m = CustomResourceDefinition{} } -func (*CustomResourceDefinition) ProtoMessage() {} -func (*CustomResourceDefinition) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{1} -} - -func (m *CustomResourceDefinitionCondition) Reset() { *m = CustomResourceDefinitionCondition{} } -func (*CustomResourceDefinitionCondition) ProtoMessage() {} -func (*CustomResourceDefinitionCondition) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{2} -} - -func (m *CustomResourceDefinitionList) Reset() { *m = CustomResourceDefinitionList{} } -func (*CustomResourceDefinitionList) ProtoMessage() {} -func (*CustomResourceDefinitionList) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{3} -} - -func (m *CustomResourceDefinitionNames) Reset() { *m = CustomResourceDefinitionNames{} } -func (*CustomResourceDefinitionNames) ProtoMessage() {} -func (*CustomResourceDefinitionNames) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{4} -} - -func (m *CustomResourceDefinitionSpec) Reset() { *m = CustomResourceDefinitionSpec{} } -func (*CustomResourceDefinitionSpec) ProtoMessage() {} -func (*CustomResourceDefinitionSpec) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{5} -} - -func (m *CustomResourceDefinitionStatus) Reset() { *m = CustomResourceDefinitionStatus{} } -func (*CustomResourceDefinitionStatus) ProtoMessage() {} -func (*CustomResourceDefinitionStatus) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{6} -} - -func (m *CustomResourceDefinitionVersion) Reset() { *m = CustomResourceDefinitionVersion{} } -func (*CustomResourceDefinitionVersion) ProtoMessage() {} -func (*CustomResourceDefinitionVersion) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{7} -} - -func (m *CustomResourceSubresourceScale) Reset() { *m = CustomResourceSubresourceScale{} } -func (*CustomResourceSubresourceScale) ProtoMessage() {} -func (*CustomResourceSubresourceScale) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{8} -} - -func (m *CustomResourceSubresourceStatus) Reset() { *m = CustomResourceSubresourceStatus{} } -func (*CustomResourceSubresourceStatus) ProtoMessage() {} -func (*CustomResourceSubresourceStatus) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{9} -} - -func (m *CustomResourceSubresources) Reset() { *m = CustomResourceSubresources{} } -func (*CustomResourceSubresources) ProtoMessage() {} -func (*CustomResourceSubresources) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{10} -} - -func (m *CustomResourceValidation) Reset() { *m = CustomResourceValidation{} } -func (*CustomResourceValidation) ProtoMessage() {} -func (*CustomResourceValidation) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{11} -} - -func (m *ExternalDocumentation) Reset() { *m = ExternalDocumentation{} } -func (*ExternalDocumentation) ProtoMessage() {} -func (*ExternalDocumentation) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} } - -func (m *JSON) Reset() { *m = JSON{} } -func (*JSON) ProtoMessage() {} -func (*JSON) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{13} } - -func (m *JSONSchemaProps) Reset() { *m = JSONSchemaProps{} } -func (*JSONSchemaProps) ProtoMessage() {} -func (*JSONSchemaProps) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{14} } - -func (m *JSONSchemaPropsOrArray) Reset() { *m = JSONSchemaPropsOrArray{} } -func (*JSONSchemaPropsOrArray) ProtoMessage() {} -func (*JSONSchemaPropsOrArray) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{15} } - -func (m *JSONSchemaPropsOrBool) Reset() { *m = JSONSchemaPropsOrBool{} } -func (*JSONSchemaPropsOrBool) ProtoMessage() {} -func (*JSONSchemaPropsOrBool) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{16} } - -func (m *JSONSchemaPropsOrStringArray) Reset() { *m = JSONSchemaPropsOrStringArray{} } -func (*JSONSchemaPropsOrStringArray) ProtoMessage() {} -func (*JSONSchemaPropsOrStringArray) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{17} -} - -func init() { - proto.RegisterType((*CustomResourceColumnDefinition)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceColumnDefinition") - proto.RegisterType((*CustomResourceDefinition)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinition") - proto.RegisterType((*CustomResourceDefinitionCondition)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionCondition") - proto.RegisterType((*CustomResourceDefinitionList)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionList") - proto.RegisterType((*CustomResourceDefinitionNames)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionNames") - proto.RegisterType((*CustomResourceDefinitionSpec)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionSpec") - proto.RegisterType((*CustomResourceDefinitionStatus)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionStatus") - proto.RegisterType((*CustomResourceDefinitionVersion)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionVersion") - proto.RegisterType((*CustomResourceSubresourceScale)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresourceScale") - proto.RegisterType((*CustomResourceSubresourceStatus)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresourceStatus") - proto.RegisterType((*CustomResourceSubresources)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresources") - proto.RegisterType((*CustomResourceValidation)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceValidation") - proto.RegisterType((*ExternalDocumentation)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.ExternalDocumentation") - proto.RegisterType((*JSON)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.JSON") - proto.RegisterType((*JSONSchemaProps)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps") - proto.RegisterType((*JSONSchemaPropsOrArray)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray") - proto.RegisterType((*JSONSchemaPropsOrBool)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrBool") - proto.RegisterType((*JSONSchemaPropsOrStringArray)(nil), "k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrStringArray") -} -func (m *CustomResourceColumnDefinition) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceColumnDefinition) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) - dAtA[i] = 0x1a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Format))) - i += copy(dAtA[i:], m.Format) - dAtA[i] = 0x22 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Description))) - i += copy(dAtA[i:], m.Description) - dAtA[i] = 0x28 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Priority)) - dAtA[i] = 0x32 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.JSONPath))) - i += copy(dAtA[i:], m.JSONPath) - return i, nil -} - -func (m *CustomResourceDefinition) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceDefinition) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n1, err := m.ObjectMeta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n2, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - dAtA[i] = 0x1a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n3, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 - return i, nil -} - -func (m *CustomResourceDefinitionCondition) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceDefinitionCondition) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) - i += copy(dAtA[i:], m.Status) - dAtA[i] = 0x1a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.LastTransitionTime.Size())) - n4, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - dAtA[i] = 0x22 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) - i += copy(dAtA[i:], m.Reason) - dAtA[i] = 0x2a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) - i += copy(dAtA[i:], m.Message) - return i, nil -} - -func (m *CustomResourceDefinitionList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceDefinitionList) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n5, err := m.ListMeta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - if len(m.Items) > 0 { - for _, msg := range m.Items { - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *CustomResourceDefinitionNames) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceDefinitionNames) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Plural))) - i += copy(dAtA[i:], m.Plural) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Singular))) - i += copy(dAtA[i:], m.Singular) - if len(m.ShortNames) > 0 { - for _, s := range m.ShortNames { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - dAtA[i] = 0x22 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - dAtA[i] = 0x2a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.ListKind))) - i += copy(dAtA[i:], m.ListKind) - if len(m.Categories) > 0 { - for _, s := range m.Categories { - dAtA[i] = 0x32 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *CustomResourceDefinitionSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceDefinitionSpec) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Group))) - i += copy(dAtA[i:], m.Group) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) - i += copy(dAtA[i:], m.Version) - dAtA[i] = 0x1a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Names.Size())) - n6, err := m.Names.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - dAtA[i] = 0x22 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Scope))) - i += copy(dAtA[i:], m.Scope) - if m.Validation != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Validation.Size())) - n7, err := m.Validation.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 - } - if m.Subresources != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Subresources.Size())) - n8, err := m.Subresources.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if len(m.Versions) > 0 { - for _, msg := range m.Versions { - dAtA[i] = 0x3a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.AdditionalPrinterColumns) > 0 { - for _, msg := range m.AdditionalPrinterColumns { - dAtA[i] = 0x42 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *CustomResourceDefinitionStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceDefinitionStatus) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Conditions) > 0 { - for _, msg := range m.Conditions { - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.AcceptedNames.Size())) - n9, err := m.AcceptedNames.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 - if len(m.StoredVersions) > 0 { - for _, s := range m.StoredVersions { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *CustomResourceDefinitionVersion) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceDefinitionVersion) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - dAtA[i] = 0x10 - i++ - if m.Served { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - dAtA[i] = 0x18 - i++ - if m.Storage { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - return i, nil -} - -func (m *CustomResourceSubresourceScale) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceSubresourceScale) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.SpecReplicasPath))) - i += copy(dAtA[i:], m.SpecReplicasPath) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.StatusReplicasPath))) - i += copy(dAtA[i:], m.StatusReplicasPath) - if m.LabelSelectorPath != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.LabelSelectorPath))) - i += copy(dAtA[i:], *m.LabelSelectorPath) - } - return i, nil -} - -func (m *CustomResourceSubresourceStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceSubresourceStatus) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *CustomResourceSubresources) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceSubresources) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Status != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n10, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 - } - if m.Scale != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Scale.Size())) - n11, err := m.Scale.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 - } - return i, nil -} - -func (m *CustomResourceValidation) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CustomResourceValidation) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.OpenAPIV3Schema != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.OpenAPIV3Schema.Size())) - n12, err := m.OpenAPIV3Schema.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 - } - return i, nil -} - -func (m *ExternalDocumentation) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ExternalDocumentation) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Description))) - i += copy(dAtA[i:], m.Description) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) - i += copy(dAtA[i:], m.URL) - return i, nil -} - -func (m *JSON) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSON) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Raw != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Raw))) - i += copy(dAtA[i:], m.Raw) - } - return i, nil -} - -func (m *JSONSchemaProps) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Schema))) - i += copy(dAtA[i:], m.Schema) - if m.Ref != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Ref))) - i += copy(dAtA[i:], *m.Ref) - } - dAtA[i] = 0x22 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Description))) - i += copy(dAtA[i:], m.Description) - dAtA[i] = 0x2a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) - dAtA[i] = 0x32 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Format))) - i += copy(dAtA[i:], m.Format) - dAtA[i] = 0x3a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Title))) - i += copy(dAtA[i:], m.Title) - if m.Default != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Default.Size())) - n13, err := m.Default.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 - } - if m.Maximum != nil { - dAtA[i] = 0x49 - i++ - i = encodeFixed64Generated(dAtA, i, uint64(math.Float64bits(float64(*m.Maximum)))) - } - dAtA[i] = 0x50 - i++ - if m.ExclusiveMaximum { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - if m.Minimum != nil { - dAtA[i] = 0x59 - i++ - i = encodeFixed64Generated(dAtA, i, uint64(math.Float64bits(float64(*m.Minimum)))) - } - dAtA[i] = 0x60 - i++ - if m.ExclusiveMinimum { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - if m.MaxLength != nil { - dAtA[i] = 0x68 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(*m.MaxLength)) - } - if m.MinLength != nil { - dAtA[i] = 0x70 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(*m.MinLength)) - } - dAtA[i] = 0x7a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Pattern))) - i += copy(dAtA[i:], m.Pattern) - if m.MaxItems != nil { - dAtA[i] = 0x80 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(*m.MaxItems)) - } - if m.MinItems != nil { - dAtA[i] = 0x88 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(*m.MinItems)) - } - dAtA[i] = 0x90 - i++ - dAtA[i] = 0x1 - i++ - if m.UniqueItems { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - if m.MultipleOf != nil { - dAtA[i] = 0x99 - i++ - dAtA[i] = 0x1 - i++ - i = encodeFixed64Generated(dAtA, i, uint64(math.Float64bits(float64(*m.MultipleOf)))) - } - if len(m.Enum) > 0 { - for _, msg := range m.Enum { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.MaxProperties != nil { - dAtA[i] = 0xa8 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(*m.MaxProperties)) - } - if m.MinProperties != nil { - dAtA[i] = 0xb0 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(*m.MinProperties)) - } - if len(m.Required) > 0 { - for _, s := range m.Required { - dAtA[i] = 0xba - i++ - dAtA[i] = 0x1 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if m.Items != nil { - dAtA[i] = 0xc2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Items.Size())) - n14, err := m.Items.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n14 - } - if len(m.AllOf) > 0 { - for _, msg := range m.AllOf { - dAtA[i] = 0xca - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.OneOf) > 0 { - for _, msg := range m.OneOf { - dAtA[i] = 0xd2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.AnyOf) > 0 { - for _, msg := range m.AnyOf { - dAtA[i] = 0xda - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Not != nil { - dAtA[i] = 0xe2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Not.Size())) - n15, err := m.Not.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n15 - } - if len(m.Properties) > 0 { - keysForProperties := make([]string, 0, len(m.Properties)) - for k := range m.Properties { - keysForProperties = append(keysForProperties, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForProperties) - for _, k := range keysForProperties { - dAtA[i] = 0xea - i++ - dAtA[i] = 0x1 - i++ - v := m.Properties[string(k)] - msgSize := 0 - if (&v) != nil { - msgSize = (&v).Size() - msgSize += 1 + sovGenerated(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + msgSize - i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n16, err := (&v).MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 - } - } - if m.AdditionalProperties != nil { - dAtA[i] = 0xf2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.AdditionalProperties.Size())) - n17, err := m.AdditionalProperties.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n17 - } - if len(m.PatternProperties) > 0 { - keysForPatternProperties := make([]string, 0, len(m.PatternProperties)) - for k := range m.PatternProperties { - keysForPatternProperties = append(keysForPatternProperties, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForPatternProperties) - for _, k := range keysForPatternProperties { - dAtA[i] = 0xfa - i++ - dAtA[i] = 0x1 - i++ - v := m.PatternProperties[string(k)] - msgSize := 0 - if (&v) != nil { - msgSize = (&v).Size() - msgSize += 1 + sovGenerated(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + msgSize - i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n18, err := (&v).MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 - } - } - if len(m.Dependencies) > 0 { - keysForDependencies := make([]string, 0, len(m.Dependencies)) - for k := range m.Dependencies { - keysForDependencies = append(keysForDependencies, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForDependencies) - for _, k := range keysForDependencies { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x2 - i++ - v := m.Dependencies[string(k)] - msgSize := 0 - if (&v) != nil { - msgSize = (&v).Size() - msgSize += 1 + sovGenerated(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + msgSize - i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n19, err := (&v).MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n19 - } - } - if m.AdditionalItems != nil { - dAtA[i] = 0x8a - i++ - dAtA[i] = 0x2 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.AdditionalItems.Size())) - n20, err := m.AdditionalItems.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n20 - } - if len(m.Definitions) > 0 { - keysForDefinitions := make([]string, 0, len(m.Definitions)) - for k := range m.Definitions { - keysForDefinitions = append(keysForDefinitions, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForDefinitions) - for _, k := range keysForDefinitions { - dAtA[i] = 0x92 - i++ - dAtA[i] = 0x2 - i++ - v := m.Definitions[string(k)] - msgSize := 0 - if (&v) != nil { - msgSize = (&v).Size() - msgSize += 1 + sovGenerated(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + msgSize - i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n21, err := (&v).MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n21 - } - } - if m.ExternalDocs != nil { - dAtA[i] = 0x9a - i++ - dAtA[i] = 0x2 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.ExternalDocs.Size())) - n22, err := m.ExternalDocs.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n22 - } - if m.Example != nil { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x2 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Example.Size())) - n23, err := m.Example.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n23 - } - return i, nil -} - -func (m *JSONSchemaPropsOrArray) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONSchemaPropsOrArray) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Schema != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Schema.Size())) - n24, err := m.Schema.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n24 - } - if len(m.JSONSchemas) > 0 { - for _, msg := range m.JSONSchemas { - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *JSONSchemaPropsOrBool) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONSchemaPropsOrBool) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0x8 - i++ - if m.Allows { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - if m.Schema != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Schema.Size())) - n25, err := m.Schema.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n25 - } - return i, nil -} - -func (m *JSONSchemaPropsOrStringArray) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *JSONSchemaPropsOrStringArray) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Schema != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Schema.Size())) - n26, err := m.Schema.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n26 - } - if len(m.Property) > 0 { - for _, s := range m.Property { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func encodeFixed64Generated(dAtA []byte, offset int, v uint64) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - dAtA[offset+4] = uint8(v >> 32) - dAtA[offset+5] = uint8(v >> 40) - dAtA[offset+6] = uint8(v >> 48) - dAtA[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Generated(dAtA []byte, offset int, v uint32) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *CustomResourceColumnDefinition) Size() (n int) { - var l int - _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Format) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Description) - n += 1 + l + sovGenerated(uint64(l)) - n += 1 + sovGenerated(uint64(m.Priority)) - l = len(m.JSONPath) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *CustomResourceDefinition) Size() (n int) { - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *CustomResourceDefinitionCondition) Size() (n int) { - var l int - _ = l - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Status) - n += 1 + l + sovGenerated(uint64(l)) - l = m.LastTransitionTime.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Reason) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Message) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *CustomResourceDefinitionList) Size() (n int) { - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *CustomResourceDefinitionNames) Size() (n int) { - var l int - _ = l - l = len(m.Plural) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Singular) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.ShortNames) > 0 { - for _, s := range m.ShortNames { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - l = len(m.Kind) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.ListKind) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Categories) > 0 { - for _, s := range m.Categories { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *CustomResourceDefinitionSpec) Size() (n int) { - var l int - _ = l - l = len(m.Group) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Version) - n += 1 + l + sovGenerated(uint64(l)) - l = m.Names.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Scope) - n += 1 + l + sovGenerated(uint64(l)) - if m.Validation != nil { - l = m.Validation.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.Subresources != nil { - l = m.Subresources.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if len(m.Versions) > 0 { - for _, e := range m.Versions { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.AdditionalPrinterColumns) > 0 { - for _, e := range m.AdditionalPrinterColumns { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *CustomResourceDefinitionStatus) Size() (n int) { - var l int - _ = l - if len(m.Conditions) > 0 { - for _, e := range m.Conditions { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - l = m.AcceptedNames.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.StoredVersions) > 0 { - for _, s := range m.StoredVersions { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *CustomResourceDefinitionVersion) Size() (n int) { - var l int - _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - n += 2 - n += 2 - return n -} - -func (m *CustomResourceSubresourceScale) Size() (n int) { - var l int - _ = l - l = len(m.SpecReplicasPath) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.StatusReplicasPath) - n += 1 + l + sovGenerated(uint64(l)) - if m.LabelSelectorPath != nil { - l = len(*m.LabelSelectorPath) - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *CustomResourceSubresourceStatus) Size() (n int) { - var l int - _ = l - return n -} - -func (m *CustomResourceSubresources) Size() (n int) { - var l int - _ = l - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.Scale != nil { - l = m.Scale.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *CustomResourceValidation) Size() (n int) { - var l int - _ = l - if m.OpenAPIV3Schema != nil { - l = m.OpenAPIV3Schema.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *ExternalDocumentation) Size() (n int) { - var l int - _ = l - l = len(m.Description) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.URL) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *JSON) Size() (n int) { - var l int - _ = l - if m.Raw != nil { - l = len(m.Raw) - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *JSONSchemaProps) Size() (n int) { - var l int - _ = l - l = len(m.ID) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Schema) - n += 1 + l + sovGenerated(uint64(l)) - if m.Ref != nil { - l = len(*m.Ref) - n += 1 + l + sovGenerated(uint64(l)) - } - l = len(m.Description) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Format) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Title) - n += 1 + l + sovGenerated(uint64(l)) - if m.Default != nil { - l = m.Default.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.Maximum != nil { - n += 9 - } - n += 2 - if m.Minimum != nil { - n += 9 - } - n += 2 - if m.MaxLength != nil { - n += 1 + sovGenerated(uint64(*m.MaxLength)) - } - if m.MinLength != nil { - n += 1 + sovGenerated(uint64(*m.MinLength)) - } - l = len(m.Pattern) - n += 1 + l + sovGenerated(uint64(l)) - if m.MaxItems != nil { - n += 2 + sovGenerated(uint64(*m.MaxItems)) - } - if m.MinItems != nil { - n += 2 + sovGenerated(uint64(*m.MinItems)) - } - n += 3 - if m.MultipleOf != nil { - n += 10 - } - if len(m.Enum) > 0 { - for _, e := range m.Enum { - l = e.Size() - n += 2 + l + sovGenerated(uint64(l)) - } - } - if m.MaxProperties != nil { - n += 2 + sovGenerated(uint64(*m.MaxProperties)) - } - if m.MinProperties != nil { - n += 2 + sovGenerated(uint64(*m.MinProperties)) - } - if len(m.Required) > 0 { - for _, s := range m.Required { - l = len(s) - n += 2 + l + sovGenerated(uint64(l)) - } - } - if m.Items != nil { - l = m.Items.Size() - n += 2 + l + sovGenerated(uint64(l)) - } - if len(m.AllOf) > 0 { - for _, e := range m.AllOf { - l = e.Size() - n += 2 + l + sovGenerated(uint64(l)) - } - } - if len(m.OneOf) > 0 { - for _, e := range m.OneOf { - l = e.Size() - n += 2 + l + sovGenerated(uint64(l)) - } - } - if len(m.AnyOf) > 0 { - for _, e := range m.AnyOf { - l = e.Size() - n += 2 + l + sovGenerated(uint64(l)) - } - } - if m.Not != nil { - l = m.Not.Size() - n += 2 + l + sovGenerated(uint64(l)) - } - if len(m.Properties) > 0 { - for k, v := range m.Properties { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) - } - } - if m.AdditionalProperties != nil { - l = m.AdditionalProperties.Size() - n += 2 + l + sovGenerated(uint64(l)) - } - if len(m.PatternProperties) > 0 { - for k, v := range m.PatternProperties { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) - } - } - if len(m.Dependencies) > 0 { - for k, v := range m.Dependencies { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) - } - } - if m.AdditionalItems != nil { - l = m.AdditionalItems.Size() - n += 2 + l + sovGenerated(uint64(l)) - } - if len(m.Definitions) > 0 { - for k, v := range m.Definitions { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) - } - } - if m.ExternalDocs != nil { - l = m.ExternalDocs.Size() - n += 2 + l + sovGenerated(uint64(l)) - } - if m.Example != nil { - l = m.Example.Size() - n += 2 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *JSONSchemaPropsOrArray) Size() (n int) { - var l int - _ = l - if m.Schema != nil { - l = m.Schema.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if len(m.JSONSchemas) > 0 { - for _, e := range m.JSONSchemas { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *JSONSchemaPropsOrBool) Size() (n int) { - var l int - _ = l - n += 2 - if m.Schema != nil { - l = m.Schema.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *JSONSchemaPropsOrStringArray) Size() (n int) { - var l int - _ = l - if m.Schema != nil { - l = m.Schema.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if len(m.Property) > 0 { - for _, s := range m.Property { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func sovGenerated(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *CustomResourceColumnDefinition) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceColumnDefinition{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Format:` + fmt.Sprintf("%v", this.Format) + `,`, - `Description:` + fmt.Sprintf("%v", this.Description) + `,`, - `Priority:` + fmt.Sprintf("%v", this.Priority) + `,`, - `JSONPath:` + fmt.Sprintf("%v", this.JSONPath) + `,`, - `}`, - }, "") - return s -} -func (this *CustomResourceDefinition) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceDefinition{`, - `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "CustomResourceDefinitionSpec", "CustomResourceDefinitionSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "CustomResourceDefinitionStatus", "CustomResourceDefinitionStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *CustomResourceDefinitionCondition) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceDefinitionCondition{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `LastTransitionTime:` + strings.Replace(strings.Replace(this.LastTransitionTime.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`, - `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `}`, - }, "") - return s -} -func (this *CustomResourceDefinitionList) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceDefinitionList{`, - `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "CustomResourceDefinition", "CustomResourceDefinition", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *CustomResourceDefinitionNames) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceDefinitionNames{`, - `Plural:` + fmt.Sprintf("%v", this.Plural) + `,`, - `Singular:` + fmt.Sprintf("%v", this.Singular) + `,`, - `ShortNames:` + fmt.Sprintf("%v", this.ShortNames) + `,`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `ListKind:` + fmt.Sprintf("%v", this.ListKind) + `,`, - `Categories:` + fmt.Sprintf("%v", this.Categories) + `,`, - `}`, - }, "") - return s -} -func (this *CustomResourceDefinitionSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceDefinitionSpec{`, - `Group:` + fmt.Sprintf("%v", this.Group) + `,`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `Names:` + strings.Replace(strings.Replace(this.Names.String(), "CustomResourceDefinitionNames", "CustomResourceDefinitionNames", 1), `&`, ``, 1) + `,`, - `Scope:` + fmt.Sprintf("%v", this.Scope) + `,`, - `Validation:` + strings.Replace(fmt.Sprintf("%v", this.Validation), "CustomResourceValidation", "CustomResourceValidation", 1) + `,`, - `Subresources:` + strings.Replace(fmt.Sprintf("%v", this.Subresources), "CustomResourceSubresources", "CustomResourceSubresources", 1) + `,`, - `Versions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Versions), "CustomResourceDefinitionVersion", "CustomResourceDefinitionVersion", 1), `&`, ``, 1) + `,`, - `AdditionalPrinterColumns:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.AdditionalPrinterColumns), "CustomResourceColumnDefinition", "CustomResourceColumnDefinition", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *CustomResourceDefinitionStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceDefinitionStatus{`, - `Conditions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Conditions), "CustomResourceDefinitionCondition", "CustomResourceDefinitionCondition", 1), `&`, ``, 1) + `,`, - `AcceptedNames:` + strings.Replace(strings.Replace(this.AcceptedNames.String(), "CustomResourceDefinitionNames", "CustomResourceDefinitionNames", 1), `&`, ``, 1) + `,`, - `StoredVersions:` + fmt.Sprintf("%v", this.StoredVersions) + `,`, - `}`, - }, "") - return s -} -func (this *CustomResourceDefinitionVersion) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceDefinitionVersion{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Served:` + fmt.Sprintf("%v", this.Served) + `,`, - `Storage:` + fmt.Sprintf("%v", this.Storage) + `,`, - `}`, - }, "") - return s -} -func (this *CustomResourceSubresourceScale) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceSubresourceScale{`, - `SpecReplicasPath:` + fmt.Sprintf("%v", this.SpecReplicasPath) + `,`, - `StatusReplicasPath:` + fmt.Sprintf("%v", this.StatusReplicasPath) + `,`, - `LabelSelectorPath:` + valueToStringGenerated(this.LabelSelectorPath) + `,`, - `}`, - }, "") - return s -} -func (this *CustomResourceSubresourceStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceSubresourceStatus{`, - `}`, - }, "") - return s -} -func (this *CustomResourceSubresources) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceSubresources{`, - `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "CustomResourceSubresourceStatus", "CustomResourceSubresourceStatus", 1) + `,`, - `Scale:` + strings.Replace(fmt.Sprintf("%v", this.Scale), "CustomResourceSubresourceScale", "CustomResourceSubresourceScale", 1) + `,`, - `}`, - }, "") - return s -} -func (this *CustomResourceValidation) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CustomResourceValidation{`, - `OpenAPIV3Schema:` + strings.Replace(fmt.Sprintf("%v", this.OpenAPIV3Schema), "JSONSchemaProps", "JSONSchemaProps", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ExternalDocumentation) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ExternalDocumentation{`, - `Description:` + fmt.Sprintf("%v", this.Description) + `,`, - `URL:` + fmt.Sprintf("%v", this.URL) + `,`, - `}`, - }, "") - return s -} -func (this *JSON) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&JSON{`, - `Raw:` + valueToStringGenerated(this.Raw) + `,`, - `}`, - }, "") - return s -} -func (this *JSONSchemaProps) String() string { - if this == nil { - return "nil" - } - keysForProperties := make([]string, 0, len(this.Properties)) - for k := range this.Properties { - keysForProperties = append(keysForProperties, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForProperties) - mapStringForProperties := "map[string]JSONSchemaProps{" - for _, k := range keysForProperties { - mapStringForProperties += fmt.Sprintf("%v: %v,", k, this.Properties[k]) - } - mapStringForProperties += "}" - keysForPatternProperties := make([]string, 0, len(this.PatternProperties)) - for k := range this.PatternProperties { - keysForPatternProperties = append(keysForPatternProperties, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForPatternProperties) - mapStringForPatternProperties := "map[string]JSONSchemaProps{" - for _, k := range keysForPatternProperties { - mapStringForPatternProperties += fmt.Sprintf("%v: %v,", k, this.PatternProperties[k]) - } - mapStringForPatternProperties += "}" - keysForDependencies := make([]string, 0, len(this.Dependencies)) - for k := range this.Dependencies { - keysForDependencies = append(keysForDependencies, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForDependencies) - mapStringForDependencies := "JSONSchemaDependencies{" - for _, k := range keysForDependencies { - mapStringForDependencies += fmt.Sprintf("%v: %v,", k, this.Dependencies[k]) - } - mapStringForDependencies += "}" - keysForDefinitions := make([]string, 0, len(this.Definitions)) - for k := range this.Definitions { - keysForDefinitions = append(keysForDefinitions, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForDefinitions) - mapStringForDefinitions := "JSONSchemaDefinitions{" - for _, k := range keysForDefinitions { - mapStringForDefinitions += fmt.Sprintf("%v: %v,", k, this.Definitions[k]) - } - mapStringForDefinitions += "}" - s := strings.Join([]string{`&JSONSchemaProps{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Schema:` + fmt.Sprintf("%v", this.Schema) + `,`, - `Ref:` + valueToStringGenerated(this.Ref) + `,`, - `Description:` + fmt.Sprintf("%v", this.Description) + `,`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Format:` + fmt.Sprintf("%v", this.Format) + `,`, - `Title:` + fmt.Sprintf("%v", this.Title) + `,`, - `Default:` + strings.Replace(fmt.Sprintf("%v", this.Default), "JSON", "JSON", 1) + `,`, - `Maximum:` + valueToStringGenerated(this.Maximum) + `,`, - `ExclusiveMaximum:` + fmt.Sprintf("%v", this.ExclusiveMaximum) + `,`, - `Minimum:` + valueToStringGenerated(this.Minimum) + `,`, - `ExclusiveMinimum:` + fmt.Sprintf("%v", this.ExclusiveMinimum) + `,`, - `MaxLength:` + valueToStringGenerated(this.MaxLength) + `,`, - `MinLength:` + valueToStringGenerated(this.MinLength) + `,`, - `Pattern:` + fmt.Sprintf("%v", this.Pattern) + `,`, - `MaxItems:` + valueToStringGenerated(this.MaxItems) + `,`, - `MinItems:` + valueToStringGenerated(this.MinItems) + `,`, - `UniqueItems:` + fmt.Sprintf("%v", this.UniqueItems) + `,`, - `MultipleOf:` + valueToStringGenerated(this.MultipleOf) + `,`, - `Enum:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Enum), "JSON", "JSON", 1), `&`, ``, 1) + `,`, - `MaxProperties:` + valueToStringGenerated(this.MaxProperties) + `,`, - `MinProperties:` + valueToStringGenerated(this.MinProperties) + `,`, - `Required:` + fmt.Sprintf("%v", this.Required) + `,`, - `Items:` + strings.Replace(fmt.Sprintf("%v", this.Items), "JSONSchemaPropsOrArray", "JSONSchemaPropsOrArray", 1) + `,`, - `AllOf:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.AllOf), "JSONSchemaProps", "JSONSchemaProps", 1), `&`, ``, 1) + `,`, - `OneOf:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.OneOf), "JSONSchemaProps", "JSONSchemaProps", 1), `&`, ``, 1) + `,`, - `AnyOf:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.AnyOf), "JSONSchemaProps", "JSONSchemaProps", 1), `&`, ``, 1) + `,`, - `Not:` + strings.Replace(fmt.Sprintf("%v", this.Not), "JSONSchemaProps", "JSONSchemaProps", 1) + `,`, - `Properties:` + mapStringForProperties + `,`, - `AdditionalProperties:` + strings.Replace(fmt.Sprintf("%v", this.AdditionalProperties), "JSONSchemaPropsOrBool", "JSONSchemaPropsOrBool", 1) + `,`, - `PatternProperties:` + mapStringForPatternProperties + `,`, - `Dependencies:` + mapStringForDependencies + `,`, - `AdditionalItems:` + strings.Replace(fmt.Sprintf("%v", this.AdditionalItems), "JSONSchemaPropsOrBool", "JSONSchemaPropsOrBool", 1) + `,`, - `Definitions:` + mapStringForDefinitions + `,`, - `ExternalDocs:` + strings.Replace(fmt.Sprintf("%v", this.ExternalDocs), "ExternalDocumentation", "ExternalDocumentation", 1) + `,`, - `Example:` + strings.Replace(fmt.Sprintf("%v", this.Example), "JSON", "JSON", 1) + `,`, - `}`, - }, "") - return s -} -func (this *JSONSchemaPropsOrArray) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&JSONSchemaPropsOrArray{`, - `Schema:` + strings.Replace(fmt.Sprintf("%v", this.Schema), "JSONSchemaProps", "JSONSchemaProps", 1) + `,`, - `JSONSchemas:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.JSONSchemas), "JSONSchemaProps", "JSONSchemaProps", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *JSONSchemaPropsOrBool) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&JSONSchemaPropsOrBool{`, - `Allows:` + fmt.Sprintf("%v", this.Allows) + `,`, - `Schema:` + strings.Replace(fmt.Sprintf("%v", this.Schema), "JSONSchemaProps", "JSONSchemaProps", 1) + `,`, - `}`, - }, "") - return s -} -func (this *JSONSchemaPropsOrStringArray) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&JSONSchemaPropsOrStringArray{`, - `Schema:` + strings.Replace(fmt.Sprintf("%v", this.Schema), "JSONSchemaProps", "JSONSchemaProps", 1) + `,`, - `Property:` + fmt.Sprintf("%v", this.Property) + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *CustomResourceColumnDefinition) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceColumnDefinition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceColumnDefinition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Format = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) - } - m.Priority = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Priority |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JSONPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.JSONPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CustomResourceDefinition) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceDefinition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceDefinition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CustomResourceDefinitionCondition) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceDefinitionCondition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceDefinitionCondition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = CustomResourceDefinitionConditionType(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = ConditionStatus(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Reason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CustomResourceDefinitionList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceDefinitionList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceDefinitionList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, CustomResourceDefinition{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CustomResourceDefinitionNames) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceDefinitionNames: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceDefinitionNames: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Plural", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Plural = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Singular", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Singular = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShortNames", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ShortNames = append(m.ShortNames, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListKind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ListKind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Categories", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Categories = append(m.Categories, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CustomResourceDefinitionSpec) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceDefinitionSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceDefinitionSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Group = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Names.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Scope = ResourceScope(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Validation == nil { - m.Validation = &CustomResourceValidation{} - } - if err := m.Validation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subresources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Subresources == nil { - m.Subresources = &CustomResourceSubresources{} - } - if err := m.Subresources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Versions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Versions = append(m.Versions, CustomResourceDefinitionVersion{}) - if err := m.Versions[len(m.Versions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AdditionalPrinterColumns", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AdditionalPrinterColumns = append(m.AdditionalPrinterColumns, CustomResourceColumnDefinition{}) - if err := m.AdditionalPrinterColumns[len(m.AdditionalPrinterColumns)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CustomResourceDefinitionStatus) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceDefinitionStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceDefinitionStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Conditions = append(m.Conditions, CustomResourceDefinitionCondition{}) - if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AcceptedNames", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AcceptedNames.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StoredVersions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StoredVersions = append(m.StoredVersions, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CustomResourceDefinitionVersion) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceDefinitionVersion: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceDefinitionVersion: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Served", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Served = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Storage", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Storage = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CustomResourceSubresourceScale) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceSubresourceScale: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceSubresourceScale: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpecReplicasPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpecReplicasPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StatusReplicasPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StatusReplicasPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LabelSelectorPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.LabelSelectorPath = &s - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CustomResourceSubresourceStatus) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceSubresourceStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceSubresourceStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CustomResourceSubresources) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceSubresources: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceSubresources: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Status == nil { - m.Status = &CustomResourceSubresourceStatus{} - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scale", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scale == nil { - m.Scale = &CustomResourceSubresourceScale{} - } - if err := m.Scale.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CustomResourceValidation) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CustomResourceValidation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CustomResourceValidation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OpenAPIV3Schema", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.OpenAPIV3Schema == nil { - m.OpenAPIV3Schema = &JSONSchemaProps{} - } - if err := m.OpenAPIV3Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ExternalDocumentation) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ExternalDocumentation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExternalDocumentation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.URL = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSON) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JSON: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JSON: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Raw = append(m.Raw[:0], dAtA[iNdEx:postIndex]...) - if m.Raw == nil { - m.Raw = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONSchemaProps) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JSONSchemaProps: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JSONSchemaProps: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Schema = JSONSchemaURL(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Ref = &s - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Format = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Default", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Default == nil { - m.Default = &JSON{} - } - if err := m.Default.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Maximum", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(dAtA[iNdEx-8]) - v |= uint64(dAtA[iNdEx-7]) << 8 - v |= uint64(dAtA[iNdEx-6]) << 16 - v |= uint64(dAtA[iNdEx-5]) << 24 - v |= uint64(dAtA[iNdEx-4]) << 32 - v |= uint64(dAtA[iNdEx-3]) << 40 - v |= uint64(dAtA[iNdEx-2]) << 48 - v |= uint64(dAtA[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.Maximum = &v2 - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExclusiveMaximum", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ExclusiveMaximum = bool(v != 0) - case 11: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Minimum", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(dAtA[iNdEx-8]) - v |= uint64(dAtA[iNdEx-7]) << 8 - v |= uint64(dAtA[iNdEx-6]) << 16 - v |= uint64(dAtA[iNdEx-5]) << 24 - v |= uint64(dAtA[iNdEx-4]) << 32 - v |= uint64(dAtA[iNdEx-3]) << 40 - v |= uint64(dAtA[iNdEx-2]) << 48 - v |= uint64(dAtA[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.Minimum = &v2 - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExclusiveMinimum", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ExclusiveMinimum = bool(v != 0) - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxLength", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MaxLength = &v - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinLength", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MinLength = &v - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pattern", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Pattern = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxItems", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MaxItems = &v - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinItems", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MinItems = &v - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UniqueItems", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.UniqueItems = bool(v != 0) - case 19: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field MultipleOf", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(dAtA[iNdEx-8]) - v |= uint64(dAtA[iNdEx-7]) << 8 - v |= uint64(dAtA[iNdEx-6]) << 16 - v |= uint64(dAtA[iNdEx-5]) << 24 - v |= uint64(dAtA[iNdEx-4]) << 32 - v |= uint64(dAtA[iNdEx-3]) << 40 - v |= uint64(dAtA[iNdEx-2]) << 48 - v |= uint64(dAtA[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.MultipleOf = &v2 - case 20: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Enum", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Enum = append(m.Enum, JSON{}) - if err := m.Enum[len(m.Enum)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 21: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxProperties", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MaxProperties = &v - case 22: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinProperties", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MinProperties = &v - case 23: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Required", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Required = append(m.Required, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 24: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Items == nil { - m.Items = &JSONSchemaPropsOrArray{} - } - if err := m.Items.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 25: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllOf", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AllOf = append(m.AllOf, JSONSchemaProps{}) - if err := m.AllOf[len(m.AllOf)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 26: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OneOf", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OneOf = append(m.OneOf, JSONSchemaProps{}) - if err := m.OneOf[len(m.OneOf)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 27: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AnyOf", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AnyOf = append(m.AnyOf, JSONSchemaProps{}) - if err := m.AnyOf[len(m.AnyOf)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 28: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Not", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Not == nil { - m.Not = &JSONSchemaProps{} - } - if err := m.Not.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 29: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Properties", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - var keykey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - keykey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - if m.Properties == nil { - m.Properties = make(map[string]JSONSchemaProps) - } - if iNdEx < postIndex { - var valuekey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - valuekey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue := &JSONSchemaProps{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - m.Properties[mapkey] = *mapvalue - } else { - var mapvalue JSONSchemaProps - m.Properties[mapkey] = mapvalue - } - iNdEx = postIndex - case 30: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AdditionalProperties", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AdditionalProperties == nil { - m.AdditionalProperties = &JSONSchemaPropsOrBool{} - } - if err := m.AdditionalProperties.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 31: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PatternProperties", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - var keykey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - keykey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - if m.PatternProperties == nil { - m.PatternProperties = make(map[string]JSONSchemaProps) - } - if iNdEx < postIndex { - var valuekey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - valuekey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue := &JSONSchemaProps{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - m.PatternProperties[mapkey] = *mapvalue - } else { - var mapvalue JSONSchemaProps - m.PatternProperties[mapkey] = mapvalue - } - iNdEx = postIndex - case 32: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dependencies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - var keykey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - keykey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - if m.Dependencies == nil { - m.Dependencies = make(JSONSchemaDependencies) - } - if iNdEx < postIndex { - var valuekey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - valuekey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue := &JSONSchemaPropsOrStringArray{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - m.Dependencies[mapkey] = *mapvalue - } else { - var mapvalue JSONSchemaPropsOrStringArray - m.Dependencies[mapkey] = mapvalue - } - iNdEx = postIndex - case 33: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AdditionalItems", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AdditionalItems == nil { - m.AdditionalItems = &JSONSchemaPropsOrBool{} - } - if err := m.AdditionalItems.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 34: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Definitions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - var keykey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - keykey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - if m.Definitions == nil { - m.Definitions = make(JSONSchemaDefinitions) - } - if iNdEx < postIndex { - var valuekey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - valuekey |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue := &JSONSchemaProps{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - m.Definitions[mapkey] = *mapvalue - } else { - var mapvalue JSONSchemaProps - m.Definitions[mapkey] = mapvalue - } - iNdEx = postIndex - case 35: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExternalDocs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExternalDocs == nil { - m.ExternalDocs = &ExternalDocumentation{} - } - if err := m.ExternalDocs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 36: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Example", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Example == nil { - m.Example = &JSON{} - } - if err := m.Example.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONSchemaPropsOrArray) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JSONSchemaPropsOrArray: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JSONSchemaPropsOrArray: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Schema == nil { - m.Schema = &JSONSchemaProps{} - } - if err := m.Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JSONSchemas", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.JSONSchemas = append(m.JSONSchemas, JSONSchemaProps{}) - if err := m.JSONSchemas[len(m.JSONSchemas)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONSchemaPropsOrBool) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JSONSchemaPropsOrBool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JSONSchemaPropsOrBool: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Allows", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Allows = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Schema == nil { - m.Schema = &JSONSchemaProps{} - } - if err := m.Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JSONSchemaPropsOrStringArray) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JSONSchemaPropsOrStringArray: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JSONSchemaPropsOrStringArray: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Schema == nil { - m.Schema = &JSONSchemaProps{} - } - if err := m.Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Property", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Property = append(m.Property, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenerated(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthGenerated - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipGenerated(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") -) - -func init() { - proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto", fileDescriptorGenerated) -} - -var fileDescriptorGenerated = []byte{ - // 2292 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xdd, 0x6f, 0x5b, 0x49, - 0x15, 0xef, 0xd8, 0x71, 0xe2, 0x8c, 0x93, 0x26, 0x99, 0x6d, 0xca, 0x6d, 0x68, 0xed, 0xd4, 0x65, - 0x57, 0x01, 0xb6, 0x0e, 0x2d, 0xbb, 0xec, 0xb2, 0x12, 0x0f, 0x71, 0x52, 0x50, 0x97, 0xa6, 0x89, - 0xc6, 0x6d, 0x11, 0xec, 0xe7, 0xc4, 0x9e, 0x38, 0xb7, 0xb9, 0x5f, 0xbd, 0x33, 0xd7, 0x4d, 0x24, - 0x40, 0x7c, 0x68, 0x85, 0x84, 0x80, 0x05, 0xb6, 0x42, 0x42, 0xe2, 0x05, 0x24, 0x5e, 0x10, 0x82, - 0x07, 0x78, 0x83, 0x3f, 0xa0, 0x8f, 0xfb, 0xb8, 0x4f, 0x16, 0x35, 0xff, 0x02, 0x12, 0x52, 0x9e, - 0xd0, 0x7c, 0xdc, 0xb9, 0x1f, 0x4e, 0xb6, 0x11, 0x6b, 0x6f, 0xdf, 0x7c, 0xcf, 0x39, 0x73, 0x7e, - 0xbf, 0x39, 0x73, 0xe6, 0xcc, 0x39, 0x09, 0xdc, 0xdd, 0x7f, 0x95, 0x35, 0x6c, 0x7f, 0x75, 0x3f, - 0xda, 0xa1, 0xa1, 0x47, 0x39, 0x65, 0xab, 0x3d, 0xea, 0x75, 0xfc, 0x70, 0x55, 0x2b, 0x48, 0x60, - 0xd3, 0x03, 0x4e, 0x3d, 0x66, 0xfb, 0x1e, 0xbb, 0x4a, 0x02, 0x9b, 0xd1, 0xb0, 0x47, 0xc3, 0xd5, - 0x60, 0xbf, 0x2b, 0x74, 0x2c, 0x6b, 0xb0, 0xda, 0xbb, 0xb6, 0x43, 0x39, 0xb9, 0xb6, 0xda, 0xa5, - 0x1e, 0x0d, 0x09, 0xa7, 0x9d, 0x46, 0x10, 0xfa, 0xdc, 0x47, 0x5f, 0x53, 0xee, 0x1a, 0x19, 0xeb, - 0x77, 0x8c, 0xbb, 0x46, 0xb0, 0xdf, 0x15, 0x3a, 0x96, 0x35, 0x68, 0x68, 0x77, 0x4b, 0x57, 0xbb, - 0x36, 0xdf, 0x8b, 0x76, 0x1a, 0x6d, 0xdf, 0x5d, 0xed, 0xfa, 0x5d, 0x7f, 0x55, 0x7a, 0xdd, 0x89, - 0x76, 0xe5, 0x97, 0xfc, 0x90, 0xbf, 0x14, 0xda, 0xd2, 0x4b, 0x09, 0x79, 0x97, 0xb4, 0xf7, 0x6c, - 0x8f, 0x86, 0x87, 0x09, 0x63, 0x97, 0x72, 0xb2, 0xda, 0x1b, 0xe2, 0xb8, 0xb4, 0x7a, 0xd2, 0xaa, - 0x30, 0xf2, 0xb8, 0xed, 0xd2, 0xa1, 0x05, 0x5f, 0x79, 0xda, 0x02, 0xd6, 0xde, 0xa3, 0x2e, 0xc9, - 0xaf, 0xab, 0x7f, 0x50, 0x80, 0xd5, 0xf5, 0x88, 0x71, 0xdf, 0xc5, 0x94, 0xf9, 0x51, 0xd8, 0xa6, - 0xeb, 0xbe, 0x13, 0xb9, 0xde, 0x06, 0xdd, 0xb5, 0x3d, 0x9b, 0xdb, 0xbe, 0x87, 0x96, 0xe1, 0x84, - 0x47, 0x5c, 0x6a, 0x81, 0x65, 0xb0, 0x32, 0xdd, 0x9c, 0x79, 0xdc, 0xaf, 0x9d, 0x19, 0xf4, 0x6b, - 0x13, 0xb7, 0x89, 0x4b, 0xb1, 0xd4, 0x08, 0x0b, 0x7e, 0x18, 0x50, 0xab, 0x90, 0xb5, 0xb8, 0x73, - 0x18, 0x50, 0x2c, 0x35, 0xe8, 0x05, 0x38, 0xb9, 0xeb, 0x87, 0x2e, 0xe1, 0x56, 0x51, 0xda, 0x9c, - 0xd5, 0x36, 0x93, 0x5f, 0x97, 0x52, 0xac, 0xb5, 0xe8, 0x65, 0x58, 0xe9, 0x50, 0xd6, 0x0e, 0xed, - 0x40, 0x40, 0x5b, 0x13, 0xd2, 0xf8, 0x39, 0x6d, 0x5c, 0xd9, 0x48, 0x54, 0x38, 0x6d, 0x87, 0x5e, - 0x84, 0xe5, 0x20, 0xb4, 0xfd, 0xd0, 0xe6, 0x87, 0x56, 0x69, 0x19, 0xac, 0x94, 0x9a, 0xf3, 0x7a, - 0x4d, 0x79, 0x5b, 0xcb, 0xb1, 0xb1, 0x40, 0xcb, 0xb0, 0xfc, 0x7a, 0x6b, 0xeb, 0xf6, 0x36, 0xe1, - 0x7b, 0xd6, 0xa4, 0x44, 0x98, 0x10, 0xd6, 0xb8, 0x7c, 0x5f, 0x4b, 0xeb, 0x3f, 0x2e, 0x42, 0x2b, - 0x1b, 0x95, 0x54, 0x3c, 0xde, 0x85, 0x65, 0x71, 0x6c, 0x1d, 0xc2, 0x89, 0x8c, 0x49, 0xe5, 0xfa, - 0x97, 0x1a, 0x49, 0x4a, 0x99, 0xe8, 0x27, 0x79, 0x24, 0xac, 0x1b, 0xbd, 0x6b, 0x8d, 0xad, 0x9d, - 0xfb, 0xb4, 0xcd, 0x37, 0x29, 0x27, 0x4d, 0xa4, 0xe9, 0xc1, 0x44, 0x86, 0x8d, 0x57, 0xf4, 0x3d, - 0x38, 0xc1, 0x02, 0xda, 0x96, 0xf1, 0xac, 0x5c, 0x7f, 0xa3, 0xf1, 0x89, 0x12, 0xb6, 0x71, 0xd2, - 0x46, 0x5a, 0x01, 0x6d, 0x27, 0x87, 0x25, 0xbe, 0xb0, 0x84, 0x45, 0xef, 0x01, 0x38, 0xc9, 0x38, - 0xe1, 0x11, 0x93, 0xa7, 0x55, 0xb9, 0xfe, 0xd6, 0xb8, 0x18, 0x48, 0x90, 0x24, 0x19, 0xd4, 0x37, - 0xd6, 0xe0, 0xf5, 0xff, 0x14, 0xe0, 0xe5, 0x93, 0x96, 0xae, 0xfb, 0x5e, 0x47, 0x1d, 0xc7, 0x4d, - 0x9d, 0x7c, 0x2a, 0x3d, 0x5f, 0x4e, 0x27, 0xdf, 0x51, 0xbf, 0xf6, 0xfc, 0x53, 0x1d, 0xa4, 0xb2, - 0xf4, 0xab, 0x66, 0xdf, 0x2a, 0x93, 0x2f, 0x67, 0x89, 0x1d, 0xf5, 0x6b, 0x73, 0x66, 0x59, 0x96, - 0x2b, 0xea, 0x41, 0xe4, 0x10, 0xc6, 0xef, 0x84, 0xc4, 0x63, 0xca, 0xad, 0xed, 0x52, 0x1d, 0xbe, - 0x2f, 0x9c, 0x2e, 0x3d, 0xc4, 0x8a, 0xe6, 0x92, 0x86, 0x44, 0xb7, 0x86, 0xbc, 0xe1, 0x63, 0x10, - 0xc4, 0xc5, 0x0a, 0x29, 0x61, 0xe6, 0xae, 0x98, 0x58, 0x62, 0x29, 0xc5, 0x5a, 0x8b, 0x3e, 0x0f, - 0xa7, 0x5c, 0xca, 0x18, 0xe9, 0x52, 0x79, 0x41, 0xa6, 0x9b, 0x73, 0xda, 0x70, 0x6a, 0x53, 0x89, - 0x71, 0xac, 0xaf, 0x1f, 0x01, 0x78, 0xf1, 0xa4, 0xa8, 0xdd, 0xb2, 0x19, 0x47, 0x6f, 0x0e, 0x5d, - 0x80, 0xc6, 0xe9, 0x76, 0x28, 0x56, 0xcb, 0xf4, 0x37, 0xb7, 0x33, 0x96, 0xa4, 0x92, 0xff, 0xbb, - 0xb0, 0x64, 0x73, 0xea, 0x8a, 0x33, 0x28, 0xae, 0x54, 0xae, 0x7f, 0x6b, 0x4c, 0xb9, 0xd7, 0x9c, - 0xd5, 0x1c, 0x4a, 0x37, 0x05, 0x1a, 0x56, 0xa0, 0xf5, 0x3f, 0x16, 0xe0, 0xa5, 0x93, 0x96, 0x88, - 0x8a, 0xc7, 0x44, 0xc4, 0x03, 0x27, 0x0a, 0x89, 0xa3, 0x33, 0xce, 0x44, 0x7c, 0x5b, 0x4a, 0xb1, - 0xd6, 0x8a, 0x9a, 0xc4, 0x6c, 0xaf, 0x1b, 0x39, 0x24, 0xd4, 0xe9, 0x64, 0x76, 0xdd, 0xd2, 0x72, - 0x6c, 0x2c, 0x50, 0x03, 0x42, 0xb6, 0xe7, 0x87, 0x5c, 0x62, 0x58, 0xc5, 0xe5, 0xa2, 0xf0, 0x2c, - 0x0a, 0x44, 0xcb, 0x48, 0x71, 0xca, 0x42, 0x94, 0xdc, 0x7d, 0xdb, 0xeb, 0xe8, 0x53, 0x37, 0xb7, - 0xf8, 0x9b, 0xb6, 0xd7, 0xc1, 0x52, 0x23, 0xf0, 0x1d, 0x9b, 0x71, 0x21, 0xd1, 0x47, 0x9e, 0x89, - 0xba, 0xb4, 0x34, 0x16, 0x02, 0xbf, 0x4d, 0x38, 0xed, 0xfa, 0xa1, 0x4d, 0x99, 0x35, 0x99, 0xe0, - 0xaf, 0x1b, 0x29, 0x4e, 0x59, 0xd4, 0x7f, 0x35, 0x75, 0x72, 0x92, 0x88, 0x52, 0x82, 0xae, 0xc0, - 0x52, 0x37, 0xf4, 0xa3, 0x40, 0x47, 0xc9, 0x44, 0xfb, 0x1b, 0x42, 0x88, 0x95, 0x4e, 0x64, 0x65, - 0x8f, 0x86, 0xe2, 0xc0, 0x74, 0x88, 0x4c, 0x56, 0xde, 0x53, 0x62, 0x1c, 0xeb, 0xd1, 0x0f, 0x01, - 0x2c, 0x79, 0x3a, 0x38, 0x22, 0xe5, 0xde, 0x1c, 0x53, 0x5e, 0xc8, 0xf0, 0x26, 0x74, 0x55, 0xe4, - 0x15, 0x32, 0x7a, 0x09, 0x96, 0x58, 0xdb, 0x0f, 0xa8, 0x8e, 0x7a, 0x35, 0x36, 0x6a, 0x09, 0xe1, - 0x51, 0xbf, 0x36, 0x1b, 0xbb, 0x93, 0x02, 0xac, 0x8c, 0xd1, 0x4f, 0x00, 0x84, 0x3d, 0xe2, 0xd8, - 0x1d, 0x22, 0xdf, 0xb4, 0x92, 0xa4, 0x3f, 0xda, 0xb4, 0xbe, 0x67, 0xdc, 0xab, 0x43, 0x4b, 0xbe, - 0x71, 0x0a, 0x1a, 0xbd, 0x0f, 0xe0, 0x0c, 0x8b, 0x76, 0x42, 0xbd, 0x8a, 0xc9, 0xd7, 0xaf, 0x72, - 0xfd, 0xdb, 0x23, 0xe5, 0xd2, 0x4a, 0x01, 0x34, 0xe7, 0x07, 0xfd, 0xda, 0x4c, 0x5a, 0x82, 0x33, - 0x04, 0xd0, 0xcf, 0x00, 0x2c, 0xeb, 0x13, 0x66, 0xd6, 0x94, 0xbc, 0xf0, 0x6f, 0x8f, 0xe9, 0x60, - 0x75, 0x46, 0x25, 0xb7, 0x40, 0x0b, 0x18, 0x36, 0x0c, 0xd0, 0x3f, 0x00, 0xb4, 0x48, 0x47, 0x15, - 0x78, 0xe2, 0x6c, 0x87, 0xb6, 0xc7, 0x69, 0xa8, 0x1a, 0x22, 0x66, 0x95, 0x25, 0xbd, 0xd1, 0xbe, - 0x85, 0xf9, 0x66, 0xab, 0xb9, 0xac, 0xd9, 0x59, 0x6b, 0x27, 0xd0, 0xc0, 0x27, 0x12, 0xac, 0xbf, - 0x5f, 0xcc, 0xf7, 0x72, 0xf9, 0xa7, 0x16, 0x3d, 0x02, 0x10, 0xb6, 0xe3, 0x27, 0x8c, 0x59, 0x40, - 0x6e, 0xe9, 0xdd, 0x31, 0x45, 0xdc, 0xbc, 0x95, 0x49, 0xbb, 0x63, 0x44, 0xa2, 0x9a, 0x98, 0xdf, - 0xe8, 0xb7, 0x00, 0xce, 0x92, 0x76, 0x9b, 0x06, 0x9c, 0x76, 0x54, 0x05, 0x2c, 0x7c, 0x0a, 0x97, - 0x7c, 0x51, 0xb3, 0x9a, 0x5d, 0x4b, 0x43, 0xe3, 0x2c, 0x13, 0xf4, 0x1a, 0x3c, 0xcb, 0xb8, 0x1f, - 0xd2, 0x4e, 0x9c, 0x2f, 0xba, 0x3a, 0xa3, 0x41, 0xbf, 0x76, 0xb6, 0x95, 0xd1, 0xe0, 0x9c, 0x65, - 0xfd, 0x37, 0x00, 0xd6, 0x9e, 0x92, 0x8f, 0xa7, 0x68, 0xaf, 0x5f, 0x80, 0x93, 0x72, 0xbb, 0x1d, - 0x19, 0x95, 0x72, 0xaa, 0x5f, 0x92, 0x52, 0xac, 0xb5, 0xa2, 0x9a, 0x0a, 0x7c, 0xf1, 0xc6, 0x17, - 0xa5, 0xa1, 0xa9, 0xa6, 0x2d, 0x25, 0xc6, 0xb1, 0xbe, 0xfe, 0x5f, 0x90, 0x4f, 0x95, 0xd4, 0x25, - 0x6d, 0xb5, 0x89, 0x43, 0xd1, 0x06, 0x9c, 0x17, 0xdd, 0x20, 0xa6, 0x81, 0x63, 0xb7, 0x09, 0x93, - 0xdd, 0xb2, 0xe2, 0x68, 0x69, 0xb7, 0xf3, 0xad, 0x9c, 0x1e, 0x0f, 0xad, 0x40, 0xaf, 0x43, 0xa4, - 0x3a, 0xa4, 0x8c, 0x1f, 0x55, 0xec, 0x4d, 0xaf, 0xd3, 0x1a, 0xb2, 0xc0, 0xc7, 0xac, 0x42, 0xeb, - 0x70, 0xc1, 0x21, 0x3b, 0xd4, 0x69, 0x51, 0x87, 0xb6, 0xb9, 0x1f, 0x4a, 0x57, 0x6a, 0x9e, 0x58, - 0x1c, 0xf4, 0x6b, 0x0b, 0xb7, 0xf2, 0x4a, 0x3c, 0x6c, 0x5f, 0xbf, 0x9c, 0x3f, 0x91, 0xf4, 0xc6, - 0x55, 0xdf, 0xf9, 0xfb, 0x02, 0x5c, 0x3a, 0xb9, 0xa6, 0xa1, 0x1f, 0x25, 0xed, 0xb1, 0xea, 0x7e, - 0xde, 0x1e, 0x57, 0xfd, 0xd4, 0xfd, 0x31, 0x1c, 0xee, 0x8d, 0xd1, 0xf7, 0xc5, 0x53, 0x44, 0x1c, - 0xaa, 0x2f, 0xca, 0x5b, 0x63, 0xa3, 0x20, 0x40, 0x9a, 0xd3, 0xea, 0x95, 0x23, 0x8e, 0x7c, 0xd4, - 0x88, 0x43, 0xeb, 0x7f, 0x02, 0xf9, 0x09, 0x29, 0x79, 0x73, 0xd0, 0xcf, 0x01, 0x9c, 0xf3, 0x03, - 0xea, 0xad, 0x6d, 0xdf, 0xbc, 0xf7, 0xe5, 0x96, 0x1c, 0x3c, 0x75, 0xa8, 0x6e, 0x7f, 0x42, 0x9e, - 0x62, 0x6e, 0x53, 0x0e, 0xb7, 0x43, 0x3f, 0x60, 0xcd, 0xe7, 0x06, 0xfd, 0xda, 0xdc, 0x56, 0x16, - 0x0a, 0xe7, 0xb1, 0xeb, 0x2e, 0x5c, 0xbc, 0x71, 0xc0, 0x69, 0xe8, 0x11, 0x67, 0xc3, 0x6f, 0x47, - 0x2e, 0xf5, 0xb8, 0x22, 0x9a, 0x1b, 0x37, 0xc1, 0x29, 0xc7, 0xcd, 0x4b, 0xb0, 0x18, 0x85, 0x8e, - 0xce, 0xe2, 0x8a, 0x36, 0x2f, 0xde, 0xc5, 0xb7, 0xb0, 0x90, 0xd7, 0x2f, 0xc3, 0x09, 0xc1, 0x13, - 0x5d, 0x80, 0xc5, 0x90, 0x3c, 0x94, 0x5e, 0x67, 0x9a, 0x53, 0xc2, 0x04, 0x93, 0x87, 0x58, 0xc8, - 0xea, 0x7f, 0xbe, 0x08, 0xe7, 0x72, 0x7b, 0x41, 0x4b, 0xb0, 0x60, 0x77, 0x34, 0x07, 0xa8, 0x9d, - 0x16, 0x6e, 0x6e, 0xe0, 0x82, 0xdd, 0x41, 0xaf, 0xc0, 0x49, 0x35, 0xc0, 0x6b, 0xd0, 0x9a, 0x29, - 0x01, 0x52, 0x2a, 0x7a, 0x8f, 0xc4, 0x9d, 0x20, 0xa2, 0xcd, 0x25, 0x07, 0xba, 0xab, 0x6f, 0x89, - 0xe2, 0x40, 0x77, 0xb1, 0x90, 0xfd, 0xbf, 0xb3, 0x76, 0x3c, 0xec, 0x97, 0x4e, 0x31, 0xec, 0x4f, - 0x7e, 0xec, 0xb0, 0x7f, 0x05, 0x96, 0xb8, 0xcd, 0x1d, 0x6a, 0x4d, 0x65, 0x5b, 0xc4, 0x3b, 0x42, - 0x88, 0x95, 0x0e, 0xdd, 0x87, 0x53, 0x1d, 0xba, 0x4b, 0x22, 0x87, 0x5b, 0x65, 0x99, 0x42, 0xeb, - 0x23, 0x48, 0xa1, 0x66, 0x45, 0x54, 0xc5, 0x0d, 0xe5, 0x17, 0xc7, 0x00, 0xe8, 0x79, 0x38, 0xe5, - 0x92, 0x03, 0xdb, 0x8d, 0x5c, 0x6b, 0x7a, 0x19, 0xac, 0x00, 0x65, 0xb6, 0xa9, 0x44, 0x38, 0xd6, - 0x89, 0xca, 0x48, 0x0f, 0xda, 0x4e, 0xc4, 0xec, 0x1e, 0xd5, 0x4a, 0x0b, 0xca, 0x82, 0x6b, 0x2a, - 0xe3, 0x8d, 0x9c, 0x1e, 0x0f, 0xad, 0x90, 0x60, 0xb6, 0x27, 0x17, 0x57, 0x52, 0x60, 0x4a, 0x84, - 0x63, 0x5d, 0x16, 0x4c, 0xdb, 0xcf, 0x9c, 0x04, 0xa6, 0x17, 0x0f, 0xad, 0x40, 0x5f, 0x84, 0xd3, - 0x2e, 0x39, 0xb8, 0x45, 0xbd, 0x2e, 0xdf, 0xb3, 0x66, 0x97, 0xc1, 0x4a, 0xb1, 0x39, 0x3b, 0xe8, - 0xd7, 0xa6, 0x37, 0x63, 0x21, 0x4e, 0xf4, 0xd2, 0xd8, 0xf6, 0xb4, 0xf1, 0xd9, 0x94, 0x71, 0x2c, - 0xc4, 0x89, 0x5e, 0x3c, 0x3a, 0x01, 0xe1, 0xe2, 0x72, 0x59, 0x73, 0xd9, 0x16, 0x7e, 0x5b, 0x89, - 0x71, 0xac, 0x47, 0x2b, 0xb0, 0xec, 0x92, 0x03, 0x39, 0x6e, 0x59, 0xf3, 0xd2, 0xed, 0x8c, 0xe8, - 0xc3, 0x36, 0xb5, 0x0c, 0x1b, 0xad, 0xb4, 0xb4, 0x3d, 0x65, 0xb9, 0x90, 0xb2, 0xd4, 0x32, 0x6c, - 0xb4, 0x22, 0x89, 0x23, 0xcf, 0x7e, 0x10, 0x51, 0x65, 0x8c, 0x64, 0x64, 0x4c, 0x12, 0xdf, 0x4d, - 0x54, 0x38, 0x6d, 0x27, 0xc6, 0x1d, 0x37, 0x72, 0xb8, 0x1d, 0x38, 0x74, 0x6b, 0xd7, 0x7a, 0x4e, - 0xc6, 0x5f, 0x76, 0xce, 0x9b, 0x46, 0x8a, 0x53, 0x16, 0x88, 0xc2, 0x09, 0xea, 0x45, 0xae, 0x75, - 0x4e, 0x36, 0x4c, 0x23, 0x49, 0x41, 0x73, 0x73, 0x6e, 0x78, 0x91, 0x8b, 0xa5, 0x7b, 0xf4, 0x0a, - 0x9c, 0x75, 0xc9, 0x81, 0x28, 0x07, 0x34, 0xe4, 0x62, 0x10, 0x5b, 0x94, 0x9b, 0x5f, 0x10, 0x4d, - 0xca, 0x66, 0x5a, 0x81, 0xb3, 0x76, 0x72, 0xa1, 0xed, 0xa5, 0x16, 0x9e, 0x4f, 0x2d, 0x4c, 0x2b, - 0x70, 0xd6, 0x4e, 0x44, 0x3a, 0xa4, 0x0f, 0x22, 0x3b, 0xa4, 0x1d, 0xeb, 0x33, 0xb2, 0xaf, 0x91, - 0x91, 0xc6, 0x5a, 0x86, 0x8d, 0x16, 0xf5, 0xe2, 0xb9, 0xdc, 0x92, 0xd7, 0xf0, 0xee, 0x68, 0x2b, - 0xf9, 0x56, 0xb8, 0x16, 0x86, 0xe4, 0x50, 0xbd, 0x34, 0xe9, 0x89, 0x1c, 0x31, 0x58, 0x22, 0x8e, - 0xb3, 0xb5, 0x6b, 0x5d, 0x90, 0xb1, 0x1f, 0xf5, 0x0b, 0x62, 0xaa, 0xce, 0x9a, 0x00, 0xc1, 0x0a, - 0x4b, 0x80, 0xfa, 0x9e, 0x48, 0x8d, 0xa5, 0xf1, 0x82, 0x6e, 0x09, 0x10, 0xac, 0xb0, 0xe4, 0x4e, - 0xbd, 0xc3, 0xad, 0x5d, 0xeb, 0xb3, 0x63, 0xde, 0xa9, 0x00, 0xc1, 0x0a, 0x0b, 0xd9, 0xb0, 0xe8, - 0xf9, 0xdc, 0xba, 0x38, 0x96, 0xe7, 0x59, 0x3e, 0x38, 0xb7, 0x7d, 0x8e, 0x05, 0x06, 0xfa, 0x35, - 0x80, 0x30, 0x48, 0x52, 0xf4, 0xd2, 0x48, 0xc6, 0xbd, 0x1c, 0x64, 0x23, 0xc9, 0xed, 0x1b, 0x1e, - 0x0f, 0x0f, 0x93, 0xd1, 0x23, 0x75, 0x07, 0x52, 0x2c, 0xd0, 0x1f, 0x00, 0x3c, 0x97, 0x9e, 0xa8, - 0x0c, 0xbd, 0xaa, 0x8c, 0xc8, 0x9d, 0x51, 0xa7, 0x79, 0xd3, 0xf7, 0x9d, 0xa6, 0x35, 0xe8, 0xd7, - 0xce, 0xad, 0x1d, 0x83, 0x8a, 0x8f, 0xe5, 0x82, 0xfe, 0x02, 0xe0, 0x82, 0xae, 0xa2, 0x29, 0x86, - 0x35, 0x19, 0x40, 0x3a, 0xea, 0x00, 0xe6, 0x71, 0x54, 0x1c, 0x2f, 0xe8, 0x38, 0x2e, 0x0c, 0xe9, - 0xf1, 0x30, 0x35, 0xf4, 0x77, 0x00, 0x67, 0x3a, 0x34, 0xa0, 0x5e, 0x87, 0x7a, 0x6d, 0xc1, 0x75, - 0x79, 0x24, 0x93, 0x66, 0x9e, 0xeb, 0x46, 0x0a, 0x42, 0xd1, 0x6c, 0x68, 0x9a, 0x33, 0x69, 0xd5, - 0x51, 0xbf, 0x76, 0x3e, 0x59, 0x9a, 0xd6, 0xe0, 0x0c, 0x4b, 0xf4, 0x01, 0x80, 0x73, 0xc9, 0x01, - 0xa8, 0x27, 0xe5, 0xf2, 0x18, 0xf3, 0x40, 0xb6, 0xaf, 0x6b, 0x59, 0x40, 0x9c, 0x67, 0x80, 0xfe, - 0x0a, 0x44, 0xa7, 0x16, 0xcf, 0x8d, 0xcc, 0xaa, 0xcb, 0x58, 0xbe, 0x33, 0xf2, 0x58, 0x1a, 0x04, - 0x15, 0xca, 0x17, 0x93, 0x56, 0xd0, 0x68, 0x8e, 0xfa, 0xb5, 0xc5, 0x74, 0x24, 0x8d, 0x02, 0xa7, - 0x19, 0xa2, 0x9f, 0x02, 0x38, 0x43, 0x93, 0x8e, 0x9b, 0x59, 0x57, 0x46, 0x12, 0xc4, 0x63, 0x9b, - 0x78, 0xf5, 0x37, 0xa6, 0x94, 0x8a, 0xe1, 0x0c, 0xb6, 0xe8, 0x20, 0xe9, 0x01, 0x71, 0x03, 0x87, - 0x5a, 0x9f, 0x1b, 0x71, 0x07, 0x79, 0x43, 0xf9, 0xc5, 0x31, 0xc0, 0x92, 0x98, 0x7c, 0x72, 0x37, - 0x07, 0xcd, 0xc3, 0xe2, 0x3e, 0x3d, 0x54, 0x8d, 0x3d, 0x16, 0x3f, 0x51, 0x07, 0x96, 0x7a, 0xc4, - 0x89, 0xe2, 0xe1, 0x6d, 0xc4, 0x55, 0x17, 0x2b, 0xe7, 0xaf, 0x15, 0x5e, 0x05, 0x4b, 0x8f, 0x00, - 0x3c, 0x7f, 0xfc, 0x85, 0x7e, 0xa6, 0xb4, 0x7e, 0x07, 0xe0, 0xc2, 0xd0, 0xdd, 0x3d, 0x86, 0xd1, - 0x83, 0x2c, 0xa3, 0x37, 0x46, 0x7d, 0x09, 0x5b, 0x3c, 0xb4, 0xbd, 0xae, 0xec, 0x3c, 0xd2, 0xf4, - 0x7e, 0x01, 0xe0, 0x7c, 0xfe, 0x3a, 0x3c, 0xcb, 0x78, 0xd5, 0x1f, 0x15, 0xe0, 0xf9, 0xe3, 0x1b, - 0x26, 0x14, 0x9a, 0xc9, 0x70, 0x3c, 0x13, 0x36, 0x4c, 0xa6, 0x4c, 0x33, 0x54, 0xbe, 0x07, 0x60, - 0xe5, 0xbe, 0xb1, 0x8b, 0xff, 0x53, 0x33, 0xf2, 0xd9, 0x3e, 0xae, 0x3f, 0x89, 0x82, 0xe1, 0x34, - 0x6e, 0xfd, 0x6f, 0x00, 0x2e, 0x1e, 0x5b, 0x58, 0xc5, 0x08, 0x4a, 0x1c, 0xc7, 0x7f, 0xa8, 0xfe, - 0x44, 0x93, 0xfa, 0x93, 0xd9, 0x9a, 0x94, 0x62, 0xad, 0x4d, 0x45, 0xaf, 0xf0, 0x69, 0x45, 0xaf, - 0xfe, 0x4f, 0x00, 0x2f, 0x7e, 0x5c, 0x26, 0x3e, 0x93, 0x23, 0x5d, 0x81, 0x65, 0xdd, 0x14, 0x1d, - 0xca, 0xe3, 0xd4, 0x73, 0x80, 0x2e, 0x1a, 0xf2, 0xbf, 0xe7, 0xea, 0x57, 0xf3, 0xea, 0xe3, 0x27, - 0xd5, 0x33, 0x1f, 0x3e, 0xa9, 0x9e, 0xf9, 0xe8, 0x49, 0xf5, 0xcc, 0x0f, 0x06, 0x55, 0xf0, 0x78, - 0x50, 0x05, 0x1f, 0x0e, 0xaa, 0xe0, 0xa3, 0x41, 0x15, 0xfc, 0x6b, 0x50, 0x05, 0xbf, 0xfc, 0x77, - 0xf5, 0xcc, 0x77, 0xa6, 0x34, 0xf8, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x5b, 0x62, 0x04, - 0xd6, 0x21, 0x00, 0x00, -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto deleted file mode 100644 index b23163d04..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto +++ /dev/null @@ -1,365 +0,0 @@ -/* -Copyright 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. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// CustomResourceColumnDefinition specifies a column for server side printing. -message CustomResourceColumnDefinition { - // name is a human readable name for the column. - optional string name = 1; - - // type is an OpenAPI type definition for this column. - // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more. - optional string type = 2; - - // format is an optional OpenAPI type definition for this column. The 'name' format is applied - // to the primary identifier column to assist in clients identifying column is the resource name. - // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more. - // +optional - optional string format = 3; - - // description is a human readable description of this column. - // +optional - optional string description = 4; - - // priority is an integer defining the relative importance of this column compared to others. Lower - // numbers are considered higher priority. Columns that may be omitted in limited space scenarios - // should be given a higher priority. - // +optional - optional int32 priority = 5; - - // JSONPath is a simple JSON path, i.e. with array notation. - optional string JSONPath = 6; -} - -// CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format -// <.spec.name>.<.spec.group>. -message CustomResourceDefinition { - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec describes how the user wants the resources to appear - optional CustomResourceDefinitionSpec spec = 2; - - // Status indicates the actual state of the CustomResourceDefinition - // +optional - optional CustomResourceDefinitionStatus status = 3; -} - -// CustomResourceDefinitionCondition contains details for the current condition of this pod. -message CustomResourceDefinitionCondition { - // Type is the type of the condition. - optional string type = 1; - - // Status is the status of the condition. - // Can be True, False, Unknown. - optional string status = 2; - - // Last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // Unique, one-word, CamelCase reason for the condition's last transition. - // +optional - optional string reason = 4; - - // Human-readable message indicating details about last transition. - // +optional - optional string message = 5; -} - -// CustomResourceDefinitionList is a list of CustomResourceDefinition objects. -message CustomResourceDefinitionList { - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items individual CustomResourceDefinitions - repeated CustomResourceDefinition items = 2; -} - -// CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition -message CustomResourceDefinitionNames { - // Plural is the plural name of the resource to serve. It must match the name of the CustomResourceDefinition-registration - // too: plural.group and it must be all lowercase. - optional string plural = 1; - - // Singular is the singular name of the resource. It must be all lowercase Defaults to lowercased - // +optional - optional string singular = 2; - - // ShortNames are short names for the resource. It must be all lowercase. - // +optional - repeated string shortNames = 3; - - // Kind is the serialized kind of the resource. It is normally CamelCase and singular. - optional string kind = 4; - - // ListKind is the serialized kind of the list for this resource. Defaults to List. - // +optional - optional string listKind = 5; - - // Categories is a list of grouped resources custom resources belong to (e.g. 'all') - // +optional - repeated string categories = 6; -} - -// CustomResourceDefinitionSpec describes how a user wants their resource to appear -message CustomResourceDefinitionSpec { - // Group is the group this resource belongs in - optional string group = 1; - - // Version is the version this resource belongs in - // Should be always first item in Versions field if provided. - // Optional, but at least one of Version or Versions must be set. - // Deprecated: Please use `Versions`. - // +optional - optional string version = 2; - - // Names are the names used to describe this custom resource - optional CustomResourceDefinitionNames names = 3; - - // Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced - optional string scope = 4; - - // Validation describes the validation methods for CustomResources - // +optional - optional CustomResourceValidation validation = 5; - - // Subresources describes the subresources for CustomResources - // +optional - optional CustomResourceSubresources subresources = 6; - - // Versions is the list of all supported versions for this resource. - // If Version field is provided, this field is optional. - // Validation: All versions must use the same validation schema for now. i.e., top - // level Validation field is applied to all of these versions. - // Order: The version name will be used to compute the order. - // If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered - // lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version), - // then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first - // by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing - // major version, then minor version. An example sorted list of versions: - // v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. - // +optional - repeated CustomResourceDefinitionVersion versions = 7; - - // AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column. - // +optional - repeated CustomResourceColumnDefinition additionalPrinterColumns = 8; -} - -// CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition -message CustomResourceDefinitionStatus { - // Conditions indicate state for particular aspects of a CustomResourceDefinition - repeated CustomResourceDefinitionCondition conditions = 1; - - // AcceptedNames are the names that are actually being used to serve discovery - // They may be different than the names in spec. - optional CustomResourceDefinitionNames acceptedNames = 2; - - // StoredVersions are all versions of CustomResources that were ever persisted. Tracking these - // versions allows a migration path for stored versions in etcd. The field is mutable - // so the migration controller can first finish a migration to another version (i.e. - // that no old objects are left in the storage), and then remove the rest of the - // versions from this list. - // None of the versions in this list can be removed from the spec.Versions field. - repeated string storedVersions = 3; -} - -message CustomResourceDefinitionVersion { - // Name is the version name, e.g. “v1”, “v2beta1”, etc. - optional string name = 1; - - // Served is a flag enabling/disabling this version from being served via REST APIs - optional bool served = 2; - - // Storage flags the version as storage version. There must be exactly one - // flagged as storage version. - optional bool storage = 3; -} - -// CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources. -message CustomResourceSubresourceScale { - // SpecReplicasPath defines the JSON path inside of a CustomResource that corresponds to Scale.Spec.Replicas. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under .spec. - // If there is no value under the given path in the CustomResource, the /scale subresource will return an error on GET. - optional string specReplicasPath = 1; - - // StatusReplicasPath defines the JSON path inside of a CustomResource that corresponds to Scale.Status.Replicas. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under .status. - // If there is no value under the given path in the CustomResource, the status replica value in the /scale subresource - // will default to 0. - optional string statusReplicasPath = 2; - - // LabelSelectorPath defines the JSON path inside of a CustomResource that corresponds to Scale.Status.Selector. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under .status. - // Must be set to work with HPA. - // If there is no value under the given path in the CustomResource, the status label selector value in the /scale - // subresource will default to the empty string. - // +optional - optional string labelSelectorPath = 3; -} - -// CustomResourceSubresourceStatus defines how to serve the status subresource for CustomResources. -// Status is represented by the `.status` JSON path inside of a CustomResource. When set, -// * exposes a /status subresource for the custom resource -// * PUT requests to the /status subresource take a custom resource object, and ignore changes to anything except the status stanza -// * PUT/POST/PATCH requests to the custom resource ignore changes to the status stanza -message CustomResourceSubresourceStatus { -} - -// CustomResourceSubresources defines the status and scale subresources for CustomResources. -message CustomResourceSubresources { - // Status denotes the status subresource for CustomResources - // +optional - optional CustomResourceSubresourceStatus status = 1; - - // Scale denotes the scale subresource for CustomResources - // +optional - optional CustomResourceSubresourceScale scale = 2; -} - -// CustomResourceValidation is a list of validation methods for CustomResources. -message CustomResourceValidation { - // OpenAPIV3Schema is the OpenAPI v3 schema to be validated against. - // +optional - optional JSONSchemaProps openAPIV3Schema = 1; -} - -// ExternalDocumentation allows referencing an external resource for extended documentation. -message ExternalDocumentation { - optional string description = 1; - - optional string url = 2; -} - -// JSON represents any valid JSON value. -// These types are supported: bool, int64, float64, string, []interface{}, map[string]interface{} and nil. -message JSON { - optional bytes raw = 1; -} - -// JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/). -message JSONSchemaProps { - optional string id = 1; - - optional string schema = 2; - - optional string ref = 3; - - optional string description = 4; - - optional string type = 5; - - optional string format = 6; - - optional string title = 7; - - optional JSON default = 8; - - optional double maximum = 9; - - optional bool exclusiveMaximum = 10; - - optional double minimum = 11; - - optional bool exclusiveMinimum = 12; - - optional int64 maxLength = 13; - - optional int64 minLength = 14; - - optional string pattern = 15; - - optional int64 maxItems = 16; - - optional int64 minItems = 17; - - optional bool uniqueItems = 18; - - optional double multipleOf = 19; - - repeated JSON enum = 20; - - optional int64 maxProperties = 21; - - optional int64 minProperties = 22; - - repeated string required = 23; - - optional JSONSchemaPropsOrArray items = 24; - - repeated JSONSchemaProps allOf = 25; - - repeated JSONSchemaProps oneOf = 26; - - repeated JSONSchemaProps anyOf = 27; - - optional JSONSchemaProps not = 28; - - map properties = 29; - - optional JSONSchemaPropsOrBool additionalProperties = 30; - - map patternProperties = 31; - - map dependencies = 32; - - optional JSONSchemaPropsOrBool additionalItems = 33; - - map definitions = 34; - - optional ExternalDocumentation externalDocs = 35; - - optional JSON example = 36; -} - -// JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps -// or an array of JSONSchemaProps. Mainly here for serialization purposes. -message JSONSchemaPropsOrArray { - optional JSONSchemaProps schema = 1; - - repeated JSONSchemaProps jSONSchemas = 2; -} - -// JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value. -// Defaults to true for the boolean property. -message JSONSchemaPropsOrBool { - optional bool allows = 1; - - optional JSONSchemaProps schema = 2; -} - -// JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array. -message JSONSchemaPropsOrStringArray { - optional JSONSchemaProps schema = 1; - - repeated string property = 2; -} - diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/marshal.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/marshal.go deleted file mode 100644 index 9a8fad3b7..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/marshal.go +++ /dev/null @@ -1,135 +0,0 @@ -/* -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 v1beta1 - -import ( - "errors" - - "k8s.io/apimachinery/pkg/util/json" -) - -var jsTrue = []byte("true") -var jsFalse = []byte("false") - -func (s JSONSchemaPropsOrBool) MarshalJSON() ([]byte, error) { - if s.Schema != nil { - return json.Marshal(s.Schema) - } - - if s.Schema == nil && !s.Allows { - return jsFalse, nil - } - return jsTrue, nil -} - -func (s *JSONSchemaPropsOrBool) UnmarshalJSON(data []byte) error { - var nw JSONSchemaPropsOrBool - switch { - case len(data) == 0: - case data[0] == '{': - var sch JSONSchemaProps - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Allows = true - nw.Schema = &sch - case len(data) == 4 && string(data) == "true": - nw.Allows = true - case len(data) == 5 && string(data) == "false": - nw.Allows = false - default: - return errors.New("boolean or JSON schema expected") - } - *s = nw - return nil -} - -func (s JSONSchemaPropsOrStringArray) MarshalJSON() ([]byte, error) { - if len(s.Property) > 0 { - return json.Marshal(s.Property) - } - if s.Schema != nil { - return json.Marshal(s.Schema) - } - return []byte("null"), nil -} - -func (s *JSONSchemaPropsOrStringArray) UnmarshalJSON(data []byte) error { - var first byte - if len(data) > 1 { - first = data[0] - } - var nw JSONSchemaPropsOrStringArray - if first == '{' { - var sch JSONSchemaProps - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - if first == '[' { - if err := json.Unmarshal(data, &nw.Property); err != nil { - return err - } - } - *s = nw - return nil -} - -func (s JSONSchemaPropsOrArray) MarshalJSON() ([]byte, error) { - if len(s.JSONSchemas) > 0 { - return json.Marshal(s.JSONSchemas) - } - return json.Marshal(s.Schema) -} - -func (s *JSONSchemaPropsOrArray) UnmarshalJSON(data []byte) error { - var nw JSONSchemaPropsOrArray - var first byte - if len(data) > 1 { - first = data[0] - } - if first == '{' { - var sch JSONSchemaProps - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - if first == '[' { - if err := json.Unmarshal(data, &nw.JSONSchemas); err != nil { - return err - } - } - *s = nw - return nil -} - -func (s JSON) MarshalJSON() ([]byte, error) { - if len(s.Raw) > 0 { - return s.Raw, nil - } - return []byte("null"), nil - -} - -func (s *JSON) UnmarshalJSON(data []byte) error { - if len(data) > 0 && string(data) != "null" { - s.Raw = data - } - return nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/marshal_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/marshal_test.go deleted file mode 100644 index 99065ff95..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/marshal_test.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -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 v1beta1 - -import ( - "encoding/json" - "reflect" - "testing" -) - -type JSONSchemaPropsOrBoolHolder struct { - JSPoB JSONSchemaPropsOrBool `json:"val1"` - JSPoBOmitEmpty *JSONSchemaPropsOrBool `json:"val2,omitempty"` -} - -func TestJSONSchemaPropsOrBoolUnmarshalJSON(t *testing.T) { - cases := []struct { - input string - result JSONSchemaPropsOrBoolHolder - }{ - {`{}`, JSONSchemaPropsOrBoolHolder{}}, - - {`{"val1": {}}`, JSONSchemaPropsOrBoolHolder{JSPoB: JSONSchemaPropsOrBool{Allows: true, Schema: &JSONSchemaProps{}}}}, - {`{"val1": {"type":"string"}}`, JSONSchemaPropsOrBoolHolder{JSPoB: JSONSchemaPropsOrBool{Allows: true, Schema: &JSONSchemaProps{Type: "string"}}}}, - {`{"val1": false}`, JSONSchemaPropsOrBoolHolder{JSPoB: JSONSchemaPropsOrBool{}}}, - {`{"val1": true}`, JSONSchemaPropsOrBoolHolder{JSPoB: JSONSchemaPropsOrBool{Allows: true}}}, - - {`{"val2": {}}`, JSONSchemaPropsOrBoolHolder{JSPoBOmitEmpty: &JSONSchemaPropsOrBool{Allows: true, Schema: &JSONSchemaProps{}}}}, - {`{"val2": {"type":"string"}}`, JSONSchemaPropsOrBoolHolder{JSPoBOmitEmpty: &JSONSchemaPropsOrBool{Allows: true, Schema: &JSONSchemaProps{Type: "string"}}}}, - {`{"val2": false}`, JSONSchemaPropsOrBoolHolder{JSPoBOmitEmpty: &JSONSchemaPropsOrBool{}}}, - {`{"val2": true}`, JSONSchemaPropsOrBoolHolder{JSPoBOmitEmpty: &JSONSchemaPropsOrBool{Allows: true}}}, - } - - for _, c := range cases { - var result JSONSchemaPropsOrBoolHolder - if err := json.Unmarshal([]byte(c.input), &result); err != nil { - t.Errorf("Failed to unmarshal input '%v': %v", c.input, err) - } - if !reflect.DeepEqual(result, c.result) { - t.Errorf("Failed to unmarshal input '%v': expected %+v, got %+v", c.input, c.result, result) - } - } -} - -func TestStringArrayOrStringMarshalJSON(t *testing.T) { - cases := []struct { - input JSONSchemaPropsOrBoolHolder - result string - }{ - {JSONSchemaPropsOrBoolHolder{}, `{"val1":false}`}, - - {JSONSchemaPropsOrBoolHolder{JSPoB: JSONSchemaPropsOrBool{Schema: &JSONSchemaProps{}}}, `{"val1":{}}`}, - {JSONSchemaPropsOrBoolHolder{JSPoB: JSONSchemaPropsOrBool{Schema: &JSONSchemaProps{Type: "string"}}}, `{"val1":{"type":"string"}}`}, - {JSONSchemaPropsOrBoolHolder{JSPoB: JSONSchemaPropsOrBool{}}, `{"val1":false}`}, - {JSONSchemaPropsOrBoolHolder{JSPoB: JSONSchemaPropsOrBool{Allows: true}}, `{"val1":true}`}, - - {JSONSchemaPropsOrBoolHolder{JSPoBOmitEmpty: &JSONSchemaPropsOrBool{Schema: &JSONSchemaProps{}}}, `{"val1":false,"val2":{}}`}, - {JSONSchemaPropsOrBoolHolder{JSPoBOmitEmpty: &JSONSchemaPropsOrBool{Schema: &JSONSchemaProps{Type: "string"}}}, `{"val1":false,"val2":{"type":"string"}}`}, - {JSONSchemaPropsOrBoolHolder{JSPoBOmitEmpty: &JSONSchemaPropsOrBool{}}, `{"val1":false,"val2":false}`}, - {JSONSchemaPropsOrBoolHolder{JSPoBOmitEmpty: &JSONSchemaPropsOrBool{Allows: true}}, `{"val1":false,"val2":true}`}, - } - - for _, c := range cases { - result, err := json.Marshal(&c.input) - if err != nil { - t.Errorf("Unexpected error marshaling input '%v': %v", c.input, err) - } - if string(result) != c.result { - t.Errorf("Failed to marshal input '%v': expected: %q, got %q", c.input, c.result, string(result)) - } - } -} - -type JSONSchemaPropsOrArrayHolder struct { - JSPoA JSONSchemaPropsOrArray `json:"val1"` - JSPoAOmitEmpty *JSONSchemaPropsOrArray `json:"val2,omitempty"` -} - -func TestJSONSchemaPropsOrArrayUnmarshalJSON(t *testing.T) { - cases := []struct { - input string - result JSONSchemaPropsOrArrayHolder - }{ - {`{}`, JSONSchemaPropsOrArrayHolder{}}, - - {`{"val1": {}}`, JSONSchemaPropsOrArrayHolder{JSPoA: JSONSchemaPropsOrArray{Schema: &JSONSchemaProps{}}}}, - {`{"val1": {"type":"string"}}`, JSONSchemaPropsOrArrayHolder{JSPoA: JSONSchemaPropsOrArray{Schema: &JSONSchemaProps{Type: "string"}}}}, - {`{"val1": [{}]}`, JSONSchemaPropsOrArrayHolder{JSPoA: JSONSchemaPropsOrArray{JSONSchemas: []JSONSchemaProps{{}}}}}, - {`{"val1": [{},{"type":"string"}]}`, JSONSchemaPropsOrArrayHolder{JSPoA: JSONSchemaPropsOrArray{JSONSchemas: []JSONSchemaProps{{}, {Type: "string"}}}}}, - - {`{"val2": {}}`, JSONSchemaPropsOrArrayHolder{JSPoAOmitEmpty: &JSONSchemaPropsOrArray{Schema: &JSONSchemaProps{}}}}, - {`{"val2": {"type":"string"}}`, JSONSchemaPropsOrArrayHolder{JSPoAOmitEmpty: &JSONSchemaPropsOrArray{Schema: &JSONSchemaProps{Type: "string"}}}}, - {`{"val2": [{}]}`, JSONSchemaPropsOrArrayHolder{JSPoAOmitEmpty: &JSONSchemaPropsOrArray{JSONSchemas: []JSONSchemaProps{{}}}}}, - {`{"val2": [{},{"type":"string"}]}`, JSONSchemaPropsOrArrayHolder{JSPoAOmitEmpty: &JSONSchemaPropsOrArray{JSONSchemas: []JSONSchemaProps{{}, {Type: "string"}}}}}, - } - - for _, c := range cases { - var result JSONSchemaPropsOrArrayHolder - if err := json.Unmarshal([]byte(c.input), &result); err != nil { - t.Errorf("Failed to unmarshal input '%v': %v", c.input, err) - } - if !reflect.DeepEqual(result, c.result) { - t.Errorf("Failed to unmarshal input '%v': expected %+v, got %+v", c.input, c.result, result) - } - } -} - -func TestJSONSchemaPropsOrArrayMarshalJSON(t *testing.T) { - cases := []struct { - input JSONSchemaPropsOrArrayHolder - result string - }{ - {JSONSchemaPropsOrArrayHolder{}, `{"val1":null}`}, - - {JSONSchemaPropsOrArrayHolder{JSPoA: JSONSchemaPropsOrArray{Schema: &JSONSchemaProps{}}}, `{"val1":{}}`}, - {JSONSchemaPropsOrArrayHolder{JSPoA: JSONSchemaPropsOrArray{Schema: &JSONSchemaProps{Type: "string"}}}, `{"val1":{"type":"string"}}`}, - {JSONSchemaPropsOrArrayHolder{JSPoA: JSONSchemaPropsOrArray{JSONSchemas: []JSONSchemaProps{{}}}}, `{"val1":[{}]}`}, - {JSONSchemaPropsOrArrayHolder{JSPoA: JSONSchemaPropsOrArray{JSONSchemas: []JSONSchemaProps{{}, {Type: "string"}}}}, `{"val1":[{},{"type":"string"}]}`}, - - {JSONSchemaPropsOrArrayHolder{JSPoAOmitEmpty: &JSONSchemaPropsOrArray{}}, `{"val1":null,"val2":null}`}, - {JSONSchemaPropsOrArrayHolder{JSPoAOmitEmpty: &JSONSchemaPropsOrArray{Schema: &JSONSchemaProps{}}}, `{"val1":null,"val2":{}}`}, - {JSONSchemaPropsOrArrayHolder{JSPoAOmitEmpty: &JSONSchemaPropsOrArray{Schema: &JSONSchemaProps{Type: "string"}}}, `{"val1":null,"val2":{"type":"string"}}`}, - {JSONSchemaPropsOrArrayHolder{JSPoAOmitEmpty: &JSONSchemaPropsOrArray{JSONSchemas: []JSONSchemaProps{{}}}}, `{"val1":null,"val2":[{}]}`}, - {JSONSchemaPropsOrArrayHolder{JSPoAOmitEmpty: &JSONSchemaPropsOrArray{JSONSchemas: []JSONSchemaProps{{}, {Type: "string"}}}}, `{"val1":null,"val2":[{},{"type":"string"}]}`}, - } - - for i, c := range cases { - result, err := json.Marshal(&c.input) - if err != nil { - t.Errorf("%d: Unexpected error marshaling input '%v': %v", i, c.input, err) - } - if string(result) != c.result { - t.Errorf("%d: Failed to marshal input '%v': expected: %q, got %q", i, c.input, c.result, string(result)) - } - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/register.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/register.go deleted file mode 100644 index 77f849975..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/register.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -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 v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const GroupName = "apiextensions.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns back a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs, addConversionFuncs) - localSchemeBuilder = &SchemeBuilder - AddToScheme = localSchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &CustomResourceDefinition{}, - &CustomResourceDefinitionList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} - -func init() { - // We only register manually written functions here. The registration of the - // generated functions takes place in the generated files. The separation - // makes the code compile even when the generated files are missing. - localSchemeBuilder.Register(addDefaultingFuncs, addConversionFuncs) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go deleted file mode 100644 index cab705d92..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go +++ /dev/null @@ -1,265 +0,0 @@ -/* -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 v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// CustomResourceDefinitionSpec describes how a user wants their resource to appear -type CustomResourceDefinitionSpec struct { - // Group is the group this resource belongs in - Group string `json:"group" protobuf:"bytes,1,opt,name=group"` - // Version is the version this resource belongs in - // Should be always first item in Versions field if provided. - // Optional, but at least one of Version or Versions must be set. - // Deprecated: Please use `Versions`. - // +optional - Version string `json:"version,omitempty" protobuf:"bytes,2,opt,name=version"` - // Names are the names used to describe this custom resource - Names CustomResourceDefinitionNames `json:"names" protobuf:"bytes,3,opt,name=names"` - // Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced - Scope ResourceScope `json:"scope" protobuf:"bytes,4,opt,name=scope,casttype=ResourceScope"` - // Validation describes the validation methods for CustomResources - // +optional - Validation *CustomResourceValidation `json:"validation,omitempty" protobuf:"bytes,5,opt,name=validation"` - // Subresources describes the subresources for CustomResources - // +optional - Subresources *CustomResourceSubresources `json:"subresources,omitempty" protobuf:"bytes,6,opt,name=subresources"` - // Versions is the list of all supported versions for this resource. - // If Version field is provided, this field is optional. - // Validation: All versions must use the same validation schema for now. i.e., top - // level Validation field is applied to all of these versions. - // Order: The version name will be used to compute the order. - // If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered - // lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version), - // then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first - // by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing - // major version, then minor version. An example sorted list of versions: - // v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. - // +optional - Versions []CustomResourceDefinitionVersion `json:"versions,omitempty" protobuf:"bytes,7,rep,name=versions"` - // AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column. - // +optional - AdditionalPrinterColumns []CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty" protobuf:"bytes,8,rep,name=additionalPrinterColumns"` -} - -type CustomResourceDefinitionVersion struct { - // Name is the version name, e.g. “v1”, “v2beta1”, etc. - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` - // Served is a flag enabling/disabling this version from being served via REST APIs - Served bool `json:"served" protobuf:"varint,2,opt,name=served"` - // Storage flags the version as storage version. There must be exactly one - // flagged as storage version. - Storage bool `json:"storage" protobuf:"varint,3,opt,name=storage"` -} - -// CustomResourceColumnDefinition specifies a column for server side printing. -type CustomResourceColumnDefinition struct { - // name is a human readable name for the column. - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` - // type is an OpenAPI type definition for this column. - // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more. - Type string `json:"type" protobuf:"bytes,2,opt,name=type"` - // format is an optional OpenAPI type definition for this column. The 'name' format is applied - // to the primary identifier column to assist in clients identifying column is the resource name. - // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more. - // +optional - Format string `json:"format,omitempty" protobuf:"bytes,3,opt,name=format"` - // description is a human readable description of this column. - // +optional - Description string `json:"description,omitempty" protobuf:"bytes,4,opt,name=description"` - // priority is an integer defining the relative importance of this column compared to others. Lower - // numbers are considered higher priority. Columns that may be omitted in limited space scenarios - // should be given a higher priority. - // +optional - Priority int32 `json:"priority,omitempty" protobuf:"bytes,5,opt,name=priority"` - - // JSONPath is a simple JSON path, i.e. with array notation. - JSONPath string `json:"JSONPath" protobuf:"bytes,6,opt,name=JSONPath"` -} - -// CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition -type CustomResourceDefinitionNames struct { - // Plural is the plural name of the resource to serve. It must match the name of the CustomResourceDefinition-registration - // too: plural.group and it must be all lowercase. - Plural string `json:"plural" protobuf:"bytes,1,opt,name=plural"` - // Singular is the singular name of the resource. It must be all lowercase Defaults to lowercased - // +optional - Singular string `json:"singular,omitempty" protobuf:"bytes,2,opt,name=singular"` - // ShortNames are short names for the resource. It must be all lowercase. - // +optional - ShortNames []string `json:"shortNames,omitempty" protobuf:"bytes,3,opt,name=shortNames"` - // Kind is the serialized kind of the resource. It is normally CamelCase and singular. - Kind string `json:"kind" protobuf:"bytes,4,opt,name=kind"` - // ListKind is the serialized kind of the list for this resource. Defaults to List. - // +optional - ListKind string `json:"listKind,omitempty" protobuf:"bytes,5,opt,name=listKind"` - // Categories is a list of grouped resources custom resources belong to (e.g. 'all') - // +optional - Categories []string `json:"categories,omitempty" protobuf:"bytes,6,rep,name=categories"` -} - -// ResourceScope is an enum defining the different scopes available to a custom resource -type ResourceScope string - -const ( - ClusterScoped ResourceScope = "Cluster" - NamespaceScoped ResourceScope = "Namespaced" -) - -type ConditionStatus string - -// These are valid condition statuses. "ConditionTrue" means a resource is in the condition. -// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes -// can't decide if a resource is in the condition or not. In the future, we could add other -// intermediate conditions, e.g. ConditionDegraded. -const ( - ConditionTrue ConditionStatus = "True" - ConditionFalse ConditionStatus = "False" - ConditionUnknown ConditionStatus = "Unknown" -) - -// CustomResourceDefinitionConditionType is a valid value for CustomResourceDefinitionCondition.Type -type CustomResourceDefinitionConditionType string - -const ( - // Established means that the resource has become active. A resource is established when all names are - // accepted without a conflict for the first time. A resource stays established until deleted, even during - // a later NamesAccepted due to changed names. Note that not all names can be changed. - Established CustomResourceDefinitionConditionType = "Established" - // NamesAccepted means the names chosen for this CustomResourceDefinition do not conflict with others in - // the group and are therefore accepted. - NamesAccepted CustomResourceDefinitionConditionType = "NamesAccepted" - // Terminating means that the CustomResourceDefinition has been deleted and is cleaning up. - Terminating CustomResourceDefinitionConditionType = "Terminating" -) - -// CustomResourceDefinitionCondition contains details for the current condition of this pod. -type CustomResourceDefinitionCondition struct { - // Type is the type of the condition. - Type CustomResourceDefinitionConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=CustomResourceDefinitionConditionType"` - // Status is the status of the condition. - // Can be True, False, Unknown. - Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` - // Last time the condition transitioned from one status to another. - // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` - // Unique, one-word, CamelCase reason for the condition's last transition. - // +optional - Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` - // Human-readable message indicating details about last transition. - // +optional - Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` -} - -// CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition -type CustomResourceDefinitionStatus struct { - // Conditions indicate state for particular aspects of a CustomResourceDefinition - Conditions []CustomResourceDefinitionCondition `json:"conditions" protobuf:"bytes,1,opt,name=conditions"` - - // AcceptedNames are the names that are actually being used to serve discovery - // They may be different than the names in spec. - AcceptedNames CustomResourceDefinitionNames `json:"acceptedNames" protobuf:"bytes,2,opt,name=acceptedNames"` - - // StoredVersions are all versions of CustomResources that were ever persisted. Tracking these - // versions allows a migration path for stored versions in etcd. The field is mutable - // so the migration controller can first finish a migration to another version (i.e. - // that no old objects are left in the storage), and then remove the rest of the - // versions from this list. - // None of the versions in this list can be removed from the spec.Versions field. - StoredVersions []string `json:"storedVersions" protobuf:"bytes,3,rep,name=storedVersions"` -} - -// CustomResourceCleanupFinalizer is the name of the finalizer which will delete instances of -// a CustomResourceDefinition -const CustomResourceCleanupFinalizer = "customresourcecleanup.apiextensions.k8s.io" - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format -// <.spec.name>.<.spec.group>. -type CustomResourceDefinition struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Spec describes how the user wants the resources to appear - Spec CustomResourceDefinitionSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - // Status indicates the actual state of the CustomResourceDefinition - // +optional - Status CustomResourceDefinitionStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CustomResourceDefinitionList is a list of CustomResourceDefinition objects. -type CustomResourceDefinitionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Items individual CustomResourceDefinitions - Items []CustomResourceDefinition `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// CustomResourceValidation is a list of validation methods for CustomResources. -type CustomResourceValidation struct { - // OpenAPIV3Schema is the OpenAPI v3 schema to be validated against. - // +optional - OpenAPIV3Schema *JSONSchemaProps `json:"openAPIV3Schema,omitempty" protobuf:"bytes,1,opt,name=openAPIV3Schema"` -} - -// CustomResourceSubresources defines the status and scale subresources for CustomResources. -type CustomResourceSubresources struct { - // Status denotes the status subresource for CustomResources - // +optional - Status *CustomResourceSubresourceStatus `json:"status,omitempty" protobuf:"bytes,1,opt,name=status"` - // Scale denotes the scale subresource for CustomResources - // +optional - Scale *CustomResourceSubresourceScale `json:"scale,omitempty" protobuf:"bytes,2,opt,name=scale"` -} - -// CustomResourceSubresourceStatus defines how to serve the status subresource for CustomResources. -// Status is represented by the `.status` JSON path inside of a CustomResource. When set, -// * exposes a /status subresource for the custom resource -// * PUT requests to the /status subresource take a custom resource object, and ignore changes to anything except the status stanza -// * PUT/POST/PATCH requests to the custom resource ignore changes to the status stanza -type CustomResourceSubresourceStatus struct{} - -// CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources. -type CustomResourceSubresourceScale struct { - // SpecReplicasPath defines the JSON path inside of a CustomResource that corresponds to Scale.Spec.Replicas. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under .spec. - // If there is no value under the given path in the CustomResource, the /scale subresource will return an error on GET. - SpecReplicasPath string `json:"specReplicasPath" protobuf:"bytes,1,name=specReplicasPath"` - // StatusReplicasPath defines the JSON path inside of a CustomResource that corresponds to Scale.Status.Replicas. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under .status. - // If there is no value under the given path in the CustomResource, the status replica value in the /scale subresource - // will default to 0. - StatusReplicasPath string `json:"statusReplicasPath" protobuf:"bytes,2,opt,name=statusReplicasPath"` - // LabelSelectorPath defines the JSON path inside of a CustomResource that corresponds to Scale.Status.Selector. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under .status. - // Must be set to work with HPA. - // If there is no value under the given path in the CustomResource, the status label selector value in the /scale - // subresource will default to the empty string. - // +optional - LabelSelectorPath *string `json:"labelSelectorPath,omitempty" protobuf:"bytes,3,opt,name=labelSelectorPath"` -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go deleted file mode 100644 index 9776731cf..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types_jsonschema.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -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 v1beta1 - -// JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/). -type JSONSchemaProps struct { - ID string `json:"id,omitempty" protobuf:"bytes,1,opt,name=id"` - Schema JSONSchemaURL `json:"$schema,omitempty" protobuf:"bytes,2,opt,name=schema"` - Ref *string `json:"$ref,omitempty" protobuf:"bytes,3,opt,name=ref"` - Description string `json:"description,omitempty" protobuf:"bytes,4,opt,name=description"` - Type string `json:"type,omitempty" protobuf:"bytes,5,opt,name=type"` - Format string `json:"format,omitempty" protobuf:"bytes,6,opt,name=format"` - Title string `json:"title,omitempty" protobuf:"bytes,7,opt,name=title"` - Default *JSON `json:"default,omitempty" protobuf:"bytes,8,opt,name=default"` - Maximum *float64 `json:"maximum,omitempty" protobuf:"bytes,9,opt,name=maximum"` - ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty" protobuf:"bytes,10,opt,name=exclusiveMaximum"` - Minimum *float64 `json:"minimum,omitempty" protobuf:"bytes,11,opt,name=minimum"` - ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty" protobuf:"bytes,12,opt,name=exclusiveMinimum"` - MaxLength *int64 `json:"maxLength,omitempty" protobuf:"bytes,13,opt,name=maxLength"` - MinLength *int64 `json:"minLength,omitempty" protobuf:"bytes,14,opt,name=minLength"` - Pattern string `json:"pattern,omitempty" protobuf:"bytes,15,opt,name=pattern"` - MaxItems *int64 `json:"maxItems,omitempty" protobuf:"bytes,16,opt,name=maxItems"` - MinItems *int64 `json:"minItems,omitempty" protobuf:"bytes,17,opt,name=minItems"` - UniqueItems bool `json:"uniqueItems,omitempty" protobuf:"bytes,18,opt,name=uniqueItems"` - MultipleOf *float64 `json:"multipleOf,omitempty" protobuf:"bytes,19,opt,name=multipleOf"` - Enum []JSON `json:"enum,omitempty" protobuf:"bytes,20,rep,name=enum"` - MaxProperties *int64 `json:"maxProperties,omitempty" protobuf:"bytes,21,opt,name=maxProperties"` - MinProperties *int64 `json:"minProperties,omitempty" protobuf:"bytes,22,opt,name=minProperties"` - Required []string `json:"required,omitempty" protobuf:"bytes,23,rep,name=required"` - Items *JSONSchemaPropsOrArray `json:"items,omitempty" protobuf:"bytes,24,opt,name=items"` - AllOf []JSONSchemaProps `json:"allOf,omitempty" protobuf:"bytes,25,rep,name=allOf"` - OneOf []JSONSchemaProps `json:"oneOf,omitempty" protobuf:"bytes,26,rep,name=oneOf"` - AnyOf []JSONSchemaProps `json:"anyOf,omitempty" protobuf:"bytes,27,rep,name=anyOf"` - Not *JSONSchemaProps `json:"not,omitempty" protobuf:"bytes,28,opt,name=not"` - Properties map[string]JSONSchemaProps `json:"properties,omitempty" protobuf:"bytes,29,rep,name=properties"` - AdditionalProperties *JSONSchemaPropsOrBool `json:"additionalProperties,omitempty" protobuf:"bytes,30,opt,name=additionalProperties"` - PatternProperties map[string]JSONSchemaProps `json:"patternProperties,omitempty" protobuf:"bytes,31,rep,name=patternProperties"` - Dependencies JSONSchemaDependencies `json:"dependencies,omitempty" protobuf:"bytes,32,opt,name=dependencies"` - AdditionalItems *JSONSchemaPropsOrBool `json:"additionalItems,omitempty" protobuf:"bytes,33,opt,name=additionalItems"` - Definitions JSONSchemaDefinitions `json:"definitions,omitempty" protobuf:"bytes,34,opt,name=definitions"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty" protobuf:"bytes,35,opt,name=externalDocs"` - Example *JSON `json:"example,omitempty" protobuf:"bytes,36,opt,name=example"` -} - -// JSON represents any valid JSON value. -// These types are supported: bool, int64, float64, string, []interface{}, map[string]interface{} and nil. -type JSON struct { - Raw []byte `protobuf:"bytes,1,opt,name=raw"` -} - -// OpenAPISchemaType is used by the kube-openapi generator when constructing -// the OpenAPI spec of this type. -// -// See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators -func (_ JSON) OpenAPISchemaType() []string { - // TODO: return actual types when anyOf is supported - return []string{} -} - -// OpenAPISchemaFormat is used by the kube-openapi generator when constructing -// the OpenAPI spec of this type. -func (_ JSON) OpenAPISchemaFormat() string { return "" } - -// JSONSchemaURL represents a schema url. -type JSONSchemaURL string - -// JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps -// or an array of JSONSchemaProps. Mainly here for serialization purposes. -type JSONSchemaPropsOrArray struct { - Schema *JSONSchemaProps `protobuf:"bytes,1,opt,name=schema"` - JSONSchemas []JSONSchemaProps `protobuf:"bytes,2,rep,name=jSONSchemas"` -} - -// OpenAPISchemaType is used by the kube-openapi generator when constructing -// the OpenAPI spec of this type. -// -// See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators -func (_ JSONSchemaPropsOrArray) OpenAPISchemaType() []string { - // TODO: return actual types when anyOf is supported - return []string{} -} - -// OpenAPISchemaFormat is used by the kube-openapi generator when constructing -// the OpenAPI spec of this type. -func (_ JSONSchemaPropsOrArray) OpenAPISchemaFormat() string { return "" } - -// JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value. -// Defaults to true for the boolean property. -type JSONSchemaPropsOrBool struct { - Allows bool `protobuf:"varint,1,opt,name=allows"` - Schema *JSONSchemaProps `protobuf:"bytes,2,opt,name=schema"` -} - -// OpenAPISchemaType is used by the kube-openapi generator when constructing -// the OpenAPI spec of this type. -// -// See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators -func (_ JSONSchemaPropsOrBool) OpenAPISchemaType() []string { - // TODO: return actual types when anyOf is supported - return []string{} -} - -// OpenAPISchemaFormat is used by the kube-openapi generator when constructing -// the OpenAPI spec of this type. -func (_ JSONSchemaPropsOrBool) OpenAPISchemaFormat() string { return "" } - -// JSONSchemaDependencies represent a dependencies property. -type JSONSchemaDependencies map[string]JSONSchemaPropsOrStringArray - -// JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array. -type JSONSchemaPropsOrStringArray struct { - Schema *JSONSchemaProps `protobuf:"bytes,1,opt,name=schema"` - Property []string `protobuf:"bytes,2,rep,name=property"` -} - -// OpenAPISchemaType is used by the kube-openapi generator when constructing -// the OpenAPI spec of this type. -// -// See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators -func (_ JSONSchemaPropsOrStringArray) OpenAPISchemaType() []string { - // TODO: return actual types when anyOf is supported - return []string{} -} - -// OpenAPISchemaFormat is used by the kube-openapi generator when constructing -// the OpenAPI spec of this type. -func (_ JSONSchemaPropsOrStringArray) OpenAPISchemaFormat() string { return "" } - -// JSONSchemaDefinitions contains the models explicitly defined in this spec. -type JSONSchemaDefinitions map[string]JSONSchemaProps - -// ExternalDocumentation allows referencing an external resource for extended documentation. -type ExternalDocumentation struct { - Description string `json:"description,omitempty" protobuf:"bytes,1,opt,name=description"` - URL string `json:"url,omitempty" protobuf:"bytes,2,opt,name=url"` -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go deleted file mode 100644 index 32fe1c8af..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,1125 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 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. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1beta1 - -import ( - unsafe "unsafe" - - apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*CustomResourceColumnDefinition)(nil), (*apiextensions.CustomResourceColumnDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceColumnDefinition_To_apiextensions_CustomResourceColumnDefinition(a.(*CustomResourceColumnDefinition), b.(*apiextensions.CustomResourceColumnDefinition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceColumnDefinition)(nil), (*CustomResourceColumnDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceColumnDefinition_To_v1beta1_CustomResourceColumnDefinition(a.(*apiextensions.CustomResourceColumnDefinition), b.(*CustomResourceColumnDefinition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CustomResourceDefinition)(nil), (*apiextensions.CustomResourceDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceDefinition_To_apiextensions_CustomResourceDefinition(a.(*CustomResourceDefinition), b.(*apiextensions.CustomResourceDefinition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceDefinition)(nil), (*CustomResourceDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceDefinition_To_v1beta1_CustomResourceDefinition(a.(*apiextensions.CustomResourceDefinition), b.(*CustomResourceDefinition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CustomResourceDefinitionCondition)(nil), (*apiextensions.CustomResourceDefinitionCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceDefinitionCondition_To_apiextensions_CustomResourceDefinitionCondition(a.(*CustomResourceDefinitionCondition), b.(*apiextensions.CustomResourceDefinitionCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceDefinitionCondition)(nil), (*CustomResourceDefinitionCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceDefinitionCondition_To_v1beta1_CustomResourceDefinitionCondition(a.(*apiextensions.CustomResourceDefinitionCondition), b.(*CustomResourceDefinitionCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CustomResourceDefinitionList)(nil), (*apiextensions.CustomResourceDefinitionList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceDefinitionList_To_apiextensions_CustomResourceDefinitionList(a.(*CustomResourceDefinitionList), b.(*apiextensions.CustomResourceDefinitionList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceDefinitionList)(nil), (*CustomResourceDefinitionList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceDefinitionList_To_v1beta1_CustomResourceDefinitionList(a.(*apiextensions.CustomResourceDefinitionList), b.(*CustomResourceDefinitionList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CustomResourceDefinitionNames)(nil), (*apiextensions.CustomResourceDefinitionNames)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDefinitionNames(a.(*CustomResourceDefinitionNames), b.(*apiextensions.CustomResourceDefinitionNames), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceDefinitionNames)(nil), (*CustomResourceDefinitionNames)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceDefinitionNames_To_v1beta1_CustomResourceDefinitionNames(a.(*apiextensions.CustomResourceDefinitionNames), b.(*CustomResourceDefinitionNames), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CustomResourceDefinitionSpec)(nil), (*apiextensions.CustomResourceDefinitionSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefinitionSpec(a.(*CustomResourceDefinitionSpec), b.(*apiextensions.CustomResourceDefinitionSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceDefinitionSpec)(nil), (*CustomResourceDefinitionSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceDefinitionSpec_To_v1beta1_CustomResourceDefinitionSpec(a.(*apiextensions.CustomResourceDefinitionSpec), b.(*CustomResourceDefinitionSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CustomResourceDefinitionStatus)(nil), (*apiextensions.CustomResourceDefinitionStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceDefinitionStatus_To_apiextensions_CustomResourceDefinitionStatus(a.(*CustomResourceDefinitionStatus), b.(*apiextensions.CustomResourceDefinitionStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceDefinitionStatus)(nil), (*CustomResourceDefinitionStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceDefinitionStatus_To_v1beta1_CustomResourceDefinitionStatus(a.(*apiextensions.CustomResourceDefinitionStatus), b.(*CustomResourceDefinitionStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CustomResourceDefinitionVersion)(nil), (*apiextensions.CustomResourceDefinitionVersion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceDefinitionVersion_To_apiextensions_CustomResourceDefinitionVersion(a.(*CustomResourceDefinitionVersion), b.(*apiextensions.CustomResourceDefinitionVersion), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceDefinitionVersion)(nil), (*CustomResourceDefinitionVersion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceDefinitionVersion_To_v1beta1_CustomResourceDefinitionVersion(a.(*apiextensions.CustomResourceDefinitionVersion), b.(*CustomResourceDefinitionVersion), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CustomResourceSubresourceScale)(nil), (*apiextensions.CustomResourceSubresourceScale)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceSubresourceScale_To_apiextensions_CustomResourceSubresourceScale(a.(*CustomResourceSubresourceScale), b.(*apiextensions.CustomResourceSubresourceScale), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceSubresourceScale)(nil), (*CustomResourceSubresourceScale)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceSubresourceScale_To_v1beta1_CustomResourceSubresourceScale(a.(*apiextensions.CustomResourceSubresourceScale), b.(*CustomResourceSubresourceScale), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CustomResourceSubresourceStatus)(nil), (*apiextensions.CustomResourceSubresourceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceSubresourceStatus_To_apiextensions_CustomResourceSubresourceStatus(a.(*CustomResourceSubresourceStatus), b.(*apiextensions.CustomResourceSubresourceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceSubresourceStatus)(nil), (*CustomResourceSubresourceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceSubresourceStatus_To_v1beta1_CustomResourceSubresourceStatus(a.(*apiextensions.CustomResourceSubresourceStatus), b.(*CustomResourceSubresourceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CustomResourceSubresources)(nil), (*apiextensions.CustomResourceSubresources)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceSubresources_To_apiextensions_CustomResourceSubresources(a.(*CustomResourceSubresources), b.(*apiextensions.CustomResourceSubresources), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceSubresources)(nil), (*CustomResourceSubresources)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceSubresources_To_v1beta1_CustomResourceSubresources(a.(*apiextensions.CustomResourceSubresources), b.(*CustomResourceSubresources), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CustomResourceValidation)(nil), (*apiextensions.CustomResourceValidation)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CustomResourceValidation_To_apiextensions_CustomResourceValidation(a.(*CustomResourceValidation), b.(*apiextensions.CustomResourceValidation), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.CustomResourceValidation)(nil), (*CustomResourceValidation)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_CustomResourceValidation_To_v1beta1_CustomResourceValidation(a.(*apiextensions.CustomResourceValidation), b.(*CustomResourceValidation), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ExternalDocumentation)(nil), (*apiextensions.ExternalDocumentation)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ExternalDocumentation_To_apiextensions_ExternalDocumentation(a.(*ExternalDocumentation), b.(*apiextensions.ExternalDocumentation), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.ExternalDocumentation)(nil), (*ExternalDocumentation)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_ExternalDocumentation_To_v1beta1_ExternalDocumentation(a.(*apiextensions.ExternalDocumentation), b.(*ExternalDocumentation), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*JSON)(nil), (*apiextensions.JSON)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JSON_To_apiextensions_JSON(a.(*JSON), b.(*apiextensions.JSON), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.JSON)(nil), (*JSON)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_JSON_To_v1beta1_JSON(a.(*apiextensions.JSON), b.(*JSON), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*JSONSchemaProps)(nil), (*apiextensions.JSONSchemaProps)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(a.(*JSONSchemaProps), b.(*apiextensions.JSONSchemaProps), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.JSONSchemaProps)(nil), (*JSONSchemaProps)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(a.(*apiextensions.JSONSchemaProps), b.(*JSONSchemaProps), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*JSONSchemaPropsOrArray)(nil), (*apiextensions.JSONSchemaPropsOrArray)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JSONSchemaPropsOrArray_To_apiextensions_JSONSchemaPropsOrArray(a.(*JSONSchemaPropsOrArray), b.(*apiextensions.JSONSchemaPropsOrArray), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.JSONSchemaPropsOrArray)(nil), (*JSONSchemaPropsOrArray)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_JSONSchemaPropsOrArray_To_v1beta1_JSONSchemaPropsOrArray(a.(*apiextensions.JSONSchemaPropsOrArray), b.(*JSONSchemaPropsOrArray), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*JSONSchemaPropsOrBool)(nil), (*apiextensions.JSONSchemaPropsOrBool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JSONSchemaPropsOrBool_To_apiextensions_JSONSchemaPropsOrBool(a.(*JSONSchemaPropsOrBool), b.(*apiextensions.JSONSchemaPropsOrBool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.JSONSchemaPropsOrBool)(nil), (*JSONSchemaPropsOrBool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_JSONSchemaPropsOrBool_To_v1beta1_JSONSchemaPropsOrBool(a.(*apiextensions.JSONSchemaPropsOrBool), b.(*JSONSchemaPropsOrBool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*JSONSchemaPropsOrStringArray)(nil), (*apiextensions.JSONSchemaPropsOrStringArray)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JSONSchemaPropsOrStringArray_To_apiextensions_JSONSchemaPropsOrStringArray(a.(*JSONSchemaPropsOrStringArray), b.(*apiextensions.JSONSchemaPropsOrStringArray), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*apiextensions.JSONSchemaPropsOrStringArray)(nil), (*JSONSchemaPropsOrStringArray)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_JSONSchemaPropsOrStringArray_To_v1beta1_JSONSchemaPropsOrStringArray(a.(*apiextensions.JSONSchemaPropsOrStringArray), b.(*JSONSchemaPropsOrStringArray), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*apiextensions.JSONSchemaProps)(nil), (*JSONSchemaProps)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(a.(*apiextensions.JSONSchemaProps), b.(*JSONSchemaProps), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*apiextensions.JSON)(nil), (*JSON)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_apiextensions_JSON_To_v1beta1_JSON(a.(*apiextensions.JSON), b.(*JSON), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*JSON)(nil), (*apiextensions.JSON)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JSON_To_apiextensions_JSON(a.(*JSON), b.(*apiextensions.JSON), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1beta1_CustomResourceColumnDefinition_To_apiextensions_CustomResourceColumnDefinition(in *CustomResourceColumnDefinition, out *apiextensions.CustomResourceColumnDefinition, s conversion.Scope) error { - out.Name = in.Name - out.Type = in.Type - out.Format = in.Format - out.Description = in.Description - out.Priority = in.Priority - out.JSONPath = in.JSONPath - return nil -} - -// Convert_v1beta1_CustomResourceColumnDefinition_To_apiextensions_CustomResourceColumnDefinition is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceColumnDefinition_To_apiextensions_CustomResourceColumnDefinition(in *CustomResourceColumnDefinition, out *apiextensions.CustomResourceColumnDefinition, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceColumnDefinition_To_apiextensions_CustomResourceColumnDefinition(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceColumnDefinition_To_v1beta1_CustomResourceColumnDefinition(in *apiextensions.CustomResourceColumnDefinition, out *CustomResourceColumnDefinition, s conversion.Scope) error { - out.Name = in.Name - out.Type = in.Type - out.Format = in.Format - out.Description = in.Description - out.Priority = in.Priority - out.JSONPath = in.JSONPath - return nil -} - -// Convert_apiextensions_CustomResourceColumnDefinition_To_v1beta1_CustomResourceColumnDefinition is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceColumnDefinition_To_v1beta1_CustomResourceColumnDefinition(in *apiextensions.CustomResourceColumnDefinition, out *CustomResourceColumnDefinition, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceColumnDefinition_To_v1beta1_CustomResourceColumnDefinition(in, out, s) -} - -func autoConvert_v1beta1_CustomResourceDefinition_To_apiextensions_CustomResourceDefinition(in *CustomResourceDefinition, out *apiextensions.CustomResourceDefinition, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefinitionSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_CustomResourceDefinitionStatus_To_apiextensions_CustomResourceDefinitionStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_CustomResourceDefinition_To_apiextensions_CustomResourceDefinition is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceDefinition_To_apiextensions_CustomResourceDefinition(in *CustomResourceDefinition, out *apiextensions.CustomResourceDefinition, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceDefinition_To_apiextensions_CustomResourceDefinition(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceDefinition_To_v1beta1_CustomResourceDefinition(in *apiextensions.CustomResourceDefinition, out *CustomResourceDefinition, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_apiextensions_CustomResourceDefinitionSpec_To_v1beta1_CustomResourceDefinitionSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_apiextensions_CustomResourceDefinitionStatus_To_v1beta1_CustomResourceDefinitionStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_apiextensions_CustomResourceDefinition_To_v1beta1_CustomResourceDefinition is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceDefinition_To_v1beta1_CustomResourceDefinition(in *apiextensions.CustomResourceDefinition, out *CustomResourceDefinition, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceDefinition_To_v1beta1_CustomResourceDefinition(in, out, s) -} - -func autoConvert_v1beta1_CustomResourceDefinitionCondition_To_apiextensions_CustomResourceDefinitionCondition(in *CustomResourceDefinitionCondition, out *apiextensions.CustomResourceDefinitionCondition, s conversion.Scope) error { - out.Type = apiextensions.CustomResourceDefinitionConditionType(in.Type) - out.Status = apiextensions.ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1beta1_CustomResourceDefinitionCondition_To_apiextensions_CustomResourceDefinitionCondition is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceDefinitionCondition_To_apiextensions_CustomResourceDefinitionCondition(in *CustomResourceDefinitionCondition, out *apiextensions.CustomResourceDefinitionCondition, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceDefinitionCondition_To_apiextensions_CustomResourceDefinitionCondition(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceDefinitionCondition_To_v1beta1_CustomResourceDefinitionCondition(in *apiextensions.CustomResourceDefinitionCondition, out *CustomResourceDefinitionCondition, s conversion.Scope) error { - out.Type = CustomResourceDefinitionConditionType(in.Type) - out.Status = ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_apiextensions_CustomResourceDefinitionCondition_To_v1beta1_CustomResourceDefinitionCondition is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceDefinitionCondition_To_v1beta1_CustomResourceDefinitionCondition(in *apiextensions.CustomResourceDefinitionCondition, out *CustomResourceDefinitionCondition, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceDefinitionCondition_To_v1beta1_CustomResourceDefinitionCondition(in, out, s) -} - -func autoConvert_v1beta1_CustomResourceDefinitionList_To_apiextensions_CustomResourceDefinitionList(in *CustomResourceDefinitionList, out *apiextensions.CustomResourceDefinitionList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]apiextensions.CustomResourceDefinition, len(*in)) - for i := range *in { - if err := Convert_v1beta1_CustomResourceDefinition_To_apiextensions_CustomResourceDefinition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_CustomResourceDefinitionList_To_apiextensions_CustomResourceDefinitionList is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceDefinitionList_To_apiextensions_CustomResourceDefinitionList(in *CustomResourceDefinitionList, out *apiextensions.CustomResourceDefinitionList, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceDefinitionList_To_apiextensions_CustomResourceDefinitionList(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceDefinitionList_To_v1beta1_CustomResourceDefinitionList(in *apiextensions.CustomResourceDefinitionList, out *CustomResourceDefinitionList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CustomResourceDefinition, len(*in)) - for i := range *in { - if err := Convert_apiextensions_CustomResourceDefinition_To_v1beta1_CustomResourceDefinition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_apiextensions_CustomResourceDefinitionList_To_v1beta1_CustomResourceDefinitionList is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceDefinitionList_To_v1beta1_CustomResourceDefinitionList(in *apiextensions.CustomResourceDefinitionList, out *CustomResourceDefinitionList, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceDefinitionList_To_v1beta1_CustomResourceDefinitionList(in, out, s) -} - -func autoConvert_v1beta1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDefinitionNames(in *CustomResourceDefinitionNames, out *apiextensions.CustomResourceDefinitionNames, s conversion.Scope) error { - out.Plural = in.Plural - out.Singular = in.Singular - out.ShortNames = *(*[]string)(unsafe.Pointer(&in.ShortNames)) - out.Kind = in.Kind - out.ListKind = in.ListKind - out.Categories = *(*[]string)(unsafe.Pointer(&in.Categories)) - return nil -} - -// Convert_v1beta1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDefinitionNames is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDefinitionNames(in *CustomResourceDefinitionNames, out *apiextensions.CustomResourceDefinitionNames, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDefinitionNames(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceDefinitionNames_To_v1beta1_CustomResourceDefinitionNames(in *apiextensions.CustomResourceDefinitionNames, out *CustomResourceDefinitionNames, s conversion.Scope) error { - out.Plural = in.Plural - out.Singular = in.Singular - out.ShortNames = *(*[]string)(unsafe.Pointer(&in.ShortNames)) - out.Kind = in.Kind - out.ListKind = in.ListKind - out.Categories = *(*[]string)(unsafe.Pointer(&in.Categories)) - return nil -} - -// Convert_apiextensions_CustomResourceDefinitionNames_To_v1beta1_CustomResourceDefinitionNames is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceDefinitionNames_To_v1beta1_CustomResourceDefinitionNames(in *apiextensions.CustomResourceDefinitionNames, out *CustomResourceDefinitionNames, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceDefinitionNames_To_v1beta1_CustomResourceDefinitionNames(in, out, s) -} - -func autoConvert_v1beta1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefinitionSpec(in *CustomResourceDefinitionSpec, out *apiextensions.CustomResourceDefinitionSpec, s conversion.Scope) error { - out.Group = in.Group - out.Version = in.Version - if err := Convert_v1beta1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDefinitionNames(&in.Names, &out.Names, s); err != nil { - return err - } - out.Scope = apiextensions.ResourceScope(in.Scope) - if in.Validation != nil { - in, out := &in.Validation, &out.Validation - *out = new(apiextensions.CustomResourceValidation) - if err := Convert_v1beta1_CustomResourceValidation_To_apiextensions_CustomResourceValidation(*in, *out, s); err != nil { - return err - } - } else { - out.Validation = nil - } - out.Subresources = (*apiextensions.CustomResourceSubresources)(unsafe.Pointer(in.Subresources)) - out.Versions = *(*[]apiextensions.CustomResourceDefinitionVersion)(unsafe.Pointer(&in.Versions)) - out.AdditionalPrinterColumns = *(*[]apiextensions.CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns)) - return nil -} - -// Convert_v1beta1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefinitionSpec is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefinitionSpec(in *CustomResourceDefinitionSpec, out *apiextensions.CustomResourceDefinitionSpec, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceDefinitionSpec_To_apiextensions_CustomResourceDefinitionSpec(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceDefinitionSpec_To_v1beta1_CustomResourceDefinitionSpec(in *apiextensions.CustomResourceDefinitionSpec, out *CustomResourceDefinitionSpec, s conversion.Scope) error { - out.Group = in.Group - out.Version = in.Version - if err := Convert_apiextensions_CustomResourceDefinitionNames_To_v1beta1_CustomResourceDefinitionNames(&in.Names, &out.Names, s); err != nil { - return err - } - out.Scope = ResourceScope(in.Scope) - if in.Validation != nil { - in, out := &in.Validation, &out.Validation - *out = new(CustomResourceValidation) - if err := Convert_apiextensions_CustomResourceValidation_To_v1beta1_CustomResourceValidation(*in, *out, s); err != nil { - return err - } - } else { - out.Validation = nil - } - out.Subresources = (*CustomResourceSubresources)(unsafe.Pointer(in.Subresources)) - out.Versions = *(*[]CustomResourceDefinitionVersion)(unsafe.Pointer(&in.Versions)) - out.AdditionalPrinterColumns = *(*[]CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns)) - return nil -} - -// Convert_apiextensions_CustomResourceDefinitionSpec_To_v1beta1_CustomResourceDefinitionSpec is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceDefinitionSpec_To_v1beta1_CustomResourceDefinitionSpec(in *apiextensions.CustomResourceDefinitionSpec, out *CustomResourceDefinitionSpec, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceDefinitionSpec_To_v1beta1_CustomResourceDefinitionSpec(in, out, s) -} - -func autoConvert_v1beta1_CustomResourceDefinitionStatus_To_apiextensions_CustomResourceDefinitionStatus(in *CustomResourceDefinitionStatus, out *apiextensions.CustomResourceDefinitionStatus, s conversion.Scope) error { - out.Conditions = *(*[]apiextensions.CustomResourceDefinitionCondition)(unsafe.Pointer(&in.Conditions)) - if err := Convert_v1beta1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDefinitionNames(&in.AcceptedNames, &out.AcceptedNames, s); err != nil { - return err - } - out.StoredVersions = *(*[]string)(unsafe.Pointer(&in.StoredVersions)) - return nil -} - -// Convert_v1beta1_CustomResourceDefinitionStatus_To_apiextensions_CustomResourceDefinitionStatus is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceDefinitionStatus_To_apiextensions_CustomResourceDefinitionStatus(in *CustomResourceDefinitionStatus, out *apiextensions.CustomResourceDefinitionStatus, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceDefinitionStatus_To_apiextensions_CustomResourceDefinitionStatus(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceDefinitionStatus_To_v1beta1_CustomResourceDefinitionStatus(in *apiextensions.CustomResourceDefinitionStatus, out *CustomResourceDefinitionStatus, s conversion.Scope) error { - out.Conditions = *(*[]CustomResourceDefinitionCondition)(unsafe.Pointer(&in.Conditions)) - if err := Convert_apiextensions_CustomResourceDefinitionNames_To_v1beta1_CustomResourceDefinitionNames(&in.AcceptedNames, &out.AcceptedNames, s); err != nil { - return err - } - out.StoredVersions = *(*[]string)(unsafe.Pointer(&in.StoredVersions)) - return nil -} - -// Convert_apiextensions_CustomResourceDefinitionStatus_To_v1beta1_CustomResourceDefinitionStatus is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceDefinitionStatus_To_v1beta1_CustomResourceDefinitionStatus(in *apiextensions.CustomResourceDefinitionStatus, out *CustomResourceDefinitionStatus, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceDefinitionStatus_To_v1beta1_CustomResourceDefinitionStatus(in, out, s) -} - -func autoConvert_v1beta1_CustomResourceDefinitionVersion_To_apiextensions_CustomResourceDefinitionVersion(in *CustomResourceDefinitionVersion, out *apiextensions.CustomResourceDefinitionVersion, s conversion.Scope) error { - out.Name = in.Name - out.Served = in.Served - out.Storage = in.Storage - return nil -} - -// Convert_v1beta1_CustomResourceDefinitionVersion_To_apiextensions_CustomResourceDefinitionVersion is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceDefinitionVersion_To_apiextensions_CustomResourceDefinitionVersion(in *CustomResourceDefinitionVersion, out *apiextensions.CustomResourceDefinitionVersion, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceDefinitionVersion_To_apiextensions_CustomResourceDefinitionVersion(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceDefinitionVersion_To_v1beta1_CustomResourceDefinitionVersion(in *apiextensions.CustomResourceDefinitionVersion, out *CustomResourceDefinitionVersion, s conversion.Scope) error { - out.Name = in.Name - out.Served = in.Served - out.Storage = in.Storage - return nil -} - -// Convert_apiextensions_CustomResourceDefinitionVersion_To_v1beta1_CustomResourceDefinitionVersion is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceDefinitionVersion_To_v1beta1_CustomResourceDefinitionVersion(in *apiextensions.CustomResourceDefinitionVersion, out *CustomResourceDefinitionVersion, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceDefinitionVersion_To_v1beta1_CustomResourceDefinitionVersion(in, out, s) -} - -func autoConvert_v1beta1_CustomResourceSubresourceScale_To_apiextensions_CustomResourceSubresourceScale(in *CustomResourceSubresourceScale, out *apiextensions.CustomResourceSubresourceScale, s conversion.Scope) error { - out.SpecReplicasPath = in.SpecReplicasPath - out.StatusReplicasPath = in.StatusReplicasPath - out.LabelSelectorPath = (*string)(unsafe.Pointer(in.LabelSelectorPath)) - return nil -} - -// Convert_v1beta1_CustomResourceSubresourceScale_To_apiextensions_CustomResourceSubresourceScale is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceSubresourceScale_To_apiextensions_CustomResourceSubresourceScale(in *CustomResourceSubresourceScale, out *apiextensions.CustomResourceSubresourceScale, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceSubresourceScale_To_apiextensions_CustomResourceSubresourceScale(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceSubresourceScale_To_v1beta1_CustomResourceSubresourceScale(in *apiextensions.CustomResourceSubresourceScale, out *CustomResourceSubresourceScale, s conversion.Scope) error { - out.SpecReplicasPath = in.SpecReplicasPath - out.StatusReplicasPath = in.StatusReplicasPath - out.LabelSelectorPath = (*string)(unsafe.Pointer(in.LabelSelectorPath)) - return nil -} - -// Convert_apiextensions_CustomResourceSubresourceScale_To_v1beta1_CustomResourceSubresourceScale is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceSubresourceScale_To_v1beta1_CustomResourceSubresourceScale(in *apiextensions.CustomResourceSubresourceScale, out *CustomResourceSubresourceScale, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceSubresourceScale_To_v1beta1_CustomResourceSubresourceScale(in, out, s) -} - -func autoConvert_v1beta1_CustomResourceSubresourceStatus_To_apiextensions_CustomResourceSubresourceStatus(in *CustomResourceSubresourceStatus, out *apiextensions.CustomResourceSubresourceStatus, s conversion.Scope) error { - return nil -} - -// Convert_v1beta1_CustomResourceSubresourceStatus_To_apiextensions_CustomResourceSubresourceStatus is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceSubresourceStatus_To_apiextensions_CustomResourceSubresourceStatus(in *CustomResourceSubresourceStatus, out *apiextensions.CustomResourceSubresourceStatus, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceSubresourceStatus_To_apiextensions_CustomResourceSubresourceStatus(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceSubresourceStatus_To_v1beta1_CustomResourceSubresourceStatus(in *apiextensions.CustomResourceSubresourceStatus, out *CustomResourceSubresourceStatus, s conversion.Scope) error { - return nil -} - -// Convert_apiextensions_CustomResourceSubresourceStatus_To_v1beta1_CustomResourceSubresourceStatus is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceSubresourceStatus_To_v1beta1_CustomResourceSubresourceStatus(in *apiextensions.CustomResourceSubresourceStatus, out *CustomResourceSubresourceStatus, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceSubresourceStatus_To_v1beta1_CustomResourceSubresourceStatus(in, out, s) -} - -func autoConvert_v1beta1_CustomResourceSubresources_To_apiextensions_CustomResourceSubresources(in *CustomResourceSubresources, out *apiextensions.CustomResourceSubresources, s conversion.Scope) error { - out.Status = (*apiextensions.CustomResourceSubresourceStatus)(unsafe.Pointer(in.Status)) - out.Scale = (*apiextensions.CustomResourceSubresourceScale)(unsafe.Pointer(in.Scale)) - return nil -} - -// Convert_v1beta1_CustomResourceSubresources_To_apiextensions_CustomResourceSubresources is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceSubresources_To_apiextensions_CustomResourceSubresources(in *CustomResourceSubresources, out *apiextensions.CustomResourceSubresources, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceSubresources_To_apiextensions_CustomResourceSubresources(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceSubresources_To_v1beta1_CustomResourceSubresources(in *apiextensions.CustomResourceSubresources, out *CustomResourceSubresources, s conversion.Scope) error { - out.Status = (*CustomResourceSubresourceStatus)(unsafe.Pointer(in.Status)) - out.Scale = (*CustomResourceSubresourceScale)(unsafe.Pointer(in.Scale)) - return nil -} - -// Convert_apiextensions_CustomResourceSubresources_To_v1beta1_CustomResourceSubresources is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceSubresources_To_v1beta1_CustomResourceSubresources(in *apiextensions.CustomResourceSubresources, out *CustomResourceSubresources, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceSubresources_To_v1beta1_CustomResourceSubresources(in, out, s) -} - -func autoConvert_v1beta1_CustomResourceValidation_To_apiextensions_CustomResourceValidation(in *CustomResourceValidation, out *apiextensions.CustomResourceValidation, s conversion.Scope) error { - if in.OpenAPIV3Schema != nil { - in, out := &in.OpenAPIV3Schema, &out.OpenAPIV3Schema - *out = new(apiextensions.JSONSchemaProps) - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(*in, *out, s); err != nil { - return err - } - } else { - out.OpenAPIV3Schema = nil - } - return nil -} - -// Convert_v1beta1_CustomResourceValidation_To_apiextensions_CustomResourceValidation is an autogenerated conversion function. -func Convert_v1beta1_CustomResourceValidation_To_apiextensions_CustomResourceValidation(in *CustomResourceValidation, out *apiextensions.CustomResourceValidation, s conversion.Scope) error { - return autoConvert_v1beta1_CustomResourceValidation_To_apiextensions_CustomResourceValidation(in, out, s) -} - -func autoConvert_apiextensions_CustomResourceValidation_To_v1beta1_CustomResourceValidation(in *apiextensions.CustomResourceValidation, out *CustomResourceValidation, s conversion.Scope) error { - if in.OpenAPIV3Schema != nil { - in, out := &in.OpenAPIV3Schema, &out.OpenAPIV3Schema - *out = new(JSONSchemaProps) - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(*in, *out, s); err != nil { - return err - } - } else { - out.OpenAPIV3Schema = nil - } - return nil -} - -// Convert_apiextensions_CustomResourceValidation_To_v1beta1_CustomResourceValidation is an autogenerated conversion function. -func Convert_apiextensions_CustomResourceValidation_To_v1beta1_CustomResourceValidation(in *apiextensions.CustomResourceValidation, out *CustomResourceValidation, s conversion.Scope) error { - return autoConvert_apiextensions_CustomResourceValidation_To_v1beta1_CustomResourceValidation(in, out, s) -} - -func autoConvert_v1beta1_ExternalDocumentation_To_apiextensions_ExternalDocumentation(in *ExternalDocumentation, out *apiextensions.ExternalDocumentation, s conversion.Scope) error { - out.Description = in.Description - out.URL = in.URL - return nil -} - -// Convert_v1beta1_ExternalDocumentation_To_apiextensions_ExternalDocumentation is an autogenerated conversion function. -func Convert_v1beta1_ExternalDocumentation_To_apiextensions_ExternalDocumentation(in *ExternalDocumentation, out *apiextensions.ExternalDocumentation, s conversion.Scope) error { - return autoConvert_v1beta1_ExternalDocumentation_To_apiextensions_ExternalDocumentation(in, out, s) -} - -func autoConvert_apiextensions_ExternalDocumentation_To_v1beta1_ExternalDocumentation(in *apiextensions.ExternalDocumentation, out *ExternalDocumentation, s conversion.Scope) error { - out.Description = in.Description - out.URL = in.URL - return nil -} - -// Convert_apiextensions_ExternalDocumentation_To_v1beta1_ExternalDocumentation is an autogenerated conversion function. -func Convert_apiextensions_ExternalDocumentation_To_v1beta1_ExternalDocumentation(in *apiextensions.ExternalDocumentation, out *ExternalDocumentation, s conversion.Scope) error { - return autoConvert_apiextensions_ExternalDocumentation_To_v1beta1_ExternalDocumentation(in, out, s) -} - -func autoConvert_v1beta1_JSON_To_apiextensions_JSON(in *JSON, out *apiextensions.JSON, s conversion.Scope) error { - // WARNING: in.Raw requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_apiextensions_JSON_To_v1beta1_JSON(in *apiextensions.JSON, out *JSON, s conversion.Scope) error { - // FIXME: Type apiextensions.JSON is unsupported. - return nil -} - -func autoConvert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(in *JSONSchemaProps, out *apiextensions.JSONSchemaProps, s conversion.Scope) error { - out.ID = in.ID - out.Schema = apiextensions.JSONSchemaURL(in.Schema) - out.Ref = (*string)(unsafe.Pointer(in.Ref)) - out.Description = in.Description - out.Type = in.Type - out.Format = in.Format - out.Title = in.Title - if in.Default != nil { - in, out := &in.Default, &out.Default - *out = new(apiextensions.JSON) - if err := Convert_v1beta1_JSON_To_apiextensions_JSON(*in, *out, s); err != nil { - return err - } - } else { - out.Default = nil - } - out.Maximum = (*float64)(unsafe.Pointer(in.Maximum)) - out.ExclusiveMaximum = in.ExclusiveMaximum - out.Minimum = (*float64)(unsafe.Pointer(in.Minimum)) - out.ExclusiveMinimum = in.ExclusiveMinimum - out.MaxLength = (*int64)(unsafe.Pointer(in.MaxLength)) - out.MinLength = (*int64)(unsafe.Pointer(in.MinLength)) - out.Pattern = in.Pattern - out.MaxItems = (*int64)(unsafe.Pointer(in.MaxItems)) - out.MinItems = (*int64)(unsafe.Pointer(in.MinItems)) - out.UniqueItems = in.UniqueItems - out.MultipleOf = (*float64)(unsafe.Pointer(in.MultipleOf)) - if in.Enum != nil { - in, out := &in.Enum, &out.Enum - *out = make([]apiextensions.JSON, len(*in)) - for i := range *in { - if err := Convert_v1beta1_JSON_To_apiextensions_JSON(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Enum = nil - } - out.MaxProperties = (*int64)(unsafe.Pointer(in.MaxProperties)) - out.MinProperties = (*int64)(unsafe.Pointer(in.MinProperties)) - out.Required = *(*[]string)(unsafe.Pointer(&in.Required)) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = new(apiextensions.JSONSchemaPropsOrArray) - if err := Convert_v1beta1_JSONSchemaPropsOrArray_To_apiextensions_JSONSchemaPropsOrArray(*in, *out, s); err != nil { - return err - } - } else { - out.Items = nil - } - if in.AllOf != nil { - in, out := &in.AllOf, &out.AllOf - *out = make([]apiextensions.JSONSchemaProps, len(*in)) - for i := range *in { - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.AllOf = nil - } - if in.OneOf != nil { - in, out := &in.OneOf, &out.OneOf - *out = make([]apiextensions.JSONSchemaProps, len(*in)) - for i := range *in { - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.OneOf = nil - } - if in.AnyOf != nil { - in, out := &in.AnyOf, &out.AnyOf - *out = make([]apiextensions.JSONSchemaProps, len(*in)) - for i := range *in { - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.AnyOf = nil - } - if in.Not != nil { - in, out := &in.Not, &out.Not - *out = new(apiextensions.JSONSchemaProps) - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(*in, *out, s); err != nil { - return err - } - } else { - out.Not = nil - } - if in.Properties != nil { - in, out := &in.Properties, &out.Properties - *out = make(map[string]apiextensions.JSONSchemaProps, len(*in)) - for key, val := range *in { - newVal := new(apiextensions.JSONSchemaProps) - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Properties = nil - } - if in.AdditionalProperties != nil { - in, out := &in.AdditionalProperties, &out.AdditionalProperties - *out = new(apiextensions.JSONSchemaPropsOrBool) - if err := Convert_v1beta1_JSONSchemaPropsOrBool_To_apiextensions_JSONSchemaPropsOrBool(*in, *out, s); err != nil { - return err - } - } else { - out.AdditionalProperties = nil - } - if in.PatternProperties != nil { - in, out := &in.PatternProperties, &out.PatternProperties - *out = make(map[string]apiextensions.JSONSchemaProps, len(*in)) - for key, val := range *in { - newVal := new(apiextensions.JSONSchemaProps) - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.PatternProperties = nil - } - if in.Dependencies != nil { - in, out := &in.Dependencies, &out.Dependencies - *out = make(apiextensions.JSONSchemaDependencies, len(*in)) - for key, val := range *in { - newVal := new(apiextensions.JSONSchemaPropsOrStringArray) - if err := Convert_v1beta1_JSONSchemaPropsOrStringArray_To_apiextensions_JSONSchemaPropsOrStringArray(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Dependencies = nil - } - if in.AdditionalItems != nil { - in, out := &in.AdditionalItems, &out.AdditionalItems - *out = new(apiextensions.JSONSchemaPropsOrBool) - if err := Convert_v1beta1_JSONSchemaPropsOrBool_To_apiextensions_JSONSchemaPropsOrBool(*in, *out, s); err != nil { - return err - } - } else { - out.AdditionalItems = nil - } - if in.Definitions != nil { - in, out := &in.Definitions, &out.Definitions - *out = make(apiextensions.JSONSchemaDefinitions, len(*in)) - for key, val := range *in { - newVal := new(apiextensions.JSONSchemaProps) - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Definitions = nil - } - out.ExternalDocs = (*apiextensions.ExternalDocumentation)(unsafe.Pointer(in.ExternalDocs)) - if in.Example != nil { - in, out := &in.Example, &out.Example - *out = new(apiextensions.JSON) - if err := Convert_v1beta1_JSON_To_apiextensions_JSON(*in, *out, s); err != nil { - return err - } - } else { - out.Example = nil - } - return nil -} - -// Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps is an autogenerated conversion function. -func Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(in *JSONSchemaProps, out *apiextensions.JSONSchemaProps, s conversion.Scope) error { - return autoConvert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(in, out, s) -} - -func autoConvert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(in *apiextensions.JSONSchemaProps, out *JSONSchemaProps, s conversion.Scope) error { - out.ID = in.ID - out.Schema = JSONSchemaURL(in.Schema) - out.Ref = (*string)(unsafe.Pointer(in.Ref)) - out.Description = in.Description - out.Type = in.Type - out.Format = in.Format - out.Title = in.Title - if in.Default != nil { - in, out := &in.Default, &out.Default - *out = new(JSON) - if err := Convert_apiextensions_JSON_To_v1beta1_JSON(*in, *out, s); err != nil { - return err - } - } else { - out.Default = nil - } - out.Maximum = (*float64)(unsafe.Pointer(in.Maximum)) - out.ExclusiveMaximum = in.ExclusiveMaximum - out.Minimum = (*float64)(unsafe.Pointer(in.Minimum)) - out.ExclusiveMinimum = in.ExclusiveMinimum - out.MaxLength = (*int64)(unsafe.Pointer(in.MaxLength)) - out.MinLength = (*int64)(unsafe.Pointer(in.MinLength)) - out.Pattern = in.Pattern - out.MaxItems = (*int64)(unsafe.Pointer(in.MaxItems)) - out.MinItems = (*int64)(unsafe.Pointer(in.MinItems)) - out.UniqueItems = in.UniqueItems - out.MultipleOf = (*float64)(unsafe.Pointer(in.MultipleOf)) - if in.Enum != nil { - in, out := &in.Enum, &out.Enum - *out = make([]JSON, len(*in)) - for i := range *in { - if err := Convert_apiextensions_JSON_To_v1beta1_JSON(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Enum = nil - } - out.MaxProperties = (*int64)(unsafe.Pointer(in.MaxProperties)) - out.MinProperties = (*int64)(unsafe.Pointer(in.MinProperties)) - out.Required = *(*[]string)(unsafe.Pointer(&in.Required)) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = new(JSONSchemaPropsOrArray) - if err := Convert_apiextensions_JSONSchemaPropsOrArray_To_v1beta1_JSONSchemaPropsOrArray(*in, *out, s); err != nil { - return err - } - } else { - out.Items = nil - } - if in.AllOf != nil { - in, out := &in.AllOf, &out.AllOf - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.AllOf = nil - } - if in.OneOf != nil { - in, out := &in.OneOf, &out.OneOf - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.OneOf = nil - } - if in.AnyOf != nil { - in, out := &in.AnyOf, &out.AnyOf - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.AnyOf = nil - } - if in.Not != nil { - in, out := &in.Not, &out.Not - *out = new(JSONSchemaProps) - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(*in, *out, s); err != nil { - return err - } - } else { - out.Not = nil - } - if in.Properties != nil { - in, out := &in.Properties, &out.Properties - *out = make(map[string]JSONSchemaProps, len(*in)) - for key, val := range *in { - newVal := new(JSONSchemaProps) - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Properties = nil - } - if in.AdditionalProperties != nil { - in, out := &in.AdditionalProperties, &out.AdditionalProperties - *out = new(JSONSchemaPropsOrBool) - if err := Convert_apiextensions_JSONSchemaPropsOrBool_To_v1beta1_JSONSchemaPropsOrBool(*in, *out, s); err != nil { - return err - } - } else { - out.AdditionalProperties = nil - } - if in.PatternProperties != nil { - in, out := &in.PatternProperties, &out.PatternProperties - *out = make(map[string]JSONSchemaProps, len(*in)) - for key, val := range *in { - newVal := new(JSONSchemaProps) - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.PatternProperties = nil - } - if in.Dependencies != nil { - in, out := &in.Dependencies, &out.Dependencies - *out = make(JSONSchemaDependencies, len(*in)) - for key, val := range *in { - newVal := new(JSONSchemaPropsOrStringArray) - if err := Convert_apiextensions_JSONSchemaPropsOrStringArray_To_v1beta1_JSONSchemaPropsOrStringArray(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Dependencies = nil - } - if in.AdditionalItems != nil { - in, out := &in.AdditionalItems, &out.AdditionalItems - *out = new(JSONSchemaPropsOrBool) - if err := Convert_apiextensions_JSONSchemaPropsOrBool_To_v1beta1_JSONSchemaPropsOrBool(*in, *out, s); err != nil { - return err - } - } else { - out.AdditionalItems = nil - } - if in.Definitions != nil { - in, out := &in.Definitions, &out.Definitions - *out = make(JSONSchemaDefinitions, len(*in)) - for key, val := range *in { - newVal := new(JSONSchemaProps) - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Definitions = nil - } - out.ExternalDocs = (*ExternalDocumentation)(unsafe.Pointer(in.ExternalDocs)) - if in.Example != nil { - in, out := &in.Example, &out.Example - *out = new(JSON) - if err := Convert_apiextensions_JSON_To_v1beta1_JSON(*in, *out, s); err != nil { - return err - } - } else { - out.Example = nil - } - return nil -} - -func autoConvert_v1beta1_JSONSchemaPropsOrArray_To_apiextensions_JSONSchemaPropsOrArray(in *JSONSchemaPropsOrArray, out *apiextensions.JSONSchemaPropsOrArray, s conversion.Scope) error { - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = new(apiextensions.JSONSchemaProps) - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(*in, *out, s); err != nil { - return err - } - } else { - out.Schema = nil - } - if in.JSONSchemas != nil { - in, out := &in.JSONSchemas, &out.JSONSchemas - *out = make([]apiextensions.JSONSchemaProps, len(*in)) - for i := range *in { - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.JSONSchemas = nil - } - return nil -} - -// Convert_v1beta1_JSONSchemaPropsOrArray_To_apiextensions_JSONSchemaPropsOrArray is an autogenerated conversion function. -func Convert_v1beta1_JSONSchemaPropsOrArray_To_apiextensions_JSONSchemaPropsOrArray(in *JSONSchemaPropsOrArray, out *apiextensions.JSONSchemaPropsOrArray, s conversion.Scope) error { - return autoConvert_v1beta1_JSONSchemaPropsOrArray_To_apiextensions_JSONSchemaPropsOrArray(in, out, s) -} - -func autoConvert_apiextensions_JSONSchemaPropsOrArray_To_v1beta1_JSONSchemaPropsOrArray(in *apiextensions.JSONSchemaPropsOrArray, out *JSONSchemaPropsOrArray, s conversion.Scope) error { - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = new(JSONSchemaProps) - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(*in, *out, s); err != nil { - return err - } - } else { - out.Schema = nil - } - if in.JSONSchemas != nil { - in, out := &in.JSONSchemas, &out.JSONSchemas - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.JSONSchemas = nil - } - return nil -} - -// Convert_apiextensions_JSONSchemaPropsOrArray_To_v1beta1_JSONSchemaPropsOrArray is an autogenerated conversion function. -func Convert_apiextensions_JSONSchemaPropsOrArray_To_v1beta1_JSONSchemaPropsOrArray(in *apiextensions.JSONSchemaPropsOrArray, out *JSONSchemaPropsOrArray, s conversion.Scope) error { - return autoConvert_apiextensions_JSONSchemaPropsOrArray_To_v1beta1_JSONSchemaPropsOrArray(in, out, s) -} - -func autoConvert_v1beta1_JSONSchemaPropsOrBool_To_apiextensions_JSONSchemaPropsOrBool(in *JSONSchemaPropsOrBool, out *apiextensions.JSONSchemaPropsOrBool, s conversion.Scope) error { - out.Allows = in.Allows - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = new(apiextensions.JSONSchemaProps) - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(*in, *out, s); err != nil { - return err - } - } else { - out.Schema = nil - } - return nil -} - -// Convert_v1beta1_JSONSchemaPropsOrBool_To_apiextensions_JSONSchemaPropsOrBool is an autogenerated conversion function. -func Convert_v1beta1_JSONSchemaPropsOrBool_To_apiextensions_JSONSchemaPropsOrBool(in *JSONSchemaPropsOrBool, out *apiextensions.JSONSchemaPropsOrBool, s conversion.Scope) error { - return autoConvert_v1beta1_JSONSchemaPropsOrBool_To_apiextensions_JSONSchemaPropsOrBool(in, out, s) -} - -func autoConvert_apiextensions_JSONSchemaPropsOrBool_To_v1beta1_JSONSchemaPropsOrBool(in *apiextensions.JSONSchemaPropsOrBool, out *JSONSchemaPropsOrBool, s conversion.Scope) error { - out.Allows = in.Allows - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = new(JSONSchemaProps) - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(*in, *out, s); err != nil { - return err - } - } else { - out.Schema = nil - } - return nil -} - -// Convert_apiextensions_JSONSchemaPropsOrBool_To_v1beta1_JSONSchemaPropsOrBool is an autogenerated conversion function. -func Convert_apiextensions_JSONSchemaPropsOrBool_To_v1beta1_JSONSchemaPropsOrBool(in *apiextensions.JSONSchemaPropsOrBool, out *JSONSchemaPropsOrBool, s conversion.Scope) error { - return autoConvert_apiextensions_JSONSchemaPropsOrBool_To_v1beta1_JSONSchemaPropsOrBool(in, out, s) -} - -func autoConvert_v1beta1_JSONSchemaPropsOrStringArray_To_apiextensions_JSONSchemaPropsOrStringArray(in *JSONSchemaPropsOrStringArray, out *apiextensions.JSONSchemaPropsOrStringArray, s conversion.Scope) error { - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = new(apiextensions.JSONSchemaProps) - if err := Convert_v1beta1_JSONSchemaProps_To_apiextensions_JSONSchemaProps(*in, *out, s); err != nil { - return err - } - } else { - out.Schema = nil - } - out.Property = *(*[]string)(unsafe.Pointer(&in.Property)) - return nil -} - -// Convert_v1beta1_JSONSchemaPropsOrStringArray_To_apiextensions_JSONSchemaPropsOrStringArray is an autogenerated conversion function. -func Convert_v1beta1_JSONSchemaPropsOrStringArray_To_apiextensions_JSONSchemaPropsOrStringArray(in *JSONSchemaPropsOrStringArray, out *apiextensions.JSONSchemaPropsOrStringArray, s conversion.Scope) error { - return autoConvert_v1beta1_JSONSchemaPropsOrStringArray_To_apiextensions_JSONSchemaPropsOrStringArray(in, out, s) -} - -func autoConvert_apiextensions_JSONSchemaPropsOrStringArray_To_v1beta1_JSONSchemaPropsOrStringArray(in *apiextensions.JSONSchemaPropsOrStringArray, out *JSONSchemaPropsOrStringArray, s conversion.Scope) error { - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = new(JSONSchemaProps) - if err := Convert_apiextensions_JSONSchemaProps_To_v1beta1_JSONSchemaProps(*in, *out, s); err != nil { - return err - } - } else { - out.Schema = nil - } - out.Property = *(*[]string)(unsafe.Pointer(&in.Property)) - return nil -} - -// Convert_apiextensions_JSONSchemaPropsOrStringArray_To_v1beta1_JSONSchemaPropsOrStringArray is an autogenerated conversion function. -func Convert_apiextensions_JSONSchemaPropsOrStringArray_To_v1beta1_JSONSchemaPropsOrStringArray(in *apiextensions.JSONSchemaPropsOrStringArray, out *JSONSchemaPropsOrStringArray, s conversion.Scope) error { - return autoConvert_apiextensions_JSONSchemaPropsOrStringArray_To_v1beta1_JSONSchemaPropsOrStringArray(in, out, s) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index 5e14efbc8..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,470 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 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. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1beta1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceColumnDefinition) DeepCopyInto(out *CustomResourceColumnDefinition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceColumnDefinition. -func (in *CustomResourceColumnDefinition) DeepCopy() *CustomResourceColumnDefinition { - if in == nil { - return nil - } - out := new(CustomResourceColumnDefinition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinition) DeepCopyInto(out *CustomResourceDefinition) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinition. -func (in *CustomResourceDefinition) DeepCopy() *CustomResourceDefinition { - if in == nil { - return nil - } - out := new(CustomResourceDefinition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CustomResourceDefinition) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionCondition) DeepCopyInto(out *CustomResourceDefinitionCondition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionCondition. -func (in *CustomResourceDefinitionCondition) DeepCopy() *CustomResourceDefinitionCondition { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionList) DeepCopyInto(out *CustomResourceDefinitionList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CustomResourceDefinition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionList. -func (in *CustomResourceDefinitionList) DeepCopy() *CustomResourceDefinitionList { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CustomResourceDefinitionList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionNames) DeepCopyInto(out *CustomResourceDefinitionNames) { - *out = *in - if in.ShortNames != nil { - in, out := &in.ShortNames, &out.ShortNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Categories != nil { - in, out := &in.Categories, &out.Categories - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionNames. -func (in *CustomResourceDefinitionNames) DeepCopy() *CustomResourceDefinitionNames { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionNames) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionSpec) DeepCopyInto(out *CustomResourceDefinitionSpec) { - *out = *in - in.Names.DeepCopyInto(&out.Names) - if in.Validation != nil { - in, out := &in.Validation, &out.Validation - *out = new(CustomResourceValidation) - (*in).DeepCopyInto(*out) - } - if in.Subresources != nil { - in, out := &in.Subresources, &out.Subresources - *out = new(CustomResourceSubresources) - (*in).DeepCopyInto(*out) - } - if in.Versions != nil { - in, out := &in.Versions, &out.Versions - *out = make([]CustomResourceDefinitionVersion, len(*in)) - copy(*out, *in) - } - if in.AdditionalPrinterColumns != nil { - in, out := &in.AdditionalPrinterColumns, &out.AdditionalPrinterColumns - *out = make([]CustomResourceColumnDefinition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionSpec. -func (in *CustomResourceDefinitionSpec) DeepCopy() *CustomResourceDefinitionSpec { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionStatus) DeepCopyInto(out *CustomResourceDefinitionStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]CustomResourceDefinitionCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.AcceptedNames.DeepCopyInto(&out.AcceptedNames) - if in.StoredVersions != nil { - in, out := &in.StoredVersions, &out.StoredVersions - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionStatus. -func (in *CustomResourceDefinitionStatus) DeepCopy() *CustomResourceDefinitionStatus { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionVersion) DeepCopyInto(out *CustomResourceDefinitionVersion) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionVersion. -func (in *CustomResourceDefinitionVersion) DeepCopy() *CustomResourceDefinitionVersion { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionVersion) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceSubresourceScale) DeepCopyInto(out *CustomResourceSubresourceScale) { - *out = *in - if in.LabelSelectorPath != nil { - in, out := &in.LabelSelectorPath, &out.LabelSelectorPath - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceSubresourceScale. -func (in *CustomResourceSubresourceScale) DeepCopy() *CustomResourceSubresourceScale { - if in == nil { - return nil - } - out := new(CustomResourceSubresourceScale) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceSubresourceStatus) DeepCopyInto(out *CustomResourceSubresourceStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceSubresourceStatus. -func (in *CustomResourceSubresourceStatus) DeepCopy() *CustomResourceSubresourceStatus { - if in == nil { - return nil - } - out := new(CustomResourceSubresourceStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceSubresources) DeepCopyInto(out *CustomResourceSubresources) { - *out = *in - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(CustomResourceSubresourceStatus) - **out = **in - } - if in.Scale != nil { - in, out := &in.Scale, &out.Scale - *out = new(CustomResourceSubresourceScale) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceSubresources. -func (in *CustomResourceSubresources) DeepCopy() *CustomResourceSubresources { - if in == nil { - return nil - } - out := new(CustomResourceSubresources) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceValidation) DeepCopyInto(out *CustomResourceValidation) { - *out = *in - if in.OpenAPIV3Schema != nil { - in, out := &in.OpenAPIV3Schema, &out.OpenAPIV3Schema - *out = (*in).DeepCopy() - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceValidation. -func (in *CustomResourceValidation) DeepCopy() *CustomResourceValidation { - if in == nil { - return nil - } - out := new(CustomResourceValidation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalDocumentation) DeepCopyInto(out *ExternalDocumentation) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDocumentation. -func (in *ExternalDocumentation) DeepCopy() *ExternalDocumentation { - if in == nil { - return nil - } - out := new(ExternalDocumentation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JSON) DeepCopyInto(out *JSON) { - *out = *in - if in.Raw != nil { - in, out := &in.Raw, &out.Raw - *out = make([]byte, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSON. -func (in *JSON) DeepCopy() *JSON { - if in == nil { - return nil - } - out := new(JSON) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in JSONSchemaDefinitions) DeepCopyInto(out *JSONSchemaDefinitions) { - { - in := &in - *out = make(JSONSchemaDefinitions, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - return - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONSchemaDefinitions. -func (in JSONSchemaDefinitions) DeepCopy() JSONSchemaDefinitions { - if in == nil { - return nil - } - out := new(JSONSchemaDefinitions) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in JSONSchemaDependencies) DeepCopyInto(out *JSONSchemaDependencies) { - { - in := &in - *out = make(JSONSchemaDependencies, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - return - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONSchemaDependencies. -func (in JSONSchemaDependencies) DeepCopy() JSONSchemaDependencies { - if in == nil { - return nil - } - out := new(JSONSchemaDependencies) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JSONSchemaProps) DeepCopyInto(out *JSONSchemaProps) { - clone := in.DeepCopy() - *out = *clone - return -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JSONSchemaPropsOrArray) DeepCopyInto(out *JSONSchemaPropsOrArray) { - *out = *in - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = (*in).DeepCopy() - } - if in.JSONSchemas != nil { - in, out := &in.JSONSchemas, &out.JSONSchemas - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONSchemaPropsOrArray. -func (in *JSONSchemaPropsOrArray) DeepCopy() *JSONSchemaPropsOrArray { - if in == nil { - return nil - } - out := new(JSONSchemaPropsOrArray) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JSONSchemaPropsOrBool) DeepCopyInto(out *JSONSchemaPropsOrBool) { - *out = *in - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = (*in).DeepCopy() - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONSchemaPropsOrBool. -func (in *JSONSchemaPropsOrBool) DeepCopy() *JSONSchemaPropsOrBool { - if in == nil { - return nil - } - out := new(JSONSchemaPropsOrBool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JSONSchemaPropsOrStringArray) DeepCopyInto(out *JSONSchemaPropsOrStringArray) { - *out = *in - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = (*in).DeepCopy() - } - if in.Property != nil { - in, out := &in.Property, &out.Property - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONSchemaPropsOrStringArray. -func (in *JSONSchemaPropsOrStringArray) DeepCopy() *JSONSchemaPropsOrStringArray { - if in == nil { - return nil - } - out := new(JSONSchemaPropsOrStringArray) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.defaults.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.defaults.go deleted file mode 100644 index f65f47a03..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.defaults.go +++ /dev/null @@ -1,48 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 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. -*/ - -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1beta1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&CustomResourceDefinition{}, func(obj interface{}) { SetObjectDefaults_CustomResourceDefinition(obj.(*CustomResourceDefinition)) }) - scheme.AddTypeDefaultingFunc(&CustomResourceDefinitionList{}, func(obj interface{}) { - SetObjectDefaults_CustomResourceDefinitionList(obj.(*CustomResourceDefinitionList)) - }) - return nil -} - -func SetObjectDefaults_CustomResourceDefinition(in *CustomResourceDefinition) { - SetDefaults_CustomResourceDefinition(in) - SetDefaults_CustomResourceDefinitionSpec(&in.Spec) -} - -func SetObjectDefaults_CustomResourceDefinitionList(in *CustomResourceDefinitionList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_CustomResourceDefinition(a) - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go deleted file mode 100644 index 0568bc181..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go +++ /dev/null @@ -1,546 +0,0 @@ -/* -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 validation - -import ( - "fmt" - "reflect" - "strings" - - genericvalidation "k8s.io/apimachinery/pkg/api/validation" - "k8s.io/apimachinery/pkg/util/sets" - validationutil "k8s.io/apimachinery/pkg/util/validation" - "k8s.io/apimachinery/pkg/util/validation/field" - utilfeature "k8s.io/apiserver/pkg/util/feature" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - apiservervalidation "k8s.io/apiextensions-apiserver/pkg/apiserver/validation" - apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" -) - -var ( - printerColumnDatatypes = sets.NewString("integer", "number", "string", "boolean", "date") - customResourceColumnDefinitionFormats = sets.NewString("int32", "int64", "float", "double", "byte", "date", "date-time", "password") -) - -// ValidateCustomResourceDefinition statically validates -func ValidateCustomResourceDefinition(obj *apiextensions.CustomResourceDefinition) field.ErrorList { - nameValidationFn := func(name string, prefix bool) []string { - ret := genericvalidation.NameIsDNSSubdomain(name, prefix) - requiredName := obj.Spec.Names.Plural + "." + obj.Spec.Group - if name != requiredName { - ret = append(ret, fmt.Sprintf(`must be spec.names.plural+"."+spec.group`)) - } - return ret - } - - allErrs := genericvalidation.ValidateObjectMeta(&obj.ObjectMeta, false, nameValidationFn, field.NewPath("metadata")) - allErrs = append(allErrs, ValidateCustomResourceDefinitionSpec(&obj.Spec, field.NewPath("spec"))...) - allErrs = append(allErrs, ValidateCustomResourceDefinitionStatus(&obj.Status, field.NewPath("status"))...) - allErrs = append(allErrs, ValidateCustomResourceDefinitionStoredVersions(obj.Status.StoredVersions, obj.Spec.Versions, field.NewPath("status").Child("storedVersions"))...) - return allErrs -} - -// ValidateCustomResourceDefinitionUpdate statically validates -func ValidateCustomResourceDefinitionUpdate(obj, oldObj *apiextensions.CustomResourceDefinition) field.ErrorList { - allErrs := genericvalidation.ValidateObjectMetaUpdate(&obj.ObjectMeta, &oldObj.ObjectMeta, field.NewPath("metadata")) - allErrs = append(allErrs, ValidateCustomResourceDefinitionSpecUpdate(&obj.Spec, &oldObj.Spec, apiextensions.IsCRDConditionTrue(oldObj, apiextensions.Established), field.NewPath("spec"))...) - allErrs = append(allErrs, ValidateCustomResourceDefinitionStatus(&obj.Status, field.NewPath("status"))...) - allErrs = append(allErrs, ValidateCustomResourceDefinitionStoredVersions(obj.Status.StoredVersions, obj.Spec.Versions, field.NewPath("status").Child("storedVersions"))...) - return allErrs -} - -// ValidateCustomResourceDefinitionStoredVersions statically validates -func ValidateCustomResourceDefinitionStoredVersions(storedVersions []string, versions []apiextensions.CustomResourceDefinitionVersion, fldPath *field.Path) field.ErrorList { - if len(storedVersions) == 0 { - return field.ErrorList{field.Invalid(fldPath, storedVersions, "must have at least one stored version")} - } - allErrs := field.ErrorList{} - storedVersionsMap := map[string]int{} - for i, v := range storedVersions { - storedVersionsMap[v] = i - } - for _, v := range versions { - _, ok := storedVersionsMap[v.Name] - if v.Storage && !ok { - allErrs = append(allErrs, field.Invalid(fldPath, v, "must have the storage version "+v.Name)) - } - if ok { - delete(storedVersionsMap, v.Name) - } - } - - for v, i := range storedVersionsMap { - allErrs = append(allErrs, field.Invalid(fldPath.Index(i), v, "must appear in spec.versions")) - } - - return allErrs -} - -// ValidateUpdateCustomResourceDefinitionStatus statically validates -func ValidateUpdateCustomResourceDefinitionStatus(obj, oldObj *apiextensions.CustomResourceDefinition) field.ErrorList { - allErrs := genericvalidation.ValidateObjectMetaUpdate(&obj.ObjectMeta, &oldObj.ObjectMeta, field.NewPath("metadata")) - allErrs = append(allErrs, ValidateCustomResourceDefinitionStatus(&obj.Status, field.NewPath("status"))...) - return allErrs -} - -// ValidateCustomResourceDefinitionSpec statically validates -func ValidateCustomResourceDefinitionSpec(spec *apiextensions.CustomResourceDefinitionSpec, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if len(spec.Group) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("group"), "")) - } else if errs := validationutil.IsDNS1123Subdomain(spec.Group); len(errs) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("group"), spec.Group, strings.Join(errs, ","))) - } else if len(strings.Split(spec.Group, ".")) < 2 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("group"), spec.Group, "should be a domain with at least one dot")) - } - - switch spec.Scope { - case "": - allErrs = append(allErrs, field.Required(fldPath.Child("scope"), "")) - case apiextensions.ClusterScoped, apiextensions.NamespaceScoped: - default: - allErrs = append(allErrs, field.NotSupported(fldPath.Child("scope"), spec.Scope, []string{string(apiextensions.ClusterScoped), string(apiextensions.NamespaceScoped)})) - } - - storageFlagCount := 0 - versionsMap := map[string]bool{} - uniqueNames := true - for i, version := range spec.Versions { - if version.Storage { - storageFlagCount++ - } - if versionsMap[version.Name] { - uniqueNames = false - } else { - versionsMap[version.Name] = true - } - if errs := validationutil.IsDNS1035Label(version.Name); len(errs) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("versions").Index(i).Child("name"), spec.Versions[i].Name, strings.Join(errs, ","))) - } - } - if !uniqueNames { - allErrs = append(allErrs, field.Invalid(fldPath.Child("versions"), spec.Versions, "must contain unique version names")) - } - if storageFlagCount != 1 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("versions"), spec.Versions, "must have exactly one version marked as storage version")) - } - if len(spec.Version) != 0 { - if errs := validationutil.IsDNS1035Label(spec.Version); len(errs) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("version"), spec.Version, strings.Join(errs, ","))) - } - if len(spec.Versions) >= 1 && spec.Versions[0].Name != spec.Version { - allErrs = append(allErrs, field.Invalid(fldPath.Child("version"), spec.Version, "must match the first version in spec.versions")) - } - } - - // in addition to the basic name restrictions, some names are required for spec, but not for status - if len(spec.Names.Plural) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("names", "plural"), "")) - } - if len(spec.Names.Singular) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("names", "singular"), "")) - } - if len(spec.Names.Kind) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("names", "kind"), "")) - } - if len(spec.Names.ListKind) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("names", "listKind"), "")) - } - - allErrs = append(allErrs, ValidateCustomResourceDefinitionNames(&spec.Names, fldPath.Child("names"))...) - - if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceValidation) { - statusEnabled := false - if spec.Subresources != nil && spec.Subresources.Status != nil { - statusEnabled = true - } - allErrs = append(allErrs, ValidateCustomResourceDefinitionValidation(spec.Validation, statusEnabled, fldPath.Child("validation"))...) - } else if spec.Validation != nil { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("validation"), "disabled by feature-gate CustomResourceValidation")) - } - - if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) { - allErrs = append(allErrs, ValidateCustomResourceDefinitionSubresources(spec.Subresources, fldPath.Child("subresources"))...) - } else if spec.Subresources != nil { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("subresources"), "disabled by feature-gate CustomResourceSubresources")) - } - - for i := range spec.AdditionalPrinterColumns { - if errs := ValidateCustomResourceColumnDefinition(&spec.AdditionalPrinterColumns[i], fldPath.Child("columns").Index(i)); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - } - - return allErrs -} - -// ValidateCustomResourceDefinitionSpecUpdate statically validates -func ValidateCustomResourceDefinitionSpecUpdate(spec, oldSpec *apiextensions.CustomResourceDefinitionSpec, established bool, fldPath *field.Path) field.ErrorList { - allErrs := ValidateCustomResourceDefinitionSpec(spec, fldPath) - - if established { - // these effect the storage and cannot be changed therefore - allErrs = append(allErrs, genericvalidation.ValidateImmutableField(spec.Scope, oldSpec.Scope, fldPath.Child("scope"))...) - allErrs = append(allErrs, genericvalidation.ValidateImmutableField(spec.Names.Kind, oldSpec.Names.Kind, fldPath.Child("names", "kind"))...) - } - - // these affects the resource name, which is always immutable, so this can't be updated. - allErrs = append(allErrs, genericvalidation.ValidateImmutableField(spec.Group, oldSpec.Group, fldPath.Child("group"))...) - allErrs = append(allErrs, genericvalidation.ValidateImmutableField(spec.Names.Plural, oldSpec.Names.Plural, fldPath.Child("names", "plural"))...) - - return allErrs -} - -// ValidateCustomResourceDefinitionStatus statically validates -func ValidateCustomResourceDefinitionStatus(status *apiextensions.CustomResourceDefinitionStatus, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - allErrs = append(allErrs, ValidateCustomResourceDefinitionNames(&status.AcceptedNames, fldPath.Child("acceptedNames"))...) - return allErrs -} - -// ValidateCustomResourceDefinitionNames statically validates -func ValidateCustomResourceDefinitionNames(names *apiextensions.CustomResourceDefinitionNames, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - if errs := validationutil.IsDNS1035Label(names.Plural); len(names.Plural) > 0 && len(errs) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("plural"), names.Plural, strings.Join(errs, ","))) - } - if errs := validationutil.IsDNS1035Label(names.Singular); len(names.Singular) > 0 && len(errs) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("singular"), names.Singular, strings.Join(errs, ","))) - } - if errs := validationutil.IsDNS1035Label(strings.ToLower(names.Kind)); len(names.Kind) > 0 && len(errs) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("kind"), names.Kind, "may have mixed case, but should otherwise match: "+strings.Join(errs, ","))) - } - if errs := validationutil.IsDNS1035Label(strings.ToLower(names.ListKind)); len(names.ListKind) > 0 && len(errs) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("listKind"), names.ListKind, "may have mixed case, but should otherwise match: "+strings.Join(errs, ","))) - } - - for i, shortName := range names.ShortNames { - if errs := validationutil.IsDNS1035Label(shortName); len(errs) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("shortNames").Index(i), shortName, strings.Join(errs, ","))) - } - } - - // kind and listKind may not be the same or parsing become ambiguous - if len(names.Kind) > 0 && names.Kind == names.ListKind { - allErrs = append(allErrs, field.Invalid(fldPath.Child("listKind"), names.ListKind, "kind and listKind may not be the same")) - } - - for i, category := range names.Categories { - if errs := validationutil.IsDNS1035Label(category); len(errs) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("categories").Index(i), category, strings.Join(errs, ","))) - } - } - - return allErrs -} - -// ValidateCustomResourceColumnDefinition statically validates a printer column. -func ValidateCustomResourceColumnDefinition(col *apiextensions.CustomResourceColumnDefinition, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if len(col.Name) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("name"), "")) - } - - if len(col.Type) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("type"), fmt.Sprintf("must be one of %s", strings.Join(printerColumnDatatypes.List(), ",")))) - } else if !printerColumnDatatypes.Has(col.Type) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("type"), col.Type, fmt.Sprintf("must be one of %s", strings.Join(printerColumnDatatypes.List(), ",")))) - } - - if len(col.Format) > 0 && !customResourceColumnDefinitionFormats.Has(col.Format) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("format"), col.Format, fmt.Sprintf("must be one of %s", strings.Join(customResourceColumnDefinitionFormats.List(), ",")))) - } - - if len(col.JSONPath) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("JSONPath"), "")) - } else if errs := validateSimpleJSONPath(col.JSONPath, fldPath.Child("JSONPath")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - return allErrs -} - -// specStandardValidator applies validations for different OpenAPI specification versions. -type specStandardValidator interface { - validate(spec *apiextensions.JSONSchemaProps, fldPath *field.Path) field.ErrorList -} - -// ValidateCustomResourceDefinitionValidation statically validates -func ValidateCustomResourceDefinitionValidation(customResourceValidation *apiextensions.CustomResourceValidation, statusSubresourceEnabled bool, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if customResourceValidation == nil { - return allErrs - } - - if schema := customResourceValidation.OpenAPIV3Schema; schema != nil { - // if the status subresource is enabled, only certain fields are allowed inside the root schema. - // these fields are chosen such that, if status is extracted as properties["status"], it's validation is not lost. - if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) && statusSubresourceEnabled { - v := reflect.ValueOf(schema).Elem() - for i := 0; i < v.NumField(); i++ { - // skip zero values - if value := v.Field(i).Interface(); reflect.DeepEqual(value, reflect.Zero(reflect.TypeOf(value)).Interface()) { - continue - } - - fieldName := v.Type().Field(i).Name - - // only "object" type is valid at root of the schema since validation schema for status is extracted as properties["status"] - if fieldName == "Type" { - if schema.Type != "object" { - allErrs = append(allErrs, field.Invalid(fldPath.Child("openAPIV3Schema.type"), schema.Type, fmt.Sprintf(`only "object" is allowed as the type at the root of the schema if the status subresource is enabled`))) - break - } - continue - } - - if !allowedAtRootSchema(fieldName) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("openAPIV3Schema"), *schema, fmt.Sprintf(`only %v fields are allowed at the root of the schema if the status subresource is enabled`, allowedFieldsAtRootSchema))) - break - } - } - } - - openAPIV3Schema := &specStandardValidatorV3{} - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(schema, fldPath.Child("openAPIV3Schema"), openAPIV3Schema)...) - } - - // if validation passed otherwise, make sure we can actually construct a schema validator from this custom resource validation. - if len(allErrs) == 0 { - if _, _, err := apiservervalidation.NewSchemaValidator(customResourceValidation); err != nil { - allErrs = append(allErrs, field.Invalid(fldPath, "", fmt.Sprintf("error building validator: %v", err))) - } - } - return allErrs -} - -// ValidateCustomResourceDefinitionOpenAPISchema statically validates -func ValidateCustomResourceDefinitionOpenAPISchema(schema *apiextensions.JSONSchemaProps, fldPath *field.Path, ssv specStandardValidator) field.ErrorList { - allErrs := field.ErrorList{} - - if schema == nil { - return allErrs - } - - allErrs = append(allErrs, ssv.validate(schema, fldPath)...) - - if schema.UniqueItems == true { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("uniqueItems"), "uniqueItems cannot be set to true since the runtime complexity becomes quadratic")) - } - - // additionalProperties and properties are mutual exclusive because otherwise they - // contradict Kubernetes' API convention to ignore unknown fields. - // - // In other words: - // - properties are for structs, - // - additionalProperties are for map[string]interface{} - // - // Note: when patternProperties is added to OpenAPI some day, this will have to be - // restricted like additionalProperties. - if schema.AdditionalProperties != nil { - if len(schema.Properties) != 0 { - if schema.AdditionalProperties.Allows == false || schema.AdditionalProperties.Schema != nil { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("additionalProperties"), "additionalProperties and properties are mutual exclusive")) - } - } - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(schema.AdditionalProperties.Schema, fldPath.Child("additionalProperties"), ssv)...) - } - - if len(schema.Properties) != 0 { - for property, jsonSchema := range schema.Properties { - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(&jsonSchema, fldPath.Child("properties").Key(property), ssv)...) - } - } - - if len(schema.PatternProperties) != 0 { - for property, jsonSchema := range schema.PatternProperties { - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(&jsonSchema, fldPath.Child("patternProperties").Key(property), ssv)...) - } - } - - if schema.AdditionalItems != nil { - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(schema.AdditionalItems.Schema, fldPath.Child("additionalItems"), ssv)...) - } - - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(schema.Not, fldPath.Child("not"), ssv)...) - - if len(schema.AllOf) != 0 { - for i, jsonSchema := range schema.AllOf { - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(&jsonSchema, fldPath.Child("allOf").Index(i), ssv)...) - } - } - - if len(schema.OneOf) != 0 { - for i, jsonSchema := range schema.OneOf { - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(&jsonSchema, fldPath.Child("oneOf").Index(i), ssv)...) - } - } - - if len(schema.AnyOf) != 0 { - for i, jsonSchema := range schema.AnyOf { - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(&jsonSchema, fldPath.Child("anyOf").Index(i), ssv)...) - } - } - - if len(schema.Definitions) != 0 { - for definition, jsonSchema := range schema.Definitions { - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(&jsonSchema, fldPath.Child("definitions").Key(definition), ssv)...) - } - } - - if schema.Items != nil { - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(schema.Items.Schema, fldPath.Child("items"), ssv)...) - if len(schema.Items.JSONSchemas) != 0 { - for i, jsonSchema := range schema.Items.JSONSchemas { - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(&jsonSchema, fldPath.Child("items").Index(i), ssv)...) - } - } - } - - if schema.Dependencies != nil { - for dependency, jsonSchemaPropsOrStringArray := range schema.Dependencies { - allErrs = append(allErrs, ValidateCustomResourceDefinitionOpenAPISchema(jsonSchemaPropsOrStringArray.Schema, fldPath.Child("dependencies").Key(dependency), ssv)...) - } - } - - return allErrs -} - -type specStandardValidatorV3 struct{} - -// validate validates against OpenAPI Schema v3. -func (v *specStandardValidatorV3) validate(schema *apiextensions.JSONSchemaProps, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if schema == nil { - return allErrs - } - - if schema.Default != nil { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("default"), "default is not supported")) - } - - if schema.ID != "" { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("id"), "id is not supported")) - } - - if schema.AdditionalItems != nil { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("additionalItems"), "additionalItems is not supported")) - } - - if len(schema.PatternProperties) != 0 { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("patternProperties"), "patternProperties is not supported")) - } - - if len(schema.Definitions) != 0 { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("definitions"), "definitions is not supported")) - } - - if schema.Dependencies != nil { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("dependencies"), "dependencies is not supported")) - } - - if schema.Ref != nil { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("$ref"), "$ref is not supported")) - } - - if schema.Type == "null" { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("type"), "type cannot be set to null")) - } - - if schema.Items != nil && len(schema.Items.JSONSchemas) != 0 { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("items"), "items must be a schema object and not an array")) - } - - return allErrs -} - -// ValidateCustomResourceDefinitionSubresources statically validates -func ValidateCustomResourceDefinitionSubresources(subresources *apiextensions.CustomResourceSubresources, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if subresources == nil { - return allErrs - } - - if subresources.Scale != nil { - if len(subresources.Scale.SpecReplicasPath) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("scale.specReplicasPath"), "")) - } else { - // should be constrained json path under .spec - if errs := validateSimpleJSONPath(subresources.Scale.SpecReplicasPath, fldPath.Child("scale.specReplicasPath")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } else if !strings.HasPrefix(subresources.Scale.SpecReplicasPath, ".spec.") { - allErrs = append(allErrs, field.Invalid(fldPath.Child("scale.specReplicasPath"), subresources.Scale.SpecReplicasPath, "should be a json path under .spec")) - } - } - - if len(subresources.Scale.StatusReplicasPath) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("scale.statusReplicasPath"), "")) - } else { - // should be constrained json path under .status - if errs := validateSimpleJSONPath(subresources.Scale.StatusReplicasPath, fldPath.Child("scale.statusReplicasPath")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } else if !strings.HasPrefix(subresources.Scale.StatusReplicasPath, ".status.") { - allErrs = append(allErrs, field.Invalid(fldPath.Child("scale.statusReplicasPath"), subresources.Scale.StatusReplicasPath, "should be a json path under .status")) - } - } - - // if labelSelectorPath is present, it should be a constrained json path under .status - if subresources.Scale.LabelSelectorPath != nil && len(*subresources.Scale.LabelSelectorPath) > 0 { - if errs := validateSimpleJSONPath(*subresources.Scale.LabelSelectorPath, fldPath.Child("scale.labelSelectorPath")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } else if !strings.HasPrefix(*subresources.Scale.LabelSelectorPath, ".status.") { - allErrs = append(allErrs, field.Invalid(fldPath.Child("scale.labelSelectorPath"), subresources.Scale.LabelSelectorPath, "should be a json path under .status")) - } - } - } - - return allErrs -} - -func validateSimpleJSONPath(s string, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - switch { - case len(s) == 0: - allErrs = append(allErrs, field.Invalid(fldPath, s, "must not be empty")) - case s[0] != '.': - allErrs = append(allErrs, field.Invalid(fldPath, s, "must be a simple json path starting with .")) - case s != ".": - if cs := strings.Split(s[1:], "."); len(cs) < 1 { - allErrs = append(allErrs, field.Invalid(fldPath, s, "must be a json path in the dot notation")) - } - } - - return allErrs -} - -var allowedFieldsAtRootSchema = []string{"Description", "Type", "Format", "Title", "Maximum", "ExclusiveMaximum", "Minimum", "ExclusiveMinimum", "MaxLength", "MinLength", "Pattern", "MaxItems", "MinItems", "UniqueItems", "MultipleOf", "Required", "Items", "Properties", "ExternalDocs", "Example"} - -func allowedAtRootSchema(field string) bool { - for _, v := range allowedFieldsAtRootSchema { - if field == v { - return true - } - } - return false -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go deleted file mode 100644 index 794142b70..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go +++ /dev/null @@ -1,926 +0,0 @@ -/* -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 validation - -import ( - "testing" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/validation/field" -) - -type validationMatch struct { - path *field.Path - errorType field.ErrorType -} - -func required(path ...string) validationMatch { - return validationMatch{path: field.NewPath(path[0], path[1:]...), errorType: field.ErrorTypeRequired} -} -func invalid(path ...string) validationMatch { - return validationMatch{path: field.NewPath(path[0], path[1:]...), errorType: field.ErrorTypeInvalid} -} -func unsupported(path ...string) validationMatch { - return validationMatch{path: field.NewPath(path[0], path[1:]...), errorType: field.ErrorTypeNotSupported} -} -func immutable(path ...string) validationMatch { - return validationMatch{path: field.NewPath(path[0], path[1:]...), errorType: field.ErrorTypeInvalid} -} -func forbidden(path ...string) validationMatch { - return validationMatch{path: field.NewPath(path[0], path[1:]...), errorType: field.ErrorTypeForbidden} -} - -func (v validationMatch) matches(err *field.Error) bool { - return err.Type == v.errorType && err.Field == v.path.String() -} - -func TestValidateCustomResourceDefinition(t *testing.T) { - singleVersionList := []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: true, - }, - } - tests := []struct { - name string - resource *apiextensions.CustomResourceDefinition - errors []validationMatch - }{ - { - name: "no_storage_version", - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "plural.group.com"}, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "Plural", - ListKind: "PluralList", - }, - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: false, - }, - { - Name: "version2", - Served: true, - Storage: false, - }, - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - StoredVersions: []string{"version"}, - }, - }, - errors: []validationMatch{ - invalid("spec", "versions"), - }, - }, - { - name: "multiple_storage_version", - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "plural.group.com"}, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "Plural", - ListKind: "PluralList", - }, - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: true, - }, - { - Name: "version2", - Served: true, - Storage: true, - }, - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - StoredVersions: []string{"version"}, - }, - }, - errors: []validationMatch{ - invalid("spec", "versions"), - invalid("status", "storedVersions"), - }, - }, - { - name: "missing_storage_version_in_stored_versions", - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "plural.group.com"}, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "Plural", - ListKind: "PluralList", - }, - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: false, - }, - { - Name: "version2", - Served: true, - Storage: true, - }, - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - StoredVersions: []string{"version"}, - }, - }, - errors: []validationMatch{ - invalid("status", "storedVersions"), - }, - }, - { - name: "empty_stored_version", - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "plural.group.com"}, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "Plural", - ListKind: "PluralList", - }, - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: true, - }, - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - StoredVersions: []string{}, - }, - }, - errors: []validationMatch{ - invalid("status", "storedVersions"), - }, - }, - { - name: "mismatched name", - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "plural.not.group.com"}, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - }, - }, - }, - errors: []validationMatch{ - invalid("status", "storedVersions"), - invalid("metadata", "name"), - invalid("spec", "versions"), - required("spec", "scope"), - required("spec", "names", "singular"), - required("spec", "names", "kind"), - required("spec", "names", "listKind"), - }, - }, - { - name: "missing values", - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "plural.group.com"}, - }, - errors: []validationMatch{ - invalid("status", "storedVersions"), - invalid("metadata", "name"), - invalid("spec", "versions"), - required("spec", "group"), - required("spec", "scope"), - required("spec", "names", "plural"), - required("spec", "names", "singular"), - required("spec", "names", "kind"), - required("spec", "names", "listKind"), - }, - }, - { - name: "bad names 01", - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "plural.group"}, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group", - Version: "ve()*rsion", - Scope: apiextensions.ResourceScope("foo"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "pl()*ural", - Singular: "value()*a", - Kind: "value()*a", - ListKind: "value()*a", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "pl()*ural", - Singular: "value()*a", - Kind: "value()*a", - ListKind: "value()*a", - }, - }, - }, - errors: []validationMatch{ - invalid("status", "storedVersions"), - invalid("metadata", "name"), - invalid("spec", "group"), - unsupported("spec", "scope"), - invalid("spec", "names", "plural"), - invalid("spec", "names", "singular"), - invalid("spec", "names", "kind"), - invalid("spec", "names", "listKind"), // invalid format - invalid("spec", "names", "listKind"), // kind == listKind - invalid("status", "acceptedNames", "plural"), - invalid("status", "acceptedNames", "singular"), - invalid("status", "acceptedNames", "kind"), - invalid("status", "acceptedNames", "listKind"), // invalid format - invalid("status", "acceptedNames", "listKind"), // kind == listKind - invalid("spec", "versions"), - invalid("spec", "version"), - }, - }, - { - name: "bad names 02", - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "plural.group"}, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.c(*&om", - Version: "version", - Versions: singleVersionList, - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "matching", - ListKind: "matching", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "matching", - ListKind: "matching", - }, - StoredVersions: []string{"version"}, - }, - }, - errors: []validationMatch{ - invalid("metadata", "name"), - invalid("spec", "group"), - required("spec", "scope"), - invalid("spec", "names", "listKind"), - invalid("status", "acceptedNames", "listKind"), - }, - }, - { - name: "additionalProperties and properties forbidden", - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "plural.group.com"}, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Version: "version", - Versions: singleVersionList, - Scope: apiextensions.NamespaceScoped, - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "Plural", - ListKind: "PluralList", - }, - Validation: &apiextensions.CustomResourceValidation{ - OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ - Properties: map[string]apiextensions.JSONSchemaProps{ - "foo": {}, - }, - AdditionalProperties: &apiextensions.JSONSchemaPropsOrBool{Allows: false}, - }, - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - StoredVersions: []string{"version"}, - }, - }, - errors: []validationMatch{ - forbidden("spec", "validation", "openAPIV3Schema", "additionalProperties"), - }, - }, - { - name: "additionalProperties without properties allowed (map[string]string)", - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "plural.group.com"}, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Version: "version", - Versions: singleVersionList, - Scope: apiextensions.NamespaceScoped, - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "Plural", - ListKind: "PluralList", - }, - Validation: &apiextensions.CustomResourceValidation{ - OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ - AdditionalProperties: &apiextensions.JSONSchemaPropsOrBool{ - Allows: true, - Schema: &apiextensions.JSONSchemaProps{ - Type: "string", - }, - }, - }, - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - StoredVersions: []string{"version"}, - }, - }, - errors: []validationMatch{}, - }, - } - - for _, tc := range tests { - errs := ValidateCustomResourceDefinition(tc.resource) - seenErrs := make([]bool, len(errs)) - - for _, expectedError := range tc.errors { - found := false - for i, err := range errs { - if expectedError.matches(err) && !seenErrs[i] { - found = true - seenErrs[i] = true - break - } - } - - if !found { - t.Errorf("%s: expected %v at %v, got %v", tc.name, expectedError.errorType, expectedError.path.String(), errs) - } - } - - for i, seen := range seenErrs { - if !seen { - t.Errorf("%s: unexpected error: %v", tc.name, errs[i]) - } - } - } -} - -func TestValidateCustomResourceDefinitionUpdate(t *testing.T) { - tests := []struct { - name string - old *apiextensions.CustomResourceDefinition - resource *apiextensions.CustomResourceDefinition - errors []validationMatch - }{ - { - name: "unchanged", - old: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "plural.group.com", - ResourceVersion: "42", - }, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Version: "version", - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: true, - }, - }, - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - }, - }, - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "plural.group.com", - ResourceVersion: "42", - }, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Version: "version", - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: true, - }, - }, - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - StoredVersions: []string{"version"}, - }, - }, - errors: []validationMatch{}, - }, - { - name: "unchanged-established", - old: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "plural.group.com", - ResourceVersion: "42", - }, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Version: "version", - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: true, - }, - }, - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - Conditions: []apiextensions.CustomResourceDefinitionCondition{ - {Type: apiextensions.Established, Status: apiextensions.ConditionTrue}, - }, - }, - }, - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "plural.group.com", - ResourceVersion: "42", - }, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Version: "version", - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: true, - }, - }, - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - StoredVersions: []string{"version"}, - }, - }, - errors: []validationMatch{}, - }, - { - name: "version-deleted", - old: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "plural.group.com", - ResourceVersion: "42", - }, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Version: "version", - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: true, - }, - { - Name: "version2", - Served: true, - Storage: false, - }, - }, - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - StoredVersions: []string{"version", "version2"}, - Conditions: []apiextensions.CustomResourceDefinitionCondition{ - {Type: apiextensions.Established, Status: apiextensions.ConditionTrue}, - }, - }, - }, - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "plural.group.com", - ResourceVersion: "42", - }, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Version: "version", - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: true, - }, - }, - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - StoredVersions: []string{"version", "version2"}, - }, - }, - errors: []validationMatch{ - invalid("status", "storedVersions[1]"), - }, - }, - { - name: "changes", - old: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "plural.group.com", - ResourceVersion: "42", - }, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Version: "version", - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: true, - }, - }, - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - Conditions: []apiextensions.CustomResourceDefinitionCondition{ - {Type: apiextensions.Established, Status: apiextensions.ConditionFalse}, - }, - }, - }, - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "plural.group.com", - ResourceVersion: "42", - }, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "abc.com", - Version: "version2", - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version2", - Served: true, - Storage: true, - }, - }, - Scope: apiextensions.ResourceScope("Namespaced"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural2", - Singular: "singular2", - Kind: "kind2", - ListKind: "listkind2", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural2", - Singular: "singular2", - Kind: "kind2", - ListKind: "listkind2", - }, - StoredVersions: []string{"version2"}, - }, - }, - errors: []validationMatch{ - immutable("spec", "group"), - immutable("spec", "names", "plural"), - }, - }, - { - name: "changes-established", - old: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "plural.group.com", - ResourceVersion: "42", - }, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "group.com", - Version: "version", - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version", - Served: true, - Storage: true, - }, - }, - Scope: apiextensions.ResourceScope("Cluster"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural", - Singular: "singular", - Kind: "kind", - ListKind: "listkind", - }, - Conditions: []apiextensions.CustomResourceDefinitionCondition{ - {Type: apiextensions.Established, Status: apiextensions.ConditionTrue}, - }, - }, - }, - resource: &apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "plural.group.com", - ResourceVersion: "42", - }, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: "abc.com", - Version: "version2", - Versions: []apiextensions.CustomResourceDefinitionVersion{ - { - Name: "version2", - Served: true, - Storage: true, - }, - }, - Scope: apiextensions.ResourceScope("Namespaced"), - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural2", - Singular: "singular2", - Kind: "kind2", - ListKind: "listkind2", - }, - }, - Status: apiextensions.CustomResourceDefinitionStatus{ - AcceptedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "plural2", - Singular: "singular2", - Kind: "kind2", - ListKind: "listkind2", - }, - StoredVersions: []string{"version2"}, - }, - }, - errors: []validationMatch{ - immutable("spec", "group"), - immutable("spec", "scope"), - immutable("spec", "names", "kind"), - immutable("spec", "names", "plural"), - }, - }, - } - - for _, tc := range tests { - errs := ValidateCustomResourceDefinitionUpdate(tc.resource, tc.old) - seenErrs := make([]bool, len(errs)) - - for _, expectedError := range tc.errors { - found := false - for i, err := range errs { - if expectedError.matches(err) && !seenErrs[i] { - found = true - seenErrs[i] = true - break - } - } - - if !found { - t.Errorf("%s: expected %v at %v, got %v", tc.name, expectedError.errorType, expectedError.path.String(), errs) - } - } - - for i, seen := range seenErrs { - if !seen { - t.Errorf("%s: unexpected error: %v", tc.name, errs[i]) - } - } - } -} - -func TestValidateCustomResourceDefinitionValidation(t *testing.T) { - tests := []struct { - name string - input apiextensions.CustomResourceValidation - statusEnabled bool - wantError bool - }{ - { - name: "empty", - input: apiextensions.CustomResourceValidation{}, - wantError: false, - }, - { - name: "empty with status", - input: apiextensions.CustomResourceValidation{}, - statusEnabled: true, - wantError: false, - }, - { - name: "root type without status", - input: apiextensions.CustomResourceValidation{ - OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ - Type: "string", - }, - }, - statusEnabled: false, - wantError: false, - }, - { - name: "root type having invalid value, with status", - input: apiextensions.CustomResourceValidation{ - OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ - Type: "string", - }, - }, - statusEnabled: true, - wantError: true, - }, - { - name: "non-allowed root field with status", - input: apiextensions.CustomResourceValidation{ - OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ - AnyOf: []apiextensions.JSONSchemaProps{ - { - Description: "First schema", - }, - { - Description: "Second schema", - }, - }, - }, - }, - statusEnabled: true, - wantError: true, - }, - { - name: "all allowed fields at the root of the schema with status", - input: apiextensions.CustomResourceValidation{ - OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ - Description: "This is a description", - Type: "object", - Format: "date-time", - Title: "This is a title", - Maximum: float64Ptr(10), - ExclusiveMaximum: true, - Minimum: float64Ptr(5), - ExclusiveMinimum: true, - MaxLength: int64Ptr(10), - MinLength: int64Ptr(5), - Pattern: "^[a-z]$", - MaxItems: int64Ptr(10), - MinItems: int64Ptr(5), - MultipleOf: float64Ptr(3), - Required: []string{"spec", "status"}, - Items: &apiextensions.JSONSchemaPropsOrArray{ - Schema: &apiextensions.JSONSchemaProps{ - Description: "This is a schema nested under Items", - }, - }, - Properties: map[string]apiextensions.JSONSchemaProps{ - "spec": {}, - "status": {}, - }, - ExternalDocs: &apiextensions.ExternalDocumentation{ - Description: "This is an external documentation description", - }, - Example: &example, - }, - }, - statusEnabled: true, - wantError: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := ValidateCustomResourceDefinitionValidation(&tt.input, tt.statusEnabled, field.NewPath("spec", "validation")) - if !tt.wantError && len(got) > 0 { - t.Errorf("Expected no error, but got: %v", got) - } else if tt.wantError && len(got) == 0 { - t.Error("Expected error, but got none") - } - }) - } -} - -var example = apiextensions.JSON(`"This is an example"`) - -func float64Ptr(f float64) *float64 { - return &f -} - -func int64Ptr(f int64) *int64 { - return &f -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go deleted file mode 100644 index 50e7ee880..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go +++ /dev/null @@ -1,449 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 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. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package apiextensions - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceColumnDefinition) DeepCopyInto(out *CustomResourceColumnDefinition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceColumnDefinition. -func (in *CustomResourceColumnDefinition) DeepCopy() *CustomResourceColumnDefinition { - if in == nil { - return nil - } - out := new(CustomResourceColumnDefinition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinition) DeepCopyInto(out *CustomResourceDefinition) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinition. -func (in *CustomResourceDefinition) DeepCopy() *CustomResourceDefinition { - if in == nil { - return nil - } - out := new(CustomResourceDefinition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CustomResourceDefinition) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionCondition) DeepCopyInto(out *CustomResourceDefinitionCondition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionCondition. -func (in *CustomResourceDefinitionCondition) DeepCopy() *CustomResourceDefinitionCondition { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionList) DeepCopyInto(out *CustomResourceDefinitionList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CustomResourceDefinition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionList. -func (in *CustomResourceDefinitionList) DeepCopy() *CustomResourceDefinitionList { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CustomResourceDefinitionList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionNames) DeepCopyInto(out *CustomResourceDefinitionNames) { - *out = *in - if in.ShortNames != nil { - in, out := &in.ShortNames, &out.ShortNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Categories != nil { - in, out := &in.Categories, &out.Categories - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionNames. -func (in *CustomResourceDefinitionNames) DeepCopy() *CustomResourceDefinitionNames { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionNames) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionSpec) DeepCopyInto(out *CustomResourceDefinitionSpec) { - *out = *in - in.Names.DeepCopyInto(&out.Names) - if in.Validation != nil { - in, out := &in.Validation, &out.Validation - *out = new(CustomResourceValidation) - (*in).DeepCopyInto(*out) - } - if in.Subresources != nil { - in, out := &in.Subresources, &out.Subresources - *out = new(CustomResourceSubresources) - (*in).DeepCopyInto(*out) - } - if in.Versions != nil { - in, out := &in.Versions, &out.Versions - *out = make([]CustomResourceDefinitionVersion, len(*in)) - copy(*out, *in) - } - if in.AdditionalPrinterColumns != nil { - in, out := &in.AdditionalPrinterColumns, &out.AdditionalPrinterColumns - *out = make([]CustomResourceColumnDefinition, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionSpec. -func (in *CustomResourceDefinitionSpec) DeepCopy() *CustomResourceDefinitionSpec { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionStatus) DeepCopyInto(out *CustomResourceDefinitionStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]CustomResourceDefinitionCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.AcceptedNames.DeepCopyInto(&out.AcceptedNames) - if in.StoredVersions != nil { - in, out := &in.StoredVersions, &out.StoredVersions - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionStatus. -func (in *CustomResourceDefinitionStatus) DeepCopy() *CustomResourceDefinitionStatus { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitionVersion) DeepCopyInto(out *CustomResourceDefinitionVersion) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionVersion. -func (in *CustomResourceDefinitionVersion) DeepCopy() *CustomResourceDefinitionVersion { - if in == nil { - return nil - } - out := new(CustomResourceDefinitionVersion) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceSubresourceScale) DeepCopyInto(out *CustomResourceSubresourceScale) { - *out = *in - if in.LabelSelectorPath != nil { - in, out := &in.LabelSelectorPath, &out.LabelSelectorPath - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceSubresourceScale. -func (in *CustomResourceSubresourceScale) DeepCopy() *CustomResourceSubresourceScale { - if in == nil { - return nil - } - out := new(CustomResourceSubresourceScale) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceSubresourceStatus) DeepCopyInto(out *CustomResourceSubresourceStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceSubresourceStatus. -func (in *CustomResourceSubresourceStatus) DeepCopy() *CustomResourceSubresourceStatus { - if in == nil { - return nil - } - out := new(CustomResourceSubresourceStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceSubresources) DeepCopyInto(out *CustomResourceSubresources) { - *out = *in - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(CustomResourceSubresourceStatus) - **out = **in - } - if in.Scale != nil { - in, out := &in.Scale, &out.Scale - *out = new(CustomResourceSubresourceScale) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceSubresources. -func (in *CustomResourceSubresources) DeepCopy() *CustomResourceSubresources { - if in == nil { - return nil - } - out := new(CustomResourceSubresources) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceValidation) DeepCopyInto(out *CustomResourceValidation) { - *out = *in - if in.OpenAPIV3Schema != nil { - in, out := &in.OpenAPIV3Schema, &out.OpenAPIV3Schema - *out = (*in).DeepCopy() - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceValidation. -func (in *CustomResourceValidation) DeepCopy() *CustomResourceValidation { - if in == nil { - return nil - } - out := new(CustomResourceValidation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalDocumentation) DeepCopyInto(out *ExternalDocumentation) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalDocumentation. -func (in *ExternalDocumentation) DeepCopy() *ExternalDocumentation { - if in == nil { - return nil - } - out := new(ExternalDocumentation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in JSONSchemaDefinitions) DeepCopyInto(out *JSONSchemaDefinitions) { - { - in := &in - *out = make(JSONSchemaDefinitions, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - return - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONSchemaDefinitions. -func (in JSONSchemaDefinitions) DeepCopy() JSONSchemaDefinitions { - if in == nil { - return nil - } - out := new(JSONSchemaDefinitions) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in JSONSchemaDependencies) DeepCopyInto(out *JSONSchemaDependencies) { - { - in := &in - *out = make(JSONSchemaDependencies, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - return - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONSchemaDependencies. -func (in JSONSchemaDependencies) DeepCopy() JSONSchemaDependencies { - if in == nil { - return nil - } - out := new(JSONSchemaDependencies) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JSONSchemaProps) DeepCopyInto(out *JSONSchemaProps) { - clone := in.DeepCopy() - *out = *clone - return -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JSONSchemaPropsOrArray) DeepCopyInto(out *JSONSchemaPropsOrArray) { - *out = *in - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = (*in).DeepCopy() - } - if in.JSONSchemas != nil { - in, out := &in.JSONSchemas, &out.JSONSchemas - *out = make([]JSONSchemaProps, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONSchemaPropsOrArray. -func (in *JSONSchemaPropsOrArray) DeepCopy() *JSONSchemaPropsOrArray { - if in == nil { - return nil - } - out := new(JSONSchemaPropsOrArray) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JSONSchemaPropsOrBool) DeepCopyInto(out *JSONSchemaPropsOrBool) { - *out = *in - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = (*in).DeepCopy() - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONSchemaPropsOrBool. -func (in *JSONSchemaPropsOrBool) DeepCopy() *JSONSchemaPropsOrBool { - if in == nil { - return nil - } - out := new(JSONSchemaPropsOrBool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JSONSchemaPropsOrStringArray) DeepCopyInto(out *JSONSchemaPropsOrStringArray) { - *out = *in - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = (*in).DeepCopy() - } - if in.Property != nil { - in, out := &in.Property, &out.Property - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONSchemaPropsOrStringArray. -func (in *JSONSchemaPropsOrStringArray) DeepCopy() *JSONSchemaPropsOrStringArray { - if in == nil { - return nil - } - out := new(JSONSchemaPropsOrStringArray) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/apiserver.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/apiserver.go deleted file mode 100644 index f1fc89ba9..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/apiserver.go +++ /dev/null @@ -1,214 +0,0 @@ -/* -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 apiserver - -import ( - "fmt" - "net/http" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/apimachinery/pkg/version" - "k8s.io/apiserver/pkg/endpoints/discovery" - genericregistry "k8s.io/apiserver/pkg/registry/generic" - "k8s.io/apiserver/pkg/registry/rest" - genericapiserver "k8s.io/apiserver/pkg/server" - serverstorage "k8s.io/apiserver/pkg/server/storage" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install" - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset" - internalinformers "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion" - "k8s.io/apiextensions-apiserver/pkg/controller/establish" - "k8s.io/apiextensions-apiserver/pkg/controller/finalizer" - "k8s.io/apiextensions-apiserver/pkg/controller/status" - "k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition" - - _ "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - _ "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions" - _ "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion" -) - -var ( - Scheme = runtime.NewScheme() - Codecs = serializer.NewCodecFactory(Scheme) - - // if you modify this, make sure you update the crEncoder - unversionedVersion = schema.GroupVersion{Group: "", Version: "v1"} - unversionedTypes = []runtime.Object{ - &metav1.Status{}, - &metav1.WatchEvent{}, - &metav1.APIVersions{}, - &metav1.APIGroupList{}, - &metav1.APIGroup{}, - &metav1.APIResourceList{}, - } -) - -func init() { - install.Install(Scheme) - - // we need to add the options to empty v1 - metav1.AddToGroupVersion(Scheme, schema.GroupVersion{Group: "", Version: "v1"}) - - Scheme.AddUnversionedTypes(unversionedVersion, unversionedTypes...) -} - -type ExtraConfig struct { - CRDRESTOptionsGetter genericregistry.RESTOptionsGetter - - // MasterCount is used to detect whether cluster is HA, and if it is - // the CRD Establishing will be hold by 5 seconds. - MasterCount int -} - -type Config struct { - GenericConfig *genericapiserver.RecommendedConfig - ExtraConfig ExtraConfig -} - -type completedConfig struct { - GenericConfig genericapiserver.CompletedConfig - ExtraConfig *ExtraConfig -} - -type CompletedConfig struct { - // Embed a private pointer that cannot be instantiated outside of this package. - *completedConfig -} - -type CustomResourceDefinitions struct { - GenericAPIServer *genericapiserver.GenericAPIServer - - // provided for easier embedding - Informers internalinformers.SharedInformerFactory -} - -// Complete fills in any fields not set that are required to have valid data. It's mutating the receiver. -func (cfg *Config) Complete() CompletedConfig { - c := completedConfig{ - cfg.GenericConfig.Complete(), - &cfg.ExtraConfig, - } - - c.GenericConfig.EnableDiscovery = false - c.GenericConfig.Version = &version.Info{ - Major: "0", - Minor: "1", - } - - return CompletedConfig{&c} -} - -// New returns a new instance of CustomResourceDefinitions from the given config. -func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget) (*CustomResourceDefinitions, error) { - genericServer, err := c.GenericConfig.New("apiextensions-apiserver", delegationTarget) - if err != nil { - return nil, err - } - - s := &CustomResourceDefinitions{ - GenericAPIServer: genericServer, - } - - apiResourceConfig := c.GenericConfig.MergedResourceConfig - apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(apiextensions.GroupName, Scheme, metav1.ParameterCodec, Codecs) - if apiResourceConfig.VersionEnabled(v1beta1.SchemeGroupVersion) { - storage := map[string]rest.Storage{} - // customresourcedefinitions - customResourceDefintionStorage := customresourcedefinition.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter) - storage["customresourcedefinitions"] = customResourceDefintionStorage - storage["customresourcedefinitions/status"] = customresourcedefinition.NewStatusREST(Scheme, customResourceDefintionStorage) - - apiGroupInfo.VersionedResourcesStorageMap["v1beta1"] = storage - } - - if err := s.GenericAPIServer.InstallAPIGroup(&apiGroupInfo); err != nil { - return nil, err - } - - crdClient, err := internalclientset.NewForConfig(s.GenericAPIServer.LoopbackClientConfig) - if err != nil { - // it's really bad that this is leaking here, but until we can fix the test (which I'm pretty sure isn't even testing what it wants to test), - // we need to be able to move forward - return nil, fmt.Errorf("failed to create clientset: %v", err) - } - s.Informers = internalinformers.NewSharedInformerFactory(crdClient, 5*time.Minute) - - delegateHandler := delegationTarget.UnprotectedHandler() - if delegateHandler == nil { - delegateHandler = http.NotFoundHandler() - } - - versionDiscoveryHandler := &versionDiscoveryHandler{ - discovery: map[schema.GroupVersion]*discovery.APIVersionHandler{}, - delegate: delegateHandler, - } - groupDiscoveryHandler := &groupDiscoveryHandler{ - discovery: map[string]*discovery.APIGroupHandler{}, - delegate: delegateHandler, - } - establishingController := establish.NewEstablishingController(s.Informers.Apiextensions().InternalVersion().CustomResourceDefinitions(), crdClient.Apiextensions()) - crdHandler := NewCustomResourceDefinitionHandler( - versionDiscoveryHandler, - groupDiscoveryHandler, - s.Informers.Apiextensions().InternalVersion().CustomResourceDefinitions(), - delegateHandler, - c.ExtraConfig.CRDRESTOptionsGetter, - c.GenericConfig.AdmissionControl, - establishingController, - c.ExtraConfig.MasterCount, - ) - s.GenericAPIServer.Handler.NonGoRestfulMux.Handle("/apis", crdHandler) - s.GenericAPIServer.Handler.NonGoRestfulMux.HandlePrefix("/apis/", crdHandler) - - crdController := NewDiscoveryController(s.Informers.Apiextensions().InternalVersion().CustomResourceDefinitions(), versionDiscoveryHandler, groupDiscoveryHandler) - namingController := status.NewNamingConditionController(s.Informers.Apiextensions().InternalVersion().CustomResourceDefinitions(), crdClient.Apiextensions()) - finalizingController := finalizer.NewCRDFinalizer( - s.Informers.Apiextensions().InternalVersion().CustomResourceDefinitions(), - crdClient.Apiextensions(), - crdHandler, - ) - - s.GenericAPIServer.AddPostStartHook("start-apiextensions-informers", func(context genericapiserver.PostStartHookContext) error { - s.Informers.Start(context.StopCh) - return nil - }) - s.GenericAPIServer.AddPostStartHook("start-apiextensions-controllers", func(context genericapiserver.PostStartHookContext) error { - go crdController.Run(context.StopCh) - go namingController.Run(context.StopCh) - go establishingController.Run(context.StopCh) - go finalizingController.Run(5, context.StopCh) - return nil - }) - - return s, nil -} - -func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig { - ret := serverstorage.NewResourceConfig() - // NOTE: GroupVersions listed here will be enabled by default. Don't put alpha versions in the list. - ret.EnableVersions( - v1beta1.SchemeGroupVersion, - ) - - return ret -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/converter.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/converter.go deleted file mode 100644 index a66f82969..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/converter.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -Copyright 2018 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 conversion - -import ( - "fmt" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// NewCRDConverter returns a new CRD converter based on the conversion settings in crd object. -func NewCRDConverter(crd *apiextensions.CustomResourceDefinition) (safe, unsafe runtime.ObjectConvertor) { - validVersions := map[schema.GroupVersion]bool{} - for _, version := range crd.Spec.Versions { - validVersions[schema.GroupVersion{Group: crd.Spec.Group, Version: version.Name}] = true - } - - // The only converter right now is nopConverter. More converters will be returned based on the - // CRD object when they introduced. - unsafe = &crdConverter{ - clusterScoped: crd.Spec.Scope == apiextensions.ClusterScoped, - delegate: &nopConverter{ - validVersions: validVersions, - }, - } - return &safeConverterWrapper{unsafe}, unsafe -} - -var _ runtime.ObjectConvertor = &crdConverter{} - -// crdConverter extends the delegate with generic CRD conversion behaviour. The delegate will implement the -// user defined conversion strategy given in the CustomResourceDefinition. -type crdConverter struct { - delegate runtime.ObjectConvertor - clusterScoped bool -} - -func (c *crdConverter) ConvertFieldLabel(gvk schema.GroupVersionKind, label, value string) (string, string, error) { - // We currently only support metadata.namespace and metadata.name. - switch { - case label == "metadata.name": - return label, value, nil - case !c.clusterScoped && label == "metadata.namespace": - return label, value, nil - default: - return "", "", fmt.Errorf("field label not supported: %s", label) - } -} - -func (c *crdConverter) Convert(in, out, context interface{}) error { - return c.delegate.Convert(in, out, context) -} - -// ConvertToVersion converts in object to the given gvk in place and returns the same `in` object. -func (c *crdConverter) ConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error) { - // Run the converter on the list items instead of list itself - if list, ok := in.(*unstructured.UnstructuredList); ok { - for i := range list.Items { - obj, err := c.delegate.ConvertToVersion(&list.Items[i], target) - if err != nil { - return nil, err - } - - u, ok := obj.(*unstructured.Unstructured) - if !ok { - return nil, fmt.Errorf("output type %T in not valid for unstructured conversion", obj) - } - list.Items[i] = *u - } - return list, nil - } - - return c.delegate.ConvertToVersion(in, target) -} - -// safeConverterWrapper is a wrapper over an unsafe object converter that makes copy of the input and then delegate to the unsafe converter. -type safeConverterWrapper struct { - unsafe runtime.ObjectConvertor -} - -var _ runtime.ObjectConvertor = &nopConverter{} - -// ConvertFieldLabel delegate the call to the unsafe converter. -func (c *safeConverterWrapper) ConvertFieldLabel(gvk schema.GroupVersionKind, label, value string) (string, string, error) { - return c.unsafe.ConvertFieldLabel(gvk, label, value) -} - -// Convert makes a copy of in object and then delegate the call to the unsafe converter. -func (c *safeConverterWrapper) Convert(in, out, context interface{}) error { - inObject, ok := in.(runtime.Object) - if !ok { - return fmt.Errorf("input type %T in not valid for object conversion", in) - } - return c.unsafe.Convert(inObject.DeepCopyObject(), out, context) -} - -// ConvertToVersion makes a copy of in object and then delegate the call to the unsafe converter. -func (c *safeConverterWrapper) ConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error) { - return c.unsafe.ConvertToVersion(in.DeepCopyObject(), target) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/nop_converter.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/nop_converter.go deleted file mode 100644 index 7fae81375..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/nop_converter.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2018 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 conversion - -import ( - "errors" - "fmt" - - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// nopConverter is a converter that only sets the apiVersion fields, but does not real conversion. -type nopConverter struct { - validVersions map[schema.GroupVersion]bool -} - -var _ runtime.ObjectConvertor = &nopConverter{} - -func (nopConverter) ConvertFieldLabel(gvk schema.GroupVersionKind, label, value string) (string, string, error) { - return "", "", errors.New("unstructured cannot convert field labels") -} - -func (c *nopConverter) Convert(in, out, context interface{}) error { - unstructIn, ok := in.(*unstructured.Unstructured) - if !ok { - return fmt.Errorf("input type %T in not valid for unstructured conversion", in) - } - - unstructOut, ok := out.(*unstructured.Unstructured) - if !ok { - return fmt.Errorf("output type %T in not valid for unstructured conversion", out) - } - - outGVK := unstructOut.GroupVersionKind() - if !c.validVersions[outGVK.GroupVersion()] { - return fmt.Errorf("request to convert CRD from an invalid group/version: %s", outGVK.String()) - } - inGVK := unstructIn.GroupVersionKind() - if !c.validVersions[inGVK.GroupVersion()] { - return fmt.Errorf("request to convert CRD to an invalid group/version: %s", inGVK.String()) - } - - unstructOut.SetUnstructuredContent(unstructIn.UnstructuredContent()) - _, err := c.ConvertToVersion(unstructOut, outGVK.GroupVersion()) - if err != nil { - return err - } - return nil -} - -func (c *nopConverter) ConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error) { - kind := in.GetObjectKind().GroupVersionKind() - gvk, ok := target.KindForGroupVersionKinds([]schema.GroupVersionKind{kind}) - if !ok { - // TODO: should this be a typed error? - return nil, fmt.Errorf("%v is unstructured and is not suitable for converting to %q", kind, target) - } - if !c.validVersions[gvk.GroupVersion()] { - return nil, fmt.Errorf("request to convert CRD to an invalid group/version: %s", gvk.String()) - } - in.GetObjectKind().SetGroupVersionKind(gvk) - return in, nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery.go deleted file mode 100644 index f40c33791..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -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 apiserver - -import ( - "net/http" - "strings" - "sync" - - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apiserver/pkg/endpoints/discovery" -) - -type versionDiscoveryHandler struct { - // TODO, writing is infrequent, optimize this - discoveryLock sync.RWMutex - discovery map[schema.GroupVersion]*discovery.APIVersionHandler - - delegate http.Handler -} - -func (r *versionDiscoveryHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { - pathParts := splitPath(req.URL.Path) - // only match /apis// - if len(pathParts) != 3 || pathParts[0] != "apis" { - r.delegate.ServeHTTP(w, req) - return - } - discovery, ok := r.getDiscovery(schema.GroupVersion{Group: pathParts[1], Version: pathParts[2]}) - if !ok { - r.delegate.ServeHTTP(w, req) - return - } - - discovery.ServeHTTP(w, req) -} - -func (r *versionDiscoveryHandler) getDiscovery(gv schema.GroupVersion) (*discovery.APIVersionHandler, bool) { - r.discoveryLock.RLock() - defer r.discoveryLock.RUnlock() - - ret, ok := r.discovery[gv] - return ret, ok -} - -func (r *versionDiscoveryHandler) setDiscovery(gv schema.GroupVersion, discovery *discovery.APIVersionHandler) { - r.discoveryLock.Lock() - defer r.discoveryLock.Unlock() - - r.discovery[gv] = discovery -} - -func (r *versionDiscoveryHandler) unsetDiscovery(gv schema.GroupVersion) { - r.discoveryLock.Lock() - defer r.discoveryLock.Unlock() - - delete(r.discovery, gv) -} - -type groupDiscoveryHandler struct { - // TODO, writing is infrequent, optimize this - discoveryLock sync.RWMutex - discovery map[string]*discovery.APIGroupHandler - - delegate http.Handler -} - -func (r *groupDiscoveryHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { - pathParts := splitPath(req.URL.Path) - // only match /apis/ - if len(pathParts) != 2 || pathParts[0] != "apis" { - r.delegate.ServeHTTP(w, req) - return - } - discovery, ok := r.getDiscovery(pathParts[1]) - if !ok { - r.delegate.ServeHTTP(w, req) - return - } - - discovery.ServeHTTP(w, req) -} - -func (r *groupDiscoveryHandler) getDiscovery(group string) (*discovery.APIGroupHandler, bool) { - r.discoveryLock.RLock() - defer r.discoveryLock.RUnlock() - - ret, ok := r.discovery[group] - return ret, ok -} - -func (r *groupDiscoveryHandler) setDiscovery(group string, discovery *discovery.APIGroupHandler) { - r.discoveryLock.Lock() - defer r.discoveryLock.Unlock() - - r.discovery[group] = discovery -} - -func (r *groupDiscoveryHandler) unsetDiscovery(group string) { - r.discoveryLock.Lock() - defer r.discoveryLock.Unlock() - - delete(r.discovery, group) -} - -// splitPath returns the segments for a URL path. -func splitPath(path string) []string { - path = strings.Trim(path, "/") - if path == "" { - return []string{} - } - return strings.Split(path, "/") -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller.go deleted file mode 100644 index e3b3d0a44..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller.go +++ /dev/null @@ -1,275 +0,0 @@ -/* -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 apiserver - -import ( - "fmt" - "sort" - "time" - - "github.com/golang/glog" - - autoscaling "k8s.io/api/autoscaling/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime/schema" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/version" - "k8s.io/apiserver/pkg/endpoints/discovery" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/util/workqueue" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - informers "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion" - listers "k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion" -) - -type DiscoveryController struct { - versionHandler *versionDiscoveryHandler - groupHandler *groupDiscoveryHandler - - crdLister listers.CustomResourceDefinitionLister - crdsSynced cache.InformerSynced - - // To allow injection for testing. - syncFn func(version schema.GroupVersion) error - - queue workqueue.RateLimitingInterface -} - -func NewDiscoveryController(crdInformer informers.CustomResourceDefinitionInformer, versionHandler *versionDiscoveryHandler, groupHandler *groupDiscoveryHandler) *DiscoveryController { - c := &DiscoveryController{ - versionHandler: versionHandler, - groupHandler: groupHandler, - crdLister: crdInformer.Lister(), - crdsSynced: crdInformer.Informer().HasSynced, - - queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "DiscoveryController"), - } - - crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: c.addCustomResourceDefinition, - UpdateFunc: c.updateCustomResourceDefinition, - DeleteFunc: c.deleteCustomResourceDefinition, - }) - - c.syncFn = c.sync - - return c -} - -func (c *DiscoveryController) sync(version schema.GroupVersion) error { - - apiVersionsForDiscovery := []metav1.GroupVersionForDiscovery{} - apiResourcesForDiscovery := []metav1.APIResource{} - versionsForDiscoveryMap := map[metav1.GroupVersion]bool{} - - crds, err := c.crdLister.List(labels.Everything()) - if err != nil { - return err - } - foundVersion := false - foundGroup := false - for _, crd := range crds { - if !apiextensions.IsCRDConditionTrue(crd, apiextensions.Established) { - continue - } - - if crd.Spec.Group != version.Group { - continue - } - - foundThisVersion := false - for _, v := range crd.Spec.Versions { - if !v.Served { - continue - } - // If there is any Served version, that means the group should show up in discovery - foundGroup = true - - gv := metav1.GroupVersion{Group: crd.Spec.Group, Version: v.Name} - if !versionsForDiscoveryMap[gv] { - versionsForDiscoveryMap[gv] = true - apiVersionsForDiscovery = append(apiVersionsForDiscovery, metav1.GroupVersionForDiscovery{ - GroupVersion: crd.Spec.Group + "/" + v.Name, - Version: v.Name, - }) - } - if v.Name == version.Version { - foundThisVersion = true - } - } - - if !foundThisVersion { - continue - } - foundVersion = true - - verbs := metav1.Verbs([]string{"delete", "deletecollection", "get", "list", "patch", "create", "update", "watch"}) - // if we're terminating we don't allow some verbs - if apiextensions.IsCRDConditionTrue(crd, apiextensions.Terminating) { - verbs = metav1.Verbs([]string{"delete", "deletecollection", "get", "list", "watch"}) - } - - apiResourcesForDiscovery = append(apiResourcesForDiscovery, metav1.APIResource{ - Name: crd.Status.AcceptedNames.Plural, - SingularName: crd.Status.AcceptedNames.Singular, - Namespaced: crd.Spec.Scope == apiextensions.NamespaceScoped, - Kind: crd.Status.AcceptedNames.Kind, - Verbs: verbs, - ShortNames: crd.Status.AcceptedNames.ShortNames, - Categories: crd.Status.AcceptedNames.Categories, - }) - - if crd.Spec.Subresources != nil && crd.Spec.Subresources.Status != nil { - apiResourcesForDiscovery = append(apiResourcesForDiscovery, metav1.APIResource{ - Name: crd.Status.AcceptedNames.Plural + "/status", - Namespaced: crd.Spec.Scope == apiextensions.NamespaceScoped, - Kind: crd.Status.AcceptedNames.Kind, - Verbs: metav1.Verbs([]string{"get", "patch", "update"}), - }) - } - - if crd.Spec.Subresources != nil && crd.Spec.Subresources.Scale != nil { - apiResourcesForDiscovery = append(apiResourcesForDiscovery, metav1.APIResource{ - Group: autoscaling.GroupName, - Version: "v1", - Kind: "Scale", - Name: crd.Status.AcceptedNames.Plural + "/scale", - Namespaced: crd.Spec.Scope == apiextensions.NamespaceScoped, - Verbs: metav1.Verbs([]string{"get", "patch", "update"}), - }) - } - } - - if !foundGroup { - c.groupHandler.unsetDiscovery(version.Group) - c.versionHandler.unsetDiscovery(version) - return nil - } - - sortGroupDiscoveryByKubeAwareVersion(apiVersionsForDiscovery) - - apiGroup := metav1.APIGroup{ - Name: version.Group, - Versions: apiVersionsForDiscovery, - // the preferred versions for a group is the first item in - // apiVersionsForDiscovery after it put in the right ordered - PreferredVersion: apiVersionsForDiscovery[0], - } - c.groupHandler.setDiscovery(version.Group, discovery.NewAPIGroupHandler(Codecs, apiGroup)) - - if !foundVersion { - c.versionHandler.unsetDiscovery(version) - return nil - } - c.versionHandler.setDiscovery(version, discovery.NewAPIVersionHandler(Codecs, version, discovery.APIResourceListerFunc(func() []metav1.APIResource { - return apiResourcesForDiscovery - }))) - - return nil -} - -func sortGroupDiscoveryByKubeAwareVersion(gd []metav1.GroupVersionForDiscovery) { - sort.Slice(gd, func(i, j int) bool { - return version.CompareKubeAwareVersionStrings(gd[i].Version, gd[j].Version) > 0 - }) -} - -func (c *DiscoveryController) Run(stopCh <-chan struct{}) { - defer utilruntime.HandleCrash() - defer c.queue.ShutDown() - defer glog.Infof("Shutting down DiscoveryController") - - glog.Infof("Starting DiscoveryController") - - if !cache.WaitForCacheSync(stopCh, c.crdsSynced) { - utilruntime.HandleError(fmt.Errorf("timed out waiting for caches to sync")) - return - } - - // only start one worker thread since its a slow moving API - go wait.Until(c.runWorker, time.Second, stopCh) - - <-stopCh -} - -func (c *DiscoveryController) runWorker() { - for c.processNextWorkItem() { - } -} - -// processNextWorkItem deals with one key off the queue. It returns false when it's time to quit. -func (c *DiscoveryController) processNextWorkItem() bool { - key, quit := c.queue.Get() - if quit { - return false - } - defer c.queue.Done(key) - - err := c.syncFn(key.(schema.GroupVersion)) - if err == nil { - c.queue.Forget(key) - return true - } - - utilruntime.HandleError(fmt.Errorf("%v failed with: %v", key, err)) - c.queue.AddRateLimited(key) - - return true -} - -func (c *DiscoveryController) enqueue(obj *apiextensions.CustomResourceDefinition) { - for _, v := range obj.Spec.Versions { - c.queue.Add(schema.GroupVersion{Group: obj.Spec.Group, Version: v.Name}) - } -} - -func (c *DiscoveryController) addCustomResourceDefinition(obj interface{}) { - castObj := obj.(*apiextensions.CustomResourceDefinition) - glog.V(4).Infof("Adding customresourcedefinition %s", castObj.Name) - c.enqueue(castObj) -} - -func (c *DiscoveryController) updateCustomResourceDefinition(oldObj, newObj interface{}) { - castNewObj := newObj.(*apiextensions.CustomResourceDefinition) - castOldObj := oldObj.(*apiextensions.CustomResourceDefinition) - glog.V(4).Infof("Updating customresourcedefinition %s", castOldObj.Name) - // Enqueue both old and new object to make sure we remove and add appropriate Versions. - // The working queue will resolve any duplicates and only changes will stay in the queue. - c.enqueue(castNewObj) - c.enqueue(castOldObj) -} - -func (c *DiscoveryController) deleteCustomResourceDefinition(obj interface{}) { - castObj, ok := obj.(*apiextensions.CustomResourceDefinition) - if !ok { - tombstone, ok := obj.(cache.DeletedFinalStateUnknown) - if !ok { - glog.Errorf("Couldn't get object from tombstone %#v", obj) - return - } - castObj, ok = tombstone.Obj.(*apiextensions.CustomResourceDefinition) - if !ok { - glog.Errorf("Tombstone contained object that is not expected %#v", obj) - return - } - } - glog.V(4).Infof("Deleting customresourcedefinition %q", castObj.Name) - c.enqueue(castObj) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go deleted file mode 100644 index 697c5e591..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go +++ /dev/null @@ -1,895 +0,0 @@ -/* -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 apiserver - -import ( - "fmt" - "net/http" - "path" - "strings" - "sync" - "sync/atomic" - "time" - - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - "github.com/golang/glog" - - apiequality "k8s.io/apimachinery/pkg/api/equality" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/apimachinery/pkg/runtime/serializer/json" - "k8s.io/apimachinery/pkg/runtime/serializer/versioning" - "k8s.io/apimachinery/pkg/types" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apiserver/pkg/admission" - "k8s.io/apiserver/pkg/endpoints/handlers" - "k8s.io/apiserver/pkg/endpoints/handlers/responsewriters" - "k8s.io/apiserver/pkg/endpoints/metrics" - apirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/registry/generic" - genericregistry "k8s.io/apiserver/pkg/registry/generic/registry" - "k8s.io/apiserver/pkg/storage/storagebackend" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/client-go/scale" - "k8s.io/client-go/scale/scheme/autoscalingv1" - "k8s.io/client-go/tools/cache" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - "k8s.io/apiextensions-apiserver/pkg/apiserver/conversion" - apiservervalidation "k8s.io/apiextensions-apiserver/pkg/apiserver/validation" - informers "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion" - listers "k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion" - "k8s.io/apiextensions-apiserver/pkg/controller/establish" - "k8s.io/apiextensions-apiserver/pkg/controller/finalizer" - "k8s.io/apiextensions-apiserver/pkg/crdserverscheme" - apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" - "k8s.io/apiextensions-apiserver/pkg/registry/customresource" - "k8s.io/apiextensions-apiserver/pkg/registry/customresource/tableconvertor" -) - -// crdHandler serves the `/apis` endpoint. -// This is registered as a filter so that it never collides with any explicitly registered endpoints -type crdHandler struct { - versionDiscoveryHandler *versionDiscoveryHandler - groupDiscoveryHandler *groupDiscoveryHandler - - customStorageLock sync.Mutex - // customStorage contains a crdStorageMap - // atomic.Value has a very good read performance compared to sync.RWMutex - // see https://gist.github.com/dim/152e6bf80e1384ea72e17ac717a5000a - // which is suited for most read and rarely write cases - customStorage atomic.Value - - crdLister listers.CustomResourceDefinitionLister - - delegate http.Handler - restOptionsGetter generic.RESTOptionsGetter - admission admission.Interface - - establishingController *establish.EstablishingController - - // MasterCount is used to implement sleep to improve - // CRD establishing process for HA clusters. - masterCount int -} - -// crdInfo stores enough information to serve the storage for the custom resource -type crdInfo struct { - // spec and acceptedNames are used to compare against if a change is made on a CRD. We only update - // the storage if one of these changes. - spec *apiextensions.CustomResourceDefinitionSpec - acceptedNames *apiextensions.CustomResourceDefinitionNames - - // Storage per version - storages map[string]customresource.CustomResourceStorage - - // Request scope per version - requestScopes map[string]handlers.RequestScope - - // Scale scope per version - scaleRequestScopes map[string]handlers.RequestScope - - // Status scope per version - statusRequestScopes map[string]handlers.RequestScope - - // storageVersion is the CRD version used when storing the object in etcd. - storageVersion string -} - -// crdStorageMap goes from customresourcedefinition to its storage -type crdStorageMap map[types.UID]*crdInfo - -func NewCustomResourceDefinitionHandler( - versionDiscoveryHandler *versionDiscoveryHandler, - groupDiscoveryHandler *groupDiscoveryHandler, - crdInformer informers.CustomResourceDefinitionInformer, - delegate http.Handler, - restOptionsGetter generic.RESTOptionsGetter, - admission admission.Interface, - establishingController *establish.EstablishingController, - masterCount int) *crdHandler { - ret := &crdHandler{ - versionDiscoveryHandler: versionDiscoveryHandler, - groupDiscoveryHandler: groupDiscoveryHandler, - customStorage: atomic.Value{}, - crdLister: crdInformer.Lister(), - delegate: delegate, - restOptionsGetter: restOptionsGetter, - admission: admission, - establishingController: establishingController, - masterCount: masterCount, - } - crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ - UpdateFunc: ret.updateCustomResourceDefinition, - DeleteFunc: func(obj interface{}) { - ret.removeDeadStorage() - }, - }) - - ret.customStorage.Store(crdStorageMap{}) - - return ret -} - -func (r *crdHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { - ctx := req.Context() - requestInfo, ok := apirequest.RequestInfoFrom(ctx) - if !ok { - responsewriters.InternalError(w, req, fmt.Errorf("no RequestInfo found in the context")) - return - } - if !requestInfo.IsResourceRequest { - pathParts := splitPath(requestInfo.Path) - // only match /apis// - // only registered under /apis - if len(pathParts) == 3 { - r.versionDiscoveryHandler.ServeHTTP(w, req) - return - } - // only match /apis/ - if len(pathParts) == 2 { - r.groupDiscoveryHandler.ServeHTTP(w, req) - return - } - - r.delegate.ServeHTTP(w, req) - return - } - - crdName := requestInfo.Resource + "." + requestInfo.APIGroup - crd, err := r.crdLister.Get(crdName) - if apierrors.IsNotFound(err) { - r.delegate.ServeHTTP(w, req) - return - } - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - if !apiextensions.HasServedCRDVersion(crd, requestInfo.APIVersion) { - r.delegate.ServeHTTP(w, req) - return - } - // There is a small chance that a CRD is being served because NamesAccepted condition is true, - // but it becomes "unserved" because another names update leads to a conflict - // and EstablishingController wasn't fast enough to put the CRD into the Established condition. - // We accept this as the problem is small and self-healing. - if !apiextensions.IsCRDConditionTrue(crd, apiextensions.NamesAccepted) && - !apiextensions.IsCRDConditionTrue(crd, apiextensions.Established) { - r.delegate.ServeHTTP(w, req) - return - } - - terminating := apiextensions.IsCRDConditionTrue(crd, apiextensions.Terminating) - - crdInfo, err := r.getOrCreateServingInfoFor(crd) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - verb := strings.ToUpper(requestInfo.Verb) - resource := requestInfo.Resource - subresource := requestInfo.Subresource - scope := metrics.CleanScope(requestInfo) - supportedTypes := []string{ - string(types.JSONPatchType), - string(types.MergePatchType), - } - - var handler http.HandlerFunc - switch { - case subresource == "status" && crd.Spec.Subresources != nil && crd.Spec.Subresources.Status != nil: - handler = r.serveStatus(w, req, requestInfo, crdInfo, terminating, supportedTypes) - case subresource == "scale" && crd.Spec.Subresources != nil && crd.Spec.Subresources.Scale != nil: - handler = r.serveScale(w, req, requestInfo, crdInfo, terminating, supportedTypes) - case len(subresource) == 0: - handler = r.serveResource(w, req, requestInfo, crdInfo, terminating, supportedTypes) - default: - http.Error(w, "the server could not find the requested resource", http.StatusNotFound) - } - - if handler != nil { - handler = metrics.InstrumentHandlerFunc(verb, resource, subresource, scope, handler) - handler(w, req) - return - } -} - -func (r *crdHandler) serveResource(w http.ResponseWriter, req *http.Request, requestInfo *apirequest.RequestInfo, crdInfo *crdInfo, terminating bool, supportedTypes []string) http.HandlerFunc { - requestScope := crdInfo.requestScopes[requestInfo.APIVersion] - storage := crdInfo.storages[requestInfo.APIVersion].CustomResource - minRequestTimeout := 1 * time.Minute - - switch requestInfo.Verb { - case "get": - return handlers.GetResource(storage, storage, requestScope) - case "list": - forceWatch := false - return handlers.ListResource(storage, storage, requestScope, forceWatch, minRequestTimeout) - case "watch": - forceWatch := true - return handlers.ListResource(storage, storage, requestScope, forceWatch, minRequestTimeout) - case "create": - if terminating { - http.Error(w, fmt.Sprintf("%v not allowed while CustomResourceDefinition is terminating", requestInfo.Verb), http.StatusMethodNotAllowed) - return nil - } - return handlers.CreateResource(storage, requestScope, r.admission) - case "update": - return handlers.UpdateResource(storage, requestScope, r.admission) - case "patch": - return handlers.PatchResource(storage, requestScope, r.admission, supportedTypes) - case "delete": - allowsOptions := true - return handlers.DeleteResource(storage, allowsOptions, requestScope, r.admission) - case "deletecollection": - checkBody := true - return handlers.DeleteCollection(storage, checkBody, requestScope, r.admission) - default: - http.Error(w, fmt.Sprintf("unhandled verb %q", requestInfo.Verb), http.StatusMethodNotAllowed) - return nil - } -} - -func (r *crdHandler) serveStatus(w http.ResponseWriter, req *http.Request, requestInfo *apirequest.RequestInfo, crdInfo *crdInfo, terminating bool, supportedTypes []string) http.HandlerFunc { - requestScope := crdInfo.statusRequestScopes[requestInfo.APIVersion] - storage := crdInfo.storages[requestInfo.APIVersion].Status - - switch requestInfo.Verb { - case "get": - return handlers.GetResource(storage, nil, requestScope) - case "update": - return handlers.UpdateResource(storage, requestScope, r.admission) - case "patch": - return handlers.PatchResource(storage, requestScope, r.admission, supportedTypes) - default: - http.Error(w, fmt.Sprintf("unhandled verb %q", requestInfo.Verb), http.StatusMethodNotAllowed) - return nil - } -} - -func (r *crdHandler) serveScale(w http.ResponseWriter, req *http.Request, requestInfo *apirequest.RequestInfo, crdInfo *crdInfo, terminating bool, supportedTypes []string) http.HandlerFunc { - requestScope := crdInfo.scaleRequestScopes[requestInfo.APIVersion] - storage := crdInfo.storages[requestInfo.APIVersion].Scale - - switch requestInfo.Verb { - case "get": - return handlers.GetResource(storage, nil, requestScope) - case "update": - return handlers.UpdateResource(storage, requestScope, r.admission) - case "patch": - return handlers.PatchResource(storage, requestScope, r.admission, supportedTypes) - default: - http.Error(w, fmt.Sprintf("unhandled verb %q", requestInfo.Verb), http.StatusMethodNotAllowed) - return nil - } -} - -func (r *crdHandler) updateCustomResourceDefinition(oldObj, newObj interface{}) { - oldCRD := oldObj.(*apiextensions.CustomResourceDefinition) - newCRD := newObj.(*apiextensions.CustomResourceDefinition) - - r.customStorageLock.Lock() - defer r.customStorageLock.Unlock() - - // Add CRD to the establishing controller queue. - // For HA clusters, we want to prevent race conditions when changing status to Established, - // so we want to be sure that CRD is Installing at least for 5 seconds before Establishing it. - // TODO: find a real HA safe checkpointing mechanism instead of an arbitrary wait. - if !apiextensions.IsCRDConditionTrue(newCRD, apiextensions.Established) && - apiextensions.IsCRDConditionTrue(newCRD, apiextensions.NamesAccepted) { - if r.masterCount > 1 { - r.establishingController.QueueCRD(newCRD.Name, 5*time.Second) - } else { - r.establishingController.QueueCRD(newCRD.Name, 0) - } - } - - storageMap := r.customStorage.Load().(crdStorageMap) - oldInfo, found := storageMap[newCRD.UID] - if !found { - return - } - if apiequality.Semantic.DeepEqual(&newCRD.Spec, oldInfo.spec) && apiequality.Semantic.DeepEqual(&newCRD.Status.AcceptedNames, oldInfo.acceptedNames) { - glog.V(6).Infof("Ignoring customresourcedefinition %s update because neither spec, nor accepted names changed", oldCRD.Name) - return - } - - glog.V(4).Infof("Updating customresourcedefinition %s", oldCRD.Name) - - // Copy because we cannot write to storageMap without a race - // as it is used without locking elsewhere. - storageMap2 := storageMap.clone() - if oldInfo, ok := storageMap2[types.UID(oldCRD.UID)]; ok { - for _, storage := range oldInfo.storages { - // destroy only the main storage. Those for the subresources share cacher and etcd clients. - storage.CustomResource.DestroyFunc() - } - delete(storageMap2, types.UID(oldCRD.UID)) - } - - r.customStorage.Store(storageMap2) -} - -// removeDeadStorage removes REST storage that isn't being used -func (r *crdHandler) removeDeadStorage() { - allCustomResourceDefinitions, err := r.crdLister.List(labels.Everything()) - if err != nil { - utilruntime.HandleError(err) - return - } - - r.customStorageLock.Lock() - defer r.customStorageLock.Unlock() - - storageMap := r.customStorage.Load().(crdStorageMap) - // Copy because we cannot write to storageMap without a race - // as it is used without locking elsewhere - storageMap2 := storageMap.clone() - for uid, s := range storageMap2 { - found := false - for _, crd := range allCustomResourceDefinitions { - if crd.UID == uid { - found = true - break - } - } - if !found { - glog.V(4).Infof("Removing dead CRD storage for %s/%s", s.spec.Group, s.spec.Names.Kind) - for _, storage := range s.storages { - // destroy only the main storage. Those for the subresources share cacher and etcd clients. - storage.CustomResource.DestroyFunc() - } - delete(storageMap2, uid) - } - } - r.customStorage.Store(storageMap2) -} - -// GetCustomResourceListerCollectionDeleter returns the ListerCollectionDeleter of -// the given crd. -func (r *crdHandler) GetCustomResourceListerCollectionDeleter(crd *apiextensions.CustomResourceDefinition) (finalizer.ListerCollectionDeleter, error) { - info, err := r.getOrCreateServingInfoFor(crd) - if err != nil { - return nil, err - } - return info.storages[info.storageVersion].CustomResource, nil -} - -var swaggerMetadataDescriptions = metav1.ObjectMeta{}.SwaggerDoc() - -func (r *crdHandler) getOrCreateServingInfoFor(crd *apiextensions.CustomResourceDefinition) (*crdInfo, error) { - storageMap := r.customStorage.Load().(crdStorageMap) - if ret, ok := storageMap[crd.UID]; ok { - return ret, nil - } - - r.customStorageLock.Lock() - defer r.customStorageLock.Unlock() - - storageMap = r.customStorage.Load().(crdStorageMap) - if ret, ok := storageMap[crd.UID]; ok { - return ret, nil - } - - storageVersion, err := apiextensions.GetCRDStorageVersion(crd) - if err != nil { - return nil, err - } - - // Scope/Storages per version. - requestScopes := map[string]handlers.RequestScope{} - storages := map[string]customresource.CustomResourceStorage{} - statusScopes := map[string]handlers.RequestScope{} - scaleScopes := map[string]handlers.RequestScope{} - - for _, v := range crd.Spec.Versions { - safeConverter, unsafeConverter := conversion.NewCRDConverter(crd) - // In addition to Unstructured objects (Custom Resources), we also may sometimes need to - // decode unversioned Options objects, so we delegate to parameterScheme for such types. - parameterScheme := runtime.NewScheme() - parameterScheme.AddUnversionedTypes(schema.GroupVersion{Group: crd.Spec.Group, Version: v.Name}, - &metav1.ListOptions{}, - &metav1.ExportOptions{}, - &metav1.GetOptions{}, - &metav1.DeleteOptions{}, - ) - parameterCodec := runtime.NewParameterCodec(parameterScheme) - - kind := schema.GroupVersionKind{Group: crd.Spec.Group, Version: v.Name, Kind: crd.Status.AcceptedNames.Kind} - typer := newUnstructuredObjectTyper(parameterScheme) - creator := unstructuredCreator{} - - validator, _, err := apiservervalidation.NewSchemaValidator(crd.Spec.Validation) - if err != nil { - return nil, err - } - - var statusSpec *apiextensions.CustomResourceSubresourceStatus - var statusValidator *validate.SchemaValidator - if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) && crd.Spec.Subresources != nil && crd.Spec.Subresources.Status != nil { - statusSpec = crd.Spec.Subresources.Status - - // for the status subresource, validate only against the status schema - if crd.Spec.Validation != nil && crd.Spec.Validation.OpenAPIV3Schema != nil && crd.Spec.Validation.OpenAPIV3Schema.Properties != nil { - if statusSchema, ok := crd.Spec.Validation.OpenAPIV3Schema.Properties["status"]; ok { - openapiSchema := &spec.Schema{} - if err := apiservervalidation.ConvertJSONSchemaProps(&statusSchema, openapiSchema); err != nil { - return nil, err - } - statusValidator = validate.NewSchemaValidator(openapiSchema, nil, "", strfmt.Default) - } - } - } - - var scaleSpec *apiextensions.CustomResourceSubresourceScale - if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) && crd.Spec.Subresources != nil && crd.Spec.Subresources.Scale != nil { - scaleSpec = crd.Spec.Subresources.Scale - } - - table, err := tableconvertor.New(crd.Spec.AdditionalPrinterColumns) - if err != nil { - glog.V(2).Infof("The CRD for %v has an invalid printer specification, falling back to default printing: %v", kind, err) - } - - storages[v.Name] = customresource.NewStorage( - schema.GroupResource{Group: crd.Spec.Group, Resource: crd.Status.AcceptedNames.Plural}, - schema.GroupVersionKind{Group: crd.Spec.Group, Version: v.Name, Kind: crd.Status.AcceptedNames.ListKind}, - customresource.NewStrategy( - typer, - crd.Spec.Scope == apiextensions.NamespaceScoped, - kind, - validator, - statusValidator, - statusSpec, - scaleSpec, - ), - crdConversionRESTOptionsGetter{ - RESTOptionsGetter: r.restOptionsGetter, - converter: safeConverter, - decoderVersion: schema.GroupVersion{Group: crd.Spec.Group, Version: v.Name}, - encoderVersion: schema.GroupVersion{Group: crd.Spec.Group, Version: storageVersion}, - }, - crd.Status.AcceptedNames.Categories, - table, - ) - - selfLinkPrefix := "" - switch crd.Spec.Scope { - case apiextensions.ClusterScoped: - selfLinkPrefix = "/" + path.Join("apis", crd.Spec.Group, v.Name) + "/" + crd.Status.AcceptedNames.Plural + "/" - case apiextensions.NamespaceScoped: - selfLinkPrefix = "/" + path.Join("apis", crd.Spec.Group, v.Name, "namespaces") + "/" - } - - clusterScoped := crd.Spec.Scope == apiextensions.ClusterScoped - - requestScopes[v.Name] = handlers.RequestScope{ - Namer: handlers.ContextBasedNaming{ - SelfLinker: meta.NewAccessor(), - ClusterScoped: clusterScoped, - SelfLinkPathPrefix: selfLinkPrefix, - }, - Serializer: unstructuredNegotiatedSerializer{typer: typer, creator: creator, converter: safeConverter}, - ParameterCodec: parameterCodec, - - Creater: creator, - Convertor: safeConverter, - Defaulter: unstructuredDefaulter{parameterScheme}, - Typer: typer, - UnsafeConvertor: unsafeConverter, - - Resource: schema.GroupVersionResource{Group: crd.Spec.Group, Version: v.Name, Resource: crd.Status.AcceptedNames.Plural}, - Kind: kind, - - MetaGroupVersion: metav1.SchemeGroupVersion, - - TableConvertor: storages[v.Name].CustomResource, - } - - // override scaleSpec subresource values - // shallow copy - scaleScope := requestScopes[v.Name] - scaleConverter := scale.NewScaleConverter() - scaleScope.Subresource = "scale" - scaleScope.Serializer = serializer.NewCodecFactory(scaleConverter.Scheme()) - scaleScope.Kind = autoscalingv1.SchemeGroupVersion.WithKind("Scale") - scaleScope.Namer = handlers.ContextBasedNaming{ - SelfLinker: meta.NewAccessor(), - ClusterScoped: clusterScoped, - SelfLinkPathPrefix: selfLinkPrefix, - SelfLinkPathSuffix: "/scale", - } - scaleScopes[v.Name] = scaleScope - - // override status subresource values - // shallow copy - statusScope := requestScopes[v.Name] - statusScope.Subresource = "status" - statusScope.Namer = handlers.ContextBasedNaming{ - SelfLinker: meta.NewAccessor(), - ClusterScoped: clusterScoped, - SelfLinkPathPrefix: selfLinkPrefix, - SelfLinkPathSuffix: "/status", - } - statusScopes[v.Name] = statusScope - } - - ret := &crdInfo{ - spec: &crd.Spec, - acceptedNames: &crd.Status.AcceptedNames, - storages: storages, - requestScopes: requestScopes, - scaleRequestScopes: scaleScopes, - statusRequestScopes: statusScopes, - storageVersion: storageVersion, - } - - // Copy because we cannot write to storageMap without a race - // as it is used without locking elsewhere. - storageMap2 := storageMap.clone() - - storageMap2[crd.UID] = ret - r.customStorage.Store(storageMap2) - - return ret, nil -} - -type unstructuredNegotiatedSerializer struct { - typer runtime.ObjectTyper - creator runtime.ObjectCreater - converter runtime.ObjectConvertor -} - -func (s unstructuredNegotiatedSerializer) SupportedMediaTypes() []runtime.SerializerInfo { - return []runtime.SerializerInfo{ - { - MediaType: "application/json", - EncodesAsText: true, - Serializer: json.NewSerializer(json.DefaultMetaFactory, s.creator, s.typer, false), - PrettySerializer: json.NewSerializer(json.DefaultMetaFactory, s.creator, s.typer, true), - StreamSerializer: &runtime.StreamSerializerInfo{ - EncodesAsText: true, - Serializer: json.NewSerializer(json.DefaultMetaFactory, s.creator, s.typer, false), - Framer: json.Framer, - }, - }, - { - MediaType: "application/yaml", - EncodesAsText: true, - Serializer: json.NewYAMLSerializer(json.DefaultMetaFactory, s.creator, s.typer), - }, - } -} - -func (s unstructuredNegotiatedSerializer) EncoderForVersion(encoder runtime.Encoder, gv runtime.GroupVersioner) runtime.Encoder { - return versioning.NewCodec(encoder, nil, s.converter, Scheme, Scheme, Scheme, gv, nil, "crdNegotiatedSerializer") -} - -func (s unstructuredNegotiatedSerializer) DecoderToVersion(decoder runtime.Decoder, gv runtime.GroupVersioner) runtime.Decoder { - d := schemaCoercingDecoder{delegate: decoder, validator: unstructuredSchemaCoercer{}} - return versioning.NewDefaultingCodecForScheme(Scheme, nil, d, nil, gv) -} - -type UnstructuredObjectTyper struct { - Delegate runtime.ObjectTyper - UnstructuredTyper runtime.ObjectTyper -} - -func newUnstructuredObjectTyper(Delegate runtime.ObjectTyper) UnstructuredObjectTyper { - return UnstructuredObjectTyper{ - Delegate: Delegate, - UnstructuredTyper: crdserverscheme.NewUnstructuredObjectTyper(), - } -} - -func (t UnstructuredObjectTyper) ObjectKinds(obj runtime.Object) ([]schema.GroupVersionKind, bool, error) { - // Delegate for things other than Unstructured. - if _, ok := obj.(runtime.Unstructured); !ok { - return t.Delegate.ObjectKinds(obj) - } - return t.UnstructuredTyper.ObjectKinds(obj) -} - -func (t UnstructuredObjectTyper) Recognizes(gvk schema.GroupVersionKind) bool { - return t.Delegate.Recognizes(gvk) || t.UnstructuredTyper.Recognizes(gvk) -} - -type unstructuredCreator struct{} - -func (c unstructuredCreator) New(kind schema.GroupVersionKind) (runtime.Object, error) { - ret := &unstructured.Unstructured{} - ret.SetGroupVersionKind(kind) - return ret, nil -} - -type unstructuredDefaulter struct { - delegate runtime.ObjectDefaulter -} - -func (d unstructuredDefaulter) Default(in runtime.Object) { - // Delegate for things other than Unstructured. - if _, ok := in.(runtime.Unstructured); !ok { - d.delegate.Default(in) - } -} - -type CRDRESTOptionsGetter struct { - StorageConfig storagebackend.Config - StoragePrefix string - EnableWatchCache bool - DefaultWatchCacheSize int - EnableGarbageCollection bool - DeleteCollectionWorkers int - CountMetricPollPeriod time.Duration -} - -func (t CRDRESTOptionsGetter) GetRESTOptions(resource schema.GroupResource) (generic.RESTOptions, error) { - ret := generic.RESTOptions{ - StorageConfig: &t.StorageConfig, - Decorator: generic.UndecoratedStorage, - EnableGarbageCollection: t.EnableGarbageCollection, - DeleteCollectionWorkers: t.DeleteCollectionWorkers, - ResourcePrefix: resource.Group + "/" + resource.Resource, - CountMetricPollPeriod: t.CountMetricPollPeriod, - } - if t.EnableWatchCache { - ret.Decorator = genericregistry.StorageWithCacher(t.DefaultWatchCacheSize) - } - return ret, nil -} - -// clone returns a clone of the provided crdStorageMap. -// The clone is a shallow copy of the map. -func (in crdStorageMap) clone() crdStorageMap { - if in == nil { - return nil - } - out := make(crdStorageMap, len(in)) - for key, value := range in { - out[key] = value - } - return out -} - -// crdConversionRESTOptionsGetter overrides the codec with one using the -// provided custom converter and custom encoder and decoder version. -type crdConversionRESTOptionsGetter struct { - generic.RESTOptionsGetter - converter runtime.ObjectConvertor - encoderVersion schema.GroupVersion - decoderVersion schema.GroupVersion -} - -func (t crdConversionRESTOptionsGetter) GetRESTOptions(resource schema.GroupResource) (generic.RESTOptions, error) { - ret, err := t.RESTOptionsGetter.GetRESTOptions(resource) - if err == nil { - d := schemaCoercingDecoder{delegate: ret.StorageConfig.Codec, validator: unstructuredSchemaCoercer{ - // drop invalid fields while decoding old CRs (before we had any ObjectMeta validation) - dropInvalidMetadata: true, - }} - c := schemaCoercingConverter{delegate: t.converter, validator: unstructuredSchemaCoercer{}} - ret.StorageConfig.Codec = versioning.NewCodec( - ret.StorageConfig.Codec, - d, - c, - &unstructuredCreator{}, - crdserverscheme.NewUnstructuredObjectTyper(), - &unstructuredDefaulter{delegate: Scheme}, - t.encoderVersion, - t.decoderVersion, - "crdRESTOptions", - ) - } - return ret, err -} - -// schemaCoercingDecoder calls the delegate decoder, and then applies the Unstructured schema validator -// to coerce the schema. -type schemaCoercingDecoder struct { - delegate runtime.Decoder - validator unstructuredSchemaCoercer -} - -var _ runtime.Decoder = schemaCoercingDecoder{} - -func (d schemaCoercingDecoder) Decode(data []byte, defaults *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) { - obj, gvk, err := d.delegate.Decode(data, defaults, into) - if err != nil { - return nil, gvk, err - } - if u, ok := obj.(*unstructured.Unstructured); ok { - if err := d.validator.apply(u); err != nil { - return nil, gvk, err - } - } - - return obj, gvk, nil -} - -// schemaCoercingConverter calls the delegate converter and applies the Unstructured validator to -// coerce the schema. -type schemaCoercingConverter struct { - delegate runtime.ObjectConvertor - validator unstructuredSchemaCoercer -} - -var _ runtime.ObjectConvertor = schemaCoercingConverter{} - -func (v schemaCoercingConverter) Convert(in, out, context interface{}) error { - if err := v.delegate.Convert(in, out, context); err != nil { - return err - } - - if u, ok := out.(*unstructured.Unstructured); ok { - if err := v.validator.apply(u); err != nil { - return err - } - } - - return nil -} - -func (v schemaCoercingConverter) ConvertToVersion(in runtime.Object, gv runtime.GroupVersioner) (runtime.Object, error) { - out, err := v.delegate.ConvertToVersion(in, gv) - if err != nil { - return nil, err - } - - if u, ok := out.(*unstructured.Unstructured); ok { - if err := v.validator.apply(u); err != nil { - return nil, err - } - } - - return out, nil -} - -func (v schemaCoercingConverter) ConvertFieldLabel(gvk schema.GroupVersionKind, label, value string) (string, string, error) { - return v.delegate.ConvertFieldLabel(gvk, label, value) -} - -// unstructuredSchemaCoercer does the validation for Unstructured that json.Unmarshal -// does for native types. This includes: -// - validating and pruning ObjectMeta (here with optional error instead of pruning) -// - TODO: application of an OpenAPI validator (against the whole object or a top-level field of it). -// - TODO: optionally application of post-validation algorithms like defaulting and/or OpenAPI based pruning. -type unstructuredSchemaCoercer struct { - dropInvalidMetadata bool -} - -func (v *unstructuredSchemaCoercer) apply(u *unstructured.Unstructured) error { - // save implicit meta fields that don't have to be specified in the validation spec - kind, foundKind, err := unstructured.NestedString(u.UnstructuredContent(), "kind") - if err != nil { - return err - } - apiVersion, foundApiVersion, err := unstructured.NestedString(u.UnstructuredContent(), "apiVersion") - if err != nil { - return err - } - objectMeta, foundObjectMeta, err := getObjectMeta(u, v.dropInvalidMetadata) - if err != nil { - return err - } - - // restore meta fields, starting clean - if foundKind { - u.SetKind(kind) - } - if foundApiVersion { - u.SetAPIVersion(apiVersion) - } - if foundObjectMeta { - if err := setObjectMeta(u, objectMeta); err != nil { - return err - } - } - - return nil -} - -var encodingjson = json.CaseSensitiveJsonIterator() - -func getObjectMeta(u *unstructured.Unstructured, dropMalformedFields bool) (*metav1.ObjectMeta, bool, error) { - metadata, found := u.UnstructuredContent()["metadata"] - if !found { - return nil, false, nil - } - - // round-trip through JSON first, hoping that unmarshaling just works - objectMeta := &metav1.ObjectMeta{} - metadataBytes, err := encodingjson.Marshal(metadata) - if err != nil { - return nil, false, err - } - if err = encodingjson.Unmarshal(metadataBytes, objectMeta); err == nil { - // if successful, return - return objectMeta, true, nil - } - if !dropMalformedFields { - // if we're not trying to drop malformed fields, return the error - return nil, true, err - } - - metadataMap, ok := metadata.(map[string]interface{}) - if !ok { - return nil, false, fmt.Errorf("invalid metadata: expected object, got %T", metadata) - } - - // Go field by field accumulating into the metadata object. - // This takes advantage of the fact that you can repeatedly unmarshal individual fields into a single struct, - // each iteration preserving the old key-values. - accumulatedObjectMeta := &metav1.ObjectMeta{} - testObjectMeta := &metav1.ObjectMeta{} - for k, v := range metadataMap { - // serialize a single field - if singleFieldBytes, err := encodingjson.Marshal(map[string]interface{}{k: v}); err == nil { - // do a test unmarshal - if encodingjson.Unmarshal(singleFieldBytes, testObjectMeta) == nil { - // if that succeeds, unmarshal for real - encodingjson.Unmarshal(singleFieldBytes, accumulatedObjectMeta) - } - } - } - - return accumulatedObjectMeta, true, nil -} - -func setObjectMeta(u *unstructured.Unstructured, objectMeta *metav1.ObjectMeta) error { - if objectMeta == nil { - unstructured.RemoveNestedField(u.UnstructuredContent(), "metadata") - return nil - } - - metadata, err := runtime.DefaultUnstructuredConverter.ToUnstructured(objectMeta) - if err != nil { - return err - } - - u.UnstructuredContent()["metadata"] = metadata - return nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go deleted file mode 100644 index fa7c84e66..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go +++ /dev/null @@ -1,309 +0,0 @@ -/* -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 apiserver - -import ( - "math/rand" - "reflect" - "testing" - - corev1 "k8s.io/api/core/v1" - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - "k8s.io/apiextensions-apiserver/pkg/apiserver/conversion" - "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" - "k8s.io/apimachinery/pkg/api/equality" - metafuzzer "k8s.io/apimachinery/pkg/apis/meta/fuzzer" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/apimachinery/pkg/runtime/serializer/json" - "k8s.io/apimachinery/pkg/util/diff" - clientgoscheme "k8s.io/client-go/kubernetes/scheme" -) - -func TestConvertFieldLabel(t *testing.T) { - tests := []struct { - name string - clusterScoped bool - label string - expectError bool - }{ - { - name: "cluster scoped - name is ok", - clusterScoped: true, - label: "metadata.name", - }, - { - name: "cluster scoped - namespace is not ok", - clusterScoped: true, - label: "metadata.namespace", - expectError: true, - }, - { - name: "cluster scoped - other field is not ok", - clusterScoped: true, - label: "some.other.field", - expectError: true, - }, - { - name: "namespace scoped - name is ok", - label: "metadata.name", - }, - { - name: "namespace scoped - namespace is ok", - label: "metadata.namespace", - }, - { - name: "namespace scoped - other field is not ok", - label: "some.other.field", - expectError: true, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - - crd := apiextensions.CustomResourceDefinition{} - - if test.clusterScoped { - crd.Spec.Scope = apiextensions.ClusterScoped - } else { - crd.Spec.Scope = apiextensions.NamespaceScoped - } - _, c := conversion.NewCRDConverter(&crd) - - label, value, err := c.ConvertFieldLabel(schema.GroupVersionKind{}, test.label, "value") - if e, a := test.expectError, err != nil; e != a { - t.Fatalf("err: expected %t, got %t", e, a) - } - if test.expectError { - if e, a := "field label not supported: "+test.label, err.Error(); e != a { - t.Errorf("err: expected %s, got %s", e, a) - } - return - } - - if e, a := test.label, label; e != a { - t.Errorf("label: expected %s, got %s", e, a) - } - if e, a := "value", value; e != a { - t.Errorf("value: expected %s, got %s", e, a) - } - }) - } -} - -func TestRoundtripObjectMeta(t *testing.T) { - scheme := runtime.NewScheme() - codecs := serializer.NewCodecFactory(scheme) - codec := json.NewSerializer(json.DefaultMetaFactory, scheme, scheme, false) - seed := rand.Int63() - fuzzer := fuzzer.FuzzerFor(metafuzzer.Funcs, rand.NewSource(seed), codecs) - - N := 1000 - for i := 0; i < N; i++ { - u := &unstructured.Unstructured{Object: map[string]interface{}{}} - original := &metav1.ObjectMeta{} - fuzzer.Fuzz(original) - if err := setObjectMeta(u, original); err != nil { - t.Fatalf("unexpected error setting ObjectMeta: %v", err) - } - o, _, err := getObjectMeta(u, false) - if err != nil { - t.Fatalf("unexpected error getting the Objectmeta: %v", err) - } - - if !equality.Semantic.DeepEqual(original, o) { - t.Errorf("diff: %v\nCodec: %#v", diff.ObjectReflectDiff(original, o), codec) - } - } -} - -// TestMalformedObjectMetaFields sets a number of different random values and types for all -// metadata fields. If json.Unmarshal accepts them, compare that getObjectMeta -// gives the same result. Otherwise, drop malformed fields. -func TestMalformedObjectMetaFields(t *testing.T) { - fuzzer := fuzzer.FuzzerFor(metafuzzer.Funcs, rand.NewSource(rand.Int63()), serializer.NewCodecFactory(runtime.NewScheme())) - spuriousValues := func() []interface{} { - return []interface{}{ - // primitives - nil, - int64(1), - float64(1.5), - true, - "a", - // well-formed complex values - []interface{}{"a", "b"}, - map[string]interface{}{"a": "1", "b": "2"}, - []interface{}{int64(1), int64(2)}, - []interface{}{float64(1.5), float64(2.5)}, - // known things json decoding tolerates - map[string]interface{}{"a": "1", "b": nil}, - // malformed things - map[string]interface{}{"a": "1", "b": []interface{}{"nested"}}, - []interface{}{"a", int64(1), float64(1.5), true, []interface{}{"nested"}}, - } - } - N := 100 - for i := 0; i < N; i++ { - fuzzedObjectMeta := &metav1.ObjectMeta{} - fuzzer.Fuzz(fuzzedObjectMeta) - goodMetaMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(fuzzedObjectMeta.DeepCopy()) - if err != nil { - t.Fatal(err) - } - for _, pth := range jsonPaths(nil, goodMetaMap) { - for _, v := range spuriousValues() { - // skip values of same type, because they can only cause decoding errors further insides - orig, err := JsonPathValue(goodMetaMap, pth, 0) - if err != nil { - t.Fatalf("unexpected to not find something at %v: %v", pth, err) - } - if reflect.TypeOf(v) == reflect.TypeOf(orig) { - continue - } - - // make a spurious map - spuriousMetaMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(fuzzedObjectMeta.DeepCopy()) - if err != nil { - t.Fatal(err) - } - if err := SetJsonPath(spuriousMetaMap, pth, 0, v); err != nil { - t.Fatal(err) - } - - // See if it can unmarshal to object meta - spuriousJSON, err := encodingjson.Marshal(spuriousMetaMap) - if err != nil { - t.Fatalf("error on %v=%#v: %v", pth, v, err) - } - expectedObjectMeta := &metav1.ObjectMeta{} - if err := encodingjson.Unmarshal(spuriousJSON, expectedObjectMeta); err != nil { - // if standard json unmarshal would fail decoding this field, drop the field entirely - truncatedMetaMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(fuzzedObjectMeta.DeepCopy()) - if err != nil { - t.Fatal(err) - } - - // we expect this logic for the different fields: - switch { - default: - // delete complete top-level field by default - DeleteJsonPath(truncatedMetaMap, pth[:1], 0) - } - - truncatedJSON, err := encodingjson.Marshal(truncatedMetaMap) - if err != nil { - t.Fatalf("error on %v=%#v: %v", pth, v, err) - } - expectedObjectMeta = &metav1.ObjectMeta{} - if err := encodingjson.Unmarshal(truncatedJSON, expectedObjectMeta); err != nil { - t.Fatalf("error on %v=%#v: %v", pth, v, err) - } - } - - // make sure dropInvalidTypedFields+getObjectMeta matches what we expect - u := &unstructured.Unstructured{Object: map[string]interface{}{"metadata": spuriousMetaMap}} - actualObjectMeta, _, err := getObjectMeta(u, true) - if err != nil { - t.Errorf("got unexpected error after dropping invalid typed fields on %v=%#v: %v", pth, v, err) - continue - } - - if !equality.Semantic.DeepEqual(expectedObjectMeta, actualObjectMeta) { - t.Errorf("%v=%#v, diff: %v\n", pth, v, diff.ObjectReflectDiff(expectedObjectMeta, actualObjectMeta)) - t.Errorf("expectedObjectMeta %#v", expectedObjectMeta) - } - } - } - } -} - -func TestGetObjectMetaNils(t *testing.T) { - u := &unstructured.Unstructured{ - Object: map[string]interface{}{ - "kind": "Pod", - "apiVersion": "v1", - "metadata": map[string]interface{}{ - "generateName": nil, - "labels": map[string]interface{}{ - "foo": nil, - }, - }, - }, - } - - o, _, err := getObjectMeta(u, true) - if err != nil { - t.Fatal(err) - } - if o.GenerateName != "" { - t.Errorf("expected null json value to be read as \"\" string, but got: %q", o.GenerateName) - } - if got, expected := o.Labels, map[string]string{"foo": ""}; !reflect.DeepEqual(got, expected) { - t.Errorf("unexpected labels, expected=%#v, got=%#v", expected, got) - } - - // double check this what the kube JSON decode is doing - bs, _ := encodingjson.Marshal(u.UnstructuredContent()) - kubeObj, _, err := clientgoscheme.Codecs.UniversalDecoder(corev1.SchemeGroupVersion).Decode(bs, nil, nil) - if err != nil { - t.Fatal(err) - } - pod, ok := kubeObj.(*corev1.Pod) - if !ok { - t.Fatalf("expected v1 Pod, got: %T", pod) - } - if got, expected := o.GenerateName, pod.ObjectMeta.GenerateName; got != expected { - t.Errorf("expected generatedName to be %q, got %q", expected, got) - } - if got, expected := o.Labels, pod.ObjectMeta.Labels; !reflect.DeepEqual(got, expected) { - t.Errorf("expected labels to be %v, got %v", expected, got) - } -} - -func TestGetObjectMeta(t *testing.T) { - for i := 0; i < 100; i++ { - u := &unstructured.Unstructured{Object: map[string]interface{}{ - "metadata": map[string]interface{}{ - "name": "good", - "Name": "bad1", - "nAme": "bad2", - "naMe": "bad3", - "namE": "bad4", - - "namespace": "good", - "Namespace": "bad1", - "nAmespace": "bad2", - "naMespace": "bad3", - "namEspace": "bad4", - - "creationTimestamp": "a", - }, - }} - - meta, _, err := getObjectMeta(u, true) - if err != nil { - t.Fatal(err) - } - if meta.Name != "good" || meta.Namespace != "good" { - t.Fatalf("got %#v", meta) - } - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/jsonpath_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/jsonpath_test.go deleted file mode 100644 index 8d9bb24f8..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/jsonpath_test.go +++ /dev/null @@ -1,235 +0,0 @@ -/* -Copyright 2018 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 apiserver - -import ( - "bytes" - "fmt" - - "k8s.io/apimachinery/pkg/runtime" -) - -type ( - jsonPathNode struct { - index *int - field string - } - JsonPath []jsonPathNode -) - -func (p JsonPath) String() string { - var buf bytes.Buffer - for _, n := range p { - if n.index == nil { - buf.WriteString("." + n.field) - } else { - buf.WriteString(fmt.Sprintf("[%d]", *n.index)) - } - } - return buf.String() -} - -func jsonPaths(base JsonPath, j map[string]interface{}) []JsonPath { - res := make([]JsonPath, 0, len(j)) - for k, old := range j { - kPth := append(append([]jsonPathNode(nil), base...), jsonPathNode{field: k}) - res = append(res, kPth) - - switch old := old.(type) { - case map[string]interface{}: - res = append(res, jsonPaths(kPth, old)...) - case []interface{}: - res = append(res, jsonIterSlice(kPth, old)...) - } - } - return res -} - -func jsonIterSlice(base JsonPath, j []interface{}) []JsonPath { - res := make([]JsonPath, 0, len(j)) - for i, old := range j { - index := i - iPth := append(append([]jsonPathNode(nil), base...), jsonPathNode{index: &index}) - res = append(res, iPth) - - switch old := old.(type) { - case map[string]interface{}: - res = append(res, jsonPaths(iPth, old)...) - case []interface{}: - res = append(res, jsonIterSlice(iPth, old)...) - } - } - return res -} - -func JsonPathValue(j map[string]interface{}, pth JsonPath, base int) (interface{}, error) { - if len(pth) == base { - return nil, fmt.Errorf("empty json path is invalid for object") - } - if pth[base].index != nil { - return nil, fmt.Errorf("index json path is invalid for object") - } - field, ok := j[pth[base].field] - if !ok || len(pth) == base+1 { - if len(pth) > base+1 { - return nil, fmt.Errorf("invalid non-terminal json path %q for non-existing field", pth) - } - return j[pth[base].field], nil - } - switch field := field.(type) { - case map[string]interface{}: - return JsonPathValue(field, pth, base+1) - case []interface{}: - return jsonPathValueSlice(field, pth, base+1) - default: - return nil, fmt.Errorf("invalid non-terminal json path %q for field", pth[:base+1]) - } -} - -func jsonPathValueSlice(j []interface{}, pth JsonPath, base int) (interface{}, error) { - if len(pth) == base { - return nil, fmt.Errorf("empty json path %q is invalid for object", pth) - } - if pth[base].index == nil { - return nil, fmt.Errorf("field json path %q is invalid for object", pth[:base+1]) - } - if *pth[base].index >= len(j) { - return nil, fmt.Errorf("invalid index %q for array of size %d", pth[:base+1], len(j)) - } - if len(pth) == base+1 { - return j[*pth[base].index], nil - } - switch item := j[*pth[base].index].(type) { - case map[string]interface{}: - return JsonPathValue(item, pth, base+1) - case []interface{}: - return jsonPathValueSlice(item, pth, base+1) - default: - return nil, fmt.Errorf("invalid non-terminal json path %q for index", pth[:base+1]) - } -} - -func SetJsonPath(j map[string]interface{}, pth JsonPath, base int, value interface{}) error { - if len(pth) == base { - return fmt.Errorf("empty json path is invalid for object") - } - if pth[base].index != nil { - return fmt.Errorf("index json path is invalid for object") - } - field, ok := j[pth[base].field] - if !ok || len(pth) == base+1 { - if len(pth) > base+1 { - return fmt.Errorf("invalid non-terminal json path %q for non-existing field", pth) - } - j[pth[base].field] = runtime.DeepCopyJSONValue(value) - return nil - } - switch field := field.(type) { - case map[string]interface{}: - return SetJsonPath(field, pth, base+1, value) - case []interface{}: - return setJsonPathSlice(field, pth, base+1, value) - default: - return fmt.Errorf("invalid non-terminal json path %q for field", pth[:base+1]) - } -} - -func setJsonPathSlice(j []interface{}, pth JsonPath, base int, value interface{}) error { - if len(pth) == base { - return fmt.Errorf("empty json path %q is invalid for object", pth) - } - if pth[base].index == nil { - return fmt.Errorf("field json path %q is invalid for object", pth[:base+1]) - } - if *pth[base].index >= len(j) { - return fmt.Errorf("invalid index %q for array of size %d", pth[:base+1], len(j)) - } - if len(pth) == base+1 { - j[*pth[base].index] = runtime.DeepCopyJSONValue(value) - return nil - } - switch item := j[*pth[base].index].(type) { - case map[string]interface{}: - return SetJsonPath(item, pth, base+1, value) - case []interface{}: - return setJsonPathSlice(item, pth, base+1, value) - default: - return fmt.Errorf("invalid non-terminal json path %q for index", pth[:base+1]) - } -} - -func DeleteJsonPath(j map[string]interface{}, pth JsonPath, base int) error { - if len(pth) == base { - return fmt.Errorf("empty json path is invalid for object") - } - if pth[base].index != nil { - return fmt.Errorf("index json path is invalid for object") - } - field, ok := j[pth[base].field] - if !ok || len(pth) == base+1 { - if len(pth) > base+1 { - return fmt.Errorf("invalid non-terminal json path %q for non-existing field", pth) - } - delete(j, pth[base].field) - return nil - } - switch field := field.(type) { - case map[string]interface{}: - return DeleteJsonPath(field, pth, base+1) - case []interface{}: - if len(pth) == base+2 { - if pth[base+1].index == nil { - return fmt.Errorf("field json path %q is invalid for object", pth) - } - j[pth[base].field] = append(field[:*pth[base+1].index], field[*pth[base+1].index+1:]...) - return nil - } - return deleteJsonPathSlice(field, pth, base+1) - default: - return fmt.Errorf("invalid non-terminal json path %q for field", pth[:base+1]) - } -} - -func deleteJsonPathSlice(j []interface{}, pth JsonPath, base int) error { - if len(pth) == base { - return fmt.Errorf("empty json path %q is invalid for object", pth) - } - if pth[base].index == nil { - return fmt.Errorf("field json path %q is invalid for object", pth[:base+1]) - } - if *pth[base].index >= len(j) { - return fmt.Errorf("invalid index %q for array of size %d", pth[:base+1], len(j)) - } - if len(pth) == base+1 { - return fmt.Errorf("cannot delete item at index %q in-place", pth[:base]) - } - switch item := j[*pth[base].index].(type) { - case map[string]interface{}: - return DeleteJsonPath(item, pth, base+1) - case []interface{}: - if len(pth) == base+2 { - if pth[base+1].index == nil { - return fmt.Errorf("field json path %q is invalid for object", pth) - } - j[*pth[base].index] = append(item[:*pth[base+1].index], item[*pth[base+1].index+1:]) - return nil - } - return deleteJsonPathSlice(item, pth, base+1) - default: - return fmt.Errorf("invalid non-terminal json path %q for index", pth[:base+1]) - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/validation.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/validation.go deleted file mode 100644 index 558ddb1fc..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/validation.go +++ /dev/null @@ -1,249 +0,0 @@ -/* -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 validation - -import ( - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" -) - -// NewSchemaValidator creates an openapi schema validator for the given CRD validation. -func NewSchemaValidator(customResourceValidation *apiextensions.CustomResourceValidation) (*validate.SchemaValidator, *spec.Schema, error) { - // Convert CRD schema to openapi schema - openapiSchema := &spec.Schema{} - if customResourceValidation != nil { - if err := ConvertJSONSchemaProps(customResourceValidation.OpenAPIV3Schema, openapiSchema); err != nil { - return nil, nil, err - } - } - return validate.NewSchemaValidator(openapiSchema, nil, "", strfmt.Default), openapiSchema, nil -} - -// ValidateCustomResource validates the Custom Resource against the schema in the CustomResourceDefinition. -// CustomResource is a JSON data structure. -func ValidateCustomResource(customResource interface{}, validator *validate.SchemaValidator) error { - if validator == nil { - return nil - } - - result := validator.Validate(customResource) - if result.AsError() != nil { - return result.AsError() - } - return nil -} - -// ConvertJSONSchemaProps converts the schema from apiextensions.JSONSchemaPropos to go-openapi/spec.Schema -func ConvertJSONSchemaProps(in *apiextensions.JSONSchemaProps, out *spec.Schema) error { - if in == nil { - return nil - } - - out.ID = in.ID - out.Schema = spec.SchemaURL(in.Schema) - out.Description = in.Description - if in.Type != "" { - out.Type = spec.StringOrArray([]string{in.Type}) - } - out.Format = in.Format - out.Title = in.Title - out.Maximum = in.Maximum - out.ExclusiveMaximum = in.ExclusiveMaximum - out.Minimum = in.Minimum - out.ExclusiveMinimum = in.ExclusiveMinimum - out.MaxLength = in.MaxLength - out.MinLength = in.MinLength - out.Pattern = in.Pattern - out.MaxItems = in.MaxItems - out.MinItems = in.MinItems - out.UniqueItems = in.UniqueItems - out.MultipleOf = in.MultipleOf - out.MaxProperties = in.MaxProperties - out.MinProperties = in.MinProperties - out.Required = in.Required - - if in.Default != nil { - out.Default = *(in.Default) - } - if in.Example != nil { - out.Example = *(in.Example) - } - - out.Enum = make([]interface{}, len(in.Enum)) - for k, v := range in.Enum { - out.Enum[k] = v - } - - if err := convertSliceOfJSONSchemaProps(&in.AllOf, &out.AllOf); err != nil { - return err - } - if err := convertSliceOfJSONSchemaProps(&in.OneOf, &out.OneOf); err != nil { - return err - } - if err := convertSliceOfJSONSchemaProps(&in.AnyOf, &out.AnyOf); err != nil { - return err - } - - if in.Not != nil { - in, out := &in.Not, &out.Not - *out = new(spec.Schema) - if err := ConvertJSONSchemaProps(*in, *out); err != nil { - return err - } - } - - var err error - out.Properties, err = convertMapOfJSONSchemaProps(in.Properties) - if err != nil { - return err - } - - out.PatternProperties, err = convertMapOfJSONSchemaProps(in.PatternProperties) - if err != nil { - return err - } - - out.Definitions, err = convertMapOfJSONSchemaProps(in.Definitions) - if err != nil { - return err - } - - if in.Ref != nil { - out.Ref, err = spec.NewRef(*in.Ref) - if err != nil { - return err - } - } - - if in.AdditionalProperties != nil { - in, out := &in.AdditionalProperties, &out.AdditionalProperties - *out = new(spec.SchemaOrBool) - if err := convertJSONSchemaPropsorBool(*in, *out); err != nil { - return err - } - } - - if in.AdditionalItems != nil { - in, out := &in.AdditionalItems, &out.AdditionalItems - *out = new(spec.SchemaOrBool) - if err := convertJSONSchemaPropsorBool(*in, *out); err != nil { - return err - } - } - - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = new(spec.SchemaOrArray) - if err := convertJSONSchemaPropsOrArray(*in, *out); err != nil { - return err - } - } - - if in.Dependencies != nil { - in, out := &in.Dependencies, &out.Dependencies - *out = make(spec.Dependencies, len(*in)) - for key, val := range *in { - newVal := new(spec.SchemaOrStringArray) - if err := convertJSONSchemaPropsOrStringArray(&val, newVal); err != nil { - return err - } - (*out)[key] = *newVal - } - } - - if in.ExternalDocs != nil { - out.ExternalDocs = &spec.ExternalDocumentation{} - out.ExternalDocs.Description = in.ExternalDocs.Description - out.ExternalDocs.URL = in.ExternalDocs.URL - } - - return nil -} - -func convertSliceOfJSONSchemaProps(in *[]apiextensions.JSONSchemaProps, out *[]spec.Schema) error { - if in != nil { - for _, jsonSchemaProps := range *in { - schema := spec.Schema{} - if err := ConvertJSONSchemaProps(&jsonSchemaProps, &schema); err != nil { - return err - } - *out = append(*out, schema) - } - } - return nil -} - -func convertMapOfJSONSchemaProps(in map[string]apiextensions.JSONSchemaProps) (map[string]spec.Schema, error) { - out := make(map[string]spec.Schema) - if len(in) != 0 { - for k, jsonSchemaProps := range in { - schema := spec.Schema{} - if err := ConvertJSONSchemaProps(&jsonSchemaProps, &schema); err != nil { - return nil, err - } - out[k] = schema - } - } - return out, nil -} - -func convertJSONSchemaPropsOrArray(in *apiextensions.JSONSchemaPropsOrArray, out *spec.SchemaOrArray) error { - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = new(spec.Schema) - if err := ConvertJSONSchemaProps(*in, *out); err != nil { - return err - } - } - if in.JSONSchemas != nil { - in, out := &in.JSONSchemas, &out.Schemas - *out = make([]spec.Schema, len(*in)) - for i := range *in { - if err := ConvertJSONSchemaProps(&(*in)[i], &(*out)[i]); err != nil { - return err - } - } - } - return nil -} - -func convertJSONSchemaPropsorBool(in *apiextensions.JSONSchemaPropsOrBool, out *spec.SchemaOrBool) error { - out.Allows = in.Allows - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = new(spec.Schema) - if err := ConvertJSONSchemaProps(*in, *out); err != nil { - return err - } - } - return nil -} - -func convertJSONSchemaPropsOrStringArray(in *apiextensions.JSONSchemaPropsOrStringArray, out *spec.SchemaOrStringArray) error { - out.Property = in.Property - if in.Schema != nil { - in, out := &in.Schema, &out.Schema - *out = new(spec.Schema) - if err := ConvertJSONSchemaProps(*in, *out); err != nil { - return err - } - } - return nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/validation_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/validation_test.go deleted file mode 100644 index ef73c008b..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/validation_test.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -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 validation - -import ( - "math/rand" - "testing" - - "github.com/go-openapi/spec" - - "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" - apiequality "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/apimachinery/pkg/util/json" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - apiextensionsfuzzer "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/fuzzer" - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" -) - -// TestRoundTrip checks the conversion to go-openapi types. -// internal -> go-openapi -> JSON -> external -> internal -func TestRoundTrip(t *testing.T) { - scheme := runtime.NewScheme() - codecs := serializer.NewCodecFactory(scheme) - - // add internal and external types to scheme - if err := apiextensions.AddToScheme(scheme); err != nil { - t.Fatal(err) - } - if err := apiextensionsv1beta1.AddToScheme(scheme); err != nil { - t.Fatal(err) - } - - seed := rand.Int63() - fuzzerFuncs := fuzzer.MergeFuzzerFuncs(apiextensionsfuzzer.Funcs) - f := fuzzer.FuzzerFor(fuzzerFuncs, rand.NewSource(seed), codecs) - - for i := 0; i < 20; i++ { - // fuzz internal types - internal := &apiextensions.JSONSchemaProps{} - f.Fuzz(internal) - - // internal -> go-openapi - openAPITypes := &spec.Schema{} - if err := ConvertJSONSchemaProps(internal, openAPITypes); err != nil { - t.Fatal(err) - } - - // go-openapi -> JSON - openAPIJSON, err := json.Marshal(openAPITypes) - if err != nil { - t.Fatal(err) - } - - // JSON -> external - external := &apiextensionsv1beta1.JSONSchemaProps{} - if err := json.Unmarshal(openAPIJSON, external); err != nil { - t.Fatal(err) - } - - // external -> internal - internalRoundTripped := &apiextensions.JSONSchemaProps{} - if err := scheme.Convert(external, internalRoundTripped, nil); err != nil { - t.Fatal(err) - } - - if !apiequality.Semantic.DeepEqual(internal, internalRoundTripped) { - t.Fatalf("expected\n\t%#v, got \n\t%#v", internal, internalRoundTripped) - } - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go deleted file mode 100644 index 63fcb510a..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package clientset - -import ( - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - ApiextensionsV1beta1() apiextensionsv1beta1.ApiextensionsV1beta1Interface - // Deprecated: please explicitly pick a version if possible. - Apiextensions() apiextensionsv1beta1.ApiextensionsV1beta1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - apiextensionsV1beta1 *apiextensionsv1beta1.ApiextensionsV1beta1Client -} - -// ApiextensionsV1beta1 retrieves the ApiextensionsV1beta1Client -func (c *Clientset) ApiextensionsV1beta1() apiextensionsv1beta1.ApiextensionsV1beta1Interface { - return c.apiextensionsV1beta1 -} - -// Deprecated: Apiextensions retrieves the default version of ApiextensionsClient. -// Please explicitly pick a version. -func (c *Clientset) Apiextensions() apiextensionsv1beta1.ApiextensionsV1beta1Interface { - return c.apiextensionsV1beta1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.apiextensionsV1beta1, err = apiextensionsv1beta1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.apiextensionsV1beta1 = apiextensionsv1beta1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.apiextensionsV1beta1 = apiextensionsv1beta1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/doc.go deleted file mode 100644 index ee865e56d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package clientset diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake/clientset_generated.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake/clientset_generated.go deleted file mode 100644 index e65fe63ea..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake/clientset_generated.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - clientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1" - fakeapiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -var _ clientset.Interface = &Clientset{} - -// ApiextensionsV1beta1 retrieves the ApiextensionsV1beta1Client -func (c *Clientset) ApiextensionsV1beta1() apiextensionsv1beta1.ApiextensionsV1beta1Interface { - return &fakeapiextensionsv1beta1.FakeApiextensionsV1beta1{Fake: &c.Fake} -} - -// Apiextensions retrieves the ApiextensionsV1beta1Client -func (c *Clientset) Apiextensions() apiextensionsv1beta1.ApiextensionsV1beta1Interface { - return &fakeapiextensionsv1beta1.FakeApiextensionsV1beta1{Fake: &c.Fake} -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake/doc.go deleted file mode 100644 index 9b99e7167..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake/register.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake/register.go deleted file mode 100644 index c4c1d2ba8..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - apiextensionsv1beta1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/doc.go deleted file mode 100644 index 7dc375616..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/register.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/register.go deleted file mode 100644 index 4232ce5ce..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - apiextensionsv1beta1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/apiextensions_client.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/apiextensions_client.go deleted file mode 100644 index a1fd337f9..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/apiextensions_client.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" -) - -type ApiextensionsV1beta1Interface interface { - RESTClient() rest.Interface - CustomResourceDefinitionsGetter -} - -// ApiextensionsV1beta1Client is used to interact with features provided by the apiextensions.k8s.io group. -type ApiextensionsV1beta1Client struct { - restClient rest.Interface -} - -func (c *ApiextensionsV1beta1Client) CustomResourceDefinitions() CustomResourceDefinitionInterface { - return newCustomResourceDefinitions(c) -} - -// NewForConfig creates a new ApiextensionsV1beta1Client for the given config. -func NewForConfig(c *rest.Config) (*ApiextensionsV1beta1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &ApiextensionsV1beta1Client{client}, nil -} - -// NewForConfigOrDie creates a new ApiextensionsV1beta1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ApiextensionsV1beta1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ApiextensionsV1beta1Client for the given RESTClient. -func New(c rest.Interface) *ApiextensionsV1beta1Client { - return &ApiextensionsV1beta1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *ApiextensionsV1beta1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go deleted file mode 100644 index f25a6ce34..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - scheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// CustomResourceDefinitionsGetter has a method to return a CustomResourceDefinitionInterface. -// A group's client should implement this interface. -type CustomResourceDefinitionsGetter interface { - CustomResourceDefinitions() CustomResourceDefinitionInterface -} - -// CustomResourceDefinitionInterface has methods to work with CustomResourceDefinition resources. -type CustomResourceDefinitionInterface interface { - Create(*v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error) - Update(*v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error) - UpdateStatus(*v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.CustomResourceDefinition, error) - List(opts v1.ListOptions) (*v1beta1.CustomResourceDefinitionList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error) - CustomResourceDefinitionExpansion -} - -// customResourceDefinitions implements CustomResourceDefinitionInterface -type customResourceDefinitions struct { - client rest.Interface -} - -// newCustomResourceDefinitions returns a CustomResourceDefinitions -func newCustomResourceDefinitions(c *ApiextensionsV1beta1Client) *customResourceDefinitions { - return &customResourceDefinitions{ - client: c.RESTClient(), - } -} - -// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any. -func (c *customResourceDefinitions) Get(name string, options v1.GetOptions) (result *v1beta1.CustomResourceDefinition, err error) { - result = &v1beta1.CustomResourceDefinition{} - err = c.client.Get(). - Resource("customresourcedefinitions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors. -func (c *customResourceDefinitions) List(opts v1.ListOptions) (result *v1beta1.CustomResourceDefinitionList, err error) { - result = &v1beta1.CustomResourceDefinitionList{} - err = c.client.Get(). - Resource("customresourcedefinitions"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested customResourceDefinitions. -func (c *customResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Resource("customresourcedefinitions"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. -func (c *customResourceDefinitions) Create(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) { - result = &v1beta1.CustomResourceDefinition{} - err = c.client.Post(). - Resource("customresourcedefinitions"). - Body(customResourceDefinition). - Do(). - Into(result) - return -} - -// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. -func (c *customResourceDefinitions) Update(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) { - result = &v1beta1.CustomResourceDefinition{} - err = c.client.Put(). - Resource("customresourcedefinitions"). - Name(customResourceDefinition.Name). - Body(customResourceDefinition). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *customResourceDefinitions) UpdateStatus(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) { - result = &v1beta1.CustomResourceDefinition{} - err = c.client.Put(). - Resource("customresourcedefinitions"). - Name(customResourceDefinition.Name). - SubResource("status"). - Body(customResourceDefinition). - Do(). - Into(result) - return -} - -// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs. -func (c *customResourceDefinitions) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Resource("customresourcedefinitions"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *customResourceDefinitions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Resource("customresourcedefinitions"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched customResourceDefinition. -func (c *customResourceDefinitions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error) { - result = &v1beta1.CustomResourceDefinition{} - err = c.client.Patch(pt). - Resource("customresourcedefinitions"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/doc.go deleted file mode 100644 index 771101956..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1beta1 diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/fake_apiextensions_client.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/fake_apiextensions_client.go deleted file mode 100644 index 288683ef9..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/fake_apiextensions_client.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeApiextensionsV1beta1 struct { - *testing.Fake -} - -func (c *FakeApiextensionsV1beta1) CustomResourceDefinitions() v1beta1.CustomResourceDefinitionInterface { - return &FakeCustomResourceDefinitions{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeApiextensionsV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/fake_customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/fake_customresourcedefinition.go deleted file mode 100644 index 11aefe869..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake/fake_customresourcedefinition.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeCustomResourceDefinitions implements CustomResourceDefinitionInterface -type FakeCustomResourceDefinitions struct { - Fake *FakeApiextensionsV1beta1 -} - -var customresourcedefinitionsResource = schema.GroupVersionResource{Group: "apiextensions.k8s.io", Version: "v1beta1", Resource: "customresourcedefinitions"} - -var customresourcedefinitionsKind = schema.GroupVersionKind{Group: "apiextensions.k8s.io", Version: "v1beta1", Kind: "CustomResourceDefinition"} - -// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any. -func (c *FakeCustomResourceDefinitions) Get(name string, options v1.GetOptions) (result *v1beta1.CustomResourceDefinition, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(customresourcedefinitionsResource, name), &v1beta1.CustomResourceDefinition{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.CustomResourceDefinition), err -} - -// List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors. -func (c *FakeCustomResourceDefinitions) List(opts v1.ListOptions) (result *v1beta1.CustomResourceDefinitionList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(customresourcedefinitionsResource, customresourcedefinitionsKind, opts), &v1beta1.CustomResourceDefinitionList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.CustomResourceDefinitionList{ListMeta: obj.(*v1beta1.CustomResourceDefinitionList).ListMeta} - for _, item := range obj.(*v1beta1.CustomResourceDefinitionList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested customResourceDefinitions. -func (c *FakeCustomResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(customresourcedefinitionsResource, opts)) -} - -// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. -func (c *FakeCustomResourceDefinitions) Create(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(customresourcedefinitionsResource, customResourceDefinition), &v1beta1.CustomResourceDefinition{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.CustomResourceDefinition), err -} - -// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. -func (c *FakeCustomResourceDefinitions) Update(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(customresourcedefinitionsResource, customResourceDefinition), &v1beta1.CustomResourceDefinition{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.CustomResourceDefinition), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeCustomResourceDefinitions) UpdateStatus(customResourceDefinition *v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(customresourcedefinitionsResource, "status", customResourceDefinition), &v1beta1.CustomResourceDefinition{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.CustomResourceDefinition), err -} - -// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs. -func (c *FakeCustomResourceDefinitions) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(customresourcedefinitionsResource, name), &v1beta1.CustomResourceDefinition{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCustomResourceDefinitions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(customresourcedefinitionsResource, listOptions) - - _, err := c.Fake.Invokes(action, &v1beta1.CustomResourceDefinitionList{}) - return err -} - -// Patch applies the patch and returns the patched customResourceDefinition. -func (c *FakeCustomResourceDefinitions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(customresourcedefinitionsResource, name, data, subresources...), &v1beta1.CustomResourceDefinition{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.CustomResourceDefinition), err -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/generated_expansion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/generated_expansion.go deleted file mode 100644 index 2a989d4be..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -type CustomResourceDefinitionExpansion interface{} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/clientset.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/clientset.go deleted file mode 100644 index 152a9fea0..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/clientset.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package internalclientset - -import ( - apiextensionsinternalversion "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - Apiextensions() apiextensionsinternalversion.ApiextensionsInterface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - apiextensions *apiextensionsinternalversion.ApiextensionsClient -} - -// Apiextensions retrieves the ApiextensionsClient -func (c *Clientset) Apiextensions() apiextensionsinternalversion.ApiextensionsInterface { - return c.apiextensions -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.apiextensions, err = apiextensionsinternalversion.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.apiextensions = apiextensionsinternalversion.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.apiextensions = apiextensionsinternalversion.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/doc.go deleted file mode 100644 index 01b3d5e0f..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package internalclientset diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/fake/clientset_generated.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/fake/clientset_generated.go deleted file mode 100644 index 72ab169e9..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/fake/clientset_generated.go +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - clientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset" - apiextensionsinternalversion "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion" - fakeapiextensionsinternalversion "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/fake" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -var _ clientset.Interface = &Clientset{} - -// Apiextensions retrieves the ApiextensionsClient -func (c *Clientset) Apiextensions() apiextensionsinternalversion.ApiextensionsInterface { - return &fakeapiextensionsinternalversion.FakeApiextensions{Fake: &c.Fake} -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/fake/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/fake/doc.go deleted file mode 100644 index 9b99e7167..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/fake/register.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/fake/register.go deleted file mode 100644 index 884c7095d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/fake/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - apiextensionsinternalversion "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - apiextensionsinternalversion.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/scheme/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/scheme/doc.go deleted file mode 100644 index 7dc375616..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/scheme/register.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/scheme/register.go deleted file mode 100644 index 01df98a6b..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/scheme/register.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - Install(Scheme) -} - -// Install registers the API group and adds types to a scheme -func Install(scheme *runtime.Scheme) { - apiextensions.Install(scheme) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/apiextensions_client.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/apiextensions_client.go deleted file mode 100644 index 31b34404c..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/apiextensions_client.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package internalversion - -import ( - "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/scheme" - rest "k8s.io/client-go/rest" -) - -type ApiextensionsInterface interface { - RESTClient() rest.Interface - CustomResourceDefinitionsGetter -} - -// ApiextensionsClient is used to interact with features provided by the apiextensions.k8s.io group. -type ApiextensionsClient struct { - restClient rest.Interface -} - -func (c *ApiextensionsClient) CustomResourceDefinitions() CustomResourceDefinitionInterface { - return newCustomResourceDefinitions(c) -} - -// NewForConfig creates a new ApiextensionsClient for the given config. -func NewForConfig(c *rest.Config) (*ApiextensionsClient, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &ApiextensionsClient{client}, nil -} - -// NewForConfigOrDie creates a new ApiextensionsClient for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ApiextensionsClient { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ApiextensionsClient for the given RESTClient. -func New(c rest.Interface) *ApiextensionsClient { - return &ApiextensionsClient{c} -} - -func setConfigDefaults(config *rest.Config) error { - config.APIPath = "/apis" - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - if config.GroupVersion == nil || config.GroupVersion.Group != scheme.Scheme.PrioritizedVersionsForGroup("apiextensions.k8s.io")[0].Group { - gv := scheme.Scheme.PrioritizedVersionsForGroup("apiextensions.k8s.io")[0] - config.GroupVersion = &gv - } - config.NegotiatedSerializer = scheme.Codecs - - if config.QPS == 0 { - config.QPS = 5 - } - if config.Burst == 0 { - config.Burst = 10 - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *ApiextensionsClient) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/customresourcedefinition.go deleted file mode 100644 index f3ddc8044..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/customresourcedefinition.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package internalversion - -import ( - apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - scheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// CustomResourceDefinitionsGetter has a method to return a CustomResourceDefinitionInterface. -// A group's client should implement this interface. -type CustomResourceDefinitionsGetter interface { - CustomResourceDefinitions() CustomResourceDefinitionInterface -} - -// CustomResourceDefinitionInterface has methods to work with CustomResourceDefinition resources. -type CustomResourceDefinitionInterface interface { - Create(*apiextensions.CustomResourceDefinition) (*apiextensions.CustomResourceDefinition, error) - Update(*apiextensions.CustomResourceDefinition) (*apiextensions.CustomResourceDefinition, error) - UpdateStatus(*apiextensions.CustomResourceDefinition) (*apiextensions.CustomResourceDefinition, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*apiextensions.CustomResourceDefinition, error) - List(opts v1.ListOptions) (*apiextensions.CustomResourceDefinitionList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apiextensions.CustomResourceDefinition, err error) - CustomResourceDefinitionExpansion -} - -// customResourceDefinitions implements CustomResourceDefinitionInterface -type customResourceDefinitions struct { - client rest.Interface -} - -// newCustomResourceDefinitions returns a CustomResourceDefinitions -func newCustomResourceDefinitions(c *ApiextensionsClient) *customResourceDefinitions { - return &customResourceDefinitions{ - client: c.RESTClient(), - } -} - -// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any. -func (c *customResourceDefinitions) Get(name string, options v1.GetOptions) (result *apiextensions.CustomResourceDefinition, err error) { - result = &apiextensions.CustomResourceDefinition{} - err = c.client.Get(). - Resource("customresourcedefinitions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors. -func (c *customResourceDefinitions) List(opts v1.ListOptions) (result *apiextensions.CustomResourceDefinitionList, err error) { - result = &apiextensions.CustomResourceDefinitionList{} - err = c.client.Get(). - Resource("customresourcedefinitions"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested customResourceDefinitions. -func (c *customResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Resource("customresourcedefinitions"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. -func (c *customResourceDefinitions) Create(customResourceDefinition *apiextensions.CustomResourceDefinition) (result *apiextensions.CustomResourceDefinition, err error) { - result = &apiextensions.CustomResourceDefinition{} - err = c.client.Post(). - Resource("customresourcedefinitions"). - Body(customResourceDefinition). - Do(). - Into(result) - return -} - -// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. -func (c *customResourceDefinitions) Update(customResourceDefinition *apiextensions.CustomResourceDefinition) (result *apiextensions.CustomResourceDefinition, err error) { - result = &apiextensions.CustomResourceDefinition{} - err = c.client.Put(). - Resource("customresourcedefinitions"). - Name(customResourceDefinition.Name). - Body(customResourceDefinition). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *customResourceDefinitions) UpdateStatus(customResourceDefinition *apiextensions.CustomResourceDefinition) (result *apiextensions.CustomResourceDefinition, err error) { - result = &apiextensions.CustomResourceDefinition{} - err = c.client.Put(). - Resource("customresourcedefinitions"). - Name(customResourceDefinition.Name). - SubResource("status"). - Body(customResourceDefinition). - Do(). - Into(result) - return -} - -// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs. -func (c *customResourceDefinitions) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Resource("customresourcedefinitions"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *customResourceDefinitions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Resource("customresourcedefinitions"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched customResourceDefinition. -func (c *customResourceDefinitions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apiextensions.CustomResourceDefinition, err error) { - result = &apiextensions.CustomResourceDefinition{} - err = c.client.Patch(pt). - Resource("customresourcedefinitions"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/doc.go deleted file mode 100644 index 86602442b..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package internalversion diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/fake/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/fake/fake_apiextensions_client.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/fake/fake_apiextensions_client.go deleted file mode 100644 index 1a601e5b0..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/fake/fake_apiextensions_client.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - internalversion "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeApiextensions struct { - *testing.Fake -} - -func (c *FakeApiextensions) CustomResourceDefinitions() internalversion.CustomResourceDefinitionInterface { - return &FakeCustomResourceDefinitions{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeApiextensions) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/fake/fake_customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/fake/fake_customresourcedefinition.go deleted file mode 100644 index 74016362d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/fake/fake_customresourcedefinition.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeCustomResourceDefinitions implements CustomResourceDefinitionInterface -type FakeCustomResourceDefinitions struct { - Fake *FakeApiextensions -} - -var customresourcedefinitionsResource = schema.GroupVersionResource{Group: "apiextensions.k8s.io", Version: "", Resource: "customresourcedefinitions"} - -var customresourcedefinitionsKind = schema.GroupVersionKind{Group: "apiextensions.k8s.io", Version: "", Kind: "CustomResourceDefinition"} - -// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any. -func (c *FakeCustomResourceDefinitions) Get(name string, options v1.GetOptions) (result *apiextensions.CustomResourceDefinition, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(customresourcedefinitionsResource, name), &apiextensions.CustomResourceDefinition{}) - if obj == nil { - return nil, err - } - return obj.(*apiextensions.CustomResourceDefinition), err -} - -// List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors. -func (c *FakeCustomResourceDefinitions) List(opts v1.ListOptions) (result *apiextensions.CustomResourceDefinitionList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(customresourcedefinitionsResource, customresourcedefinitionsKind, opts), &apiextensions.CustomResourceDefinitionList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &apiextensions.CustomResourceDefinitionList{ListMeta: obj.(*apiextensions.CustomResourceDefinitionList).ListMeta} - for _, item := range obj.(*apiextensions.CustomResourceDefinitionList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested customResourceDefinitions. -func (c *FakeCustomResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(customresourcedefinitionsResource, opts)) -} - -// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. -func (c *FakeCustomResourceDefinitions) Create(customResourceDefinition *apiextensions.CustomResourceDefinition) (result *apiextensions.CustomResourceDefinition, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(customresourcedefinitionsResource, customResourceDefinition), &apiextensions.CustomResourceDefinition{}) - if obj == nil { - return nil, err - } - return obj.(*apiextensions.CustomResourceDefinition), err -} - -// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. -func (c *FakeCustomResourceDefinitions) Update(customResourceDefinition *apiextensions.CustomResourceDefinition) (result *apiextensions.CustomResourceDefinition, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(customresourcedefinitionsResource, customResourceDefinition), &apiextensions.CustomResourceDefinition{}) - if obj == nil { - return nil, err - } - return obj.(*apiextensions.CustomResourceDefinition), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeCustomResourceDefinitions) UpdateStatus(customResourceDefinition *apiextensions.CustomResourceDefinition) (*apiextensions.CustomResourceDefinition, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(customresourcedefinitionsResource, "status", customResourceDefinition), &apiextensions.CustomResourceDefinition{}) - if obj == nil { - return nil, err - } - return obj.(*apiextensions.CustomResourceDefinition), err -} - -// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs. -func (c *FakeCustomResourceDefinitions) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(customresourcedefinitionsResource, name), &apiextensions.CustomResourceDefinition{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCustomResourceDefinitions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(customresourcedefinitionsResource, listOptions) - - _, err := c.Fake.Invokes(action, &apiextensions.CustomResourceDefinitionList{}) - return err -} - -// Patch applies the patch and returns the patched customResourceDefinition. -func (c *FakeCustomResourceDefinitions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apiextensions.CustomResourceDefinition, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(customresourcedefinitionsResource, name, data, subresources...), &apiextensions.CustomResourceDefinition{}) - if obj == nil { - return nil, err - } - return obj.(*apiextensions.CustomResourceDefinition), err -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/generated_expansion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/generated_expansion.go deleted file mode 100644 index a88821021..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package internalversion - -type CustomResourceDefinitionExpansion interface{} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/interface.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/interface.go deleted file mode 100644 index 7b48c57ca..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package apiextensions - -import ( - v1beta1 "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1" - internalinterfaces "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1beta1 provides access to shared informers for resources in V1beta1. - V1beta1() v1beta1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1beta1 returns a new v1beta1.Interface. -func (g *group) V1beta1() v1beta1.Interface { - return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1/customresourcedefinition.go deleted file mode 100644 index 05e8c4217..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1/customresourcedefinition.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1beta1 - -import ( - time "time" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - clientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - internalinterfaces "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/internalinterfaces" - v1beta1 "k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// CustomResourceDefinitionInformer provides access to a shared informer and lister for -// CustomResourceDefinitions. -type CustomResourceDefinitionInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1beta1.CustomResourceDefinitionLister -} - -type customResourceDefinitionInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewCustomResourceDefinitionInformer constructs a new informer for CustomResourceDefinition type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewCustomResourceDefinitionInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredCustomResourceDefinitionInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredCustomResourceDefinitionInformer constructs a new informer for CustomResourceDefinition type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredCustomResourceDefinitionInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ApiextensionsV1beta1().CustomResourceDefinitions().List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ApiextensionsV1beta1().CustomResourceDefinitions().Watch(options) - }, - }, - &apiextensionsv1beta1.CustomResourceDefinition{}, - resyncPeriod, - indexers, - ) -} - -func (f *customResourceDefinitionInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredCustomResourceDefinitionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *customResourceDefinitionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiextensionsv1beta1.CustomResourceDefinition{}, f.defaultInformer) -} - -func (f *customResourceDefinitionInformer) Lister() v1beta1.CustomResourceDefinitionLister { - return v1beta1.NewCustomResourceDefinitionLister(f.Informer().GetIndexer()) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1/interface.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1/interface.go deleted file mode 100644 index f78edbb59..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1beta1 - -import ( - internalinterfaces "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // CustomResourceDefinitions returns a CustomResourceDefinitionInformer. - CustomResourceDefinitions() CustomResourceDefinitionInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// CustomResourceDefinitions returns a CustomResourceDefinitionInformer. -func (v *version) CustomResourceDefinitions() CustomResourceDefinitionInformer { - return &customResourceDefinitionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/factory.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/factory.go deleted file mode 100644 index 94d039c72..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/factory.go +++ /dev/null @@ -1,180 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - reflect "reflect" - sync "sync" - time "time" - - clientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - apiextensions "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions" - internalinterfaces "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/internalinterfaces" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client clientset.Interface - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc - lock sync.Mutex - defaultResync time.Duration - customResync map[reflect.Type]time.Duration - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client clientset.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client clientset.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client clientset.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - customResync: make(map[reflect.Type]time.Duration), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -// Start initializes all requested informers. -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - go informer.Run(stopCh) - f.startedInformers[informerType] = true - } - } -} - -// WaitForCacheSync waits for all started informers' cache were synced. -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InternalInformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - Apiextensions() apiextensions.Interface -} - -func (f *sharedInformerFactory) Apiextensions() apiextensions.Interface { - return apiextensions.New(f, f.namespace, f.tweakListOptions) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/generic.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/generic.go deleted file mode 100644 index da8a2ab0c..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/generic.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - "fmt" - - v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - // Group=apiextensions.k8s.io, Version=v1beta1 - case v1beta1.SchemeGroupVersion.WithResource("customresourcedefinitions"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Apiextensions().V1beta1().CustomResourceDefinitions().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go deleted file mode 100644 index 3b17f5a1a..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalinterfaces - -import ( - time "time" - - clientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - cache "k8s.io/client-go/tools/cache" -) - -type NewInformerFunc func(clientset.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} - -type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/interface.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/interface.go deleted file mode 100644 index 8236e2acc..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package apiextensions - -import ( - internalversion "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion" - internalinterfaces "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/internalinterfaces" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // InternalVersion provides access to shared informers for resources in InternalVersion. - InternalVersion() internalversion.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// InternalVersion returns a new internalversion.Interface. -func (g *group) InternalVersion() internalversion.Interface { - return internalversion.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion/customresourcedefinition.go deleted file mode 100644 index 2c54f3ce5..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion/customresourcedefinition.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalversion - -import ( - time "time" - - apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - internalclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset" - internalinterfaces "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/internalinterfaces" - internalversion "k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// CustomResourceDefinitionInformer provides access to a shared informer and lister for -// CustomResourceDefinitions. -type CustomResourceDefinitionInformer interface { - Informer() cache.SharedIndexInformer - Lister() internalversion.CustomResourceDefinitionLister -} - -type customResourceDefinitionInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewCustomResourceDefinitionInformer constructs a new informer for CustomResourceDefinition type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewCustomResourceDefinitionInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredCustomResourceDefinitionInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredCustomResourceDefinitionInformer constructs a new informer for CustomResourceDefinition type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredCustomResourceDefinitionInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.Apiextensions().CustomResourceDefinitions().List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.Apiextensions().CustomResourceDefinitions().Watch(options) - }, - }, - &apiextensions.CustomResourceDefinition{}, - resyncPeriod, - indexers, - ) -} - -func (f *customResourceDefinitionInformer) defaultInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredCustomResourceDefinitionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *customResourceDefinitionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiextensions.CustomResourceDefinition{}, f.defaultInformer) -} - -func (f *customResourceDefinitionInformer) Lister() internalversion.CustomResourceDefinitionLister { - return internalversion.NewCustomResourceDefinitionLister(f.Informer().GetIndexer()) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion/interface.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion/interface.go deleted file mode 100644 index d9444144b..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalversion - -import ( - internalinterfaces "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // CustomResourceDefinitions returns a CustomResourceDefinitionInformer. - CustomResourceDefinitions() CustomResourceDefinitionInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// CustomResourceDefinitions returns a CustomResourceDefinitionInformer. -func (v *version) CustomResourceDefinitions() CustomResourceDefinitionInformer { - return &customResourceDefinitionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/factory.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/factory.go deleted file mode 100644 index 84b04523d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/factory.go +++ /dev/null @@ -1,180 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalversion - -import ( - reflect "reflect" - sync "sync" - time "time" - - internalclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset" - apiextensions "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions" - internalinterfaces "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/internalinterfaces" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client internalclientset.Interface - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc - lock sync.Mutex - defaultResync time.Duration - customResync map[reflect.Type]time.Duration - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client internalclientset.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client internalclientset.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client internalclientset.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - customResync: make(map[reflect.Type]time.Duration), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -// Start initializes all requested informers. -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - go informer.Run(stopCh) - f.startedInformers[informerType] = true - } - } -} - -// WaitForCacheSync waits for all started informers' cache were synced. -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InternalInformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - Apiextensions() apiextensions.Interface -} - -func (f *sharedInformerFactory) Apiextensions() apiextensions.Interface { - return apiextensions.New(f, f.namespace, f.tweakListOptions) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/generic.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/generic.go deleted file mode 100644 index c12c44074..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/generic.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalversion - -import ( - "fmt" - - apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - // Group=apiextensions.k8s.io, Version=internalVersion - case apiextensions.SchemeGroupVersion.WithResource("customresourcedefinitions"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Apiextensions().InternalVersion().CustomResourceDefinitions().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/internalinterfaces/factory_interfaces.go deleted file mode 100644 index 5854db0ca..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalinterfaces - -import ( - time "time" - - internalclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - cache "k8s.io/client-go/tools/cache" -) - -type NewInformerFunc func(internalclientset.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} - -type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion/customresourcedefinition.go deleted file mode 100644 index f64f01d9d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion/customresourcedefinition.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package internalversion - -import ( - apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// CustomResourceDefinitionLister helps list CustomResourceDefinitions. -type CustomResourceDefinitionLister interface { - // List lists all CustomResourceDefinitions in the indexer. - List(selector labels.Selector) (ret []*apiextensions.CustomResourceDefinition, err error) - // Get retrieves the CustomResourceDefinition from the index for a given name. - Get(name string) (*apiextensions.CustomResourceDefinition, error) - CustomResourceDefinitionListerExpansion -} - -// customResourceDefinitionLister implements the CustomResourceDefinitionLister interface. -type customResourceDefinitionLister struct { - indexer cache.Indexer -} - -// NewCustomResourceDefinitionLister returns a new CustomResourceDefinitionLister. -func NewCustomResourceDefinitionLister(indexer cache.Indexer) CustomResourceDefinitionLister { - return &customResourceDefinitionLister{indexer: indexer} -} - -// List lists all CustomResourceDefinitions in the indexer. -func (s *customResourceDefinitionLister) List(selector labels.Selector) (ret []*apiextensions.CustomResourceDefinition, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*apiextensions.CustomResourceDefinition)) - }) - return ret, err -} - -// Get retrieves the CustomResourceDefinition from the index for a given name. -func (s *customResourceDefinitionLister) Get(name string) (*apiextensions.CustomResourceDefinition, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(apiextensions.Resource("customresourcedefinition"), name) - } - return obj.(*apiextensions.CustomResourceDefinition), nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion/expansion_generated.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion/expansion_generated.go deleted file mode 100644 index 5e3ae381d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion/expansion_generated.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package internalversion - -// CustomResourceDefinitionListerExpansion allows custom methods to be added to -// CustomResourceDefinitionLister. -type CustomResourceDefinitionListerExpansion interface{} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1/customresourcedefinition.go deleted file mode 100644 index 87633217b..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1/customresourcedefinition.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// CustomResourceDefinitionLister helps list CustomResourceDefinitions. -type CustomResourceDefinitionLister interface { - // List lists all CustomResourceDefinitions in the indexer. - List(selector labels.Selector) (ret []*v1beta1.CustomResourceDefinition, err error) - // Get retrieves the CustomResourceDefinition from the index for a given name. - Get(name string) (*v1beta1.CustomResourceDefinition, error) - CustomResourceDefinitionListerExpansion -} - -// customResourceDefinitionLister implements the CustomResourceDefinitionLister interface. -type customResourceDefinitionLister struct { - indexer cache.Indexer -} - -// NewCustomResourceDefinitionLister returns a new CustomResourceDefinitionLister. -func NewCustomResourceDefinitionLister(indexer cache.Indexer) CustomResourceDefinitionLister { - return &customResourceDefinitionLister{indexer: indexer} -} - -// List lists all CustomResourceDefinitions in the indexer. -func (s *customResourceDefinitionLister) List(selector labels.Selector) (ret []*v1beta1.CustomResourceDefinition, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.CustomResourceDefinition)) - }) - return ret, err -} - -// Get retrieves the CustomResourceDefinition from the index for a given name. -func (s *customResourceDefinitionLister) Get(name string) (*v1beta1.CustomResourceDefinition, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("customresourcedefinition"), name) - } - return obj.(*v1beta1.CustomResourceDefinition), nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1/expansion_generated.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1/expansion_generated.go deleted file mode 100644 index 429782deb..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1/expansion_generated.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1beta1 - -// CustomResourceDefinitionListerExpansion allows custom methods to be added to -// CustomResourceDefinitionLister. -type CustomResourceDefinitionListerExpansion interface{} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/options/options.go b/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/options/options.go deleted file mode 100644 index 995a31555..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/options/options.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -Copyright 2018 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 options - -import ( - "fmt" - "io" - "net" - - "github.com/spf13/pflag" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/pkg/apiserver" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - utilerrors "k8s.io/apimachinery/pkg/util/errors" - genericregistry "k8s.io/apiserver/pkg/registry/generic" - genericapiserver "k8s.io/apiserver/pkg/server" - genericoptions "k8s.io/apiserver/pkg/server/options" -) - -const defaultEtcdPathPrefix = "/registry/apiextensions.kubernetes.io" - -// CustomResourceDefinitionsServerOptions describes the runtime options of an apiextensions-apiserver. -type CustomResourceDefinitionsServerOptions struct { - RecommendedOptions *genericoptions.RecommendedOptions - APIEnablement *genericoptions.APIEnablementOptions - - StdOut io.Writer - StdErr io.Writer -} - -// NewCustomResourceDefinitionsServerOptions creates default options of an apiextensions-apiserver. -func NewCustomResourceDefinitionsServerOptions(out, errOut io.Writer) *CustomResourceDefinitionsServerOptions { - o := &CustomResourceDefinitionsServerOptions{ - RecommendedOptions: genericoptions.NewRecommendedOptions(defaultEtcdPathPrefix, apiserver.Codecs.LegacyCodec(v1beta1.SchemeGroupVersion)), - APIEnablement: genericoptions.NewAPIEnablementOptions(), - - StdOut: out, - StdErr: errOut, - } - - return o -} - -// AddFlags adds the apiextensions-apiserver flags to the flagset. -func (o CustomResourceDefinitionsServerOptions) AddFlags(fs *pflag.FlagSet) { - o.RecommendedOptions.AddFlags(fs) - o.APIEnablement.AddFlags(fs) -} - -// Validate validates the apiextensions-apiserver options. -func (o CustomResourceDefinitionsServerOptions) Validate() error { - errors := []error{} - errors = append(errors, o.RecommendedOptions.Validate()...) - errors = append(errors, o.APIEnablement.Validate(apiserver.Scheme)...) - return utilerrors.NewAggregate(errors) -} - -// Complete fills in missing options. -func (o *CustomResourceDefinitionsServerOptions) Complete() error { - return nil -} - -// Config returns an apiextensions-apiserver configuration. -func (o CustomResourceDefinitionsServerOptions) Config() (*apiserver.Config, error) { - // TODO have a "real" external address - if err := o.RecommendedOptions.SecureServing.MaybeDefaultWithSelfSignedCerts("localhost", nil, []net.IP{net.ParseIP("127.0.0.1")}); err != nil { - return nil, fmt.Errorf("error creating self-signed certificates: %v", err) - } - - serverConfig := genericapiserver.NewRecommendedConfig(apiserver.Codecs) - if err := o.RecommendedOptions.ApplyTo(serverConfig, apiserver.Scheme); err != nil { - return nil, err - } - if err := o.APIEnablement.ApplyTo(&serverConfig.Config, apiserver.DefaultAPIResourceConfigSource(), apiserver.Scheme); err != nil { - return nil, err - } - - config := &apiserver.Config{ - GenericConfig: serverConfig, - ExtraConfig: apiserver.ExtraConfig{ - CRDRESTOptionsGetter: NewCRDRESTOptionsGetter(*o.RecommendedOptions.Etcd), - }, - } - return config, nil -} - -// NewCRDRESTOptionsGetter create a RESTOptionsGetter for CustomResources. -func NewCRDRESTOptionsGetter(etcdOptions genericoptions.EtcdOptions) genericregistry.RESTOptionsGetter { - ret := apiserver.CRDRESTOptionsGetter{ - StorageConfig: etcdOptions.StorageConfig, - StoragePrefix: etcdOptions.StorageConfig.Prefix, - EnableWatchCache: etcdOptions.EnableWatchCache, - DefaultWatchCacheSize: etcdOptions.DefaultWatchCacheSize, - EnableGarbageCollection: etcdOptions.EnableGarbageCollection, - DeleteCollectionWorkers: etcdOptions.DeleteCollectionWorkers, - CountMetricPollPeriod: etcdOptions.StorageConfig.CountMetricPollPeriod, - } - ret.StorageConfig.Codec = unstructured.UnstructuredJSONScheme - - return ret -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/server.go b/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/server.go deleted file mode 100644 index b30b9cb65..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/server.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2018 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 server - -import ( - "io" - - "github.com/spf13/cobra" - - "k8s.io/apiextensions-apiserver/pkg/cmd/server/options" - genericapiserver "k8s.io/apiserver/pkg/server" -) - -func NewServerCommand(out, errOut io.Writer, stopCh <-chan struct{}) *cobra.Command { - o := options.NewCustomResourceDefinitionsServerOptions(out, errOut) - - cmd := &cobra.Command{ - Short: "Launch an API extensions API server", - Long: "Launch an API extensions API server", - RunE: func(c *cobra.Command, args []string) error { - if err := o.Complete(); err != nil { - return err - } - if err := o.Validate(); err != nil { - return err - } - if err := Run(o, stopCh); err != nil { - return err - } - return nil - }, - } - - fs := cmd.Flags() - o.AddFlags(fs) - return cmd -} - -func Run(o *options.CustomResourceDefinitionsServerOptions, stopCh <-chan struct{}) error { - config, err := o.Config() - if err != nil { - return err - } - - server, err := config.Complete().New(genericapiserver.NewEmptyDelegate()) - if err != nil { - return err - } - return server.GenericAPIServer.PrepareRun().Run(stopCh) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testdata/localhost_127.0.0.1_localhost.crt b/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testdata/localhost_127.0.0.1_localhost.crt deleted file mode 100644 index 6143ecc60..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testdata/localhost_127.0.0.1_localhost.crt +++ /dev/null @@ -1,37 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDGjCCAgKgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdsb2Nh -bGhvc3QtY2FAMTUzMTQ2ODA4NTAgFw0xODA3MTMwNjQ4MDVaGA8yMTE4MDYxOTA2 -NDgwNVowHzEdMBsGA1UEAwwUbG9jYWxob3N0QDE1MzE0NjgwODYwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDC9Qfx1YAEp+wrSIjbinWw3pWIDbf57Lut -fXgS84ilZpc7M2zeu1QrPyhCedL/gPP0QxKbPS6AR5R/DibH4RWcujL6CU5FB0Y9 -on+IpN/Iml2XzgGiU82gTkJg185VgWwDaHOPKvUF9N1GpvxcSvRsNGoiBJ/LlE4N -hxyUQ0V/lAalYxYybxgl8/xghWMkGnQc3YKWKqGmtBaaax3xvMzamxpWPphoLG07 -+YZfAf0Q7vslVMmlslRmx9OpJFvRnkelbXoHHx73umbMiFp28njY8NK2dqXwb6Z8 -0BCezppCKYpbjnupOIDAAE0KvjzhhzSS68ZgukiBZOcUlnWLzL39AgMBAAGjXDBa -MA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8E -AjAAMCUGA1UdEQQeMByCCWxvY2FsaG9zdIIJbG9jYWxob3N0hwR/AAABMA0GCSqG -SIb3DQEBCwUAA4IBAQBm9Z15QxsRqoaRDh/ELA93eE9105gwrXrR3AK/iKuJyxIc -/SXVbpAaYHArMrUzaZs0GXEzgW31tZn8D3dgFy8XdZxk1ztaFTm+QTnFRogMNB8A -kvpq7jwTa44c7G0wuNO2nATMu2Ifi/nSdQadTxzmZacSrevN/zcjmvSoV4VFkKO5 -VBnr7e1ruffxAaVAzrRraplpZvuJzlcvqTYAME8fq8H9QidvaXF6yIbEPwwUHK67 -8W4rXn9Zp6NDuQhH0eNPAGlEAaYuyCJvJZeM68ootMi7Uh6RJOTDw1HIdekYEr1/ -FAg4+rH/9Gi+o/LXsBmYXabO+GjsOwfezv3THDnw ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIC5DCCAcygAwIBAgIBATANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdsb2Nh -bGhvc3QtY2FAMTUzMTQ2ODA4NTAgFw0xODA3MTMwNjQ4MDVaGA8yMTE4MDYxOTA2 -NDgwNVowIjEgMB4GA1UEAwwXbG9jYWxob3N0LWNhQDE1MzE0NjgwODUwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDFDtkZLlseubpzPQr1IT3xE28/1cDM -3UB2vp+pbiwvkmHvfm9RxMmDZbYWqXL5beCG/ladHaJ0RW4f3sBPzxDzUP1zFM94 -iYDZmVA0f7ZvtijuiUrwc6TP21ctX5TlN2YYoh4Er+aZ6E5MQIMAxkP+w1lwyYmj -oxopD1wf/4cmZgv9axZV1zR5MrpyVboQa4mQRUoMlLQFE0erMc0yIJsIVWXx9yS7 -9dzhEXC2WPYnPHh6AYSQZBdzumj5HdZhOQhL/UOWq6AJGP1p7l0uXPArmDG0g9pS -aFxAQx6IxtdSUOZFBlel/p+iOab3H8eoNkgCPMXmrM3WZLW7Uy5Onx6LAgMBAAGj -IzAhMA4GA1UdDwEB/wQEAwICpDAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB -CwUAA4IBAQC0BaURRhpRbORaOiZJFeQR0gCD9goggXNj+cPh8yYol2GNBdLfed6x -B6ZxGW2Y14pOjo2Ba5FdZyzfOenjhkqhUujQSMxKjkWxX03blLjPEvLo/Wi6TLnp -H3Qmm/Gq1GAxmkZUaovcE71/zpZ/lJLWVVxz21wxcGQIA30DUKgdycfOvWdYkYGf -tnsXpY4yIyHvKvfeIbxo8doBnoRvYd4a7QyY0zw/Q3qaCdINo9zKJYV0CnpSZhKy -5RLcrlfvXttEYryP57RWP9GYJMNmiovGcbls4pOwZMNueUx5qEzIbC9lsfyt13Bc -oZ1lk1TqzwJERoALmgT0ccp7LRxIV90P ------END CERTIFICATE----- diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testdata/localhost_127.0.0.1_localhost.key b/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testdata/localhost_127.0.0.1_localhost.key deleted file mode 100644 index 3d652c869..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testdata/localhost_127.0.0.1_localhost.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpgIBAAKCAQEAwvUH8dWABKfsK0iI24p1sN6ViA23+ey7rX14EvOIpWaXOzNs -3rtUKz8oQnnS/4Dz9EMSmz0ugEeUfw4mx+EVnLoy+glORQdGPaJ/iKTfyJpdl84B -olPNoE5CYNfOVYFsA2hzjyr1BfTdRqb8XEr0bDRqIgSfy5RODYcclENFf5QGpWMW -Mm8YJfP8YIVjJBp0HN2CliqhprQWmmsd8bzM2psaVj6YaCxtO/mGXwH9EO77JVTJ -pbJUZsfTqSRb0Z5HpW16Bx8e97pmzIhadvJ42PDStnal8G+mfNAQns6aQimKW457 -qTiAwABNCr484Yc0kuvGYLpIgWTnFJZ1i8y9/QIDAQABAoIBAQC3rgioLpEI0fVO -6m4W+iLcWznjD5nQnNxOHrJsmIqb20aM/myKhVBN1pll2EWVeLdf4Xm8TS5sqgQc -mQast0KXgU7aCL53ht0E4P7rjPtSky2vAubDO9W2PUWI3IqIQQG1TEnkD4L+868v -C9EkW3JiKBf+qQCs27OWR0AD6EWoZfc9NT5AVnL1aTwKnLpSt80umXUMmR5c4ddT -58FO9JgZCzHbcoAyosf4v8fiz588zjBDRRienHourxmUnsKJrIyCMrygBpQ7wIcO -R86e+PuQ+toeSbldq8EfN/XoY0POUvLL/zu6HkbZLhOEjEHQMkMRCMtmLCjuU+sy -TwdRl0xBAoGBAOtC+kqh5eYgQAYtvPaW/XQwrang+G2xIYd/OTXzIlU2T3sTPrDo -IEkwsXwAeKcJx+Z7XcipSG5l1s5QZbc+GIARmJ0DrAwLkDhlwz8RssxBY4q64Jtn -FWRm6CBJkPDq4t16ZbXDdUleXAaqbvxTTnPZMz2o1XHEDpUcPG29MnF1AoGBANQk -hh44qY3IUxRwp6ZoNHVRz7oJC2JLj1++QNoLXX/8LWTXd49RZpI7Byk2lEXl7clf -3rErBuWElrxxuikOahEdzkjKSZq4RSKj1lNpy14spBRo7O9Q+GrJgcr3tcuyT6ri -sXOo6ET5bG72j+uVzv/QbuyCS8elZQHifBIi58FpAoGBAIXsQ8TWcqPUuf2KbeZF -v5Qz3bg1y9XNnpOedbfjZyjw2L/sDaTxDuf7Ix2+uvADnlry4UlILGZD7MrXc3+j -hpjo62J+Y6MbtgaUz1eIwKqLkpm3lgKA5OmZtwwiNLMgUvLXKS0WTh7s6yAUR0e2 -OJO0EfpIsPCpNc/mGfQyXpO9AoGBANEVblo63mGvHrL2lUWdTpaSm3lvkJjAf/6N -NL2yleSeVt8cvemzALT/GH+2G00I4OOoaYOUNKfhle8E58WvPzq/daCoPwMOupT5 -hTORAa8/sDetclgsJaqaECJLIhIxG/QAmYS05LeWXRjASfiXHf1jIPBZOvb6PCMv -Zbk6TdCBAoGBAIxT9W5FhHl+uUpuHIuFvCUg0AoERk9dUPXVEz1C1lqsYfetZ0uz -wh9KtFq2puWrez+K4o04LoInXHFeb34Hx/9SRDCTawmMicuLxivbTm4yjG2RsShl -nbq376nyawu9rcjM3F5ucYLiGHmQOPYWSOvGr2QhGgFgzXiBQ1RcAYdH ------END RSA PRIVATE KEY----- diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testserver.go b/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testserver.go deleted file mode 100644 index 3d705576f..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/testing/testserver.go +++ /dev/null @@ -1,211 +0,0 @@ -/* -Copyright 2018 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 ( - "fmt" - "io/ioutil" - "net" - "os" - "path" - "runtime" - "time" - - "github.com/spf13/pflag" - - "k8s.io/apiextensions-apiserver/pkg/cmd/server/options" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apiserver/pkg/registry/generic/registry" - genericapiserver "k8s.io/apiserver/pkg/server" - "k8s.io/apiserver/pkg/storage/storagebackend" - "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" -) - -// TearDownFunc is to be called to tear down a test server. -type TearDownFunc func() - -// TestServerInstanceOptions Instance options the TestServer -type TestServerInstanceOptions struct { - // DisableStorageCleanup Disable the automatic storage cleanup - DisableStorageCleanup bool -} - -// TestServer return values supplied by kube-test-ApiServer -type TestServer struct { - ClientConfig *restclient.Config // Rest client config - ServerOpts *options.CustomResourceDefinitionsServerOptions // ServerOpts - TearDownFn TearDownFunc // TearDown function - TmpDir string // Temp Dir used, by the apiserver -} - -// Logger allows t.Testing and b.Testing to be passed to StartTestServer and StartTestServerOrDie -type Logger interface { - Errorf(format string, args ...interface{}) - Fatalf(format string, args ...interface{}) - Logf(format string, args ...interface{}) -} - -// NewDefaultTestServerOptions Default options for TestServer instances -func NewDefaultTestServerOptions() *TestServerInstanceOptions { - return &TestServerInstanceOptions{ - DisableStorageCleanup: false, - } -} - -// StartTestServer starts a apiextensions-apiserver. A rest client config and a tear-down func, -// and location of the tmpdir are returned. -// -// Note: we return a tear-down func instead of a stop channel because the later will leak temporary -// files that because Golang testing's call to os.Exit will not give a stop channel go routine -// enough time to remove temporary files. -func StartTestServer(t Logger, instanceOptions *TestServerInstanceOptions, customFlags []string, storageConfig *storagebackend.Config) (result TestServer, err error) { - if instanceOptions == nil { - instanceOptions = NewDefaultTestServerOptions() - } - - // TODO : Remove TrackStorageCleanup below when PR - // https://github.com/kubernetes/kubernetes/pull/50690 - // merges as that shuts down storage properly - if !instanceOptions.DisableStorageCleanup { - registry.TrackStorageCleanup() - } - - stopCh := make(chan struct{}) - tearDown := func() { - if !instanceOptions.DisableStorageCleanup { - registry.CleanupStorage() - } - close(stopCh) - if len(result.TmpDir) != 0 { - os.RemoveAll(result.TmpDir) - } - } - defer func() { - if result.TearDownFn == nil { - tearDown() - } - }() - - result.TmpDir, err = ioutil.TempDir("", "apiextensions-apiserver") - if err != nil { - return result, fmt.Errorf("failed to create temp dir: %v", err) - } - - fs := pflag.NewFlagSet("test", pflag.PanicOnError) - - s := options.NewCustomResourceDefinitionsServerOptions(os.Stdout, os.Stderr) - s.AddFlags(fs) - - s.RecommendedOptions.SecureServing.Listener, s.RecommendedOptions.SecureServing.BindPort, err = createLocalhostListenerOnFreePort() - if err != nil { - return result, fmt.Errorf("failed to create listener: %v", err) - } - s.RecommendedOptions.SecureServing.ServerCert.CertDirectory = result.TmpDir - s.RecommendedOptions.SecureServing.ExternalAddress = s.RecommendedOptions.SecureServing.Listener.Addr().(*net.TCPAddr).IP // use listener addr although it is a loopback device - - _, thisFile, _, ok := runtime.Caller(0) - if !ok { - return result, fmt.Errorf("failed to get current file") - } - s.RecommendedOptions.SecureServing.ServerCert.FixtureDirectory = path.Join(path.Dir(thisFile), "testdata") - - if storageConfig != nil { - s.RecommendedOptions.Etcd.StorageConfig = *storageConfig - } - s.APIEnablement.RuntimeConfig.Set("api/all=true") - - fs.Parse(customFlags) - - if err := s.Complete(); err != nil { - return result, fmt.Errorf("failed to set default options: %v", err) - } - if err := s.Validate(); err != nil { - return result, fmt.Errorf("failed to validate options: %v", err) - } - - t.Logf("runtime-config=%v", s.APIEnablement.RuntimeConfig) - t.Logf("Starting apiextensions-apiserver on port %d...", s.RecommendedOptions.SecureServing.BindPort) - - config, err := s.Config() - if err != nil { - return result, fmt.Errorf("failed to create config from options: %v", err) - } - server, err := config.Complete().New(genericapiserver.NewEmptyDelegate()) - if err != nil { - return result, fmt.Errorf("failed to create server: %v", err) - } - - go func(stopCh <-chan struct{}) { - if err := server.GenericAPIServer.PrepareRun().Run(stopCh); err != nil { - t.Errorf("apiextensions-apiserver failed run: %v", err) - } - }(stopCh) - - t.Logf("Waiting for /healthz to be ok...") - - client, err := kubernetes.NewForConfig(server.GenericAPIServer.LoopbackClientConfig) - if err != nil { - return result, fmt.Errorf("failed to create a client: %v", err) - } - err = wait.Poll(100*time.Millisecond, 30*time.Second, func() (bool, error) { - result := client.CoreV1().RESTClient().Get().AbsPath("/healthz").Do() - status := 0 - result.StatusCode(&status) - if status == 200 { - return true, nil - } - return false, nil - }) - if err != nil { - return result, fmt.Errorf("failed to wait for /healthz to return ok: %v", err) - } - - // from here the caller must call tearDown - result.ClientConfig = server.GenericAPIServer.LoopbackClientConfig - result.ServerOpts = s - result.TearDownFn = tearDown - - return result, nil -} - -// StartTestServerOrDie calls StartTestServer t.Fatal if it does not succeed. -func StartTestServerOrDie(t Logger, instanceOptions *TestServerInstanceOptions, flags []string, storageConfig *storagebackend.Config) *TestServer { - result, err := StartTestServer(t, instanceOptions, flags, storageConfig) - if err == nil { - return &result - } - - t.Fatalf("failed to launch server: %v", err) - return nil -} - -func createLocalhostListenerOnFreePort() (net.Listener, int, error) { - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - return nil, 0, err - } - - // get port - tcpAddr, ok := ln.Addr().(*net.TCPAddr) - if !ok { - ln.Close() - return nil, 0, fmt.Errorf("invalid listen address: %q", ln.Addr().String()) - } - - return ln, tcpAddr.Port, nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/establish/establishing_controller.go b/vendor/k8s.io/apiextensions-apiserver/pkg/controller/establish/establishing_controller.go deleted file mode 100644 index 6420c3a6f..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/establish/establishing_controller.go +++ /dev/null @@ -1,143 +0,0 @@ -/* -Copyright 2018 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 establish - -import ( - "fmt" - "time" - - "github.com/golang/glog" - apierrors "k8s.io/apimachinery/pkg/api/errors" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/util/workqueue" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - client "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion" - informers "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion" - listers "k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion" -) - -// EstablishingController controls how and when CRD is established. -type EstablishingController struct { - crdClient client.CustomResourceDefinitionsGetter - crdLister listers.CustomResourceDefinitionLister - crdSynced cache.InformerSynced - - // To allow injection for testing. - syncFn func(key string) error - - queue workqueue.RateLimitingInterface -} - -// NewEstablishingController creates new EstablishingController. -func NewEstablishingController(crdInformer informers.CustomResourceDefinitionInformer, - crdClient client.CustomResourceDefinitionsGetter) *EstablishingController { - ec := &EstablishingController{ - crdClient: crdClient, - crdLister: crdInformer.Lister(), - crdSynced: crdInformer.Informer().HasSynced, - queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "crdEstablishing"), - } - - ec.syncFn = ec.sync - - return ec -} - -// QueueCRD adds CRD into the establishing queue. -func (ec *EstablishingController) QueueCRD(key string, timeout time.Duration) { - ec.queue.AddAfter(key, timeout) -} - -// Run starts the EstablishingController. -func (ec *EstablishingController) Run(stopCh <-chan struct{}) { - defer utilruntime.HandleCrash() - defer ec.queue.ShutDown() - - glog.Infof("Starting EstablishingController") - defer glog.Infof("Shutting down EstablishingController") - - if !cache.WaitForCacheSync(stopCh, ec.crdSynced) { - return - } - - // only start one worker thread since its a slow moving API - go wait.Until(ec.runWorker, time.Second, stopCh) - - <-stopCh -} - -func (ec *EstablishingController) runWorker() { - for ec.processNextWorkItem() { - } -} - -// processNextWorkItem deals with one key off the queue. -// It returns false when it's time to quit. -func (ec *EstablishingController) processNextWorkItem() bool { - key, quit := ec.queue.Get() - if quit { - return false - } - defer ec.queue.Done(key) - - err := ec.syncFn(key.(string)) - if err == nil { - ec.queue.Forget(key) - return true - } - - utilruntime.HandleError(fmt.Errorf("%v failed with: %v", key, err)) - ec.queue.AddRateLimited(key) - - return true -} - -// sync is used to turn CRDs into the Established state. -func (ec *EstablishingController) sync(key string) error { - cachedCRD, err := ec.crdLister.Get(key) - if apierrors.IsNotFound(err) { - return nil - } - if err != nil { - return err - } - - if !apiextensions.IsCRDConditionTrue(cachedCRD, apiextensions.NamesAccepted) || - apiextensions.IsCRDConditionTrue(cachedCRD, apiextensions.Established) { - return nil - } - - crd := cachedCRD.DeepCopy() - establishedCondition := apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Established, - Status: apiextensions.ConditionTrue, - Reason: "InitialNamesAccepted", - Message: "the initial names have been accepted", - } - apiextensions.SetCRDCondition(crd, establishedCondition) - - // Update server with new CRD condition. - _, err = ec.crdClient.CustomResourceDefinitions().UpdateStatus(crd) - if err != nil { - return err - } - - return nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go b/vendor/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go deleted file mode 100644 index f881427ef..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go +++ /dev/null @@ -1,327 +0,0 @@ -/* -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 finalizer - -import ( - "fmt" - "reflect" - "time" - - "github.com/golang/glog" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - utilerrors "k8s.io/apimachinery/pkg/util/errors" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" - genericapirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/registry/rest" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/util/workqueue" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - client "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion" - informers "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion" - listers "k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion" -) - -// CRDFinalizer is a controller that finalizes the CRD by deleting all the CRs associated with it. -type CRDFinalizer struct { - crdClient client.CustomResourceDefinitionsGetter - crClientGetter CRClientGetter - - crdLister listers.CustomResourceDefinitionLister - crdSynced cache.InformerSynced - - // To allow injection for testing. - syncFn func(key string) error - - queue workqueue.RateLimitingInterface -} - -// ListerCollectionDeleter combines rest.Lister and rest.CollectionDeleter. -type ListerCollectionDeleter interface { - rest.Lister - rest.CollectionDeleter -} - -// CRClientGetter knows how to get a ListerCollectionDeleter for a given CRD UID. -type CRClientGetter interface { - // GetCustomResourceListerCollectionDeleter gets the ListerCollectionDeleter for the given CRD - // UID. - GetCustomResourceListerCollectionDeleter(crd *apiextensions.CustomResourceDefinition) (ListerCollectionDeleter, error) -} - -// NewCRDFinalizer creates a new CRDFinalizer. -func NewCRDFinalizer( - crdInformer informers.CustomResourceDefinitionInformer, - crdClient client.CustomResourceDefinitionsGetter, - crClientGetter CRClientGetter, -) *CRDFinalizer { - c := &CRDFinalizer{ - crdClient: crdClient, - crdLister: crdInformer.Lister(), - crdSynced: crdInformer.Informer().HasSynced, - crClientGetter: crClientGetter, - queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "CustomResourceDefinition-CRDFinalizer"), - } - - crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: c.addCustomResourceDefinition, - UpdateFunc: c.updateCustomResourceDefinition, - }) - - c.syncFn = c.sync - - return c -} - -func (c *CRDFinalizer) sync(key string) error { - cachedCRD, err := c.crdLister.Get(key) - if apierrors.IsNotFound(err) { - return nil - } - if err != nil { - return err - } - - // no work to do - if cachedCRD.DeletionTimestamp.IsZero() || !apiextensions.CRDHasFinalizer(cachedCRD, apiextensions.CustomResourceCleanupFinalizer) { - return nil - } - - crd := cachedCRD.DeepCopy() - - // update the status condition. This cleanup could take a while. - apiextensions.SetCRDCondition(crd, apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Terminating, - Status: apiextensions.ConditionTrue, - Reason: "InstanceDeletionInProgress", - Message: "CustomResource deletion is in progress", - }) - crd, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(crd) - if err != nil { - return err - } - - // Now we can start deleting items. We should use the REST API to ensure that all normal admission runs. - // Since we control the endpoints, we know that delete collection works. No need to delete if not established. - if apiextensions.IsCRDConditionTrue(crd, apiextensions.Established) { - cond, deleteErr := c.deleteInstances(crd) - apiextensions.SetCRDCondition(crd, cond) - if deleteErr != nil { - crd, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(crd) - if err != nil { - utilruntime.HandleError(err) - } - return deleteErr - } - } else { - apiextensions.SetCRDCondition(crd, apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Terminating, - Status: apiextensions.ConditionFalse, - Reason: "NeverEstablished", - Message: "resource was never established", - }) - } - - apiextensions.CRDRemoveFinalizer(crd, apiextensions.CustomResourceCleanupFinalizer) - crd, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(crd) - if err != nil { - return err - } - - // and now issue another delete, which should clean it all up if no finalizers remain or no-op if they do - return c.crdClient.CustomResourceDefinitions().Delete(crd.Name, nil) -} - -func (c *CRDFinalizer) deleteInstances(crd *apiextensions.CustomResourceDefinition) (apiextensions.CustomResourceDefinitionCondition, error) { - // Now we can start deleting items. While it would be ideal to use a REST API client, doing so - // could incorrectly delete a ThirdPartyResource with the same URL as the CustomResource, so we go - // directly to the storage instead. Since we control the storage, we know that delete collection works. - crClient, err := c.crClientGetter.GetCustomResourceListerCollectionDeleter(crd) - if err != nil { - err = fmt.Errorf("unable to find a custom resource client for %s.%s: %v", crd.Status.AcceptedNames.Plural, crd.Spec.Group, err) - return apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Terminating, - Status: apiextensions.ConditionTrue, - Reason: "InstanceDeletionFailed", - Message: fmt.Sprintf("could not list instances: %v", err), - }, err - } - - ctx := genericapirequest.NewContext() - allResources, err := crClient.List(ctx, nil) - if err != nil { - return apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Terminating, - Status: apiextensions.ConditionTrue, - Reason: "InstanceDeletionFailed", - Message: fmt.Sprintf("could not list instances: %v", err), - }, err - } - - deletedNamespaces := sets.String{} - deleteErrors := []error{} - for _, item := range allResources.(*unstructured.UnstructuredList).Items { - metadata, err := meta.Accessor(&item) - if err != nil { - utilruntime.HandleError(err) - continue - } - if deletedNamespaces.Has(metadata.GetNamespace()) { - continue - } - // don't retry deleting the same namespace - deletedNamespaces.Insert(metadata.GetNamespace()) - nsCtx := genericapirequest.WithNamespace(ctx, metadata.GetNamespace()) - if _, err := crClient.DeleteCollection(nsCtx, nil, nil); err != nil { - deleteErrors = append(deleteErrors, err) - continue - } - } - if deleteError := utilerrors.NewAggregate(deleteErrors); deleteError != nil { - return apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Terminating, - Status: apiextensions.ConditionTrue, - Reason: "InstanceDeletionFailed", - Message: fmt.Sprintf("could not issue all deletes: %v", deleteError), - }, deleteError - } - - // now we need to wait until all the resources are deleted. Start with a simple poll before we do anything fancy. - // TODO not all servers are synchronized on caches. It is possible for a stale one to still be creating things. - // Once we have a mechanism for servers to indicate their states, we should check that for concurrence. - err = wait.PollImmediate(5*time.Second, 1*time.Minute, func() (bool, error) { - listObj, err := crClient.List(ctx, nil) - if err != nil { - return false, err - } - if len(listObj.(*unstructured.UnstructuredList).Items) == 0 { - return true, nil - } - glog.V(2).Infof("%s.%s waiting for %d items to be removed", crd.Status.AcceptedNames.Plural, crd.Spec.Group, len(listObj.(*unstructured.UnstructuredList).Items)) - return false, nil - }) - if err != nil { - return apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Terminating, - Status: apiextensions.ConditionTrue, - Reason: "InstanceDeletionCheck", - Message: fmt.Sprintf("could not confirm zero CustomResources remaining: %v", err), - }, err - } - return apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Terminating, - Status: apiextensions.ConditionFalse, - Reason: "InstanceDeletionCompleted", - Message: "removed all instances", - }, nil -} - -func (c *CRDFinalizer) Run(workers int, stopCh <-chan struct{}) { - defer utilruntime.HandleCrash() - defer c.queue.ShutDown() - - glog.Infof("Starting CRDFinalizer") - defer glog.Infof("Shutting down CRDFinalizer") - - if !cache.WaitForCacheSync(stopCh, c.crdSynced) { - return - } - - for i := 0; i < workers; i++ { - go wait.Until(c.runWorker, time.Second, stopCh) - } - - <-stopCh -} - -func (c *CRDFinalizer) runWorker() { - for c.processNextWorkItem() { - } -} - -// processNextWorkItem deals with one key off the queue. It returns false when it's time to quit. -func (c *CRDFinalizer) processNextWorkItem() bool { - key, quit := c.queue.Get() - if quit { - return false - } - defer c.queue.Done(key) - - err := c.syncFn(key.(string)) - if err == nil { - c.queue.Forget(key) - return true - } - - utilruntime.HandleError(fmt.Errorf("%v failed with: %v", key, err)) - c.queue.AddRateLimited(key) - - return true -} - -func (c *CRDFinalizer) enqueue(obj *apiextensions.CustomResourceDefinition) { - key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) - if err != nil { - utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %#v: %v", obj, err)) - return - } - - c.queue.Add(key) -} - -func (c *CRDFinalizer) addCustomResourceDefinition(obj interface{}) { - castObj := obj.(*apiextensions.CustomResourceDefinition) - // only queue deleted things - if !castObj.DeletionTimestamp.IsZero() && apiextensions.CRDHasFinalizer(castObj, apiextensions.CustomResourceCleanupFinalizer) { - c.enqueue(castObj) - } -} - -func (c *CRDFinalizer) updateCustomResourceDefinition(oldObj, newObj interface{}) { - oldCRD := oldObj.(*apiextensions.CustomResourceDefinition) - newCRD := newObj.(*apiextensions.CustomResourceDefinition) - // only queue deleted things that haven't been finalized by us - if newCRD.DeletionTimestamp.IsZero() || !apiextensions.CRDHasFinalizer(newCRD, apiextensions.CustomResourceCleanupFinalizer) { - return - } - - // always requeue resyncs just in case - if oldCRD.ResourceVersion == newCRD.ResourceVersion { - c.enqueue(newCRD) - return - } - - // If the only difference is in the terminating condition, then there's no reason to requeue here. This controller - // is likely to be the originator, so requeuing would hot-loop us. Failures are requeued by the workqueue directly. - // This is a low traffic and scale resource, so the copy is terrible. It's not good, so better ideas - // are welcome. - oldCopy := oldCRD.DeepCopy() - newCopy := newCRD.DeepCopy() - oldCopy.ResourceVersion = "" - newCopy.ResourceVersion = "" - apiextensions.RemoveCRDCondition(oldCopy, apiextensions.Terminating) - apiextensions.RemoveCRDCondition(newCopy, apiextensions.Terminating) - - if !reflect.DeepEqual(oldCopy, newCopy) { - c.enqueue(newCRD) - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller.go b/vendor/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller.go deleted file mode 100644 index f00def4b1..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller.go +++ /dev/null @@ -1,374 +0,0 @@ -/* -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 status - -import ( - "fmt" - "reflect" - "strings" - "time" - - "github.com/golang/glog" - - "k8s.io/apimachinery/pkg/api/equality" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - utilerrors "k8s.io/apimachinery/pkg/util/errors" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/util/workqueue" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - client "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion" - informers "k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/apiextensions/internalversion" - listers "k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion" -) - -// This controller is reserving names. To avoid conflicts, be sure to run only one instance of the worker at a time. -// This could eventually be lifted, but starting simple. -type NamingConditionController struct { - crdClient client.CustomResourceDefinitionsGetter - - crdLister listers.CustomResourceDefinitionLister - crdSynced cache.InformerSynced - // crdMutationCache backs our lister and keeps track of committed updates to avoid racy - // write/lookup cycles. It's got 100 slots by default, so it unlikely to overrun - // TODO to revisit this if naming conflicts are found to occur in the wild - crdMutationCache cache.MutationCache - - // To allow injection for testing. - syncFn func(key string) error - - queue workqueue.RateLimitingInterface -} - -func NewNamingConditionController( - crdInformer informers.CustomResourceDefinitionInformer, - crdClient client.CustomResourceDefinitionsGetter, -) *NamingConditionController { - c := &NamingConditionController{ - crdClient: crdClient, - crdLister: crdInformer.Lister(), - crdSynced: crdInformer.Informer().HasSynced, - queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "CustomResourceDefinition-NamingConditionController"), - } - - informerIndexer := crdInformer.Informer().GetIndexer() - c.crdMutationCache = cache.NewIntegerResourceVersionMutationCache(informerIndexer, informerIndexer, 60*time.Second, false) - - crdInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: c.addCustomResourceDefinition, - UpdateFunc: c.updateCustomResourceDefinition, - DeleteFunc: c.deleteCustomResourceDefinition, - }) - - c.syncFn = c.sync - - return c -} - -func (c *NamingConditionController) getAcceptedNamesForGroup(group string) (allResources sets.String, allKinds sets.String) { - allResources = sets.String{} - allKinds = sets.String{} - - list, err := c.crdLister.List(labels.Everything()) - if err != nil { - panic(err) - } - - for _, curr := range list { - if curr.Spec.Group != group { - continue - } - - // for each item here, see if we have a mutation cache entry that is more recent - // this makes sure that if we tight loop on update and run, our mutation cache will show - // us the version of the objects we just updated to. - item := curr - obj, exists, err := c.crdMutationCache.GetByKey(curr.Name) - if exists && err == nil { - item = obj.(*apiextensions.CustomResourceDefinition) - } - - allResources.Insert(item.Status.AcceptedNames.Plural) - allResources.Insert(item.Status.AcceptedNames.Singular) - allResources.Insert(item.Status.AcceptedNames.ShortNames...) - - allKinds.Insert(item.Status.AcceptedNames.Kind) - allKinds.Insert(item.Status.AcceptedNames.ListKind) - } - - return allResources, allKinds -} - -func (c *NamingConditionController) calculateNamesAndConditions(in *apiextensions.CustomResourceDefinition) (apiextensions.CustomResourceDefinitionNames, apiextensions.CustomResourceDefinitionCondition, apiextensions.CustomResourceDefinitionCondition) { - // Get the names that have already been claimed - allResources, allKinds := c.getAcceptedNamesForGroup(in.Spec.Group) - - namesAcceptedCondition := apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.NamesAccepted, - Status: apiextensions.ConditionUnknown, - } - - requestedNames := in.Spec.Names - acceptedNames := in.Status.AcceptedNames - newNames := in.Status.AcceptedNames - - // Check each name for mismatches. If there's a mismatch between spec and status, then try to deconflict. - // Continue on errors so that the status is the best match possible - if err := equalToAcceptedOrFresh(requestedNames.Plural, acceptedNames.Plural, allResources); err != nil { - namesAcceptedCondition.Status = apiextensions.ConditionFalse - namesAcceptedCondition.Reason = "PluralConflict" - namesAcceptedCondition.Message = err.Error() - } else { - newNames.Plural = requestedNames.Plural - } - if err := equalToAcceptedOrFresh(requestedNames.Singular, acceptedNames.Singular, allResources); err != nil { - namesAcceptedCondition.Status = apiextensions.ConditionFalse - namesAcceptedCondition.Reason = "SingularConflict" - namesAcceptedCondition.Message = err.Error() - } else { - newNames.Singular = requestedNames.Singular - } - if !reflect.DeepEqual(requestedNames.ShortNames, acceptedNames.ShortNames) { - errs := []error{} - existingShortNames := sets.NewString(acceptedNames.ShortNames...) - for _, shortName := range requestedNames.ShortNames { - // if the shortname is already ours, then we're fine - if existingShortNames.Has(shortName) { - continue - } - if err := equalToAcceptedOrFresh(shortName, "", allResources); err != nil { - errs = append(errs, err) - } - - } - if err := utilerrors.NewAggregate(errs); err != nil { - namesAcceptedCondition.Status = apiextensions.ConditionFalse - namesAcceptedCondition.Reason = "ShortNamesConflict" - namesAcceptedCondition.Message = err.Error() - } else { - newNames.ShortNames = requestedNames.ShortNames - } - } - - if err := equalToAcceptedOrFresh(requestedNames.Kind, acceptedNames.Kind, allKinds); err != nil { - namesAcceptedCondition.Status = apiextensions.ConditionFalse - namesAcceptedCondition.Reason = "KindConflict" - namesAcceptedCondition.Message = err.Error() - } else { - newNames.Kind = requestedNames.Kind - } - if err := equalToAcceptedOrFresh(requestedNames.ListKind, acceptedNames.ListKind, allKinds); err != nil { - namesAcceptedCondition.Status = apiextensions.ConditionFalse - namesAcceptedCondition.Reason = "ListKindConflict" - namesAcceptedCondition.Message = err.Error() - } else { - newNames.ListKind = requestedNames.ListKind - } - - newNames.Categories = requestedNames.Categories - - // if we haven't changed the condition, then our names must be good. - if namesAcceptedCondition.Status == apiextensions.ConditionUnknown { - namesAcceptedCondition.Status = apiextensions.ConditionTrue - namesAcceptedCondition.Reason = "NoConflicts" - namesAcceptedCondition.Message = "no conflicts found" - } - - // set EstablishedCondition initially to false, then set it to true in establishing controller. - // The Establishing Controller will see the NamesAccepted condition when it arrives through the shared informer. - // At that time the API endpoint handler will serve the endpoint, avoiding a race - // which we had if we set Established to true here. - establishedCondition := apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Established, - Status: apiextensions.ConditionFalse, - Reason: "NotAccepted", - Message: "not all names are accepted", - } - if old := apiextensions.FindCRDCondition(in, apiextensions.Established); old != nil { - establishedCondition = *old - } - if establishedCondition.Status != apiextensions.ConditionTrue && namesAcceptedCondition.Status == apiextensions.ConditionTrue { - establishedCondition = apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Established, - Status: apiextensions.ConditionFalse, - Reason: "Installing", - Message: "the initial names have been accepted", - } - } - - return newNames, namesAcceptedCondition, establishedCondition -} - -func equalToAcceptedOrFresh(requestedName, acceptedName string, usedNames sets.String) error { - if requestedName == acceptedName { - return nil - } - if !usedNames.Has(requestedName) { - return nil - } - - return fmt.Errorf("%q is already in use", requestedName) -} - -func (c *NamingConditionController) sync(key string) error { - inCustomResourceDefinition, err := c.crdLister.Get(key) - if apierrors.IsNotFound(err) { - // CRD was deleted and has freed its names. - // Reconsider all other CRDs in the same group. - if err := c.requeueAllOtherGroupCRDs(key); err != nil { - return err - } - return nil - } - if err != nil { - return err - } - - // Skip checking names if Spec and Status names are same. - if equality.Semantic.DeepEqual(inCustomResourceDefinition.Spec.Names, inCustomResourceDefinition.Status.AcceptedNames) { - return nil - } - - acceptedNames, namingCondition, establishedCondition := c.calculateNamesAndConditions(inCustomResourceDefinition) - - // nothing to do if accepted names and NamesAccepted condition didn't change - if reflect.DeepEqual(inCustomResourceDefinition.Status.AcceptedNames, acceptedNames) && - apiextensions.IsCRDConditionEquivalent(&namingCondition, apiextensions.FindCRDCondition(inCustomResourceDefinition, apiextensions.NamesAccepted)) { - return nil - } - - crd := inCustomResourceDefinition.DeepCopy() - crd.Status.AcceptedNames = acceptedNames - apiextensions.SetCRDCondition(crd, namingCondition) - apiextensions.SetCRDCondition(crd, establishedCondition) - - updatedObj, err := c.crdClient.CustomResourceDefinitions().UpdateStatus(crd) - if err != nil { - return err - } - - // if the update was successful, go ahead and add the entry to the mutation cache - c.crdMutationCache.Mutation(updatedObj) - - // we updated our status, so we may be releasing a name. When this happens, we need to rekick everything in our group - // if we fail to rekick, just return as normal. We'll get everything on a resync - if err := c.requeueAllOtherGroupCRDs(key); err != nil { - return err - } - - return nil -} - -func (c *NamingConditionController) Run(stopCh <-chan struct{}) { - defer utilruntime.HandleCrash() - defer c.queue.ShutDown() - - glog.Infof("Starting NamingConditionController") - defer glog.Infof("Shutting down NamingConditionController") - - if !cache.WaitForCacheSync(stopCh, c.crdSynced) { - return - } - - // only start one worker thread since its a slow moving API and the naming conflict resolution bits aren't thread-safe - go wait.Until(c.runWorker, time.Second, stopCh) - - <-stopCh -} - -func (c *NamingConditionController) runWorker() { - for c.processNextWorkItem() { - } -} - -// processNextWorkItem deals with one key off the queue. It returns false when it's time to quit. -func (c *NamingConditionController) processNextWorkItem() bool { - key, quit := c.queue.Get() - if quit { - return false - } - defer c.queue.Done(key) - - err := c.syncFn(key.(string)) - if err == nil { - c.queue.Forget(key) - return true - } - - utilruntime.HandleError(fmt.Errorf("%v failed with: %v", key, err)) - c.queue.AddRateLimited(key) - - return true -} - -func (c *NamingConditionController) enqueue(obj *apiextensions.CustomResourceDefinition) { - key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) - if err != nil { - utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %#v: %v", obj, err)) - return - } - - c.queue.Add(key) -} - -func (c *NamingConditionController) addCustomResourceDefinition(obj interface{}) { - castObj := obj.(*apiextensions.CustomResourceDefinition) - glog.V(4).Infof("Adding %s", castObj.Name) - c.enqueue(castObj) -} - -func (c *NamingConditionController) updateCustomResourceDefinition(obj, _ interface{}) { - castObj := obj.(*apiextensions.CustomResourceDefinition) - glog.V(4).Infof("Updating %s", castObj.Name) - c.enqueue(castObj) -} - -func (c *NamingConditionController) deleteCustomResourceDefinition(obj interface{}) { - castObj, ok := obj.(*apiextensions.CustomResourceDefinition) - if !ok { - tombstone, ok := obj.(cache.DeletedFinalStateUnknown) - if !ok { - glog.Errorf("Couldn't get object from tombstone %#v", obj) - return - } - castObj, ok = tombstone.Obj.(*apiextensions.CustomResourceDefinition) - if !ok { - glog.Errorf("Tombstone contained object that is not expected %#v", obj) - return - } - } - glog.V(4).Infof("Deleting %q", castObj.Name) - c.enqueue(castObj) -} - -func (c *NamingConditionController) requeueAllOtherGroupCRDs(name string) error { - pluralGroup := strings.SplitN(name, ".", 2) - list, err := c.crdLister.List(labels.Everything()) - if err != nil { - return err - } - for _, curr := range list { - if curr.Spec.Group == pluralGroup[1] && curr.Name != name { - c.queue.Add(curr.Name) - } - } - return nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller_test.go deleted file mode 100644 index 717e52884..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller_test.go +++ /dev/null @@ -1,344 +0,0 @@ -/* -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 status - -import ( - "reflect" - "strings" - "testing" - "time" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - listers "k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/cache" -) - -type crdBuilder struct { - curr apiextensions.CustomResourceDefinition -} - -func newCRD(name string) *crdBuilder { - tokens := strings.SplitN(name, ".", 2) - return &crdBuilder{ - curr: apiextensions.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: name}, - Spec: apiextensions.CustomResourceDefinitionSpec{ - Group: tokens[1], - Names: apiextensions.CustomResourceDefinitionNames{ - Plural: tokens[0], - }, - }, - }, - } -} - -func (b *crdBuilder) SpecNames(plural, singular, kind, listKind string, shortNames ...string) *crdBuilder { - b.curr.Spec.Names.Plural = plural - b.curr.Spec.Names.Singular = singular - b.curr.Spec.Names.Kind = kind - b.curr.Spec.Names.ListKind = listKind - b.curr.Spec.Names.ShortNames = shortNames - - return b -} - -func (b *crdBuilder) StatusNames(plural, singular, kind, listKind string, shortNames ...string) *crdBuilder { - b.curr.Status.AcceptedNames.Plural = plural - b.curr.Status.AcceptedNames.Singular = singular - b.curr.Status.AcceptedNames.Kind = kind - b.curr.Status.AcceptedNames.ListKind = listKind - b.curr.Status.AcceptedNames.ShortNames = shortNames - - return b -} - -func (b *crdBuilder) Condition(c apiextensions.CustomResourceDefinitionCondition) *crdBuilder { - b.curr.Status.Conditions = append(b.curr.Status.Conditions, c) - - return b -} - -func names(plural, singular, kind, listKind string, shortNames ...string) apiextensions.CustomResourceDefinitionNames { - ret := apiextensions.CustomResourceDefinitionNames{ - Plural: plural, - Singular: singular, - Kind: kind, - ListKind: listKind, - ShortNames: shortNames, - } - return ret -} - -func (b *crdBuilder) NewOrDie() *apiextensions.CustomResourceDefinition { - return &b.curr -} - -var acceptedCondition = apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.NamesAccepted, - Status: apiextensions.ConditionTrue, - Reason: "NoConflicts", - Message: "no conflicts found", -} - -var notAcceptedCondition = apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.NamesAccepted, - Status: apiextensions.ConditionFalse, - Reason: "NotAccepted", - Message: "not all names are accepted", -} - -var installingCondition = apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Established, - Status: apiextensions.ConditionFalse, - Reason: "Installing", - Message: "the initial names have been accepted", -} - -var notEstablishedCondition = apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Established, - Status: apiextensions.ConditionFalse, - Reason: "NotAccepted", - Message: "not all names are accepted", -} - -func nameConflictCondition(reason, message string) apiextensions.CustomResourceDefinitionCondition { - return apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.NamesAccepted, - Status: apiextensions.ConditionFalse, - Reason: reason, - Message: message, - } -} - -func TestSync(t *testing.T) { - tests := []struct { - name string - - in *apiextensions.CustomResourceDefinition - existing []*apiextensions.CustomResourceDefinition - expectedNames apiextensions.CustomResourceDefinitionNames - expectedNameConflictCondition apiextensions.CustomResourceDefinitionCondition - expectedEstablishedCondition apiextensions.CustomResourceDefinitionCondition - }{ - { - name: "first resource", - in: newCRD("alfa.bravo.com").NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{}, - expectedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "alfa", - }, - expectedNameConflictCondition: acceptedCondition, - expectedEstablishedCondition: installingCondition, - }, - { - name: "different groups", - in: newCRD("alfa.bravo.com").SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2").NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("alfa.charlie.com").StatusNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2").NewOrDie(), - }, - expectedNames: names("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"), - expectedNameConflictCondition: acceptedCondition, - expectedEstablishedCondition: installingCondition, - }, - { - name: "conflict plural to singular", - in: newCRD("alfa.bravo.com").SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2").NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("india.bravo.com").StatusNames("india", "alfa", "", "").NewOrDie(), - }, - expectedNames: names("", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"), - expectedNameConflictCondition: nameConflictCondition("PluralConflict", `"alfa" is already in use`), - expectedEstablishedCondition: notEstablishedCondition, - }, - { - name: "conflict singular to shortName", - in: newCRD("alfa.bravo.com").SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2").NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("india.bravo.com").StatusNames("india", "indias", "", "", "delta-singular").NewOrDie(), - }, - expectedNames: names("alfa", "", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"), - expectedNameConflictCondition: nameConflictCondition("SingularConflict", `"delta-singular" is already in use`), - expectedEstablishedCondition: notEstablishedCondition, - }, - { - name: "conflict on shortName to shortName", - in: newCRD("alfa.bravo.com").SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2").NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("india.bravo.com").StatusNames("india", "indias", "", "", "hotel-shortname-2").NewOrDie(), - }, - expectedNames: names("alfa", "delta-singular", "echo-kind", "foxtrot-listkind"), - expectedNameConflictCondition: nameConflictCondition("ShortNamesConflict", `"hotel-shortname-2" is already in use`), - expectedEstablishedCondition: notEstablishedCondition, - }, - { - name: "conflict on kind to listkind", - in: newCRD("alfa.bravo.com").SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2").NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("india.bravo.com").StatusNames("india", "indias", "", "echo-kind").NewOrDie(), - }, - expectedNames: names("alfa", "delta-singular", "", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"), - expectedNameConflictCondition: nameConflictCondition("KindConflict", `"echo-kind" is already in use`), - expectedEstablishedCondition: notEstablishedCondition, - }, - { - name: "conflict on listkind to kind", - in: newCRD("alfa.bravo.com").SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2").NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("india.bravo.com").StatusNames("india", "indias", "foxtrot-listkind", "").NewOrDie(), - }, - expectedNames: names("alfa", "delta-singular", "echo-kind", "", "golf-shortname-1", "hotel-shortname-2"), - expectedNameConflictCondition: nameConflictCondition("ListKindConflict", `"foxtrot-listkind" is already in use`), - expectedEstablishedCondition: notEstablishedCondition, - }, - { - name: "no conflict on resource and kind", - in: newCRD("alfa.bravo.com").SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2").NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("india.bravo.com").StatusNames("india", "echo-kind", "", "").NewOrDie(), - }, - expectedNames: names("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"), - expectedNameConflictCondition: acceptedCondition, - expectedEstablishedCondition: installingCondition, - }, - { - name: "merge on conflicts", - in: newCRD("alfa.bravo.com"). - SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"). - StatusNames("zulu", "yankee-singular", "xray-kind", "whiskey-listkind", "victor-shortname-1", "uniform-shortname-2"). - NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("india.bravo.com").StatusNames("india", "indias", "foxtrot-listkind", "", "delta-singular").NewOrDie(), - }, - expectedNames: names("alfa", "yankee-singular", "echo-kind", "whiskey-listkind", "golf-shortname-1", "hotel-shortname-2"), - expectedNameConflictCondition: nameConflictCondition("ListKindConflict", `"foxtrot-listkind" is already in use`), - expectedEstablishedCondition: notEstablishedCondition, - }, - { - name: "merge on conflicts shortNames as one", - in: newCRD("alfa.bravo.com"). - SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"). - StatusNames("zulu", "yankee-singular", "xray-kind", "whiskey-listkind", "victor-shortname-1", "uniform-shortname-2"). - NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("india.bravo.com").StatusNames("india", "indias", "foxtrot-listkind", "", "delta-singular", "golf-shortname-1").NewOrDie(), - }, - expectedNames: names("alfa", "yankee-singular", "echo-kind", "whiskey-listkind", "victor-shortname-1", "uniform-shortname-2"), - expectedNameConflictCondition: nameConflictCondition("ListKindConflict", `"foxtrot-listkind" is already in use`), - expectedEstablishedCondition: notEstablishedCondition, - }, - { - name: "no conflicts on self", - in: newCRD("alfa.bravo.com"). - SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"). - StatusNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"). - NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("alfa.bravo.com"). - SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"). - StatusNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"). - NewOrDie(), - }, - expectedNames: names("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"), - expectedNameConflictCondition: acceptedCondition, - expectedEstablishedCondition: installingCondition, - }, - { - name: "no conflicts on self, remove shortname", - in: newCRD("alfa.bravo.com"). - SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1"). - StatusNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"). - NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("alfa.bravo.com"). - SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"). - StatusNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"). - NewOrDie(), - }, - expectedNames: names("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1"), - expectedNameConflictCondition: acceptedCondition, - expectedEstablishedCondition: installingCondition, - }, - { - name: "installing before with true condition", - in: newCRD("alfa.bravo.com").Condition(acceptedCondition).NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{}, - expectedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "alfa", - }, - expectedNameConflictCondition: acceptedCondition, - expectedEstablishedCondition: installingCondition, - }, - { - name: "not installing before with false condition", - in: newCRD("alfa.bravo.com").Condition(notAcceptedCondition).NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{}, - expectedNames: apiextensions.CustomResourceDefinitionNames{ - Plural: "alfa", - }, - expectedNameConflictCondition: acceptedCondition, - expectedEstablishedCondition: installingCondition, - }, - { - name: "conflicting, installing before with true condition", - in: newCRD("alfa.bravo.com").SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"). - Condition(acceptedCondition). - NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("india.bravo.com").StatusNames("india", "alfa", "", "").NewOrDie(), - }, - expectedNames: names("", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"), - expectedNameConflictCondition: nameConflictCondition("PluralConflict", `"alfa" is already in use`), - expectedEstablishedCondition: notEstablishedCondition, - }, - { - name: "conflicting, not installing before with false condition", - in: newCRD("alfa.bravo.com").SpecNames("alfa", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"). - Condition(notAcceptedCondition). - NewOrDie(), - existing: []*apiextensions.CustomResourceDefinition{ - newCRD("india.bravo.com").StatusNames("india", "alfa", "", "").NewOrDie(), - }, - expectedNames: names("", "delta-singular", "echo-kind", "foxtrot-listkind", "golf-shortname-1", "hotel-shortname-2"), - expectedNameConflictCondition: nameConflictCondition("PluralConflict", `"alfa" is already in use`), - expectedEstablishedCondition: notEstablishedCondition, - }, - } - - for _, tc := range tests { - crdIndexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}) - for _, obj := range tc.existing { - crdIndexer.Add(obj) - } - - c := NamingConditionController{ - crdLister: listers.NewCustomResourceDefinitionLister(crdIndexer), - crdMutationCache: cache.NewIntegerResourceVersionMutationCache(crdIndexer, crdIndexer, 60*time.Second, false), - } - actualNames, actualNameConflictCondition, establishedCondition := c.calculateNamesAndConditions(tc.in) - - if e, a := tc.expectedNames, actualNames; !reflect.DeepEqual(e, a) { - t.Errorf("%v expected %v, got %#v", tc.name, e, a) - } - if e, a := tc.expectedNameConflictCondition, actualNameConflictCondition; !apiextensions.IsCRDConditionEquivalent(&e, &a) { - t.Errorf("%v expected %v, got %v", tc.name, e, a) - } - if e, a := tc.expectedEstablishedCondition, establishedCondition; !apiextensions.IsCRDConditionEquivalent(&e, &a) { - t.Errorf("%v expected %v, got %v", tc.name, e, a) - } - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/crdserverscheme/unstructured.go b/vendor/k8s.io/apiextensions-apiserver/pkg/crdserverscheme/unstructured.go deleted file mode 100644 index b5e334798..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/crdserverscheme/unstructured.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright 2016 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 crdserverscheme - -import ( - "reflect" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// UnstructuredObjectTyper provides a runtime.ObjectTyper implementation for -// runtime.Unstructured object based on discovery information. -type UnstructuredObjectTyper struct { -} - -// NewUnstructuredObjectTyper returns a runtime.ObjectTyper for -// unstructured objects based on discovery information. It accepts a list of fallback typers -// for handling objects that are not runtime.Unstructured. It does not delegate the Recognizes -// check, only ObjectKinds. -// TODO this only works for the apiextensions server and doesn't recognize any types. Move to point of use. -func NewUnstructuredObjectTyper() *UnstructuredObjectTyper { - dot := &UnstructuredObjectTyper{} - return dot -} - -// ObjectKinds returns a slice of one element with the group,version,kind of the -// provided object, or an error if the object is not runtime.Unstructured or -// has no group,version,kind information. unversionedType will always be false -// because runtime.Unstructured object should always have group,version,kind -// information set. -func (d *UnstructuredObjectTyper) ObjectKinds(obj runtime.Object) (gvks []schema.GroupVersionKind, unversionedType bool, err error) { - if _, ok := obj.(runtime.Unstructured); ok { - gvk := obj.GetObjectKind().GroupVersionKind() - if len(gvk.Kind) == 0 { - return nil, false, runtime.NewMissingKindErr("object has no kind field ") - } - if len(gvk.Version) == 0 { - return nil, false, runtime.NewMissingVersionErr("object has no apiVersion field") - } - return []schema.GroupVersionKind{gvk}, false, nil - } - - return nil, false, runtime.NewNotRegisteredErrForType("crdserverscheme.UnstructuredObjectTyper", reflect.TypeOf(obj)) -} - -// Recognizes returns true if the provided group,version,kind was in the -// discovery information. -func (d *UnstructuredObjectTyper) Recognizes(gvk schema.GroupVersionKind) bool { - return false -} - -var _ runtime.ObjectTyper = &UnstructuredObjectTyper{} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/features/OWNERS b/vendor/k8s.io/apiextensions-apiserver/pkg/features/OWNERS deleted file mode 100644 index fe7b0144e..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/features/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: -- feature-approvers diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go b/vendor/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go deleted file mode 100644 index 24e72f91e..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -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 features - -import ( - utilfeature "k8s.io/apiserver/pkg/util/feature" -) - -const ( - // Every feature gate should add method here following this template: - // - // // owner: @username - // // alpha: v1.4 - // MyFeature() bool - - // owner: @sttts, @nikhita - // alpha: v1.8 - // beta: v1.9 - // - // CustomResourceValidation is a list of validation methods for CustomResources - CustomResourceValidation utilfeature.Feature = "CustomResourceValidation" - - // owner: @sttts, @nikhita - // alpha: v1.10 - // beta: v1.11 - // - // CustomResourceSubresources defines the subresources for CustomResources - CustomResourceSubresources utilfeature.Feature = "CustomResourceSubresources" -) - -func init() { - utilfeature.DefaultFeatureGate.Add(defaultKubernetesFeatureGates) -} - -// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys. -// To add a new feature, define a key for it above and add it here. The features will be -// available throughout Kubernetes binaries. -var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureSpec{ - CustomResourceValidation: {Default: true, PreRelease: utilfeature.Beta}, - CustomResourceSubresources: {Default: true, PreRelease: utilfeature.Beta}, -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/etcd.go b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/etcd.go deleted file mode 100644 index 0a94bc5c4..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/etcd.go +++ /dev/null @@ -1,325 +0,0 @@ -/* -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 customresource - -import ( - "context" - "fmt" - "strings" - - autoscalingv1 "k8s.io/api/autoscaling/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apiserver/pkg/registry/generic" - genericregistry "k8s.io/apiserver/pkg/registry/generic/registry" - "k8s.io/apiserver/pkg/registry/rest" -) - -// CustomResourceStorage includes dummy storage for CustomResources, and their Status and Scale subresources. -type CustomResourceStorage struct { - CustomResource *REST - Status *StatusREST - Scale *ScaleREST -} - -func NewStorage(resource schema.GroupResource, listKind schema.GroupVersionKind, strategy customResourceStrategy, optsGetter generic.RESTOptionsGetter, categories []string, tableConvertor rest.TableConvertor) CustomResourceStorage { - customResourceREST, customResourceStatusREST := newREST(resource, listKind, strategy, optsGetter, categories, tableConvertor) - - s := CustomResourceStorage{ - CustomResource: customResourceREST, - } - - if strategy.status != nil { - s.Status = customResourceStatusREST - } - - if scale := strategy.scale; scale != nil { - var labelSelectorPath string - if scale.LabelSelectorPath != nil { - labelSelectorPath = *scale.LabelSelectorPath - } - - s.Scale = &ScaleREST{ - store: customResourceREST.Store, - specReplicasPath: scale.SpecReplicasPath, - statusReplicasPath: scale.StatusReplicasPath, - labelSelectorPath: labelSelectorPath, - } - } - - return s -} - -// REST implements a RESTStorage for API services against etcd -type REST struct { - *genericregistry.Store - categories []string -} - -// newREST returns a RESTStorage object that will work against API services. -func newREST(resource schema.GroupResource, listKind schema.GroupVersionKind, strategy customResourceStrategy, optsGetter generic.RESTOptionsGetter, categories []string, tableConvertor rest.TableConvertor) (*REST, *StatusREST) { - store := &genericregistry.Store{ - NewFunc: func() runtime.Object { return &unstructured.Unstructured{} }, - NewListFunc: func() runtime.Object { - // lists are never stored, only manufactured, so stomp in the right kind - ret := &unstructured.UnstructuredList{} - ret.SetGroupVersionKind(listKind) - return ret - }, - PredicateFunc: strategy.MatchCustomResourceDefinitionStorage, - DefaultQualifiedResource: resource, - - CreateStrategy: strategy, - UpdateStrategy: strategy, - DeleteStrategy: strategy, - - TableConvertor: tableConvertor, - } - options := &generic.StoreOptions{RESTOptions: optsGetter, AttrFunc: strategy.GetAttrs} - if err := store.CompleteWithOptions(options); err != nil { - panic(err) // TODO: Propagate error up - } - - statusStore := *store - statusStore.UpdateStrategy = NewStatusStrategy(strategy) - return &REST{store, categories}, &StatusREST{store: &statusStore} -} - -// Implement CategoriesProvider -var _ rest.CategoriesProvider = &REST{} - -// List returns a list of items matching labels and field according to the store's PredicateFunc. -func (e *REST) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error) { - l, err := e.Store.List(ctx, options) - if err != nil { - return nil, err - } - - // Shallow copy ObjectMeta in returned list for each item. Native types have `Items []Item` fields and therefore - // implicitly shallow copy ObjectMeta. The generic store sets the self-link for each item. So this is necessary - // to avoid mutation of the objects from the cache. - if ul, ok := l.(*unstructured.UnstructuredList); ok { - for i := range ul.Items { - shallowCopyObjectMeta(&ul.Items[i]) - } - } - - return l, nil -} - -func (r *REST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) { - o, err := r.Store.Get(ctx, name, options) - if err != nil { - return nil, err - } - if u, ok := o.(*unstructured.Unstructured); ok { - shallowCopyObjectMeta(u) - } - return o, nil -} - -func shallowCopyObjectMeta(u runtime.Unstructured) { - obj := shallowMapDeepCopy(u.UnstructuredContent()) - if metadata, ok := obj["metadata"]; ok { - if metadata, ok := metadata.(map[string]interface{}); ok { - obj["metadata"] = shallowMapDeepCopy(metadata) - u.SetUnstructuredContent(obj) - } - } -} - -func shallowMapDeepCopy(in map[string]interface{}) map[string]interface{} { - if in == nil { - return nil - } - - out := make(map[string]interface{}, len(in)) - for k, v := range in { - out[k] = v - } - - return out -} - -// Categories implements the CategoriesProvider interface. Returns a list of categories a resource is part of. -func (r *REST) Categories() []string { - return r.categories -} - -// StatusREST implements the REST endpoint for changing the status of a CustomResource -type StatusREST struct { - store *genericregistry.Store -} - -var _ = rest.Patcher(&StatusREST{}) - -func (r *StatusREST) New() runtime.Object { - return &unstructured.Unstructured{} -} - -// Get retrieves the object from the storage. It is required to support Patch. -func (r *StatusREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) { - return r.store.Get(ctx, name, options) -} - -// Update alters the status subset of an object. -func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) { - // We are explicitly setting forceAllowCreate to false in the call to the underlying storage because - // subresources should never allow create on update. - return r.store.Update(ctx, name, objInfo, createValidation, updateValidation, false, options) -} - -type ScaleREST struct { - store *genericregistry.Store - specReplicasPath string - statusReplicasPath string - labelSelectorPath string -} - -// ScaleREST implements Patcher -var _ = rest.Patcher(&ScaleREST{}) -var _ = rest.GroupVersionKindProvider(&ScaleREST{}) - -func (r *ScaleREST) GroupVersionKind(containingGV schema.GroupVersion) schema.GroupVersionKind { - return autoscalingv1.SchemeGroupVersion.WithKind("Scale") -} - -// New creates a new Scale object -func (r *ScaleREST) New() runtime.Object { - return &autoscalingv1.Scale{} -} - -func (r *ScaleREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) { - obj, err := r.store.Get(ctx, name, options) - if err != nil { - return nil, err - } - cr := obj.(*unstructured.Unstructured) - - scaleObject, replicasFound, err := scaleFromCustomResource(cr, r.specReplicasPath, r.statusReplicasPath, r.labelSelectorPath) - if err != nil { - return nil, err - } - if !replicasFound { - return nil, apierrors.NewInternalError(fmt.Errorf("the spec replicas field %q does not exist", r.specReplicasPath)) - } - return scaleObject, err -} - -func (r *ScaleREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) { - obj, err := r.store.Get(ctx, name, &metav1.GetOptions{}) - if err != nil { - return nil, false, err - } - cr := obj.(*unstructured.Unstructured) - - const invalidSpecReplicas = -2147483648 // smallest int32 - oldScale, replicasFound, err := scaleFromCustomResource(cr, r.specReplicasPath, r.statusReplicasPath, r.labelSelectorPath) - if err != nil { - return nil, false, err - } - if !replicasFound { - oldScale.Spec.Replicas = invalidSpecReplicas // signal that this was not set before - } - - obj, err = objInfo.UpdatedObject(ctx, oldScale) - if err != nil { - return nil, false, err - } - if obj == nil { - return nil, false, apierrors.NewBadRequest(fmt.Sprintf("nil update passed to Scale")) - } - - scale, ok := obj.(*autoscalingv1.Scale) - if !ok { - return nil, false, apierrors.NewBadRequest(fmt.Sprintf("wrong object passed to Scale update: %v", obj)) - } - - if scale.Spec.Replicas == invalidSpecReplicas { - return nil, false, apierrors.NewBadRequest(fmt.Sprintf("the spec replicas field %q cannot be empty", r.specReplicasPath)) - } - - specReplicasPath := strings.TrimPrefix(r.specReplicasPath, ".") // ignore leading period - if err = unstructured.SetNestedField(cr.Object, int64(scale.Spec.Replicas), strings.Split(specReplicasPath, ".")...); err != nil { - return nil, false, err - } - cr.SetResourceVersion(scale.ResourceVersion) - - obj, _, err = r.store.Update(ctx, cr.GetName(), rest.DefaultUpdatedObjectInfo(cr), createValidation, updateValidation, false, options) - if err != nil { - return nil, false, err - } - cr = obj.(*unstructured.Unstructured) - - newScale, _, err := scaleFromCustomResource(cr, r.specReplicasPath, r.statusReplicasPath, r.labelSelectorPath) - if err != nil { - return nil, false, apierrors.NewBadRequest(err.Error()) - } - return newScale, false, err -} - -// scaleFromCustomResource returns a scale subresource for a customresource and a bool signalling wether -// the specReplicas value was found. -func scaleFromCustomResource(cr *unstructured.Unstructured, specReplicasPath, statusReplicasPath, labelSelectorPath string) (*autoscalingv1.Scale, bool, error) { - specReplicasPath = strings.TrimPrefix(specReplicasPath, ".") // ignore leading period - specReplicas, foundSpecReplicas, err := unstructured.NestedInt64(cr.UnstructuredContent(), strings.Split(specReplicasPath, ".")...) - if err != nil { - return nil, false, err - } else if !foundSpecReplicas { - specReplicas = 0 - } - - statusReplicasPath = strings.TrimPrefix(statusReplicasPath, ".") // ignore leading period - statusReplicas, found, err := unstructured.NestedInt64(cr.UnstructuredContent(), strings.Split(statusReplicasPath, ".")...) - if err != nil { - return nil, false, err - } else if !found { - statusReplicas = 0 - } - - var labelSelector string - if len(labelSelectorPath) > 0 { - labelSelectorPath = strings.TrimPrefix(labelSelectorPath, ".") // ignore leading period - labelSelector, found, err = unstructured.NestedString(cr.UnstructuredContent(), strings.Split(labelSelectorPath, ".")...) - if err != nil { - return nil, false, err - } - } - - scale := &autoscalingv1.Scale{ - ObjectMeta: metav1.ObjectMeta{ - Name: cr.GetName(), - Namespace: cr.GetNamespace(), - UID: cr.GetUID(), - ResourceVersion: cr.GetResourceVersion(), - CreationTimestamp: cr.GetCreationTimestamp(), - }, - Spec: autoscalingv1.ScaleSpec{ - Replicas: int32(specReplicas), - }, - Status: autoscalingv1.ScaleStatus{ - Replicas: int32(statusReplicas), - Selector: labelSelector, - }, - } - - return scale, foundSpecReplicas, nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/etcd_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/etcd_test.go deleted file mode 100644 index 0a6870dc0..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/etcd_test.go +++ /dev/null @@ -1,575 +0,0 @@ -/* -Copyright 2018 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 customresource_test - -import ( - "io" - "reflect" - "strings" - "testing" - "time" - - autoscalingv1 "k8s.io/api/autoscaling/v1" - apiequality "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" - metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/diff" - genericapirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/registry/generic" - registrytest "k8s.io/apiserver/pkg/registry/generic/testing" - "k8s.io/apiserver/pkg/registry/rest" - etcdtesting "k8s.io/apiserver/pkg/storage/etcd/testing" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - "k8s.io/apiextensions-apiserver/pkg/apiserver" - "k8s.io/apiextensions-apiserver/pkg/crdserverscheme" - "k8s.io/apiextensions-apiserver/pkg/registry/customresource" - "k8s.io/apiextensions-apiserver/pkg/registry/customresource/tableconvertor" -) - -func newStorage(t *testing.T) (customresource.CustomResourceStorage, *etcdtesting.EtcdTestServer) { - server, etcdStorage := etcdtesting.NewUnsecuredEtcd3TestClientServer(t) - etcdStorage.Codec = unstructuredJsonCodec{} - restOptions := generic.RESTOptions{StorageConfig: etcdStorage, Decorator: generic.UndecoratedStorage, DeleteCollectionWorkers: 1, ResourcePrefix: "noxus"} - - parameterScheme := runtime.NewScheme() - parameterScheme.AddUnversionedTypes(schema.GroupVersion{Group: "mygroup.example.com", Version: "v1beta1"}, - &metav1.ListOptions{}, - &metav1.ExportOptions{}, - &metav1.GetOptions{}, - &metav1.DeleteOptions{}, - ) - - typer := apiserver.UnstructuredObjectTyper{ - Delegate: parameterScheme, - UnstructuredTyper: crdserverscheme.NewUnstructuredObjectTyper(), - } - - kind := schema.GroupVersionKind{Group: "mygroup.example.com", Version: "v1beta1", Kind: "Noxu"} - - labelSelectorPath := ".status.labelSelector" - scale := &apiextensions.CustomResourceSubresourceScale{ - SpecReplicasPath: ".spec.replicas", - StatusReplicasPath: ".status.replicas", - LabelSelectorPath: &labelSelectorPath, - } - - status := &apiextensions.CustomResourceSubresourceStatus{} - - headers := []apiextensions.CustomResourceColumnDefinition{ - {Name: "Age", Type: "date", JSONPath: ".metadata.creationTimestamp"}, - {Name: "Replicas", Type: "integer", JSONPath: ".spec.replicas"}, - {Name: "Missing", Type: "string", JSONPath: ".spec.missing"}, - {Name: "Invalid", Type: "integer", JSONPath: ".spec.string"}, - {Name: "String", Type: "string", JSONPath: ".spec.string"}, - {Name: "StringFloat64", Type: "string", JSONPath: ".spec.float64"}, - {Name: "StringInt64", Type: "string", JSONPath: ".spec.replicas"}, - {Name: "StringBool", Type: "string", JSONPath: ".spec.bool"}, - {Name: "Float64", Type: "number", JSONPath: ".spec.float64"}, - {Name: "Bool", Type: "boolean", JSONPath: ".spec.bool"}, - } - table, _ := tableconvertor.New(headers) - - storage := customresource.NewStorage( - schema.GroupResource{Group: "mygroup.example.com", Resource: "noxus"}, - schema.GroupVersionKind{Group: "mygroup.example.com", Version: "v1beta1", Kind: "NoxuItemList"}, - customresource.NewStrategy( - typer, - true, - kind, - nil, - nil, - status, - scale, - ), - restOptions, - []string{"all"}, - table, - ) - - return storage, server -} - -// createCustomResource is a helper function that returns a CustomResource with the updated resource version. -func createCustomResource(storage *customresource.REST, cr unstructured.Unstructured, t *testing.T) (unstructured.Unstructured, error) { - ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), cr.GetNamespace()) - obj, err := storage.Create(ctx, &cr, rest.ValidateAllObjectFunc, &metav1.CreateOptions{}) - if err != nil { - t.Errorf("Failed to create CustomResource, %v", err) - } - newCR := obj.(*unstructured.Unstructured) - return *newCR, nil -} - -func validNewCustomResource() *unstructured.Unstructured { - return &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "mygroup.example.com/v1beta1", - "kind": "Noxu", - "metadata": map[string]interface{}{ - "namespace": "default", - "name": "foo", - "creationTimestamp": time.Now().Add(-time.Hour*12 - 30*time.Minute).UTC().Format(time.RFC3339), - }, - "spec": map[string]interface{}{ - "replicas": int64(7), - "string": "string", - "float64": float64(3.1415926), - "bool": true, - "stringList": []interface{}{"foo", "bar"}, - "mixedList": []interface{}{"foo", int64(42)}, - "nonPrimitiveList": []interface{}{"foo", []interface{}{int64(1), int64(2)}}, - }, - }, - } -} - -var validCustomResource = *validNewCustomResource() - -func TestCreate(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - test := registrytest.New(t, storage.CustomResource.Store) - cr := validNewCustomResource() - cr.SetNamespace("") - test.TestCreate( - cr, - ) -} - -func TestGet(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - test := registrytest.New(t, storage.CustomResource.Store) - test.TestGet(validNewCustomResource()) -} - -func TestList(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - test := registrytest.New(t, storage.CustomResource.Store) - test.TestList(validNewCustomResource()) -} - -func TestDelete(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - test := registrytest.New(t, storage.CustomResource.Store) - test.TestDelete(validNewCustomResource()) -} - -func TestGenerationNumber(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - modifiedRno := *validNewCustomResource() - modifiedRno.SetGeneration(10) - ctx := genericapirequest.NewDefaultContext() - cr, err := createCustomResource(storage.CustomResource, modifiedRno, t) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - etcdCR, err := storage.CustomResource.Get(ctx, cr.GetName(), &metav1.GetOptions{}) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - storedCR, _ := etcdCR.(*unstructured.Unstructured) - - // Generation initialization - if storedCR.GetGeneration() != 1 { - t.Fatalf("Unexpected generation number %v", storedCR.GetGeneration()) - } - - // Updates to spec should increment the generation number - setSpecReplicas(storedCR, getSpecReplicas(storedCR)+1) - if _, _, err := storage.CustomResource.Update(ctx, storedCR.GetName(), rest.DefaultUpdatedObjectInfo(storedCR), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{}); err != nil { - t.Errorf("unexpected error: %v", err) - } - etcdCR, err = storage.CustomResource.Get(ctx, cr.GetName(), &metav1.GetOptions{}) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - storedCR, _ = etcdCR.(*unstructured.Unstructured) - if storedCR.GetGeneration() != 2 { - t.Fatalf("Unexpected generation, spec: %v", storedCR.GetGeneration()) - } - - // Updates to status should not increment the generation number - setStatusReplicas(storedCR, getStatusReplicas(storedCR)+1) - if _, _, err := storage.CustomResource.Update(ctx, storedCR.GetName(), rest.DefaultUpdatedObjectInfo(storedCR), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{}); err != nil { - t.Errorf("unexpected error: %v", err) - } - etcdCR, err = storage.CustomResource.Get(ctx, cr.GetName(), &metav1.GetOptions{}) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - storedCR, _ = etcdCR.(*unstructured.Unstructured) - if storedCR.GetGeneration() != 2 { - t.Fatalf("Unexpected generation, spec: %v", storedCR.GetGeneration()) - } - -} - -func TestCategories(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - - expected := []string{"all"} - actual := storage.CustomResource.Categories() - ok := reflect.DeepEqual(actual, expected) - if !ok { - t.Errorf("categories are not equal. expected = %v actual = %v", expected, actual) - } -} - -func TestColumns(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - - ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), metav1.NamespaceDefault) - key := "/noxus/" + metav1.NamespaceDefault + "/foo" - validCustomResource := validNewCustomResource() - if err := storage.CustomResource.Storage.Create(ctx, key, validCustomResource, nil, 0, false); err != nil { - t.Fatalf("unexpected error: %v", err) - } - - gottenList, err := storage.CustomResource.List(ctx, &metainternal.ListOptions{}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - tbl, err := storage.CustomResource.ConvertToTable(ctx, gottenList, &metav1beta1.TableOptions{}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - expectedColumns := []struct { - Name, Type string - }{ - {"Name", "string"}, - {"Age", "date"}, - {"Replicas", "integer"}, - {"Missing", "string"}, - {"Invalid", "integer"}, - {"String", "string"}, - {"StringFloat64", "string"}, - {"StringInt64", "string"}, - {"StringBool", "string"}, - {"Float64", "number"}, - {"Bool", "boolean"}, - } - if len(tbl.ColumnDefinitions) != len(expectedColumns) { - t.Fatalf("got %d columns, expected %d. Got: %+v", len(tbl.ColumnDefinitions), len(expectedColumns), tbl.ColumnDefinitions) - } - for i, d := range tbl.ColumnDefinitions { - if d.Name != expectedColumns[i].Name { - t.Errorf("got column %d name %q, expected %q", i, d.Name, expectedColumns[i].Name) - } - if d.Type != expectedColumns[i].Type { - t.Errorf("got column %d type %q, expected %q", i, d.Type, expectedColumns[i].Type) - } - } - - expectedRows := [][]interface{}{ - { - "foo", - "12h", - int64(7), - nil, - nil, - "string", - "3.1415926", - "7", - "true", - float64(3.1415926), - true, - }, - } - for i, r := range tbl.Rows { - if !reflect.DeepEqual(r.Cells, expectedRows[i]) { - t.Errorf("got row %d with cells %#v, expected %#v", i, r.Cells, expectedRows[i]) - } - } -} - -func TestStatusUpdate(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), metav1.NamespaceDefault) - key := "/noxus/" + metav1.NamespaceDefault + "/foo" - validCustomResource := validNewCustomResource() - if err := storage.CustomResource.Storage.Create(ctx, key, validCustomResource, nil, 0, false); err != nil { - t.Fatalf("unexpected error: %v", err) - } - - gottenObj, err := storage.CustomResource.Get(ctx, "foo", &metav1.GetOptions{}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - update := gottenObj.(*unstructured.Unstructured) - updateContent := update.Object - updateContent["status"] = map[string]interface{}{ - "replicas": int64(7), - } - - if _, _, err := storage.Status.Update(ctx, update.GetName(), rest.DefaultUpdatedObjectInfo(update), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{}); err != nil { - t.Fatalf("unexpected error: %v", err) - } - - obj, err := storage.CustomResource.Get(ctx, "foo", &metav1.GetOptions{}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - cr, ok := obj.(*unstructured.Unstructured) - if !ok { - t.Fatal("unexpected error: custom resource should be of type Unstructured") - } - content := cr.UnstructuredContent() - - spec := content["spec"].(map[string]interface{}) - status := content["status"].(map[string]interface{}) - - if spec["replicas"].(int64) != 7 { - t.Errorf("we expected .spec.replicas to not be updated but it was updated to %v", spec["replicas"].(int64)) - } - if status["replicas"].(int64) != 7 { - t.Errorf("we expected .status.replicas to be updated to %d but it was %v", 7, status["replicas"].(int64)) - } -} - -func TestScaleGet(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - - name := "foo" - - var cr unstructured.Unstructured - ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), metav1.NamespaceDefault) - key := "/noxus/" + metav1.NamespaceDefault + "/" + name - if err := storage.CustomResource.Storage.Create(ctx, key, &validCustomResource, &cr, 0, false); err != nil { - t.Fatalf("error setting new custom resource (key: %s) %v: %v", key, validCustomResource, err) - } - - want := &autoscalingv1.Scale{ - ObjectMeta: metav1.ObjectMeta{ - Name: cr.GetName(), - Namespace: metav1.NamespaceDefault, - UID: cr.GetUID(), - ResourceVersion: cr.GetResourceVersion(), - CreationTimestamp: cr.GetCreationTimestamp(), - }, - Spec: autoscalingv1.ScaleSpec{ - Replicas: int32(7), - }, - } - - obj, err := storage.Scale.Get(ctx, name, &metav1.GetOptions{}) - if err != nil { - t.Fatalf("error fetching scale for %s: %v", name, err) - } - - got := obj.(*autoscalingv1.Scale) - if !apiequality.Semantic.DeepEqual(got, want) { - t.Errorf("unexpected scale: %s", diff.ObjectDiff(got, want)) - } -} - -func TestScaleGetWithoutSpecReplicas(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - - name := "foo" - - var cr unstructured.Unstructured - ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), metav1.NamespaceDefault) - key := "/noxus/" + metav1.NamespaceDefault + "/" + name - withoutSpecReplicas := validCustomResource.DeepCopy() - unstructured.RemoveNestedField(withoutSpecReplicas.Object, "spec", "replicas") - if err := storage.CustomResource.Storage.Create(ctx, key, withoutSpecReplicas, &cr, 0, false); err != nil { - t.Fatalf("error setting new custom resource (key: %s) %v: %v", key, withoutSpecReplicas, err) - } - - _, err := storage.Scale.Get(ctx, name, &metav1.GetOptions{}) - if err == nil { - t.Fatalf("error expected for %s", name) - } - if expected := `the spec replicas field ".spec.replicas" does not exist`; !strings.Contains(err.Error(), expected) { - t.Fatalf("expected error string %q, got: %v", expected, err) - } -} - -func TestScaleUpdate(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - - name := "foo" - - var cr unstructured.Unstructured - ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), metav1.NamespaceDefault) - key := "/noxus/" + metav1.NamespaceDefault + "/" + name - if err := storage.CustomResource.Storage.Create(ctx, key, &validCustomResource, &cr, 0, false); err != nil { - t.Fatalf("error setting new custom resource (key: %s) %v: %v", key, validCustomResource, err) - } - - obj, err := storage.Scale.Get(ctx, name, &metav1.GetOptions{}) - if err != nil { - t.Fatalf("error fetching scale for %s: %v", name, err) - } - scale, ok := obj.(*autoscalingv1.Scale) - if !ok { - t.Fatalf("%v is not of the type autoscalingv1.Scale", scale) - } - - replicas := 12 - update := autoscalingv1.Scale{ - ObjectMeta: scale.ObjectMeta, - Spec: autoscalingv1.ScaleSpec{ - Replicas: int32(replicas), - }, - } - - if _, _, err := storage.Scale.Update(ctx, update.Name, rest.DefaultUpdatedObjectInfo(&update), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{}); err != nil { - t.Fatalf("error updating scale %v: %v", update, err) - } - - obj, err = storage.Scale.Get(ctx, name, &metav1.GetOptions{}) - if err != nil { - t.Fatalf("error fetching scale for %s: %v", name, err) - } - scale = obj.(*autoscalingv1.Scale) - if scale.Spec.Replicas != int32(replicas) { - t.Errorf("wrong replicas count: expected: %d got: %d", replicas, scale.Spec.Replicas) - } - - update.ResourceVersion = scale.ResourceVersion - update.Spec.Replicas = 15 - - if _, _, err = storage.Scale.Update(ctx, update.Name, rest.DefaultUpdatedObjectInfo(&update), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{}); err != nil && !errors.IsConflict(err) { - t.Fatalf("unexpected error, expecting an update conflict but got %v", err) - } -} - -func TestScaleUpdateWithoutSpecReplicas(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - defer storage.CustomResource.Store.DestroyFunc() - - name := "foo" - - var cr unstructured.Unstructured - ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), metav1.NamespaceDefault) - key := "/noxus/" + metav1.NamespaceDefault + "/" + name - withoutSpecReplicas := validCustomResource.DeepCopy() - unstructured.RemoveNestedField(withoutSpecReplicas.Object, "spec", "replicas") - if err := storage.CustomResource.Storage.Create(ctx, key, withoutSpecReplicas, &cr, 0, false); err != nil { - t.Fatalf("error setting new custom resource (key: %s) %v: %v", key, withoutSpecReplicas, err) - } - - replicas := 12 - update := autoscalingv1.Scale{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - ResourceVersion: cr.GetResourceVersion(), - }, - Spec: autoscalingv1.ScaleSpec{ - Replicas: int32(replicas), - }, - } - - if _, _, err := storage.Scale.Update(ctx, update.Name, rest.DefaultUpdatedObjectInfo(&update), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{}); err != nil { - t.Fatalf("error updating scale %v: %v", update, err) - } - - obj, err := storage.Scale.Get(ctx, name, &metav1.GetOptions{}) - if err != nil { - t.Fatalf("error fetching scale for %s: %v", name, err) - } - scale := obj.(*autoscalingv1.Scale) - if scale.Spec.Replicas != int32(replicas) { - t.Errorf("wrong replicas count: expected: %d got: %d", replicas, scale.Spec.Replicas) - } -} - -type unstructuredJsonCodec struct{} - -func (c unstructuredJsonCodec) Decode(data []byte, defaults *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) { - obj := into.(*unstructured.Unstructured) - err := obj.UnmarshalJSON(data) - if err != nil { - return nil, nil, err - } - gvk := obj.GroupVersionKind() - return obj, &gvk, nil -} - -func (c unstructuredJsonCodec) Encode(obj runtime.Object, w io.Writer) error { - u := obj.(*unstructured.Unstructured) - bs, err := u.MarshalJSON() - if err != nil { - return err - } - w.Write(bs) - return nil -} - -func setSpecReplicas(u *unstructured.Unstructured, replicas int64) { - setNestedField(u, replicas, "spec", "replicas") -} - -func getSpecReplicas(u *unstructured.Unstructured) int64 { - val, found, err := unstructured.NestedInt64(u.Object, "spec", "replicas") - if !found || err != nil { - return 0 - } - return val -} - -func setStatusReplicas(u *unstructured.Unstructured, replicas int64) { - setNestedField(u, replicas, "status", "replicas") -} - -func getStatusReplicas(u *unstructured.Unstructured) int64 { - val, found, err := unstructured.NestedInt64(u.Object, "status", "replicas") - if !found || err != nil { - return 0 - } - return val -} - -func setNestedField(u *unstructured.Unstructured, value interface{}, fields ...string) { - if u.Object == nil { - u.Object = make(map[string]interface{}) - } - unstructured.SetNestedField(u.Object, value, fields...) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/status_strategy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/status_strategy.go deleted file mode 100644 index 1710eb2e1..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/status_strategy.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2018 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 customresource - -import ( - "context" - - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" -) - -type statusStrategy struct { - customResourceStrategy -} - -func NewStatusStrategy(strategy customResourceStrategy) statusStrategy { - return statusStrategy{strategy} -} - -func (a statusStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { - // update is only allowed to set status - newCustomResourceObject := obj.(*unstructured.Unstructured) - newCustomResource := newCustomResourceObject.UnstructuredContent() - status, ok := newCustomResource["status"] - - // copy old object into new object - oldCustomResourceObject := old.(*unstructured.Unstructured) - // overridding the resourceVersion in metadata is safe here, we have already checked that - // new object and old object have the same resourceVersion. - *newCustomResourceObject = *oldCustomResourceObject.DeepCopy() - - // set status - newCustomResource = newCustomResourceObject.UnstructuredContent() - if ok { - newCustomResource["status"] = status - } else { - delete(newCustomResource, "status") - } -} - -// ValidateUpdate is the default update validation for an end user updating status. -func (a statusStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { - return a.customResourceStrategy.validator.ValidateStatusUpdate(ctx, obj, old, a.scale) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/status_strategy_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/status_strategy_test.go deleted file mode 100644 index 8a651d12b..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/status_strategy_test.go +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright 2018 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 customresource - -import ( - "context" - "reflect" - "testing" - - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -func TestPrepareForUpdate(t *testing.T) { - strategy := statusStrategy{} - tcs := []struct { - old *unstructured.Unstructured - obj *unstructured.Unstructured - expected *unstructured.Unstructured - }{ - { - // changes to spec are ignored - old: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "old", - }, - }, - obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "new", - }, - }, - expected: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "old", - }, - }, - }, - { - // changes to other places are also ignored - old: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "old", - }, - }, - obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "new": "new", - }, - }, - expected: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "old", - }, - }, - }, - { - // delete status - old: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "old", - "status": "old", - }, - }, - obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "old", - }, - }, - expected: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "old", - }, - }, - }, - { - // update status - old: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "old", - "status": "old", - }, - }, - obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "status": "new", - }, - }, - expected: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "old", - "status": "new", - }, - }, - }, - { - // update status and other parts - old: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "old", - "status": "old", - }, - }, - obj: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "new", - "new": "new", - "status": "new", - }, - }, - expected: &unstructured.Unstructured{ - Object: map[string]interface{}{ - "spec": "old", - "status": "new", - }, - }, - }, - } - for index, tc := range tcs { - strategy.PrepareForUpdate(context.TODO(), tc.obj, tc.old) - if !reflect.DeepEqual(tc.obj, tc.expected) { - t.Errorf("test %d failed: expected: %v, got %v", index, tc.expected, tc.obj) - } - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/strategy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/strategy.go deleted file mode 100644 index 4895e287a..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/strategy.go +++ /dev/null @@ -1,185 +0,0 @@ -/* -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 customresource - -import ( - "context" - - "github.com/go-openapi/validate" - - apiequality "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/validation/field" - apiserverstorage "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/names" - utilfeature "k8s.io/apiserver/pkg/util/feature" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" -) - -// customResourceStrategy implements behavior for CustomResources. -type customResourceStrategy struct { - runtime.ObjectTyper - names.NameGenerator - - namespaceScoped bool - validator customResourceValidator - status *apiextensions.CustomResourceSubresourceStatus - scale *apiextensions.CustomResourceSubresourceScale -} - -func NewStrategy(typer runtime.ObjectTyper, namespaceScoped bool, kind schema.GroupVersionKind, schemaValidator, statusSchemaValidator *validate.SchemaValidator, status *apiextensions.CustomResourceSubresourceStatus, scale *apiextensions.CustomResourceSubresourceScale) customResourceStrategy { - return customResourceStrategy{ - ObjectTyper: typer, - NameGenerator: names.SimpleNameGenerator, - namespaceScoped: namespaceScoped, - status: status, - scale: scale, - validator: customResourceValidator{ - namespaceScoped: namespaceScoped, - kind: kind, - schemaValidator: schemaValidator, - statusSchemaValidator: statusSchemaValidator, - }, - } -} - -func (a customResourceStrategy) NamespaceScoped() bool { - return a.namespaceScoped -} - -// PrepareForCreate clears the status of a CustomResource before creation. -func (a customResourceStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { - if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) && a.status != nil { - customResourceObject := obj.(*unstructured.Unstructured) - customResource := customResourceObject.UnstructuredContent() - - // create cannot set status - if _, ok := customResource["status"]; ok { - delete(customResource, "status") - } - } - - accessor, _ := meta.Accessor(obj) - accessor.SetGeneration(1) -} - -// PrepareForUpdate clears fields that are not allowed to be set by end users on update. -func (a customResourceStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { - if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) || a.status == nil { - return - } - - newCustomResourceObject := obj.(*unstructured.Unstructured) - oldCustomResourceObject := old.(*unstructured.Unstructured) - - newCustomResource := newCustomResourceObject.UnstructuredContent() - oldCustomResource := oldCustomResourceObject.UnstructuredContent() - - // update is not allowed to set status - _, ok1 := newCustomResource["status"] - _, ok2 := oldCustomResource["status"] - switch { - case ok2: - newCustomResource["status"] = oldCustomResource["status"] - case ok1: - delete(newCustomResource, "status") - } - - // Any changes to the spec increment the generation number, any changes to the - // status should reflect the generation number of the corresponding object. We push - // the burden of managing the status onto the clients because we can't (in general) - // know here what version of spec the writer of the status has seen. It may seem like - // we can at first -- since obj contains spec -- but in the future we will probably make - // status its own object, and even if we don't, writes may be the result of a - // read-update-write loop, so the contents of spec may not actually be the spec that - // the CustomResource has *seen*. - newSpec, ok1 := newCustomResource["spec"] - oldSpec, ok2 := oldCustomResource["spec"] - - // spec is changed, created or deleted - if (ok1 && ok2 && !apiequality.Semantic.DeepEqual(oldSpec, newSpec)) || (ok1 && !ok2) || (!ok1 && ok2) { - oldAccessor, _ := meta.Accessor(oldCustomResourceObject) - newAccessor, _ := meta.Accessor(newCustomResourceObject) - newAccessor.SetGeneration(oldAccessor.GetGeneration() + 1) - } -} - -// Validate validates a new CustomResource. -func (a customResourceStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { - return a.validator.Validate(ctx, obj, a.scale) -} - -// Canonicalize normalizes the object after validation. -func (customResourceStrategy) Canonicalize(obj runtime.Object) { -} - -// AllowCreateOnUpdate is false for CustomResources; this means a POST is -// needed to create one. -func (customResourceStrategy) AllowCreateOnUpdate() bool { - return false -} - -// AllowUnconditionalUpdate is the default update policy for CustomResource objects. -func (customResourceStrategy) AllowUnconditionalUpdate() bool { - return false -} - -// ValidateUpdate is the default update validation for an end user updating status. -func (a customResourceStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { - return a.validator.ValidateUpdate(ctx, obj, old, a.scale) -} - -// GetAttrs returns labels and fields of a given object for filtering purposes. -func (a customResourceStrategy) GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error) { - accessor, err := meta.Accessor(obj) - if err != nil { - return nil, nil, false, err - } - return labels.Set(accessor.GetLabels()), objectMetaFieldsSet(accessor, a.namespaceScoped), accessor.GetInitializers() != nil, nil -} - -// objectMetaFieldsSet returns a fields that represent the ObjectMeta. -func objectMetaFieldsSet(objectMeta metav1.Object, namespaceScoped bool) fields.Set { - if namespaceScoped { - return fields.Set{ - "metadata.name": objectMeta.GetName(), - "metadata.namespace": objectMeta.GetNamespace(), - } - } - return fields.Set{ - "metadata.name": objectMeta.GetName(), - } -} - -// MatchCustomResourceDefinitionStorage is the filter used by the generic etcd backend to route -// watch events from etcd to clients of the apiserver only interested in specific -// labels/fields. -func (a customResourceStrategy) MatchCustomResourceDefinitionStorage(label labels.Selector, field fields.Selector) apiserverstorage.SelectionPredicate { - return apiserverstorage.SelectionPredicate{ - Label: label, - Field: field, - GetAttrs: a.GetAttrs, - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/tableconvertor/tableconvertor.go b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/tableconvertor/tableconvertor.go deleted file mode 100644 index e1bed809d..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/tableconvertor/tableconvertor.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright 2018 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 tableconvertor - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "reflect" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - "k8s.io/apimachinery/pkg/api/meta" - metatable "k8s.io/apimachinery/pkg/api/meta/table" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apiserver/pkg/registry/rest" - "k8s.io/client-go/util/jsonpath" -) - -var swaggerMetadataDescriptions = metav1.ObjectMeta{}.SwaggerDoc() - -// New creates a new table convertor for the provided CRD column definition. If the printer definition cannot be parsed, -// error will be returned along with a default table convertor. -func New(crdColumns []apiextensions.CustomResourceColumnDefinition) (rest.TableConvertor, error) { - headers := []metav1beta1.TableColumnDefinition{ - {Name: "Name", Type: "string", Format: "name", Description: swaggerMetadataDescriptions["name"]}, - } - c := &convertor{ - headers: headers, - } - - for _, col := range crdColumns { - path := jsonpath.New(col.Name) - if err := path.Parse(fmt.Sprintf("{%s}", col.JSONPath)); err != nil { - return c, fmt.Errorf("unrecognized column definition %q", col.JSONPath) - } - path.AllowMissingKeys(true) - - desc := fmt.Sprintf("Custom resource definition column (in JSONPath format): %s", col.JSONPath) - if len(col.Description) > 0 { - desc = col.Description - } - - c.additionalColumns = append(c.additionalColumns, path) - c.headers = append(c.headers, metav1beta1.TableColumnDefinition{ - Name: col.Name, - Type: col.Type, - Format: col.Format, - Description: desc, - Priority: col.Priority, - }) - } - - return c, nil -} - -type convertor struct { - headers []metav1beta1.TableColumnDefinition - additionalColumns []*jsonpath.JSONPath -} - -func (c *convertor) ConvertToTable(ctx context.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1beta1.Table, error) { - table := &metav1beta1.Table{ - ColumnDefinitions: c.headers, - } - if m, err := meta.ListAccessor(obj); err == nil { - table.ResourceVersion = m.GetResourceVersion() - table.SelfLink = m.GetSelfLink() - table.Continue = m.GetContinue() - } else { - if m, err := meta.CommonAccessor(obj); err == nil { - table.ResourceVersion = m.GetResourceVersion() - table.SelfLink = m.GetSelfLink() - } - } - - var err error - buf := &bytes.Buffer{} - table.Rows, err = metatable.MetaToTableRow(obj, func(obj runtime.Object, m metav1.Object, name, age string) ([]interface{}, error) { - cells := make([]interface{}, 1, 1+len(c.additionalColumns)) - cells[0] = name - customHeaders := c.headers[1:] - for i, column := range c.additionalColumns { - results, err := column.FindResults(obj.(runtime.Unstructured).UnstructuredContent()) - if err != nil || len(results) == 0 || len(results[0]) == 0 { - cells = append(cells, nil) - continue - } - - // as we only support simple JSON path, we can assume to have only one result (or none, filtered out above) - value := results[0][0].Interface() - if customHeaders[i].Type == "string" { - if err := column.PrintResults(buf, []reflect.Value{reflect.ValueOf(value)}); err == nil { - cells = append(cells, buf.String()) - buf.Reset() - } else { - cells = append(cells, nil) - } - } else { - cells = append(cells, cellForJSONValue(customHeaders[i].Type, value)) - } - } - return cells, nil - }) - return table, err -} - -func cellForJSONValue(headerType string, value interface{}) interface{} { - if value == nil { - return nil - } - - switch headerType { - case "integer": - switch typed := value.(type) { - case int64: - return typed - case float64: - return int64(typed) - case json.Number: - if i64, err := typed.Int64(); err == nil { - return i64 - } - } - case "number": - switch typed := value.(type) { - case int64: - return float64(typed) - case float64: - return typed - case json.Number: - if f, err := typed.Float64(); err == nil { - return f - } - } - case "boolean": - if b, ok := value.(bool); ok { - return b - } - case "string": - if s, ok := value.(string); ok { - return s - } - case "date": - if typed, ok := value.(string); ok { - var timestamp metav1.Time - err := timestamp.UnmarshalQueryParameter(typed) - if err != nil { - return "" - } - return metatable.ConvertToHumanReadableDateType(timestamp) - } - } - - return nil -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/tableconvertor/tableconvertor_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/tableconvertor/tableconvertor_test.go deleted file mode 100644 index 179aabb8a..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/tableconvertor/tableconvertor_test.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2018 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 tableconvertor - -import ( - "fmt" - "reflect" - "testing" - "time" -) - -func Test_cellForJSONValue(t *testing.T) { - tests := []struct { - headerType string - value interface{} - want interface{} - }{ - {"integer", int64(42), int64(42)}, - {"integer", float64(3.14), int64(3)}, - {"integer", true, nil}, - {"integer", "foo", nil}, - - {"number", int64(42), float64(42)}, - {"number", float64(3.14), float64(3.14)}, - {"number", true, nil}, - {"number", "foo", nil}, - - {"boolean", int64(42), nil}, - {"boolean", float64(3.14), nil}, - {"boolean", true, true}, - {"boolean", "foo", nil}, - - {"string", int64(42), nil}, - {"string", float64(3.14), nil}, - {"string", true, nil}, - {"string", "foo", "foo"}, - - {"date", int64(42), nil}, - {"date", float64(3.14), nil}, - {"date", true, nil}, - {"date", time.Now().Add(-time.Hour*12 - 30*time.Minute).UTC().Format(time.RFC3339), "12h"}, - {"date", time.Now().Add(+time.Hour*12 + 30*time.Minute).UTC().Format(time.RFC3339), ""}, - {"date", "", ""}, - - {"unknown", "foo", nil}, - } - for _, tt := range tests { - t.Run(fmt.Sprintf("%#v of type %s", tt.value, tt.headerType), func(t *testing.T) { - if got := cellForJSONValue(tt.headerType, tt.value); !reflect.DeepEqual(got, tt.want) { - t.Errorf("cellForJSONValue() = %#v, want %#v", got, tt.want) - } - }) - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/validator.go b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/validator.go deleted file mode 100644 index 5206a17eb..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresource/validator.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright 2018 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 customresource - -import ( - "context" - "fmt" - "math" - "strings" - - "github.com/go-openapi/validate" - - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/api/validation" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/validation/field" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - apiservervalidation "k8s.io/apiextensions-apiserver/pkg/apiserver/validation" -) - -type customResourceValidator struct { - namespaceScoped bool - kind schema.GroupVersionKind - schemaValidator *validate.SchemaValidator - statusSchemaValidator *validate.SchemaValidator -} - -func (a customResourceValidator) Validate(ctx context.Context, obj runtime.Object, scale *apiextensions.CustomResourceSubresourceScale) field.ErrorList { - u, ok := obj.(*unstructured.Unstructured) - if !ok { - return field.ErrorList{field.Invalid(field.NewPath(""), u, fmt.Sprintf("has type %T. Must be a pointer to an Unstructured type", u))} - } - accessor, err := meta.Accessor(obj) - if err != nil { - return field.ErrorList{field.Invalid(field.NewPath("metadata"), nil, err.Error())} - } - - if errs := a.ValidateTypeMeta(ctx, u); len(errs) > 0 { - return errs - } - - var allErrs field.ErrorList - - allErrs = append(allErrs, validation.ValidateObjectMetaAccessor(accessor, a.namespaceScoped, validation.NameIsDNSSubdomain, field.NewPath("metadata"))...) - if err = apiservervalidation.ValidateCustomResource(u.UnstructuredContent(), a.schemaValidator); err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath(""), u.UnstructuredContent(), err.Error())) - } - allErrs = append(allErrs, a.ValidateScaleSpec(ctx, u, scale)...) - allErrs = append(allErrs, a.ValidateScaleStatus(ctx, u, scale)...) - - return allErrs -} - -func (a customResourceValidator) ValidateUpdate(ctx context.Context, obj, old runtime.Object, scale *apiextensions.CustomResourceSubresourceScale) field.ErrorList { - u, ok := obj.(*unstructured.Unstructured) - if !ok { - return field.ErrorList{field.Invalid(field.NewPath(""), u, fmt.Sprintf("has type %T. Must be a pointer to an Unstructured type", u))} - } - objAccessor, err := meta.Accessor(obj) - if err != nil { - return field.ErrorList{field.Invalid(field.NewPath("metadata"), nil, err.Error())} - } - oldAccessor, err := meta.Accessor(old) - if err != nil { - return field.ErrorList{field.Invalid(field.NewPath("metadata"), nil, err.Error())} - } - - if errs := a.ValidateTypeMeta(ctx, u); len(errs) > 0 { - return errs - } - - var allErrs field.ErrorList - - allErrs = append(allErrs, validation.ValidateObjectMetaAccessorUpdate(objAccessor, oldAccessor, field.NewPath("metadata"))...) - if err = apiservervalidation.ValidateCustomResource(u.UnstructuredContent(), a.schemaValidator); err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath(""), u.UnstructuredContent(), err.Error())) - } - allErrs = append(allErrs, a.ValidateScaleSpec(ctx, u, scale)...) - allErrs = append(allErrs, a.ValidateScaleStatus(ctx, u, scale)...) - - return allErrs -} - -func (a customResourceValidator) ValidateStatusUpdate(ctx context.Context, obj, old runtime.Object, scale *apiextensions.CustomResourceSubresourceScale) field.ErrorList { - u, ok := obj.(*unstructured.Unstructured) - if !ok { - return field.ErrorList{field.Invalid(field.NewPath(""), u, fmt.Sprintf("has type %T. Must be a pointer to an Unstructured type", u))} - } - objAccessor, err := meta.Accessor(obj) - if err != nil { - return field.ErrorList{field.Invalid(field.NewPath("metadata"), nil, err.Error())} - } - oldAccessor, err := meta.Accessor(old) - if err != nil { - return field.ErrorList{field.Invalid(field.NewPath("metadata"), nil, err.Error())} - } - - if errs := a.ValidateTypeMeta(ctx, u); len(errs) > 0 { - return errs - } - - var allErrs field.ErrorList - - allErrs = append(allErrs, validation.ValidateObjectMetaAccessorUpdate(objAccessor, oldAccessor, field.NewPath("metadata"))...) - if err = apiservervalidation.ValidateCustomResource(u.UnstructuredContent(), a.schemaValidator); err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath(""), u.UnstructuredContent(), err.Error())) - } - allErrs = append(allErrs, a.ValidateScaleStatus(ctx, u, scale)...) - - return allErrs -} - -func (a customResourceValidator) ValidateTypeMeta(ctx context.Context, obj *unstructured.Unstructured) field.ErrorList { - typeAccessor, err := meta.TypeAccessor(obj) - if err != nil { - return field.ErrorList{field.Invalid(field.NewPath("kind"), nil, err.Error())} - } - - var allErrs field.ErrorList - if typeAccessor.GetKind() != a.kind.Kind { - allErrs = append(allErrs, field.Invalid(field.NewPath("kind"), typeAccessor.GetKind(), fmt.Sprintf("must be %v", a.kind.Kind))) - } - if typeAccessor.GetAPIVersion() != a.kind.Group+"/"+a.kind.Version { - allErrs = append(allErrs, field.Invalid(field.NewPath("apiVersion"), typeAccessor.GetAPIVersion(), fmt.Sprintf("must be %v", a.kind.Group+"/"+a.kind.Version))) - } - return allErrs -} - -func (a customResourceValidator) ValidateScaleSpec(ctx context.Context, obj *unstructured.Unstructured, scale *apiextensions.CustomResourceSubresourceScale) field.ErrorList { - if scale == nil { - return nil - } - - var allErrs field.ErrorList - - // validate specReplicas - specReplicasPath := strings.TrimPrefix(scale.SpecReplicasPath, ".") // ignore leading period - specReplicas, _, err := unstructured.NestedInt64(obj.UnstructuredContent(), strings.Split(specReplicasPath, ".")...) - if err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath(scale.SpecReplicasPath), specReplicas, err.Error())) - } else if specReplicas < 0 { - allErrs = append(allErrs, field.Invalid(field.NewPath(scale.SpecReplicasPath), specReplicas, "should be a non-negative integer")) - } else if specReplicas > math.MaxInt32 { - allErrs = append(allErrs, field.Invalid(field.NewPath(scale.SpecReplicasPath), specReplicas, fmt.Sprintf("should be less than or equal to %v", math.MaxInt32))) - } - - return allErrs -} - -func (a customResourceValidator) ValidateScaleStatus(ctx context.Context, obj *unstructured.Unstructured, scale *apiextensions.CustomResourceSubresourceScale) field.ErrorList { - if scale == nil { - return nil - } - - var allErrs field.ErrorList - - // validate statusReplicas - statusReplicasPath := strings.TrimPrefix(scale.StatusReplicasPath, ".") // ignore leading period - statusReplicas, _, err := unstructured.NestedInt64(obj.UnstructuredContent(), strings.Split(statusReplicasPath, ".")...) - if err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath(scale.StatusReplicasPath), statusReplicas, err.Error())) - } else if statusReplicas < 0 { - allErrs = append(allErrs, field.Invalid(field.NewPath(scale.StatusReplicasPath), statusReplicas, "should be a non-negative integer")) - } else if statusReplicas > math.MaxInt32 { - allErrs = append(allErrs, field.Invalid(field.NewPath(scale.StatusReplicasPath), statusReplicas, fmt.Sprintf("should be less than or equal to %v", math.MaxInt32))) - } - - // validate labelSelector - if scale.LabelSelectorPath != nil { - labelSelectorPath := strings.TrimPrefix(*scale.LabelSelectorPath, ".") // ignore leading period - labelSelector, _, err := unstructured.NestedString(obj.UnstructuredContent(), strings.Split(labelSelectorPath, ".")...) - if err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath(*scale.LabelSelectorPath), labelSelector, err.Error())) - } - } - - return allErrs -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go deleted file mode 100644 index c6b50915f..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go +++ /dev/null @@ -1,181 +0,0 @@ -/* -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 customresourcedefinition - -import ( - "context" - "fmt" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apiserver/pkg/registry/generic" - genericregistry "k8s.io/apiserver/pkg/registry/generic/registry" - "k8s.io/apiserver/pkg/registry/rest" - "k8s.io/apiserver/pkg/storage" - storageerr "k8s.io/apiserver/pkg/storage/errors" - "k8s.io/apiserver/pkg/util/dryrun" -) - -// rest implements a RESTStorage for API services against etcd -type REST struct { - *genericregistry.Store -} - -// NewREST returns a RESTStorage object that will work against API services. -func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) *REST { - strategy := NewStrategy(scheme) - - store := &genericregistry.Store{ - NewFunc: func() runtime.Object { return &apiextensions.CustomResourceDefinition{} }, - NewListFunc: func() runtime.Object { return &apiextensions.CustomResourceDefinitionList{} }, - PredicateFunc: MatchCustomResourceDefinition, - DefaultQualifiedResource: apiextensions.Resource("customresourcedefinitions"), - - CreateStrategy: strategy, - UpdateStrategy: strategy, - DeleteStrategy: strategy, - } - options := &generic.StoreOptions{RESTOptions: optsGetter, AttrFunc: GetAttrs} - if err := store.CompleteWithOptions(options); err != nil { - panic(err) // TODO: Propagate error up - } - return &REST{store} -} - -// Implement ShortNamesProvider -var _ rest.ShortNamesProvider = &REST{} - -// ShortNames implements the ShortNamesProvider interface. Returns a list of short names for a resource. -func (r *REST) ShortNames() []string { - return []string{"crd", "crds"} -} - -// Delete adds the CRD finalizer to the list -func (r *REST) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) (runtime.Object, bool, error) { - obj, err := r.Get(ctx, name, &metav1.GetOptions{}) - if err != nil { - return nil, false, err - } - - crd := obj.(*apiextensions.CustomResourceDefinition) - - // Ensure we have a UID precondition - if options == nil { - options = metav1.NewDeleteOptions(0) - } - if options.Preconditions == nil { - options.Preconditions = &metav1.Preconditions{} - } - if options.Preconditions.UID == nil { - options.Preconditions.UID = &crd.UID - } else if *options.Preconditions.UID != crd.UID { - err = apierrors.NewConflict( - apiextensions.Resource("customresourcedefinitions"), - name, - fmt.Errorf("Precondition failed: UID in precondition: %v, UID in object meta: %v", *options.Preconditions.UID, crd.UID), - ) - return nil, false, err - } - - // upon first request to delete, add our finalizer and then delegate - if crd.DeletionTimestamp.IsZero() { - key, err := r.Store.KeyFunc(ctx, name) - if err != nil { - return nil, false, err - } - - preconditions := storage.Preconditions{UID: options.Preconditions.UID} - - out := r.Store.NewFunc() - err = r.Store.Storage.GuaranteedUpdate( - ctx, key, out, false, &preconditions, - storage.SimpleUpdate(func(existing runtime.Object) (runtime.Object, error) { - existingCRD, ok := existing.(*apiextensions.CustomResourceDefinition) - if !ok { - // wrong type - return nil, fmt.Errorf("expected *apiextensions.CustomResourceDefinition, got %v", existing) - } - - // Set the deletion timestamp if needed - if existingCRD.DeletionTimestamp.IsZero() { - now := metav1.Now() - existingCRD.DeletionTimestamp = &now - } - - if !apiextensions.CRDHasFinalizer(existingCRD, apiextensions.CustomResourceCleanupFinalizer) { - existingCRD.Finalizers = append(existingCRD.Finalizers, apiextensions.CustomResourceCleanupFinalizer) - } - // update the status condition too - apiextensions.SetCRDCondition(existingCRD, apiextensions.CustomResourceDefinitionCondition{ - Type: apiextensions.Terminating, - Status: apiextensions.ConditionTrue, - Reason: "InstanceDeletionPending", - Message: "CustomResourceDefinition marked for deletion; CustomResource deletion will begin soon", - }) - return existingCRD, nil - }), - dryrun.IsDryRun(options.DryRun), - ) - - if err != nil { - err = storageerr.InterpretGetError(err, apiextensions.Resource("customresourcedefinitions"), name) - err = storageerr.InterpretUpdateError(err, apiextensions.Resource("customresourcedefinitions"), name) - if _, ok := err.(*apierrors.StatusError); !ok { - err = apierrors.NewInternalError(err) - } - return nil, false, err - } - - return out, false, nil - } - - return r.Store.Delete(ctx, name, options) -} - -// NewStatusREST makes a RESTStorage for status that has more limited options. -// It is based on the original REST so that we can share the same underlying store -func NewStatusREST(scheme *runtime.Scheme, rest *REST) *StatusREST { - statusStore := *rest.Store - statusStore.CreateStrategy = nil - statusStore.DeleteStrategy = nil - statusStore.UpdateStrategy = NewStatusStrategy(scheme) - return &StatusREST{store: &statusStore} -} - -type StatusREST struct { - store *genericregistry.Store -} - -var _ = rest.Patcher(&StatusREST{}) - -func (r *StatusREST) New() runtime.Object { - return &apiextensions.CustomResourceDefinition{} -} - -// Get retrieves the object from the storage. It is required to support Patch. -func (r *StatusREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) { - return r.store.Get(ctx, name, options) -} - -// Update alters the status subset of an object. -func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) { - // We are explicitly setting forceAllowCreate to false in the call to the underlying storage because - // subresources should never allow create on update. - return r.store.Update(ctx, name, objInfo, createValidation, updateValidation, false, options) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/strategy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/strategy.go deleted file mode 100644 index a0bebb7a7..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/strategy.go +++ /dev/null @@ -1,202 +0,0 @@ -/* -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 customresourcedefinition - -import ( - "context" - "fmt" - - apiequality "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apiserver/pkg/registry/generic" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/names" - utilfeature "k8s.io/apiserver/pkg/util/feature" - - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation" - apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" -) - -// strategy implements behavior for CustomResources. -type strategy struct { - runtime.ObjectTyper - names.NameGenerator -} - -func NewStrategy(typer runtime.ObjectTyper) strategy { - return strategy{typer, names.SimpleNameGenerator} -} - -func (strategy) NamespaceScoped() bool { - return false -} - -// PrepareForCreate clears the status of a CustomResourceDefinition before creation. -func (strategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { - crd := obj.(*apiextensions.CustomResourceDefinition) - crd.Status = apiextensions.CustomResourceDefinitionStatus{} - crd.Generation = 1 - - // if the feature gate is disabled, drop the feature. - if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceValidation) { - crd.Spec.Validation = nil - } - if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) { - crd.Spec.Subresources = nil - } - - for _, v := range crd.Spec.Versions { - if v.Storage { - if !apiextensions.IsStoredVersion(crd, v.Name) { - crd.Status.StoredVersions = append(crd.Status.StoredVersions, v.Name) - } - break - } - } -} - -// PrepareForUpdate clears fields that are not allowed to be set by end users on update. -func (strategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { - newCRD := obj.(*apiextensions.CustomResourceDefinition) - oldCRD := old.(*apiextensions.CustomResourceDefinition) - newCRD.Status = oldCRD.Status - - // Any changes to the spec increment the generation number, any changes to the - // status should reflect the generation number of the corresponding object. We push - // the burden of managing the status onto the clients because we can't (in general) - // know here what version of spec the writer of the status has seen. It may seem like - // we can at first -- since obj contains spec -- but in the future we will probably make - // status its own object, and even if we don't, writes may be the result of a - // read-update-write loop, so the contents of spec may not actually be the spec that - // the controller has *seen*. - if !apiequality.Semantic.DeepEqual(oldCRD.Spec, newCRD.Spec) { - newCRD.Generation = oldCRD.Generation + 1 - } - - if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceValidation) { - newCRD.Spec.Validation = nil - oldCRD.Spec.Validation = nil - } - if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) { - newCRD.Spec.Subresources = nil - oldCRD.Spec.Subresources = nil - } - - for _, v := range newCRD.Spec.Versions { - if v.Storage { - if !apiextensions.IsStoredVersion(newCRD, v.Name) { - newCRD.Status.StoredVersions = append(newCRD.Status.StoredVersions, v.Name) - } - break - } - } -} - -// Validate validates a new CustomResourceDefinition. -func (strategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { - return validation.ValidateCustomResourceDefinition(obj.(*apiextensions.CustomResourceDefinition)) -} - -// AllowCreateOnUpdate is false for CustomResourceDefinition; this means a POST is -// needed to create one. -func (strategy) AllowCreateOnUpdate() bool { - return false -} - -// AllowUnconditionalUpdate is the default update policy for CustomResourceDefinition objects. -func (strategy) AllowUnconditionalUpdate() bool { - return false -} - -// Canonicalize normalizes the object after validation. -func (strategy) Canonicalize(obj runtime.Object) { -} - -// ValidateUpdate is the default update validation for an end user updating status. -func (strategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { - return validation.ValidateCustomResourceDefinitionUpdate(obj.(*apiextensions.CustomResourceDefinition), old.(*apiextensions.CustomResourceDefinition)) -} - -type statusStrategy struct { - runtime.ObjectTyper - names.NameGenerator -} - -func NewStatusStrategy(typer runtime.ObjectTyper) statusStrategy { - return statusStrategy{typer, names.SimpleNameGenerator} -} - -func (statusStrategy) NamespaceScoped() bool { - return false -} - -func (statusStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { - newObj := obj.(*apiextensions.CustomResourceDefinition) - oldObj := old.(*apiextensions.CustomResourceDefinition) - newObj.Spec = oldObj.Spec - - // Status updates are for only for updating status, not objectmeta. - // TODO: Update after ResetObjectMetaForStatus is added to meta/v1. - newObj.Labels = oldObj.Labels - newObj.Annotations = oldObj.Annotations - newObj.OwnerReferences = oldObj.OwnerReferences - newObj.Generation = oldObj.Generation - newObj.SelfLink = oldObj.SelfLink -} - -func (statusStrategy) AllowCreateOnUpdate() bool { - return false -} - -func (statusStrategy) AllowUnconditionalUpdate() bool { - return false -} - -func (statusStrategy) Canonicalize(obj runtime.Object) { -} - -func (statusStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { - return validation.ValidateUpdateCustomResourceDefinitionStatus(obj.(*apiextensions.CustomResourceDefinition), old.(*apiextensions.CustomResourceDefinition)) -} - -// GetAttrs returns labels and fields of a given object for filtering purposes. -func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error) { - apiserver, ok := obj.(*apiextensions.CustomResourceDefinition) - if !ok { - return nil, nil, false, fmt.Errorf("given object is not a CustomResourceDefinition") - } - return labels.Set(apiserver.ObjectMeta.Labels), CustomResourceDefinitionToSelectableFields(apiserver), apiserver.Initializers != nil, nil -} - -// MatchCustomResourceDefinition is the filter used by the generic etcd backend to watch events -// from etcd to clients of the apiserver only interested in specific labels/fields. -func MatchCustomResourceDefinition(label labels.Selector, field fields.Selector) storage.SelectionPredicate { - return storage.SelectionPredicate{ - Label: label, - Field: field, - GetAttrs: GetAttrs, - } -} - -// CustomResourceDefinitionToSelectableFields returns a field set that represents the object. -func CustomResourceDefinitionToSelectableFields(obj *apiextensions.CustomResourceDefinition) fields.Set { - return generic.ObjectMetaFieldsSet(&obj.ObjectMeta, true) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/apiserver.local.config/certificates/apiserver.crt b/vendor/k8s.io/apiextensions-apiserver/test/integration/apiserver.local.config/certificates/apiserver.crt deleted file mode 100644 index 0b52619bf..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/apiserver.local.config/certificates/apiserver.crt +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDFTCCAf2gAwIBAgIBATANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRsb2Nh -bGhvc3RAMTUxNTQ2MjIwNjAgFw0xODAxMDkwMTQzMjZaGA8yMTE4MDEwOTAxNDMy -NlowHzEdMBsGA1UEAwwUbG9jYWxob3N0QDE1MTU0NjIyMDYwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQC2hIORzonehlNadYyI30v1Jj8lhhABuiWiTSkl -KCLqZjwBfWfSC4w02zxi2SAH9ju20XCJrUauwPq1qXCp/CqXC/rVgZrzluDlpJpe -gF9AilQvGOxhrZhV4kqpOjGVE78uOmpfxiOyNermoJ0OVE8ugh3s/LLTNK/qmCAX -uEYTQccAvNEiPX3XPBCiaFlSCkUNS0zp12mJNP43+KF9y0CbtYs1gXKHmmJVSpjR -YmcuJJUfHxNrV2YR3ek6O4IIJFIlnLxgpjRBseBPkTenAT3S2YY9MyQkkBrRSPBa -vLM24al3KDvXYikYe3WpxeYNHGNcHIgR+hKlRTQ5VrWlfx9dAgMBAAGjWjBYMA4G -A1UdDwEB/wQEAwICpDATBgNVHSUEDDAKBggrBgEFBQcDATAPBgNVHRMBAf8EBTAD -AQH/MCAGA1UdEQQZMBeCCWxvY2FsaG9zdIcEfwAAAYcEfwAAATANBgkqhkiG9w0B -AQsFAAOCAQEAFhW8cVTraHPNsE+Jo0ZvcE2ic8lEzeOhWI2O/fpkrUJS5LptPKHS -nTK+CPxA0zhIS/vlJznIabeddXwtq7Xb5SwlJMHYMnHD6f5qwpD22D2dxJJa5sma -3yrK/4CutuEae08qqSeakfgCjcHLL9p7FZWxujkV9/5CEH5lFWYLGumyIoS46Svf -nSfDFKTrOj8P60ncCoWcSpMbdVQBDuKlIZuBMmz9CguC1CtuQWPDUmOGJuPs/+So -yusHbBfj+ATUWDYTg1lLjOIOSJpHGUQkvS+8Bo47SThD/b4w2i6VC72ldxtBuxGf -L7+jALMhMhiQD+Q4qsNuyvvNQLoYcTTFTw== ------END CERTIFICATE----- diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/apiserver.local.config/certificates/apiserver.key b/vendor/k8s.io/apiextensions-apiserver/test/integration/apiserver.local.config/certificates/apiserver.key deleted file mode 100644 index d4878784e..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/apiserver.local.config/certificates/apiserver.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAtoSDkc6J3oZTWnWMiN9L9SY/JYYQAbolok0pJSgi6mY8AX1n -0guMNNs8YtkgB/Y7ttFwia1GrsD6talwqfwqlwv61YGa85bg5aSaXoBfQIpULxjs -Ya2YVeJKqToxlRO/LjpqX8YjsjXq5qCdDlRPLoId7Pyy0zSv6pggF7hGE0HHALzR -Ij191zwQomhZUgpFDUtM6ddpiTT+N/ihfctAm7WLNYFyh5piVUqY0WJnLiSVHx8T -a1dmEd3pOjuCCCRSJZy8YKY0QbHgT5E3pwE90tmGPTMkJJAa0UjwWryzNuGpdyg7 -12IpGHt1qcXmDRxjXByIEfoSpUU0OVa1pX8fXQIDAQABAoIBAERy2ezaqnXbpnLs -VrIWHCRqHZBzAJnFN8vwaBfZP47snGBqqX7qecBw3+qqRwr1W1uqnCvl4fYzxVJP -o0L8oPRYt89OddAYq2s0GfiK6C4KMpwfGrdfJRxAa4OfoWypJS+vFKmqY0S4V8n6 -Pixbjf6BKbvw4Re4UKkIODDtGMqrZFVKcFe8LCnd3D+7jvt0M/WjEhrepWxscJh3 -aHgDzsLzCv1DNjgZfoRZubkK3bdndMaL6NhaKNBz6S7CT9XmZsJaWkmBXs9zOoyr -0hKP0A11cm6a7LsmxX5h4uaQLh66KHUPbV4KjKgKiGkSS9cnZoXHFZLOplOfozje -1DKitAECgYEA2eWiRNByNIqqRPvBtD8ydavOLk6iLlLt+LkCpGupgELs53WS5fTT -TxbyVq+897qeW2Klir7jZFWG3Q+EaBATxMYON+jb7QnIz8gX9lh1PpUlo88BiQzO -hAIx2uV19KM0ftXYVTSAUh1N2cgoOWGUWLaeMPdxPOlJwvM25hSfp90CgYEA1m8W -vWBO8X5LXM9g+fO1TFSlTnUJW1gWrnOw4VmU2+DbqNmtefpVrqDa5Iw2+mU+EBgA -d3wdAHARXpc2MGcIRnRbHn+gXJVHA+gA7H9LSZ4Yi0qJZbNVAgRySs2iBYUcunsR -AXkS7sPGQinfnjKh6vhYVErh5jA+cvS8CXZtnYECgYBmh61hYAw9OPqB100AebRO -tncgRxP9ZDxiCvx5TcfGeLds+mATIK7FynBh5fOvRfr52WM39DafobcCEiklplsG -/oL2P/YshaweSXMtEdapihjaCbAZQxNx/m5jKBHm+VzcSdev0DKJcQyO66Yxyf65 -98RcGjMIjGWO/E7a2N1/aQKBgCPrY+HBGjg1saYQTuxPuJTasP4deL3GWbZLRtvY -x6i1V9ZG8Fo4ZtXjuAcEvcjf4K+NdbaOIcWLAD3aEoe1GpvCrejD9DbOAqFS4aS8 -Bf6E7xOWHsHccmbuG78QBw3pqFBMgSLABz3bqYA3x2+Wh6z2gMVN7d1DQ5K6EC19 -mwsBAoGBAKZBgqRHRq1Ch3SWb5Q+SgUvNyQ+PAIwCve0vA4mMIK6EGqU/8wbU01B -5/UkCfT+ovDeDuyeaZbTWzwUC4Mrg4C9rThrK5WLc43Dig6G1HhfjdLA+gdKFOjh -FpocOI2FEwbmj5Mka6n3TSFI8c55ubYdyXQu92DoFt4dTOJStUn2 ------END RSA PRIVATE KEY----- diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/basic_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/basic_test.go deleted file mode 100644 index b9f34b3cb..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/basic_test.go +++ /dev/null @@ -1,982 +0,0 @@ -/* -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 integration - -import ( - "fmt" - "reflect" - "sort" - "strings" - "testing" - "time" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/test/integration/fixtures" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/dynamic" -) - -func TestServerUp(t *testing.T) { - tearDown, _, _, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() -} - -func TestNamespaceScopedCRUD(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - - testSimpleCRUD(t, ns, noxuDefinition, dynamicClient) - testFieldSelector(t, ns, noxuDefinition, dynamicClient) -} - -func TestClusterScopedCRUD(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.ClusterScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "" - testSimpleCRUD(t, ns, noxuDefinition, dynamicClient) - testFieldSelector(t, ns, noxuDefinition, dynamicClient) -} - -func testSimpleCRUD(t *testing.T, ns string, noxuDefinition *apiextensionsv1beta1.CustomResourceDefinition, dynamicClient dynamic.Interface) { - noxuResourceClients := map[string]dynamic.ResourceInterface{} - noxuWatchs := map[string]watch.Interface{} - disabledVersions := map[string]bool{} - for _, v := range noxuDefinition.Spec.Versions { - disabledVersions[v.Name] = !v.Served - } - for _, v := range noxuDefinition.Spec.Versions { - noxuResourceClients[v.Name] = newNamespacedCustomResourceVersionedClient(ns, dynamicClient, noxuDefinition, v.Name) - - noxuWatch, err := noxuResourceClients[v.Name].Watch(metav1.ListOptions{}) - if disabledVersions[v.Name] { - if !errors.IsNotFound(err) { - t.Errorf("expected the watch operation fail with NotFound for disabled version %s, got error: %v", v.Name, err) - } - } else { - if err != nil { - t.Fatal(err) - } - noxuWatchs[v.Name] = noxuWatch - } - } - defer func() { - for _, w := range noxuWatchs { - w.Stop() - } - }() - - for version, noxuResourceClient := range noxuResourceClients { - createdNoxuInstance, err := instantiateVersionedCustomResource(t, fixtures.NewVersionedNoxuInstance(ns, "foo", version), noxuResourceClient, noxuDefinition, version) - if disabledVersions[version] { - if !errors.IsNotFound(err) { - t.Errorf("expected the CR creation fail with NotFound for disabled version %s, got error: %v", version, err) - } - continue - } - if err != nil { - t.Fatalf("unable to create noxu Instance:%v", err) - } - if e, a := noxuDefinition.Spec.Group+"/"+version, createdNoxuInstance.GetAPIVersion(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - for watchVersion, noxuWatch := range noxuWatchs { - select { - case watchEvent := <-noxuWatch.ResultChan(): - if e, a := watch.Added, watchEvent.Type; e != a { - t.Errorf("expected %v, got %v", e, a) - break - } - createdObjectMeta, err := meta.Accessor(watchEvent.Object) - if err != nil { - t.Fatal(err) - } - // it should have a UUID - if len(createdObjectMeta.GetUID()) == 0 { - t.Errorf("missing uuid: %#v", watchEvent.Object) - } - if e, a := ns, createdObjectMeta.GetNamespace(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - createdTypeMeta, err := meta.TypeAccessor(watchEvent.Object) - if err != nil { - t.Fatal(err) - } - if e, a := noxuDefinition.Spec.Group+"/"+watchVersion, createdTypeMeta.GetAPIVersion(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := noxuDefinition.Spec.Names.Kind, createdTypeMeta.GetKind(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - case <-time.After(5 * time.Second): - t.Errorf("missing watch event") - } - } - - // Check get for all versions - for version2, noxuResourceClient2 := range noxuResourceClients { - // Get test - gottenNoxuInstance, err := noxuResourceClient2.Get("foo", metav1.GetOptions{}) - - if disabledVersions[version2] { - if !errors.IsNotFound(err) { - t.Errorf("expected the get operation fail with NotFound for disabled version %s, got error: %v", version2, err) - - } - } else { - if err != nil { - t.Fatal(err) - } - - if e, a := version2, gottenNoxuInstance.GroupVersionKind().Version; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } - } - - // List test - listWithItem, err := noxuResourceClient2.List(metav1.ListOptions{}) - if disabledVersions[version2] { - if !errors.IsNotFound(err) { - t.Errorf("expected the list operation fail with NotFound for disabled version %s, got error: %v", version2, err) - - } - } else { - if err != nil { - t.Fatal(err) - } - if e, a := 1, len(listWithItem.Items); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := version2, listWithItem.GroupVersionKind().Version; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := version2, listWithItem.Items[0].GroupVersionKind().Version; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } - } - } - - // Update test - for version2, noxuResourceClient2 := range noxuResourceClients { - var gottenNoxuInstance *unstructured.Unstructured - if disabledVersions[version2] { - gottenNoxuInstance = &unstructured.Unstructured{} - gottenNoxuInstance.SetName("foo") - } else { - gottenNoxuInstance, err = noxuResourceClient2.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - } - - gottenNoxuInstance.Object["updated"] = version2 - updatedNoxuInstance, err := noxuResourceClient2.Update(gottenNoxuInstance, metav1.UpdateOptions{}) - if disabledVersions[version2] { - if !errors.IsNotFound(err) { - t.Errorf("expected the update operation fail with NotFound for disabled version %s, got error: %v", version2, err) - } - } else { - if err != nil { - t.Fatal(err) - } - - if updated, ok := updatedNoxuInstance.Object["updated"]; !ok { - t.Errorf("expected string 'updated' field") - } else if updated, ok := updated.(string); !ok || updated != version2 { - t.Errorf("expected string 'updated' field to equal %q, got %q of type %T", version2, updated, updated) - } - - if e, a := version2, updatedNoxuInstance.GroupVersionKind().Version; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } - - for _, noxuWatch := range noxuWatchs { - select { - case watchEvent := <-noxuWatch.ResultChan(): - eventMetadata, err := meta.Accessor(watchEvent.Object) - if err != nil { - t.Fatal(err) - } - - if watchEvent.Type != watch.Modified { - t.Errorf("expected modified event, got %v", watchEvent.Type) - break - } - - // it should have a UUID - createdMetadata, err := meta.Accessor(createdNoxuInstance) - if err != nil { - t.Fatal(err) - } - if e, a := createdMetadata.GetUID(), eventMetadata.GetUID(); e != a { - t.Errorf("expected equal UID for (expected) %v, and (actual) %v", createdNoxuInstance, watchEvent.Object) - } - - case <-time.After(5 * time.Second): - t.Errorf("missing watch event") - } - } - } - } - - // Delete test - if err := noxuResourceClient.Delete("foo", metav1.NewDeleteOptions(0)); err != nil { - t.Fatal(err) - } - - listWithoutItem, err := noxuResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := 0, len(listWithoutItem.Items); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - for _, noxuWatch := range noxuWatchs { - select { - case watchEvent := <-noxuWatch.ResultChan(): - eventMetadata, err := meta.Accessor(watchEvent.Object) - if err != nil { - t.Fatal(err) - } - - if watchEvent.Type != watch.Deleted { - t.Errorf("expected delete event, got %v", watchEvent.Type) - break - } - - // it should have a UUID - createdMetadata, err := meta.Accessor(createdNoxuInstance) - if err != nil { - t.Fatal(err) - } - if e, a := createdMetadata.GetUID(), eventMetadata.GetUID(); e != a { - t.Errorf("expected equal UID for (expected) %v, and (actual) %v", createdNoxuInstance, watchEvent.Object) - } - - case <-time.After(5 * time.Second): - t.Errorf("missing watch event") - } - } - - // Delete test - if err := noxuResourceClient.DeleteCollection(metav1.NewDeleteOptions(0), metav1.ListOptions{}); err != nil { - t.Fatal(err) - } - } -} - -func testFieldSelector(t *testing.T, ns string, noxuDefinition *apiextensionsv1beta1.CustomResourceDefinition, dynamicClient dynamic.Interface) { - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - initialList, err := noxuResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := 0, len(initialList.Items); e != a { - t.Errorf("expected %v, got %v", e, a) - } - initialListTypeMeta, err := meta.TypeAccessor(initialList) - if err != nil { - t.Fatal(err) - } - if e, a := noxuDefinition.Spec.Group+"/"+noxuDefinition.Spec.Versions[0].Name, initialListTypeMeta.GetAPIVersion(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := noxuDefinition.Spec.Names.ListKind, initialListTypeMeta.GetKind(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - initialListListMeta, err := meta.ListAccessor(initialList) - if err != nil { - t.Fatal(err) - } - noxuWatch, err := noxuResourceClient.Watch( - metav1.ListOptions{ - ResourceVersion: initialListListMeta.GetResourceVersion(), - FieldSelector: "metadata.name=foo", - }, - ) - if err != nil { - t.Fatal(err) - } - defer noxuWatch.Stop() - - _, err = instantiateCustomResource(t, fixtures.NewNoxuInstance(ns, "bar"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu Instance:%v", err) - } - createdNoxuInstanceFoo, err := instantiateCustomResource(t, fixtures.NewNoxuInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu Instance:%v", err) - } - - select { - case watchEvent := <-noxuWatch.ResultChan(): - if e, a := watch.Added, watchEvent.Type; e != a { - t.Errorf("expected %v, got %v", e, a) - break - } - createdObjectMeta, err := meta.Accessor(watchEvent.Object) - if err != nil { - t.Fatal(err) - } - // it should have a UUID - if len(createdObjectMeta.GetUID()) == 0 { - t.Errorf("missing uuid: %#v", watchEvent.Object) - } - if e, a := ns, createdObjectMeta.GetNamespace(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := "foo", createdObjectMeta.GetName(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - createdTypeMeta, err := meta.TypeAccessor(watchEvent.Object) - if err != nil { - t.Fatal(err) - } - if e, a := noxuDefinition.Spec.Group+"/"+noxuDefinition.Spec.Versions[0].Name, createdTypeMeta.GetAPIVersion(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := noxuDefinition.Spec.Names.Kind, createdTypeMeta.GetKind(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - case <-time.After(5 * time.Second): - t.Errorf("missing watch event") - } - - gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := createdNoxuInstanceFoo, gottenNoxuInstance; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } - - listWithItem, err := noxuResourceClient.List(metav1.ListOptions{FieldSelector: "metadata.name=foo"}) - if err != nil { - t.Fatal(err) - } - if e, a := 1, len(listWithItem.Items); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := *createdNoxuInstanceFoo, listWithItem.Items[0]; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } - - if err := noxuResourceClient.Delete("bar", nil); err != nil { - t.Fatal(err) - } - if err := noxuResourceClient.Delete("foo", nil); err != nil { - t.Fatal(err) - } - - listWithoutItem, err := noxuResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := 0, len(listWithoutItem.Items); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - select { - case watchEvent := <-noxuWatch.ResultChan(): - if e, a := watch.Deleted, watchEvent.Type; e != a { - t.Errorf("expected %v, got %v", e, a) - break - } - deletedObjectMeta, err := meta.Accessor(watchEvent.Object) - if err != nil { - t.Fatal(err) - } - // it should have a UUID - createdObjectMeta, err := meta.Accessor(createdNoxuInstanceFoo) - if err != nil { - t.Fatal(err) - } - if e, a := createdObjectMeta.GetUID(), deletedObjectMeta.GetUID(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := ns, createdObjectMeta.GetNamespace(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := "foo", createdObjectMeta.GetName(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - case <-time.After(5 * time.Second): - t.Errorf("missing watch event") - } -} - -func TestDiscovery(t *testing.T) { - group := "mygroup.example.com" - version := "v1beta1" - - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - scope := apiextensionsv1beta1.NamespaceScoped - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(scope) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - // check whether it shows up in discovery properly - resources, err := apiExtensionClient.Discovery().ServerResourcesForGroupVersion(group + "/" + version) - if err != nil { - t.Fatal(err) - } - - if len(resources.APIResources) != 1 { - t.Fatalf("Expected exactly the resource \"noxus\" in group version %v/%v via discovery, got: %v", group, version, resources.APIResources) - } - - r := resources.APIResources[0] - if r.Name != "noxus" { - t.Fatalf("Expected exactly the resource \"noxus\" in group version %v/%v via discovery, got: %v", group, version, r.Name) - } - if r.Kind != "WishIHadChosenNoxu" { - t.Fatalf("Expected exactly the kind \"WishIHadChosenNoxu\" in group version %v/%v via discovery, got: %v", group, version, r.Kind) - } - - s := []string{"foo", "bar", "abc", "def"} - if !reflect.DeepEqual(r.ShortNames, s) { - t.Fatalf("Expected exactly the shortnames `foo, bar, abc, def` in group version %v/%v via discovery, got: %v", group, version, r.ShortNames) - } - - sort.Strings(r.Verbs) - expectedVerbs := []string{"create", "delete", "deletecollection", "get", "list", "patch", "update", "watch"} - if !reflect.DeepEqual([]string(r.Verbs), expectedVerbs) { - t.Fatalf("Unexpected verbs for resource \"noxus\" in group version %v/%v via discovery: expected=%v got=%v", group, version, expectedVerbs, r.Verbs) - } - - if !reflect.DeepEqual(r.Categories, []string{"all"}) { - t.Fatalf("Expected exactly the category \"all\" in group version %v/%v via discovery, got: %v", group, version, r.Categories) - } -} - -func TestNoNamespaceReject(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - initialList, err := noxuResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := 0, len(initialList.Items); e != a { - t.Errorf("expected %v, got %v", e, a) - } - initialListTypeMeta, err := meta.TypeAccessor(initialList) - if err != nil { - t.Fatal(err) - } - if e, a := noxuDefinition.Spec.Group+"/"+noxuDefinition.Spec.Version, initialListTypeMeta.GetAPIVersion(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := noxuDefinition.Spec.Names.ListKind, initialListTypeMeta.GetKind(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - createdNoxuInstance, err := instantiateCustomResource(t, fixtures.NewNoxuInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err == nil { - t.Fatalf("unexpected non-error: an empty namespace may not be set during creation while creating noxu instance: %v ", createdNoxuInstance) - } -} - -func TestSameNameDiffNamespace(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns1 := "namespace-1" - testSimpleCRUD(t, ns1, noxuDefinition, dynamicClient) - ns2 := "namespace-2" - testSimpleCRUD(t, ns2, noxuDefinition, dynamicClient) - -} - -func TestSelfLink(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - // namespace scoped - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuNamespacedResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - - noxuInstanceToCreate := fixtures.NewNoxuInstance(ns, "foo") - createdNoxuInstance, err := noxuNamespacedResourceClient.Create(noxuInstanceToCreate, metav1.CreateOptions{}) - if err != nil { - t.Fatal(err) - } - - if e, a := "/apis/mygroup.example.com/v1beta1/namespaces/not-the-default/noxus/foo", createdNoxuInstance.GetSelfLink(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - // cluster scoped - curletDefinition := fixtures.NewCurletCustomResourceDefinition(apiextensionsv1beta1.ClusterScoped) - curletDefinition, err = fixtures.CreateNewCustomResourceDefinition(curletDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - curletResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, curletDefinition) - - curletInstanceToCreate := fixtures.NewCurletInstance(ns, "foo") - createdCurletInstance, err := curletResourceClient.Create(curletInstanceToCreate, metav1.CreateOptions{}) - if err != nil { - t.Fatal(err) - } - - if e, a := "/apis/mygroup.example.com/v1beta1/curlets/foo", createdCurletInstance.GetSelfLink(); e != a { - t.Errorf("expected %v, got %v", e, a) - } -} - -func TestPreserveInt(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.ClusterScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuNamespacedResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - - noxuInstanceToCreate := fixtures.NewNoxuInstance(ns, "foo") - createdNoxuInstance, err := noxuNamespacedResourceClient.Create(noxuInstanceToCreate, metav1.CreateOptions{}) - if err != nil { - t.Fatal(err) - } - - originalJSON, err := runtime.Encode(unstructured.UnstructuredJSONScheme, createdNoxuInstance) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - gottenNoxuInstance, err := runtime.Decode(unstructured.UnstructuredJSONScheme, originalJSON) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - // Check if int is preserved. - unstructuredObj := gottenNoxuInstance.(*unstructured.Unstructured).Object - num := unstructuredObj["num"].(map[string]interface{}) - num1 := num["num1"].(int64) - num2 := num["num2"].(int64) - if num1 != 9223372036854775807 || num2 != 1000000 { - t.Errorf("Expected %v, got %v, %v", `9223372036854775807, 1000000`, num1, num2) - } -} - -func TestPatch(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.ClusterScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuNamespacedResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - - t.Logf("Creating foo") - noxuInstanceToCreate := fixtures.NewNoxuInstance(ns, "foo") - _, err = noxuNamespacedResourceClient.Create(noxuInstanceToCreate, metav1.CreateOptions{}) - if err != nil { - t.Fatal(err) - } - - t.Logf("Patching .num.num2 to 999") - patch := []byte(`{"num": {"num2":999}}`) - patchedNoxuInstance, err := noxuNamespacedResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "num", "num2") - rv, found, err := unstructured.NestedString(patchedNoxuInstance.UnstructuredContent(), "metadata", "resourceVersion") - if err != nil { - t.Fatal(err) - } - if !found { - t.Fatalf("metadata.resourceVersion not found") - } - - // a patch with no change - t.Logf("Patching .num.num2 again to 999") - patchedNoxuInstance, err = noxuNamespacedResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - // make sure no-op patch does not increment resourceVersion - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "num", "num2") - expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") - - // an empty patch - t.Logf("Applying empty patch") - patchedNoxuInstance, err = noxuNamespacedResourceClient.Patch("foo", types.MergePatchType, []byte(`{}`), metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - // an empty patch is a no-op patch. make sure it does not increment resourceVersion - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "num", "num2") - expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") - - originalJSON, err := runtime.Encode(unstructured.UnstructuredJSONScheme, patchedNoxuInstance) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - gottenNoxuInstance, err := runtime.Decode(unstructured.UnstructuredJSONScheme, originalJSON) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - // Check if int is preserved. - unstructuredObj := gottenNoxuInstance.(*unstructured.Unstructured).Object - num := unstructuredObj["num"].(map[string]interface{}) - num1 := num["num1"].(int64) - num2 := num["num2"].(int64) - if num1 != 9223372036854775807 || num2 != 999 { - t.Errorf("Expected %v, got %v, %v", `9223372036854775807, 999`, num1, num2) - } -} - -func TestCrossNamespaceListWatch(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - initialList, err := noxuResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := 0, len(initialList.Items); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - initialListListMeta, err := meta.ListAccessor(initialList) - if err != nil { - t.Fatal(err) - } - - noxuWatch, err := noxuResourceClient.Watch(metav1.ListOptions{ResourceVersion: initialListListMeta.GetResourceVersion()}) - if err != nil { - t.Fatal(err) - } - defer noxuWatch.Stop() - - instances := make(map[string]*unstructured.Unstructured) - ns1 := "namespace-1" - noxuNamespacedResourceClient1 := newNamespacedCustomResourceClient(ns1, dynamicClient, noxuDefinition) - instances[ns1] = createInstanceWithNamespaceHelper(t, ns1, "foo1", noxuNamespacedResourceClient1, noxuDefinition) - noxuNamespacesWatch1, err := noxuNamespacedResourceClient1.Watch(metav1.ListOptions{ResourceVersion: initialListListMeta.GetResourceVersion()}) - defer noxuNamespacesWatch1.Stop() - - ns2 := "namespace-2" - noxuNamespacedResourceClient2 := newNamespacedCustomResourceClient(ns2, dynamicClient, noxuDefinition) - instances[ns2] = createInstanceWithNamespaceHelper(t, ns2, "foo2", noxuNamespacedResourceClient2, noxuDefinition) - noxuNamespacesWatch2, err := noxuNamespacedResourceClient2.Watch(metav1.ListOptions{ResourceVersion: initialListListMeta.GetResourceVersion()}) - defer noxuNamespacesWatch2.Stop() - - createdList, err := noxuResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - - if e, a := 2, len(createdList.Items); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - for _, a := range createdList.Items { - if e := instances[a.GetNamespace()]; !reflect.DeepEqual(e, &a) { - t.Errorf("expected %v, got %v", e, a) - } - } - - addEvents := 0 - for addEvents < 2 { - select { - case watchEvent := <-noxuWatch.ResultChan(): - if e, a := watch.Added, watchEvent.Type; e != a { - t.Fatalf("expected %v, got %v", e, a) - } - createdObjectMeta, err := meta.Accessor(watchEvent.Object) - if err != nil { - t.Fatal(err) - } - if len(createdObjectMeta.GetUID()) == 0 { - t.Errorf("missing uuid: %#v", watchEvent.Object) - } - createdTypeMeta, err := meta.TypeAccessor(watchEvent.Object) - if err != nil { - t.Fatal(err) - } - if e, a := noxuDefinition.Spec.Group+"/"+noxuDefinition.Spec.Version, createdTypeMeta.GetAPIVersion(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := noxuDefinition.Spec.Names.Kind, createdTypeMeta.GetKind(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - delete(instances, createdObjectMeta.GetNamespace()) - addEvents++ - case <-time.After(5 * time.Second): - t.Fatalf("missing watch event") - } - } - if e, a := 0, len(instances); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - checkNamespacesWatchHelper(t, ns1, noxuNamespacesWatch1) - checkNamespacesWatchHelper(t, ns2, noxuNamespacesWatch2) -} - -func createInstanceWithNamespaceHelper(t *testing.T, ns string, name string, noxuNamespacedResourceClient dynamic.ResourceInterface, noxuDefinition *apiextensionsv1beta1.CustomResourceDefinition) *unstructured.Unstructured { - createdInstance, err := instantiateCustomResource(t, fixtures.NewNoxuInstance(ns, name), noxuNamespacedResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu Instance:%v", err) - } - return createdInstance -} - -func checkNamespacesWatchHelper(t *testing.T, ns string, namespacedwatch watch.Interface) { - namespacedAddEvent := 0 - for namespacedAddEvent < 2 { - select { - case watchEvent := <-namespacedwatch.ResultChan(): - // Check that the namespaced watch only has one result - if namespacedAddEvent > 0 { - t.Fatalf("extra watch event") - } - if e, a := watch.Added, watchEvent.Type; e != a { - t.Fatalf("expected %v, got %v", e, a) - } - createdObjectMeta, err := meta.Accessor(watchEvent.Object) - if err != nil { - t.Fatal(err) - } - if e, a := ns, createdObjectMeta.GetNamespace(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - case <-time.After(5 * time.Second): - if namespacedAddEvent != 1 { - t.Fatalf("missing watch event") - } - } - namespacedAddEvent++ - } -} - -func TestNameConflict(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - noxu2Definition := fixtures.NewNoxu2CustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Create(noxu2Definition) - if err != nil { - t.Fatal(err) - } - - // A NameConflict occurs - err = wait.Poll(500*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { - crd, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxu2Definition.Name, metav1.GetOptions{}) - if err != nil { - return false, err - } - - for _, condition := range crd.Status.Conditions { - if condition.Type == apiextensionsv1beta1.NamesAccepted && condition.Status == apiextensionsv1beta1.ConditionFalse { - return true, nil - } - } - return false, nil - }) - if err != nil { - t.Fatal(err) - } - - err = fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient) - if err != nil { - t.Fatal(err) - } - - // Names are now accepted - err = wait.Poll(500*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { - crd, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxu2Definition.Name, metav1.GetOptions{}) - if err != nil { - return false, err - } - - for _, condition := range crd.Status.Conditions { - if condition.Type == apiextensionsv1beta1.NamesAccepted && condition.Status == apiextensionsv1beta1.ConditionTrue { - return true, nil - } - } - return false, nil - }) - if err != nil { - t.Fatal(err) - } -} - -func TestStatusGetAndPatch(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - // make sure we don't get 405 Method Not Allowed from Getting CRD/status subresource - result := &apiextensionsv1beta1.CustomResourceDefinition{} - err = apiExtensionClient.ApiextensionsV1beta1().RESTClient().Get(). - Resource("customresourcedefinitions"). - Name(noxuDefinition.Name). - SubResource("status"). - Do(). - Into(result) - if err != nil { - t.Fatal(err) - } - - // make sure we don't get 405 Method Not Allowed from Patching CRD/status subresource - _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions(). - Patch(noxuDefinition.Name, types.StrategicMergePatchType, - []byte(fmt.Sprintf(`{"labels":{"test-label":"dummy"}}`)), - "status") - if err != nil { - t.Fatal(err) - } -} - -func expectInt64(t *testing.T, obj map[string]interface{}, value int64, pth ...string) { - if v, found, err := unstructured.NestedInt64(obj, pth...); err != nil { - t.Fatalf("failed to access .%s: %v", strings.Join(pth, "."), err) - } else if !found { - t.Fatalf("failed to find .%s", strings.Join(pth, ".")) - } else if v != value { - t.Fatalf("wanted %d at .%s, got %d", value, strings.Join(pth, "."), v) - } -} -func expectString(t *testing.T, obj map[string]interface{}, value string, pth ...string) { - if v, found, err := unstructured.NestedString(obj, pth...); err != nil { - t.Fatalf("failed to access .%s: %v", strings.Join(pth, "."), err) - } else if !found { - t.Fatalf("failed to find .%s", strings.Join(pth, ".")) - } else if v != value { - t.Fatalf("wanted %q at .%s, got %q", value, strings.Join(pth, "."), v) - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/finalization_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/finalization_test.go deleted file mode 100644 index 745aa5854..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/finalization_test.go +++ /dev/null @@ -1,165 +0,0 @@ -/* -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 integration - -import ( - "testing" - "time" - - "github.com/stretchr/testify/require" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - - "k8s.io/apiextensions-apiserver/test/integration/fixtures" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" -) - -func TestFinalization(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - require.NoError(t, err) - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.ClusterScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - require.NoError(t, err) - - ns := "not-the-default" - name := "foo123" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - - instance := fixtures.NewNoxuInstance(ns, name) - instance.SetFinalizers([]string{"noxu.example.com/finalizer"}) - createdNoxuInstance, err := instantiateCustomResource(t, instance, noxuResourceClient, noxuDefinition) - require.NoError(t, err) - - uid := createdNoxuInstance.GetUID() - err = noxuResourceClient.Delete(name, &metav1.DeleteOptions{ - Preconditions: &metav1.Preconditions{ - UID: &uid, - }, - }) - require.NoError(t, err) - - // Deleting something with a finalizer sets deletion timestamp to a not-nil value but does not - // remove the object from the API server. Here we read it to confirm this. - gottenNoxuInstance, err := noxuResourceClient.Get(name, metav1.GetOptions{}) - require.NoError(t, err) - - require.NotNil(t, gottenNoxuInstance.GetDeletionTimestamp()) - - // Trying to delete it again to confirm it will not remove the object because finalizer is still there. - err = noxuResourceClient.Delete(name, &metav1.DeleteOptions{ - Preconditions: &metav1.Preconditions{ - UID: &uid, - }, - }) - require.NoError(t, err) - - // Removing the finalizers to allow the following delete remove the object. - // This step will fail if previous delete wrongly removed the object. The - // object will be deleted as part of the finalizer update. - for { - gottenNoxuInstance.SetFinalizers(nil) - _, err = noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) - if err == nil { - break - } - if !errors.IsConflict(err) { - require.NoError(t, err) // Fail on unexpected error - } - gottenNoxuInstance, err = noxuResourceClient.Get(name, metav1.GetOptions{}) - require.NoError(t, err) - } - - // Check that the object is actually gone. - _, err = noxuResourceClient.Get(name, metav1.GetOptions{}) - require.Error(t, err) - require.True(t, errors.IsNotFound(err), "%#v", err) -} - -func TestFinalizationAndDeletion(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - require.NoError(t, err) - defer tearDown() - - // Create a CRD. - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.ClusterScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - require.NoError(t, err) - - // Create a CR with a finalizer. - ns := "not-the-default" - name := "foo123" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - - instance := fixtures.NewNoxuInstance(ns, name) - instance.SetFinalizers([]string{"noxu.example.com/finalizer"}) - createdNoxuInstance, err := instantiateCustomResource(t, instance, noxuResourceClient, noxuDefinition) - require.NoError(t, err) - - // Delete a CR. Because there's a finalizer, it will not get deleted now. - uid := createdNoxuInstance.GetUID() - err = noxuResourceClient.Delete(name, &metav1.DeleteOptions{ - Preconditions: &metav1.Preconditions{ - UID: &uid, - }, - }) - require.NoError(t, err) - - // Check is the CR scheduled for deletion. - gottenNoxuInstance, err := noxuResourceClient.Get(name, metav1.GetOptions{}) - require.NoError(t, err) - require.NotNil(t, gottenNoxuInstance.GetDeletionTimestamp()) - - // Delete the CRD. - fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient) - - // Check is CR still there after the CRD deletion. - gottenNoxuInstance, err = noxuResourceClient.Get(name, metav1.GetOptions{}) - require.NoError(t, err) - - // Update the CR to remove the finalizer. - for { - gottenNoxuInstance.SetFinalizers(nil) - _, err = noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) - if err == nil { - break - } - if !errors.IsConflict(err) { - require.NoError(t, err) // Fail on unexpected error - } - gottenNoxuInstance, err = noxuResourceClient.Get(name, metav1.GetOptions{}) - require.NoError(t, err) - } - - // Verify the CR is gone. - // It should return the NonFound error. - _, err = noxuResourceClient.Get(name, metav1.GetOptions{}) - if !errors.IsNotFound(err) { - t.Fatalf("unable to delete cr: %v", err) - } - - err = wait.Poll(500*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { - _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxuDefinition.Name, metav1.GetOptions{}) - return errors.IsNotFound(err), err - }) - if !errors.IsNotFound(err) { - t.Fatalf("unable to delete crd: %v", err) - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go deleted file mode 100644 index 9a1f2d848..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go +++ /dev/null @@ -1,403 +0,0 @@ -/* -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 fixtures - -import ( - "fmt" - "time" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/apiserver/pkg/storage/names" - "k8s.io/client-go/discovery" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/rest" - "k8s.io/client-go/restmapper" - "k8s.io/client-go/scale" -) - -const ( - noxuInstanceNum int64 = 9223372036854775807 -) - -// NewRandomNameCustomResourceDefinition generates a CRD with random name to avoid name conflict in e2e tests -func NewRandomNameCustomResourceDefinition(scope apiextensionsv1beta1.ResourceScope) *apiextensionsv1beta1.CustomResourceDefinition { - // ensure the singular doesn't end in an s for now - gName := names.SimpleNameGenerator.GenerateName("foo") + "a" - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: gName + "s.mygroup.example.com"}, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: "mygroup.example.com", - Version: "v1beta1", - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: gName + "s", - Singular: gName, - Kind: gName, - ListKind: gName + "List", - }, - Scope: scope, - }, - } -} - -// NewNoxuCustomResourceDefinition returns a WishIHadChosenNoxu CRD. -func NewNoxuCustomResourceDefinition(scope apiextensionsv1beta1.ResourceScope) *apiextensionsv1beta1.CustomResourceDefinition { - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "noxus.mygroup.example.com"}, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: "mygroup.example.com", - Version: "v1beta1", - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: "noxus", - Singular: "nonenglishnoxu", - Kind: "WishIHadChosenNoxu", - ShortNames: []string{"foo", "bar", "abc", "def"}, - ListKind: "NoxuItemList", - Categories: []string{"all"}, - }, - Scope: scope, - }, - } -} - -// NewVersionedNoxuInstance returns a WishIHadChosenNoxu instance for a given version -func NewVersionedNoxuInstance(namespace, name, version string) *unstructured.Unstructured { - return &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "mygroup.example.com/" + version, - "kind": "WishIHadChosenNoxu", - "metadata": map[string]interface{}{ - "namespace": namespace, - "name": name, - }, - "content": map[string]interface{}{ - "key": "value", - }, - "num": map[string]interface{}{ - "num1": noxuInstanceNum, - "num2": 1000000, - }, - }, - } -} - -// NewNoxuInstance returns a WishIHadChosenNoxu instance for v1beta1. -func NewNoxuInstance(namespace, name string) *unstructured.Unstructured { - return NewVersionedNoxuInstance(namespace, name, "v1beta1") -} - -// NewMultipleVersionNoxuCRD returns a WishIHadChosenNoxu with multiple versions. -func NewMultipleVersionNoxuCRD(scope apiextensionsv1beta1.ResourceScope) *apiextensionsv1beta1.CustomResourceDefinition { - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "noxus.mygroup.example.com"}, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: "mygroup.example.com", - Version: "v1beta1", - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: "noxus", - Singular: "nonenglishnoxu", - Kind: "WishIHadChosenNoxu", - ShortNames: []string{"foo", "bar", "abc", "def"}, - ListKind: "NoxuItemList", - Categories: []string{"all"}, - }, - Scope: scope, - Versions: []apiextensionsv1beta1.CustomResourceDefinitionVersion{ - { - Name: "v1beta1", - Served: true, - Storage: false, - }, - { - Name: "v1beta2", - Served: true, - Storage: true, - }, - { - Name: "v0", - Served: false, - Storage: false, - }, - }, - }, - } -} - -// NewNoxu2CustomResourceDefinition returns a WishIHadChosenNoxu2 CRD. -func NewNoxu2CustomResourceDefinition(scope apiextensionsv1beta1.ResourceScope) *apiextensionsv1beta1.CustomResourceDefinition { - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "noxus2.mygroup.example.com"}, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: "mygroup.example.com", - Version: "v1alpha1", - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: "noxus2", - Singular: "nonenglishnoxu2", - Kind: "WishIHadChosenNoxu2", - ShortNames: []string{"foo", "bar", "abc", "def"}, - ListKind: "Noxu2ItemList", - }, - Scope: scope, - }, - } -} - -// NewCurletCustomResourceDefinition returns a Curlet CRD. -func NewCurletCustomResourceDefinition(scope apiextensionsv1beta1.ResourceScope) *apiextensionsv1beta1.CustomResourceDefinition { - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "curlets.mygroup.example.com"}, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: "mygroup.example.com", - Version: "v1beta1", - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: "curlets", - Singular: "curlet", - Kind: "Curlet", - ListKind: "CurletList", - }, - Scope: scope, - }, - } -} - -// NewCurletInstance returns a Curlet instance. -func NewCurletInstance(namespace, name string) *unstructured.Unstructured { - return &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "mygroup.example.com/v1beta1", - "kind": "Curlet", - "metadata": map[string]interface{}{ - "namespace": namespace, - "name": name, - }, - "content": map[string]interface{}{ - "key": "value", - }, - }, - } -} - -func servedVersions(crd *apiextensionsv1beta1.CustomResourceDefinition) []string { - if len(crd.Spec.Versions) == 0 { - return []string{crd.Spec.Version} - } - var versions []string - for _, v := range crd.Spec.Versions { - if v.Served { - versions = append(versions, v.Name) - } - } - return versions -} - -func existsInDiscovery(crd *apiextensionsv1beta1.CustomResourceDefinition, apiExtensionsClient clientset.Interface, version string) (bool, error) { - groupResource, err := apiExtensionsClient.Discovery().ServerResourcesForGroupVersion(crd.Spec.Group + "/" + version) - if err != nil { - if errors.IsNotFound(err) { - return false, nil - } - return false, err - } - for _, g := range groupResource.APIResources { - if g.Name == crd.Spec.Names.Plural { - return true, nil - } - } - return false, nil -} - -// CreateNewCustomResourceDefinitionWatchUnsafe creates the CRD and makes sure -// the apiextension apiserver has installed the CRD. But it's not safe to watch -// the created CR. Please call CreateNewCustomResourceDefinition if you need to -// watch the CR. -func CreateNewCustomResourceDefinitionWatchUnsafe(crd *apiextensionsv1beta1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) (*apiextensionsv1beta1.CustomResourceDefinition, error) { - crd, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Create(crd) - if err != nil { - return nil, err - } - - // wait until all resources appears in discovery - for _, version := range servedVersions(crd) { - err := wait.PollImmediate(500*time.Millisecond, 30*time.Second, func() (bool, error) { - return existsInDiscovery(crd, apiExtensionsClient, version) - }) - if err != nil { - return nil, err - } - } - - return crd, err -} - -// CreateNewCustomResourceDefinition creates the given CRD and makes sure its watch cache is primed on the server. -func CreateNewCustomResourceDefinition(crd *apiextensionsv1beta1.CustomResourceDefinition, apiExtensionsClient clientset.Interface, dynamicClientSet dynamic.Interface) (*apiextensionsv1beta1.CustomResourceDefinition, error) { - crd, err := CreateNewCustomResourceDefinitionWatchUnsafe(crd, apiExtensionsClient) - if err != nil { - return nil, err - } - - // This is only for a test. We need the watch cache to have a resource version that works for the test. - // When new REST storage is created, the storage cacher for the CR starts asynchronously. - // REST API operations return like list use the RV of etcd, but the storage cacher's reflector's list - // can get a different RV because etcd can be touched in between the initial list operation (if that's what you're doing first) - // and the storage cache reflector starting. - // Later, you can issue a watch with the REST apis list.RV and end up earlier than the storage cacher. - // The general working model is that if you get a "resourceVersion too old" message, you re-list and rewatch. - // For this test, we'll actually cycle, "list/watch/create/delete" until we get an RV from list that observes the create and not an error. - // This way all the tests that are checking for watches don't have to worry about RV too old problems because crazy things *could* happen - // before like the created RV could be too old to watch. - err = wait.PollImmediate(500*time.Millisecond, 30*time.Second, func() (bool, error) { - return isWatchCachePrimed(crd, dynamicClientSet) - }) - if err != nil { - return nil, err - } - return crd, nil -} - -func resourceClientForVersion(crd *apiextensionsv1beta1.CustomResourceDefinition, dynamicClientSet dynamic.Interface, namespace, version string) dynamic.ResourceInterface { - gvr := schema.GroupVersionResource{Group: crd.Spec.Group, Version: version, Resource: crd.Spec.Names.Plural} - if crd.Spec.Scope != apiextensionsv1beta1.ClusterScoped { - return dynamicClientSet.Resource(gvr).Namespace(namespace) - } - return dynamicClientSet.Resource(gvr) -} - -// isWatchCachePrimed returns true if the watch is primed for an specified version of CRD watch -func isWatchCachePrimed(crd *apiextensionsv1beta1.CustomResourceDefinition, dynamicClientSet dynamic.Interface) (bool, error) { - ns := "" - if crd.Spec.Scope != apiextensionsv1beta1.ClusterScoped { - ns = "aval" - } - - versions := servedVersions(crd) - if len(versions) == 0 { - return true, nil - } - - resourceClient := resourceClientForVersion(crd, dynamicClientSet, ns, versions[0]) - instanceName := "setup-instance" - instance := &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": crd.Spec.Group + "/" + versions[0], - "kind": crd.Spec.Names.Kind, - "metadata": map[string]interface{}{ - "namespace": ns, - "name": instanceName, - }, - "alpha": "foo_123", - "beta": 10, - "gamma": "bar", - "delta": "hello", - "epsilon": "foobar", - "spec": map[string]interface{}{}, - }, - } - createdInstance, err := resourceClient.Create(instance, metav1.CreateOptions{}) - if err != nil { - return false, err - } - err = resourceClient.Delete(createdInstance.GetName(), nil) - if err != nil { - return false, err - } - - // Wait for all versions of watch cache to be primed and also make sure we consumed the DELETE event for all - // versions so that any new watch with ResourceVersion=0 does not get those events. This is source of some flaky tests. - // When a client creates a watch with resourceVersion=0, it will get an ADD event for any existing objects - // but because they specified resourceVersion=0, there is no starting point in the cache buffer to return existing events - // from, thus the server will return anything from current head of the cache to the end. By accessing the delete - // events for all versions here, we make sure that the head of the cache is passed those events and they will not being - // delivered to any future watch with resourceVersion=0. - for _, v := range versions { - noxuWatch, err := resourceClientForVersion(crd, dynamicClientSet, ns, v).Watch( - metav1.ListOptions{ResourceVersion: createdInstance.GetResourceVersion()}) - if err != nil { - return false, err - } - defer noxuWatch.Stop() - - select { - case watchEvent := <-noxuWatch.ResultChan(): - if watch.Error == watchEvent.Type { - return false, nil - } - if watch.Deleted != watchEvent.Type { - return false, fmt.Errorf("expected DELETE, but got %#v", watchEvent) - } - case <-time.After(5 * time.Second): - return false, fmt.Errorf("gave up waiting for watch event") - } - } - - return true, nil -} - -// DeleteCustomResourceDefinition deletes a CRD and waits until it disappears from discovery. -func DeleteCustomResourceDefinition(crd *apiextensionsv1beta1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) error { - if err := apiExtensionsClient.Apiextensions().CustomResourceDefinitions().Delete(crd.Name, nil); err != nil { - return err - } - for _, version := range servedVersions(crd) { - err := wait.PollImmediate(500*time.Millisecond, 30*time.Second, func() (bool, error) { - exists, err := existsInDiscovery(crd, apiExtensionsClient, version) - return !exists, err - }) - if err != nil { - return err - } - } - return nil -} - -// CreateNewScaleClient returns a scale client. -func CreateNewScaleClient(crd *apiextensionsv1beta1.CustomResourceDefinition, config *rest.Config) (scale.ScalesGetter, error) { - discoveryClient, err := discovery.NewDiscoveryClientForConfig(config) - if err != nil { - return nil, err - } - groupResource, err := discoveryClient.ServerResourcesForGroupVersion(crd.Spec.Group + "/" + crd.Spec.Version) - if err != nil { - return nil, err - } - - resources := []*restmapper.APIGroupResources{ - { - Group: metav1.APIGroup{ - Name: crd.Spec.Group, - Versions: []metav1.GroupVersionForDiscovery{ - {Version: crd.Spec.Version}, - }, - PreferredVersion: metav1.GroupVersionForDiscovery{Version: crd.Spec.Version}, - }, - VersionedResources: map[string][]metav1.APIResource{ - crd.Spec.Version: groupResource.APIResources, - }, - }, - } - - restMapper := restmapper.NewDiscoveryRESTMapper(resources) - resolver := scale.NewDiscoveryScaleKindResolver(discoveryClient) - - return scale.NewForConfig(config, restMapper, dynamic.LegacyAPIPathResolverFunc, resolver) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/fixtures/server.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/fixtures/server.go deleted file mode 100644 index 0a3d6444e..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/fixtures/server.go +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright 2018 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 fixtures - -import ( - "io/ioutil" - "os" - "strings" - - "github.com/pborman/uuid" - "k8s.io/apiextensions-apiserver/pkg/cmd/server/options" - - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - servertesting "k8s.io/apiextensions-apiserver/pkg/cmd/server/testing" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/rest" -) - -// StartDefaultServer starts a test server. -func StartDefaultServer(t servertesting.Logger) (func(), *rest.Config, *options.CustomResourceDefinitionsServerOptions, error) { - // create kubeconfig which will not actually be used. But authz/authn needs it to startup. - fakeKubeConfig, err := ioutil.TempFile("", "kubeconfig") - fakeKubeConfig.WriteString(` -apiVersion: v1 -kind: Config -clusters: -- cluster: - server: http://127.1.2.3:12345 - name: integration -contexts: -- context: - cluster: integration - user: test - name: default-context -current-context: default-context -users: -- name: test - user: - password: test - username: test -`) - fakeKubeConfig.Close() - - s, err := servertesting.StartTestServer(t, nil, []string{ - "--etcd-prefix", uuid.New(), - "--etcd-servers", strings.Join(IntegrationEtcdServers(), ","), - "--authentication-skip-lookup", - "--authentication-kubeconfig", fakeKubeConfig.Name(), - "--authorization-kubeconfig", fakeKubeConfig.Name(), - "--kubeconfig", fakeKubeConfig.Name(), - "--disable-admission-plugins", "NamespaceLifecycle,MutatingAdmissionWebhook,ValidatingAdmissionWebhook", - }, nil) - if err != nil { - os.Remove(fakeKubeConfig.Name()) - return nil, nil, nil, err - } - - tearDownFn := func() { - defer os.Remove(fakeKubeConfig.Name()) - s.TearDownFn() - } - - return tearDownFn, s.ClientConfig, s.ServerOpts, nil -} - -// StartDefaultServerWithClients starts a test server and returns clients for it. -func StartDefaultServerWithClients(t servertesting.Logger) (func(), clientset.Interface, dynamic.Interface, error) { - tearDown, config, _, err := StartDefaultServer(t) - if err != nil { - return nil, nil, nil, err - } - - apiExtensionsClient, err := clientset.NewForConfig(config) - if err != nil { - tearDown() - return nil, nil, nil, err - } - - dynamicClient, err := dynamic.NewForConfig(config) - if err != nil { - tearDown() - return nil, nil, nil, err - } - - return tearDown, apiExtensionsClient, dynamicClient, nil -} - -// IntegrationEtcdServers returns etcd server URLs. -func IntegrationEtcdServers() []string { - if etcdURL, ok := os.LookupEnv("KUBE_INTEGRATION_ETCD_URL"); ok { - return []string{etcdURL} - } - return []string{"http://127.0.0.1:2379"} -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/helpers.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/helpers.go deleted file mode 100644 index 763440345..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/helpers.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 2018 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 integration - -import ( - "fmt" - "testing" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/dynamic" -) - -func instantiateCustomResource(t *testing.T, instanceToCreate *unstructured.Unstructured, client dynamic.ResourceInterface, definition *apiextensionsv1beta1.CustomResourceDefinition) (*unstructured.Unstructured, error) { - return instantiateVersionedCustomResource(t, instanceToCreate, client, definition, definition.Spec.Versions[0].Name) -} - -func instantiateVersionedCustomResource(t *testing.T, instanceToCreate *unstructured.Unstructured, client dynamic.ResourceInterface, definition *apiextensionsv1beta1.CustomResourceDefinition, version string) (*unstructured.Unstructured, error) { - createdInstance, err := client.Create(instanceToCreate, metav1.CreateOptions{}) - if err != nil { - t.Logf("%#v", createdInstance) - return nil, err - } - createdObjectMeta, err := meta.Accessor(createdInstance) - if err != nil { - t.Fatal(err) - } - // it should have a UUID - if len(createdObjectMeta.GetUID()) == 0 { - t.Errorf("missing uuid: %#v", createdInstance) - } - createdTypeMeta, err := meta.TypeAccessor(createdInstance) - if err != nil { - t.Fatal(err) - } - if e, a := definition.Spec.Group+"/"+version, createdTypeMeta.GetAPIVersion(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := definition.Spec.Names.Kind, createdTypeMeta.GetKind(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - return createdInstance, nil -} - -func newNamespacedCustomResourceVersionedClient(ns string, client dynamic.Interface, crd *apiextensionsv1beta1.CustomResourceDefinition, version string) dynamic.ResourceInterface { - gvr := schema.GroupVersionResource{Group: crd.Spec.Group, Version: version, Resource: crd.Spec.Names.Plural} - - if crd.Spec.Scope != apiextensionsv1beta1.ClusterScoped { - return client.Resource(gvr).Namespace(ns) - } - return client.Resource(gvr) -} - -func newNamespacedCustomResourceClient(ns string, client dynamic.Interface, crd *apiextensionsv1beta1.CustomResourceDefinition) dynamic.ResourceInterface { - return newNamespacedCustomResourceVersionedClient(ns, client, crd, crd.Spec.Versions[0].Name) -} - -// updateCustomResourceDefinitionWithRetry updates a CRD, retrying up to 5 times on version conflict errors. -func updateCustomResourceDefinitionWithRetry(client clientset.Interface, name string, update func(*apiextensionsv1beta1.CustomResourceDefinition)) (*apiextensionsv1beta1.CustomResourceDefinition, error) { - for i := 0; i < 5; i++ { - crd, err := client.ApiextensionsV1beta1().CustomResourceDefinitions().Get(name, metav1.GetOptions{}) - if err != nil { - return nil, fmt.Errorf("failed to get CustomResourceDefinition %q: %v", name, err) - } - update(crd) - crd, err = client.ApiextensionsV1beta1().CustomResourceDefinitions().Update(crd) - if err == nil { - return crd, nil - } - if !errors.IsConflict(err) { - return nil, fmt.Errorf("failed to update CustomResourceDefinition %q: %v", name, err) - } - } - return nil, fmt.Errorf("too many retries after conflicts updating CustomResourceDefinition %q", name) -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go deleted file mode 100644 index 1ce637aa7..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/objectmeta_test.go +++ /dev/null @@ -1,164 +0,0 @@ -/* -Copyright 2018 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 integration - -import ( - "path" - "reflect" - "strings" - "testing" - - "github.com/coreos/etcd/clientv3" - "github.com/coreos/etcd/pkg/transport" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - serveroptions "k8s.io/apiextensions-apiserver/pkg/cmd/server/options" - "k8s.io/apiextensions-apiserver/test/integration/fixtures" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/json" - genericapirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/client-go/dynamic" -) - -func TestPostInvalidObjectMeta(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - noxuResourceClient := newNamespacedCustomResourceClient("default", dynamicClient, noxuDefinition) - - obj := fixtures.NewNoxuInstance("default", "foo") - unstructured.SetNestedField(obj.UnstructuredContent(), int64(42), "metadata", "unknown") - unstructured.SetNestedField(obj.UnstructuredContent(), map[string]interface{}{"foo": int64(42), "bar": "abc"}, "metadata", "labels") - _, err = instantiateCustomResource(t, obj, noxuResourceClient, noxuDefinition) - if err == nil { - t.Fatalf("unexpected non-error, expected invalid labels to be rejected: %v", err) - } - if status, ok := err.(errors.APIStatus); !ok { - t.Fatalf("expected APIStatus error, but got: %#v", err) - } else if !errors.IsBadRequest(err) { - t.Fatalf("expected BadRequst error, but got: %v", errors.ReasonForError(err)) - } else if !strings.Contains(status.Status().Message, "cannot be handled") { - t.Fatalf("expected 'cannot be handled' error message, got: %v", status.Status().Message) - } - - unstructured.SetNestedField(obj.UnstructuredContent(), map[string]interface{}{"bar": "abc"}, "metadata", "labels") - obj, err = instantiateCustomResource(t, obj, noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - if unknown, found, err := unstructured.NestedInt64(obj.UnstructuredContent(), "metadata", "unknown"); err != nil { - t.Errorf("unexpected error getting metadata.unknown: %v", err) - } else if found { - t.Errorf("unexpected metadata.unknown=%#v: expected this to be pruned", unknown) - } -} - -func TestInvalidObjectMetaInStorage(t *testing.T) { - tearDown, config, options, err := fixtures.StartDefaultServer(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - apiExtensionClient, err := clientset.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - - dynamicClient, err := dynamic.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - RESTOptionsGetter := serveroptions.NewCRDRESTOptionsGetter(*options.RecommendedOptions.Etcd) - restOptions, err := RESTOptionsGetter.GetRESTOptions(schema.GroupResource{Group: noxuDefinition.Spec.Group, Resource: noxuDefinition.Spec.Names.Plural}) - if err != nil { - t.Fatal(err) - } - tlsInfo := transport.TLSInfo{ - CertFile: restOptions.StorageConfig.CertFile, - KeyFile: restOptions.StorageConfig.KeyFile, - CAFile: restOptions.StorageConfig.CAFile, - } - tlsConfig, err := tlsInfo.ClientConfig() - if err != nil { - t.Fatal(err) - } - etcdConfig := clientv3.Config{ - Endpoints: restOptions.StorageConfig.ServerList, - TLS: tlsConfig, - } - etcdclient, err := clientv3.New(etcdConfig) - if err != nil { - t.Fatal(err) - } - - t.Logf("Creating object with invalid labels manually in etcd") - - original := fixtures.NewNoxuInstance("default", "foo") - unstructured.SetNestedField(original.UnstructuredContent(), int64(42), "metadata", "unknown") - unstructured.SetNestedField(original.UnstructuredContent(), map[string]interface{}{"foo": int64(42), "bar": "abc"}, "metadata", "labels") - - ctx := genericapirequest.WithNamespace(genericapirequest.NewContext(), metav1.NamespaceDefault) - key := path.Join("/", restOptions.StorageConfig.Prefix, noxuDefinition.Spec.Group, "noxus/default/foo") - val, _ := json.Marshal(original.UnstructuredContent()) - if _, err := etcdclient.Put(ctx, key, string(val)); err != nil { - t.Fatalf("unexpected error: %v", err) - } - - t.Logf("Checking that ObjectMeta is pruned from unknown fields") - - noxuResourceClient := newNamespacedCustomResourceClient("default", dynamicClient, noxuDefinition) - obj, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - if unknown, found, err := unstructured.NestedFieldNoCopy(obj.UnstructuredContent(), "metadata", "unknown"); err != nil { - t.Errorf("unexpected error: %v", err) - } else if found { - t.Errorf("unexpected to find metadata.unknown=%#v", unknown) - } - - t.Logf("Checking that ObjectMeta is pruned from invalid typed fields") - - if labels, found, err := unstructured.NestedStringMap(obj.UnstructuredContent(), "metadata", "labels"); err != nil { - t.Errorf("unexpected error: %v", err) - } else if found && !reflect.DeepEqual(labels, map[string]string{"bar": "abc"}) { - t.Errorf("unexpected to find metadata.lables=%#v", labels) - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/registration_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/registration_test.go deleted file mode 100644 index 2523210c8..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/registration_test.go +++ /dev/null @@ -1,456 +0,0 @@ -/* -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 integration - -import ( - "context" - "encoding/json" - "fmt" - "os" - "path" - "reflect" - "testing" - "time" - - "github.com/coreos/etcd/clientv3" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - "k8s.io/apiextensions-apiserver/test/integration/fixtures" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/dynamic" -) - -func TestMultipleResourceInstances(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - ns := "not-the-default" - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - noxuNamespacedResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - noxuList, err := noxuNamespacedResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - - noxuListListMeta, err := meta.ListAccessor(noxuList) - if err != nil { - t.Fatal(err) - } - - noxuNamespacedWatch, err := noxuNamespacedResourceClient.Watch(metav1.ListOptions{ResourceVersion: noxuListListMeta.GetResourceVersion()}) - if err != nil { - t.Fatal(err) - } - defer noxuNamespacedWatch.Stop() - - instances := map[string]*struct { - Added bool - Deleted bool - Instance *unstructured.Unstructured - }{ - "foo": {}, - "bar": {}, - } - - for key, val := range instances { - val.Instance, err = instantiateCustomResource(t, fixtures.NewNoxuInstance(ns, key), noxuNamespacedResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create Noxu Instance %q:%v", key, err) - } - } - - addEvents := 0 - for addEvents < len(instances) { - select { - case watchEvent := <-noxuNamespacedWatch.ResultChan(): - if e, a := watch.Added, watchEvent.Type; e != a { - t.Fatalf("expected %v, got %v", e, a) - } - name, err := meta.NewAccessor().Name(watchEvent.Object) - if err != nil { - t.Fatalf("unable to retrieve object name:%v", err) - } - if instances[name].Added { - t.Fatalf("Add event already registered for %q", name) - } - instances[name].Added = true - addEvents++ - case <-time.After(5 * time.Second): - t.Fatalf("missing watch event") - } - } - - for key, val := range instances { - gottenNoxuInstace, err := noxuNamespacedResourceClient.Get(key, metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := val.Instance, gottenNoxuInstace; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } - } - listWithItem, err := noxuNamespacedResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := len(instances), len(listWithItem.Items); e != a { - t.Errorf("expected %v, got %v", e, a) - } - for _, a := range listWithItem.Items { - if e := instances[a.GetName()].Instance; !reflect.DeepEqual(e, &a) { - t.Errorf("expected %v, got %v", e, a) - } - } - for key := range instances { - if err := noxuNamespacedResourceClient.Delete(key, nil); err != nil { - t.Fatalf("unable to delete %s:%v", key, err) - } - } - listWithoutItem, err := noxuNamespacedResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := 0, len(listWithoutItem.Items); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - deleteEvents := 0 - for deleteEvents < len(instances) { - select { - case watchEvent := <-noxuNamespacedWatch.ResultChan(): - if e, a := watch.Deleted, watchEvent.Type; e != a { - t.Errorf("expected %v, got %v", e, a) - break - } - name, err := meta.NewAccessor().Name(watchEvent.Object) - if err != nil { - t.Errorf("unable to retrieve object name:%v", err) - } - if instances[name].Deleted { - t.Errorf("Delete event already registered for %q", name) - } - instances[name].Deleted = true - deleteEvents++ - case <-time.After(5 * time.Second): - t.Errorf("missing watch event") - } - } -} - -func TestMultipleRegistration(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - ns := "not-the-default" - sameInstanceName := "foo" - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - noxuNamespacedResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - createdNoxuInstance, err := instantiateCustomResource(t, fixtures.NewNoxuInstance(ns, sameInstanceName), noxuNamespacedResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu Instance:%v", err) - } - - gottenNoxuInstance, err := noxuNamespacedResourceClient.Get(sameInstanceName, metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := createdNoxuInstance, gottenNoxuInstance; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } - - curletDefinition := fixtures.NewCurletCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - curletDefinition, err = fixtures.CreateNewCustomResourceDefinition(curletDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - curletNamespacedResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, curletDefinition) - createdCurletInstance, err := instantiateCustomResource(t, fixtures.NewCurletInstance(ns, sameInstanceName), curletNamespacedResourceClient, curletDefinition) - if err != nil { - t.Fatalf("unable to create noxu Instance:%v", err) - } - gottenCurletInstance, err := curletNamespacedResourceClient.Get(sameInstanceName, metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := createdCurletInstance, gottenCurletInstance; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } - - // now re-GET noxu - gottenNoxuInstance2, err := noxuNamespacedResourceClient.Get(sameInstanceName, metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := createdNoxuInstance, gottenNoxuInstance2; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } -} - -func TestDeRegistrationAndReRegistration(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - ns := "not-the-default" - sameInstanceName := "foo" - func() { - noxuDefinition, err := fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - noxuNamespacedResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - if _, err := instantiateCustomResource(t, fixtures.NewNoxuInstance(ns, sameInstanceName), noxuNamespacedResourceClient, noxuDefinition); err != nil { - t.Fatal(err) - } - if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { - t.Fatal(err) - } - if _, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxuDefinition.Name, metav1.GetOptions{}); err == nil || !errors.IsNotFound(err) { - t.Fatalf("expected a NotFound error, got:%v", err) - } - if _, err = noxuNamespacedResourceClient.List(metav1.ListOptions{}); err == nil || !errors.IsNotFound(err) { - t.Fatalf("expected a NotFound error, got:%v", err) - } - if _, err = noxuNamespacedResourceClient.Get("foo", metav1.GetOptions{}); err == nil || !errors.IsNotFound(err) { - t.Fatalf("expected a NotFound error, got:%v", err) - } - }() - - func() { - if _, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxuDefinition.Name, metav1.GetOptions{}); err == nil || !errors.IsNotFound(err) { - t.Fatalf("expected a NotFound error, got:%v", err) - } - noxuDefinition, err := fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - noxuNamespacedResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - initialList, err := noxuNamespacedResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - if _, err = noxuNamespacedResourceClient.Get(sameInstanceName, metav1.GetOptions{}); err == nil || !errors.IsNotFound(err) { - t.Fatalf("expected a NotFound error, got:%v", err) - } - if e, a := 0, len(initialList.Items); e != a { - t.Fatalf("expected %v, got %v", e, a) - } - createdNoxuInstance, err := instantiateCustomResource(t, fixtures.NewNoxuInstance(ns, sameInstanceName), noxuNamespacedResourceClient, noxuDefinition) - if err != nil { - t.Fatal(err) - } - gottenNoxuInstance, err := noxuNamespacedResourceClient.Get(sameInstanceName, metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := createdNoxuInstance, gottenNoxuInstance; !reflect.DeepEqual(e, a) { - t.Fatalf("expected %v, got %v", e, a) - } - listWithItem, err := noxuNamespacedResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := 1, len(listWithItem.Items); e != a { - t.Fatalf("expected %v, got %v", e, a) - } - if e, a := *createdNoxuInstance, listWithItem.Items[0]; !reflect.DeepEqual(e, a) { - t.Fatalf("expected %v, got %v", e, a) - } - - if err := noxuNamespacedResourceClient.Delete(sameInstanceName, nil); err != nil { - t.Fatal(err) - } - if _, err = noxuNamespacedResourceClient.Get(sameInstanceName, metav1.GetOptions{}); err == nil || !errors.IsNotFound(err) { - t.Fatalf("expected a NotFound error, got:%v", err) - } - listWithoutItem, err := noxuNamespacedResourceClient.List(metav1.ListOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := 0, len(listWithoutItem.Items); e != a { - t.Fatalf("expected %v, got %v", e, a) - } - }() -} - -func TestEtcdStorage(t *testing.T) { - tearDown, clientConfig, s, err := fixtures.StartDefaultServer(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - apiExtensionClient, err := apiextensionsclientset.NewForConfig(clientConfig) - if err != nil { - t.Fatal(err) - } - dynamicClient, err := dynamic.NewForConfig(clientConfig) - if err != nil { - t.Fatal(err) - } - - etcdPrefix := s.RecommendedOptions.Etcd.StorageConfig.Prefix - - ns1 := "another-default-is-possible" - curletDefinition := fixtures.NewCurletCustomResourceDefinition(apiextensionsv1beta1.ClusterScoped) - curletDefinition, err = fixtures.CreateNewCustomResourceDefinition(curletDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - curletNamespacedResourceClient := newNamespacedCustomResourceClient(ns1, dynamicClient, curletDefinition) - if _, err := instantiateCustomResource(t, fixtures.NewCurletInstance(ns1, "bar"), curletNamespacedResourceClient, curletDefinition); err != nil { - t.Fatalf("unable to create curlet cluster scoped Instance:%v", err) - } - - ns2 := "the-cruel-default" - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - noxuNamespacedResourceClient := newNamespacedCustomResourceClient(ns2, dynamicClient, noxuDefinition) - if _, err := instantiateCustomResource(t, fixtures.NewNoxuInstance(ns2, "foo"), noxuNamespacedResourceClient, noxuDefinition); err != nil { - t.Fatalf("unable to create noxu namespace scoped Instance:%v", err) - } - - testcases := map[string]struct { - etcdPath string - expectedObject *metaObject - }{ - "namespacedNoxuDefinition": { - etcdPath: "apiextensions.k8s.io/customresourcedefinitions/noxus.mygroup.example.com", - expectedObject: &metaObject{ - Kind: "CustomResourceDefinition", - APIVersion: "apiextensions.k8s.io/v1beta1", - Metadata: Metadata{ - Name: "noxus.mygroup.example.com", - Namespace: "", - SelfLink: "", - }, - }, - }, - "namespacedNoxuInstance": { - etcdPath: "mygroup.example.com/noxus/the-cruel-default/foo", - expectedObject: &metaObject{ - Kind: "WishIHadChosenNoxu", - APIVersion: "mygroup.example.com/v1beta1", - Metadata: Metadata{ - Name: "foo", - Namespace: "the-cruel-default", - SelfLink: "", // TODO double check: empty? - }, - }, - }, - - "clusteredCurletDefinition": { - etcdPath: "apiextensions.k8s.io/customresourcedefinitions/curlets.mygroup.example.com", - expectedObject: &metaObject{ - Kind: "CustomResourceDefinition", - APIVersion: "apiextensions.k8s.io/v1beta1", - Metadata: Metadata{ - Name: "curlets.mygroup.example.com", - Namespace: "", - SelfLink: "", - }, - }, - }, - - "clusteredCurletInstance": { - etcdPath: "mygroup.example.com/curlets/bar", - expectedObject: &metaObject{ - Kind: "Curlet", - APIVersion: "mygroup.example.com/v1beta1", - Metadata: Metadata{ - Name: "bar", - Namespace: "", - SelfLink: "", // TODO double check: empty? - }, - }, - }, - } - - etcdURL, ok := os.LookupEnv("KUBE_INTEGRATION_ETCD_URL") - if !ok { - etcdURL = "http://127.0.0.1:2379" - } - cfg := clientv3.Config{ - Endpoints: []string{etcdURL}, - } - c, err := clientv3.New(cfg) - if err != nil { - t.Fatal(err) - } - kv := clientv3.NewKV(c) - for testName, tc := range testcases { - output, err := getFromEtcd(kv, etcdPrefix, tc.etcdPath) - if err != nil { - t.Fatalf("%s - no path gotten from etcd:%v", testName, err) - } - if e, a := tc.expectedObject, output; !reflect.DeepEqual(e, a) { - t.Errorf("%s - expected %#v\n got %#v\n", testName, e, a) - } - } -} - -func getFromEtcd(keys clientv3.KV, prefix, localPath string) (*metaObject, error) { - internalPath := path.Join("/", prefix, localPath) // TODO: Double check, should we concatenate two prefixes? - response, err := keys.Get(context.Background(), internalPath) - if err != nil { - return nil, err - } - if response.More || response.Count != 1 || len(response.Kvs) != 1 { - return nil, fmt.Errorf("Invalid etcd response (not found == %v): %#v", response.Count == 0, response) - } - obj := &metaObject{} - if err := json.Unmarshal(response.Kvs[0].Value, obj); err != nil { - return nil, err - } - return obj, nil -} - -type metaObject struct { - Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` - APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"` - Metadata `json:"metadata,omitempty" protobuf:"bytes,3,opt,name=metadata"` -} - -type Metadata struct { - Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` - Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"` - SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,3,opt,name=selfLink"` -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/subresources_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/subresources_test.go deleted file mode 100644 index c8c8728ee..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/subresources_test.go +++ /dev/null @@ -1,770 +0,0 @@ -/* -Copyright 2018 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 integration - -import ( - "math" - "reflect" - "sort" - "strings" - "testing" - - autoscaling "k8s.io/api/autoscaling/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/dynamic" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - "k8s.io/apiextensions-apiserver/test/integration/fixtures" -) - -var labelSelectorPath = ".status.labelSelector" - -func NewNoxuSubresourcesCRD(scope apiextensionsv1beta1.ResourceScope) *apiextensionsv1beta1.CustomResourceDefinition { - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "noxus.mygroup.example.com"}, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: "mygroup.example.com", - Version: "v1beta1", - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: "noxus", - Singular: "nonenglishnoxu", - Kind: "WishIHadChosenNoxu", - ShortNames: []string{"foo", "bar", "abc", "def"}, - ListKind: "NoxuItemList", - }, - Scope: scope, - Subresources: &apiextensionsv1beta1.CustomResourceSubresources{ - Status: &apiextensionsv1beta1.CustomResourceSubresourceStatus{}, - Scale: &apiextensionsv1beta1.CustomResourceSubresourceScale{ - SpecReplicasPath: ".spec.replicas", - StatusReplicasPath: ".status.replicas", - LabelSelectorPath: &labelSelectorPath, - }, - }, - }, - } -} - -func NewNoxuSubresourceInstance(namespace, name string) *unstructured.Unstructured { - return &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "mygroup.example.com/v1beta1", - "kind": "WishIHadChosenNoxu", - "metadata": map[string]interface{}{ - "namespace": namespace, - "name": name, - }, - "spec": map[string]interface{}{ - "num": int64(10), - "replicas": int64(3), - }, - "status": map[string]interface{}{ - "replicas": int64(7), - }, - }, - } -} - -func TestStatusSubresource(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - _, err = instantiateCustomResource(t, NewNoxuSubresourceInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } - - gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - - // status should not be set after creation - if val, ok := gottenNoxuInstance.Object["status"]; ok { - t.Fatalf("status should not be set after creation, got %v", val) - } - - // .status.num = 20 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "status", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - // .spec.num = 20 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "spec", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - // UpdateStatus should not update spec. - // Check that .spec.num = 10 and .status.num = 20 - updatedStatusInstance, err := noxuResourceClient.UpdateStatus(gottenNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unable to update status: %v", err) - } - - specNum, found, err := unstructured.NestedInt64(updatedStatusInstance.Object, "spec", "num") - if !found || err != nil { - t.Fatalf("unable to get .spec.num") - } - if specNum != int64(10) { - t.Fatalf(".spec.num: expected: %v, got: %v", int64(10), specNum) - } - - statusNum, found, err := unstructured.NestedInt64(updatedStatusInstance.Object, "status", "num") - if !found || err != nil { - t.Fatalf("unable to get .status.num") - } - if statusNum != int64(20) { - t.Fatalf(".status.num: expected: %v, got: %v", int64(20), statusNum) - } - - gottenNoxuInstance, err = noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - - // .status.num = 40 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(40), "status", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - // .spec.num = 40 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(40), "spec", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - // Update should not update status. - // Check that .spec.num = 40 and .status.num = 20 - updatedInstance, err := noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unable to update instance: %v", err) - } - - specNum, found, err = unstructured.NestedInt64(updatedInstance.Object, "spec", "num") - if !found || err != nil { - t.Fatalf("unable to get .spec.num") - } - if specNum != int64(40) { - t.Fatalf(".spec.num: expected: %v, got: %v", int64(40), specNum) - } - - statusNum, found, err = unstructured.NestedInt64(updatedInstance.Object, "status", "num") - if !found || err != nil { - t.Fatalf("unable to get .status.num") - } - if statusNum != int64(20) { - t.Fatalf(".status.num: expected: %v, got: %v", int64(20), statusNum) - } -} - -func TestScaleSubresource(t *testing.T) { - groupResource := schema.GroupResource{ - Group: "mygroup.example.com", - Resource: "noxus", - } - - tearDown, config, _, err := fixtures.StartDefaultServer(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - apiExtensionClient, err := clientset.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - dynamicClient, err := dynamic.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) - - // set invalid json path for specReplicasPath - noxuDefinition.Spec.Subresources.Scale.SpecReplicasPath = "foo,bar" - _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err == nil { - t.Fatalf("unexpected non-error: specReplicasPath should be a valid json path under .spec") - } - - noxuDefinition.Spec.Subresources.Scale.SpecReplicasPath = ".spec.replicas" - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - _, err = instantiateCustomResource(t, NewNoxuSubresourceInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } - - scaleClient, err := fixtures.CreateNewScaleClient(noxuDefinition, config) - if err != nil { - t.Fatal(err) - } - - // set .status.labelSelector = bar - gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - err = unstructured.SetNestedField(gottenNoxuInstance.Object, "bar", "status", "labelSelector") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - _, err = noxuResourceClient.UpdateStatus(gottenNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unable to update status: %v", err) - } - - // get the scale object - gottenScale, err := scaleClient.Scales("not-the-default").Get(groupResource, "foo") - if err != nil { - t.Fatal(err) - } - if gottenScale.Spec.Replicas != 3 { - t.Fatalf("Scale.Spec.Replicas: expected: %v, got: %v", 3, gottenScale.Spec.Replicas) - } - if gottenScale.Status.Selector != "bar" { - t.Fatalf("Scale.Status.Selector: expected: %v, got: %v", "bar", gottenScale.Status.Selector) - } - - // check self link - expectedSelfLink := "/apis/mygroup.example.com/v1beta1/namespaces/not-the-default/noxus/foo/scale" - if gottenScale.GetSelfLink() != expectedSelfLink { - t.Fatalf("Scale.Metadata.SelfLink: expected: %v, got: %v", expectedSelfLink, gottenScale.GetSelfLink()) - } - - // update the scale object - // check that spec is updated, but status is not - gottenScale.Spec.Replicas = 5 - gottenScale.Status.Selector = "baz" - updatedScale, err := scaleClient.Scales("not-the-default").Update(groupResource, gottenScale) - if err != nil { - t.Fatal(err) - } - if updatedScale.Spec.Replicas != 5 { - t.Fatalf("replicas: expected: %v, got: %v", 5, updatedScale.Spec.Replicas) - } - if updatedScale.Status.Selector != "bar" { - t.Fatalf("scale should not update status: expected %v, got: %v", "bar", updatedScale.Status.Selector) - } - - // check that .spec.replicas = 5, but status is not updated - updatedNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - specReplicas, found, err := unstructured.NestedInt64(updatedNoxuInstance.Object, "spec", "replicas") - if !found || err != nil { - t.Fatalf("unable to get .spec.replicas") - } - if specReplicas != 5 { - t.Fatalf("replicas: expected: %v, got: %v", 5, specReplicas) - } - statusLabelSelector, found, err := unstructured.NestedString(updatedNoxuInstance.Object, "status", "labelSelector") - if !found || err != nil { - t.Fatalf("unable to get .status.labelSelector") - } - if statusLabelSelector != "bar" { - t.Fatalf("scale should not update status: expected %v, got: %v", "bar", statusLabelSelector) - } - - // validate maximum value - // set .spec.replicas = math.MaxInt64 - gottenNoxuInstance, err = noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(math.MaxInt64), "spec", "replicas") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - _, err = noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) - if err == nil { - t.Fatalf("unexpected non-error: .spec.replicas should be less than 2147483647") - } -} - -func TestValidationSchemaWithStatus(t *testing.T) { - tearDown, config, _, err := fixtures.StartDefaultServer(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - apiExtensionClient, err := clientset.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - dynamicClient, err := dynamic.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - - // fields other than properties in root schema are not allowed - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition.Spec.Subresources = &apiextensionsv1beta1.CustomResourceSubresources{ - Status: &apiextensionsv1beta1.CustomResourceSubresourceStatus{}, - } - _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err == nil { - t.Fatalf(`unexpected non-error, expected: must not have "additionalProperties" at the root of the schema if the status subresource is enabled`) - } - - // make sure we are not restricting fields to properties even in subschemas - noxuDefinition.Spec.Validation.OpenAPIV3Schema = &apiextensionsv1beta1.JSONSchemaProps{ - Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ - "spec": { - Description: "Validation for spec", - Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ - "replicas": { - Type: "integer", - }, - }, - }, - }, - Required: []string{"spec"}, - Description: "This is a description at the root of the schema", - } - _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatalf("unable to created crd %v: %v", noxuDefinition.Name, err) - } -} - -func TestValidateOnlyStatus(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - // UpdateStatus should validate only status - // 1. create a crd with max value of .spec.num = 10 and .status.num = 10 - // 2. create a cr with .spec.num = 10 and .status.num = 10 (valid) - // 3. update the spec of the cr with .spec.num = 15 (spec is invalid), expect no error - // 4. update the spec of the cr with .spec.num = 15 (spec is invalid), expect error - - // max value of spec.num = 10 and status.num = 10 - schema := &apiextensionsv1beta1.JSONSchemaProps{ - Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ - "spec": { - Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ - "num": { - Type: "integer", - Maximum: float64Ptr(10), - }, - }, - }, - "status": { - Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ - "num": { - Type: "integer", - Maximum: float64Ptr(10), - }, - }, - }, - }, - } - - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition.Spec.Validation = &apiextensionsv1beta1.CustomResourceValidation{ - OpenAPIV3Schema: schema, - } - - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - - // set .spec.num = 10 and .status.num = 10 - noxuInstance := NewNoxuSubresourceInstance(ns, "foo") - err = unstructured.SetNestedField(noxuInstance.Object, int64(10), "status", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - createdNoxuInstance, err := instantiateCustomResource(t, noxuInstance, noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } - - // update the spec with .spec.num = 15, expecting no error - err = unstructured.SetNestedField(createdNoxuInstance.Object, int64(15), "spec", "num") - if err != nil { - t.Fatalf("unexpected error setting .spec.num: %v", err) - } - createdNoxuInstance, err = noxuResourceClient.UpdateStatus(createdNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - - // update with .status.num = 15, expecting an error - err = unstructured.SetNestedField(createdNoxuInstance.Object, int64(15), "status", "num") - if err != nil { - t.Fatalf("unexpected error setting .status.num: %v", err) - } - createdNoxuInstance, err = noxuResourceClient.UpdateStatus(createdNoxuInstance, metav1.UpdateOptions{}) - if err == nil { - t.Fatal("expected error, but got none") - } - statusError, isStatus := err.(*apierrors.StatusError) - if !isStatus || statusError == nil { - t.Fatalf("expected status error, got %T: %v", err, err) - } - if !strings.Contains(statusError.Error(), "Invalid value") { - t.Fatalf("expected 'Invalid value' in error, got: %v", err) - } -} - -func TestSubresourcesDiscovery(t *testing.T) { - tearDown, config, _, err := fixtures.StartDefaultServer(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - apiExtensionClient, err := clientset.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - dynamicClient, err := dynamic.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - group := "mygroup.example.com" - version := "v1beta1" - - resources, err := apiExtensionClient.Discovery().ServerResourcesForGroupVersion(group + "/" + version) - if err != nil { - t.Fatal(err) - } - - if len(resources.APIResources) != 3 { - t.Fatalf("Expected exactly the resources \"noxus\", \"noxus/status\" and \"noxus/scale\" in group version %v/%v via discovery, got: %v", group, version, resources.APIResources) - } - - // check discovery info for status - status := resources.APIResources[1] - - if status.Name != "noxus/status" { - t.Fatalf("incorrect status via discovery: expected name: %v, got: %v", "noxus/status", status.Name) - } - - if status.Namespaced != true { - t.Fatalf("incorrect status via discovery: expected namespace: %v, got: %v", true, status.Namespaced) - } - - if status.Kind != "WishIHadChosenNoxu" { - t.Fatalf("incorrect status via discovery: expected kind: %v, got: %v", "WishIHadChosenNoxu", status.Kind) - } - - expectedVerbs := []string{"get", "patch", "update"} - sort.Strings(status.Verbs) - if !reflect.DeepEqual([]string(status.Verbs), expectedVerbs) { - t.Fatalf("incorrect status via discovery: expected: %v, got: %v", expectedVerbs, status.Verbs) - } - - // check discovery info for scale - scale := resources.APIResources[2] - - if scale.Group != autoscaling.GroupName { - t.Fatalf("incorrect scale via discovery: expected group: %v, got: %v", autoscaling.GroupName, scale.Group) - } - - if scale.Version != "v1" { - t.Fatalf("incorrect scale via discovery: expected version: %v, got %v", "v1", scale.Version) - } - - if scale.Name != "noxus/scale" { - t.Fatalf("incorrect scale via discovery: expected name: %v, got: %v", "noxus/scale", scale.Name) - } - - if scale.Namespaced != true { - t.Fatalf("incorrect scale via discovery: expected namespace: %v, got: %v", true, scale.Namespaced) - } - - if scale.Kind != "Scale" { - t.Fatalf("incorrect scale via discovery: expected kind: %v, got: %v", "Scale", scale.Kind) - } - - sort.Strings(scale.Verbs) - if !reflect.DeepEqual([]string(scale.Verbs), expectedVerbs) { - t.Fatalf("incorrect scale via discovery: expected: %v, got: %v", expectedVerbs, scale.Verbs) - } -} - -func TestGeneration(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - _, err = instantiateCustomResource(t, NewNoxuSubresourceInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } - - // .metadata.generation = 1 - gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - if gottenNoxuInstance.GetGeneration() != 1 { - t.Fatalf(".metadata.generation should be 1 after creation") - } - - // .status.num = 20 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "status", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - // UpdateStatus does not increment generation - updatedStatusInstance, err := noxuResourceClient.UpdateStatus(gottenNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unable to update status: %v", err) - } - if updatedStatusInstance.GetGeneration() != 1 { - t.Fatalf("updating status should not increment .metadata.generation: expected: %v, got: %v", 1, updatedStatusInstance.GetGeneration()) - } - - gottenNoxuInstance, err = noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - - // .spec.num = 20 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "spec", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - // Update increments generation - updatedInstance, err := noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unable to update instance: %v", err) - } - if updatedInstance.GetGeneration() != 2 { - t.Fatalf("updating spec should increment .metadata.generation: expected: %v, got: %v", 2, updatedStatusInstance.GetGeneration()) - } -} - -func TestSubresourcePatch(t *testing.T) { - groupResource := schema.GroupResource{ - Group: "mygroup.example.com", - Resource: "noxus", - } - - tearDown, config, _, err := fixtures.StartDefaultServer(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - apiExtensionClient, err := clientset.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - dynamicClient, err := dynamic.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - - t.Logf("Creating foo") - _, err = instantiateCustomResource(t, NewNoxuSubresourceInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } - - scaleClient, err := fixtures.CreateNewScaleClient(noxuDefinition, config) - if err != nil { - t.Fatal(err) - } - - t.Logf("Patching .status.num to 999") - patch := []byte(`{"spec": {"num":999}, "status": {"num":999}}`) - patchedNoxuInstance, err := noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "status") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "status", "num") // .status.num should be 999 - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 10, "spec", "num") // .spec.num should remain 10 - rv, found, err := unstructured.NestedString(patchedNoxuInstance.UnstructuredContent(), "metadata", "resourceVersion") - if err != nil { - t.Fatal(err) - } - if !found { - t.Fatalf("metadata.resourceVersion not found") - } - - // this call waits for the resourceVersion to be reached in the cache before returning. - // We need to do this because the patch gets its initial object from the storage, and the cache serves that. - // If it is out of date, then our initial patch is applied to an old resource version, which conflicts - // and then the updated object shows a conflicting diff, which permanently fails the patch. - // This gives expected stability in the patch without retrying on an known number of conflicts below in the test. - // See https://issue.k8s.io/42644 - _, err = noxuResourceClient.Get("foo", metav1.GetOptions{ResourceVersion: patchedNoxuInstance.GetResourceVersion()}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - // no-op patch - t.Logf("Patching .status.num again to 999") - patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "status") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - // make sure no-op patch does not increment resourceVersion - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "status", "num") - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 10, "spec", "num") - expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") - - // empty patch - t.Logf("Applying empty patch") - patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, []byte(`{}`), metav1.UpdateOptions{}, "status") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - // an empty patch is a no-op patch. make sure it does not increment resourceVersion - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "status", "num") - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 10, "spec", "num") - expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") - - t.Logf("Patching .spec.replicas to 7") - patch = []byte(`{"spec": {"replicas":7}, "status": {"replicas":7}}`) - patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "scale") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 7, "spec", "replicas") - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 0, "status", "replicas") // .status.replicas should remain 0 - rv, found, err = unstructured.NestedString(patchedNoxuInstance.UnstructuredContent(), "metadata", "resourceVersion") - if err != nil { - t.Fatal(err) - } - if !found { - t.Fatalf("metadata.resourceVersion not found") - } - - // this call waits for the resourceVersion to be reached in the cache before returning. - // We need to do this because the patch gets its initial object from the storage, and the cache serves that. - // If it is out of date, then our initial patch is applied to an old resource version, which conflicts - // and then the updated object shows a conflicting diff, which permanently fails the patch. - // This gives expected stability in the patch without retrying on an known number of conflicts below in the test. - // See https://issue.k8s.io/42644 - _, err = noxuResourceClient.Get("foo", metav1.GetOptions{ResourceVersion: patchedNoxuInstance.GetResourceVersion()}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - // Scale.Spec.Replicas = 7 but Scale.Status.Replicas should remain 0 - gottenScale, err := scaleClient.Scales("not-the-default").Get(groupResource, "foo") - if err != nil { - t.Fatal(err) - } - if gottenScale.Spec.Replicas != 7 { - t.Fatalf("Scale.Spec.Replicas: expected: %v, got: %v", 7, gottenScale.Spec.Replicas) - } - if gottenScale.Status.Replicas != 0 { - t.Fatalf("Scale.Status.Replicas: expected: %v, got: %v", 0, gottenScale.Spec.Replicas) - } - - // no-op patch - t.Logf("Patching .spec.replicas again to 7") - patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "scale") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - // make sure no-op patch does not increment resourceVersion - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 7, "spec", "replicas") - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 0, "status", "replicas") - expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") - - // empty patch - t.Logf("Applying empty patch") - patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, []byte(`{}`), metav1.UpdateOptions{}, "scale") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - // an empty patch is a no-op patch. make sure it does not increment resourceVersion - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 7, "spec", "replicas") - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 0, "status", "replicas") - expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") - - // make sure strategic merge patch is not supported for both status and scale - _, err = noxuResourceClient.Patch("foo", types.StrategicMergePatchType, patch, metav1.UpdateOptions{}, "status") - if err == nil { - t.Fatalf("unexpected non-error: strategic merge patch is not supported for custom resources") - } - - _, err = noxuResourceClient.Patch("foo", types.StrategicMergePatchType, patch, metav1.UpdateOptions{}, "scale") - if err == nil { - t.Fatalf("unexpected non-error: strategic merge patch is not supported for custom resources") - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/table_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/table_test.go deleted file mode 100644 index 7aab4f408..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/table_test.go +++ /dev/null @@ -1,218 +0,0 @@ -/* -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 integration - -import ( - "fmt" - "testing" - "time" - - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/rest" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/test/integration/fixtures" -) - -func newTableCRD() *apiextensionsv1beta1.CustomResourceDefinition { - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "tables.mygroup.example.com"}, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: "mygroup.example.com", - Version: "v1beta1", - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: "tables", - Singular: "table", - Kind: "Table", - ListKind: "TablemList", - }, - Scope: apiextensionsv1beta1.ClusterScoped, - AdditionalPrinterColumns: []apiextensionsv1beta1.CustomResourceColumnDefinition{ - {Name: "Age", Type: "date", JSONPath: ".metadata.creationTimestamp"}, - {Name: "Alpha", Type: "string", JSONPath: ".spec.alpha"}, - {Name: "Beta", Type: "integer", Description: "the beta field", Format: "int64", Priority: 42, JSONPath: ".spec.beta"}, - {Name: "Gamma", Type: "integer", Description: "a column with wrongly typed values", JSONPath: ".spec.gamma"}, - {Name: "Epsilon", Type: "string", Description: "an array of integers as string", JSONPath: ".spec.epsilon"}, - }, - }, - } -} - -func newTableInstance(name string) *unstructured.Unstructured { - return &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "mygroup.example.com/v1beta1", - "kind": "Table", - "metadata": map[string]interface{}{ - "name": name, - }, - "spec": map[string]interface{}{ - "alpha": "foo_123", - "beta": 10, - "gamma": "bar", - "delta": "hello", - "epsilon": []int64{1, 2, 3}, - }, - }, - } -} - -func TestTableGet(t *testing.T) { - tearDown, config, _, err := fixtures.StartDefaultServer(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - apiExtensionClient, err := clientset.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - - dynamicClient, err := dynamic.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - - crd := newTableCRD() - crd, err = fixtures.CreateNewCustomResourceDefinition(crd, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(crd.Name, metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - t.Logf("table crd created: %#v", crd) - - crClient := newNamespacedCustomResourceClient("", dynamicClient, crd) - foo, err := crClient.Create(newTableInstance("foo"), metav1.CreateOptions{}) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } - t.Logf("foo created: %#v", foo.UnstructuredContent()) - - gv := schema.GroupVersion{Group: crd.Spec.Group, Version: crd.Spec.Version} - gvk := gv.WithKind(crd.Spec.Names.Kind) - - scheme := runtime.NewScheme() - codecs := serializer.NewCodecFactory(scheme) - parameterCodec := runtime.NewParameterCodec(scheme) - metav1.AddToGroupVersion(scheme, gv) - scheme.AddKnownTypes(gv, &metav1beta1.Table{}, &metav1beta1.TableOptions{}) - scheme.AddKnownTypes(metav1beta1.SchemeGroupVersion, &metav1beta1.Table{}, &metav1beta1.TableOptions{}) - - crConfig := *config - crConfig.GroupVersion = &gv - crConfig.APIPath = "/apis" - crConfig.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: codecs} - crRestClient, err := rest.RESTClientFor(&crConfig) - if err != nil { - t.Fatal(err) - } - - ret, err := crRestClient.Get(). - Resource(crd.Spec.Names.Plural). - SetHeader("Accept", fmt.Sprintf("application/json;as=Table;v=%s;g=%s, application/json", metav1beta1.SchemeGroupVersion.Version, metav1beta1.GroupName)). - VersionedParams(&metav1beta1.TableOptions{}, parameterCodec). - Do(). - Get() - if err != nil { - t.Fatalf("failed to list %v resources: %v", gvk, err) - } - - tbl, ok := ret.(*metav1beta1.Table) - if !ok { - t.Fatalf("expected metav1beta1.Table, got %T", ret) - } - t.Logf("%v table list: %#v", gvk, tbl) - - if got, expected := len(tbl.ColumnDefinitions), 6; got != expected { - t.Errorf("expected %d headers, got %d", expected, got) - } else { - age := metav1beta1.TableColumnDefinition{Name: "Age", Type: "date", Format: "", Description: "Custom resource definition column (in JSONPath format): .metadata.creationTimestamp", Priority: 0} - if got, expected := tbl.ColumnDefinitions[1], age; got != expected { - t.Errorf("expected column definition %#v, got %#v", expected, got) - } - - alpha := metav1beta1.TableColumnDefinition{Name: "Alpha", Type: "string", Format: "", Description: "Custom resource definition column (in JSONPath format): .spec.alpha", Priority: 0} - if got, expected := tbl.ColumnDefinitions[2], alpha; got != expected { - t.Errorf("expected column definition %#v, got %#v", expected, got) - } - - beta := metav1beta1.TableColumnDefinition{Name: "Beta", Type: "integer", Format: "int64", Description: "the beta field", Priority: 42} - if got, expected := tbl.ColumnDefinitions[3], beta; got != expected { - t.Errorf("expected column definition %#v, got %#v", expected, got) - } - - gamma := metav1beta1.TableColumnDefinition{Name: "Gamma", Type: "integer", Description: "a column with wrongly typed values"} - if got, expected := tbl.ColumnDefinitions[4], gamma; got != expected { - t.Errorf("expected column definition %#v, got %#v", expected, got) - } - - epsilon := metav1beta1.TableColumnDefinition{Name: "Epsilon", Type: "string", Description: "an array of integers as string"} - if got, expected := tbl.ColumnDefinitions[5], epsilon; got != expected { - t.Errorf("expected column definition %#v, got %#v", expected, got) - } - } - if got, expected := len(tbl.Rows), 1; got != expected { - t.Errorf("expected %d rows, got %d", expected, got) - } else if got, expected := len(tbl.Rows[0].Cells), 6; got != expected { - t.Errorf("expected %d cells, got %d", expected, got) - } else { - if got, expected := tbl.Rows[0].Cells[0], "foo"; got != expected { - t.Errorf("expected cell[0] to equal %q, got %q", expected, got) - } - if s, ok := tbl.Rows[0].Cells[1].(string); !ok { - t.Errorf("expected cell[1] to be a string, got: %#v", tbl.Rows[0].Cells[1]) - } else { - dur, err := time.ParseDuration(s) - if err != nil { - t.Errorf("expected cell[1] to be a duration: %v", err) - } else if abs(dur.Seconds()) > 30.0 { - t.Errorf("expected cell[1] to be a small age, but got: %v", dur) - } - } - if got, expected := tbl.Rows[0].Cells[2], "foo_123"; got != expected { - t.Errorf("expected cell[2] to equal %q, got %q", expected, got) - } - if got, expected := tbl.Rows[0].Cells[3], int64(10); got != expected { - t.Errorf("expected cell[3] to equal %#v, got %#v", expected, got) - } - if got, expected := tbl.Rows[0].Cells[4], interface{}(nil); got != expected { - t.Errorf("expected cell[4] to equal %#v although the type does not match the column, got %#v", expected, got) - } - if got, expected := tbl.Rows[0].Cells[5], "[1 2 3]"; got != expected { - t.Errorf("expected cell[5] to equal %q, got %q", expected, got) - } - } -} - -func abs(x float64) float64 { - if x < 0 { - return -x - } - return x -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/validation_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/validation_test.go deleted file mode 100644 index 37f9d0943..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/validation_test.go +++ /dev/null @@ -1,431 +0,0 @@ -/* -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 integration - -import ( - "strings" - "testing" - "time" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/util/wait" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/test/integration/fixtures" -) - -func TestForProperValidationErrors(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - - tests := []struct { - name string - instanceFn func() *unstructured.Unstructured - expectedError string - }{ - { - name: "bad version", - instanceFn: func() *unstructured.Unstructured { - instance := fixtures.NewVersionedNoxuInstance(ns, "foo", "v2") - return instance - }, - expectedError: "the API version in the data (mygroup.example.com/v2) does not match the expected API version (mygroup.example.com/v1beta1)", - }, - { - name: "bad kind", - instanceFn: func() *unstructured.Unstructured { - instance := fixtures.NewNoxuInstance(ns, "foo") - instance.Object["kind"] = "SomethingElse" - return instance - }, - expectedError: `SomethingElse.mygroup.example.com "foo" is invalid: kind: Invalid value: "SomethingElse": must be WishIHadChosenNoxu`, - }, - } - - for _, tc := range tests { - _, err := noxuResourceClient.Create(tc.instanceFn(), metav1.CreateOptions{}) - if err == nil { - t.Errorf("%v: expected %v", tc.name, tc.expectedError) - continue - } - // this only works when status errors contain the expect kind and version, so this effectively tests serializations too - if !strings.Contains(err.Error(), tc.expectedError) { - t.Errorf("%v: expected %v, got %v", tc.name, tc.expectedError, err) - continue - } - } -} - -func newNoxuValidationCRD(scope apiextensionsv1beta1.ResourceScope) *apiextensionsv1beta1.CustomResourceDefinition { - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "noxus.mygroup.example.com"}, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: "mygroup.example.com", - Version: "v1beta1", - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: "noxus", - Singular: "nonenglishnoxu", - Kind: "WishIHadChosenNoxu", - ShortNames: []string{"foo", "bar", "abc", "def"}, - ListKind: "NoxuItemList", - }, - Scope: apiextensionsv1beta1.NamespaceScoped, - Validation: &apiextensionsv1beta1.CustomResourceValidation{ - OpenAPIV3Schema: &apiextensionsv1beta1.JSONSchemaProps{ - Required: []string{"alpha", "beta"}, - AdditionalProperties: &apiextensionsv1beta1.JSONSchemaPropsOrBool{ - Allows: true, - }, - Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ - "alpha": { - Description: "Alpha is an alphanumeric string with underscores", - Type: "string", - Pattern: "^[a-zA-Z0-9_]*$", - }, - "beta": { - Description: "Minimum value of beta is 10", - Type: "number", - Minimum: float64Ptr(10), - }, - "gamma": { - Description: "Gamma is restricted to foo, bar and baz", - Type: "string", - Enum: []apiextensionsv1beta1.JSON{ - { - Raw: []byte(`"foo"`), - }, - { - Raw: []byte(`"bar"`), - }, - { - Raw: []byte(`"baz"`), - }, - }, - }, - "delta": { - Description: "Delta is a string with a maximum length of 5 or a number with a minimum value of 0", - AnyOf: []apiextensionsv1beta1.JSONSchemaProps{ - { - Type: "string", - MaxLength: int64Ptr(5), - }, - { - Type: "number", - Minimum: float64Ptr(0), - }, - }, - }, - }, - }, - }, - }, - } -} - -func newNoxuValidationInstance(namespace, name string) *unstructured.Unstructured { - return &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "mygroup.example.com/v1beta1", - "kind": "WishIHadChosenNoxu", - "metadata": map[string]interface{}{ - "namespace": namespace, - "name": name, - }, - "alpha": "foo_123", - "beta": 10, - "gamma": "bar", - "delta": "hello", - }, - } -} - -func TestCustomResourceValidation(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - _, err = instantiateCustomResource(t, newNoxuValidationInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } -} - -func TestCustomResourceUpdateValidation(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - _, err = instantiateCustomResource(t, newNoxuValidationInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } - - gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - - // invalidate the instance - gottenNoxuInstance.Object = map[string]interface{}{ - "apiVersion": "mygroup.example.com/v1beta1", - "kind": "WishIHadChosenNoxu", - "metadata": map[string]interface{}{ - "namespace": "not-the-default", - "name": "foo", - }, - "gamma": "bar", - "delta": "hello", - } - - _, err = noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) - if err == nil { - t.Fatalf("unexpected non-error: alpha and beta should be present while updating %v", gottenNoxuInstance) - } -} - -func TestCustomResourceValidationErrors(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - - tests := []struct { - name string - instanceFn func() *unstructured.Unstructured - expectedError string - }{ - { - name: "bad alpha", - instanceFn: func() *unstructured.Unstructured { - instance := newNoxuValidationInstance(ns, "foo") - instance.Object["alpha"] = "foo_123!" - return instance - }, - expectedError: "alpha in body should match '^[a-zA-Z0-9_]*$'", - }, - { - name: "bad beta", - instanceFn: func() *unstructured.Unstructured { - instance := newNoxuValidationInstance(ns, "foo") - instance.Object["beta"] = 5 - return instance - }, - expectedError: "beta in body should be greater than or equal to 10", - }, - { - name: "bad gamma", - instanceFn: func() *unstructured.Unstructured { - instance := newNoxuValidationInstance(ns, "foo") - instance.Object["gamma"] = "qux" - return instance - }, - expectedError: "gamma in body should be one of [foo bar baz]", - }, - { - name: "bad delta", - instanceFn: func() *unstructured.Unstructured { - instance := newNoxuValidationInstance(ns, "foo") - instance.Object["delta"] = "foobarbaz" - return instance - }, - expectedError: "must validate at least one schema (anyOf)\ndelta in body should be at most 5 chars long", - }, - { - name: "absent alpha and beta", - instanceFn: func() *unstructured.Unstructured { - instance := newNoxuValidationInstance(ns, "foo") - instance.Object = map[string]interface{}{ - "apiVersion": "mygroup.example.com/v1beta1", - "kind": "WishIHadChosenNoxu", - "metadata": map[string]interface{}{ - "namespace": "not-the-default", - "name": "foo", - }, - "gamma": "bar", - "delta": "hello", - } - return instance - }, - expectedError: ".alpha in body is required\n.beta in body is required", - }, - } - - for _, tc := range tests { - _, err := noxuResourceClient.Create(tc.instanceFn(), metav1.CreateOptions{}) - if err == nil { - t.Errorf("%v: expected %v", tc.name, tc.expectedError) - continue - } - // this only works when status errors contain the expect kind and version, so this effectively tests serializations too - if !strings.Contains(err.Error(), tc.expectedError) { - t.Errorf("%v: expected %v, got %v", tc.name, tc.expectedError, err) - continue - } - } -} - -func TestCRValidationOnCRDUpdate(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) - - // set stricter schema - noxuDefinition.Spec.Validation.OpenAPIV3Schema.Required = []string{"alpha", "beta", "epsilon"} - - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - - // CR is rejected - _, err = instantiateCustomResource(t, newNoxuValidationInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err == nil { - t.Fatalf("unexpected non-error: CR should be rejected") - } - - // update the CRD to a less stricter schema - _, err = updateCustomResourceDefinitionWithRetry(apiExtensionClient, "noxus.mygroup.example.com", func(crd *apiextensionsv1beta1.CustomResourceDefinition) { - crd.Spec.Validation.OpenAPIV3Schema.Required = []string{"alpha", "beta"} - }) - if err != nil { - t.Fatal(err) - } - - // CR is now accepted - err = wait.Poll(500*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { - _, err := noxuResourceClient.Create(newNoxuValidationInstance(ns, "foo"), metav1.CreateOptions{}) - if statusError, isStatus := err.(*apierrors.StatusError); isStatus { - if strings.Contains(statusError.Error(), "is invalid") { - return false, nil - } - } - if err != nil { - return false, err - } - return true, nil - }) - if err != nil { - t.Fatal(err) - } -} - -func TestForbiddenFieldsInSchema(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition.Spec.Validation.OpenAPIV3Schema.AdditionalProperties.Allows = false - - _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err == nil { - t.Fatalf("unexpected non-error: additionalProperties cannot be set to false") - } - - noxuDefinition.Spec.Validation.OpenAPIV3Schema.Properties["zeta"] = apiextensionsv1beta1.JSONSchemaProps{ - Type: "array", - UniqueItems: true, - } - noxuDefinition.Spec.Validation.OpenAPIV3Schema.AdditionalProperties.Allows = true - - _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err == nil { - t.Fatalf("unexpected non-error: uniqueItems cannot be set to true") - } - - noxuDefinition.Spec.Validation.OpenAPIV3Schema.Ref = strPtr("#/definition/zeta") - noxuDefinition.Spec.Validation.OpenAPIV3Schema.Properties["zeta"] = apiextensionsv1beta1.JSONSchemaProps{ - Type: "array", - UniqueItems: false, - } - - _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err == nil { - t.Fatal("unexpected non-error: $ref cannot be non-empty string") - } - - noxuDefinition.Spec.Validation.OpenAPIV3Schema.Ref = nil - - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } -} - -func float64Ptr(f float64) *float64 { - return &f -} - -func int64Ptr(f int64) *int64 { - return &f -} - -func strPtr(str string) *string { - return &str -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/versioning_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/versioning_test.go deleted file mode 100644 index 7d305b081..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/versioning_test.go +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright 2018 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 integration - -import ( - "reflect" - "testing" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/test/integration/fixtures" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestVersionedNamspacedScopedCRD(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewMultipleVersionNoxuCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - testSimpleCRUD(t, ns, noxuDefinition, dynamicClient) -} - -func TestVersionedClusterScopedCRD(t *testing.T) { - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition := fixtures.NewMultipleVersionNoxuCRD(apiextensionsv1beta1.ClusterScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "" - testSimpleCRUD(t, ns, noxuDefinition, dynamicClient) -} - -func TestStoragedVersionInNamespacedCRDStatus(t *testing.T) { - noxuDefinition := fixtures.NewMultipleVersionNoxuCRD(apiextensionsv1beta1.NamespaceScoped) - ns := "not-the-default" - testStoragedVersionInCRDStatus(t, ns, noxuDefinition) -} - -func TestStoragedVersionInClusterScopedCRDStatus(t *testing.T) { - noxuDefinition := fixtures.NewMultipleVersionNoxuCRD(apiextensionsv1beta1.ClusterScoped) - ns := "" - testStoragedVersionInCRDStatus(t, ns, noxuDefinition) -} - -func testStoragedVersionInCRDStatus(t *testing.T, ns string, noxuDefinition *apiextensionsv1beta1.CustomResourceDefinition) { - versionsV1Beta1Storage := []apiextensionsv1beta1.CustomResourceDefinitionVersion{ - { - Name: "v1beta1", - Served: true, - Storage: true, - }, - { - Name: "v1beta2", - Served: true, - Storage: false, - }, - } - versionsV1Beta2Storage := []apiextensionsv1beta1.CustomResourceDefinitionVersion{ - { - Name: "v1beta1", - Served: true, - Storage: false, - }, - { - Name: "v1beta2", - Served: true, - Storage: true, - }, - } - tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - noxuDefinition.Spec.Versions = versionsV1Beta1Storage - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - // The storage version list should be initilized to storage version - crd, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxuDefinition.Name, metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := []string{"v1beta1"}, crd.Status.StoredVersions; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } - - // Changing CRD storage version should be reflected immediately - crd.Spec.Versions = versionsV1Beta2Storage - _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(crd) - if err != nil { - t.Fatal(err) - } - crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxuDefinition.Name, metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - if e, a := []string{"v1beta1", "v1beta2"}, crd.Status.StoredVersions; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, got %v", e, a) - } - - err = fixtures.DeleteCustomResourceDefinition(crd, apiExtensionClient) - if err != nil { - t.Fatal(err) - } -} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go deleted file mode 100644 index 45e5176b0..000000000 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go +++ /dev/null @@ -1,541 +0,0 @@ -/* -Copyright 2018 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 integration - -import ( - "encoding/json" - "fmt" - "net/http" - "testing" - - "github.com/ghodss/yaml" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/dynamic" - - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - "k8s.io/apiextensions-apiserver/test/integration/fixtures" -) - -func TestYAML(t *testing.T) { - tearDown, config, _, err := fixtures.StartDefaultServer(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - apiExtensionClient, err := clientset.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - dynamicClient, err := dynamic.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - - noxuDefinition := fixtures.NewNoxuCustomResourceDefinition(apiextensionsv1beta1.ClusterScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - kind := noxuDefinition.Spec.Names.Kind - listKind := noxuDefinition.Spec.Names.ListKind - apiVersion := noxuDefinition.Spec.Group + "/" + noxuDefinition.Spec.Version - - rest := apiExtensionClient.Discovery().RESTClient() - - // Discovery - { - result, err := rest.Get(). - SetHeader("Accept", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version). - DoRaw() - if err != nil { - t.Fatal(err, string(result)) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err) - } - if obj.GetAPIVersion() != "v1" || obj.GetKind() != "APIResourceList" { - t.Fatalf("unexpected discovery kind: %s", string(result)) - } - if v, ok, err := unstructured.NestedString(obj.Object, "groupVersion"); v != apiVersion || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - } - - // Error - { - result, err := rest.Get(). - SetHeader("Accept", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "missingname"). - DoRaw() - if !errors.IsNotFound(err) { - t.Fatalf("expected not found, got %v", err) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err) - } - if obj.GetAPIVersion() != "v1" || obj.GetKind() != "Status" { - t.Fatalf("unexpected discovery kind: %s", string(result)) - } - if v, ok, err := unstructured.NestedString(obj.Object, "reason"); v != "NotFound" || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - } - - uid := types.UID("") - resourceVersion := "" - - // Create - { - yamlBody := []byte(fmt.Sprintf(` -apiVersion: %s -kind: %s -metadata: - name: mytest -values: - numVal: 1 - boolVal: true - stringVal: "1"`, apiVersion, kind)) - - result, err := rest.Post(). - SetHeader("Accept", "application/yaml"). - SetHeader("Content-Type", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural). - Body(yamlBody). - DoRaw() - if err != nil { - t.Fatal(err, string(result)) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err) - } - if obj.GetName() != "mytest" { - t.Fatalf("expected mytest, got %s", obj.GetName()) - } - if obj.GetAPIVersion() != apiVersion { - t.Fatalf("expected %s, got %s", apiVersion, obj.GetAPIVersion()) - } - if obj.GetKind() != kind { - t.Fatalf("expected %s, got %s", kind, obj.GetKind()) - } - if v, ok, err := unstructured.NestedFloat64(obj.Object, "values", "numVal"); v != 1 || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if v, ok, err := unstructured.NestedBool(obj.Object, "values", "boolVal"); v != true || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if v, ok, err := unstructured.NestedString(obj.Object, "values", "stringVal"); v != "1" || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - uid = obj.GetUID() - resourceVersion = obj.GetResourceVersion() - } - - // Get - { - result, err := rest.Get(). - SetHeader("Accept", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest"). - DoRaw() - if err != nil { - t.Fatal(err) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err, string(result)) - } - if obj.GetName() != "mytest" { - t.Fatalf("expected mytest, got %s", obj.GetName()) - } - if obj.GetAPIVersion() != apiVersion { - t.Fatalf("expected %s, got %s", apiVersion, obj.GetAPIVersion()) - } - if obj.GetKind() != kind { - t.Fatalf("expected %s, got %s", kind, obj.GetKind()) - } - if v, ok, err := unstructured.NestedFloat64(obj.Object, "values", "numVal"); v != 1 || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if v, ok, err := unstructured.NestedBool(obj.Object, "values", "boolVal"); v != true || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if v, ok, err := unstructured.NestedString(obj.Object, "values", "stringVal"); v != "1" || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - } - - // List - { - result, err := rest.Get(). - SetHeader("Accept", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural). - DoRaw() - if err != nil { - t.Fatal(err, string(result)) - } - listObj, err := decodeYAML(result) - if err != nil { - t.Fatal(err) - } - if listObj.GetAPIVersion() != apiVersion { - t.Fatalf("expected %s, got %s", apiVersion, listObj.GetAPIVersion()) - } - if listObj.GetKind() != listKind { - t.Fatalf("expected %s, got %s", kind, listObj.GetKind()) - } - items, ok, err := unstructured.NestedSlice(listObj.Object, "items") - if !ok || err != nil || len(items) != 1 { - t.Fatalf("expected one item, got %v %v %v", items, ok, err) - } - obj := unstructured.Unstructured{Object: items[0].(map[string]interface{})} - if obj.GetName() != "mytest" { - t.Fatalf("expected mytest, got %s", obj.GetName()) - } - if obj.GetAPIVersion() != apiVersion { - t.Fatalf("expected %s, got %s", apiVersion, obj.GetAPIVersion()) - } - if obj.GetKind() != kind { - t.Fatalf("expected %s, got %s", kind, obj.GetKind()) - } - if v, ok, err := unstructured.NestedFloat64(obj.Object, "values", "numVal"); v != 1 || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if v, ok, err := unstructured.NestedBool(obj.Object, "values", "boolVal"); v != true || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if v, ok, err := unstructured.NestedString(obj.Object, "values", "stringVal"); v != "1" || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - } - - // Watch rejects yaml (no streaming support) - { - result, err := rest.Get(). - SetHeader("Accept", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural). - Param("watch", "true"). - DoRaw() - if !errors.IsNotAcceptable(err) { - t.Fatalf("expected not acceptable error, got %v (%s)", err, string(result)) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err) - } - if obj.GetAPIVersion() != "v1" || obj.GetKind() != "Status" { - t.Fatalf("unexpected result: %s", string(result)) - } - if v, ok, err := unstructured.NestedString(obj.Object, "reason"); v != "NotAcceptable" || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if v, ok, err := unstructured.NestedFloat64(obj.Object, "code"); v != http.StatusNotAcceptable || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - } - - // Update - { - yamlBody := []byte(fmt.Sprintf(` -apiVersion: %s -kind: %s -metadata: - name: mytest - uid: %s - resourceVersion: "%s" -values: - numVal: 2 - boolVal: false - stringVal: "2"`, apiVersion, kind, uid, resourceVersion)) - result, err := rest.Put(). - SetHeader("Accept", "application/yaml"). - SetHeader("Content-Type", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest"). - Body(yamlBody). - DoRaw() - if err != nil { - t.Fatal(err, string(result)) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err) - } - if obj.GetName() != "mytest" { - t.Fatalf("expected mytest, got %s", obj.GetName()) - } - if obj.GetAPIVersion() != apiVersion { - t.Fatalf("expected %s, got %s", apiVersion, obj.GetAPIVersion()) - } - if obj.GetKind() != kind { - t.Fatalf("expected %s, got %s", kind, obj.GetKind()) - } - if v, ok, err := unstructured.NestedFloat64(obj.Object, "values", "numVal"); v != 2 || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if v, ok, err := unstructured.NestedBool(obj.Object, "values", "boolVal"); v != false || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if v, ok, err := unstructured.NestedString(obj.Object, "values", "stringVal"); v != "2" || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if obj.GetUID() != uid { - t.Fatalf("uid changed: %v vs %v", uid, obj.GetUID()) - } - } - - // Patch rejects yaml requests (only JSON mime types are allowed) - { - yamlBody := []byte(fmt.Sprintf(` -values: - numVal: 3`)) - result, err := rest.Patch(types.MergePatchType). - SetHeader("Accept", "application/yaml"). - SetHeader("Content-Type", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest"). - Body(yamlBody). - DoRaw() - if !errors.IsUnsupportedMediaType(err) { - t.Fatalf("Expected bad request, got %v\n%s", err, string(result)) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err) - } - if obj.GetAPIVersion() != "v1" || obj.GetKind() != "Status" { - t.Fatalf("expected %s %s, got %s %s", "v1", "Status", obj.GetAPIVersion(), obj.GetKind()) - } - if v, ok, err := unstructured.NestedString(obj.Object, "reason"); v != "UnsupportedMediaType" || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - } - - // Delete - { - result, err := rest.Delete(). - SetHeader("Accept", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest"). - DoRaw() - if err != nil { - t.Fatal(err, string(result)) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err) - } - if obj.GetAPIVersion() != "v1" || obj.GetKind() != "Status" { - t.Fatalf("unexpected response: %s", string(result)) - } - if v, ok, err := unstructured.NestedString(obj.Object, "status"); v != "Success" || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - } -} - -func TestYAMLSubresource(t *testing.T) { - tearDown, config, _, err := fixtures.StartDefaultServer(t) - if err != nil { - t.Fatal(err) - } - defer tearDown() - - apiExtensionClient, err := clientset.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - dynamicClient, err := dynamic.NewForConfig(config) - if err != nil { - t.Fatal(err) - } - - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.ClusterScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - kind := noxuDefinition.Spec.Names.Kind - apiVersion := noxuDefinition.Spec.Group + "/" + noxuDefinition.Spec.Version - - rest := apiExtensionClient.Discovery().RESTClient() - - uid := types.UID("") - resourceVersion := "" - - // Create - { - yamlBody := []byte(fmt.Sprintf(` -apiVersion: %s -kind: %s -metadata: - name: mytest -spec: - replicas: 3`, apiVersion, kind)) - - result, err := rest.Post(). - SetHeader("Accept", "application/yaml"). - SetHeader("Content-Type", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural). - Body(yamlBody). - DoRaw() - if err != nil { - t.Fatal(err, string(result)) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err) - } - if obj.GetName() != "mytest" { - t.Fatalf("expected mytest, got %s", obj.GetName()) - } - if obj.GetAPIVersion() != apiVersion { - t.Fatalf("expected %s, got %s", apiVersion, obj.GetAPIVersion()) - } - if obj.GetKind() != kind { - t.Fatalf("expected %s, got %s", kind, obj.GetKind()) - } - if v, ok, err := unstructured.NestedFloat64(obj.Object, "spec", "replicas"); v != 3 || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - uid = obj.GetUID() - resourceVersion = obj.GetResourceVersion() - } - - // Get at /status - { - result, err := rest.Get(). - SetHeader("Accept", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest", "status"). - DoRaw() - if err != nil { - t.Fatal(err) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err, string(result)) - } - if obj.GetName() != "mytest" { - t.Fatalf("expected mytest, got %s", obj.GetName()) - } - if obj.GetAPIVersion() != apiVersion { - t.Fatalf("expected %s, got %s", apiVersion, obj.GetAPIVersion()) - } - if obj.GetKind() != kind { - t.Fatalf("expected %s, got %s", kind, obj.GetKind()) - } - if v, ok, err := unstructured.NestedFloat64(obj.Object, "spec", "replicas"); v != 3 || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - } - - // Update at /status - { - yamlBody := []byte(fmt.Sprintf(` -apiVersion: %s -kind: %s -metadata: - name: mytest - uid: %s - resourceVersion: "%s" -spec: - replicas: 5 -status: - replicas: 3`, apiVersion, kind, uid, resourceVersion)) - result, err := rest.Put(). - SetHeader("Accept", "application/yaml"). - SetHeader("Content-Type", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest", "status"). - Body(yamlBody). - DoRaw() - if err != nil { - t.Fatal(err, string(result)) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err) - } - if obj.GetName() != "mytest" { - t.Fatalf("expected mytest, got %s", obj.GetName()) - } - if obj.GetAPIVersion() != apiVersion { - t.Fatalf("expected %s, got %s", apiVersion, obj.GetAPIVersion()) - } - if obj.GetKind() != kind { - t.Fatalf("expected %s, got %s", kind, obj.GetKind()) - } - if v, ok, err := unstructured.NestedFloat64(obj.Object, "spec", "replicas"); v != 3 || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if v, ok, err := unstructured.NestedFloat64(obj.Object, "status", "replicas"); v != 3 || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if obj.GetUID() != uid { - t.Fatalf("uid changed: %v vs %v", uid, obj.GetUID()) - } - } - - // Get at /scale - { - result, err := rest.Get(). - SetHeader("Accept", "application/yaml"). - AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest", "scale"). - DoRaw() - if err != nil { - t.Fatal(err) - } - obj, err := decodeYAML(result) - if err != nil { - t.Fatal(err, string(result)) - } - if obj.GetName() != "mytest" { - t.Fatalf("expected mytest, got %s", obj.GetName()) - } - if obj.GetAPIVersion() != "autoscaling/v1" { - t.Fatalf("expected %s, got %s", apiVersion, obj.GetAPIVersion()) - } - if obj.GetKind() != "Scale" { - t.Fatalf("expected %s, got %s", kind, obj.GetKind()) - } - if v, ok, err := unstructured.NestedFloat64(obj.Object, "spec", "replicas"); v != 3 || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - if v, ok, err := unstructured.NestedFloat64(obj.Object, "status", "replicas"); v != 3 || !ok || err != nil { - t.Fatal(v, ok, err, string(result)) - } - } -} - -func decodeYAML(data []byte) (*unstructured.Unstructured, error) { - retval := &unstructured.Unstructured{Object: map[string]interface{}{}} - // ensure this isn't JSON - if json.Unmarshal(data, &retval.Object) == nil { - return nil, fmt.Errorf("data is JSON, not YAML: %s", string(data)) - } - // ensure it is YAML - retval.Object = map[string]interface{}{} - if err := yaml.Unmarshal(data, &retval.Object); err != nil { - return nil, fmt.Errorf("error decoding YAML: %v\noriginal YAML: %s", err, string(data)) - } - return retval, nil -} diff --git a/vendor/k8s.io/csi-api/.github/PULL_REQUEST_TEMPLATE.md b/vendor/k8s.io/csi-api/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e559c074b..000000000 --- a/vendor/k8s.io/csi-api/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,2 +0,0 @@ -Sorry, we do not accept changes directly against this repository. Please see -CONTRIBUTING.md for information on where and how to contribute instead. diff --git a/vendor/k8s.io/csi-api/CONTRIBUTING.md b/vendor/k8s.io/csi-api/CONTRIBUTING.md deleted file mode 100644 index f793e3047..000000000 --- a/vendor/k8s.io/csi-api/CONTRIBUTING.md +++ /dev/null @@ -1,7 +0,0 @@ -# Contributing guidelines - -Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. - -This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/csi-api](https://git.k8s.io/kubernetes/staging/src/k8s.io/csi-api) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). - -Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/staging.md) for more information. diff --git a/vendor/k8s.io/csi-api/Godeps/Godeps.json b/vendor/k8s.io/csi-api/Godeps/Godeps.json deleted file mode 100644 index af3d73a45..000000000 --- a/vendor/k8s.io/csi-api/Godeps/Godeps.json +++ /dev/null @@ -1,566 +0,0 @@ -{ - "ImportPath": "k8s.io/csi-api", - "GoVersion": "go1.10", - "GodepVersion": "v80", - "Packages": [ - "./..." - ], - "Deps": [ - { - "ImportPath": "github.com/davecgh/go-spew/spew", - "Rev": "782f4967f2dc4564575ca782fe2d04090b5faca8" - }, - { - "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/protobuf/proto", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/any", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/duration", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/golang/protobuf/ptypes/timestamp", - "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" - }, - { - "ImportPath": "github.com/google/btree", - "Rev": "7d79101e329e5a3adf994758c578dab82b90c017" - }, - { - "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/gregjones/httpcache", - "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" - }, - { - "ImportPath": "github.com/gregjones/httpcache/diskcache", - "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" - }, - { - "ImportPath": "github.com/hashicorp/golang-lru", - "Rev": "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" - }, - { - "ImportPath": "github.com/hashicorp/golang-lru/simplelru", - "Rev": "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" - }, - { - "ImportPath": "github.com/json-iterator/go", - "Rev": "f2b4162afba35581b6d4a50d3b8f34e33c144682" - }, - { - "ImportPath": "github.com/modern-go/concurrent", - "Rev": "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94" - }, - { - "ImportPath": "github.com/modern-go/reflect2", - "Rev": "05fbef0ca5da472bbf96c9322b84a53edc03c9fd" - }, - { - "ImportPath": "github.com/peterbourgon/diskv", - "Rev": "5f041e8faa004a95c88a202771f4cc3e991971e6" - }, - { - "ImportPath": "golang.org/x/crypto/ssh/terminal", - "Rev": "de0752318171da717af4ce24d0a2e8626afaeb11" - }, - { - "ImportPath": "golang.org/x/net/context", - "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/internal", - "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": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/admissionregistration/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/apps/v1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/apps/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/apps/v1beta2", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/authentication/v1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/authentication/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/authorization/v1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/authorization/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/autoscaling/v1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/autoscaling/v2beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/autoscaling/v2beta2", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/batch/v1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/batch/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/batch/v2alpha1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/certificates/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/coordination/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/core/v1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/events/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/extensions/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/networking/v1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/policy/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/rbac/v1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/rbac/v1alpha1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/rbac/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/scheduling/v1alpha1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/scheduling/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/settings/v1alpha1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/storage/v1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/storage/v1alpha1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/api/storage/v1beta1", - "Rev": "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc" - }, - { - "ImportPath": "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions", - "Rev": "1748dfb29e8a4432b78514bc88a1b07937a9805a" - }, - { - "ImportPath": "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1", - "Rev": "1748dfb29e8a4432b78514bc88a1b07937a9805a" - }, - { - "ImportPath": "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme", - "Rev": "1748dfb29e8a4432b78514bc88a1b07937a9805a" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/errors", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/cache", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/clock", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/naming", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/version", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "6dd46049f39503a1fc8d65de4bd566829e95faff" - }, - { - "ImportPath": "k8s.io/client-go/discovery", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/discovery/fake", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/kubernetes/scheme", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/pkg/apis/clientauthentication", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/pkg/version", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/plugin/pkg/client/auth/exec", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/rest", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/rest/watch", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/testing", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/tools/cache", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/tools/clientcmd/api", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/tools/metrics", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/tools/pager", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/transport", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/util/cert", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/util/connrotation", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/util/flowcontrol", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/client-go/util/retry", - "Rev": "1638f8970cefaa404ff3a62950f88b08292b2696" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "0cf8f7e6ed1d2e3d47d02e3b6e559369af24d803" - } - ] -} diff --git a/vendor/k8s.io/csi-api/Godeps/OWNERS b/vendor/k8s.io/csi-api/Godeps/OWNERS deleted file mode 100644 index 3d49f3060..000000000 --- a/vendor/k8s.io/csi-api/Godeps/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: -- dep-approvers diff --git a/vendor/k8s.io/csi-api/Godeps/Readme b/vendor/k8s.io/csi-api/Godeps/Readme deleted file mode 100644 index 4cdaa53d5..000000000 --- a/vendor/k8s.io/csi-api/Godeps/Readme +++ /dev/null @@ -1,5 +0,0 @@ -This directory tree is generated automatically by godep. - -Please do not edit. - -See https://github.com/tools/godep for more information. diff --git a/vendor/k8s.io/csi-api/OWNERS b/vendor/k8s.io/csi-api/OWNERS deleted file mode 100644 index 6dfb625d9..000000000 --- a/vendor/k8s.io/csi-api/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -approvers: -- jsafrane -- saad-ali diff --git a/vendor/k8s.io/csi-api/README.md b/vendor/k8s.io/csi-api/README.md deleted file mode 100644 index 6b9bcf6be..000000000 --- a/vendor/k8s.io/csi-api/README.md +++ /dev/null @@ -1,28 +0,0 @@ -## Purpose - -This repository contains type definitions and client code for the CSI -APIs that Kubernetes makes use of. - -Consumers of the CSI APIs can make use of this repository to access -implementations of the APIs. - -## Community, discussion, contribution, and support - -Learn how to engage with the Kubernetes community on the [community -page](http://kubernetes.io/community/). - -You can reach the maintainers of this repository at: - -- Slack: #sig-storage (on https://kubernetes.slack.com -- get an - invite at slack.kubernetes.io) -- Mailing List: - https://groups.google.com/forum/#!forum/kubernetes-sig-storage - -### Code of Conduct - -Participation in the Kubernetes community is governed by the [Kubernetes -Code of Conduct](code-of-conduct.md). - -### Contibution Guidelines - -See [CONTRIBUTING.md](CONTRIBUTING.md) for more information. diff --git a/vendor/k8s.io/csi-api/code-of-conduct.md b/vendor/k8s.io/csi-api/code-of-conduct.md deleted file mode 100644 index 0d15c00cf..000000000 --- a/vendor/k8s.io/csi-api/code-of-conduct.md +++ /dev/null @@ -1,3 +0,0 @@ -# Kubernetes Community Code of Conduct - -Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/k8s.io/csi-api/hack/boilerplate.go.txt b/vendor/k8s.io/csi-api/hack/boilerplate.go.txt deleted file mode 100644 index b7c650da4..000000000 --- a/vendor/k8s.io/csi-api/hack/boilerplate.go.txt +++ /dev/null @@ -1,16 +0,0 @@ -/* -Copyright 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. -*/ - diff --git a/vendor/k8s.io/csi-api/hack/update-codegen.sh b/vendor/k8s.io/csi-api/hack/update-codegen.sh deleted file mode 100755 index 106cf6ed9..000000000 --- a/vendor/k8s.io/csi-api/hack/update-codegen.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2018 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. - -set -o errexit -set -o nounset -set -o pipefail - -SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. -CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} - -# generate the code with: -# --output-base because this script should also be able to run inside the vendor dir of -# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir -# instead of the $GOPATH directly. For normal projects this can be dropped. -${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ - k8s.io/csi-api/pkg/client k8s.io/csi-api/pkg/apis \ - csi:v1alpha1 \ - --output-base "$(dirname ${BASH_SOURCE})/../../.." \ - --go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt diff --git a/vendor/k8s.io/csi-api/hack/verify-codegen.sh b/vendor/k8s.io/csi-api/hack/verify-codegen.sh deleted file mode 100755 index 8be07ea16..000000000 --- a/vendor/k8s.io/csi-api/hack/verify-codegen.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2018 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. - -set -o errexit -set -o nounset -set -o pipefail - -SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/.. - -DIFFROOT="${SCRIPT_ROOT}/pkg" -TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg" -_tmp="${SCRIPT_ROOT}/_tmp" - -cleanup() { - rm -rf "${_tmp}" -} -trap "cleanup" EXIT SIGINT - -cleanup - -mkdir -p "${TMP_DIFFROOT}" -cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}" - -"${SCRIPT_ROOT}/hack/update-codegen.sh" -echo "diffing ${DIFFROOT} against freshly generated codegen" -ret=0 -diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$? -cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}" -if [[ $ret -eq 0 ]] -then - echo "${DIFFROOT} up to date." -else - echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh" - exit 1 -fi diff --git a/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/doc.go b/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/doc.go deleted file mode 100644 index 67f44299a..000000000 --- a/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2018 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. -*/ - -// +k8s:deepcopy-gen=package,register -// +groupName=csi.storage.k8s.io -// +k8s:openapi-gen=true - -// Package v1alpha1 provides alpha API for CSI API objects. -package v1alpha1 // import "k8s.io/csi-api/pkg/apis/csi/v1alpha1" diff --git a/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/register.go b/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/register.go deleted file mode 100644 index b2ffe63ab..000000000 --- a/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/register.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const ( - // GroupName is the group name use in this package - GroupName string = "csi.storage.k8s.io" - - // CsiDriverResourcePlural is the plural name of the CSIDriver resource - CsiDriverResourcePlural string = "csidrivers" - - // CsiNodeInfoResourcePlural is the plural name of the CSINode resource - CsiNodeInfoResourcePlural string = "csinodeinfos" -) - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // SchemeBuilder collects schemas to build. - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme is used by generated client to add this scheme to the generated client. - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &CSIDriver{}, - &CSIDriverList{}, - &CSINodeInfo{}, - &CSINodeInfoList{}, - ) - - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/types.go b/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/types.go deleted file mode 100644 index d2fbe0aa5..000000000 --- a/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/types.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CSIDriver captures information about a Container Storage Interface (CSI) -// volume driver deployed on the cluster. -// CSIDriver objects are non-namespaced. -type CSIDriver struct { - metav1.TypeMeta `json:",inline"` - - // Standard object metadata. - // metadata.Name indicates the name of the CSI driver that this object - // refers to; it MUST be the same name returned by the CSI GetPluginName() - // call for that driver. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Specification of the CSI Driver. - Spec CSIDriverSpec `json:"spec"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CSIDriverList is a collection of CSIDriver objects. -type CSIDriverList struct { - metav1.TypeMeta `json:",inline"` - - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // items is the list of CSIDriver - Items []CSIDriver `json:"items"` -} - -// CSIDriverSpec is the specification of a CSIDriver. -type CSIDriverSpec struct { - // attachRequired indicates this CSI volume driver requires an attach - // operation (because it implements the CSI ControllerPublishVolume() - // method), and that Kubernetes should call attach and wait for any attach - // operation to complete before proceeding to mounting. - // If value is not specified, default is false -- meaning attach will not be - // called. - // +optional - AttachRequired *bool `json:"attachRequired"` - - // If specified, podInfoRequiredOnMount indicates this CSI volume driver - // requires additional pod information (like podName, podUID, etc.) during - // mount operations. - // If value is not specified, pod information will not be passed on mount. - // If value is set to a valid version, Kubelet will pass pod information as - // VolumeAttributes in the CSI NodePublishVolume() calls. - // Supported versions: - // Version "v1" will pass the following ValueAttributes - // "csi.storage.k8s.io/pod.name": pod.Name - // "csi.storage.k8s.io/pod.namespace": pod.Namespace - // "csi.storage.k8s.io/pod.uid": string(pod.UID) - // +optional - PodInfoOnMountVersion *string `json:"podInfoOnMountVersion"` -} - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CSINodeInfo holds information about all CSI drivers installed on a node. -type CSINodeInfo struct { - metav1.TypeMeta `json:",inline"` - - // metadata.name must be the Kubernetes node name. - metav1.ObjectMeta `json:"metadata,omitempty"` - - // List of CSI drivers running on the node and their properties. - // +patchMergeKey=driver - // +patchStrategy=merge - CSIDrivers []CSIDriverInfo `json:"csiDrivers" patchStrategy:"merge" patchMergeKey:"driver"` -} - -// CSIDriverInfo contains information about one CSI driver installed on a node. -type CSIDriverInfo struct { - // driver is the name of the CSI driver that this object refers to. - // This MUST be the same name returned by the CSI GetPluginName() call for - // that driver. - Driver string `json:"driver"` - - // nodeID of the node from the driver point of view. - // This field enables Kubernetes to communicate with storage systems that do - // not share the same nomenclature for nodes. For example, Kubernetes may - // refer to a given node as "node1", but the storage system may refer to - // the same node as "nodeA". When Kubernetes issues a command to the storage - // system to attach a volume to a specific node, it can use this field to - // refer to the node name using the ID that the storage system will - // understand, e.g. "nodeA" instead of "node1". - NodeID string `json:"nodeID"` - - // topologyKeys is the list of keys supported by the driver. - // When a driver is initialized on a cluster, it provides a set of topology - // keys that it understands (e.g. "company.com/zone", "company.com/region"). - // When a driver is initialized on a node it provides the same topology keys - // along with values that kubelet applies to the coresponding node API - // object as labels. - // When Kubernetes does topology aware provisioning, it can use this list to - // determine which labels it should retrieve from the node object and pass - // back to the driver. - TopologyKeys []string `json:"topologyKeys"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CSINodeInfoList is a collection of CSINodeInfo objects. -type CSINodeInfoList struct { - metav1.TypeMeta `json:",inline"` - - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // items is the list of CSINodeInfo - Items []CSINodeInfo `json:"items"` -} diff --git a/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index aa9ccbbaa..000000000 --- a/vendor/k8s.io/csi-api/pkg/apis/csi/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,198 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 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. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CSIDriver) DeepCopyInto(out *CSIDriver) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSIDriver. -func (in *CSIDriver) DeepCopy() *CSIDriver { - if in == nil { - return nil - } - out := new(CSIDriver) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CSIDriver) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CSIDriverInfo) DeepCopyInto(out *CSIDriverInfo) { - *out = *in - if in.TopologyKeys != nil { - in, out := &in.TopologyKeys, &out.TopologyKeys - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSIDriverInfo. -func (in *CSIDriverInfo) DeepCopy() *CSIDriverInfo { - if in == nil { - return nil - } - out := new(CSIDriverInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CSIDriverList) DeepCopyInto(out *CSIDriverList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CSIDriver, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSIDriverList. -func (in *CSIDriverList) DeepCopy() *CSIDriverList { - if in == nil { - return nil - } - out := new(CSIDriverList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CSIDriverList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CSIDriverSpec) DeepCopyInto(out *CSIDriverSpec) { - *out = *in - if in.AttachRequired != nil { - in, out := &in.AttachRequired, &out.AttachRequired - *out = new(bool) - **out = **in - } - if in.PodInfoOnMountVersion != nil { - in, out := &in.PodInfoOnMountVersion, &out.PodInfoOnMountVersion - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSIDriverSpec. -func (in *CSIDriverSpec) DeepCopy() *CSIDriverSpec { - if in == nil { - return nil - } - out := new(CSIDriverSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CSINodeInfo) DeepCopyInto(out *CSINodeInfo) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.CSIDrivers != nil { - in, out := &in.CSIDrivers, &out.CSIDrivers - *out = make([]CSIDriverInfo, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSINodeInfo. -func (in *CSINodeInfo) DeepCopy() *CSINodeInfo { - if in == nil { - return nil - } - out := new(CSINodeInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CSINodeInfo) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CSINodeInfoList) DeepCopyInto(out *CSINodeInfoList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CSINodeInfo, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSINodeInfoList. -func (in *CSINodeInfoList) DeepCopy() *CSINodeInfoList { - if in == nil { - return nil - } - out := new(CSINodeInfoList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CSINodeInfoList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/clientset.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/clientset.go deleted file mode 100644 index 9d9099a7f..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/clientset.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" - csiv1alpha1 "k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - CsiV1alpha1() csiv1alpha1.CsiV1alpha1Interface - // Deprecated: please explicitly pick a version if possible. - Csi() csiv1alpha1.CsiV1alpha1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - csiV1alpha1 *csiv1alpha1.CsiV1alpha1Client -} - -// CsiV1alpha1 retrieves the CsiV1alpha1Client -func (c *Clientset) CsiV1alpha1() csiv1alpha1.CsiV1alpha1Interface { - return c.csiV1alpha1 -} - -// Deprecated: Csi retrieves the default version of CsiClient. -// Please explicitly pick a version. -func (c *Clientset) Csi() csiv1alpha1.CsiV1alpha1Interface { - return c.csiV1alpha1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.csiV1alpha1, err = csiv1alpha1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.csiV1alpha1 = csiv1alpha1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.csiV1alpha1 = csiv1alpha1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/doc.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/doc.go deleted file mode 100644 index 41721ca52..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/fake/clientset_generated.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/fake/clientset_generated.go deleted file mode 100644 index 6cc8be08b..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/fake/clientset_generated.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" - clientset "k8s.io/csi-api/pkg/client/clientset/versioned" - csiv1alpha1 "k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1" - fakecsiv1alpha1 "k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -var _ clientset.Interface = &Clientset{} - -// CsiV1alpha1 retrieves the CsiV1alpha1Client -func (c *Clientset) CsiV1alpha1() csiv1alpha1.CsiV1alpha1Interface { - return &fakecsiv1alpha1.FakeCsiV1alpha1{Fake: &c.Fake} -} - -// Csi retrieves the CsiV1alpha1Client -func (c *Clientset) Csi() csiv1alpha1.CsiV1alpha1Interface { - return &fakecsiv1alpha1.FakeCsiV1alpha1{Fake: &c.Fake} -} diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/fake/doc.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/fake/doc.go deleted file mode 100644 index 9b99e7167..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/fake/register.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/fake/register.go deleted file mode 100644 index 6f04c670d..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/fake/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - csiv1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - csiv1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/scheme/doc.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7dc375616..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/scheme/register.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/scheme/register.go deleted file mode 100644 index 114f615f5..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - csiv1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - csiv1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/csi_client.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/csi_client.go deleted file mode 100644 index dcda8c23e..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/csi_client.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" - v1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" - "k8s.io/csi-api/pkg/client/clientset/versioned/scheme" -) - -type CsiV1alpha1Interface interface { - RESTClient() rest.Interface - CSIDriversGetter - CSINodeInfosGetter -} - -// CsiV1alpha1Client is used to interact with features provided by the csi.storage.k8s.io group. -type CsiV1alpha1Client struct { - restClient rest.Interface -} - -func (c *CsiV1alpha1Client) CSIDrivers() CSIDriverInterface { - return newCSIDrivers(c) -} - -func (c *CsiV1alpha1Client) CSINodeInfos() CSINodeInfoInterface { - return newCSINodeInfos(c) -} - -// NewForConfig creates a new CsiV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*CsiV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &CsiV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new CsiV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *CsiV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new CsiV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *CsiV1alpha1Client { - return &CsiV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *CsiV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/csidriver.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/csidriver.go deleted file mode 100644 index ffcee6193..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/csidriver.go +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" - scheme "k8s.io/csi-api/pkg/client/clientset/versioned/scheme" -) - -// CSIDriversGetter has a method to return a CSIDriverInterface. -// A group's client should implement this interface. -type CSIDriversGetter interface { - CSIDrivers() CSIDriverInterface -} - -// CSIDriverInterface has methods to work with CSIDriver resources. -type CSIDriverInterface interface { - Create(*v1alpha1.CSIDriver) (*v1alpha1.CSIDriver, error) - Update(*v1alpha1.CSIDriver) (*v1alpha1.CSIDriver, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.CSIDriver, error) - List(opts v1.ListOptions) (*v1alpha1.CSIDriverList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.CSIDriver, err error) - CSIDriverExpansion -} - -// cSIDrivers implements CSIDriverInterface -type cSIDrivers struct { - client rest.Interface -} - -// newCSIDrivers returns a CSIDrivers -func newCSIDrivers(c *CsiV1alpha1Client) *cSIDrivers { - return &cSIDrivers{ - client: c.RESTClient(), - } -} - -// Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. -func (c *cSIDrivers) Get(name string, options v1.GetOptions) (result *v1alpha1.CSIDriver, err error) { - result = &v1alpha1.CSIDriver{} - err = c.client.Get(). - Resource("csidrivers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. -func (c *cSIDrivers) List(opts v1.ListOptions) (result *v1alpha1.CSIDriverList, err error) { - result = &v1alpha1.CSIDriverList{} - err = c.client.Get(). - Resource("csidrivers"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cSIDrivers. -func (c *cSIDrivers) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Resource("csidrivers"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *cSIDrivers) Create(cSIDriver *v1alpha1.CSIDriver) (result *v1alpha1.CSIDriver, err error) { - result = &v1alpha1.CSIDriver{} - err = c.client.Post(). - Resource("csidrivers"). - Body(cSIDriver). - Do(). - Into(result) - return -} - -// Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *cSIDrivers) Update(cSIDriver *v1alpha1.CSIDriver) (result *v1alpha1.CSIDriver, err error) { - result = &v1alpha1.CSIDriver{} - err = c.client.Put(). - Resource("csidrivers"). - Name(cSIDriver.Name). - Body(cSIDriver). - Do(). - Into(result) - return -} - -// Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. -func (c *cSIDrivers) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Resource("csidrivers"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cSIDrivers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Resource("csidrivers"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched cSIDriver. -func (c *cSIDrivers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.CSIDriver, err error) { - result = &v1alpha1.CSIDriver{} - err = c.client.Patch(pt). - Resource("csidrivers"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/csinodeinfo.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/csinodeinfo.go deleted file mode 100644 index 8580127c0..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/csinodeinfo.go +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" - scheme "k8s.io/csi-api/pkg/client/clientset/versioned/scheme" -) - -// CSINodeInfosGetter has a method to return a CSINodeInfoInterface. -// A group's client should implement this interface. -type CSINodeInfosGetter interface { - CSINodeInfos() CSINodeInfoInterface -} - -// CSINodeInfoInterface has methods to work with CSINodeInfo resources. -type CSINodeInfoInterface interface { - Create(*v1alpha1.CSINodeInfo) (*v1alpha1.CSINodeInfo, error) - Update(*v1alpha1.CSINodeInfo) (*v1alpha1.CSINodeInfo, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.CSINodeInfo, error) - List(opts v1.ListOptions) (*v1alpha1.CSINodeInfoList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.CSINodeInfo, err error) - CSINodeInfoExpansion -} - -// cSINodeInfos implements CSINodeInfoInterface -type cSINodeInfos struct { - client rest.Interface -} - -// newCSINodeInfos returns a CSINodeInfos -func newCSINodeInfos(c *CsiV1alpha1Client) *cSINodeInfos { - return &cSINodeInfos{ - client: c.RESTClient(), - } -} - -// Get takes name of the cSINodeInfo, and returns the corresponding cSINodeInfo object, and an error if there is any. -func (c *cSINodeInfos) Get(name string, options v1.GetOptions) (result *v1alpha1.CSINodeInfo, err error) { - result = &v1alpha1.CSINodeInfo{} - err = c.client.Get(). - Resource("csinodeinfos"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CSINodeInfos that match those selectors. -func (c *cSINodeInfos) List(opts v1.ListOptions) (result *v1alpha1.CSINodeInfoList, err error) { - result = &v1alpha1.CSINodeInfoList{} - err = c.client.Get(). - Resource("csinodeinfos"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cSINodeInfos. -func (c *cSINodeInfos) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Resource("csinodeinfos"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a cSINodeInfo and creates it. Returns the server's representation of the cSINodeInfo, and an error, if there is any. -func (c *cSINodeInfos) Create(cSINodeInfo *v1alpha1.CSINodeInfo) (result *v1alpha1.CSINodeInfo, err error) { - result = &v1alpha1.CSINodeInfo{} - err = c.client.Post(). - Resource("csinodeinfos"). - Body(cSINodeInfo). - Do(). - Into(result) - return -} - -// Update takes the representation of a cSINodeInfo and updates it. Returns the server's representation of the cSINodeInfo, and an error, if there is any. -func (c *cSINodeInfos) Update(cSINodeInfo *v1alpha1.CSINodeInfo) (result *v1alpha1.CSINodeInfo, err error) { - result = &v1alpha1.CSINodeInfo{} - err = c.client.Put(). - Resource("csinodeinfos"). - Name(cSINodeInfo.Name). - Body(cSINodeInfo). - Do(). - Into(result) - return -} - -// Delete takes name of the cSINodeInfo and deletes it. Returns an error if one occurs. -func (c *cSINodeInfos) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Resource("csinodeinfos"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cSINodeInfos) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Resource("csinodeinfos"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched cSINodeInfo. -func (c *cSINodeInfos) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.CSINodeInfo, err error) { - result = &v1alpha1.CSINodeInfo{} - err = c.client.Patch(pt). - Resource("csinodeinfos"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/doc.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/doc.go deleted file mode 100644 index df51baa4d..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1alpha1 diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/doc.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/fake_csi_client.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/fake_csi_client.go deleted file mode 100644 index 4c279ee1a..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/fake_csi_client.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" - v1alpha1 "k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1" -) - -type FakeCsiV1alpha1 struct { - *testing.Fake -} - -func (c *FakeCsiV1alpha1) CSIDrivers() v1alpha1.CSIDriverInterface { - return &FakeCSIDrivers{c} -} - -func (c *FakeCsiV1alpha1) CSINodeInfos() v1alpha1.CSINodeInfoInterface { - return &FakeCSINodeInfos{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeCsiV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/fake_csidriver.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/fake_csidriver.go deleted file mode 100644 index 00887cc0b..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/fake_csidriver.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - v1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" -) - -// FakeCSIDrivers implements CSIDriverInterface -type FakeCSIDrivers struct { - Fake *FakeCsiV1alpha1 -} - -var csidriversResource = schema.GroupVersionResource{Group: "csi.storage.k8s.io", Version: "v1alpha1", Resource: "csidrivers"} - -var csidriversKind = schema.GroupVersionKind{Group: "csi.storage.k8s.io", Version: "v1alpha1", Kind: "CSIDriver"} - -// Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. -func (c *FakeCSIDrivers) Get(name string, options v1.GetOptions) (result *v1alpha1.CSIDriver, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(csidriversResource, name), &v1alpha1.CSIDriver{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.CSIDriver), err -} - -// List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. -func (c *FakeCSIDrivers) List(opts v1.ListOptions) (result *v1alpha1.CSIDriverList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(csidriversResource, csidriversKind, opts), &v1alpha1.CSIDriverList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.CSIDriverList{ListMeta: obj.(*v1alpha1.CSIDriverList).ListMeta} - for _, item := range obj.(*v1alpha1.CSIDriverList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested cSIDrivers. -func (c *FakeCSIDrivers) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(csidriversResource, opts)) -} - -// Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *FakeCSIDrivers) Create(cSIDriver *v1alpha1.CSIDriver) (result *v1alpha1.CSIDriver, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(csidriversResource, cSIDriver), &v1alpha1.CSIDriver{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.CSIDriver), err -} - -// Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *FakeCSIDrivers) Update(cSIDriver *v1alpha1.CSIDriver) (result *v1alpha1.CSIDriver, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(csidriversResource, cSIDriver), &v1alpha1.CSIDriver{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.CSIDriver), err -} - -// Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. -func (c *FakeCSIDrivers) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(csidriversResource, name), &v1alpha1.CSIDriver{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCSIDrivers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(csidriversResource, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.CSIDriverList{}) - return err -} - -// Patch applies the patch and returns the patched cSIDriver. -func (c *FakeCSIDrivers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.CSIDriver, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, name, data, subresources...), &v1alpha1.CSIDriver{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.CSIDriver), err -} diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/fake_csinodeinfo.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/fake_csinodeinfo.go deleted file mode 100644 index 38c18178c..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/fake/fake_csinodeinfo.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - v1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" -) - -// FakeCSINodeInfos implements CSINodeInfoInterface -type FakeCSINodeInfos struct { - Fake *FakeCsiV1alpha1 -} - -var csinodeinfosResource = schema.GroupVersionResource{Group: "csi.storage.k8s.io", Version: "v1alpha1", Resource: "csinodeinfos"} - -var csinodeinfosKind = schema.GroupVersionKind{Group: "csi.storage.k8s.io", Version: "v1alpha1", Kind: "CSINodeInfo"} - -// Get takes name of the cSINodeInfo, and returns the corresponding cSINodeInfo object, and an error if there is any. -func (c *FakeCSINodeInfos) Get(name string, options v1.GetOptions) (result *v1alpha1.CSINodeInfo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(csinodeinfosResource, name), &v1alpha1.CSINodeInfo{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.CSINodeInfo), err -} - -// List takes label and field selectors, and returns the list of CSINodeInfos that match those selectors. -func (c *FakeCSINodeInfos) List(opts v1.ListOptions) (result *v1alpha1.CSINodeInfoList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(csinodeinfosResource, csinodeinfosKind, opts), &v1alpha1.CSINodeInfoList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.CSINodeInfoList{ListMeta: obj.(*v1alpha1.CSINodeInfoList).ListMeta} - for _, item := range obj.(*v1alpha1.CSINodeInfoList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested cSINodeInfos. -func (c *FakeCSINodeInfos) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(csinodeinfosResource, opts)) -} - -// Create takes the representation of a cSINodeInfo and creates it. Returns the server's representation of the cSINodeInfo, and an error, if there is any. -func (c *FakeCSINodeInfos) Create(cSINodeInfo *v1alpha1.CSINodeInfo) (result *v1alpha1.CSINodeInfo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(csinodeinfosResource, cSINodeInfo), &v1alpha1.CSINodeInfo{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.CSINodeInfo), err -} - -// Update takes the representation of a cSINodeInfo and updates it. Returns the server's representation of the cSINodeInfo, and an error, if there is any. -func (c *FakeCSINodeInfos) Update(cSINodeInfo *v1alpha1.CSINodeInfo) (result *v1alpha1.CSINodeInfo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(csinodeinfosResource, cSINodeInfo), &v1alpha1.CSINodeInfo{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.CSINodeInfo), err -} - -// Delete takes name of the cSINodeInfo and deletes it. Returns an error if one occurs. -func (c *FakeCSINodeInfos) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(csinodeinfosResource, name), &v1alpha1.CSINodeInfo{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCSINodeInfos) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(csinodeinfosResource, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.CSINodeInfoList{}) - return err -} - -// Patch applies the patch and returns the patched cSINodeInfo. -func (c *FakeCSINodeInfos) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.CSINodeInfo, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csinodeinfosResource, name, data, subresources...), &v1alpha1.CSINodeInfo{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.CSINodeInfo), err -} diff --git a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/generated_expansion.go b/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/generated_expansion.go deleted file mode 100644 index efa8eeda1..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/clientset/versioned/typed/csi/v1alpha1/generated_expansion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -type CSIDriverExpansion interface{} - -type CSINodeInfoExpansion interface{} diff --git a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/interface.go b/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/interface.go deleted file mode 100644 index 7dd274f16..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package csi - -import ( - v1alpha1 "k8s.io/csi-api/pkg/client/informers/externalversions/csi/v1alpha1" - internalinterfaces "k8s.io/csi-api/pkg/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1alpha1 provides access to shared informers for resources in V1alpha1. - V1alpha1() v1alpha1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1alpha1 returns a new v1alpha1.Interface. -func (g *group) V1alpha1() v1alpha1.Interface { - return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/v1alpha1/csidriver.go b/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/v1alpha1/csidriver.go deleted file mode 100644 index 3875764ea..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/v1alpha1/csidriver.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - csiv1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" - versioned "k8s.io/csi-api/pkg/client/clientset/versioned" - internalinterfaces "k8s.io/csi-api/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/csi-api/pkg/client/listers/csi/v1alpha1" -) - -// CSIDriverInformer provides access to a shared informer and lister for -// CSIDrivers. -type CSIDriverInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.CSIDriverLister -} - -type cSIDriverInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewCSIDriverInformer constructs a new informer for CSIDriver type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewCSIDriverInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredCSIDriverInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredCSIDriverInformer constructs a new informer for CSIDriver type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredCSIDriverInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.CsiV1alpha1().CSIDrivers().List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.CsiV1alpha1().CSIDrivers().Watch(options) - }, - }, - &csiv1alpha1.CSIDriver{}, - resyncPeriod, - indexers, - ) -} - -func (f *cSIDriverInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredCSIDriverInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *cSIDriverInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&csiv1alpha1.CSIDriver{}, f.defaultInformer) -} - -func (f *cSIDriverInformer) Lister() v1alpha1.CSIDriverLister { - return v1alpha1.NewCSIDriverLister(f.Informer().GetIndexer()) -} diff --git a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/v1alpha1/csinodeinfo.go b/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/v1alpha1/csinodeinfo.go deleted file mode 100644 index 675ae8982..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/v1alpha1/csinodeinfo.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - csiv1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" - versioned "k8s.io/csi-api/pkg/client/clientset/versioned" - internalinterfaces "k8s.io/csi-api/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/csi-api/pkg/client/listers/csi/v1alpha1" -) - -// CSINodeInfoInformer provides access to a shared informer and lister for -// CSINodeInfos. -type CSINodeInfoInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.CSINodeInfoLister -} - -type cSINodeInfoInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewCSINodeInfoInformer constructs a new informer for CSINodeInfo type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewCSINodeInfoInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredCSINodeInfoInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredCSINodeInfoInformer constructs a new informer for CSINodeInfo type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredCSINodeInfoInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.CsiV1alpha1().CSINodeInfos().List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.CsiV1alpha1().CSINodeInfos().Watch(options) - }, - }, - &csiv1alpha1.CSINodeInfo{}, - resyncPeriod, - indexers, - ) -} - -func (f *cSINodeInfoInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredCSINodeInfoInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *cSINodeInfoInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&csiv1alpha1.CSINodeInfo{}, f.defaultInformer) -} - -func (f *cSINodeInfoInformer) Lister() v1alpha1.CSINodeInfoLister { - return v1alpha1.NewCSINodeInfoLister(f.Informer().GetIndexer()) -} diff --git a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/v1alpha1/interface.go b/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/v1alpha1/interface.go deleted file mode 100644 index 837f7f0d8..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/csi/v1alpha1/interface.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - internalinterfaces "k8s.io/csi-api/pkg/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // CSIDrivers returns a CSIDriverInformer. - CSIDrivers() CSIDriverInformer - // CSINodeInfos returns a CSINodeInfoInformer. - CSINodeInfos() CSINodeInfoInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// CSIDrivers returns a CSIDriverInformer. -func (v *version) CSIDrivers() CSIDriverInformer { - return &cSIDriverInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// CSINodeInfos returns a CSINodeInfoInformer. -func (v *version) CSINodeInfos() CSINodeInfoInformer { - return &cSINodeInfoInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/factory.go b/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/factory.go deleted file mode 100644 index 02cb36121..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/factory.go +++ /dev/null @@ -1,180 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - reflect "reflect" - sync "sync" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/csi-api/pkg/client/clientset/versioned" - csi "k8s.io/csi-api/pkg/client/informers/externalversions/csi" - internalinterfaces "k8s.io/csi-api/pkg/client/informers/externalversions/internalinterfaces" -) - -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client versioned.Interface - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc - lock sync.Mutex - defaultResync time.Duration - customResync map[reflect.Type]time.Duration - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - customResync: make(map[reflect.Type]time.Duration), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -// Start initializes all requested informers. -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - go informer.Run(stopCh) - f.startedInformers[informerType] = true - } - } -} - -// WaitForCacheSync waits for all started informers' cache were synced. -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InternalInformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - Csi() csi.Interface -} - -func (f *sharedInformerFactory) Csi() csi.Interface { - return csi.New(f, f.namespace, f.tweakListOptions) -} diff --git a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/generic.go b/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/generic.go deleted file mode 100644 index 0c779e961..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/generic.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - "fmt" - - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" - v1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - // Group=csi.storage.k8s.io, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("csidrivers"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Csi().V1alpha1().CSIDrivers().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("csinodeinfos"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Csi().V1alpha1().CSINodeInfos().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go deleted file mode 100644 index 820b3b44a..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalinterfaces - -import ( - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/csi-api/pkg/client/clientset/versioned" -) - -type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} - -type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/k8s.io/csi-api/pkg/client/listers/csi/v1alpha1/csidriver.go b/vendor/k8s.io/csi-api/pkg/client/listers/csi/v1alpha1/csidriver.go deleted file mode 100644 index 2db14c73f..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/listers/csi/v1alpha1/csidriver.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" - v1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" -) - -// CSIDriverLister helps list CSIDrivers. -type CSIDriverLister interface { - // List lists all CSIDrivers in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.CSIDriver, err error) - // Get retrieves the CSIDriver from the index for a given name. - Get(name string) (*v1alpha1.CSIDriver, error) - CSIDriverListerExpansion -} - -// cSIDriverLister implements the CSIDriverLister interface. -type cSIDriverLister struct { - indexer cache.Indexer -} - -// NewCSIDriverLister returns a new CSIDriverLister. -func NewCSIDriverLister(indexer cache.Indexer) CSIDriverLister { - return &cSIDriverLister{indexer: indexer} -} - -// List lists all CSIDrivers in the indexer. -func (s *cSIDriverLister) List(selector labels.Selector) (ret []*v1alpha1.CSIDriver, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.CSIDriver)) - }) - return ret, err -} - -// Get retrieves the CSIDriver from the index for a given name. -func (s *cSIDriverLister) Get(name string) (*v1alpha1.CSIDriver, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("csidriver"), name) - } - return obj.(*v1alpha1.CSIDriver), nil -} diff --git a/vendor/k8s.io/csi-api/pkg/client/listers/csi/v1alpha1/csinodeinfo.go b/vendor/k8s.io/csi-api/pkg/client/listers/csi/v1alpha1/csinodeinfo.go deleted file mode 100644 index baf0d60f6..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/listers/csi/v1alpha1/csinodeinfo.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" - v1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" -) - -// CSINodeInfoLister helps list CSINodeInfos. -type CSINodeInfoLister interface { - // List lists all CSINodeInfos in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.CSINodeInfo, err error) - // Get retrieves the CSINodeInfo from the index for a given name. - Get(name string) (*v1alpha1.CSINodeInfo, error) - CSINodeInfoListerExpansion -} - -// cSINodeInfoLister implements the CSINodeInfoLister interface. -type cSINodeInfoLister struct { - indexer cache.Indexer -} - -// NewCSINodeInfoLister returns a new CSINodeInfoLister. -func NewCSINodeInfoLister(indexer cache.Indexer) CSINodeInfoLister { - return &cSINodeInfoLister{indexer: indexer} -} - -// List lists all CSINodeInfos in the indexer. -func (s *cSINodeInfoLister) List(selector labels.Selector) (ret []*v1alpha1.CSINodeInfo, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.CSINodeInfo)) - }) - return ret, err -} - -// Get retrieves the CSINodeInfo from the index for a given name. -func (s *cSINodeInfoLister) Get(name string) (*v1alpha1.CSINodeInfo, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("csinodeinfo"), name) - } - return obj.(*v1alpha1.CSINodeInfo), nil -} diff --git a/vendor/k8s.io/csi-api/pkg/client/listers/csi/v1alpha1/expansion_generated.go b/vendor/k8s.io/csi-api/pkg/client/listers/csi/v1alpha1/expansion_generated.go deleted file mode 100644 index 590e85a5c..000000000 --- a/vendor/k8s.io/csi-api/pkg/client/listers/csi/v1alpha1/expansion_generated.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -// CSIDriverListerExpansion allows custom methods to be added to -// CSIDriverLister. -type CSIDriverListerExpansion interface{} - -// CSINodeInfoListerExpansion allows custom methods to be added to -// CSINodeInfoLister. -type CSINodeInfoListerExpansion interface{} diff --git a/vendor/k8s.io/csi-api/pkg/crd/crd.go b/vendor/k8s.io/csi-api/pkg/crd/crd.go deleted file mode 100644 index 4a7936e41..000000000 --- a/vendor/k8s.io/csi-api/pkg/crd/crd.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright 2018 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 crd - -import ( - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - csiapiv1alpha1 "k8s.io/csi-api/pkg/apis/csi/v1alpha1" - "reflect" -) - -// NOTE: the CRD functions here and the associated unit tests are non-ideal temporary measures in -// release 1.12 in order to aid manual CRD installation. This installation will be automated in -// subsequent releases and as a result this package will be removed. - -// CSIDriverCRD returns the CustomResourceDefinition for CSIDriver object. -func CSIDriverCRD() *apiextensionsv1beta1.CustomResourceDefinition { - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: csiapiv1alpha1.CsiDriverResourcePlural + "." + csiapiv1alpha1.GroupName, - }, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: csiapiv1alpha1.GroupName, - Version: csiapiv1alpha1.SchemeGroupVersion.Version, - Scope: apiextensionsv1beta1.ClusterScoped, - Validation: &apiextensionsv1beta1.CustomResourceValidation{ - OpenAPIV3Schema: &apiextensionsv1beta1.JSONSchemaProps{ - Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ - "spec": { - Description: "Specification of the CSI Driver.", - Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ - "attachRequired": { - Description: "Indicates this CSI volume driver requires an attach operation," + - " and that Kubernetes should call attach and wait for any attach operation to" + - " complete before proceeding to mount.", - Type: "boolean", - }, - "podInfoOnMountVersion": { - Description: "Indicates this CSI volume driver requires additional pod" + - " information (like podName, podUID, etc.) during mount operations.", - Type: "string", - }, - }, - }, - }, - }, - }, - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: csiapiv1alpha1.CsiDriverResourcePlural, - Kind: reflect.TypeOf(csiapiv1alpha1.CSIDriver{}).Name(), - }, - }, - } -} - -// CSINodeInfoCRD returns the CustomResourceDefinition for CSINodeInfo object. -func CSINodeInfoCRD() *apiextensionsv1beta1.CustomResourceDefinition { - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: csiapiv1alpha1.CsiNodeInfoResourcePlural + "." + csiapiv1alpha1.GroupName, - }, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: csiapiv1alpha1.GroupName, - Version: csiapiv1alpha1.SchemeGroupVersion.Version, - Scope: apiextensionsv1beta1.ClusterScoped, - Validation: &apiextensionsv1beta1.CustomResourceValidation{ - OpenAPIV3Schema: &apiextensionsv1beta1.JSONSchemaProps{ - Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ - "csiDrivers": { - Description: "List of CSI drivers running on the node and their properties.", - Type: "array", - Items: &apiextensionsv1beta1.JSONSchemaPropsOrArray{ - Schema: &apiextensionsv1beta1.JSONSchemaProps{ - Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ - "driver": { - Description: "The CSI driver that this object refers to.", - Type: "string", - }, - "nodeID": { - Description: "The node from the driver point of view.", - Type: "string", - }, - "topologyKeys": { - Description: "List of keys supported by the driver.", - Type: "array", - Items: &apiextensionsv1beta1.JSONSchemaPropsOrArray{ - Schema: &apiextensionsv1beta1.JSONSchemaProps{ - Type: "string", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: csiapiv1alpha1.CsiNodeInfoResourcePlural, - Kind: reflect.TypeOf(csiapiv1alpha1.CSINodeInfo{}).Name(), - }, - }, - } -} diff --git a/vendor/k8s.io/csi-api/pkg/crd/crd_test.go b/vendor/k8s.io/csi-api/pkg/crd/crd_test.go deleted file mode 100644 index 369a3b458..000000000 --- a/vendor/k8s.io/csi-api/pkg/crd/crd_test.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2018 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 crd_test - -import ( - "path/filepath" - "testing" - - "github.com/ghodss/yaml" - "io/ioutil" - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - apiextensionsscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/diff" - "k8s.io/csi-api/pkg/crd" - "os" -) - -func TestBootstrapCRDs(t *testing.T) { - testObjects(t, crd.CSIDriverCRD(), "csidriver.yaml") - testObjects(t, crd.CSINodeInfoCRD(), "csinodeinfo.yaml") -} - -func testObjects(t *testing.T, crd *apiextensionsv1beta1.CustomResourceDefinition, fixtureFilename string) { - filename := filepath.Join("testdata", fixtureFilename) - expectedYAML, err := ioutil.ReadFile(filename) - if err != nil { - t.Fatal(err) - } - - jsonData, err := runtime.Encode(apiextensionsscheme.Codecs.LegacyCodec(apiextensionsv1beta1.SchemeGroupVersion), crd) - if err != nil { - t.Fatal(err) - } - yamlData, err := yaml.JSONToYAML(jsonData) - if err != nil { - t.Fatal(err) - } - if string(yamlData) != string(expectedYAML) { - t.Errorf("Bootstrap CRD data does not match the test fixture in %s", filename) - - const updateEnvVar = "UPDATE_CSI_CRD_FIXTURE_DATA" - if os.Getenv(updateEnvVar) == "true" { - if err := ioutil.WriteFile(filename, []byte(yamlData), os.FileMode(0755)); err == nil { - t.Logf("Updated data in %s", filename) - t.Logf("Verify the diff, commit changes, and rerun the tests") - } else { - t.Logf("Could not update data in %s: %v", filename, err) - } - } else { - t.Logf("Diff between data in code and fixture data in %s:\n-------------\n%s", filename, diff.StringDiff(string(yamlData), string(expectedYAML))) - t.Logf("If the change is expected, re-run with %s=true to update the fixtures", updateEnvVar) - } - } -} diff --git a/vendor/k8s.io/csi-api/pkg/crd/testdata/csidriver.yaml b/vendor/k8s.io/csi-api/pkg/crd/testdata/csidriver.yaml deleted file mode 100644 index d950cbf49..000000000 --- a/vendor/k8s.io/csi-api/pkg/crd/testdata/csidriver.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - name: csidrivers.csi.storage.k8s.io -spec: - group: csi.storage.k8s.io - names: - kind: CSIDriver - plural: csidrivers - scope: Cluster - validation: - openAPIV3Schema: - properties: - spec: - description: Specification of the CSI Driver. - properties: - attachRequired: - description: Indicates this CSI volume driver requires an attach operation, - and that Kubernetes should call attach and wait for any attach operation - to complete before proceeding to mount. - type: boolean - podInfoOnMountVersion: - description: Indicates this CSI volume driver requires additional pod - information (like podName, podUID, etc.) during mount operations. - type: string - version: v1alpha1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: null diff --git a/vendor/k8s.io/csi-api/pkg/crd/testdata/csinodeinfo.yaml b/vendor/k8s.io/csi-api/pkg/crd/testdata/csinodeinfo.yaml deleted file mode 100644 index 6ea408d5e..000000000 --- a/vendor/k8s.io/csi-api/pkg/crd/testdata/csinodeinfo.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - name: csinodeinfos.csi.storage.k8s.io -spec: - group: csi.storage.k8s.io - names: - kind: CSINodeInfo - plural: csinodeinfos - scope: Cluster - validation: - openAPIV3Schema: - properties: - csiDrivers: - description: List of CSI drivers running on the node and their properties. - items: - properties: - driver: - description: The CSI driver that this object refers to. - type: string - nodeID: - description: The node from the driver point of view. - type: string - topologyKeys: - description: List of keys supported by the driver. - items: - type: string - type: array - type: array - version: v1alpha1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: null