diff --git a/RELEASE.md b/RELEASE.md index fa42a264..3760bd1c 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,9 +1,3 @@ # Release Process -nfs-provisioner is released on an as-needed basis. The process is as follows: - -1. An issue is proposing a new release with a changelog since the last release -1. An OWNER runs `make test` to make sure tests pass -1. An OWNER runs `git tag -a $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION` -1. An OWNER runs `make push` to build and push the image -1. The release issue is closed +TBD diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/OWNERS b/nfs/OWNERS similarity index 100% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/OWNERS rename to nfs/OWNERS diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/RELEASE.md b/nfs/RELEASE.md similarity index 100% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/RELEASE.md rename to nfs/RELEASE.md diff --git a/nfs/trash.yaml b/nfs/trash.yaml index 901f2189..fd1caeb5 100644 --- a/nfs/trash.yaml +++ b/nfs/trash.yaml @@ -19,7 +19,6 @@ github.com/go-openapi/spec 3a04341 github.com/go-openapi/swag 3b6d86c github.com/gogo/protobuf v0.3-127-g8d70fb3 github.com/golang/glog 23def4e -github.com/golang/groupcache a6b377e github.com/golang/protobuf 8ee7999 github.com/google/gofuzz fd52762 github.com/guelfey/go.dbus f6a3a23 @@ -27,7 +26,7 @@ github.com/hashicorp/hcl c3e054b github.com/howeyc/gopass f5387c4 github.com/imdario/mergo 0.2.2-6-g50d4dbd github.com/jonboulle/clockwork v0.1.0-4-gbcac988 -github.com/kubernetes-incubator/nfs-provisioner #TODO! +github.com/kubernetes-incubator/external-storage 2517d1f github.com/magiconair/properties v1.7.0-5-g0723e35 github.com/mailru/easyjson 159cdb8 github.com/mitchellh/mapstructure f3009df diff --git a/nfs/vendor/github.com/golang/groupcache/.gitignore b/nfs/vendor/github.com/golang/groupcache/.gitignore deleted file mode 100644 index b25c15b8..00000000 --- a/nfs/vendor/github.com/golang/groupcache/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*~ diff --git a/nfs/vendor/github.com/golang/groupcache/LICENSE b/nfs/vendor/github.com/golang/groupcache/LICENSE deleted file mode 100644 index 37ec93a1..00000000 --- a/nfs/vendor/github.com/golang/groupcache/LICENSE +++ /dev/null @@ -1,191 +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: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -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 -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/nfs/vendor/github.com/golang/groupcache/README.md b/nfs/vendor/github.com/golang/groupcache/README.md deleted file mode 100644 index 70c29da1..00000000 --- a/nfs/vendor/github.com/golang/groupcache/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# groupcache - -## Summary - -groupcache is a caching and cache-filling library, intended as a -replacement for memcached in many cases. - -For API docs and examples, see http://godoc.org/github.com/golang/groupcache - -## Comparison to memcached - -### **Like memcached**, groupcache: - - * shards by key to select which peer is responsible for that key - -### **Unlike memcached**, groupcache: - - * does not require running a separate set of servers, thus massively - reducing deployment/configuration pain. groupcache is a client - library as well as a server. It connects to its own peers. - - * comes with a cache filling mechanism. Whereas memcached just says - "Sorry, cache miss", often resulting in a thundering herd of - database (or whatever) loads from an unbounded number of clients - (which has resulted in several fun outages), groupcache coordinates - cache fills such that only one load in one process of an entire - replicated set of processes populates the cache, then multiplexes - the loaded value to all callers. - - * does not support versioned values. If key "foo" is value "bar", - key "foo" must always be "bar". There are neither cache expiration - times, nor explicit cache evictions. Thus there is also no CAS, - nor Increment/Decrement. This also means that groupcache.... - - * ... supports automatic mirroring of super-hot items to multiple - processes. This prevents memcached hot spotting where a machine's - CPU and/or NIC are overloaded by very popular keys/values. - - * is currently only available for Go. It's very unlikely that I - (bradfitz@) will port the code to any other language. - -## Loading process - -In a nutshell, a groupcache lookup of **Get("foo")** looks like: - -(On machine #5 of a set of N machines running the same code) - - 1. Is the value of "foo" in local memory because it's super hot? If so, use it. - - 2. Is the value of "foo" in local memory because peer #5 (the current - peer) is the owner of it? If so, use it. - - 3. Amongst all the peers in my set of N, am I the owner of the key - "foo"? (e.g. does it consistent hash to 5?) If so, load it. If - other callers come in, via the same process or via RPC requests - from peers, they block waiting for the load to finish and get the - same answer. If not, RPC to the peer that's the owner and get - the answer. If the RPC fails, just load it locally (still with - local dup suppression). - -## Users - -groupcache is in production use by dl.google.com (its original user), -parts of Blogger, parts of Google Code, parts of Google Fiber, parts -of Google production monitoring systems, etc. - -## Presentations - -See http://talks.golang.org/2013/oscon-dl.slide - -## Help - -Use the golang-nuts mailing list for any discussion or questions. diff --git a/nfs/vendor/github.com/golang/groupcache/lru/lru.go b/nfs/vendor/github.com/golang/groupcache/lru/lru.go deleted file mode 100644 index cdfe2991..00000000 --- a/nfs/vendor/github.com/golang/groupcache/lru/lru.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -Copyright 2013 Google Inc. - -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 lru implements an LRU cache. -package lru - -import "container/list" - -// Cache is an LRU cache. It is not safe for concurrent access. -type Cache struct { - // MaxEntries is the maximum number of cache entries before - // an item is evicted. Zero means no limit. - MaxEntries int - - // OnEvicted optionally specificies a callback function to be - // executed when an entry is purged from the cache. - OnEvicted func(key Key, value interface{}) - - ll *list.List - cache map[interface{}]*list.Element -} - -// A Key may be any value that is comparable. See http://golang.org/ref/spec#Comparison_operators -type Key interface{} - -type entry struct { - key Key - value interface{} -} - -// New creates a new Cache. -// If maxEntries is zero, the cache has no limit and it's assumed -// that eviction is done by the caller. -func New(maxEntries int) *Cache { - return &Cache{ - MaxEntries: maxEntries, - ll: list.New(), - cache: make(map[interface{}]*list.Element), - } -} - -// Add adds a value to the cache. -func (c *Cache) Add(key Key, value interface{}) { - if c.cache == nil { - c.cache = make(map[interface{}]*list.Element) - c.ll = list.New() - } - if ee, ok := c.cache[key]; ok { - c.ll.MoveToFront(ee) - ee.Value.(*entry).value = value - return - } - ele := c.ll.PushFront(&entry{key, value}) - c.cache[key] = ele - if c.MaxEntries != 0 && c.ll.Len() > c.MaxEntries { - c.RemoveOldest() - } -} - -// Get looks up a key's value from the cache. -func (c *Cache) Get(key Key) (value interface{}, ok bool) { - if c.cache == nil { - return - } - if ele, hit := c.cache[key]; hit { - c.ll.MoveToFront(ele) - return ele.Value.(*entry).value, true - } - return -} - -// Remove removes the provided key from the cache. -func (c *Cache) Remove(key Key) { - if c.cache == nil { - return - } - if ele, hit := c.cache[key]; hit { - c.removeElement(ele) - } -} - -// RemoveOldest removes the oldest item from the cache. -func (c *Cache) RemoveOldest() { - if c.cache == nil { - return - } - ele := c.ll.Back() - if ele != nil { - c.removeElement(ele) - } -} - -func (c *Cache) removeElement(e *list.Element) { - c.ll.Remove(e) - kv := e.Value.(*entry) - delete(c.cache, kv.key) - if c.OnEvicted != nil { - c.OnEvicted(kv.key, kv.value) - } -} - -// Len returns the number of items in the cache. -func (c *Cache) Len() int { - if c.cache == nil { - return 0 - } - return c.ll.Len() -} diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/.gitignore b/nfs/vendor/github.com/kubernetes-incubator/external-storage/.gitignore similarity index 100% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/.gitignore rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/.gitignore diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/.travis.yml b/nfs/vendor/github.com/kubernetes-incubator/external-storage/.travis.yml similarity index 100% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/.travis.yml rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/.travis.yml diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/CONTRIBUTING.md b/nfs/vendor/github.com/kubernetes-incubator/external-storage/CONTRIBUTING.md similarity index 100% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/CONTRIBUTING.md rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/CONTRIBUTING.md diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/LICENSE b/nfs/vendor/github.com/kubernetes-incubator/external-storage/LICENSE similarity index 100% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/LICENSE rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/LICENSE diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/OWNERS b/nfs/vendor/github.com/kubernetes-incubator/external-storage/OWNERS new file mode 100644 index 00000000..96a6d08f --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/OWNERS @@ -0,0 +1,3 @@ +assignees: + - wongma7 + - jsafrane diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/README.md b/nfs/vendor/github.com/kubernetes-incubator/external-storage/README.md similarity index 61% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/README.md rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/README.md index fcc99d2f..06cf486e 100644 --- a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/README.md +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/README.md @@ -1,13 +1,16 @@ -# External Provisioners +# External Storage +## External Provisioners This repository houses community-maintained external provisioners plus a helper library for building them. Each provisioner is contained in its own directory so for information on how to use one, enter its directory and read its documentation. The library is contained in the `lib` directory. -## What is an 'external provisioner'? -External provisioners work just like in-tree dynamic PV provisioners. A `StorageClass` object can specify an external provisioner instance to be its `provisioner` like it can in-tree provisioners such as GCE or AWS. The instance will then watch for `PersistentVolumeClaims` that ask for the `StorageClass` and automatically create `PersistentVolumes` for them. For more information on how dynamic provisioning works, see [the docs](http://kubernetes.io/docs/user-guide/persistent-volumes/) or [this blog post](http://blog.kubernetes.io/2016/10/dynamic-provisioning-and-storage-in-kubernetes.html). +### What is an 'external provisioner'? +An external provisioner is a dynamic PV provisioner whose code lives out-of-tree/external to Kubernetes. Unlike [in-tree dynamic provisioners](https://kubernetes.io/docs/user-guide/persistent-volumes/#aws) that run as part of the Kubernetes controller manager, external ones can be deployed & updated independently. -## How to use the library +External provisioners work just like in-tree dynamic PV provisioners. A `StorageClass` object can specify an external provisioner instance to be its `provisioner` like it can in-tree provisioners. The instance will then watch for `PersistentVolumeClaims` that ask for the `StorageClass` and automatically create `PersistentVolumes` for them. For more information on how dynamic provisioning works, see [the docs](http://kubernetes.io/docs/user-guide/persistent-volumes/) or [this blog post](http://blog.kubernetes.io/2016/10/dynamic-provisioning-and-storage-in-kubernetes.html). + +### How to use the library ```go import ( - "github.com/kubernetes-incubator/nfs-provisioner/lib/controller" + "github.com/kubernetes-incubator/external-storage/lib/controller" ) ``` You need to implement the `Provisioner` interface then pass your implementation to a `ProvisionController` and run the controller. The controller takes care of deciding when to call your implementation's `Provision` or `Delete`. The interface and controller are defined in the above package. diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/RELEASE.md b/nfs/vendor/github.com/kubernetes-incubator/external-storage/RELEASE.md new file mode 100644 index 00000000..fa42a264 --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/RELEASE.md @@ -0,0 +1,9 @@ +# Release Process + +nfs-provisioner is released on an as-needed basis. The process is as follows: + +1. An issue is proposing a new release with a changelog since the last release +1. An OWNER runs `make test` to make sure tests pass +1. An OWNER runs `git tag -a $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION` +1. An OWNER runs `make push` to build and push the image +1. The release issue is closed diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/code-of-conduct.md b/nfs/vendor/github.com/kubernetes-incubator/external-storage/code-of-conduct.md similarity index 100% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/code-of-conduct.md rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/code-of-conduct.md diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/controller/controller.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/controller.go similarity index 99% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/controller/controller.go rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/controller.go index 440ec628..e18cbf55 100644 --- a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/controller/controller.go +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/controller.go @@ -25,8 +25,8 @@ import ( "time" "github.com/golang/glog" - "github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection" - rl "github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection/resourcelock" + "github.com/kubernetes-incubator/external-storage/lib/leaderelection" + rl "github.com/kubernetes-incubator/external-storage/lib/leaderelection/resourcelock" "k8s.io/client-go/kubernetes" core_v1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/pkg/api" diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/controller/volume.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/volume.go similarity index 100% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/controller/volume.go rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/volume.go diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/glide.yaml b/nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/glide.yaml similarity index 89% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/glide.yaml rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/glide.yaml index 3f955d6b..0849bfa1 100644 --- a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/glide.yaml +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/glide.yaml @@ -1,4 +1,4 @@ -package: github.com/kubernetes-incubator/nfs-provisioner/lib +package: github.com/kubernetes-incubator/external-storage/lib import: - package: github.com/golang/glog - package: k8s.io/client-go diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection/leaderelection.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/leaderelection/leaderelection.go similarity index 99% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection/leaderelection.go rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/leaderelection/leaderelection.go index de51ba2b..5806e1c0 100644 --- a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection/leaderelection.go +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/leaderelection/leaderelection.go @@ -28,7 +28,7 @@ import ( "reflect" "time" - rl "github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection/resourcelock" + rl "github.com/kubernetes-incubator/external-storage/lib/leaderelection/resourcelock" "k8s.io/client-go/pkg/api/errors" "k8s.io/client-go/pkg/api/unversioned" "k8s.io/client-go/pkg/util/runtime" diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection/resourcelock/interface.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/leaderelection/resourcelock/interface.go similarity index 100% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection/resourcelock/interface.go rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/leaderelection/resourcelock/interface.go diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection/resourcelock/provisionpvclock.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/leaderelection/resourcelock/provisionpvclock.go similarity index 100% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection/resourcelock/provisionpvclock.go rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/leaderelection/resourcelock/provisionpvclock.go diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/verify.sh b/nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/verify.sh similarity index 100% rename from nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/verify.sh rename to nfs/vendor/github.com/kubernetes-incubator/external-storage/lib/verify.sh diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/Makefile b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/Makefile new file mode 100644 index 00000000..81b93247 --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/Makefile @@ -0,0 +1,70 @@ +# 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. + +IMAGE = quay.io/kubernetes_incubator/nfs-provisioner + +VERSION := +TAG := $(shell git describe --abbrev=0 --tags HEAD 2>/dev/null) +COMMIT := $(shell git rev-parse HEAD) +ifeq ($(TAG),) + VERSION := latest +else + ifeq ($(COMMIT), $(shell git rev-list -n1 $(TAG))) + VERSION := $(TAG) + else + VERSION := latest + endif +endif + +all build: + GOOS=linux go install -v ./cmd/nfs-provisioner + GOOS=linux go build ./cmd/nfs-provisioner +.PHONY: all build + +container: build quick-container +.PHONY: container + +quick-container: + cp nfs-provisioner deploy/docker/nfs-provisioner + docker build -t $(IMAGE):$(VERSION) deploy/docker +.PHONY: quick-container + +push: container + docker push $(IMAGE):$(VERSION) +.PHONY: push + +test-integration: verify + go test `go list ./... | grep -v 'vendor\|test\|demo'` +.PHONY: test-integration + +test-e2e: verify + go test ./test/e2e -v --kubeconfig=$(HOME)/.kube/config +.PHONY: test-e2e + +verify: + @tput bold; echo Running gofmt:; tput sgr0 + (gofmt -s -w -l `find . -type f -name "*.go" | grep -v vendor`) || exit 1 + @tput bold; echo Running golint and go vet:; tput sgr0 + for i in $$(find . -type f -name "*.go" | grep -v 'vendor\|framework'); do \ + golint --set_exit_status $$i; \ + go vet $$i; \ + done + @tput bold; echo Running verify-boilerplate; tput sgr0 + ../repo-infra/verify/verify-boilerplate.sh +.PHONY: verify + +clean: + rm -f nfs-provisioner + rm -f deploy/docker/nfs-provisioner +.PHONY: clean diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/README.md b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/README.md new file mode 100644 index 00000000..f118c6a4 --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/README.md @@ -0,0 +1,105 @@ +# nfs-provisioner +[![Build Status](https://travis-ci.org/kubernetes-incubator/nfs-provisioner.svg?branch=master)](https://travis-ci.org/kubernetes-incubator/nfs-provisioner) + +nfs-provisioner is an out-of-tree dynamic provisioner for Kubernetes 1.4. You can use it to quickly & easily deploy shared storage that works almost anywhere. Or it can help you write your own out-of-tree dynamic provisioner by serving as an example implementation of the requirements detailed in [the proposal](https://github.com/kubernetes/kubernetes/pull/30285). Go [here](./docs/demo) for a demo of how to use it and [here](../docs/demo/hostpath-provisioner) for an example of how to write your own. + +It works just like in-tree dynamic provisioners: a `StorageClass` object can specify an instance of nfs-provisioner to be its `provisioner` like it specifies in-tree provisioners such as GCE or AWS. Then, the instance of nfs-provisioner will watch for `PersistentVolumeClaims` that ask for the `StorageClass` and automatically create NFS-backed `PersistentVolumes` for them. For more information on how dynamic provisioning works, see [the docs](http://kubernetes.io/docs/user-guide/persistent-volumes/) or [this blog post](http://blog.kubernetes.io/2016/10/dynamic-provisioning-and-storage-in-kubernetes.html). + +## Quickstart +Choose some volume for your nfs-provisioner instance to store its state & data in and mount the volume at `/export` in `deploy/kubernetes/deployment.yaml`. It doesn't have to be a `hostPath` volume, it can e.g. be a PVC. Note that the volume must have a [supported file system](https://github.com/nfs-ganesha/nfs-ganesha/wiki/Fsalsupport#vfs) on it: any local filesystem on Linux is supported & NFS is not supported. +```yaml +... + volumeMounts: + - name: export-volume + mountPath: /export +volumes: + - name: export-volume + hostPath: + path: /tmp/nfs-provisioner +... +``` + +Choose a `provisioner` name for a `StorageClass` to specify and set it in `deploy/kubernetes/deployment.yaml` +```yaml +... +args: + - "-provisioner=example.com/nfs" +... +``` + +Create the deployment. +```console +$ kubectl create -f deploy/kubernetes/deployment.yaml +service "nfs-provisioner" created +deployment "nfs-provisioner" created +``` + +Create a `StorageClass` named "example-nfs" with `provisioner: example.com/nfs`. +```console +$ kubectl create -f deploy/kubernetes/class.yaml +storageclass "example-nfs" created +``` + +Create a `PersistentVolumeClaim` with annotation `volume.beta.kubernetes.io/storage-class: "example-nfs"` +```console +$ kubectl create -f deploy/kubernetes/claim.yaml +persistentvolumeclaim "nfs" created +``` + +A `PersistentVolume` is provisioned for the `PersistentVolumeClaim`. Now the claim can be consumed by some pod(s) and the backing NFS storage read from or written to. +```console +$ kubectl get pv +NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM REASON AGE +pvc-dce84888-7a9d-11e6-b1ee-5254001e0c1b 1Mi RWX Delete Bound default/nfs 23s +``` + +Deleting the `PersistentVolumeClaim` will cause the provisioner to delete the `PersistentVolume` and its data. + +Deleting the provisioner deployment will cause any outstanding `PersistentVolumes` to become unusable for as long as the provisioner is gone. + +## Running +Go [here](./docs/demo) for a demo of how to run nfs-provisioner. You may also/instead want to read the (dryer but more detailed) following docs. + +To authorize nfs-provisioner on a Kubernetes cluster (only if you have RBAC and/or PSP enabled or are running OpenShift) see [Authorization](docs/authorization.md). + +To deploy nfs-provisioner on a Kubernetes cluster see [Deployment](docs/deployment.md). + +To use nfs-provisioner once it is deployed see [Usage](docs/usage.md). + +For information on running multiple instances of nfs-provisioner see [Running Multiple Provisioners](docs/multiple.md). + +## Writing your own +Go [here](../docs/demo/hostpath-provisioner) for an example of how to write your own out-of-tree dynamic provisioner. + +## Roadmap +This is still alpha/experimental and will change to reflect the [out-of-tree dynamic provisioner proposal](https://github.com/kubernetes/kubernetes/pull/30285) + +November +* Create a process for releasing (to Docker Hub, etc.) +* Release 0.1 for kubernetes 1.5 +* Support using the controller as a library +* Support running the provisioner as a StatefulSet + +December +* Prevent multiple provisioners from racing to provision where possible (in a StatefulSet or DaemonSet) +* Add configurable retries for failed provisioning and deleting + +## 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: #sig-storage + +## Kubernetes Incubator + +This is a [Kubernetes Incubator project](https://github.com/kubernetes/community/blob/master/incubator.md). The project was established 2016-11-15. The incubator team for the project is: + +- Sponsor: Clayton (@smarterclayton) +- Champion: Brad (@childsb) +- SIG: sig-storage + +### Code of conduct + +Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md). diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/cmd/nfs-provisioner/main.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/cmd/nfs-provisioner/main.go new file mode 100644 index 00000000..ce1d3476 --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/cmd/nfs-provisioner/main.go @@ -0,0 +1,137 @@ +/* +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 main + +import ( + "flag" + "strings" + "time" + + "github.com/golang/glog" + "github.com/kubernetes-incubator/external-storage/lib/controller" + "github.com/kubernetes-incubator/external-storage/lib/leaderelection" + "github.com/kubernetes-incubator/external-storage/nfs/pkg/server" + vol "github.com/kubernetes-incubator/external-storage/nfs/pkg/volume" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/pkg/util/validation" + "k8s.io/client-go/pkg/util/validation/field" + "k8s.io/client-go/pkg/util/wait" + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/clientcmd" +) + +var ( + provisioner = flag.String("provisioner", "example.com/nfs", "Name of the provisioner. The provisioner will only provision volumes for claims that request a StorageClass with a provisioner field set equal to this name.") + master = flag.String("master", "", "Master URL to build a client config from. Either this or kubeconfig needs to be set if the provisioner is being run out of cluster.") + kubeconfig = flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Either this or master needs to be set if the provisioner is being run out of cluster.") + runServer = flag.Bool("run-server", true, "If the provisioner is responsible for running the NFS server, i.e. starting and stopping NFS Ganesha. Default true.") + useGanesha = flag.Bool("use-ganesha", true, "If the provisioner will create volumes using NFS Ganesha (D-Bus method calls) as opposed to using the kernel NFS server ('exportfs'). If run-server is true, this must be true. Default true.") + gracePeriod = flag.Uint("grace-period", 90, "NFS Ganesha grace period to use in seconds, from 0-180. If the server is not expected to survive restarts, i.e. it is running as a pod & its export directory is not persisted, this can be set to 0. Can only be set if both run-server and use-ganesha are true. Default 90.") + rootSquash = flag.Bool("root-squash", false, "If the provisioner will squash root users by adding the NFS Ganesha root_id_squash or kernel root_squash option to each export. Default false.") + enableXfsQuota = flag.Bool("enable-xfs-quota", false, "If the provisioner will set xfs quotas for each volume it provisions. Requires that the directory it creates volumes in ('/export') is xfs mounted with option prjquota/pquota, and that it has the privilege to run xfs_quota. Default false.") + failedRetryThreshold = flag.Int("failed-retry-threshold", 10, "If the number of retries on provisioning failure need to be limited to a set number of attempts. Default 10") + serverHostname = flag.String("server-hostname", "", "The hostname for the NFS server to export from. Only applicable when running out-of-cluster i.e. it can only be set if either master or kubeconfig are set. If unset, the first IP output by `hostname -i` is used.") +) + +const ( + exportDir = "/export" + ganeshaConfig = "/export/vfs.conf" + leasePeriod = leaderelection.DefaultLeaseDuration + retryPeriod = leaderelection.DefaultRetryPeriod + renewDeadline = leaderelection.DefaultRenewDeadline + termLimit = leaderelection.DefaultTermLimit +) + +func main() { + flag.Set("logtostderr", "true") + flag.Parse() + + if errs := validateProvisioner(*provisioner, field.NewPath("provisioner")); len(errs) != 0 { + glog.Fatalf("Invalid provisioner specified: %v", errs) + } + glog.Infof("Provisioner %s specified", *provisioner) + + if *runServer && !*useGanesha { + glog.Fatalf("Invalid flags specified: if run-server is true, use-ganesha must also be true.") + } + + if *gracePeriod != 90 && (!*runServer || !*useGanesha) { + glog.Fatalf("Invalid flags specified: custom grace period can only be set if both run-server and use-ganesha are true.") + } else if *gracePeriod > 180 && *runServer && *useGanesha { + glog.Fatalf("Invalid flags specified: custom grace period must be in the range 0-180") + } + + // Create the client according to whether we are running in or out-of-cluster + outOfCluster := *master != "" || *kubeconfig != "" + + if !outOfCluster && *serverHostname != "" { + glog.Fatalf("Invalid flags specified: if server-hostname is set, either master or kube-config must also be set.") + } + + if *runServer { + glog.Infof("Starting NFS server!") + err := server.Start(ganeshaConfig, *gracePeriod) + if err != nil { + glog.Fatalf("Error starting NFS server: %v", err) + } + } + + var config *rest.Config + var err error + if outOfCluster { + config, err = clientcmd.BuildConfigFromFlags(*master, *kubeconfig) + } else { + config, err = rest.InClusterConfig() + } + if err != nil { + glog.Fatalf("Failed to create config: %v", err) + } + clientset, err := kubernetes.NewForConfig(config) + if err != nil { + glog.Fatalf("Failed to create client: %v", err) + } + + // The controller needs to know what the server version is because out-of-tree + // provisioners aren't officially supported until 1.5 + serverVersion, err := clientset.Discovery().ServerVersion() + if err != nil { + glog.Fatalf("Error getting server version: %v", err) + } + + // Create the provisioner: it implements the Provisioner interface expected by + // the controller + nfsProvisioner := vol.NewNFSProvisioner(exportDir, clientset, outOfCluster, *useGanesha, ganeshaConfig, *rootSquash, *enableXfsQuota, *serverHostname) + + // Start the provision controller which will dynamically provision NFS PVs + pc := controller.NewProvisionController(clientset, 15*time.Second, *provisioner, nfsProvisioner, serverVersion.GitVersion, false, *failedRetryThreshold, leasePeriod, renewDeadline, retryPeriod, termLimit) + pc.Run(wait.NeverStop) +} + +// validateProvisioner tests if provisioner is a valid qualified name. +// https://github.com/kubernetes/kubernetes/blob/release-1.4/pkg/apis/storage/validation/validation.go +func validateProvisioner(provisioner string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if len(provisioner) == 0 { + allErrs = append(allErrs, field.Required(fldPath, provisioner)) + } + if len(provisioner) > 0 { + for _, msg := range validation.IsQualifiedName(strings.ToLower(provisioner)) { + allErrs = append(allErrs, field.Invalid(fldPath, provisioner, msg)) + } + } + return allErrs +} diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/server/server.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/server/server.go new file mode 100644 index 00000000..93fe7fa8 --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/server/server.go @@ -0,0 +1,203 @@ +/* +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 server + +import ( + "fmt" + "io/ioutil" + "os" + "os/exec" + "regexp" + "strings" +) + +var defaultGaneshaConfigContents = []byte(` +################################################### +# +# EXPORT +# +# To function, all that is required is an EXPORT +# +# Define the absolute minimal export +# +################################################### + +EXPORT +{ + # Export Id (mandatory, each EXPORT must have a unique Export_Id) + Export_Id = 0; + + # Exported path (mandatory) + Path = /nonexistent; + + # Pseudo Path (required for NFS v4) + Pseudo = /nonexistent; + + # Required for access (default is None) + # Could use CLIENT blocks instead + Access_Type = RW; + + # Exporting FSAL + FSAL { + Name = VFS; + } +} + +NFS_Core_Param +{ + MNT_Port = 20048; + fsid_device = true; +} + +NFSV4 +{ + Grace_Period = 90; +} +`) + +// Start starts the NFS server. If an error is encountered at any point it returns it instantly +func Start(ganeshaConfig string, gracePeriod uint) error { + // Start rpcbind if it is not started yet + cmd := exec.Command("/usr/sbin/rpcinfo", "127.0.0.1") + if err := cmd.Run(); err != nil { + cmd := exec.Command("/usr/sbin/rpcbind", "-w") + if out, err := cmd.CombinedOutput(); err != nil { + return fmt.Errorf("Starting rpcbind failed with error: %v, output: %s", err, out) + } + } + + cmd = exec.Command("/usr/sbin/rpc.statd") + if out, err := cmd.CombinedOutput(); err != nil { + return fmt.Errorf("rpc.statd failed with error: %v, output: %s", err, out) + } + + // Start dbus, needed for ganesha dynamic exports + cmd = exec.Command("dbus-daemon", "--system") + if out, err := cmd.CombinedOutput(); err != nil { + return fmt.Errorf("dbus-daemon failed with error: %v, output: %s", err, out) + } + + // Use defaultGaneshaConfigContents if the ganeshaConfig doesn't exist yet + if _, err := os.Stat(ganeshaConfig); os.IsNotExist(err) { + err = ioutil.WriteFile(ganeshaConfig, defaultGaneshaConfigContents, 0600) + if err != nil { + return fmt.Errorf("error writing ganesha config %s: %v", ganeshaConfig, err) + } + } + err := setGracePeriod(ganeshaConfig, gracePeriod) + if err != nil { + return fmt.Errorf("error setting grace period to ganesha config: %v", err) + } + err = setFsidDevice(ganeshaConfig, true) + if err != nil { + return fmt.Errorf("error setting fsid device to ganesha config: %v", err) + } + // Start ganesha.nfsd + cmd = exec.Command("ganesha.nfsd", "-L", "/var/log/ganesha.log", "-f", ganeshaConfig) + if out, err := cmd.CombinedOutput(); err != nil { + return fmt.Errorf("ganesha.nfsd failed with error: %v, output: %s", err, out) + } + + return nil +} + +func setFsidDevice(ganeshaConfig string, fsidDevice bool) error { + newLine := fmt.Sprintf("fsid_device = %t;", fsidDevice) + + re := regexp.MustCompile("fsid_device = (true|false);") + + read, err := ioutil.ReadFile(ganeshaConfig) + if err != nil { + return err + } + + oldLine := re.Find(read) + + if oldLine == nil { + // fsid_device line not there, append it after MNT_Port + re := regexp.MustCompile("MNT_Port = 20048;") + + mntPort := re.Find(read) + + block := "MNT_Port = 20048;\n" + + "\t" + newLine + + replaced := strings.Replace(string(read), string(mntPort), block, -1) + err = ioutil.WriteFile(ganeshaConfig, []byte(replaced), 0) + if err != nil { + return err + } + } else { + // fsid_device there, just replace it + replaced := strings.Replace(string(read), string(oldLine), newLine, -1) + err = ioutil.WriteFile(ganeshaConfig, []byte(replaced), 0) + if err != nil { + return err + } + } + + return nil +} + +func setGracePeriod(ganeshaConfig string, gracePeriod uint) error { + if gracePeriod > 180 { + return fmt.Errorf("grace period cannot be greater than 180") + } + + newLine := fmt.Sprintf("Grace_Period = %d;", gracePeriod) + + re := regexp.MustCompile("Grace_Period = [0-9]+;") + + read, err := ioutil.ReadFile(ganeshaConfig) + if err != nil { + return err + } + + oldLine := re.Find(read) + + if oldLine == nil { + // Grace_Period line not there, append the whole NFSV4 block. + file, err := os.OpenFile(ganeshaConfig, os.O_APPEND|os.O_WRONLY, 0600) + if err != nil { + return err + } + defer file.Close() + + block := "\nNFSV4\n{\n" + + "\t" + newLine + "\n" + + "}\n" + + if _, err = file.WriteString(block); err != nil { + return err + } + file.Sync() + } else { + // Grace_Period line there, just replace it + replaced := strings.Replace(string(read), string(oldLine), newLine, -1) + err = ioutil.WriteFile(ganeshaConfig, []byte(replaced), 0) + if err != nil { + return err + } + } + + return nil +} + +// Stop stops the NFS server. +func Stop() { + // /bin/dbus-send --system --dest=org.ganesha.nfsd --type=method_call /org/ganesha/nfsd/admin org.ganesha.nfsd.admin.shutdown +} diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/delete.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/delete.go new file mode 100644 index 00000000..a02dc4a3 --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/delete.go @@ -0,0 +1,130 @@ +/* +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 volume + +import ( + "fmt" + "os" + "path" + "strconv" + + "github.com/kubernetes-incubator/external-storage/lib/controller" + "k8s.io/client-go/pkg/api/v1" +) + +// Delete removes the directory that was created by Provision backing the given +// PV and removes its export from the NFS server. +func (p *nfsProvisioner) Delete(volume *v1.PersistentVolume) error { + // Ignore the call if this provisioner was not the one to provision the + // volume. It doesn't even attempt to delete it, so it's neither a success + // (nil error) nor failure (any other error) + provisioned, err := p.provisioned(volume) + if err != nil { + return fmt.Errorf("error determining if this provisioner was the one to provision volume %q: %v", volume.Name, err) + } + if !provisioned { + strerr := fmt.Sprintf("this provisioner id %s didn't provision volume %q and so can't delete it; id %s did & can", p.identity, volume.Name, volume.Annotations[annProvisionerID]) + return &controller.IgnoredError{Reason: strerr} + } + + err = p.deleteDirectory(volume) + if err != nil { + return fmt.Errorf("error deleting volume's backing path: %v", err) + } + + err = p.deleteExport(volume) + if err != nil { + return fmt.Errorf("deleted the volume's backing path but error deleting export: %v", err) + } + + err = p.deleteQuota(volume) + if err != nil { + return fmt.Errorf("deleted the volume's backing path & export but error deleting quota: %v", err) + } + + return nil +} + +func (p *nfsProvisioner) provisioned(volume *v1.PersistentVolume) (bool, error) { + provisionerID, ok := volume.Annotations[annProvisionerID] + if !ok { + return false, fmt.Errorf("PV doesn't have an annotation %s", annProvisionerID) + } + + return provisionerID == string(p.identity), nil +} + +func (p *nfsProvisioner) deleteDirectory(volume *v1.PersistentVolume) error { + path := path.Join(p.exportDir, volume.ObjectMeta.Name) + if _, err := os.Stat(path); os.IsNotExist(err) { + return nil + } + if err := os.RemoveAll(path); err != nil { + return err + } + + return nil +} + +func (p *nfsProvisioner) deleteExport(volume *v1.PersistentVolume) error { + block, exportID, err := getBlockAndID(volume, annExportBlock, annExportID) + if err != nil { + return fmt.Errorf("error getting block &/or id from annotations: %v", err) + } + + if err := p.exporter.RemoveExportBlock(block, uint16(exportID)); err != nil { + return fmt.Errorf("error removing the export from the config file: %v", err) + } + + if err := p.exporter.Unexport(volume); err != nil { + return fmt.Errorf("removed export from the config file but error unexporting it: %v", err) + } + + return nil +} + +func (p *nfsProvisioner) deleteQuota(volume *v1.PersistentVolume) error { + block, projectID, err := getBlockAndID(volume, annProjectBlock, annProjectID) + if err != nil { + return fmt.Errorf("error getting block &/or id from annotations: %v", err) + } + + if err := p.quotaer.RemoveProject(block, uint16(projectID)); err != nil { + return fmt.Errorf("error removing the quota project from the projects file: %v", err) + } + + if err := p.quotaer.UnsetQuota(); err != nil { + return fmt.Errorf("removed quota project from the project file but error unsetting the quota: %v", err) + } + + return nil +} + +func getBlockAndID(volume *v1.PersistentVolume, annBlock, annID string) (string, uint16, error) { + block, ok := volume.Annotations[annBlock] + if !ok { + return "", 0, fmt.Errorf("PV doesn't have an annotation with key %s", annBlock) + } + + idStr, ok := volume.Annotations[annID] + if !ok { + return "", 0, fmt.Errorf("PV doesn't have an annotation %s", annID) + } + id, _ := strconv.ParseUint(idStr, 10, 16) + + return block, uint16(id), nil +} diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/export.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/export.go new file mode 100644 index 00000000..5bcb6e3d --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/export.go @@ -0,0 +1,216 @@ +/* +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 volume + +import ( + "fmt" + "os" + "os/exec" + "regexp" + "strconv" + "sync" + + "github.com/golang/glog" + "github.com/guelfey/go.dbus" + "k8s.io/client-go/pkg/api/v1" +) + +type exporter interface { + AddExportBlock(string) (string, uint16, error) + RemoveExportBlock(string, uint16) error + Export(string) error + Unexport(*v1.PersistentVolume) error +} + +type exportBlockCreator interface { + CreateExportBlock(string, string) string +} + +type genericExporter struct { + ebc exportBlockCreator + config string + + // Map to track used exportIDs. Each ganesha export needs a unique fsid and + // Export_Id, each kernel a unique fsid. Assign each export an exportID and + // use it as both fsid and Export_Id. + exportIDs map[uint16]bool + + mapMutex *sync.Mutex + fileMutex *sync.Mutex +} + +func newGenericExporter(ebc exportBlockCreator, config string, re *regexp.Regexp) *genericExporter { + if _, err := os.Stat(config); os.IsNotExist(err) { + glog.Fatalf("config %s does not exist!", config) + } + + exportIDs, err := getExistingIDs(config, re) + if err != nil { + glog.Errorf("error while populating exportIDs map, there may be errors exporting later if exportIDs are reused: %v", err) + } + return &genericExporter{ + ebc: ebc, + config: config, + exportIDs: exportIDs, + mapMutex: &sync.Mutex{}, + fileMutex: &sync.Mutex{}, + } +} + +func (e *genericExporter) AddExportBlock(path string) (string, uint16, error) { + exportID := generateID(e.mapMutex, e.exportIDs) + exportIDStr := strconv.FormatUint(uint64(exportID), 10) + + block := e.ebc.CreateExportBlock(exportIDStr, path) + + // Add the export block to the config file + if err := addToFile(e.fileMutex, e.config, block); err != nil { + deleteID(e.mapMutex, e.exportIDs, exportID) + return "", 0, fmt.Errorf("error adding export block %s to config %s: %v", block, e.config, err) + } + return block, exportID, nil +} + +func (e *genericExporter) RemoveExportBlock(block string, exportID uint16) error { + deleteID(e.mapMutex, e.exportIDs, exportID) + return removeFromFile(e.fileMutex, e.config, block) +} + +type ganeshaExporter struct { + genericExporter +} + +var _ exporter = &ganeshaExporter{} + +func newGaneshaExporter(ganeshaConfig string, rootSquash bool) exporter { + return &ganeshaExporter{ + genericExporter: *newGenericExporter(&ganeshaExportBlockCreator{rootSquash}, ganeshaConfig, regexp.MustCompile("Export_Id = ([0-9]+);")), + } +} + +// Export exports the given directory using NFS Ganesha, assuming it is running +// and can be connected to using D-Bus. +func (e *ganeshaExporter) Export(path string) error { + // Call AddExport using dbus + conn, err := dbus.SystemBus() + if err != nil { + return fmt.Errorf("error getting dbus session bus: %v", err) + } + obj := conn.Object("org.ganesha.nfsd", "/org/ganesha/nfsd/ExportMgr") + call := obj.Call("org.ganesha.nfsd.exportmgr.AddExport", 0, e.config, fmt.Sprintf("export(path = %s)", path)) + if call.Err != nil { + return fmt.Errorf("error calling org.ganesha.nfsd.exportmgr.AddExport: %v", call.Err) + } + + return nil +} + +func (e *ganeshaExporter) Unexport(volume *v1.PersistentVolume) error { + ann, ok := volume.Annotations[annExportID] + if !ok { + return fmt.Errorf("PV doesn't have an annotation %s, can't remove the export from the server", annExportID) + } + exportID, _ := strconv.ParseUint(ann, 10, 16) + + // Call RemoveExport using dbus + conn, err := dbus.SystemBus() + if err != nil { + return fmt.Errorf("error getting dbus session bus: %v", err) + } + obj := conn.Object("org.ganesha.nfsd", "/org/ganesha/nfsd/ExportMgr") + call := obj.Call("org.ganesha.nfsd.exportmgr.RemoveExport", 0, uint16(exportID)) + if call.Err != nil { + return fmt.Errorf("error calling org.ganesha.nfsd.exportmgr.RemoveExport: %v", call.Err) + } + + return nil +} + +type ganeshaExportBlockCreator struct { + // Whether to export with squash = root_id_squash, not no_root_squash + rootSquash bool +} + +var _ exportBlockCreator = &ganeshaExportBlockCreator{} + +// CreateBlock creates the text block to add to the ganesha config file. +func (e *ganeshaExportBlockCreator) CreateExportBlock(exportID, path string) string { + squash := "no_root_squash" + if e.rootSquash { + squash = "root_id_squash" + } + return "\nEXPORT\n{\n" + + "\tExport_Id = " + exportID + ";\n" + + "\tPath = " + path + ";\n" + + "\tPseudo = " + path + ";\n" + + "\tAccess_Type = RW;\n" + + "\tSquash = " + squash + ";\n" + + "\tSecType = sys;\n" + + "\tFilesystem_id = " + exportID + "." + exportID + ";\n" + + "\tFSAL {\n\t\tName = VFS;\n\t}\n}\n" +} + +type kernelExporter struct { + genericExporter +} + +var _ exporter = &kernelExporter{} + +func newKernelExporter(rootSquash bool) exporter { + return &kernelExporter{ + genericExporter: *newGenericExporter(&kernelExportBlockCreator{rootSquash}, "/etc/exports", regexp.MustCompile("fsid=([0-9]+)")), + } +} + +// Export exports all directories listed in /etc/exports +func (e *kernelExporter) Export(_ string) error { + // Execute exportfs + cmd := exec.Command("exportfs", "-r") + out, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("exportfs -r failed with error: %v, output: %s", err, out) + } + + return nil +} + +func (e *kernelExporter) Unexport(volume *v1.PersistentVolume) error { + // Execute exportfs + cmd := exec.Command("exportfs", "-r") + out, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("exportfs -r failed with error: %v, output: %s", err, out) + } + + return nil +} + +type kernelExportBlockCreator struct { + // Whether to export with option root_squash, not no_root_squash + rootSquash bool +} + +var _ exportBlockCreator = &kernelExportBlockCreator{} + +// CreateBlock creates the text block to add to the /etc/exports file. +func (e *kernelExportBlockCreator) CreateExportBlock(exportID, path string) string { + squash := "no_root_squash" + if e.rootSquash { + squash = "root_squash" + } + return "\n" + path + " *(rw,insecure," + squash + ",fsid=" + exportID + ")\n" +} diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/provision.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/provision.go new file mode 100644 index 00000000..79fea74c --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/provision.go @@ -0,0 +1,453 @@ +/* +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 volume + +import ( + "fmt" + "io/ioutil" + "os" + "os/exec" + "path" + "reflect" + "strconv" + "strings" + "syscall" + + "github.com/golang/glog" + "github.com/kubernetes-incubator/external-storage/lib/controller" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/pkg/api/resource" + "k8s.io/client-go/pkg/api/v1" + "k8s.io/client-go/pkg/types" + "k8s.io/client-go/pkg/util/uuid" +) + +const ( + // Name of the file where an nfsProvisioner will store its identity + identityFile = "nfs-provisioner.identity" + + // are we allowed to set this? else make up our own + annCreatedBy = "kubernetes.io/createdby" + createdBy = "nfs-dynamic-provisioner" + + // A PV annotation for the entire ganesha EXPORT block or /etc/exports + // block, needed for deletion. + annExportBlock = "EXPORT_block" + // A PV annotation for the exportID of this PV's backing ganesha/kernel export + // , needed for ganesha deletion and used for deleting the entry in exportIDs + // map so the id can be reassigned. + annExportID = "Export_Id" + + // A PV annotation for the project quota info block, needed for quota + // deletion. + annProjectBlock = "Project_block" + // A PV annotation for the project quota id, needed for quota deletion + annProjectID = "Project_Id" + + // VolumeGidAnnotationKey is the key of the annotation on the PersistentVolume + // object that specifies a supplemental GID. + VolumeGidAnnotationKey = "pv.beta.kubernetes.io/gid" + + // A PV annotation for the identity of the nfsProvisioner that provisioned it + annProvisionerID = "Provisioner_Id" + + podIPEnv = "POD_IP" + serviceEnv = "SERVICE_NAME" + namespaceEnv = "POD_NAMESPACE" + nodeEnv = "NODE_NAME" +) + +// NewNFSProvisioner creates a Provisioner that provisions NFS PVs backed by +// the given directory. +func NewNFSProvisioner(exportDir string, client kubernetes.Interface, outOfCluster bool, useGanesha bool, ganeshaConfig string, rootSquash bool, enableXfsQuota bool, serverHostname string) controller.Provisioner { + var exporter exporter + if useGanesha { + exporter = newGaneshaExporter(ganeshaConfig, rootSquash) + } else { + exporter = newKernelExporter(rootSquash) + } + var quotaer quotaer + var err error + if enableXfsQuota { + quotaer, err = newXfsQuotaer(exportDir) + if err != nil { + glog.Fatalf("Error creating xfs quotaer! %v", err) + } + } else { + quotaer = newDummyQuotaer() + } + return newNFSProvisionerInternal(exportDir, client, outOfCluster, exporter, quotaer, serverHostname) +} + +func newNFSProvisionerInternal(exportDir string, client kubernetes.Interface, outOfCluster bool, exporter exporter, quotaer quotaer, serverHostname string) *nfsProvisioner { + if _, err := os.Stat(exportDir); os.IsNotExist(err) { + glog.Fatalf("exportDir %s does not exist!", exportDir) + } + + var identity types.UID + identityPath := path.Join(exportDir, identityFile) + if _, err := os.Stat(identityPath); os.IsNotExist(err) { + identity = uuid.NewUUID() + err := ioutil.WriteFile(identityPath, []byte(identity), 0600) + if err != nil { + glog.Fatalf("Error writing identity file %s! %v", identityPath, err) + } + } else { + read, err := ioutil.ReadFile(identityPath) + if err != nil { + glog.Fatalf("Error reading identity file %s! %v", identityPath, err) + } + identity = types.UID(strings.TrimSpace(string(read))) + } + + provisioner := &nfsProvisioner{ + exportDir: exportDir, + client: client, + outOfCluster: outOfCluster, + exporter: exporter, + quotaer: quotaer, + serverHostname: serverHostname, + identity: identity, + podIPEnv: podIPEnv, + serviceEnv: serviceEnv, + namespaceEnv: namespaceEnv, + nodeEnv: nodeEnv, + } + + return provisioner +} + +type nfsProvisioner struct { + // The directory to create PV-backing directories in + exportDir string + + // Client, needed for getting a service cluster IP to put as the NFS server of + // provisioned PVs + client kubernetes.Interface + + // Whether the provisioner is running out of cluster and so cannot rely on + // the existence of any of the pod, service, namespace, node env variables. + outOfCluster bool + + // The exporter to use for exporting NFS shares + exporter exporter + + // The quotaer to use for setting per-share/directory/project quotas + quotaer quotaer + + // The hostname for the NFS server to export from. Only applicable when + // running as a Docker container + serverHostname string + + // Identity of this nfsProvisioner, generated & persisted to exportDir or + // recovered from there. Used to mark provisioned PVs + identity types.UID + + // Environment variables the provisioner pod needs valid values for in order to + // put a service cluster IP as the server of provisioned NFS PVs, passed in + // via downward API. If serviceEnv is set, namespaceEnv must be too. + podIPEnv string + serviceEnv string + namespaceEnv string + nodeEnv string +} + +var _ controller.Provisioner = &nfsProvisioner{} + +// Provision creates a volume i.e. the storage asset and returns a PV object for +// the volume. +func (p *nfsProvisioner) Provision(options controller.VolumeOptions) (*v1.PersistentVolume, error) { + server, path, supGroup, exportBlock, exportID, projectBlock, projectID, err := p.createVolume(options) + if err != nil { + return nil, err + } + + annotations := make(map[string]string) + annotations[annCreatedBy] = createdBy + annotations[annExportBlock] = exportBlock + annotations[annExportID] = strconv.FormatUint(uint64(exportID), 10) + annotations[annProjectBlock] = projectBlock + annotations[annProjectID] = strconv.FormatUint(uint64(projectID), 10) + if supGroup != 0 { + annotations[VolumeGidAnnotationKey] = strconv.FormatUint(supGroup, 10) + } + annotations[annProvisionerID] = string(p.identity) + + pv := &v1.PersistentVolume{ + ObjectMeta: v1.ObjectMeta{ + Name: options.PVName, + Labels: map[string]string{}, + Annotations: annotations, + }, + Spec: v1.PersistentVolumeSpec{ + PersistentVolumeReclaimPolicy: options.PersistentVolumeReclaimPolicy, + AccessModes: options.PVC.Spec.AccessModes, + Capacity: v1.ResourceList{ + v1.ResourceName(v1.ResourceStorage): options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)], + }, + PersistentVolumeSource: v1.PersistentVolumeSource{ + NFS: &v1.NFSVolumeSource{ + Server: server, + Path: path, + ReadOnly: false, + }, + }, + }, + } + + return pv, nil +} + +// createVolume creates a volume i.e. the storage asset. It creates a unique +// directory under /export and exports it. Returns the server IP, the path, a +// zero/non-zero supplemental group, the block it added to either the ganesha +// config or /etc/exports, and the exportID +// TODO return values +func (p *nfsProvisioner) createVolume(options controller.VolumeOptions) (string, string, uint64, string, uint16, string, uint16, error) { + gid, err := p.validateOptions(options) + if err != nil { + return "", "", 0, "", 0, "", 0, fmt.Errorf("error validating options for volume: %v", err) + } + + server, err := p.getServer() + if err != nil { + return "", "", 0, "", 0, "", 0, fmt.Errorf("error getting NFS server IP for volume: %v", err) + } + + path := path.Join(p.exportDir, options.PVName) + + err = p.createDirectory(options.PVName, gid) + if err != nil { + return "", "", 0, "", 0, "", 0, fmt.Errorf("error creating directory for volume: %v", err) + } + + exportBlock, exportID, err := p.createExport(options.PVName) + if err != nil { + os.RemoveAll(path) + return "", "", 0, "", 0, "", 0, fmt.Errorf("error creating export for volume: %v", err) + } + + projectBlock, projectID, err := p.createQuota(options.PVName, options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)]) + if err != nil { + os.RemoveAll(path) + return "", "", 0, "", 0, "", 0, fmt.Errorf("error creating quota for volume: %v", err) + } + + return server, path, 0, exportBlock, exportID, projectBlock, projectID, nil +} + +func (p *nfsProvisioner) validateOptions(options controller.VolumeOptions) (string, error) { + gid := "none" + for k, v := range options.Parameters { + switch strings.ToLower(k) { + case "gid": + if strings.ToLower(v) == "none" { + gid = "none" + } else if i, err := strconv.ParseUint(v, 10, 64); err == nil && i != 0 { + gid = v + } else { + return "", fmt.Errorf("invalid value for parameter gid: %v. valid values are: 'none' or a non-zero integer", v) + } + default: + return "", fmt.Errorf("invalid parameter: %q", k) + } + } + + // TODO implement options.ProvisionerSelector parsing + // pv.Labels MUST be set to match claim.spec.selector + // gid selector? with or without pv annotation? + if options.PVC.Spec.Selector != nil { + return "", fmt.Errorf("claim.Spec.Selector is not supported") + } + + var stat syscall.Statfs_t + if err := syscall.Statfs(p.exportDir, &stat); err != nil { + return "", fmt.Errorf("error calling statfs on %v: %v", p.exportDir, err) + } + capacity := options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] + requestBytes := capacity.Value() + available := int64(stat.Bavail) * int64(stat.Bsize) + if requestBytes > available { + return "", fmt.Errorf("insufficient available space %v bytes to satisfy claim for %v bytes", available, requestBytes) + } + + return gid, nil +} + +// getServer gets the server IP to put in a provisioned PV's spec. +func (p *nfsProvisioner) getServer() (string, error) { + if p.outOfCluster { + if p.serverHostname != "" { + return p.serverHostname, nil + } + // TODO make this better + out, err := exec.Command("hostname", "-i").Output() + if err != nil { + return "", fmt.Errorf("hostname -i failed with error: %v, output: %s", err, out) + } + addresses := strings.Fields(string(out)) + if len(addresses) > 0 { + return addresses[0], nil + } + return "", fmt.Errorf("hostname -i had bad output %s, no address to use", string(out)) + } + + nodeName := os.Getenv(p.nodeEnv) + if nodeName != "" { + glog.Infof("using node name %s=%s as NFS server IP", p.nodeEnv, nodeName) + return nodeName, nil + } + + podIP := os.Getenv(p.podIPEnv) + if podIP == "" { + return "", fmt.Errorf("pod IP env %s must be set even if intent is to use service cluster IP as NFS server IP", p.podIPEnv) + } + + serviceName := os.Getenv(p.serviceEnv) + if serviceName == "" { + glog.Infof("using potentially unstable pod IP %s=%s as NFS server IP (because neither service env %s nor node env %s are set)", p.podIPEnv, podIP, p.serviceEnv, p.nodeEnv) + return podIP, nil + } + + // Service env was set, now find and validate it + namespace := os.Getenv(p.namespaceEnv) + if namespace == "" { + return "", fmt.Errorf("service env %s is set but namespace env %s isn't; no way to get the service cluster IP", p.serviceEnv, p.namespaceEnv) + } + service, err := p.client.Core().Services(namespace).Get(serviceName) + if err != nil { + return "", fmt.Errorf("error getting service %s=%s in namespace %s=%s", p.serviceEnv, serviceName, p.namespaceEnv, namespace) + } + + // Do some validation of the service before provisioning useless volumes + valid := false + type endpointPort struct { + port int32 + protocol v1.Protocol + } + expectedPorts := map[endpointPort]bool{ + endpointPort{2049, v1.ProtocolTCP}: true, + endpointPort{20048, v1.ProtocolTCP}: true, + endpointPort{111, v1.ProtocolUDP}: true, + endpointPort{111, v1.ProtocolTCP}: true, + } + endpoints, err := p.client.Core().Endpoints(namespace).Get(serviceName) + for _, subset := range endpoints.Subsets { + if len(subset.Addresses) != 1 { + continue + } + if subset.Addresses[0].IP != podIP { + continue + } + actualPorts := make(map[endpointPort]bool) + for _, port := range subset.Ports { + actualPorts[endpointPort{port.Port, port.Protocol}] = true + } + if !reflect.DeepEqual(expectedPorts, actualPorts) { + continue + } + valid = true + break + } + if !valid { + return "", fmt.Errorf("service %s=%s is not valid; check that it has for ports %v one endpoint, this pod's IP %s=%s", p.serviceEnv, serviceName, expectedPorts, p.podIPEnv, podIP) + } + if service.Spec.ClusterIP == v1.ClusterIPNone { + return "", fmt.Errorf("service %s=%s is valid but it doesn't have a cluster IP", p.serviceEnv, serviceName) + } + + glog.Infof("using service %s=%s cluster IP %s as NFS server IP", p.serviceEnv, serviceName, service.Spec.ClusterIP) + return service.Spec.ClusterIP, nil +} + +// createDirectory creates the given directory in exportDir with appropriate +// permissions and ownership according to the given gid parameter string. +func (p *nfsProvisioner) createDirectory(directory, gid string) error { + // TODO quotas + path := path.Join(p.exportDir, directory) + if _, err := os.Stat(path); !os.IsNotExist(err) { + return fmt.Errorf("the path already exists") + } + + perm := os.FileMode(0777) + if gid != "none" { + // Execute permission is required for stat, which kubelet uses during unmount. + perm = os.FileMode(0071) + } + if err := os.MkdirAll(path, perm); err != nil { + return err + } + // Due to umask, need to chmod + cmd := exec.Command("chmod", strconv.FormatInt(int64(perm), 8), path) + out, err := cmd.CombinedOutput() + if err != nil { + os.RemoveAll(path) + return fmt.Errorf("chmod failed with error: %v, output: %s", err, out) + } + + if gid != "none" { + groupID, _ := strconv.ParseUint(gid, 10, 64) + cmd = exec.Command("chgrp", strconv.FormatUint(groupID, 10), path) + out, err = cmd.CombinedOutput() + if err != nil { + os.RemoveAll(path) + return fmt.Errorf("chgrp failed with error: %v, output: %s", err, out) + } + } + + return nil +} + +// createExport creates the export by adding a block to the appropriate config +// file and exporting it +func (p *nfsProvisioner) createExport(directory string) (string, uint16, error) { + path := path.Join(p.exportDir, directory) + + block, exportID, err := p.exporter.AddExportBlock(path) + if err != nil { + return "", 0, fmt.Errorf("error adding export block for path %s: %v", path, err) + } + + err = p.exporter.Export(path) + if err != nil { + p.exporter.RemoveExportBlock(block, exportID) + return "", 0, fmt.Errorf("error exporting export block %s: %v", block, err) + } + + return block, exportID, nil +} + +// createQuota creates a quota for the directory by adding a project to +// represent the directory and setting a quota on it +func (p *nfsProvisioner) createQuota(directory string, capacity resource.Quantity) (string, uint16, error) { + path := path.Join(p.exportDir, directory) + + limit := strconv.FormatInt(capacity.Value(), 10) + + block, projectID, err := p.quotaer.AddProject(path, limit) + if err != nil { + return "", 0, fmt.Errorf("error adding project for path %s: %v", path, err) + } + + err = p.quotaer.SetQuota(projectID, path, limit) + if err != nil { + p.quotaer.RemoveProject(block, projectID) + return "", 0, fmt.Errorf("error setting quota for path %s: %v", path, err) + } + + return block, projectID, nil +} diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/quota.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/quota.go new file mode 100644 index 00000000..4481ae27 --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/quota.go @@ -0,0 +1,236 @@ +/* +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 volume + +import ( + "fmt" + "io/ioutil" + "os" + "os/exec" + "path" + "regexp" + "strconv" + "strings" + "sync" + + "github.com/docker/docker/pkg/mount" + "github.com/golang/glog" +) + +type quotaer interface { + AddProject(string, string) (string, uint16, error) + RemoveProject(string, uint16) error + SetQuota(uint16, string, string) error + UnsetQuota() error +} + +type xfsQuotaer struct { + xfsPath string + + // The file where we store mappings between project ids and directories, and + // each project's quota limit information, for backup. + // Similar to http://man7.org/linux/man-pages/man5/projects.5.html + projectsFile string + + projectIDs map[uint16]bool + + mapMutex *sync.Mutex + fileMutex *sync.Mutex +} + +var _ quotaer = &xfsQuotaer{} + +func newXfsQuotaer(xfsPath string) (*xfsQuotaer, error) { + if _, err := os.Stat(xfsPath); os.IsNotExist(err) { + return nil, fmt.Errorf("xfs path %s does not exist", xfsPath) + } + + isXfs, err := isXfs(xfsPath) + if err != nil { + return nil, fmt.Errorf("error checking if xfs path %s is an XFS filesystem: %v", xfsPath, err) + } + if !isXfs { + return nil, fmt.Errorf("xfs path %s is not an XFS filesystem", xfsPath) + } + + entry, err := getMountEntry(path.Clean(xfsPath), "xfs") + if err != nil { + return nil, err + } + if !strings.Contains(entry.VfsOpts, "pquota") && !strings.Contains(entry.VfsOpts, "prjquota") { + return nil, fmt.Errorf("xfs path %s was not mounted with pquota nor prjquota", xfsPath) + } + + if _, err := exec.LookPath("xfs_quota"); err != nil { + return nil, err + } + + projectsFile := path.Join(xfsPath, "projects") + projectIDs := map[uint16]bool{} + if _, err := os.Stat(projectsFile); os.IsNotExist(err) { + file, err := os.Create(projectsFile) + if err != nil { + return nil, fmt.Errorf("error creating xfs projects file %s: %v", projectsFile, err) + } + file.Close() + } else { + re := regexp.MustCompile("(?m:^([0-9]+):/.+$)") + projectIDs, err = getExistingIDs(projectsFile, re) + if err != nil { + glog.Errorf("error while populating projectIDs map, there may be errors setting quotas later if projectIDs are reused: %v", err) + } + } + + xfsQuotaer := &xfsQuotaer{ + xfsPath: xfsPath, + projectsFile: projectsFile, + projectIDs: projectIDs, + mapMutex: &sync.Mutex{}, + fileMutex: &sync.Mutex{}, + } + + err = xfsQuotaer.restoreQuotas() + if err != nil { + return nil, fmt.Errorf("error restoring quotas from projects file %s: %v", projectsFile, err) + } + + return xfsQuotaer, nil +} + +func isXfs(xfsPath string) (bool, error) { + cmd := exec.Command("stat", "-f", "-c", "%T", xfsPath) + out, err := cmd.Output() + if err != nil { + return false, err + } + if strings.TrimSpace(string(out)) != "xfs" { + return false, nil + } + return true, nil +} + +func getMountEntry(mountpoint, fstype string) (*mount.Info, error) { + entries, err := mount.GetMounts() + if err != nil { + return nil, err + } + for _, e := range entries { + if e.Mountpoint == mountpoint && e.Fstype == fstype { + return e, nil + } + } + return nil, fmt.Errorf("mount entry for mountpoint %s, fstype %s not found", mountpoint, fstype) +} + +func (q *xfsQuotaer) restoreQuotas() error { + read, err := ioutil.ReadFile(q.projectsFile) + if err != nil { + return err + } + + re := regexp.MustCompile("(?m:\n^([0-9]+):(.+):(.+)$\n)") + + matches := re.FindAllSubmatch(read, -1) + for _, match := range matches { + projectID, _ := strconv.ParseUint(string(match[1]), 10, 16) + directory := string(match[2]) + bhard := string(match[3]) + + // If directory referenced by projects file no longer exists, don't set a + // quota for it: will fail + if _, err := os.Stat(directory); os.IsNotExist(err) { + q.RemoveProject(string(match[0]), uint16(projectID)) + continue + } + + if err := q.SetQuota(uint16(projectID), directory, bhard); err != nil { + return fmt.Errorf("error restoring quota for directory %s: %v", directory, err) + } + } + + return nil +} + +func (q *xfsQuotaer) AddProject(directory, bhard string) (string, uint16, error) { + projectID := generateID(q.mapMutex, q.projectIDs) + projectIDStr := strconv.FormatUint(uint64(projectID), 10) + + // Store project:directory mapping and also project's quota info + block := "\n" + projectIDStr + ":" + directory + ":" + bhard + "\n" + + // Add the project block to the projects file + if err := addToFile(q.fileMutex, q.projectsFile, block); err != nil { + deleteID(q.mapMutex, q.projectIDs, projectID) + return "", 0, fmt.Errorf("error adding project block %s to projects file %s: %v", block, q.projectsFile, err) + } + + // Specify the new project + cmd := exec.Command("xfs_quota", "-x", "-c", fmt.Sprintf("project -s -p %s %s", directory, projectIDStr), q.xfsPath) + out, err := cmd.CombinedOutput() + if err != nil { + deleteID(q.mapMutex, q.projectIDs, projectID) + removeFromFile(q.fileMutex, q.projectsFile, block) + return "", 0, fmt.Errorf("xfs_quota failed with error: %v, output: %s", err, out) + } + + return block, projectID, nil +} + +func (q *xfsQuotaer) RemoveProject(block string, projectID uint16) error { + deleteID(q.mapMutex, q.projectIDs, projectID) + return removeFromFile(q.fileMutex, q.projectsFile, block) +} + +func (q *xfsQuotaer) SetQuota(projectID uint16, directory, bhard string) error { + if !q.projectIDs[projectID] { + return fmt.Errorf("project with id %v has not been added", projectID) + } + projectIDStr := strconv.FormatUint(uint64(projectID), 10) + + cmd := exec.Command("xfs_quota", "-x", "-c", fmt.Sprintf("limit -p bhard=%s %s", bhard, projectIDStr), q.xfsPath) + out, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("xfs_quota failed with error: %v, output: %s", err, out) + } + + return nil +} + +func (q *xfsQuotaer) UnsetQuota() error { + return nil +} + +type dummyQuotaer struct{} + +var _ quotaer = &dummyQuotaer{} + +func newDummyQuotaer() *dummyQuotaer { + return &dummyQuotaer{} +} + +func (q *dummyQuotaer) AddProject(_, _ string) (string, uint16, error) { + return "", 0, nil +} +func (q *dummyQuotaer) RemoveProject(_ string, _ uint16) error { + return nil +} +func (q *dummyQuotaer) SetQuota(_ uint16, _, _ string) error { + return nil +} +func (q *dummyQuotaer) UnsetQuota() error { + return nil +} diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/util.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/util.go new file mode 100644 index 00000000..06731651 --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/pkg/volume/util.go @@ -0,0 +1,114 @@ +/* +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 volume + +import ( + "fmt" + "io/ioutil" + "math" + "os" + "regexp" + "strconv" + "strings" + "sync" +) + +// generateID generates a unique exportID to assign an export +func generateID(mutex *sync.Mutex, ids map[uint16]bool) uint16 { + mutex.Lock() + id := uint16(1) + for ; id <= math.MaxUint16; id++ { + if _, ok := ids[id]; !ok { + break + } + } + ids[id] = true + mutex.Unlock() + return id +} + +func deleteID(mutex *sync.Mutex, ids map[uint16]bool, id uint16) { + mutex.Lock() + delete(ids, id) + mutex.Unlock() +} + +// getExistingIDs populates a map with existing ids found in the given config +// file using the given regexp. Regexp must have a "digits" submatch. +func getExistingIDs(config string, re *regexp.Regexp) (map[uint16]bool, error) { + ids := map[uint16]bool{} + + digitsRe := "([0-9]+)" + if !strings.Contains(re.String(), digitsRe) { + return ids, fmt.Errorf("regexp %s doesn't contain digits submatch %s", re.String(), digitsRe) + } + + read, err := ioutil.ReadFile(config) + if err != nil { + return ids, err + } + + allMatches := re.FindAllSubmatch(read, -1) + for _, match := range allMatches { + digits := match[1] + if id, err := strconv.ParseUint(string(digits), 10, 16); err == nil { + ids[uint16(id)] = true + } + } + + return ids, nil +} + +func addToFile(mutex *sync.Mutex, path string, toAdd string) error { + mutex.Lock() + + file, err := os.OpenFile(path, os.O_APPEND|os.O_WRONLY, 0600) + if err != nil { + mutex.Unlock() + return err + } + defer file.Close() + + if _, err = file.WriteString(toAdd); err != nil { + mutex.Unlock() + return err + } + file.Sync() + + mutex.Unlock() + return nil +} + +func removeFromFile(mutex *sync.Mutex, path string, toRemove string) error { + mutex.Lock() + + read, err := ioutil.ReadFile(path) + if err != nil { + mutex.Unlock() + return err + } + + removed := strings.Replace(string(read), toRemove, "", -1) + err = ioutil.WriteFile(path, []byte(removed), 0) + if err != nil { + mutex.Unlock() + return err + } + + mutex.Unlock() + return nil +} diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/cleanup.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/cleanup.go new file mode 100644 index 00000000..55fa1d4a --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/cleanup.go @@ -0,0 +1,61 @@ +/* +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 framework + +import "sync" + +type CleanupActionHandle *int + +var cleanupActionsLock sync.Mutex +var cleanupActions = map[CleanupActionHandle]func(){} + +// AddCleanupAction installs a function that will be called in the event of the +// whole test being terminated. This allows arbitrary pieces of the overall +// test to hook into SynchronizedAfterSuite(). +func AddCleanupAction(fn func()) CleanupActionHandle { + p := CleanupActionHandle(new(int)) + cleanupActionsLock.Lock() + defer cleanupActionsLock.Unlock() + cleanupActions[p] = fn + return p +} + +// RemoveCleanupAction removes a function that was installed by +// AddCleanupAction. +func RemoveCleanupAction(p CleanupActionHandle) { + cleanupActionsLock.Lock() + defer cleanupActionsLock.Unlock() + delete(cleanupActions, p) +} + +// RunCleanupActions runs all functions installed by AddCleanupAction. It does +// not remove them (see RemoveCleanupAction) but it does run unlocked, so they +// may remove themselves. +func RunCleanupActions() { + list := []func(){} + func() { + cleanupActionsLock.Lock() + defer cleanupActionsLock.Unlock() + for _, fn := range cleanupActions { + list = append(list, fn) + } + }() + // Run unlocked. + for _, fn := range list { + fn() + } +} diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/framework.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/framework.go new file mode 100644 index 00000000..3c596d43 --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/framework.go @@ -0,0 +1,209 @@ +/* +Copyright 2015 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 framework + +import ( + "fmt" + "strings" + "time" + + "k8s.io/client-go/dynamic" + clientset "k8s.io/client-go/kubernetes" + apierrs "k8s.io/client-go/pkg/api/errors" + "k8s.io/client-go/pkg/api/unversioned" + "k8s.io/client-go/pkg/api/v1" + "k8s.io/client-go/pkg/apimachinery/registered" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +const ( + maxKubectlExecRetries = 5 +) + +// Framework supports common operations used by e2e tests; it will keep a client & a namespace for you. +// Eventual goal is to merge this with integration test framework. +type Framework struct { + BaseName string + + ClientSet clientset.Interface + + ClientPool dynamic.ClientPool + + Namespace *v1.Namespace // Every test has at least one namespace + namespacesToDelete []*v1.Namespace // Some tests have more than one. + NamespaceDeletionTimeout time.Duration + + // To make sure that this framework cleans up after itself, no matter what, + // we install a Cleanup action before each test and clear it after. If we + // should abort, the AfterSuite hook should run all Cleanup actions. + cleanupHandle CleanupActionHandle + + // configuration for framework's client + options FrameworkOptions +} + +type TestDataSummary interface { + PrintHumanReadable() string + PrintJSON() string +} + +type FrameworkOptions struct { + ClientQPS float32 + ClientBurst int + GroupVersion *unversioned.GroupVersion +} + +// NewFramework makes a new framework and sets up a BeforeEach/AfterEach for +// you (you can write additional before/after each functions). +func NewDefaultFramework(baseName string) *Framework { + options := FrameworkOptions{ + ClientQPS: 20, + ClientBurst: 50, + } + return NewFramework(baseName, options, nil) +} + +func NewFramework(baseName string, options FrameworkOptions, client clientset.Interface) *Framework { + f := &Framework{ + BaseName: baseName, + options: options, + ClientSet: client, + } + + BeforeEach(f.BeforeEach) + AfterEach(f.AfterEach) + + return f +} + +// BeforeEach gets a client and makes a namespace. +func (f *Framework) BeforeEach() { + // The fact that we need this feels like a bug in ginkgo. + // https://github.com/onsi/ginkgo/issues/222 + f.cleanupHandle = AddCleanupAction(f.AfterEach) + if f.ClientSet == nil { + By("Creating a kubernetes client") + config, err := LoadConfig() + Expect(err).NotTo(HaveOccurred()) + config.QPS = f.options.ClientQPS + config.Burst = f.options.ClientBurst + if f.options.GroupVersion != nil { + config.GroupVersion = f.options.GroupVersion + } + if TestContext.KubeAPIContentType != "" { + config.ContentType = TestContext.KubeAPIContentType + } + f.ClientSet, err = clientset.NewForConfig(config) + Expect(err).NotTo(HaveOccurred()) + f.ClientPool = dynamic.NewClientPool(config, registered.RESTMapper(), dynamic.LegacyAPIPathResolverFunc) + } + + By("Building a namespace api object") + namespace, err := f.CreateNamespace(f.BaseName, map[string]string{ + "e2e-framework": f.BaseName, + }) + Expect(err).NotTo(HaveOccurred()) + + f.Namespace = namespace +} + +// AfterEach deletes the namespace, after reading its events. +func (f *Framework) AfterEach() { + RemoveCleanupAction(f.cleanupHandle) + + // DeleteNamespace at the very end in defer, to avoid any + // expectation failures preventing deleting the namespace. + defer func() { + nsDeletionErrors := map[string]error{} + // Whether to delete namespace is determined by 3 factors: delete-namespace flag, delete-namespace-on-failure flag and the test result + // if delete-namespace set to false, namespace will always be preserved. + // if delete-namespace is true and delete-namespace-on-failure is false, namespace will be preserved if test failed. + if TestContext.DeleteNamespace && (TestContext.DeleteNamespaceOnFailure || !CurrentGinkgoTestDescription().Failed) { + for _, ns := range f.namespacesToDelete { + By(fmt.Sprintf("Destroying namespace %q for this suite.", ns.Name)) + timeout := 5 * time.Minute + if f.NamespaceDeletionTimeout != 0 { + timeout = f.NamespaceDeletionTimeout + } + if err := deleteNS(f.ClientSet, f.ClientPool, ns.Name, timeout); err != nil { + if !apierrs.IsNotFound(err) { + nsDeletionErrors[ns.Name] = err + } else { + Logf("Namespace %v was already deleted", ns.Name) + } + } + } + } else { + if TestContext.DeleteNamespace { + Logf("Found DeleteNamespace=false, skipping namespace deletion!") + } else if TestContext.DeleteNamespaceOnFailure { + Logf("Found DeleteNamespaceOnFailure=false, skipping namespace deletion!") + } + + } + + // Paranoia-- prevent reuse! + f.Namespace = nil + f.ClientSet = nil + f.namespacesToDelete = nil + + // if we had errors deleting, report them now. + if len(nsDeletionErrors) != 0 { + messages := []string{} + for namespaceKey, namespaceErr := range nsDeletionErrors { + messages = append(messages, fmt.Sprintf("Couldn't delete ns: %q: %s (%#v)", namespaceKey, namespaceErr, namespaceErr)) + } + Failf(strings.Join(messages, ",")) + } + }() + + // Print events if the test failed. + if CurrentGinkgoTestDescription().Failed && TestContext.DumpLogsOnFailure { + // Pass both unversioned client and and versioned clientset, till we have removed all uses of the unversioned client. + DumpAllNamespaceInfo(f.ClientSet, f.Namespace.Name) + } + + // Check whether all nodes are ready after the test. + // This is explicitly done at the very end of the test, to avoid + // e.g. not removing namespace in case of this failure. + if err := AllNodesReady(f.ClientSet, 3*time.Minute); err != nil { + Failf("All nodes should be ready after test, %v", err) + } +} + +func (f *Framework) CreateNamespace(baseName string, labels map[string]string) (*v1.Namespace, error) { + createTestingNS := TestContext.CreateTestingNS + if createTestingNS == nil { + createTestingNS = CreateTestingNS + } + ns, err := createTestingNS(baseName, f.ClientSet, labels) + // check ns instead of err to see if it's nil as we may + // fail to create serviceAccount in it. + // In this case, we should not forget to delete the namespace. + if ns != nil { + f.namespacesToDelete = append(f.namespacesToDelete, ns) + } + return ns, err +} + +// Wrapper function for ginkgo describe. Adds namespacing. +// TODO: Support type safe tagging as well https://github.com/kubernetes/kubernetes/pull/22401. +func KubeDescribe(text string, body func()) bool { + return Describe("[k8s.io] "+text, body) +} diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/test_context.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/test_context.go new file mode 100644 index 00000000..99e4e1ff --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/test_context.go @@ -0,0 +1,240 @@ +/* +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 framework + +import ( + "flag" + "os" + "time" + + "github.com/onsi/ginkgo/config" + "github.com/spf13/viper" + "k8s.io/client-go/pkg/apis/componentconfig" + "k8s.io/client-go/tools/clientcmd" + "k8s.io/kubernetes/pkg/cloudprovider" +) + +type TestContextType struct { + KubeConfig string + KubeContext string + KubeAPIContentType string + KubeVolumeDir string + CertDir string + Host string + // TODO: Deprecating this over time... instead just use gobindata_util.go , see #23987. + RepoRoot string + + Provider string + CloudConfig CloudConfig + KubectlPath string + OutputDir string + ReportDir string + ReportPrefix string + Prefix string + MinStartupPods int + // Timeout for waiting for system pods to be running + SystemPodsStartupTimeout time.Duration + UpgradeTarget string + UpgradeImage string + PrometheusPushGateway string + ContainerRuntime string + MasterOSDistro string + NodeOSDistro string + VerifyServiceAccount bool + DeleteNamespace bool + DeleteNamespaceOnFailure bool + AllowedNotReadyNodes int + CleanStart bool + // If set to 'true' or 'all' framework will start a goroutine monitoring resource usage of system add-ons. + // It will read the data every 30 seconds from all Nodes and print summary during afterEach. If set to 'master' + // only master Node will be monitored. + GatherKubeSystemResourceUsageData string + GatherLogsSizes bool + GatherMetricsAfterTest bool + // Currently supported values are 'hr' for human-readable and 'json'. It's a comma separated list. + OutputPrintType string + // CreateTestingNS is responsible for creating namespace used for executing e2e tests. + // It accepts namespace base name, which will be prepended with e2e prefix, kube client + // and labels to be applied to a namespace. + CreateTestingNS CreateTestingNSFn + // If set to true test will dump data about the namespace in which test was running. + DumpLogsOnFailure bool + // If the garbage collector is enabled in the kube-apiserver and kube-controller-manager. + GarbageCollectorEnabled bool + // FeatureGates is a set of key=value pairs that describe feature gates for alpha/experimental features. + FeatureGates string + // Node e2e specific test context + NodeTestContextType + + // Viper-only parameters. These will in time replace all flags. + + // Example: Create a file 'e2e.json' with the following: + // "Cadvisor":{ + // "MaxRetries":"6" + // } + + Viper string + Cadvisor struct { + MaxRetries int + SleepDurationMS int + } + + LoggingSoak struct { + Scale int + MilliSecondsBetweenWaves int + } +} + +// NodeTestContextType is part of TestContextType, it is shared by all node e2e test. +type NodeTestContextType struct { + // NodeE2E indicates whether it is running node e2e. + NodeE2E bool + // Name of the node to run tests on. + NodeName string + // NodeConformance indicates whether the test is running in node conformance mode. + NodeConformance bool + // PrepullImages indicates whether node e2e framework should prepull images. + PrepullImages bool + // KubeletConfig is the kubelet configuration the test is running against. + KubeletConfig componentconfig.KubeletConfiguration +} + +type CloudConfig struct { + ProjectID string + Zone string + Cluster string + MasterName string + NodeInstanceGroup string + NumNodes int + ClusterTag string + Network string + + Provider cloudprovider.Interface +} + +var TestContext TestContextType +var federatedKubeContext string + +// Register flags common to all e2e test suites. +func RegisterCommonFlags() { + // Turn on verbose by default to get spec names + config.DefaultReporterConfig.Verbose = true + + // Turn on EmitSpecProgress to get spec progress (especially on interrupt) + config.GinkgoConfig.EmitSpecProgress = true + + // Randomize specs as well as suites + config.GinkgoConfig.RandomizeAllSpecs = true + + flag.StringVar(&TestContext.GatherKubeSystemResourceUsageData, "gather-resource-usage", "false", "If set to 'true' or 'all' framework will be monitoring resource usage of system all add-ons in (some) e2e tests, if set to 'master' framework will be monitoring master node only, if set to 'none' of 'false' monitoring will be turned off.") + flag.BoolVar(&TestContext.GatherLogsSizes, "gather-logs-sizes", false, "If set to true framework will be monitoring logs sizes on all machines running e2e tests.") + flag.BoolVar(&TestContext.GatherMetricsAfterTest, "gather-metrics-at-teardown", false, "If set to true framwork will gather metrics from all components after each test.") + flag.StringVar(&TestContext.OutputPrintType, "output-print-type", "hr", "Comma separated list: 'hr' for human readable summaries 'json' for JSON ones.") + flag.BoolVar(&TestContext.DumpLogsOnFailure, "dump-logs-on-failure", true, "If set to true test will dump data about the namespace in which test was running.") + flag.BoolVar(&TestContext.DeleteNamespace, "delete-namespace", true, "If true tests will delete namespace after completion. It is only designed to make debugging easier, DO NOT turn it off by default.") + flag.BoolVar(&TestContext.DeleteNamespaceOnFailure, "delete-namespace-on-failure", true, "If true, framework will delete test namespace on failure. Used only during test debugging.") + flag.IntVar(&TestContext.AllowedNotReadyNodes, "allowed-not-ready-nodes", 0, "If non-zero, framework will allow for that many non-ready nodes when checking for all ready nodes.") + flag.StringVar(&TestContext.Host, "host", "http://127.0.0.1:8080", "The host, or apiserver, to connect to") + flag.StringVar(&TestContext.ReportPrefix, "report-prefix", "", "Optional prefix for JUnit XML reports. Default is empty, which doesn't prepend anything to the default name.") + flag.StringVar(&TestContext.ReportDir, "report-dir", "", "Path to the directory where the JUnit XML reports should be saved. Default is empty, which doesn't generate these reports.") + flag.StringVar(&TestContext.FeatureGates, "feature-gates", "", "A set of key=value pairs that describe feature gates for alpha/experimental features.") + flag.StringVar(&TestContext.Viper, "viper-config", "e2e", "The name of the viper config i.e. 'e2e' will read values from 'e2e.json' locally. All e2e parameters are meant to be configurable by viper.") +} + +// Register flags specific to the cluster e2e test suite. +func RegisterClusterFlags() { + flag.BoolVar(&TestContext.VerifyServiceAccount, "e2e-verify-service-account", true, "If true tests will verify the service account before running.") + flag.StringVar(&TestContext.KubeConfig, clientcmd.RecommendedConfigPathFlag, os.Getenv(clientcmd.RecommendedConfigPathEnvVar), "Path to kubeconfig containing embedded authinfo.") + flag.StringVar(&TestContext.KubeContext, clientcmd.FlagContext, "", "kubeconfig context to use/override. If unset, will use value from 'current-context'") + flag.StringVar(&TestContext.KubeAPIContentType, "kube-api-content-type", "application/vnd.kubernetes.protobuf", "ContentType used to communicate with apiserver") + flag.StringVar(&federatedKubeContext, "federated-kube-context", "federation-cluster", "kubeconfig context for federation-cluster.") + + flag.StringVar(&TestContext.KubeVolumeDir, "volume-dir", "/var/lib/kubelet", "Path to the directory containing the kubelet volumes.") + flag.StringVar(&TestContext.CertDir, "cert-dir", "", "Path to the directory containing the certs. Default is empty, which doesn't use certs.") + flag.StringVar(&TestContext.RepoRoot, "repo-root", "../../", "Root directory of kubernetes repository, for finding test files.") + flag.StringVar(&TestContext.Provider, "provider", "", "The name of the Kubernetes provider (gce, gke, local, vagrant, etc.)") + flag.StringVar(&TestContext.KubectlPath, "kubectl-path", "kubectl", "The kubectl binary to use. For development, you might use 'cluster/kubectl.sh' here.") + flag.StringVar(&TestContext.OutputDir, "e2e-output-dir", "/tmp", "Output directory for interesting/useful test data, like performance data, benchmarks, and other metrics.") + flag.StringVar(&TestContext.Prefix, "prefix", "e2e", "A prefix to be added to cloud resources created during testing.") + flag.StringVar(&TestContext.ContainerRuntime, "container-runtime", "docker", "The container runtime of cluster VM instances (docker or rkt).") + flag.StringVar(&TestContext.MasterOSDistro, "master-os-distro", "debian", "The OS distribution of cluster master (debian, trusty, or coreos).") + flag.StringVar(&TestContext.NodeOSDistro, "node-os-distro", "debian", "The OS distribution of cluster VM instances (debian, trusty, or coreos).") + + // TODO: Flags per provider? Rename gce-project/gce-zone? + cloudConfig := &TestContext.CloudConfig + flag.StringVar(&cloudConfig.MasterName, "kube-master", "", "Name of the kubernetes master. Only required if provider is gce or gke") + flag.StringVar(&cloudConfig.ProjectID, "gce-project", "", "The GCE project being used, if applicable") + flag.StringVar(&cloudConfig.Zone, "gce-zone", "", "GCE zone being used, if applicable") + flag.StringVar(&cloudConfig.Cluster, "gke-cluster", "", "GKE name of cluster being used, if applicable") + flag.StringVar(&cloudConfig.NodeInstanceGroup, "node-instance-group", "", "Name of the managed instance group for nodes. Valid only for gce, gke or aws. If there is more than one group: comma separated list of groups.") + flag.StringVar(&cloudConfig.Network, "network", "e2e", "The cloud provider network for this e2e cluster.") + flag.IntVar(&cloudConfig.NumNodes, "num-nodes", -1, "Number of nodes in the cluster") + + flag.StringVar(&cloudConfig.ClusterTag, "cluster-tag", "", "Tag used to identify resources. Only required if provider is aws.") + flag.IntVar(&TestContext.MinStartupPods, "minStartupPods", 0, "The number of pods which we need to see in 'Running' state with a 'Ready' condition of true, before we try running tests. This is useful in any cluster which needs some base pod-based services running before it can be used.") + flag.DurationVar(&TestContext.SystemPodsStartupTimeout, "system-pods-startup-timeout", 10*time.Minute, "Timeout for waiting for all system pods to be running before starting tests.") + flag.StringVar(&TestContext.UpgradeTarget, "upgrade-target", "ci/latest", "Version to upgrade to (e.g. 'release/stable', 'release/latest', 'ci/latest', '0.19.1', '0.19.1-669-gabac8c8') if doing an upgrade test.") + flag.StringVar(&TestContext.UpgradeImage, "upgrade-image", "", "Image to upgrade to (e.g. 'container_vm' or 'gci') if doing an upgrade test.") + flag.StringVar(&TestContext.PrometheusPushGateway, "prom-push-gateway", "", "The URL to prometheus gateway, so that metrics can be pushed during e2es and scraped by prometheus. Typically something like 127.0.0.1:9091.") + flag.BoolVar(&TestContext.CleanStart, "clean-start", false, "If true, purge all namespaces except default and system before running tests. This serves to Cleanup test namespaces from failed/interrupted e2e runs in a long-lived cluster.") + flag.BoolVar(&TestContext.GarbageCollectorEnabled, "garbage-collector-enabled", true, "Set to true if the garbage collector is enabled in the kube-apiserver and kube-controller-manager, then some tests will rely on the garbage collector to delete dependent resources.") +} + +// Register flags specific to the node e2e test suite. +func RegisterNodeFlags() { + // Mark the test as node e2e when node flags are registered. + TestContext.NodeE2E = true + flag.StringVar(&TestContext.NodeName, "node-name", "", "Name of the node to run tests on.") + // TODO(random-liu): Move kubelet start logic out of the test. + // TODO(random-liu): Move log fetch logic out of the test. + // There are different ways to start kubelet (systemd, initd, docker, rkt, manually started etc.) + // and manage logs (journald, upstart etc.). + // For different situation we need to mount different things into the container, run different commands. + // It is hard and unnecessary to deal with the complexity inside the test suite. + flag.BoolVar(&TestContext.NodeConformance, "conformance", false, "If true, the test suite will not start kubelet, and fetch system log (kernel, docker, kubelet log etc.) to the report directory.") + flag.BoolVar(&TestContext.PrepullImages, "prepull-images", true, "If true, prepull images so image pull failures do not cause test failures.") +} + +// overwriteFlagsWithViperConfig finds and writes values to flags using viper as input. +func overwriteFlagsWithViperConfig() { + viperFlagSetter := func(f *flag.Flag) { + if viper.IsSet(f.Name) { + f.Value.Set(viper.GetString(f.Name)) + } + } + flag.VisitAll(viperFlagSetter) +} + +// ViperizeFlags sets up all flag and config processing. Future configuration info should be added to viper, not to flags. +func ViperizeFlags() { + + // Part 1: Set regular flags. + // TODO: Future, lets eliminate e2e 'flag' deps entirely in favor of viper only, + // since go test 'flag's are sort of incompatible w/ flag, glog, etc. + RegisterCommonFlags() + RegisterClusterFlags() + flag.Parse() + + // Part 2: Set Viper provided flags. + // This must be done after common flags are registered, since Viper is a flag option. + viper.SetConfigName(TestContext.Viper) + viper.AddConfigPath(".") + viper.ReadInConfig() + + // TODO Consider wether or not we want to use overwriteFlagsWithViperConfig(). + viper.Unmarshal(&TestContext) +} diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/util.go b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/util.go new file mode 100644 index 00000000..ceaa7bc0 --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/test/e2e/framework/util.go @@ -0,0 +1,931 @@ +/* +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 framework + +import ( + "fmt" + "sort" + "strings" + "time" + + "github.com/blang/semver" + "k8s.io/client-go/discovery" + "k8s.io/client-go/dynamic" + clientset "k8s.io/client-go/kubernetes" + "k8s.io/client-go/pkg/api" + apierrs "k8s.io/client-go/pkg/api/errors" + "k8s.io/client-go/pkg/api/unversioned" + "k8s.io/client-go/pkg/api/v1" + "k8s.io/client-go/pkg/fields" + "k8s.io/client-go/pkg/labels" + "k8s.io/client-go/pkg/master/ports" + "k8s.io/client-go/pkg/runtime" + "k8s.io/client-go/pkg/util/sets" + "k8s.io/client-go/pkg/util/uuid" + "k8s.io/client-go/pkg/util/wait" + "k8s.io/client-go/pkg/version" + "k8s.io/client-go/pkg/watch" + restclient "k8s.io/client-go/rest" + "k8s.io/client-go/tools/clientcmd" + clientcmdapi "k8s.io/client-go/tools/clientcmd/api" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +const ( + // Initial pod start can be delayed O(minutes) by slow docker pulls + // TODO: Make this 30 seconds once #4566 is resolved. + PodStartTimeout = 5 * time.Minute + + // Some pods can take much longer to get ready due to volume attach/detach latency. + slowPodStartTimeout = 15 * time.Minute + + // How often to Poll pods, nodes and claims. + Poll = 2 * time.Second + + // How long claims have to become dynamically provisioned + ClaimProvisionTimeout = 5 * time.Minute +) + +var ( + // Label allocated to the image puller static pod that runs on each node + // before e2es. + ImagePullerLabels = map[string]string{"name": "e2e-image-puller"} +) + +// unique identifier of the e2e run +var RunId = uuid.NewUUID() + +var subResourceServiceAndNodeProxyVersion = version.MustParse("v1.2.0") + +type CreateTestingNSFn func(baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error) + +func nowStamp() string { + return time.Now().Format(time.StampMilli) +} + +func log(level string, format string, args ...interface{}) { + fmt.Fprintf(GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...) +} + +func Logf(format string, args ...interface{}) { + log("INFO", format, args...) +} + +func Failf(format string, args ...interface{}) { + msg := fmt.Sprintf(format, args...) + log("INFO", msg) + Fail(nowStamp()+": "+msg, 1) +} + +type podCondition func(pod *v1.Pod) (bool, error) + +// logPodStates logs basic info of provided pods for debugging. +func logPodStates(pods []v1.Pod) { + // Find maximum widths for pod, node, and phase strings for column printing. + maxPodW, maxNodeW, maxPhaseW, maxGraceW := len("POD"), len("NODE"), len("PHASE"), len("GRACE") + for i := range pods { + pod := &pods[i] + if len(pod.ObjectMeta.Name) > maxPodW { + maxPodW = len(pod.ObjectMeta.Name) + } + if len(pod.Spec.NodeName) > maxNodeW { + maxNodeW = len(pod.Spec.NodeName) + } + if len(pod.Status.Phase) > maxPhaseW { + maxPhaseW = len(pod.Status.Phase) + } + } + // Increase widths by one to separate by a single space. + maxPodW++ + maxNodeW++ + maxPhaseW++ + maxGraceW++ + + // Log pod info. * does space padding, - makes them left-aligned. + Logf("%-[1]*[2]s %-[3]*[4]s %-[5]*[6]s %-[7]*[8]s %[9]s", + maxPodW, "POD", maxNodeW, "NODE", maxPhaseW, "PHASE", maxGraceW, "GRACE", "CONDITIONS") + for _, pod := range pods { + grace := "" + if pod.DeletionGracePeriodSeconds != nil { + grace = fmt.Sprintf("%ds", *pod.DeletionGracePeriodSeconds) + } + Logf("%-[1]*[2]s %-[3]*[4]s %-[5]*[6]s %-[7]*[8]s %[9]s", + maxPodW, pod.ObjectMeta.Name, maxNodeW, pod.Spec.NodeName, maxPhaseW, pod.Status.Phase, maxGraceW, grace, pod.Status.Conditions) + } + Logf("") // Final empty line helps for readability. +} + +func waitForPodCondition(c clientset.Interface, ns, podName, desc string, timeout time.Duration, condition podCondition) error { + Logf("Waiting up to %[1]v for pod %[2]s status to be %[3]s", timeout, podName, desc) + for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) { + pod, err := c.Core().Pods(ns).Get(podName) + if err != nil { + if apierrs.IsNotFound(err) { + Logf("Pod %q in namespace %q disappeared. Error: %v", podName, ns, err) + return err + } + // Aligning this text makes it much more readable + Logf("Get pod %[1]s in namespace '%[2]s' failed, ignoring for %[3]v. Error: %[4]v", + podName, ns, Poll, err) + continue + } + done, err := condition(pod) + if done { + return err + } + Logf("Waiting for pod %[1]s in namespace '%[2]s' status to be '%[3]s'"+ + "(found phase: %[4]q, readiness: %[5]t) (%[6]v elapsed)", + podName, ns, desc, pod.Status.Phase, IsPodReady(pod), time.Since(start)) + } + return fmt.Errorf("gave up waiting for pod '%s' to be '%s' after %v", podName, desc, timeout) +} + +// IsPodReady returns true if a pod is ready; false otherwise. +func IsPodReady(pod *v1.Pod) bool { + return IsPodReadyConditionTrue(pod.Status) +} + +// IsPodReady retruns true if a pod is ready; false otherwise. +func IsPodReadyConditionTrue(status v1.PodStatus) bool { + condition := GetPodReadyCondition(status) + return condition != nil && condition.Status == v1.ConditionTrue +} + +// Extracts the pod ready condition from the given status and returns that. +// Returns nil if the condition is not present. +func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition { + _, condition := GetPodCondition(&status, v1.PodReady) + return condition +} + +// GetPodCondition extracts the provided condition from the given status and returns that. +// Returns nil and -1 if the condition is not present, and the index of the located condition. +func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition) { + if status == nil { + return -1, nil + } + for i := range status.Conditions { + if status.Conditions[i].Type == conditionType { + return i, &status.Conditions[i] + } + } + return -1, nil +} + +// WaitForPersistentVolumeDeleted waits for a PersistentVolume to get deleted or until timeout occurs, whichever comes first. +func WaitForPersistentVolumeDeleted(c clientset.Interface, pvName string, Poll, timeout time.Duration) error { + Logf("Waiting up to %v for PersistentVolume %s to get deleted", timeout, pvName) + for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) { + pv, err := c.Core().PersistentVolumes().Get(pvName) + if err == nil { + Logf("PersistentVolume %s found and phase=%s (%v)", pvName, pv.Status.Phase, time.Since(start)) + continue + } else { + if apierrs.IsNotFound(err) { + Logf("PersistentVolume %s was removed", pvName) + return nil + } else { + Logf("Get persistent volume %s in failed, ignoring for %v: %v", pvName, Poll, err) + } + } + } + return fmt.Errorf("PersistentVolume %s still exists within %v", pvName, timeout) +} + +// WaitForPersistentVolumeClaimPhase waits for a PersistentVolumeClaim to be in a specific phase or until timeout occurs, whichever comes first. +func WaitForPersistentVolumeClaimPhase(phase v1.PersistentVolumeClaimPhase, c clientset.Interface, ns string, pvcName string, Poll, timeout time.Duration) error { + Logf("Waiting up to %v for PersistentVolumeClaim %s to have phase %s", timeout, pvcName, phase) + for start := time.Now(); time.Since(start) < timeout; time.Sleep(Poll) { + pvc, err := c.Core().PersistentVolumeClaims(ns).Get(pvcName) + if err != nil { + Logf("Get persistent volume claim %s in failed, ignoring for %v: %v", pvcName, Poll, err) + continue + } else { + if pvc.Status.Phase == phase { + Logf("PersistentVolumeClaim %s found and phase=%s (%v)", pvcName, phase, time.Since(start)) + return nil + } else { + Logf("PersistentVolumeClaim %s found but phase is %s instead of %s.", pvcName, pvc.Status.Phase, phase) + } + } + } + return fmt.Errorf("PersistentVolumeClaim %s not in phase %s within %v", pvcName, phase, timeout) +} + +// CreateTestingNS should be used by every test, note that we append a common prefix to the provided test name. +// Please see NewFramework instead of using this directly. +func CreateTestingNS(baseName string, c clientset.Interface, labels map[string]string) (*v1.Namespace, error) { + if labels == nil { + labels = map[string]string{} + } + labels["e2e-run"] = string(RunId) + + namespaceObj := &v1.Namespace{ + ObjectMeta: v1.ObjectMeta{ + GenerateName: fmt.Sprintf("e2e-tests-%v-", baseName), + Namespace: "", + Labels: labels, + }, + Status: v1.NamespaceStatus{}, + } + // Be robust about making the namespace creation call. + var got *v1.Namespace + if err := wait.PollImmediate(Poll, 30*time.Second, func() (bool, error) { + var err error + got, err = c.Core().Namespaces().Create(namespaceObj) + if err != nil { + Logf("Unexpected error while creating namespace: %v", err) + return false, nil + } + return true, nil + }); err != nil { + return nil, err + } + + return got, nil +} + +// deleteNS deletes the provided namespace, waits for it to be completely deleted, and then checks +// whether there are any pods remaining in a non-terminating state. +func deleteNS(c clientset.Interface, clientPool dynamic.ClientPool, namespace string, timeout time.Duration) error { + if err := c.Core().Namespaces().Delete(namespace, nil); err != nil { + return err + } + + // wait for namespace to delete or timeout. + err := wait.PollImmediate(5*time.Second, timeout, func() (bool, error) { + if _, err := c.Core().Namespaces().Get(namespace); err != nil { + if apierrs.IsNotFound(err) { + return true, nil + } + Logf("Error while waiting for namespace to be terminated: %v", err) + return false, nil + } + return false, nil + }) + + // verify there is no more remaining content in the namespace + remainingContent, cerr := hasRemainingContent(c, clientPool, namespace) + if cerr != nil { + return cerr + } + + // if content remains, let's dump information about the namespace, and system for flake debugging. + remainingPods := 0 + missingTimestamp := 0 + if remainingContent { + // log information about namespace, and set of namespaces in api server to help flake detection + logNamespace(c, namespace) + logNamespaces(c, namespace) + + // if we can, check if there were pods remaining with no timestamp. + remainingPods, missingTimestamp, _ = countRemainingPods(c, namespace) + } + + // a timeout waiting for namespace deletion happened! + if err != nil { + // some content remains in the namespace + if remainingContent { + // pods remain + if remainingPods > 0 { + // but they were all undergoing deletion (kubelet is probably culprit) + if missingTimestamp == 0 { + return fmt.Errorf("namespace %v was not deleted with limit: %v, pods remaining: %v, pods missing deletion timestamp: %v", namespace, err, remainingPods, missingTimestamp) + } + // pods remained, but were not undergoing deletion (namespace controller is probably culprit) + return fmt.Errorf("namespace %v was not deleted with limit: %v, pods remaining: %v", namespace, err, remainingPods) + } + // other content remains (namespace controller is probably screwed up) + return fmt.Errorf("namespace %v was not deleted with limit: %v, namespaced content other than pods remain", namespace, err) + } + // no remaining content, but namespace was not deleted (namespace controller is probably wedged) + return fmt.Errorf("namespace %v was not deleted with limit: %v, namespace is empty but is not yet removed", namespace, err) + } + return nil +} + +// logNamespaces logs the number of namespaces by phase +// namespace is the namespace the test was operating against that failed to delete so it can be grepped in logs +func logNamespaces(c clientset.Interface, namespace string) { + namespaceList, err := c.Core().Namespaces().List(v1.ListOptions{}) + if err != nil { + Logf("namespace: %v, unable to list namespaces: %v", namespace, err) + return + } + + numActive := 0 + numTerminating := 0 + for _, namespace := range namespaceList.Items { + if namespace.Status.Phase == v1.NamespaceActive { + numActive++ + } else { + numTerminating++ + } + } + Logf("namespace: %v, total namespaces: %v, active: %v, terminating: %v", namespace, len(namespaceList.Items), numActive, numTerminating) +} + +// logNamespace logs detail about a namespace +func logNamespace(c clientset.Interface, namespace string) { + ns, err := c.Core().Namespaces().Get(namespace) + if err != nil { + if apierrs.IsNotFound(err) { + Logf("namespace: %v no longer exists", namespace) + return + } + Logf("namespace: %v, unable to get namespace due to error: %v", namespace, err) + return + } + Logf("namespace: %v, DeletionTimetamp: %v, Finalizers: %v, Phase: %v", ns.Name, ns.DeletionTimestamp, ns.Spec.Finalizers, ns.Status.Phase) +} + +// countRemainingPods queries the server to count number of remaining pods, and number of pods that had a missing deletion timestamp. +func countRemainingPods(c clientset.Interface, namespace string) (int, int, error) { + // check for remaining pods + pods, err := c.Core().Pods(namespace).List(v1.ListOptions{}) + if err != nil { + return 0, 0, err + } + + // nothing remains! + if len(pods.Items) == 0 { + return 0, 0, nil + } + + // stuff remains, log about it + logPodStates(pods.Items) + + // check if there were any pods with missing deletion timestamp + numPods := len(pods.Items) + missingTimestamp := 0 + for _, pod := range pods.Items { + if pod.DeletionTimestamp == nil { + missingTimestamp++ + } + } + return numPods, missingTimestamp, nil +} + +// hasRemainingContent checks if there is remaining content in the namespace via API discovery +func hasRemainingContent(c clientset.Interface, clientPool dynamic.ClientPool, namespace string) (bool, error) { + // some tests generate their own framework.Client rather than the default + // TODO: ensure every test call has a configured clientPool + if clientPool == nil { + return false, nil + } + + // find out what content is supported on the server + groupVersionResources, err := c.Discovery().ServerPreferredNamespacedResources() + if err != nil { + return false, err + } + + // TODO: temporary hack for https://github.com/kubernetes/kubernetes/issues/31798 + ignoredResources := sets.NewString("bindings") + + contentRemaining := false + + // dump how many of resource type is on the server in a log. + for _, gvr := range groupVersionResources { + // get a client for this group version... + dynamicClient, err := clientPool.ClientForGroupVersionResource(gvr) + if err != nil { + // not all resource types support list, so some errors here are normal depending on the resource type. + Logf("namespace: %s, unable to get client - gvr: %v, error: %v", namespace, gvr, err) + continue + } + // get the api resource + apiResource := unversioned.APIResource{Name: gvr.Resource, Namespaced: true} + // TODO: temporary hack for https://github.com/kubernetes/kubernetes/issues/31798 + if ignoredResources.Has(apiResource.Name) { + Logf("namespace: %s, resource: %s, ignored listing per whitelist", namespace, apiResource.Name) + continue + } + obj, err := dynamicClient.Resource(&apiResource, namespace).List(&v1.ListOptions{}) + if err != nil { + // not all resources support list, so we ignore those + if apierrs.IsMethodNotSupported(err) || apierrs.IsNotFound(err) || apierrs.IsForbidden(err) { + continue + } + return false, err + } + unstructuredList, ok := obj.(*runtime.UnstructuredList) + if !ok { + return false, fmt.Errorf("namespace: %s, resource: %s, expected *runtime.UnstructuredList, got %#v", namespace, apiResource.Name, obj) + } + if len(unstructuredList.Items) > 0 { + Logf("namespace: %s, resource: %s, items remaining: %v", namespace, apiResource.Name, len(unstructuredList.Items)) + contentRemaining = true + } + } + return contentRemaining, nil +} + +// Waits default amount of time (PodStartTimeout) for the specified pod to become running. +// Returns an error if timeout occurs first, or pod goes in to failed state. +func WaitForPodRunningInNamespace(c clientset.Interface, pod *v1.Pod) error { + // this short-cicuit is needed for cases when we pass a list of pods instead + // of newly created pod (e.g. VerifyPods) which means we are getting already + // running pod for which waiting does not make sense and will always fail + if pod.Status.Phase == v1.PodRunning { + return nil + } + return waitTimeoutForPodRunningInNamespace(c, pod.Name, pod.Namespace, pod.ResourceVersion, PodStartTimeout) +} + +func waitTimeoutForPodRunningInNamespace(c clientset.Interface, podName, namespace, resourceVersion string, timeout time.Duration) error { + w, err := c.Core().Pods(namespace).Watch(SingleObject(v1.ObjectMeta{Name: podName, ResourceVersion: resourceVersion})) + if err != nil { + return err + } + _, err = watch.Until(timeout, w, PodRunning) + return err +} + +// SingleObject returns a ListOptions for watching a single object. +func SingleObject(meta v1.ObjectMeta) v1.ListOptions { + return v1.ListOptions{ + FieldSelector: fields.OneTermEqualSelector("metadata.name", meta.Name).String(), + ResourceVersion: meta.ResourceVersion, + } +} + +// ErrPodCompleted is returned by PodRunning or PodContainerRunning to indicate that +// the pod has already reached completed state. +var ErrPodCompleted = fmt.Errorf("pod ran to completion") + +// PodRunning returns true if the pod is running, false if the pod has not yet reached running state, +// returns ErrPodCompleted if the pod has run to completion, or an error in any other case. +func PodRunning(event watch.Event) (bool, error) { + switch event.Type { + case watch.Deleted: + return false, apierrs.NewNotFound(unversioned.GroupResource{Resource: "pods"}, "") + } + switch t := event.Object.(type) { + case *v1.Pod: + switch t.Status.Phase { + case v1.PodRunning: + return true, nil + case v1.PodFailed, v1.PodSucceeded: + return false, ErrPodCompleted + } + } + return false, nil +} + +// waitForPodSuccessInNamespaceTimeout returns nil if the pod reached state success, or an error if it reached failure or ran too long. +func waitForPodSuccessInNamespaceTimeout(c clientset.Interface, podName string, namespace string, timeout time.Duration) error { + return waitForPodCondition(c, namespace, podName, "success or failure", timeout, func(pod *v1.Pod) (bool, error) { + if pod.Spec.RestartPolicy == v1.RestartPolicyAlways { + return true, fmt.Errorf("pod %q will never terminate with a succeeded state since its restart policy is Always", podName) + } + switch pod.Status.Phase { + case v1.PodSucceeded: + By("Saw pod success") + return true, nil + case v1.PodFailed: + return true, fmt.Errorf("pod %q failed with status: %+v", podName, pod.Status) + default: + return false, nil + } + }) +} + +// WaitForPodSuccessInNamespace returns nil if the pod reached state success, or an error if it reached failure or until podStartupTimeout. +func WaitForPodSuccessInNamespace(c clientset.Interface, podName string, namespace string) error { + return waitForPodSuccessInNamespaceTimeout(c, podName, namespace, PodStartTimeout) +} + +// WaitForPodSuccessInNamespaceSlow returns nil if the pod reached state success, or an error if it reached failure or until slowPodStartupTimeout. +func WaitForPodSuccessInNamespaceSlow(c clientset.Interface, podName string, namespace string) error { + return waitForPodSuccessInNamespaceTimeout(c, podName, namespace, slowPodStartTimeout) +} + +// ServerVersionGTE returns true if v is greater than or equal to the server +// version. +// +// TODO(18726): This should be incorporated into client.VersionInterface. +func ServerVersionGTE(v semver.Version, c discovery.ServerVersionInterface) (bool, error) { + serverVersion, err := c.ServerVersion() + if err != nil { + return false, fmt.Errorf("Unable to get server version: %v", err) + } + sv, err := version.Parse(serverVersion.GitVersion) + if err != nil { + return false, fmt.Errorf("Unable to parse server version %q: %v", serverVersion.GitVersion, err) + } + return sv.GTE(v), nil +} + +func restclientConfig(kubeContext string) (*clientcmdapi.Config, error) { + Logf(">>> kubeConfig: %s\n", TestContext.KubeConfig) + if TestContext.KubeConfig == "" { + return nil, fmt.Errorf("KubeConfig must be specified to load client config") + } + c, err := clientcmd.LoadFromFile(TestContext.KubeConfig) + if err != nil { + return nil, fmt.Errorf("error loading KubeConfig: %v", err.Error()) + } + if kubeContext != "" { + Logf(">>> kubeContext: %s\n", kubeContext) + c.CurrentContext = kubeContext + } + return c, nil +} + +func LoadConfig() (*restclient.Config, error) { + if TestContext.NodeE2E { + // This is a node e2e test, apply the node e2e configuration + return &restclient.Config{Host: TestContext.Host}, nil + } + c, err := restclientConfig(TestContext.KubeContext) + if err != nil { + return nil, err + } + + return clientcmd.NewDefaultClientConfig(*c, &clientcmd.ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: TestContext.Host}}).ClientConfig() +} + +func ExpectNoError(err error, explain ...interface{}) { + if err != nil { + Logf("Unexpected error occurred: %v", err) + } + ExpectWithOffset(1, err).NotTo(HaveOccurred(), explain...) +} + +type EventsLister func(opts v1.ListOptions, ns string) (*v1.EventList, error) + +func DumpEventsInNamespace(eventsLister EventsLister, namespace string) { + By(fmt.Sprintf("Collecting events from namespace %q.", namespace)) + events, err := eventsLister(v1.ListOptions{}, namespace) + Expect(err).NotTo(HaveOccurred()) + + By(fmt.Sprintf("Found %d events.", len(events.Items))) + // Sort events by their first timestamp + sortedEvents := events.Items + if len(sortedEvents) > 1 { + sort.Sort(byFirstTimestamp(sortedEvents)) + } + for _, e := range sortedEvents { + Logf("At %v - event for %v: %v %v: %v", e.FirstTimestamp, e.InvolvedObject.Name, e.Source, e.Reason, e.Message) + } + // Note that we don't wait for any Cleanup to propagate, which means + // that if you delete a bunch of pods right before ending your test, + // you may or may not see the killing/deletion/Cleanup events. +} + +func DumpAllNamespaceInfo(c clientset.Interface, namespace string) { + DumpEventsInNamespace(func(opts v1.ListOptions, ns string) (*v1.EventList, error) { + return c.Core().Events(ns).List(opts) + }, namespace) + + // If cluster is large, then the following logs are basically useless, because: + // 1. it takes tens of minutes or hours to grab all of them + // 2. there are so many of them that working with them are mostly impossible + // So we dump them only if the cluster is relatively small. + maxNodesForDump := 20 + if nodes, err := c.Core().Nodes().List(v1.ListOptions{}); err == nil { + if len(nodes.Items) <= maxNodesForDump { + dumpAllPodInfo(c) + dumpAllNodeInfo(c) + } else { + Logf("skipping dumping cluster info - cluster too large") + } + } else { + Logf("unable to fetch node list: %v", err) + } +} + +// byFirstTimestamp sorts a slice of events by first timestamp, using their involvedObject's name as a tie breaker. +type byFirstTimestamp []v1.Event + +func (o byFirstTimestamp) Len() int { return len(o) } +func (o byFirstTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] } + +func (o byFirstTimestamp) Less(i, j int) bool { + if o[i].FirstTimestamp.Equal(o[j].FirstTimestamp) { + return o[i].InvolvedObject.Name < o[j].InvolvedObject.Name + } + return o[i].FirstTimestamp.Before(o[j].FirstTimestamp) +} + +func dumpAllPodInfo(c clientset.Interface) { + pods, err := c.Core().Pods("").List(v1.ListOptions{}) + if err != nil { + Logf("unable to fetch pod debug info: %v", err) + } + logPodStates(pods.Items) +} + +func dumpAllNodeInfo(c clientset.Interface) { + // It should be OK to list unschedulable Nodes here. + nodes, err := c.Core().Nodes().List(v1.ListOptions{}) + if err != nil { + Logf("unable to fetch node list: %v", err) + return + } + names := make([]string, len(nodes.Items)) + for ix := range nodes.Items { + names[ix] = nodes.Items[ix].Name + } + DumpNodeDebugInfo(c, names, Logf) +} + +func DumpNodeDebugInfo(c clientset.Interface, nodeNames []string, logFunc func(fmt string, args ...interface{})) { + for _, n := range nodeNames { + logFunc("\nLogging node info for node %v", n) + node, err := c.Core().Nodes().Get(n) + if err != nil { + logFunc("Error getting node info %v", err) + } + logFunc("Node Info: %v", node) + + logFunc("\nLogging kubelet events for node %v", n) + for _, e := range getNodeEvents(c, n) { + logFunc("source %v type %v message %v reason %v first ts %v last ts %v, involved obj %+v", + e.Source, e.Type, e.Message, e.Reason, e.FirstTimestamp, e.LastTimestamp, e.InvolvedObject) + } + logFunc("\nLogging pods the kubelet thinks is on node %v", n) + podList, err := GetKubeletPods(c, n) + if err != nil { + logFunc("Unable to retrieve kubelet pods for node %v", n) + continue + } + for _, p := range podList.Items { + logFunc("%v started at %v (%d+%d container statuses recorded)", p.Name, p.Status.StartTime, len(p.Status.InitContainerStatuses), len(p.Status.ContainerStatuses)) + for _, c := range p.Status.InitContainerStatuses { + logFunc("\tInit container %v ready: %v, restart count %v", + c.Name, c.Ready, c.RestartCount) + } + for _, c := range p.Status.ContainerStatuses { + logFunc("\tContainer %v ready: %v, restart count %v", + c.Name, c.Ready, c.RestartCount) + } + } + // HighLatencyKubeletOperations(c, 10*time.Second, n, logFunc) + // TODO: Log node resource info + } +} + +// logNodeEvents logs kubelet events from the given node. This includes kubelet +// restart and node unhealthy events. Note that listing events like this will mess +// with latency metrics, beware of calling it during a test. +func getNodeEvents(c clientset.Interface, nodeName string) []v1.Event { + selector := fields.Set{ + "involvedObject.kind": "Node", + "involvedObject.name": nodeName, + "involvedObject.namespace": v1.NamespaceAll, + "source": "kubelet", + }.AsSelector() + options := v1.ListOptions{FieldSelector: selector.String()} + events, err := c.Core().Events(api.NamespaceSystem).List(options) + if err != nil { + Logf("Unexpected error retrieving node events %v", err) + return []v1.Event{} + } + return events.Items +} + +func isNodeConditionSetAsExpected(node *v1.Node, conditionType v1.NodeConditionType, wantTrue, silent bool) bool { + // Check the node readiness condition (logging all). + for _, cond := range node.Status.Conditions { + // Ensure that the condition type and the status matches as desired. + if cond.Type == conditionType { + if (cond.Status == v1.ConditionTrue) == wantTrue { + return true + } else { + if !silent { + Logf("Condition %s of node %s is %v instead of %t. Reason: %v, message: %v", + conditionType, node.Name, cond.Status == v1.ConditionTrue, wantTrue, cond.Reason, cond.Message) + } + return false + } + } + } + if !silent { + Logf("Couldn't find condition %v on node %v", conditionType, node.Name) + } + return false +} + +func IsNodeConditionSetAsExpected(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool { + return isNodeConditionSetAsExpected(node, conditionType, wantTrue, false) +} + +func IsNodeConditionSetAsExpectedSilent(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool { + return isNodeConditionSetAsExpected(node, conditionType, wantTrue, true) +} + +// Checks whether not-ready nodes can be ignored while checking if all nodes are +// ready (we allow e.g. for incorrect provisioning of some small percentage of nodes +// while validating cluster, and those nodes may never become healthy). +// Currently we allow only for: +// - not present CNI plugins on node +// TODO: we should extend it for other reasons. +func allowedNotReadyReasons(nodes []*v1.Node) bool { + for _, node := range nodes { + index, condition := GetNodeCondition(&node.Status, v1.NodeReady) + if index == -1 || + !strings.Contains(condition.Message, "could not locate kubenet required CNI plugins") { + return false + } + } + return true +} + +// GetNodeCondition extracts the provided condition from the given status and returns that. +// Returns nil and -1 if the condition is not present, and the index of the located condition. +func GetNodeCondition(status *v1.NodeStatus, conditionType v1.NodeConditionType) (int, *v1.NodeCondition) { + if status == nil { + return -1, nil + } + for i := range status.Conditions { + if status.Conditions[i].Type == conditionType { + return i, &status.Conditions[i] + } + } + return -1, nil +} + +// Checks whether all registered nodes are ready. +// TODO: we should change the AllNodesReady call in AfterEach to WaitForAllNodesHealthy, +// and figure out how to do it in a configurable way, as we can't expect all setups to run +// default test add-ons. +func AllNodesReady(c clientset.Interface, timeout time.Duration) error { + Logf("Waiting up to %v for all (but %d) nodes to be ready", timeout, TestContext.AllowedNotReadyNodes) + + var notReady []*v1.Node + err := wait.PollImmediate(Poll, timeout, func() (bool, error) { + notReady = nil + // It should be OK to list unschedulable Nodes here. + nodes, err := c.Core().Nodes().List(v1.ListOptions{}) + if err != nil { + return false, err + } + for i := range nodes.Items { + node := &nodes.Items[i] + if !IsNodeConditionSetAsExpected(node, v1.NodeReady, true) { + notReady = append(notReady, node) + } + } + // Framework allows for nodes to be non-ready, + // to make it possible e.g. for incorrect deployment of some small percentage + // of nodes (which we allow in cluster validation). Some nodes that are not + // provisioned correctly at startup will never become ready (e.g. when something + // won't install correctly), so we can't expect them to be ready at any point. + // + // However, we only allow non-ready nodes with some specific reasons. + if len(notReady) > TestContext.AllowedNotReadyNodes { + return false, nil + } + return allowedNotReadyReasons(notReady), nil + }) + + if err != nil && err != wait.ErrWaitTimeout { + return err + } + + if len(notReady) > TestContext.AllowedNotReadyNodes || !allowedNotReadyReasons(notReady) { + return fmt.Errorf("Not ready nodes: %#v", notReady) + } + return nil +} + +// timeout for proxy requests. +const proxyTimeout = 2 * time.Minute + +// NodeProxyRequest performs a get on a node proxy endpoint given the nodename and rest client. +func NodeProxyRequest(c clientset.Interface, node, endpoint string) (restclient.Result, error) { + // proxy tends to hang in some cases when Node is not ready. Add an artificial timeout for this call. + // This will leak a goroutine if proxy hangs. #22165 + subResourceProxyAvailable, err := ServerVersionGTE(subResourceServiceAndNodeProxyVersion, c.Discovery()) + if err != nil { + return restclient.Result{}, err + } + var result restclient.Result + finished := make(chan struct{}) + go func() { + if subResourceProxyAvailable { + result = c.Core().RESTClient().Get(). + Resource("nodes"). + SubResource("proxy"). + Name(fmt.Sprintf("%v:%v", node, ports.KubeletPort)). + Suffix(endpoint). + Do() + + } else { + result = c.Core().RESTClient().Get(). + Prefix("proxy"). + Resource("nodes"). + Name(fmt.Sprintf("%v:%v", node, ports.KubeletPort)). + Suffix(endpoint). + Do() + } + finished <- struct{}{} + }() + select { + case <-finished: + return result, nil + case <-time.After(proxyTimeout): + return restclient.Result{}, nil + } +} + +// GetKubeletPods retrieves the list of pods on the kubelet +func GetKubeletPods(c clientset.Interface, node string) (*v1.PodList, error) { + return getKubeletPods(c, node, "pods") +} + +func getKubeletPods(c clientset.Interface, node, resource string) (*v1.PodList, error) { + result := &v1.PodList{} + client, err := NodeProxyRequest(c, node, resource) + if err != nil { + return &v1.PodList{}, err + } + if err = client.Into(result); err != nil { + return &v1.PodList{}, err + } + return result, nil +} + +func WaitForPodToDisappear(c clientset.Interface, ns, podName string, label labels.Selector, interval, timeout time.Duration) error { + return wait.PollImmediate(interval, timeout, func() (bool, error) { + Logf("Waiting for pod %s to disappear", podName) + options := v1.ListOptions{LabelSelector: label.String()} + pods, err := c.Core().Pods(ns).List(options) + if err != nil { + return false, err + } + found := false + for _, pod := range pods.Items { + if pod.Name == podName { + Logf("Pod %s still exists", podName) + found = true + break + } + } + if !found { + Logf("Pod %s no longer exists", podName) + return true, nil + } + return false, nil + }) +} + +func WaitForDeploymentPodsRunning(c clientset.Interface, ns, name string) error { + deployment, err := c.Extensions().Deployments(ns).Get(name) + if err != nil { + return err + } + selector := labels.SelectorFromSet(labels.Set(deployment.Spec.Selector.MatchLabels)) + err = WaitForPodsWithLabelRunning(c, ns, selector) + if err != nil { + return fmt.Errorf("Error while waiting for Deployment %s pods to be running: %v", name, err) + } + return nil +} + +// Wait up to 1 minute for all matching pods to become Running and at least one +// matching pod exists. +func WaitForPodsWithLabelRunning(c clientset.Interface, ns string, label labels.Selector) error { + running := false + options := v1.ListOptions{LabelSelector: label.String()} + podClient := c.Core().Pods(ns) +waitLoop: + for start := time.Now(); time.Since(start) < 1*time.Minute; time.Sleep(5 * time.Second) { + pods, err := podClient.List(options) + if err != nil { + continue waitLoop + } + if len(pods.Items) == 0 { + continue waitLoop + } + for _, p := range pods.Items { + if p.Status.Phase != v1.PodRunning { + continue waitLoop + } + } + running = true + break + } + if !running { + return fmt.Errorf("Timeout while waiting for pods with labels %q to be running", label.String()) + } + return nil +} diff --git a/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/trash.yaml b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/trash.yaml new file mode 100644 index 00000000..901f2189 --- /dev/null +++ b/nfs/vendor/github.com/kubernetes-incubator/external-storage/nfs/trash.yaml @@ -0,0 +1,55 @@ +# package +github.com/kubernetes-incubator/external-storage/nfs + +cloud.google.com/go v0.4.0-54-g2c3878e +github.com/PuerkitoBio/purell v1.1.0 +github.com/PuerkitoBio/urlesc 5bd2802 +github.com/blang/semver v3.3.0 +github.com/coreos/go-oidc 5a7f09a +github.com/coreos/pkg v3-2-g447b7ec +github.com/davecgh/go-spew v1.1.0 +github.com/docker/distribution v2.6.0-rc.1-4-g7694c31 +github.com/docker/docker docs-v1.12.0-rc4-2016-07-15-3908-gab65ac6 +github.com/emicklei/go-restful v1.2-92-g858e58f +github.com/fsnotify/fsnotify v1.4.2-2-gfd9ec7d +github.com/ghodss/yaml bea76d6 +github.com/go-openapi/jsonpointer 8d96a2d +github.com/go-openapi/jsonreference 36d33bf +github.com/go-openapi/spec 3a04341 +github.com/go-openapi/swag 3b6d86c +github.com/gogo/protobuf v0.3-127-g8d70fb3 +github.com/golang/glog 23def4e +github.com/golang/groupcache a6b377e +github.com/golang/protobuf 8ee7999 +github.com/google/gofuzz fd52762 +github.com/guelfey/go.dbus f6a3a23 +github.com/hashicorp/hcl c3e054b +github.com/howeyc/gopass f5387c4 +github.com/imdario/mergo 0.2.2-6-g50d4dbd +github.com/jonboulle/clockwork v0.1.0-4-gbcac988 +github.com/kubernetes-incubator/nfs-provisioner #TODO! +github.com/magiconair/properties v1.7.0-5-g0723e35 +github.com/mailru/easyjson 159cdb8 +github.com/mitchellh/mapstructure f3009df +github.com/onsi/ginkgo v1.2.0-87-g00054c0 +github.com/onsi/gomega v1.0-149-g2b6ed62 +github.com/opencontainers/runc v1.0.0-rc2-173-g083933f +github.com/pborman/uuid v1.0-17-g3d4f2ba +github.com/pelletier/go-buffruneio df1e16f +github.com/pelletier/go-toml v0.3.5-16-g45932ad +github.com/spf13/afero 06b7e5f +github.com/spf13/cast 24b6558 +github.com/spf13/jwalterweatherman 33c24e7 +github.com/spf13/pflag 5ccb023 +github.com/spf13/viper 651d9d9 +github.com/ugorji/go faddd61 +golang.org/x/crypto 9477e0b +golang.org/x/net 4971afd +golang.org/x/oauth2 d5040cd +golang.org/x/sys b699b70 +golang.org/x/text a263ba8 +google.golang.org/appengine v1.0.0-19-gca59ef3 +gopkg.in/inf.v0 v0.9.0 +gopkg.in/yaml.v2 a5b47d3 +k8s.io/client-go v2.0.0-alpha.0-9-g89c6009 +k8s.io/kubernetes v1.6.0-alpha.0-635-g0664405 diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/controller/controller_test.go b/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/controller/controller_test.go deleted file mode 100644 index 414fc21e..00000000 --- a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/controller/controller_test.go +++ /dev/null @@ -1,676 +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 controller - -import ( - "errors" - "fmt" - "reflect" - "strconv" - "sync" - "testing" - "time" - - "github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection" - rl "github.com/kubernetes-incubator/nfs-provisioner/lib/leaderelection/resourcelock" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/kubernetes/fake" - fakev1core "k8s.io/client-go/kubernetes/typed/core/v1/fake" - "k8s.io/client-go/pkg/api/resource" - "k8s.io/client-go/pkg/api/testapi" - "k8s.io/client-go/pkg/api/v1" - "k8s.io/client-go/pkg/apis/storage/v1beta1" - "k8s.io/client-go/pkg/conversion" - "k8s.io/client-go/pkg/runtime" - "k8s.io/client-go/pkg/types" - "k8s.io/client-go/pkg/watch" - testclient "k8s.io/client-go/testing" - fcache "k8s.io/client-go/tools/cache/testing" -) - -const ( - resyncPeriod = 100 * time.Millisecond - failedRetryThreshold = 5 -) - -// TODO clean this up, e.g. remove redundant params (provisionerName: "foo.bar/baz") -func TestController(t *testing.T) { - tests := []struct { - name string - objs []runtime.Object - provisionerName string - provisioner Provisioner - verbs []string - reaction testclient.ReactionFunc - expectedVolumes []v1.PersistentVolume - }{ - { - name: "provision for claim-1 but not claim-2", - objs: []runtime.Object{ - newStorageClass("class-1", "foo.bar/baz"), - newStorageClass("class-2", "abc.def/ghi"), - newClaim("claim-1", "uid-1-1", "class-1", "", nil), - newClaim("claim-2", "uid-1-2", "class-2", "", nil), - }, - provisionerName: "foo.bar/baz", - provisioner: newTestProvisioner(), - expectedVolumes: []v1.PersistentVolume{ - *newProvisionedVolume(newStorageClass("class-1", "foo.bar/baz"), newClaim("claim-1", "uid-1-1", "class-1", "", nil)), - }, - }, - { - name: "delete volume-1 but not volume-2", - objs: []runtime.Object{ - newVolume("volume-1", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - newVolume("volume-2", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "abc.def/ghi"}), - }, - provisionerName: "foo.bar/baz", - provisioner: newTestProvisioner(), - expectedVolumes: []v1.PersistentVolume{ - *newVolume("volume-2", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "abc.def/ghi"}), - }, - }, - { - name: "don't provision for claim-1 because it's already bound", - objs: []runtime.Object{ - newClaim("claim-1", "uid-1-1", "class-1", "volume-1", nil), - }, - provisionerName: "foo.bar/baz", - provisioner: newTestProvisioner(), - expectedVolumes: []v1.PersistentVolume(nil), - }, - { - name: "don't provision for claim-1 because its class doesn't exist", - objs: []runtime.Object{ - newClaim("claim-1", "uid-1-1", "class-1", "", nil), - }, - provisionerName: "foo.bar/baz", - provisioner: newTestProvisioner(), - expectedVolumes: []v1.PersistentVolume(nil), - }, - { - name: "don't delete volume-1 because it's still bound", - objs: []runtime.Object{ - newVolume("volume-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - }, - provisionerName: "foo.bar/baz", - provisioner: newTestProvisioner(), - expectedVolumes: []v1.PersistentVolume{ - *newVolume("volume-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - }, - }, - { - name: "don't delete volume-1 because its reclaim policy is not delete", - objs: []runtime.Object{ - newVolume("volume-1", v1.VolumeReleased, v1.PersistentVolumeReclaimRetain, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - }, - provisionerName: "foo.bar/baz", - provisioner: newTestProvisioner(), - expectedVolumes: []v1.PersistentVolume{ - *newVolume("volume-1", v1.VolumeReleased, v1.PersistentVolumeReclaimRetain, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - }, - }, - { - name: "provisioner fails to provision for claim-1: no pv is created", - objs: []runtime.Object{ - newStorageClass("class-1", "foo.bar/baz"), - newClaim("claim-1", "uid-1-1", "class-1", "", nil), - }, - provisionerName: "foo.bar/baz", - provisioner: newBadTestProvisioner(), - expectedVolumes: []v1.PersistentVolume(nil), - }, - { - name: "provisioner fails to delete volume-1: pv is not deleted", - objs: []runtime.Object{ - newVolume("volume-1", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - }, - provisionerName: "foo.bar/baz", - provisioner: newBadTestProvisioner(), - expectedVolumes: []v1.PersistentVolume{ - *newVolume("volume-1", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - }, - }, - { - name: "try to provision for claim-1 but fail to save the pv object", - objs: []runtime.Object{ - newStorageClass("class-1", "foo.bar/baz"), - newClaim("claim-1", "uid-1-1", "class-1", "", nil), - }, - provisionerName: "foo.bar/baz", - provisioner: newTestProvisioner(), - verbs: []string{"create"}, - reaction: func(action testclient.Action) (handled bool, ret runtime.Object, err error) { - return true, nil, errors.New("fake error") - }, - expectedVolumes: []v1.PersistentVolume(nil), - }, - { - name: "try to delete volume-1 but fail to delete the pv object", - objs: []runtime.Object{ - newVolume("volume-1", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - }, - provisionerName: "foo.bar/baz", - provisioner: newTestProvisioner(), - verbs: []string{"delete"}, - reaction: func(action testclient.Action) (handled bool, ret runtime.Object, err error) { - return true, nil, errors.New("fake error") - }, - expectedVolumes: []v1.PersistentVolume{ - *newVolume("volume-1", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - }, - }, - } - for _, test := range tests { - client := fake.NewSimpleClientset(test.objs...) - if len(test.verbs) != 0 { - for _, v := range test.verbs { - client.Fake.PrependReactor(v, "persistentvolumes", test.reaction) - } - } - ctrl := newTestProvisionController(client, resyncPeriod, test.provisionerName, test.provisioner, "v1.5.0", false, failedRetryThreshold) - stopCh := make(chan struct{}) - go ctrl.Run(stopCh) - - time.Sleep(2 * resyncPeriod) - ctrl.runningOperations.Wait() - - pvList, _ := client.Core().PersistentVolumes().List(v1.ListOptions{}) - if !reflect.DeepEqual(test.expectedVolumes, pvList.Items) { - t.Logf("test case: %s", test.name) - t.Errorf("expected PVs:\n %v\n but got:\n %v\n", test.expectedVolumes, pvList.Items) - } - close(stopCh) - } -} - -func TestMultipleControllers(t *testing.T) { - tests := []struct { - name string - provisionerName string - numControllers int - numClaims int - expectedCalls int - }{ - { - name: "call provision exactly once", - provisionerName: "foo.bar/baz", - numControllers: 5, - numClaims: 1, - expectedCalls: 1, - }, - } - for _, test := range tests { - client := fake.NewSimpleClientset() - - // Create a reactor to reject Updates if object has already been modified, - // like etcd. - claimSource := fcache.NewFakePVCControllerSource() - reactor := claimReactor{ - fake: &fakev1core.FakeCoreV1{Fake: &client.Fake}, - claims: make(map[string]*v1.PersistentVolumeClaim), - lock: sync.Mutex{}, - claimSource: claimSource, - } - reactor.claims["claim-1"] = newClaim("claim-1", "uid-1-1", "class-1", "", nil) - client.PrependReactor("update", "persistentvolumeclaims", reactor.React) - client.PrependReactor("get", "persistentvolumeclaims", reactor.React) - - // Create a fake watch so each controller can get ProvisioningSucceeded - fakeWatch := watch.NewFakeWithChanSize(test.numControllers, false) - client.PrependWatchReactor("events", testclient.DefaultWatchReactor(fakeWatch, nil)) - client.PrependReactor("create", "events", func(action testclient.Action) (bool, runtime.Object, error) { - obj := action.(testclient.CreateAction).GetObject() - for i := 0; i < test.numControllers; i++ { - fakeWatch.Add(obj) - } - return true, obj, nil - }) - - provisioner := newTestProvisioner() - ctrls := make([]*ProvisionController, test.numControllers) - stopChs := make([]chan struct{}, test.numControllers) - for i := 0; i < test.numControllers; i++ { - ctrls[i] = NewProvisionController(client, 15*time.Second, test.provisionerName, provisioner, "v1.5.0", false, failedRetryThreshold, leaderelection.DefaultLeaseDuration, leaderelection.DefaultRenewDeadline, leaderelection.DefaultRetryPeriod, leaderelection.DefaultTermLimit) - ctrls[i].createProvisionedPVInterval = 10 * time.Millisecond - ctrls[i].claimSource = claimSource - ctrls[i].claims.Add(newClaim("claim-1", "uid-1-1", "class-1", "", nil)) - ctrls[i].classes.Add(newStorageClass("class-1", "foo.bar/baz")) - stopChs[i] = make(chan struct{}) - } - - for i := 0; i < test.numControllers; i++ { - go ctrls[i].addClaim(newClaim("claim-1", "uid-1-1", "class-1", "", nil)) - } - - // Sleep for 3 election retry periods - time.Sleep(3 * ctrls[0].retryPeriod) - - if test.expectedCalls != len(provisioner.provisionCalls) { - t.Logf("test case: %s", test.name) - t.Errorf("expected provision calls:\n %v\n but got:\n %v\n", test.expectedCalls, len(provisioner.provisionCalls)) - } - - for _, stopCh := range stopChs { - close(stopCh) - } - } -} - -func TestShouldProvision(t *testing.T) { - tests := []struct { - name string - provisionerName string - class *v1beta1.StorageClass - claim *v1.PersistentVolumeClaim - expectedShould bool - }{ - { - name: "should provision", - provisionerName: "foo.bar/baz", - class: newStorageClass("class-1", "foo.bar/baz"), - claim: newClaim("claim-1", "1-1", "class-1", "", nil), - expectedShould: true, - }, - { - name: "claim already bound", - provisionerName: "foo.bar/baz", - class: newStorageClass("class-1", "foo.bar/baz"), - claim: newClaim("claim-1", "1-1", "class-1", "foo", nil), - expectedShould: false, - }, - { - name: "no such class", - provisionerName: "foo.bar/baz", - class: newStorageClass("class-1", "foo.bar/baz"), - claim: newClaim("claim-1", "1-1", "class-2", "", nil), - expectedShould: false, - }, - { - name: "not this provisioner's job", - provisionerName: "foo.bar/baz", - class: newStorageClass("class-1", "abc.def/ghi"), - claim: newClaim("claim-1", "1-1", "class-1", "", nil), - expectedShould: false, - }, - // Kubernetes 1.5 provisioning - annDynamicallyProvisioned is set - // and only this annotation is evaluated - { - name: "should provision 1.5", - provisionerName: "foo.bar/baz", - class: newStorageClass("class-2", "abc.def/ghi"), - claim: newClaim("claim-1", "1-1", "class-1", "", - map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - expectedShould: true, - }, - { - name: "unknown provisioner 1.5", - provisionerName: "foo.bar/baz", - class: newStorageClass("class-1", "foo.bar/baz"), - claim: newClaim("claim-1", "1-1", "class-1", "", - map[string]string{annDynamicallyProvisioned: "abc.def/ghi"}), - expectedShould: false, - }, - } - for _, test := range tests { - client := fake.NewSimpleClientset(test.claim) - provisioner := newTestProvisioner() - ctrl := newTestProvisionController(client, resyncPeriod, test.provisionerName, provisioner, "v1.5.0", false, failedRetryThreshold) - - err := ctrl.classes.Add(test.class) - if err != nil { - t.Logf("test case: %s", test.name) - t.Errorf("error adding class %v to cache: %v", test.class, err) - } - - should := ctrl.shouldProvision(test.claim) - if test.expectedShould != should { - t.Logf("test case: %s", test.name) - t.Errorf("expected should provision %v but got %v\n", test.expectedShould, should) - } - } -} - -func TestShouldDelete(t *testing.T) { - tests := []struct { - name string - provisionerName string - volume *v1.PersistentVolume - serverGitVersion string - expectedShould bool - }{ - { - name: "should delete", - provisionerName: "foo.bar/baz", - volume: newVolume("volume-1", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - serverGitVersion: "v1.5.0", - expectedShould: true, - }, - { - name: "1.4 and failed: should delete", - provisionerName: "foo.bar/baz", - volume: newVolume("volume-1", v1.VolumeFailed, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - serverGitVersion: "v1.4.0", - expectedShould: true, - }, - { - name: "1.5 and failed: shouldn't delete", - provisionerName: "foo.bar/baz", - volume: newVolume("volume-1", v1.VolumeFailed, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - serverGitVersion: "v1.5.0", - expectedShould: false, - }, - { - name: "volume still bound", - provisionerName: "foo.bar/baz", - volume: newVolume("volume-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - serverGitVersion: "v1.5.0", - expectedShould: false, - }, - { - name: "non-delete reclaim policy", - provisionerName: "foo.bar/baz", - volume: newVolume("volume-1", v1.VolumeReleased, v1.PersistentVolumeReclaimRetain, map[string]string{annDynamicallyProvisioned: "foo.bar/baz"}), - serverGitVersion: "v1.5.0", - expectedShould: false, - }, - { - name: "not this provisioner's job", - provisionerName: "foo.bar/baz", - volume: newVolume("volume-1", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, map[string]string{annDynamicallyProvisioned: "abc.def/ghi"}), - serverGitVersion: "v1.5.0", - expectedShould: false, - }, - } - for _, test := range tests { - client := fake.NewSimpleClientset() - provisioner := newTestProvisioner() - ctrl := newTestProvisionController(client, resyncPeriod, test.provisionerName, provisioner, test.serverGitVersion, false, failedRetryThreshold) - - should := ctrl.shouldDelete(test.volume) - if test.expectedShould != should { - t.Logf("test case: %s", test.name) - t.Errorf("expected should delete %v but got %v\n", test.expectedShould, should) - } - } -} - -func TestIsOnlyRecordUpdate(t *testing.T) { - tests := []struct { - name string - old *v1.PersistentVolumeClaim - new *v1.PersistentVolumeClaim - expectedIs bool - }{ - { - name: "is only record update", - old: newClaim("claim-1", "1-1", "class-1", "", map[string]string{rl.LeaderElectionRecordAnnotationKey: "a"}), - new: newClaim("claim-1", "1-1", "class-1", "", map[string]string{rl.LeaderElectionRecordAnnotationKey: "b"}), - expectedIs: true, - }, - { - name: "is seen as only record update, stayed exactly the same", - old: newClaim("claim-1", "1-1", "class-1", "", map[string]string{rl.LeaderElectionRecordAnnotationKey: "a"}), - new: newClaim("claim-1", "1-1", "class-1", "", map[string]string{rl.LeaderElectionRecordAnnotationKey: "a"}), - expectedIs: true, - }, - { - name: "isn't only record update, class changed as well", - old: newClaim("claim-1", "1-1", "class-1", "", map[string]string{rl.LeaderElectionRecordAnnotationKey: "a"}), - new: newClaim("claim-1", "1-1", "class-2", "", map[string]string{rl.LeaderElectionRecordAnnotationKey: "b"}), - expectedIs: false, - }, - { - name: "isn't only record update, only class changed", - old: newClaim("claim-1", "1-1", "class-1", "", map[string]string{rl.LeaderElectionRecordAnnotationKey: "a"}), - new: newClaim("claim-1", "1-1", "class-2", "", map[string]string{rl.LeaderElectionRecordAnnotationKey: "a"}), - expectedIs: false, - }, - } - for _, test := range tests { - client := fake.NewSimpleClientset() - provisioner := newTestProvisioner() - ctrl := newTestProvisionController(client, resyncPeriod, "foo.bar/baz", provisioner, "v1.5.0", false, failedRetryThreshold) - - is, _ := ctrl.isOnlyRecordUpdate(test.old, test.new) - if test.expectedIs != is { - t.Logf("test case: %s", test.name) - t.Errorf("expected is only record update %v but got %v\n", test.expectedIs, is) - } - } -} - -func newTestProvisionController( - client kubernetes.Interface, - resyncPeriod time.Duration, - provisionerName string, - provisioner Provisioner, - serverGitVersion string, - exponentialBackOffOnError bool, - failedRetryThreshold int, -) *ProvisionController { - ctrl := NewProvisionController(client, resyncPeriod, provisionerName, provisioner, serverGitVersion, exponentialBackOffOnError, failedRetryThreshold, 2*resyncPeriod, resyncPeriod, resyncPeriod/2, 2*resyncPeriod) - ctrl.createProvisionedPVInterval = 10 * time.Millisecond - return ctrl -} - -func newStorageClass(name, provisioner string) *v1beta1.StorageClass { - return &v1beta1.StorageClass{ - ObjectMeta: v1.ObjectMeta{ - Name: name, - }, - Provisioner: provisioner, - } -} - -func newClaim(name, claimUID, provisioner, volumeName string, annotations map[string]string) *v1.PersistentVolumeClaim { - claim := &v1.PersistentVolumeClaim{ - ObjectMeta: v1.ObjectMeta{ - Name: name, - Namespace: v1.NamespaceDefault, - UID: types.UID(claimUID), - ResourceVersion: "0", - Annotations: map[string]string{annClass: provisioner}, - SelfLink: testapi.Default.SelfLink("pvc", ""), - }, - Spec: v1.PersistentVolumeClaimSpec{ - AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce, v1.ReadOnlyMany}, - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceName(v1.ResourceStorage): resource.MustParse("1Mi"), - }, - }, - VolumeName: volumeName, - }, - Status: v1.PersistentVolumeClaimStatus{ - Phase: v1.ClaimPending, - }, - } - for k, v := range annotations { - claim.Annotations[k] = v - } - return claim -} - -func newVolume(name string, phase v1.PersistentVolumePhase, policy v1.PersistentVolumeReclaimPolicy, annotations map[string]string) *v1.PersistentVolume { - pv := &v1.PersistentVolume{ - ObjectMeta: v1.ObjectMeta{ - Name: name, - Annotations: annotations, - }, - Spec: v1.PersistentVolumeSpec{ - PersistentVolumeReclaimPolicy: policy, - AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce, v1.ReadOnlyMany}, - Capacity: v1.ResourceList{ - v1.ResourceName(v1.ResourceStorage): resource.MustParse("1Mi"), - }, - PersistentVolumeSource: v1.PersistentVolumeSource{ - NFS: &v1.NFSVolumeSource{ - Server: "foo", - Path: "bar", - ReadOnly: false, - }, - }, - }, - Status: v1.PersistentVolumeStatus{ - Phase: phase, - }, - } - - return pv -} - -// newProvisionedVolume returns the volume the test controller should provision for the -// given claim with the given class -func newProvisionedVolume(storageClass *v1beta1.StorageClass, claim *v1.PersistentVolumeClaim) *v1.PersistentVolume { - // pv.Spec MUST be set to match requirements in claim.Spec, especially access mode and PV size. The provisioned volume size MUST NOT be smaller than size requested in the claim, however it MAY be larger. - options := VolumeOptions{ - PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, - PVName: "pvc-" + string(claim.ObjectMeta.UID), - PVC: claim, - Parameters: storageClass.Parameters, - } - volume, _ := newTestProvisioner().Provision(options) - - // pv.Spec.ClaimRef MUST point to the claim that led to its creation (including the claim UID). - volume.Spec.ClaimRef, _ = v1.GetReference(claim) - - // pv.Annotations["pv.kubernetes.io/provisioned-by"] MUST be set to name of the external provisioner. This provisioner will be used to delete the volume. - // pv.Annotations["volume.beta.kubernetes.io/storage-class"] MUST be set to name of the storage class requested by the claim. - volume.Annotations = map[string]string{annDynamicallyProvisioned: storageClass.Provisioner, annClass: storageClass.Name} - - // TODO implement options.ProvisionerSelector parsing - // pv.Labels MUST be set to match claim.spec.selector. The provisioner MAY add additional labels. - - return volume -} - -func newTestProvisioner() *testProvisioner { - return &testProvisioner{make(chan bool, 16)} -} - -type testProvisioner struct { - provisionCalls chan bool -} - -var _ Provisioner = &testProvisioner{} - -func (p *testProvisioner) Provision(options VolumeOptions) (*v1.PersistentVolume, error) { - p.provisionCalls <- true - - // Sleep to simulate work done by Provision...for long enough that - // TestMultipleControllers will consistently fail with lock disabled. If - // Provision happens too fast, the first controller creates the PV too soon - // and the next controllers won't call Provision even though they're clearly - // racing when there's no lock - time.Sleep(50 * time.Millisecond) - - pv := &v1.PersistentVolume{ - ObjectMeta: v1.ObjectMeta{ - Name: options.PVName, - }, - Spec: v1.PersistentVolumeSpec{ - PersistentVolumeReclaimPolicy: options.PersistentVolumeReclaimPolicy, - AccessModes: options.PVC.Spec.AccessModes, - Capacity: v1.ResourceList{ - v1.ResourceName(v1.ResourceStorage): options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)], - }, - PersistentVolumeSource: v1.PersistentVolumeSource{ - NFS: &v1.NFSVolumeSource{ - Server: "foo", - Path: "bar", - ReadOnly: false, - }, - }, - }, - } - - return pv, nil -} - -func (p *testProvisioner) Delete(volume *v1.PersistentVolume) error { - return nil -} - -func newBadTestProvisioner() Provisioner { - return &badTestProvisioner{} -} - -type badTestProvisioner struct { -} - -var _ Provisioner = &badTestProvisioner{} - -func (p *badTestProvisioner) Provision(options VolumeOptions) (*v1.PersistentVolume, error) { - return nil, errors.New("fake error") -} - -func (p *badTestProvisioner) Delete(volume *v1.PersistentVolume) error { - return errors.New("fake error") -} - -type claimReactor struct { - fake *fakev1core.FakeCoreV1 - claims map[string]*v1.PersistentVolumeClaim - lock sync.Mutex - claimSource *fcache.FakePVCControllerSource -} - -func (r *claimReactor) React(action testclient.Action) (handled bool, ret runtime.Object, err error) { - r.lock.Lock() - defer r.lock.Unlock() - switch { - case action.Matches("update", "persistentvolumeclaims"): - obj := action.(testclient.UpdateAction).GetObject() - - claim := obj.(*v1.PersistentVolumeClaim) - - // Check and bump object version - storedClaim, found := r.claims[claim.Name] - if found { - storedVer, _ := strconv.Atoi(storedClaim.ResourceVersion) - requestedVer, _ := strconv.Atoi(claim.ResourceVersion) - if storedVer != requestedVer { - return true, obj, errors.New("VersionError") - } - claim.ResourceVersion = strconv.Itoa(storedVer + 1) - } else { - return true, nil, fmt.Errorf("Cannot update claim %s: claim not found", claim.Name) - } - - r.claims[claim.Name] = claim - r.claimSource.Modify(claim) - return true, claim, nil - case action.Matches("get", "persistentvolumeclaims"): - name := action.(testclient.GetAction).GetName() - claim, found := r.claims[name] - if found { - clone, err := conversion.NewCloner().DeepCopy(claim) - if err != nil { - return true, nil, fmt.Errorf("Error cloning claim %s: %v", name, err) - } - claimClone, ok := clone.(*v1.PersistentVolumeClaim) - if !ok { - return true, nil, fmt.Errorf("Error casting clone of claim %s: %v", name, claimClone) - } - return true, claimClone, nil - } - return true, nil, fmt.Errorf("Cannot find claim %s", name) - } - - return false, nil, nil -} diff --git a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/glide.lock b/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/glide.lock deleted file mode 100644 index f5d07829..00000000 --- a/nfs/vendor/github.com/kubernetes-incubator/nfs-provisioner/lib/glide.lock +++ /dev/null @@ -1,284 +0,0 @@ -hash: 66484ee6b45dc6d93dc03713861521b7a344131c91718c4c5fec28baa52500fb -updated: 2017-02-21T12:42:23.187028865-05:00 -imports: -- name: cloud.google.com/go - version: 3b1ae45394a234c385be014e9a488f2bb6eef821 - subpackages: - - compute/metadata - - internal -- name: github.com/blang/semver - version: 31b736133b98f26d5e078ec9eb591666edfd091f -- name: github.com/coreos/go-oidc - version: 5644a2f50e2d2d5ba0b474bc5bc55fea1925936d - subpackages: - - http - - jose - - key - - oauth2 - - oidc -- name: github.com/coreos/pkg - version: fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8 - subpackages: - - health - - httputil - - timeutil -- name: github.com/davecgh/go-spew - version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d - subpackages: - - spew -- name: github.com/docker/distribution - version: cd27f179f2c10c5d300e6d09025b538c475b0d51 - subpackages: - - digest - - reference -- name: github.com/emicklei/go-restful - version: 89ef8af493ab468a45a42bb0d89a06fccdd2fb22 - subpackages: - - log - - swagger -- name: github.com/ghodss/yaml - version: 73d445a93680fa1a78ae23a5839bad48f32ba1ee -- name: github.com/go-openapi/jsonpointer - version: 46af16f9f7b149af66e5d1bd010e3574dc06de98 -- name: github.com/go-openapi/jsonreference - version: 13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272 -- name: github.com/go-openapi/spec - version: 6aced65f8501fe1217321abf0749d354824ba2ff -- name: github.com/go-openapi/swag - version: 1d0bd113de87027671077d3c71eb3ac5d7dbba72 -- name: github.com/gogo/protobuf - version: e18d7aa8f8c624c915db340349aad4c49b10d173 - subpackages: - - proto - - sortkeys -- name: github.com/golang/glog - version: 23def4e6c14b4da8ac2ed8007337bc5eb5007998 -- name: github.com/golang/groupcache - version: 02826c3e79038b59d737d3b1c0a1d937f71a4433 - subpackages: - - lru -- name: github.com/golang/protobuf - version: 8616e8ee5e20a1704615e6c8d7afcdac06087a67 - subpackages: - - proto -- name: github.com/google/gofuzz - version: bbcb9da2d746f8bdbd6a936686a0a6067ada0ec5 -- name: github.com/jonboulle/clockwork - version: 72f9bd7c4e0c2a40055ab3d0f09654f730cce982 -- name: github.com/mailru/easyjson - version: d5b7844b561a7bc640052f1b935f7b800330d7e0 - subpackages: - - buffer - - jlexer - - jwriter -- name: github.com/pborman/uuid - version: ca53cad383cad2479bbba7f7a1a05797ec1386e4 -- name: github.com/PuerkitoBio/purell - version: 8a290539e2e8629dbc4e6bad948158f790ec31f4 -- name: github.com/PuerkitoBio/urlesc - version: 5bd2802263f21d8788851d5305584c82a5c75d7e -- name: github.com/spf13/pflag - version: 5ccb023bc27df288a957c5e994cd44fd19619465 -- name: github.com/ugorji/go - version: f1f1a805ed361a0e078bb537e4ea78cd37dcf065 - subpackages: - - codec -- name: golang.org/x/net - version: e90d6d0afc4c315a0d87a568ae68577cc15149a0 - subpackages: - - context - - context/ctxhttp - - http2 - - http2/hpack - - idna - - lex/httplex -- name: golang.org/x/oauth2 - version: 3c3a985cb79f52a3190fbc056984415ca6763d01 - subpackages: - - google - - internal - - jws - - jwt -- name: golang.org/x/text - version: 2910a502d2bf9e43193af9d68ca516529614eed3 - subpackages: - - cases - - internal/tag - - language - - runes - - secure/bidirule - - secure/precis - - transform - - unicode/bidi - - unicode/norm - - width -- name: google.golang.org/appengine - version: 4f7eeb5305a4ba1966344836ba4af9996b7b4e05 - subpackages: - - internal - - internal/app_identity - - internal/base - - internal/datastore - - internal/log - - internal/modules - - internal/remote_api - - internal/urlfetch - - urlfetch -- name: gopkg.in/inf.v0 - version: 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4 -- name: gopkg.in/yaml.v2 - version: 53feefa2559fb8dfa8d81baad31be332c97d6c77 -- name: k8s.io/client-go - version: 89c60099837a47cfce19bd14e2d1f16c4670fd58 - subpackages: - - discovery - - discovery/fake - - kubernetes - - kubernetes/fake - - kubernetes/typed/apps/v1beta1 - - kubernetes/typed/apps/v1beta1/fake - - kubernetes/typed/authentication/v1beta1 - - kubernetes/typed/authentication/v1beta1/fake - - kubernetes/typed/authorization/v1beta1 - - kubernetes/typed/authorization/v1beta1/fake - - kubernetes/typed/autoscaling/v1 - - kubernetes/typed/autoscaling/v1/fake - - kubernetes/typed/batch/v1 - - kubernetes/typed/batch/v1/fake - - kubernetes/typed/batch/v2alpha1 - - kubernetes/typed/batch/v2alpha1/fake - - kubernetes/typed/certificates/v1alpha1 - - kubernetes/typed/certificates/v1alpha1/fake - - kubernetes/typed/core/v1 - - kubernetes/typed/core/v1/fake - - kubernetes/typed/extensions/v1beta1 - - kubernetes/typed/extensions/v1beta1/fake - - kubernetes/typed/policy/v1beta1 - - kubernetes/typed/policy/v1beta1/fake - - kubernetes/typed/rbac/v1alpha1 - - kubernetes/typed/rbac/v1alpha1/fake - - kubernetes/typed/storage/v1beta1 - - kubernetes/typed/storage/v1beta1/fake - - pkg/api - - pkg/api/errors - - pkg/api/install - - pkg/api/meta - - pkg/api/meta/metatypes - - pkg/api/resource - - pkg/api/testapi - - pkg/api/unversioned - - pkg/api/v1 - - pkg/api/validation/path - - pkg/apimachinery - - pkg/apimachinery/announced - - pkg/apimachinery/registered - - pkg/apis/apps - - pkg/apis/apps/install - - pkg/apis/apps/v1beta1 - - pkg/apis/authentication - - pkg/apis/authentication/install - - pkg/apis/authentication/v1beta1 - - pkg/apis/authorization - - pkg/apis/authorization/install - - pkg/apis/authorization/v1beta1 - - pkg/apis/autoscaling - - pkg/apis/autoscaling/install - - pkg/apis/autoscaling/v1 - - pkg/apis/batch - - pkg/apis/batch/install - - pkg/apis/batch/v1 - - pkg/apis/batch/v2alpha1 - - pkg/apis/certificates - - pkg/apis/certificates/install - - pkg/apis/certificates/v1alpha1 - - pkg/apis/componentconfig - - pkg/apis/componentconfig/install - - pkg/apis/componentconfig/v1alpha1 - - pkg/apis/extensions - - pkg/apis/extensions/install - - pkg/apis/extensions/v1beta1 - - pkg/apis/imagepolicy - - pkg/apis/imagepolicy/install - - pkg/apis/imagepolicy/v1alpha1 - - pkg/apis/kubeadm - - pkg/apis/kubeadm/install - - pkg/apis/kubeadm/v1alpha1 - - pkg/apis/policy - - pkg/apis/policy/install - - pkg/apis/policy/v1beta1 - - pkg/apis/rbac - - pkg/apis/rbac/install - - pkg/apis/rbac/v1alpha1 - - pkg/apis/storage - - pkg/apis/storage/install - - pkg/apis/storage/v1beta1 - - pkg/auth/user - - pkg/conversion - - pkg/conversion/queryparams - - pkg/federation/apis/federation - - pkg/federation/apis/federation/install - - pkg/federation/apis/federation/v1beta1 - - pkg/fields - - pkg/genericapiserver/openapi/common - - pkg/kubelet/qos - - pkg/kubelet/types - - pkg/labels - - pkg/master/ports - - pkg/runtime - - pkg/runtime/serializer - - pkg/runtime/serializer/json - - pkg/runtime/serializer/protobuf - - pkg/runtime/serializer/recognizer - - pkg/runtime/serializer/streaming - - pkg/runtime/serializer/versioning - - pkg/selection - - pkg/third_party/forked/golang/json - - pkg/third_party/forked/golang/reflect - - pkg/third_party/forked/golang/template - - pkg/types - - pkg/util - - pkg/util/cert - - pkg/util/clock - - pkg/util/config - - pkg/util/diff - - pkg/util/errors - - pkg/util/flowcontrol - - pkg/util/framer - - pkg/util/integer - - pkg/util/intstr - - pkg/util/json - - pkg/util/jsonpath - - pkg/util/labels - - pkg/util/net - - pkg/util/parsers - - pkg/util/rand - - pkg/util/ratelimit - - pkg/util/runtime - - pkg/util/sets - - pkg/util/strategicpatch - - pkg/util/uuid - - pkg/util/validation - - pkg/util/validation/field - - pkg/util/wait - - pkg/util/yaml - - pkg/version - - pkg/watch - - pkg/watch/versioned - - plugin/pkg/client/auth - - plugin/pkg/client/auth/gcp - - plugin/pkg/client/auth/oidc - - rest - - testing - - tools/cache - - tools/cache/testing - - tools/clientcmd/api - - tools/metrics - - tools/record - - transport -- name: k8s.io/kubernetes - version: ee03b9b206ece1500b65140f26acc2ebe40b630b - subpackages: - - pkg/util/goroutinemap - - pkg/util/goroutinemap/exponentialbackoff - - pkg/util/runtime -testImports: [] diff --git a/nfs/vendor/k8s.io/client-go/pkg/api/testapi/testapi.go b/nfs/vendor/k8s.io/client-go/pkg/api/testapi/testapi.go deleted file mode 100644 index b461ae3d..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/api/testapi/testapi.go +++ /dev/null @@ -1,478 +0,0 @@ -/* -Copyright 2014 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 testapi provides a helper for retrieving the KUBE_TEST_API environment variable. -// -// TODO(lavalamp): this package is a huge disaster at the moment. I intend to -// refactor. All code currently using this package should change: -// 1. Declare your own registered.APIGroupRegistrationManager in your own test code. -// 2. Import the relevant install packages. -// 3. Register the types you need, from the announced.APIGroupAnnouncementManager. -package testapi - -import ( - "fmt" - "mime" - "os" - "reflect" - "strings" - - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/meta" - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/apimachinery/registered" - "k8s.io/client-go/pkg/apis/apps" - "k8s.io/client-go/pkg/apis/authorization" - "k8s.io/client-go/pkg/apis/autoscaling" - "k8s.io/client-go/pkg/apis/batch" - "k8s.io/client-go/pkg/apis/certificates" - "k8s.io/client-go/pkg/apis/extensions" - "k8s.io/client-go/pkg/apis/imagepolicy" - "k8s.io/client-go/pkg/apis/kubeadm" - "k8s.io/client-go/pkg/apis/policy" - "k8s.io/client-go/pkg/apis/rbac" - "k8s.io/client-go/pkg/apis/storage" - "k8s.io/client-go/pkg/federation/apis/federation" - "k8s.io/client-go/pkg/runtime" - "k8s.io/client-go/pkg/runtime/serializer/recognizer" - - _ "k8s.io/client-go/pkg/api/install" - _ "k8s.io/client-go/pkg/apis/apps/install" - _ "k8s.io/client-go/pkg/apis/authentication/install" - _ "k8s.io/client-go/pkg/apis/authorization/install" - _ "k8s.io/client-go/pkg/apis/autoscaling/install" - _ "k8s.io/client-go/pkg/apis/batch/install" - _ "k8s.io/client-go/pkg/apis/certificates/install" - _ "k8s.io/client-go/pkg/apis/componentconfig/install" - _ "k8s.io/client-go/pkg/apis/extensions/install" - _ "k8s.io/client-go/pkg/apis/imagepolicy/install" - _ "k8s.io/client-go/pkg/apis/kubeadm/install" - _ "k8s.io/client-go/pkg/apis/policy/install" - _ "k8s.io/client-go/pkg/apis/rbac/install" - _ "k8s.io/client-go/pkg/apis/storage/install" - _ "k8s.io/client-go/pkg/federation/apis/federation/install" -) - -var ( - Groups = make(map[string]TestGroup) - Default TestGroup - Authorization TestGroup - Autoscaling TestGroup - Batch TestGroup - Extensions TestGroup - Apps TestGroup - Policy TestGroup - Federation TestGroup - Rbac TestGroup - Certificates TestGroup - Storage TestGroup - ImagePolicy TestGroup - - serializer runtime.SerializerInfo - storageSerializer runtime.SerializerInfo -) - -type TestGroup struct { - externalGroupVersion unversioned.GroupVersion - internalGroupVersion unversioned.GroupVersion - internalTypes map[string]reflect.Type - externalTypes map[string]reflect.Type -} - -func init() { - if apiMediaType := os.Getenv("KUBE_TEST_API_TYPE"); len(apiMediaType) > 0 { - var ok bool - mediaType, _, err := mime.ParseMediaType(apiMediaType) - if err != nil { - panic(err) - } - serializer, ok = runtime.SerializerInfoForMediaType(api.Codecs.SupportedMediaTypes(), mediaType) - if !ok { - panic(fmt.Sprintf("no serializer for %s", apiMediaType)) - } - } - - if storageMediaType := StorageMediaType(); len(storageMediaType) > 0 { - var ok bool - mediaType, _, err := mime.ParseMediaType(storageMediaType) - if err != nil { - panic(err) - } - storageSerializer, ok = runtime.SerializerInfoForMediaType(api.Codecs.SupportedMediaTypes(), mediaType) - if !ok { - panic(fmt.Sprintf("no serializer for %s", storageMediaType)) - } - } - - kubeTestAPI := os.Getenv("KUBE_TEST_API") - if len(kubeTestAPI) != 0 { - // priority is "first in list preferred", so this has to run in reverse order - testGroupVersions := strings.Split(kubeTestAPI, ",") - for i := len(testGroupVersions) - 1; i >= 0; i-- { - gvString := testGroupVersions[i] - groupVersion, err := unversioned.ParseGroupVersion(gvString) - if err != nil { - panic(fmt.Sprintf("Error parsing groupversion %v: %v", gvString, err)) - } - - internalGroupVersion := unversioned.GroupVersion{Group: groupVersion.Group, Version: runtime.APIVersionInternal} - Groups[groupVersion.Group] = TestGroup{ - externalGroupVersion: groupVersion, - internalGroupVersion: internalGroupVersion, - internalTypes: api.Scheme.KnownTypes(internalGroupVersion), - externalTypes: api.Scheme.KnownTypes(groupVersion), - } - } - } - - if _, ok := Groups[api.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: api.GroupName, Version: registered.GroupOrDie(api.GroupName).GroupVersion.Version} - Groups[api.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: api.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(api.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[extensions.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: extensions.GroupName, Version: registered.GroupOrDie(extensions.GroupName).GroupVersion.Version} - Groups[extensions.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: extensions.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(extensions.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[autoscaling.GroupName]; !ok { - internalTypes := make(map[string]reflect.Type) - for k, t := range api.Scheme.KnownTypes(extensions.SchemeGroupVersion) { - if k == "Scale" { - continue - } - internalTypes[k] = t - } - externalGroupVersion := unversioned.GroupVersion{Group: autoscaling.GroupName, Version: registered.GroupOrDie(autoscaling.GroupName).GroupVersion.Version} - Groups[autoscaling.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: extensions.SchemeGroupVersion, - internalTypes: internalTypes, - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[autoscaling.GroupName+"IntraGroup"]; !ok { - internalTypes := make(map[string]reflect.Type) - for k, t := range api.Scheme.KnownTypes(extensions.SchemeGroupVersion) { - if k == "Scale" { - internalTypes[k] = t - break - } - } - externalGroupVersion := unversioned.GroupVersion{Group: autoscaling.GroupName, Version: registered.GroupOrDie(autoscaling.GroupName).GroupVersion.Version} - Groups[autoscaling.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: autoscaling.SchemeGroupVersion, - internalTypes: internalTypes, - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[batch.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: batch.GroupName, Version: registered.GroupOrDie(batch.GroupName).GroupVersion.Version} - Groups[batch.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: batch.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(batch.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[apps.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: apps.GroupName, Version: registered.GroupOrDie(apps.GroupName).GroupVersion.Version} - Groups[apps.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: extensions.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(extensions.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[policy.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: policy.GroupName, Version: registered.GroupOrDie(policy.GroupName).GroupVersion.Version} - Groups[policy.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: policy.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(policy.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[federation.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: federation.GroupName, Version: registered.GroupOrDie(federation.GroupName).GroupVersion.Version} - Groups[federation.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: federation.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(federation.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[rbac.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: rbac.GroupName, Version: registered.GroupOrDie(rbac.GroupName).GroupVersion.Version} - Groups[rbac.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: rbac.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(rbac.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[storage.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: storage.GroupName, Version: registered.GroupOrDie(storage.GroupName).GroupVersion.Version} - Groups[storage.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: storage.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(storage.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[certificates.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: certificates.GroupName, Version: registered.GroupOrDie(certificates.GroupName).GroupVersion.Version} - Groups[certificates.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: certificates.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(certificates.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[imagepolicy.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: imagepolicy.GroupName, Version: registered.GroupOrDie(imagepolicy.GroupName).GroupVersion.Version} - Groups[imagepolicy.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: imagepolicy.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(imagepolicy.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[authorization.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: authorization.GroupName, Version: registered.GroupOrDie(authorization.GroupName).GroupVersion.Version} - Groups[authorization.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: authorization.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(authorization.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - if _, ok := Groups[kubeadm.GroupName]; !ok { - externalGroupVersion := unversioned.GroupVersion{Group: kubeadm.GroupName, Version: registered.GroupOrDie(kubeadm.GroupName).GroupVersion.Version} - Groups[kubeadm.GroupName] = TestGroup{ - externalGroupVersion: externalGroupVersion, - internalGroupVersion: kubeadm.SchemeGroupVersion, - internalTypes: api.Scheme.KnownTypes(kubeadm.SchemeGroupVersion), - externalTypes: api.Scheme.KnownTypes(externalGroupVersion), - } - } - - Default = Groups[api.GroupName] - Autoscaling = Groups[autoscaling.GroupName] - Batch = Groups[batch.GroupName] - Apps = Groups[apps.GroupName] - Policy = Groups[policy.GroupName] - Certificates = Groups[certificates.GroupName] - Extensions = Groups[extensions.GroupName] - Federation = Groups[federation.GroupName] - Rbac = Groups[rbac.GroupName] - Storage = Groups[storage.GroupName] - ImagePolicy = Groups[imagepolicy.GroupName] - Authorization = Groups[authorization.GroupName] -} - -func (g TestGroup) ContentConfig() (string, *unversioned.GroupVersion, runtime.Codec) { - return "application/json", g.GroupVersion(), g.Codec() -} - -func (g TestGroup) GroupVersion() *unversioned.GroupVersion { - copyOfGroupVersion := g.externalGroupVersion - return ©OfGroupVersion -} - -// InternalGroupVersion returns the group,version used to identify the internal -// types for this API -func (g TestGroup) InternalGroupVersion() unversioned.GroupVersion { - return g.internalGroupVersion -} - -// InternalTypes returns a map of internal API types' kind names to their Go types. -func (g TestGroup) InternalTypes() map[string]reflect.Type { - return g.internalTypes -} - -// ExternalTypes returns a map of external API types' kind names to their Go types. -func (g TestGroup) ExternalTypes() map[string]reflect.Type { - return g.externalTypes -} - -// Codec returns the codec for the API version to test against, as set by the -// KUBE_TEST_API_TYPE env var. -func (g TestGroup) Codec() runtime.Codec { - if serializer.Serializer == nil { - return api.Codecs.LegacyCodec(g.externalGroupVersion) - } - return api.Codecs.CodecForVersions(serializer.Serializer, api.Codecs.UniversalDeserializer(), unversioned.GroupVersions{g.externalGroupVersion}, nil) -} - -// NegotiatedSerializer returns the negotiated serializer for the server. -func (g TestGroup) NegotiatedSerializer() runtime.NegotiatedSerializer { - return api.Codecs -} - -func StorageMediaType() string { - return os.Getenv("KUBE_TEST_API_STORAGE_TYPE") -} - -// StorageCodec returns the codec for the API version to store in etcd, as set by the -// KUBE_TEST_API_STORAGE_TYPE env var. -func (g TestGroup) StorageCodec() runtime.Codec { - s := storageSerializer.Serializer - - if s == nil { - return api.Codecs.LegacyCodec(g.externalGroupVersion) - } - - // etcd2 only supports string data - we must wrap any result before returning - // TODO: remove for etcd3 / make parameterizable - if !storageSerializer.EncodesAsText { - s = runtime.NewBase64Serializer(s) - } - ds := recognizer.NewDecoder(s, api.Codecs.UniversalDeserializer()) - - return api.Codecs.CodecForVersions(s, ds, unversioned.GroupVersions{g.externalGroupVersion}, nil) -} - -// Converter returns the api.Scheme for the API version to test against, as set by the -// KUBE_TEST_API env var. -func (g TestGroup) Converter() runtime.ObjectConvertor { - interfaces, err := registered.GroupOrDie(g.externalGroupVersion.Group).InterfacesFor(g.externalGroupVersion) - if err != nil { - panic(err) - } - return interfaces.ObjectConvertor -} - -// MetadataAccessor returns the MetadataAccessor for the API version to test against, -// as set by the KUBE_TEST_API env var. -func (g TestGroup) MetadataAccessor() meta.MetadataAccessor { - interfaces, err := registered.GroupOrDie(g.externalGroupVersion.Group).InterfacesFor(g.externalGroupVersion) - if err != nil { - panic(err) - } - return interfaces.MetadataAccessor -} - -// SelfLink returns a self link that will appear to be for the version Version(). -// 'resource' should be the resource path, e.g. "pods" for the Pod type. 'name' should be -// empty for lists. -func (g TestGroup) SelfLink(resource, name string) string { - if g.externalGroupVersion.Group == api.GroupName { - if name == "" { - return fmt.Sprintf("/api/%s/%s", g.externalGroupVersion.Version, resource) - } - return fmt.Sprintf("/api/%s/%s/%s", g.externalGroupVersion.Version, resource, name) - } else { - // TODO: will need a /apis prefix once we have proper multi-group - // support - if name == "" { - return fmt.Sprintf("/apis/%s/%s/%s", g.externalGroupVersion.Group, g.externalGroupVersion.Version, resource) - } - return fmt.Sprintf("/apis/%s/%s/%s/%s", g.externalGroupVersion.Group, g.externalGroupVersion.Version, resource, name) - } -} - -// Returns the appropriate path for the given prefix (watch, proxy, redirect, etc), resource, namespace and name. -// For ex, this is of the form: -// /api/v1/watch/namespaces/foo/pods/pod0 for v1. -func (g TestGroup) ResourcePathWithPrefix(prefix, resource, namespace, name string) string { - var path string - if g.externalGroupVersion.Group == api.GroupName { - path = "/api/" + g.externalGroupVersion.Version - } else { - // TODO: switch back once we have proper multiple group support - // path = "/apis/" + g.Group + "/" + Version(group...) - path = "/apis/" + g.externalGroupVersion.Group + "/" + g.externalGroupVersion.Version - } - - if prefix != "" { - path = path + "/" + prefix - } - if namespace != "" { - path = path + "/namespaces/" + namespace - } - // Resource names are lower case. - resource = strings.ToLower(resource) - if resource != "" { - path = path + "/" + resource - } - if name != "" { - path = path + "/" + name - } - return path -} - -// Returns the appropriate path for the given resource, namespace and name. -// For example, this is of the form: -// /api/v1/namespaces/foo/pods/pod0 for v1. -func (g TestGroup) ResourcePath(resource, namespace, name string) string { - return g.ResourcePathWithPrefix("", resource, namespace, name) -} - -func (g TestGroup) RESTMapper() meta.RESTMapper { - return registered.RESTMapper() -} - -// ExternalGroupVersions returns all external group versions allowed for the server. -func ExternalGroupVersions() unversioned.GroupVersions { - versions := []unversioned.GroupVersion{} - for _, g := range Groups { - gv := g.GroupVersion() - versions = append(versions, *gv) - } - return versions -} - -// Get codec based on runtime.Object -func GetCodecForObject(obj runtime.Object) (runtime.Codec, error) { - kinds, _, err := api.Scheme.ObjectKinds(obj) - if err != nil { - return nil, fmt.Errorf("unexpected encoding error: %v", err) - } - kind := kinds[0] - - for _, group := range Groups { - if group.GroupVersion().Group != kind.Group { - continue - } - - if api.Scheme.Recognizes(kind) { - return group.Codec(), nil - } - } - // Codec used for unversioned types - if api.Scheme.Recognizes(kind) { - serializer, ok := runtime.SerializerInfoForMediaType(api.Codecs.SupportedMediaTypes(), runtime.ContentTypeJSON) - if !ok { - return nil, fmt.Errorf("no serializer registered for json") - } - return serializer.Serializer, nil - } - return nil, fmt.Errorf("unexpected kind: %v", kind) -} - -func NewTestGroup(external, internal unversioned.GroupVersion, internalTypes map[string]reflect.Type, externalTypes map[string]reflect.Type) TestGroup { - return TestGroup{external, internal, internalTypes, externalTypes} -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/install/install.go b/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/install/install.go deleted file mode 100644 index 38e9c02f..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/install/install.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2015 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 installs the experimental API group, making it available as -// an option to all of the API encoding/decoding machinery. -package install - -import ( - "k8s.io/client-go/pkg/apimachinery/announced" - "k8s.io/client-go/pkg/apis/componentconfig" - "k8s.io/client-go/pkg/apis/componentconfig/v1alpha1" -) - -func init() { - if err := announced.NewGroupMetaFactory( - &announced.GroupMetaFactoryArgs{ - GroupName: componentconfig.GroupName, - VersionPreferenceOrder: []string{v1alpha1.SchemeGroupVersion.Version}, - ImportPrefix: "k8s.io/client-go/pkg/apis/componentconfig", - AddInternalObjectsToScheme: componentconfig.AddToScheme, - }, - announced.VersionToSchemeFunc{ - v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme, - }, - ).Announce().RegisterAndEnable(); err != nil { - panic(err) - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/defaults.go b/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/defaults.go deleted file mode 100644 index 51a6358b..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/defaults.go +++ /dev/null @@ -1,419 +0,0 @@ -/* -Copyright 2015 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 ( - "path/filepath" - "runtime" - "time" - - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/kubelet/qos" - kubetypes "k8s.io/client-go/pkg/kubelet/types" - "k8s.io/client-go/pkg/master/ports" - kruntime "k8s.io/client-go/pkg/runtime" -) - -const ( - defaultRootDir = "/var/lib/kubelet" - - // When these values are updated, also update test/e2e/framework/util.go - defaultPodInfraContainerImageName = "gcr.io/google_containers/pause" - defaultPodInfraContainerImageVersion = "3.0" - defaultPodInfraContainerImage = defaultPodInfraContainerImageName + - "-" + runtime.GOARCH + ":" + - defaultPodInfraContainerImageVersion - - // From pkg/kubelet/rkt/rkt.go to avoid circular import - defaultRktAPIServiceEndpoint = "localhost:15441" - - AutoDetectCloudProvider = "auto-detect" - - defaultIPTablesMasqueradeBit = 14 - defaultIPTablesDropBit = 15 -) - -var zeroDuration = unversioned.Duration{} - -func addDefaultingFuncs(scheme *kruntime.Scheme) error { - RegisterDefaults(scheme) - return scheme.AddDefaultingFuncs( - SetDefaults_KubeProxyConfiguration, - SetDefaults_KubeSchedulerConfiguration, - SetDefaults_LeaderElectionConfiguration, - SetDefaults_KubeletConfiguration, - ) -} - -func SetDefaults_KubeProxyConfiguration(obj *KubeProxyConfiguration) { - if obj.BindAddress == "" { - obj.BindAddress = "0.0.0.0" - } - if obj.HealthzPort == 0 { - obj.HealthzPort = 10249 - } - if obj.HealthzBindAddress == "" { - obj.HealthzBindAddress = "127.0.0.1" - } - if obj.OOMScoreAdj == nil { - temp := int32(qos.KubeProxyOOMScoreAdj) - obj.OOMScoreAdj = &temp - } - if obj.ResourceContainer == "" { - obj.ResourceContainer = "/kube-proxy" - } - if obj.IPTablesSyncPeriod.Duration == 0 { - obj.IPTablesSyncPeriod = unversioned.Duration{Duration: 30 * time.Second} - } - zero := unversioned.Duration{} - if obj.UDPIdleTimeout == zero { - obj.UDPIdleTimeout = unversioned.Duration{Duration: 250 * time.Millisecond} - } - // If ConntrackMax is set, respect it. - if obj.ConntrackMax == 0 { - // If ConntrackMax is *not* set, use per-core scaling. - if obj.ConntrackMaxPerCore == 0 { - obj.ConntrackMaxPerCore = 32 * 1024 - } - if obj.ConntrackMin == 0 { - obj.ConntrackMin = 128 * 1024 - } - } - if obj.IPTablesMasqueradeBit == nil { - temp := int32(14) - obj.IPTablesMasqueradeBit = &temp - } - if obj.ConntrackTCPEstablishedTimeout == zero { - obj.ConntrackTCPEstablishedTimeout = unversioned.Duration{Duration: 24 * time.Hour} // 1 day (1/5 default) - } - if obj.ConntrackTCPCloseWaitTimeout == zero { - // See https://github.com/kubernetes/kubernetes/issues/32551. - // - // CLOSE_WAIT conntrack state occurs when the the Linux kernel - // sees a FIN from the remote server. Note: this is a half-close - // condition that persists as long as the local side keeps the - // socket open. The condition is rare as it is typical in most - // protocols for both sides to issue a close; this typically - // occurs when the local socket is lazily garbage collected. - // - // If the CLOSE_WAIT conntrack entry expires, then FINs from the - // local socket will not be properly SNAT'd and will not reach the - // remote server (if the connection was subject to SNAT). If the - // remote timeouts for FIN_WAIT* states exceed the CLOSE_WAIT - // timeout, then there will be an inconsistency in the state of - // the connection and a new connection reusing the SNAT (src, - // port) pair may be rejected by the remote side with RST. This - // can cause new calls to connect(2) to return with ECONNREFUSED. - // - // We set CLOSE_WAIT to one hour by default to better match - // typical server timeouts. - obj.ConntrackTCPCloseWaitTimeout = unversioned.Duration{Duration: 1 * time.Hour} - } -} - -func SetDefaults_KubeSchedulerConfiguration(obj *KubeSchedulerConfiguration) { - if obj.Port == 0 { - obj.Port = ports.SchedulerPort - } - if obj.Address == "" { - obj.Address = "0.0.0.0" - } - if obj.AlgorithmProvider == "" { - obj.AlgorithmProvider = "DefaultProvider" - } - if obj.ContentType == "" { - obj.ContentType = "application/vnd.kubernetes.protobuf" - } - if obj.KubeAPIQPS == 0 { - obj.KubeAPIQPS = 50.0 - } - if obj.KubeAPIBurst == 0 { - obj.KubeAPIBurst = 100 - } - if obj.SchedulerName == "" { - obj.SchedulerName = api.DefaultSchedulerName - } - if obj.HardPodAffinitySymmetricWeight == 0 { - obj.HardPodAffinitySymmetricWeight = api.DefaultHardPodAffinitySymmetricWeight - } - if obj.FailureDomains == "" { - obj.FailureDomains = api.DefaultFailureDomains - } -} - -func SetDefaults_LeaderElectionConfiguration(obj *LeaderElectionConfiguration) { - zero := unversioned.Duration{} - if obj.LeaseDuration == zero { - obj.LeaseDuration = unversioned.Duration{Duration: 15 * time.Second} - } - if obj.RenewDeadline == zero { - obj.RenewDeadline = unversioned.Duration{Duration: 10 * time.Second} - } - if obj.RetryPeriod == zero { - obj.RetryPeriod = unversioned.Duration{Duration: 2 * time.Second} - } -} - -func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) { - if obj.Authentication.Anonymous.Enabled == nil { - obj.Authentication.Anonymous.Enabled = boolVar(true) - } - if obj.Authentication.Webhook.Enabled == nil { - obj.Authentication.Webhook.Enabled = boolVar(false) - } - if obj.Authentication.Webhook.CacheTTL == zeroDuration { - obj.Authentication.Webhook.CacheTTL = unversioned.Duration{Duration: 2 * time.Minute} - } - if obj.Authorization.Mode == "" { - obj.Authorization.Mode = KubeletAuthorizationModeAlwaysAllow - } - if obj.Authorization.Webhook.CacheAuthorizedTTL == zeroDuration { - obj.Authorization.Webhook.CacheAuthorizedTTL = unversioned.Duration{Duration: 5 * time.Minute} - } - if obj.Authorization.Webhook.CacheUnauthorizedTTL == zeroDuration { - obj.Authorization.Webhook.CacheUnauthorizedTTL = unversioned.Duration{Duration: 30 * time.Second} - } - - if obj.Address == "" { - obj.Address = "0.0.0.0" - } - if obj.CloudProvider == "" { - obj.CloudProvider = AutoDetectCloudProvider - } - if obj.CAdvisorPort == 0 { - obj.CAdvisorPort = 4194 - } - if obj.VolumeStatsAggPeriod == zeroDuration { - obj.VolumeStatsAggPeriod = unversioned.Duration{Duration: time.Minute} - } - if obj.CertDirectory == "" { - obj.CertDirectory = "/var/run/kubernetes" - } - if obj.CgroupsPerQOS == nil { - obj.CgroupsPerQOS = boolVar(false) - } - if obj.ContainerRuntime == "" { - obj.ContainerRuntime = "docker" - } - if obj.RuntimeRequestTimeout == zeroDuration { - obj.RuntimeRequestTimeout = unversioned.Duration{Duration: 2 * time.Minute} - } - if obj.CPUCFSQuota == nil { - obj.CPUCFSQuota = boolVar(true) - } - if obj.DockerExecHandlerName == "" { - obj.DockerExecHandlerName = "native" - } - if obj.DockerEndpoint == "" && runtime.GOOS != "windows" { - obj.DockerEndpoint = "unix:///var/run/docker.sock" - } - if obj.EventBurst == 0 { - obj.EventBurst = 10 - } - if obj.EventRecordQPS == nil { - temp := int32(5) - obj.EventRecordQPS = &temp - } - if obj.EnableControllerAttachDetach == nil { - obj.EnableControllerAttachDetach = boolVar(true) - } - if obj.EnableDebuggingHandlers == nil { - obj.EnableDebuggingHandlers = boolVar(true) - } - if obj.EnableServer == nil { - obj.EnableServer = boolVar(true) - } - if obj.FileCheckFrequency == zeroDuration { - obj.FileCheckFrequency = unversioned.Duration{Duration: 20 * time.Second} - } - if obj.HealthzBindAddress == "" { - obj.HealthzBindAddress = "127.0.0.1" - } - if obj.HealthzPort == 0 { - obj.HealthzPort = 10248 - } - if obj.HostNetworkSources == nil { - obj.HostNetworkSources = []string{kubetypes.AllSource} - } - if obj.HostPIDSources == nil { - obj.HostPIDSources = []string{kubetypes.AllSource} - } - if obj.HostIPCSources == nil { - obj.HostIPCSources = []string{kubetypes.AllSource} - } - if obj.HTTPCheckFrequency == zeroDuration { - obj.HTTPCheckFrequency = unversioned.Duration{Duration: 20 * time.Second} - } - if obj.ImageMinimumGCAge == zeroDuration { - obj.ImageMinimumGCAge = unversioned.Duration{Duration: 2 * time.Minute} - } - if obj.ImageGCHighThresholdPercent == nil { - temp := int32(90) - obj.ImageGCHighThresholdPercent = &temp - } - if obj.ImageGCLowThresholdPercent == nil { - temp := int32(80) - obj.ImageGCLowThresholdPercent = &temp - } - if obj.LowDiskSpaceThresholdMB == 0 { - obj.LowDiskSpaceThresholdMB = 256 - } - if obj.MasterServiceNamespace == "" { - obj.MasterServiceNamespace = api.NamespaceDefault - } - if obj.MaxContainerCount == nil { - temp := int32(-1) - obj.MaxContainerCount = &temp - } - if obj.MaxPerPodContainerCount == 0 { - obj.MaxPerPodContainerCount = 1 - } - if obj.MaxOpenFiles == 0 { - obj.MaxOpenFiles = 1000000 - } - if obj.MaxPods == 0 { - obj.MaxPods = 110 - } - if obj.MinimumGCAge == zeroDuration { - obj.MinimumGCAge = unversioned.Duration{Duration: 0} - } - if obj.NonMasqueradeCIDR == "" { - obj.NonMasqueradeCIDR = "10.0.0.0/8" - } - if obj.VolumePluginDir == "" { - obj.VolumePluginDir = "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/" - } - if obj.NodeStatusUpdateFrequency == zeroDuration { - obj.NodeStatusUpdateFrequency = unversioned.Duration{Duration: 10 * time.Second} - } - if obj.OOMScoreAdj == nil { - temp := int32(qos.KubeletOOMScoreAdj) - obj.OOMScoreAdj = &temp - } - if obj.PodInfraContainerImage == "" { - obj.PodInfraContainerImage = defaultPodInfraContainerImage - } - if obj.Port == 0 { - obj.Port = ports.KubeletPort - } - if obj.ReadOnlyPort == 0 { - obj.ReadOnlyPort = ports.KubeletReadOnlyPort - } - if obj.RegisterNode == nil { - obj.RegisterNode = boolVar(true) - } - if obj.RegisterSchedulable == nil { - obj.RegisterSchedulable = boolVar(true) - } - if obj.RegistryBurst == 0 { - obj.RegistryBurst = 10 - } - if obj.RegistryPullQPS == nil { - temp := int32(5) - obj.RegistryPullQPS = &temp - } - if obj.ResolverConfig == "" { - obj.ResolverConfig = kubetypes.ResolvConfDefault - } - if obj.RktAPIEndpoint == "" { - obj.RktAPIEndpoint = defaultRktAPIServiceEndpoint - } - if obj.RootDirectory == "" { - obj.RootDirectory = defaultRootDir - } - if obj.SerializeImagePulls == nil { - obj.SerializeImagePulls = boolVar(true) - } - if obj.SeccompProfileRoot == "" { - obj.SeccompProfileRoot = filepath.Join(defaultRootDir, "seccomp") - } - if obj.StreamingConnectionIdleTimeout == zeroDuration { - obj.StreamingConnectionIdleTimeout = unversioned.Duration{Duration: 4 * time.Hour} - } - if obj.SyncFrequency == zeroDuration { - obj.SyncFrequency = unversioned.Duration{Duration: 1 * time.Minute} - } - if obj.ReconcileCIDR == nil { - obj.ReconcileCIDR = boolVar(true) - } - if obj.ContentType == "" { - obj.ContentType = "application/vnd.kubernetes.protobuf" - } - if obj.KubeAPIQPS == nil { - temp := int32(5) - obj.KubeAPIQPS = &temp - } - if obj.KubeAPIBurst == 0 { - obj.KubeAPIBurst = 10 - } - if obj.OutOfDiskTransitionFrequency == zeroDuration { - obj.OutOfDiskTransitionFrequency = unversioned.Duration{Duration: 5 * time.Minute} - } - if string(obj.HairpinMode) == "" { - obj.HairpinMode = PromiscuousBridge - } - if obj.EvictionHard == nil { - temp := "memory.available<100Mi" - obj.EvictionHard = &temp - } - if obj.EvictionPressureTransitionPeriod == zeroDuration { - obj.EvictionPressureTransitionPeriod = unversioned.Duration{Duration: 5 * time.Minute} - } - if obj.SystemReserved == nil { - obj.SystemReserved = make(map[string]string) - } - if obj.KubeReserved == nil { - obj.KubeReserved = make(map[string]string) - } - if obj.MakeIPTablesUtilChains == nil { - obj.MakeIPTablesUtilChains = boolVar(true) - } - if obj.IPTablesMasqueradeBit == nil { - temp := int32(defaultIPTablesMasqueradeBit) - obj.IPTablesMasqueradeBit = &temp - } - if obj.IPTablesDropBit == nil { - temp := int32(defaultIPTablesDropBit) - obj.IPTablesDropBit = &temp - } - if obj.CgroupsPerQOS == nil { - temp := false - obj.CgroupsPerQOS = &temp - } - if obj.CgroupDriver == "" { - obj.CgroupDriver = "cgroupfs" - } - // NOTE: this is for backwards compatibility with earlier releases where cgroup-root was optional. - // if cgroups per qos is not enabled, and cgroup-root is not specified, we need to default to the - // container runtime default and not default to the root cgroup. - if obj.CgroupsPerQOS != nil { - if *obj.CgroupsPerQOS { - if obj.CgroupRoot == "" { - obj.CgroupRoot = "/" - } - } - } -} - -func boolVar(b bool) *bool { - return &b -} - -var ( - defaultCfg = KubeletConfiguration{} -) diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/doc.go b/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/doc.go deleted file mode 100644 index 0ae15b67..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/doc.go +++ /dev/null @@ -1,22 +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. -*/ - -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/componentconfig -// +k8s:openapi-gen=true -// +k8s:defaulter-gen=TypeMeta - -package v1alpha1 diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/register.go b/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/register.go deleted file mode 100644 index 4f3a6ae7..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/register.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2015 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 ( - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/runtime" -) - -// GroupName is the group name use in this package -const GroupName = "componentconfig" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1alpha1"} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs) - AddToScheme = SchemeBuilder.AddToScheme -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &KubeProxyConfiguration{}, - &KubeSchedulerConfiguration{}, - &KubeletConfiguration{}, - ) - return nil -} - -func (obj *KubeProxyConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } -func (obj *KubeSchedulerConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } -func (obj *KubeletConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/types.go b/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/types.go deleted file mode 100644 index 7207a860..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/types.go +++ /dev/null @@ -1,568 +0,0 @@ -/* -Copyright 2015 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 "k8s.io/client-go/pkg/api/unversioned" - -type KubeProxyConfiguration struct { - unversioned.TypeMeta - - // bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0 - // for all interfaces) - BindAddress string `json:"bindAddress"` - // clusterCIDR is the CIDR range of the pods in the cluster. It is used to - // bridge traffic coming from outside of the cluster. If not provided, - // no off-cluster bridging will be performed. - ClusterCIDR string `json:"clusterCIDR"` - // healthzBindAddress is the IP address for the health check server to serve on, - // defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces) - HealthzBindAddress string `json:"healthzBindAddress"` - // healthzPort is the port to bind the health check server. Use 0 to disable. - HealthzPort int32 `json:"healthzPort"` - // hostnameOverride, if non-empty, will be used as the identity instead of the actual hostname. - HostnameOverride string `json:"hostnameOverride"` - // iptablesMasqueradeBit is the bit of the iptables fwmark space to use for SNAT if using - // the pure iptables proxy mode. Values must be within the range [0, 31]. - IPTablesMasqueradeBit *int32 `json:"iptablesMasqueradeBit"` - // iptablesSyncPeriod is the period that iptables rules are refreshed (e.g. '5s', '1m', - // '2h22m'). Must be greater than 0. - IPTablesSyncPeriod unversioned.Duration `json:"iptablesSyncPeriodSeconds"` - // iptablesMinSyncPeriod is the minimum period that iptables rules are refreshed (e.g. '5s', '1m', - // '2h22m'). - IPTablesMinSyncPeriod unversioned.Duration `json:"iptablesMinSyncPeriodSeconds"` - // kubeconfigPath is the path to the kubeconfig file with authorization information (the - // master location is set by the master flag). - KubeconfigPath string `json:"kubeconfigPath"` - // masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode. - MasqueradeAll bool `json:"masqueradeAll"` - // master is the address of the Kubernetes API server (overrides any value in kubeconfig) - Master string `json:"master"` - // oomScoreAdj is the oom-score-adj value for kube-proxy process. Values must be within - // the range [-1000, 1000] - OOMScoreAdj *int32 `json:"oomScoreAdj"` - // mode specifies which proxy mode to use. - Mode ProxyMode `json:"mode"` - // portRange is the range of host ports (beginPort-endPort, inclusive) that may be consumed - // in order to proxy service traffic. If unspecified (0-0) then ports will be randomly chosen. - PortRange string `json:"portRange"` - // resourceContainer is the bsolute name of the resource-only container to create and run - // the Kube-proxy in (Default: /kube-proxy). - ResourceContainer string `json:"resourceContainer"` - // udpIdleTimeout is how long an idle UDP connection will be kept open (e.g. '250ms', '2s'). - // Must be greater than 0. Only applicable for proxyMode=userspace. - UDPIdleTimeout unversioned.Duration `json:"udpTimeoutMilliseconds"` - // conntrackMax is the maximum number of NAT connections to track (0 to - // leave as-is). This takes precedence over conntrackMaxPerCore and conntrackMin. - ConntrackMax int32 `json:"conntrackMax"` - // conntrackMaxPerCore is the maximum number of NAT connections to track - // per CPU core (0 to leave the limit as-is and ignore conntrackMin). - ConntrackMaxPerCore int32 `json:"conntrackMaxPerCore"` - // conntrackMin is the minimum value of connect-tracking records to allocate, - // regardless of conntrackMaxPerCore (set conntrackMaxPerCore=0 to leave the limit as-is). - ConntrackMin int32 `json:"conntrackMin"` - // conntrackTCPEstablishedTimeout is how long an idle TCP connection - // will be kept open (e.g. '2s'). Must be greater than 0. - ConntrackTCPEstablishedTimeout unversioned.Duration `json:"conntrackTCPEstablishedTimeout"` - // conntrackTCPCloseWaitTimeout is how long an idle conntrack entry - // in CLOSE_WAIT state will remain in the conntrack - // table. (e.g. '60s'). Must be greater than 0 to set. - ConntrackTCPCloseWaitTimeout unversioned.Duration `json:"conntrackTCPCloseWaitTimeout"` -} - -// Currently two modes of proxying are available: 'userspace' (older, stable) or 'iptables' -// (experimental). If blank, look at the Node object on the Kubernetes API and respect the -// 'net.experimental.kubernetes.io/proxy-mode' annotation if provided. Otherwise use the -// best-available proxy (currently userspace, but may change in future versions). If the -// iptables proxy is selected, regardless of how, but the system's kernel or iptables -// versions are insufficient, this always falls back to the userspace proxy. -type ProxyMode string - -const ( - ProxyModeUserspace ProxyMode = "userspace" - ProxyModeIPTables ProxyMode = "iptables" -) - -type KubeSchedulerConfiguration struct { - unversioned.TypeMeta - - // port is the port that the scheduler's http service runs on. - Port int `json:"port"` - // address is the IP address to serve on. - Address string `json:"address"` - // algorithmProvider is the scheduling algorithm provider to use. - AlgorithmProvider string `json:"algorithmProvider"` - // policyConfigFile is the filepath to the scheduler policy configuration. - PolicyConfigFile string `json:"policyConfigFile"` - // enableProfiling enables profiling via web interface. - EnableProfiling *bool `json:"enableProfiling"` - // contentType is contentType of requests sent to apiserver. - ContentType string `json:"contentType"` - // kubeAPIQPS is the QPS to use while talking with kubernetes apiserver. - KubeAPIQPS float32 `json:"kubeAPIQPS"` - // kubeAPIBurst is the QPS burst to use while talking with kubernetes apiserver. - KubeAPIBurst int `json:"kubeAPIBurst"` - // schedulerName is name of the scheduler, used to select which pods - // will be processed by this scheduler, based on pod's annotation with - // key 'scheduler.alpha.kubernetes.io/name'. - SchedulerName string `json:"schedulerName"` - // RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule - // corresponding to every RequiredDuringScheduling affinity rule. - // HardPodAffinitySymmetricWeight represents the weight of implicit PreferredDuringScheduling affinity rule, in the range 0-100. - HardPodAffinitySymmetricWeight int `json:"hardPodAffinitySymmetricWeight"` - // Indicate the "all topologies" set for empty topologyKey when it's used for PreferredDuringScheduling pod anti-affinity. - FailureDomains string `json:"failureDomains"` - // leaderElection defines the configuration of leader election client. - LeaderElection LeaderElectionConfiguration `json:"leaderElection"` -} - -// HairpinMode denotes how the kubelet should configure networking to handle -// hairpin packets. -type HairpinMode string - -// Enum settings for different ways to handle hairpin packets. -const ( - // Set the hairpin flag on the veth of containers in the respective - // container runtime. - HairpinVeth = "hairpin-veth" - // Make the container bridge promiscuous. This will force it to accept - // hairpin packets, even if the flag isn't set on ports of the bridge. - PromiscuousBridge = "promiscuous-bridge" - // Neither of the above. If the kubelet is started in this hairpin mode - // and kube-proxy is running in iptables mode, hairpin packets will be - // dropped by the container bridge. - HairpinNone = "none" -) - -// LeaderElectionConfiguration defines the configuration of leader election -// clients for components that can run with leader election enabled. -type LeaderElectionConfiguration struct { - // leaderElect enables a leader election client to gain leadership - // before executing the main loop. Enable this when running replicated - // components for high availability. - LeaderElect *bool `json:"leaderElect"` - // leaseDuration is the duration that non-leader candidates will wait - // after observing a leadership renewal until attempting to acquire - // leadership of a led but unrenewed leader slot. This is effectively the - // maximum duration that a leader can be stopped before it is replaced - // by another candidate. This is only applicable if leader election is - // enabled. - LeaseDuration unversioned.Duration `json:"leaseDuration"` - // renewDeadline is the interval between attempts by the acting master to - // renew a leadership slot before it stops leading. This must be less - // than or equal to the lease duration. This is only applicable if leader - // election is enabled. - RenewDeadline unversioned.Duration `json:"renewDeadline"` - // retryPeriod is the duration the clients should wait between attempting - // acquisition and renewal of a leadership. This is only applicable if - // leader election is enabled. - RetryPeriod unversioned.Duration `json:"retryPeriod"` -} - -type KubeletConfiguration struct { - unversioned.TypeMeta - - // podManifestPath is the path to the directory containing pod manifests to - // run, or the path to a single manifest file - PodManifestPath string `json:"podManifestPath"` - // syncFrequency is the max period between synchronizing running - // containers and config - SyncFrequency unversioned.Duration `json:"syncFrequency"` - // fileCheckFrequency is the duration between checking config files for - // new data - FileCheckFrequency unversioned.Duration `json:"fileCheckFrequency"` - // httpCheckFrequency is the duration between checking http for new data - HTTPCheckFrequency unversioned.Duration `json:"httpCheckFrequency"` - // manifestURL is the URL for accessing the container manifest - ManifestURL string `json:"manifestURL"` - // manifestURLHeader is the HTTP header to use when accessing the manifest - // URL, with the key separated from the value with a ':', as in 'key:value' - ManifestURLHeader string `json:"manifestURLHeader"` - // enableServer enables the Kubelet's server - EnableServer *bool `json:"enableServer"` - // address is the IP address for the Kubelet to serve on (set to 0.0.0.0 - // for all interfaces) - Address string `json:"address"` - // port is the port for the Kubelet to serve on. - Port int32 `json:"port"` - // readOnlyPort is the read-only port for the Kubelet to serve on with - // no authentication/authorization (set to 0 to disable) - ReadOnlyPort int32 `json:"readOnlyPort"` - // tlsCertFile is the file containing x509 Certificate for HTTPS. (CA cert, - // if any, concatenated after server cert). If tlsCertFile and - // tlsPrivateKeyFile are not provided, a self-signed certificate - // and key are generated for the public address and saved to the directory - // passed to certDir. - TLSCertFile string `json:"tlsCertFile"` - // tlsPrivateKeyFile is the ile containing x509 private key matching - // tlsCertFile. - TLSPrivateKeyFile string `json:"tlsPrivateKeyFile"` - // certDirectory is the directory where the TLS certs are located (by - // default /var/run/kubernetes). If tlsCertFile and tlsPrivateKeyFile - // are provided, this flag will be ignored. - CertDirectory string `json:"certDirectory"` - // authentication specifies how requests to the Kubelet's server are authenticated - Authentication KubeletAuthentication `json:"authentication"` - // authorization specifies how requests to the Kubelet's server are authorized - Authorization KubeletAuthorization `json:"authorization"` - // hostnameOverride is the hostname used to identify the kubelet instead - // of the actual hostname. - HostnameOverride string `json:"hostnameOverride"` - // podInfraContainerImage is the image whose network/ipc namespaces - // containers in each pod will use. - PodInfraContainerImage string `json:"podInfraContainerImage"` - // dockerEndpoint is the path to the docker endpoint to communicate with. - DockerEndpoint string `json:"dockerEndpoint"` - // rootDirectory is the directory path to place kubelet files (volume - // mounts,etc). - RootDirectory string `json:"rootDirectory"` - // seccompProfileRoot is the directory path for seccomp profiles. - SeccompProfileRoot string `json:"seccompProfileRoot"` - // allowPrivileged enables containers to request privileged mode. - // Defaults to false. - AllowPrivileged *bool `json:"allowPrivileged"` - // hostNetworkSources is a comma-separated list of sources from which the - // Kubelet allows pods to use of host network. Defaults to "*". Valid - // options are "file", "http", "api", and "*" (all sources). - HostNetworkSources []string `json:"hostNetworkSources"` - // hostPIDSources is a comma-separated list of sources from which the - // Kubelet allows pods to use the host pid namespace. Defaults to "*". - HostPIDSources []string `json:"hostPIDSources"` - // hostIPCSources is a comma-separated list of sources from which the - // Kubelet allows pods to use the host ipc namespace. Defaults to "*". - HostIPCSources []string `json:"hostIPCSources"` - // registryPullQPS is the limit of registry pulls per second. If 0, - // unlimited. Set to 0 for no limit. Defaults to 5.0. - RegistryPullQPS *int32 `json:"registryPullQPS"` - // registryBurst is the maximum size of a bursty pulls, temporarily allows - // pulls to burst to this number, while still not exceeding registryQps. - // Only used if registryQPS > 0. - RegistryBurst int32 `json:"registryBurst"` - // eventRecordQPS is the maximum event creations per second. If 0, there - // is no limit enforced. - EventRecordQPS *int32 `json:"eventRecordQPS"` - // eventBurst is the maximum size of a bursty event records, temporarily - // allows event records to burst to this number, while still not exceeding - // event-qps. Only used if eventQps > 0 - EventBurst int32 `json:"eventBurst"` - // enableDebuggingHandlers enables server endpoints for log collection - // and local running of containers and commands - EnableDebuggingHandlers *bool `json:"enableDebuggingHandlers"` - // minimumGCAge is the minimum age for a finished container before it is - // garbage collected. - MinimumGCAge unversioned.Duration `json:"minimumGCAge"` - // maxPerPodContainerCount is the maximum number of old instances to - // retain per container. Each container takes up some disk space. - MaxPerPodContainerCount int32 `json:"maxPerPodContainerCount"` - // maxContainerCount is the maximum number of old instances of containers - // to retain globally. Each container takes up some disk space. - MaxContainerCount *int32 `json:"maxContainerCount"` - // cAdvisorPort is the port of the localhost cAdvisor endpoint - CAdvisorPort int32 `json:"cAdvisorPort"` - // healthzPort is the port of the localhost healthz endpoint - HealthzPort int32 `json:"healthzPort"` - // healthzBindAddress is the IP address for the healthz server to serve - // on. - HealthzBindAddress string `json:"healthzBindAddress"` - // oomScoreAdj is The oom-score-adj value for kubelet process. Values - // must be within the range [-1000, 1000]. - OOMScoreAdj *int32 `json:"oomScoreAdj"` - // registerNode enables automatic registration with the apiserver. - RegisterNode *bool `json:"registerNode"` - // clusterDomain is the DNS domain for this cluster. If set, kubelet will - // configure all containers to search this domain in addition to the - // host's search domains. - ClusterDomain string `json:"clusterDomain"` - // masterServiceNamespace is The namespace from which the kubernetes - // master services should be injected into pods. - MasterServiceNamespace string `json:"masterServiceNamespace"` - // clusterDNS is the IP address for a cluster DNS server. If set, kubelet - // will configure all containers to use this for DNS resolution in - // addition to the host's DNS servers - ClusterDNS string `json:"clusterDNS"` - // streamingConnectionIdleTimeout is the maximum time a streaming connection - // can be idle before the connection is automatically closed. - StreamingConnectionIdleTimeout unversioned.Duration `json:"streamingConnectionIdleTimeout"` - // nodeStatusUpdateFrequency is the frequency that kubelet posts node - // status to master. Note: be cautious when changing the constant, it - // must work with nodeMonitorGracePeriod in nodecontroller. - NodeStatusUpdateFrequency unversioned.Duration `json:"nodeStatusUpdateFrequency"` - // imageMinimumGCAge is the minimum age for an unused image before it is - // garbage collected. - ImageMinimumGCAge unversioned.Duration `json:"imageMinimumGCAge"` - // imageGCHighThresholdPercent is the percent of disk usage after which - // image garbage collection is always run. The percent is calculated as - // this field value out of 100. - ImageGCHighThresholdPercent *int32 `json:"imageGCHighThresholdPercent"` - // imageGCLowThresholdPercent is the percent of disk usage before which - // image garbage collection is never run. Lowest disk usage to garbage - // collect to. The percent is calculated as this field value out of 100. - ImageGCLowThresholdPercent *int32 `json:"imageGCLowThresholdPercent"` - // lowDiskSpaceThresholdMB is the absolute free disk space, in MB, to - // maintain. When disk space falls below this threshold, new pods would - // be rejected. - LowDiskSpaceThresholdMB int32 `json:"lowDiskSpaceThresholdMB"` - // How frequently to calculate and cache volume disk usage for all pods - VolumeStatsAggPeriod unversioned.Duration `json:"volumeStatsAggPeriod"` - // networkPluginName is the name of the network plugin to be invoked for - // various events in kubelet/pod lifecycle - NetworkPluginName string `json:"networkPluginName"` - // networkPluginDir is the full path of the directory in which to search - // for network plugins (and, for backwards-compat, CNI config files) - NetworkPluginDir string `json:"networkPluginDir"` - // CNIConfDir is the full path of the directory in which to search for - // CNI config files - CNIConfDir string `json:"cniConfDir"` - // CNIBinDir is the full path of the directory in which to search for - // CNI plugin binaries - CNIBinDir string `json:"cniBinDir"` - // networkPluginMTU is the MTU to be passed to the network plugin, - // and overrides the default MTU for cases where it cannot be automatically - // computed (such as IPSEC). - NetworkPluginMTU int32 `json:"networkPluginMTU"` - // volumePluginDir is the full path of the directory in which to search - // for additional third party volume plugins - VolumePluginDir string `json:"volumePluginDir"` - // cloudProvider is the provider for cloud services. - CloudProvider string `json:"cloudProvider"` - // cloudConfigFile is the path to the cloud provider configuration file. - CloudConfigFile string `json:"cloudConfigFile"` - // kubeletCgroups is the absolute name of cgroups to isolate the kubelet in. - KubeletCgroups string `json:"kubeletCgroups"` - // runtimeCgroups are cgroups that container runtime is expected to be isolated in. - RuntimeCgroups string `json:"runtimeCgroups"` - // systemCgroups is absolute name of cgroups in which to place - // all non-kernel processes that are not already in a container. Empty - // for no container. Rolling back the flag requires a reboot. - SystemCgroups string `json:"systemCgroups"` - // cgroupRoot is the root cgroup to use for pods. This is handled by the - // container runtime on a best effort basis. - CgroupRoot string `json:"cgroupRoot"` - // Enable QoS based Cgroup hierarchy: top level cgroups for QoS Classes - // And all Burstable and BestEffort pods are brought up under their - // specific top level QoS cgroup. - // +optional - CgroupsPerQOS *bool `json:"cgroupsPerQOS,omitempty"` - // driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd) - // +optional - CgroupDriver string `json:"cgroupDriver,omitempty"` - // containerRuntime is the container runtime to use. - ContainerRuntime string `json:"containerRuntime"` - // remoteRuntimeEndpoint is the endpoint of remote runtime service - RemoteRuntimeEndpoint string `json:"remoteRuntimeEndpoint"` - // remoteImageEndpoint is the endpoint of remote image service - RemoteImageEndpoint string `json:"remoteImageEndpoint"` - // runtimeRequestTimeout is the timeout for all runtime requests except long running - // requests - pull, logs, exec and attach. - RuntimeRequestTimeout unversioned.Duration `json:"runtimeRequestTimeout"` - // rktPath is the path of rkt binary. Leave empty to use the first rkt in - // $PATH. - RktPath string `json:"rktPath"` - // experimentalMounterPath is the path to mounter binary. If not set, kubelet will attempt to use mount - // binary that is available via $PATH, - ExperimentalMounterPath string `json:"experimentalMounterPath,omitempty"` - // rktApiEndpoint is the endpoint of the rkt API service to communicate with. - RktAPIEndpoint string `json:"rktAPIEndpoint"` - // rktStage1Image is the image to use as stage1. Local paths and - // http/https URLs are supported. - RktStage1Image string `json:"rktStage1Image"` - // lockFilePath is the path that kubelet will use to as a lock file. - // It uses this file as a lock to synchronize with other kubelet processes - // that may be running. - LockFilePath *string `json:"lockFilePath"` - // ExitOnLockContention is a flag that signifies to the kubelet that it is running - // in "bootstrap" mode. This requires that 'LockFilePath' has been set. - // This will cause the kubelet to listen to inotify events on the lock file, - // releasing it and exiting when another process tries to open that file. - ExitOnLockContention bool `json:"exitOnLockContention"` - // How should the kubelet configure the container bridge for hairpin packets. - // Setting this flag allows endpoints in a Service to loadbalance back to - // themselves if they should try to access their own Service. Values: - // "promiscuous-bridge": make the container bridge promiscuous. - // "hairpin-veth": set the hairpin flag on container veth interfaces. - // "none": do nothing. - // Generally, one must set --hairpin-mode=veth-flag to achieve hairpin NAT, - // because promiscous-bridge assumes the existence of a container bridge named cbr0. - HairpinMode string `json:"hairpinMode"` - // The node has babysitter process monitoring docker and kubelet. - BabysitDaemons bool `json:"babysitDaemons"` - // maxPods is the number of pods that can run on this Kubelet. - MaxPods int32 `json:"maxPods"` - // nvidiaGPUs is the number of NVIDIA GPU devices on this node. - NvidiaGPUs int32 `json:"nvidiaGPUs"` - // dockerExecHandlerName is the handler to use when executing a command - // in a container. Valid values are 'native' and 'nsenter'. Defaults to - // 'native'. - DockerExecHandlerName string `json:"dockerExecHandlerName"` - // The CIDR to use for pod IP addresses, only used in standalone mode. - // In cluster mode, this is obtained from the master. - PodCIDR string `json:"podCIDR"` - // ResolverConfig is the resolver configuration file used as the basis - // for the container DNS resolution configuration."), [] - ResolverConfig string `json:"resolvConf"` - // cpuCFSQuota is Enable CPU CFS quota enforcement for containers that - // specify CPU limits - CPUCFSQuota *bool `json:"cpuCFSQuota"` - // containerized should be set to true if kubelet is running in a container. - Containerized *bool `json:"containerized"` - // maxOpenFiles is Number of files that can be opened by Kubelet process. - MaxOpenFiles int64 `json:"maxOpenFiles"` - // reconcileCIDR is Reconcile node CIDR with the CIDR specified by the - // API server. Won't have any effect if register-node is false. - ReconcileCIDR *bool `json:"reconcileCIDR"` - // registerSchedulable tells the kubelet to register the node as - // schedulable. Won't have any effect if register-node is false. - RegisterSchedulable *bool `json:"registerSchedulable"` - // contentType is contentType of requests sent to apiserver. - ContentType string `json:"contentType"` - // kubeAPIQPS is the QPS to use while talking with kubernetes apiserver - KubeAPIQPS *int32 `json:"kubeAPIQPS"` - // kubeAPIBurst is the burst to allow while talking with kubernetes - // apiserver - KubeAPIBurst int32 `json:"kubeAPIBurst"` - // serializeImagePulls when enabled, tells the Kubelet to pull images one - // at a time. We recommend *not* changing the default value on nodes that - // run docker daemon with version < 1.9 or an Aufs storage backend. - // Issue #10959 has more details. - SerializeImagePulls *bool `json:"serializeImagePulls"` - // outOfDiskTransitionFrequency is duration for which the kubelet has to - // wait before transitioning out of out-of-disk node condition status. - OutOfDiskTransitionFrequency unversioned.Duration `json:"outOfDiskTransitionFrequency"` - // nodeIP is IP address of the node. If set, kubelet will use this IP - // address for the node. - NodeIP string `json:"nodeIP"` - // nodeLabels to add when registering the node in the cluster. - NodeLabels map[string]string `json:"nodeLabels"` - // nonMasqueradeCIDR configures masquerading: traffic to IPs outside this range will use IP masquerade. - NonMasqueradeCIDR string `json:"nonMasqueradeCIDR"` - // enable gathering custom metrics. - EnableCustomMetrics bool `json:"enableCustomMetrics"` - // Comma-delimited list of hard eviction expressions. For example, 'memory.available<300Mi'. - EvictionHard *string `json:"evictionHard"` - // Comma-delimited list of soft eviction expressions. For example, 'memory.available<300Mi'. - EvictionSoft string `json:"evictionSoft"` - // Comma-delimeted list of grace periods for each soft eviction signal. For example, 'memory.available=30s'. - EvictionSoftGracePeriod string `json:"evictionSoftGracePeriod"` - // Duration for which the kubelet has to wait before transitioning out of an eviction pressure condition. - EvictionPressureTransitionPeriod unversioned.Duration `json:"evictionPressureTransitionPeriod"` - // Maximum allowed grace period (in seconds) to use when terminating pods in response to a soft eviction threshold being met. - EvictionMaxPodGracePeriod int32 `json:"evictionMaxPodGracePeriod"` - // Comma-delimited list of minimum reclaims (e.g. imagefs.available=2Gi) that describes the minimum amount of resource the kubelet will reclaim when performing a pod eviction if that resource is under pressure. - EvictionMinimumReclaim string `json:"evictionMinimumReclaim"` - // Maximum number of pods per core. Cannot exceed MaxPods - PodsPerCore int32 `json:"podsPerCore"` - // enableControllerAttachDetach enables the Attach/Detach controller to - // manage attachment/detachment of volumes scheduled to this node, and - // disables kubelet from executing any attach/detach operations - EnableControllerAttachDetach *bool `json:"enableControllerAttachDetach"` - // A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs - // that describe resources reserved for non-kubernetes components. - // Currently only cpu and memory are supported. [default=none] - // See http://kubernetes.io/docs/user-guide/compute-resources for more detail. - SystemReserved map[string]string `json:"systemReserved"` - // A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs - // that describe resources reserved for kubernetes system components. - // Currently only cpu and memory are supported. [default=none] - // See http://kubernetes.io/docs/user-guide/compute-resources for more detail. - KubeReserved map[string]string `json:"kubeReserved"` - // Default behaviour for kernel tuning - ProtectKernelDefaults bool `json:"protectKernelDefaults"` - // If true, Kubelet ensures a set of iptables rules are present on host. - // These rules will serve as utility rules for various components, e.g. KubeProxy. - // The rules will be created based on IPTablesMasqueradeBit and IPTablesDropBit. - MakeIPTablesUtilChains *bool `json:"makeIPTablesUtilChains"` - // iptablesMasqueradeBit is the bit of the iptables fwmark space to mark for SNAT - // Values must be within the range [0, 31]. Must be different from other mark bits. - // Warning: Please match the value of corresponding parameter in kube-proxy - // TODO: clean up IPTablesMasqueradeBit in kube-proxy - IPTablesMasqueradeBit *int32 `json:"iptablesMasqueradeBit"` - // iptablesDropBit is the bit of the iptables fwmark space to mark for dropping packets. - // Values must be within the range [0, 31]. Must be different from other mark bits. - IPTablesDropBit *int32 `json:"iptablesDropBit"` - // Whitelist of unsafe sysctls or sysctl patterns (ending in *). Use these at your own risk. - // Resource isolation might be lacking and pod might influence each other on the same node. - // +optional - AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty"` - // featureGates is a string of comma-separated key=value pairs that describe feature - // gates for alpha/experimental features. - FeatureGates string `json:"featureGates,omitempty"` - // Enable Container Runtime Interface (CRI) integration. - // +optional - EnableCRI bool `json:"enableCRI,omitempty"` - // TODO(#34726:1.8.0): Remove the opt-in for failing when swap is enabled. - // Tells the Kubelet to fail to start if swap is enabled on the node. - ExperimentalFailSwapOn bool `json:"experimentalFailSwapOn,omitempty"` - // This flag, if set, enables a check prior to mount operations to verify that the required components - // (binaries, etc.) to mount the volume are available on the underlying node. If the check is enabled - // and fails the mount operation fails. - ExperimentalCheckNodeCapabilitiesBeforeMount bool `json:"ExperimentalCheckNodeCapabilitiesBeforeMount,omitempty"` -} - -type KubeletAuthorizationMode string - -const ( - // KubeletAuthorizationModeAlwaysAllow authorizes all authenticated requests - KubeletAuthorizationModeAlwaysAllow KubeletAuthorizationMode = "AlwaysAllow" - // KubeletAuthorizationModeWebhook uses the SubjectAccessReview API to determine authorization - KubeletAuthorizationModeWebhook KubeletAuthorizationMode = "Webhook" -) - -type KubeletAuthorization struct { - // mode is the authorization mode to apply to requests to the kubelet server. - // Valid values are AlwaysAllow and Webhook. - // Webhook mode uses the SubjectAccessReview API to determine authorization. - Mode KubeletAuthorizationMode `json:"mode"` - - // webhook contains settings related to Webhook authorization. - Webhook KubeletWebhookAuthorization `json:"webhook"` -} - -type KubeletWebhookAuthorization struct { - // cacheAuthorizedTTL is the duration to cache 'authorized' responses from the webhook authorizer. - CacheAuthorizedTTL unversioned.Duration `json:"cacheAuthorizedTTL"` - // cacheUnauthorizedTTL is the duration to cache 'unauthorized' responses from the webhook authorizer. - CacheUnauthorizedTTL unversioned.Duration `json:"cacheUnauthorizedTTL"` -} - -type KubeletAuthentication struct { - // x509 contains settings related to x509 client certificate authentication - X509 KubeletX509Authentication `json:"x509"` - // webhook contains settings related to webhook bearer token authentication - Webhook KubeletWebhookAuthentication `json:"webhook"` - // anonymous contains settings related to anonymous authentication - Anonymous KubeletAnonymousAuthentication `json:"anonymous"` -} - -type KubeletX509Authentication struct { - // clientCAFile is the path to a PEM-encoded certificate bundle. If set, any request presenting a client certificate - // signed by one of the authorities in the bundle is authenticated with a username corresponding to the CommonName, - // and groups corresponding to the Organization in the client certificate. - ClientCAFile string `json:"clientCAFile"` -} - -type KubeletWebhookAuthentication struct { - // enabled allows bearer token authentication backed by the tokenreviews.authentication.k8s.io API - Enabled *bool `json:"enabled"` - // cacheTTL enables caching of authentication results - CacheTTL unversioned.Duration `json:"cacheTTL"` -} - -type KubeletAnonymousAuthentication struct { - // enabled allows anonymous requests to the kubelet server. - // Requests that are not rejected by another authentication method are treated as anonymous requests. - // Anonymous requests have a username of system:anonymous, and a group name of system:unauthenticated. - Enabled *bool `json:"enabled"` -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go b/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index f9630321..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,675 +0,0 @@ -// +build !ignore_autogenerated - -/* -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. -*/ - -// This file was autogenerated by conversion-gen. Do not edit it manually! - -package v1alpha1 - -import ( - api "k8s.io/client-go/pkg/api" - componentconfig "k8s.io/client-go/pkg/apis/componentconfig" - conversion "k8s.io/client-go/pkg/conversion" - runtime "k8s.io/client-go/pkg/runtime" - config "k8s.io/client-go/pkg/util/config" - unsafe "unsafe" -) - -func init() { - SchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(scheme *runtime.Scheme) error { - return scheme.AddGeneratedConversionFuncs( - Convert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration, - Convert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration, - Convert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration, - Convert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration, - Convert_v1alpha1_KubeletAnonymousAuthentication_To_componentconfig_KubeletAnonymousAuthentication, - Convert_componentconfig_KubeletAnonymousAuthentication_To_v1alpha1_KubeletAnonymousAuthentication, - Convert_v1alpha1_KubeletAuthentication_To_componentconfig_KubeletAuthentication, - Convert_componentconfig_KubeletAuthentication_To_v1alpha1_KubeletAuthentication, - Convert_v1alpha1_KubeletAuthorization_To_componentconfig_KubeletAuthorization, - Convert_componentconfig_KubeletAuthorization_To_v1alpha1_KubeletAuthorization, - Convert_v1alpha1_KubeletConfiguration_To_componentconfig_KubeletConfiguration, - Convert_componentconfig_KubeletConfiguration_To_v1alpha1_KubeletConfiguration, - Convert_v1alpha1_KubeletWebhookAuthentication_To_componentconfig_KubeletWebhookAuthentication, - Convert_componentconfig_KubeletWebhookAuthentication_To_v1alpha1_KubeletWebhookAuthentication, - Convert_v1alpha1_KubeletWebhookAuthorization_To_componentconfig_KubeletWebhookAuthorization, - Convert_componentconfig_KubeletWebhookAuthorization_To_v1alpha1_KubeletWebhookAuthorization, - Convert_v1alpha1_KubeletX509Authentication_To_componentconfig_KubeletX509Authentication, - Convert_componentconfig_KubeletX509Authentication_To_v1alpha1_KubeletX509Authentication, - Convert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration, - Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration, - ) -} - -func autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in *KubeProxyConfiguration, out *componentconfig.KubeProxyConfiguration, s conversion.Scope) error { - out.BindAddress = in.BindAddress - out.ClusterCIDR = in.ClusterCIDR - out.HealthzBindAddress = in.HealthzBindAddress - out.HealthzPort = in.HealthzPort - out.HostnameOverride = in.HostnameOverride - out.IPTablesMasqueradeBit = (*int32)(unsafe.Pointer(in.IPTablesMasqueradeBit)) - out.IPTablesSyncPeriod = in.IPTablesSyncPeriod - out.IPTablesMinSyncPeriod = in.IPTablesMinSyncPeriod - out.KubeconfigPath = in.KubeconfigPath - out.MasqueradeAll = in.MasqueradeAll - out.Master = in.Master - out.OOMScoreAdj = (*int32)(unsafe.Pointer(in.OOMScoreAdj)) - out.Mode = componentconfig.ProxyMode(in.Mode) - out.PortRange = in.PortRange - out.ResourceContainer = in.ResourceContainer - out.UDPIdleTimeout = in.UDPIdleTimeout - out.ConntrackMax = in.ConntrackMax - out.ConntrackMaxPerCore = in.ConntrackMaxPerCore - out.ConntrackMin = in.ConntrackMin - out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout - out.ConntrackTCPCloseWaitTimeout = in.ConntrackTCPCloseWaitTimeout - return nil -} - -func Convert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in *KubeProxyConfiguration, out *componentconfig.KubeProxyConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in, out, s) -} - -func autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in *componentconfig.KubeProxyConfiguration, out *KubeProxyConfiguration, s conversion.Scope) error { - out.BindAddress = in.BindAddress - out.ClusterCIDR = in.ClusterCIDR - out.HealthzBindAddress = in.HealthzBindAddress - out.HealthzPort = in.HealthzPort - out.HostnameOverride = in.HostnameOverride - out.IPTablesMasqueradeBit = (*int32)(unsafe.Pointer(in.IPTablesMasqueradeBit)) - out.IPTablesSyncPeriod = in.IPTablesSyncPeriod - out.IPTablesMinSyncPeriod = in.IPTablesMinSyncPeriod - out.KubeconfigPath = in.KubeconfigPath - out.MasqueradeAll = in.MasqueradeAll - out.Master = in.Master - out.OOMScoreAdj = (*int32)(unsafe.Pointer(in.OOMScoreAdj)) - out.Mode = ProxyMode(in.Mode) - out.PortRange = in.PortRange - out.ResourceContainer = in.ResourceContainer - out.UDPIdleTimeout = in.UDPIdleTimeout - out.ConntrackMax = in.ConntrackMax - out.ConntrackMaxPerCore = in.ConntrackMaxPerCore - out.ConntrackMin = in.ConntrackMin - out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout - out.ConntrackTCPCloseWaitTimeout = in.ConntrackTCPCloseWaitTimeout - return nil -} - -func Convert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in *componentconfig.KubeProxyConfiguration, out *KubeProxyConfiguration, s conversion.Scope) error { - return autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in, out, s) -} - -func autoConvert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration(in *KubeSchedulerConfiguration, out *componentconfig.KubeSchedulerConfiguration, s conversion.Scope) error { - out.Port = int32(in.Port) - out.Address = in.Address - out.AlgorithmProvider = in.AlgorithmProvider - out.PolicyConfigFile = in.PolicyConfigFile - if err := api.Convert_Pointer_bool_To_bool(&in.EnableProfiling, &out.EnableProfiling, s); err != nil { - return err - } - out.ContentType = in.ContentType - out.KubeAPIQPS = in.KubeAPIQPS - out.KubeAPIBurst = int32(in.KubeAPIBurst) - out.SchedulerName = in.SchedulerName - out.HardPodAffinitySymmetricWeight = in.HardPodAffinitySymmetricWeight - out.FailureDomains = in.FailureDomains - if err := Convert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration(in *KubeSchedulerConfiguration, out *componentconfig.KubeSchedulerConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration(in, out, s) -} - -func autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in *componentconfig.KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, s conversion.Scope) error { - out.Port = int(in.Port) - out.Address = in.Address - out.AlgorithmProvider = in.AlgorithmProvider - out.PolicyConfigFile = in.PolicyConfigFile - if err := api.Convert_bool_To_Pointer_bool(&in.EnableProfiling, &out.EnableProfiling, s); err != nil { - return err - } - out.ContentType = in.ContentType - out.KubeAPIQPS = in.KubeAPIQPS - out.KubeAPIBurst = int(in.KubeAPIBurst) - out.SchedulerName = in.SchedulerName - out.HardPodAffinitySymmetricWeight = in.HardPodAffinitySymmetricWeight - out.FailureDomains = in.FailureDomains - if err := Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { - return err - } - return nil -} - -func Convert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in *componentconfig.KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, s conversion.Scope) error { - return autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in, out, s) -} - -func autoConvert_v1alpha1_KubeletAnonymousAuthentication_To_componentconfig_KubeletAnonymousAuthentication(in *KubeletAnonymousAuthentication, out *componentconfig.KubeletAnonymousAuthentication, s conversion.Scope) error { - if err := api.Convert_Pointer_bool_To_bool(&in.Enabled, &out.Enabled, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_KubeletAnonymousAuthentication_To_componentconfig_KubeletAnonymousAuthentication(in *KubeletAnonymousAuthentication, out *componentconfig.KubeletAnonymousAuthentication, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeletAnonymousAuthentication_To_componentconfig_KubeletAnonymousAuthentication(in, out, s) -} - -func autoConvert_componentconfig_KubeletAnonymousAuthentication_To_v1alpha1_KubeletAnonymousAuthentication(in *componentconfig.KubeletAnonymousAuthentication, out *KubeletAnonymousAuthentication, s conversion.Scope) error { - if err := api.Convert_bool_To_Pointer_bool(&in.Enabled, &out.Enabled, s); err != nil { - return err - } - return nil -} - -func Convert_componentconfig_KubeletAnonymousAuthentication_To_v1alpha1_KubeletAnonymousAuthentication(in *componentconfig.KubeletAnonymousAuthentication, out *KubeletAnonymousAuthentication, s conversion.Scope) error { - return autoConvert_componentconfig_KubeletAnonymousAuthentication_To_v1alpha1_KubeletAnonymousAuthentication(in, out, s) -} - -func autoConvert_v1alpha1_KubeletAuthentication_To_componentconfig_KubeletAuthentication(in *KubeletAuthentication, out *componentconfig.KubeletAuthentication, s conversion.Scope) error { - if err := Convert_v1alpha1_KubeletX509Authentication_To_componentconfig_KubeletX509Authentication(&in.X509, &out.X509, s); err != nil { - return err - } - if err := Convert_v1alpha1_KubeletWebhookAuthentication_To_componentconfig_KubeletWebhookAuthentication(&in.Webhook, &out.Webhook, s); err != nil { - return err - } - if err := Convert_v1alpha1_KubeletAnonymousAuthentication_To_componentconfig_KubeletAnonymousAuthentication(&in.Anonymous, &out.Anonymous, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_KubeletAuthentication_To_componentconfig_KubeletAuthentication(in *KubeletAuthentication, out *componentconfig.KubeletAuthentication, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeletAuthentication_To_componentconfig_KubeletAuthentication(in, out, s) -} - -func autoConvert_componentconfig_KubeletAuthentication_To_v1alpha1_KubeletAuthentication(in *componentconfig.KubeletAuthentication, out *KubeletAuthentication, s conversion.Scope) error { - if err := Convert_componentconfig_KubeletX509Authentication_To_v1alpha1_KubeletX509Authentication(&in.X509, &out.X509, s); err != nil { - return err - } - if err := Convert_componentconfig_KubeletWebhookAuthentication_To_v1alpha1_KubeletWebhookAuthentication(&in.Webhook, &out.Webhook, s); err != nil { - return err - } - if err := Convert_componentconfig_KubeletAnonymousAuthentication_To_v1alpha1_KubeletAnonymousAuthentication(&in.Anonymous, &out.Anonymous, s); err != nil { - return err - } - return nil -} - -func Convert_componentconfig_KubeletAuthentication_To_v1alpha1_KubeletAuthentication(in *componentconfig.KubeletAuthentication, out *KubeletAuthentication, s conversion.Scope) error { - return autoConvert_componentconfig_KubeletAuthentication_To_v1alpha1_KubeletAuthentication(in, out, s) -} - -func autoConvert_v1alpha1_KubeletAuthorization_To_componentconfig_KubeletAuthorization(in *KubeletAuthorization, out *componentconfig.KubeletAuthorization, s conversion.Scope) error { - out.Mode = componentconfig.KubeletAuthorizationMode(in.Mode) - if err := Convert_v1alpha1_KubeletWebhookAuthorization_To_componentconfig_KubeletWebhookAuthorization(&in.Webhook, &out.Webhook, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_KubeletAuthorization_To_componentconfig_KubeletAuthorization(in *KubeletAuthorization, out *componentconfig.KubeletAuthorization, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeletAuthorization_To_componentconfig_KubeletAuthorization(in, out, s) -} - -func autoConvert_componentconfig_KubeletAuthorization_To_v1alpha1_KubeletAuthorization(in *componentconfig.KubeletAuthorization, out *KubeletAuthorization, s conversion.Scope) error { - out.Mode = KubeletAuthorizationMode(in.Mode) - if err := Convert_componentconfig_KubeletWebhookAuthorization_To_v1alpha1_KubeletWebhookAuthorization(&in.Webhook, &out.Webhook, s); err != nil { - return err - } - return nil -} - -func Convert_componentconfig_KubeletAuthorization_To_v1alpha1_KubeletAuthorization(in *componentconfig.KubeletAuthorization, out *KubeletAuthorization, s conversion.Scope) error { - return autoConvert_componentconfig_KubeletAuthorization_To_v1alpha1_KubeletAuthorization(in, out, s) -} - -func autoConvert_v1alpha1_KubeletConfiguration_To_componentconfig_KubeletConfiguration(in *KubeletConfiguration, out *componentconfig.KubeletConfiguration, s conversion.Scope) error { - out.PodManifestPath = in.PodManifestPath - out.SyncFrequency = in.SyncFrequency - out.FileCheckFrequency = in.FileCheckFrequency - out.HTTPCheckFrequency = in.HTTPCheckFrequency - out.ManifestURL = in.ManifestURL - out.ManifestURLHeader = in.ManifestURLHeader - if err := api.Convert_Pointer_bool_To_bool(&in.EnableServer, &out.EnableServer, s); err != nil { - return err - } - out.Address = in.Address - out.Port = in.Port - out.ReadOnlyPort = in.ReadOnlyPort - out.TLSCertFile = in.TLSCertFile - out.TLSPrivateKeyFile = in.TLSPrivateKeyFile - out.CertDirectory = in.CertDirectory - if err := Convert_v1alpha1_KubeletAuthentication_To_componentconfig_KubeletAuthentication(&in.Authentication, &out.Authentication, s); err != nil { - return err - } - if err := Convert_v1alpha1_KubeletAuthorization_To_componentconfig_KubeletAuthorization(&in.Authorization, &out.Authorization, s); err != nil { - return err - } - out.HostnameOverride = in.HostnameOverride - out.PodInfraContainerImage = in.PodInfraContainerImage - out.DockerEndpoint = in.DockerEndpoint - out.RootDirectory = in.RootDirectory - out.SeccompProfileRoot = in.SeccompProfileRoot - if err := api.Convert_Pointer_bool_To_bool(&in.AllowPrivileged, &out.AllowPrivileged, s); err != nil { - return err - } - out.HostNetworkSources = *(*[]string)(unsafe.Pointer(&in.HostNetworkSources)) - out.HostPIDSources = *(*[]string)(unsafe.Pointer(&in.HostPIDSources)) - out.HostIPCSources = *(*[]string)(unsafe.Pointer(&in.HostIPCSources)) - if err := api.Convert_Pointer_int32_To_int32(&in.RegistryPullQPS, &out.RegistryPullQPS, s); err != nil { - return err - } - out.RegistryBurst = in.RegistryBurst - if err := api.Convert_Pointer_int32_To_int32(&in.EventRecordQPS, &out.EventRecordQPS, s); err != nil { - return err - } - out.EventBurst = in.EventBurst - if err := api.Convert_Pointer_bool_To_bool(&in.EnableDebuggingHandlers, &out.EnableDebuggingHandlers, s); err != nil { - return err - } - out.MinimumGCAge = in.MinimumGCAge - out.MaxPerPodContainerCount = in.MaxPerPodContainerCount - if err := api.Convert_Pointer_int32_To_int32(&in.MaxContainerCount, &out.MaxContainerCount, s); err != nil { - return err - } - out.CAdvisorPort = in.CAdvisorPort - out.HealthzPort = in.HealthzPort - out.HealthzBindAddress = in.HealthzBindAddress - if err := api.Convert_Pointer_int32_To_int32(&in.OOMScoreAdj, &out.OOMScoreAdj, s); err != nil { - return err - } - if err := api.Convert_Pointer_bool_To_bool(&in.RegisterNode, &out.RegisterNode, s); err != nil { - return err - } - out.ClusterDomain = in.ClusterDomain - out.MasterServiceNamespace = in.MasterServiceNamespace - out.ClusterDNS = in.ClusterDNS - out.StreamingConnectionIdleTimeout = in.StreamingConnectionIdleTimeout - out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency - out.ImageMinimumGCAge = in.ImageMinimumGCAge - if err := api.Convert_Pointer_int32_To_int32(&in.ImageGCHighThresholdPercent, &out.ImageGCHighThresholdPercent, s); err != nil { - return err - } - if err := api.Convert_Pointer_int32_To_int32(&in.ImageGCLowThresholdPercent, &out.ImageGCLowThresholdPercent, s); err != nil { - return err - } - out.LowDiskSpaceThresholdMB = in.LowDiskSpaceThresholdMB - out.VolumeStatsAggPeriod = in.VolumeStatsAggPeriod - out.NetworkPluginName = in.NetworkPluginName - out.NetworkPluginDir = in.NetworkPluginDir - out.CNIConfDir = in.CNIConfDir - out.CNIBinDir = in.CNIBinDir - out.NetworkPluginMTU = in.NetworkPluginMTU - out.VolumePluginDir = in.VolumePluginDir - out.CloudProvider = in.CloudProvider - out.CloudConfigFile = in.CloudConfigFile - out.KubeletCgroups = in.KubeletCgroups - out.RuntimeCgroups = in.RuntimeCgroups - out.SystemCgroups = in.SystemCgroups - out.CgroupRoot = in.CgroupRoot - if err := api.Convert_Pointer_bool_To_bool(&in.CgroupsPerQOS, &out.CgroupsPerQOS, s); err != nil { - return err - } - out.CgroupDriver = in.CgroupDriver - out.ContainerRuntime = in.ContainerRuntime - out.RemoteRuntimeEndpoint = in.RemoteRuntimeEndpoint - out.RemoteImageEndpoint = in.RemoteImageEndpoint - out.RuntimeRequestTimeout = in.RuntimeRequestTimeout - out.RktPath = in.RktPath - out.ExperimentalMounterPath = in.ExperimentalMounterPath - out.RktAPIEndpoint = in.RktAPIEndpoint - out.RktStage1Image = in.RktStage1Image - if err := api.Convert_Pointer_string_To_string(&in.LockFilePath, &out.LockFilePath, s); err != nil { - return err - } - out.ExitOnLockContention = in.ExitOnLockContention - out.HairpinMode = in.HairpinMode - out.BabysitDaemons = in.BabysitDaemons - out.MaxPods = in.MaxPods - out.NvidiaGPUs = in.NvidiaGPUs - out.DockerExecHandlerName = in.DockerExecHandlerName - out.PodCIDR = in.PodCIDR - out.ResolverConfig = in.ResolverConfig - if err := api.Convert_Pointer_bool_To_bool(&in.CPUCFSQuota, &out.CPUCFSQuota, s); err != nil { - return err - } - if err := api.Convert_Pointer_bool_To_bool(&in.Containerized, &out.Containerized, s); err != nil { - return err - } - out.MaxOpenFiles = in.MaxOpenFiles - if err := api.Convert_Pointer_bool_To_bool(&in.ReconcileCIDR, &out.ReconcileCIDR, s); err != nil { - return err - } - if err := api.Convert_Pointer_bool_To_bool(&in.RegisterSchedulable, &out.RegisterSchedulable, s); err != nil { - return err - } - out.ContentType = in.ContentType - if err := api.Convert_Pointer_int32_To_int32(&in.KubeAPIQPS, &out.KubeAPIQPS, s); err != nil { - return err - } - out.KubeAPIBurst = in.KubeAPIBurst - if err := api.Convert_Pointer_bool_To_bool(&in.SerializeImagePulls, &out.SerializeImagePulls, s); err != nil { - return err - } - out.OutOfDiskTransitionFrequency = in.OutOfDiskTransitionFrequency - out.NodeIP = in.NodeIP - out.NodeLabels = *(*map[string]string)(unsafe.Pointer(&in.NodeLabels)) - out.NonMasqueradeCIDR = in.NonMasqueradeCIDR - out.EnableCustomMetrics = in.EnableCustomMetrics - if err := api.Convert_Pointer_string_To_string(&in.EvictionHard, &out.EvictionHard, s); err != nil { - return err - } - out.EvictionSoft = in.EvictionSoft - out.EvictionSoftGracePeriod = in.EvictionSoftGracePeriod - out.EvictionPressureTransitionPeriod = in.EvictionPressureTransitionPeriod - out.EvictionMaxPodGracePeriod = in.EvictionMaxPodGracePeriod - out.EvictionMinimumReclaim = in.EvictionMinimumReclaim - out.PodsPerCore = in.PodsPerCore - if err := api.Convert_Pointer_bool_To_bool(&in.EnableControllerAttachDetach, &out.EnableControllerAttachDetach, s); err != nil { - return err - } - out.SystemReserved = *(*config.ConfigurationMap)(unsafe.Pointer(&in.SystemReserved)) - out.KubeReserved = *(*config.ConfigurationMap)(unsafe.Pointer(&in.KubeReserved)) - out.ProtectKernelDefaults = in.ProtectKernelDefaults - if err := api.Convert_Pointer_bool_To_bool(&in.MakeIPTablesUtilChains, &out.MakeIPTablesUtilChains, s); err != nil { - return err - } - if err := api.Convert_Pointer_int32_To_int32(&in.IPTablesMasqueradeBit, &out.IPTablesMasqueradeBit, s); err != nil { - return err - } - if err := api.Convert_Pointer_int32_To_int32(&in.IPTablesDropBit, &out.IPTablesDropBit, s); err != nil { - return err - } - out.AllowedUnsafeSysctls = *(*[]string)(unsafe.Pointer(&in.AllowedUnsafeSysctls)) - out.FeatureGates = in.FeatureGates - out.EnableCRI = in.EnableCRI - out.ExperimentalFailSwapOn = in.ExperimentalFailSwapOn - out.ExperimentalCheckNodeCapabilitiesBeforeMount = in.ExperimentalCheckNodeCapabilitiesBeforeMount - return nil -} - -func Convert_v1alpha1_KubeletConfiguration_To_componentconfig_KubeletConfiguration(in *KubeletConfiguration, out *componentconfig.KubeletConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeletConfiguration_To_componentconfig_KubeletConfiguration(in, out, s) -} - -func autoConvert_componentconfig_KubeletConfiguration_To_v1alpha1_KubeletConfiguration(in *componentconfig.KubeletConfiguration, out *KubeletConfiguration, s conversion.Scope) error { - out.PodManifestPath = in.PodManifestPath - out.SyncFrequency = in.SyncFrequency - out.FileCheckFrequency = in.FileCheckFrequency - out.HTTPCheckFrequency = in.HTTPCheckFrequency - out.ManifestURL = in.ManifestURL - out.ManifestURLHeader = in.ManifestURLHeader - if err := api.Convert_bool_To_Pointer_bool(&in.EnableServer, &out.EnableServer, s); err != nil { - return err - } - out.Address = in.Address - out.Port = in.Port - out.ReadOnlyPort = in.ReadOnlyPort - out.TLSCertFile = in.TLSCertFile - out.TLSPrivateKeyFile = in.TLSPrivateKeyFile - out.CertDirectory = in.CertDirectory - if err := Convert_componentconfig_KubeletAuthentication_To_v1alpha1_KubeletAuthentication(&in.Authentication, &out.Authentication, s); err != nil { - return err - } - if err := Convert_componentconfig_KubeletAuthorization_To_v1alpha1_KubeletAuthorization(&in.Authorization, &out.Authorization, s); err != nil { - return err - } - out.HostnameOverride = in.HostnameOverride - out.PodInfraContainerImage = in.PodInfraContainerImage - out.DockerEndpoint = in.DockerEndpoint - out.RootDirectory = in.RootDirectory - out.SeccompProfileRoot = in.SeccompProfileRoot - if err := api.Convert_bool_To_Pointer_bool(&in.AllowPrivileged, &out.AllowPrivileged, s); err != nil { - return err - } - out.HostNetworkSources = *(*[]string)(unsafe.Pointer(&in.HostNetworkSources)) - out.HostPIDSources = *(*[]string)(unsafe.Pointer(&in.HostPIDSources)) - out.HostIPCSources = *(*[]string)(unsafe.Pointer(&in.HostIPCSources)) - if err := api.Convert_int32_To_Pointer_int32(&in.RegistryPullQPS, &out.RegistryPullQPS, s); err != nil { - return err - } - out.RegistryBurst = in.RegistryBurst - if err := api.Convert_int32_To_Pointer_int32(&in.EventRecordQPS, &out.EventRecordQPS, s); err != nil { - return err - } - out.EventBurst = in.EventBurst - if err := api.Convert_bool_To_Pointer_bool(&in.EnableDebuggingHandlers, &out.EnableDebuggingHandlers, s); err != nil { - return err - } - out.MinimumGCAge = in.MinimumGCAge - out.MaxPerPodContainerCount = in.MaxPerPodContainerCount - if err := api.Convert_int32_To_Pointer_int32(&in.MaxContainerCount, &out.MaxContainerCount, s); err != nil { - return err - } - out.CAdvisorPort = in.CAdvisorPort - out.HealthzPort = in.HealthzPort - out.HealthzBindAddress = in.HealthzBindAddress - if err := api.Convert_int32_To_Pointer_int32(&in.OOMScoreAdj, &out.OOMScoreAdj, s); err != nil { - return err - } - if err := api.Convert_bool_To_Pointer_bool(&in.RegisterNode, &out.RegisterNode, s); err != nil { - return err - } - out.ClusterDomain = in.ClusterDomain - out.MasterServiceNamespace = in.MasterServiceNamespace - out.ClusterDNS = in.ClusterDNS - out.StreamingConnectionIdleTimeout = in.StreamingConnectionIdleTimeout - out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency - out.ImageMinimumGCAge = in.ImageMinimumGCAge - if err := api.Convert_int32_To_Pointer_int32(&in.ImageGCHighThresholdPercent, &out.ImageGCHighThresholdPercent, s); err != nil { - return err - } - if err := api.Convert_int32_To_Pointer_int32(&in.ImageGCLowThresholdPercent, &out.ImageGCLowThresholdPercent, s); err != nil { - return err - } - out.LowDiskSpaceThresholdMB = in.LowDiskSpaceThresholdMB - out.VolumeStatsAggPeriod = in.VolumeStatsAggPeriod - out.NetworkPluginName = in.NetworkPluginName - out.NetworkPluginMTU = in.NetworkPluginMTU - out.NetworkPluginDir = in.NetworkPluginDir - out.CNIConfDir = in.CNIConfDir - out.CNIBinDir = in.CNIBinDir - out.VolumePluginDir = in.VolumePluginDir - out.CloudProvider = in.CloudProvider - out.CloudConfigFile = in.CloudConfigFile - out.KubeletCgroups = in.KubeletCgroups - if err := api.Convert_bool_To_Pointer_bool(&in.CgroupsPerQOS, &out.CgroupsPerQOS, s); err != nil { - return err - } - out.CgroupDriver = in.CgroupDriver - out.RuntimeCgroups = in.RuntimeCgroups - out.SystemCgroups = in.SystemCgroups - out.CgroupRoot = in.CgroupRoot - out.ContainerRuntime = in.ContainerRuntime - out.RemoteRuntimeEndpoint = in.RemoteRuntimeEndpoint - out.RemoteImageEndpoint = in.RemoteImageEndpoint - out.RuntimeRequestTimeout = in.RuntimeRequestTimeout - out.RktPath = in.RktPath - out.ExperimentalMounterPath = in.ExperimentalMounterPath - out.RktAPIEndpoint = in.RktAPIEndpoint - out.RktStage1Image = in.RktStage1Image - if err := api.Convert_string_To_Pointer_string(&in.LockFilePath, &out.LockFilePath, s); err != nil { - return err - } - out.ExitOnLockContention = in.ExitOnLockContention - out.HairpinMode = in.HairpinMode - out.BabysitDaemons = in.BabysitDaemons - out.MaxPods = in.MaxPods - out.NvidiaGPUs = in.NvidiaGPUs - out.DockerExecHandlerName = in.DockerExecHandlerName - out.PodCIDR = in.PodCIDR - out.ResolverConfig = in.ResolverConfig - if err := api.Convert_bool_To_Pointer_bool(&in.CPUCFSQuota, &out.CPUCFSQuota, s); err != nil { - return err - } - if err := api.Convert_bool_To_Pointer_bool(&in.Containerized, &out.Containerized, s); err != nil { - return err - } - out.MaxOpenFiles = in.MaxOpenFiles - if err := api.Convert_bool_To_Pointer_bool(&in.ReconcileCIDR, &out.ReconcileCIDR, s); err != nil { - return err - } - if err := api.Convert_bool_To_Pointer_bool(&in.RegisterSchedulable, &out.RegisterSchedulable, s); err != nil { - return err - } - out.ContentType = in.ContentType - if err := api.Convert_int32_To_Pointer_int32(&in.KubeAPIQPS, &out.KubeAPIQPS, s); err != nil { - return err - } - out.KubeAPIBurst = in.KubeAPIBurst - if err := api.Convert_bool_To_Pointer_bool(&in.SerializeImagePulls, &out.SerializeImagePulls, s); err != nil { - return err - } - out.OutOfDiskTransitionFrequency = in.OutOfDiskTransitionFrequency - out.NodeIP = in.NodeIP - out.NodeLabels = *(*map[string]string)(unsafe.Pointer(&in.NodeLabels)) - out.NonMasqueradeCIDR = in.NonMasqueradeCIDR - out.EnableCustomMetrics = in.EnableCustomMetrics - if err := api.Convert_string_To_Pointer_string(&in.EvictionHard, &out.EvictionHard, s); err != nil { - return err - } - out.EvictionSoft = in.EvictionSoft - out.EvictionSoftGracePeriod = in.EvictionSoftGracePeriod - out.EvictionPressureTransitionPeriod = in.EvictionPressureTransitionPeriod - out.EvictionMaxPodGracePeriod = in.EvictionMaxPodGracePeriod - out.EvictionMinimumReclaim = in.EvictionMinimumReclaim - out.PodsPerCore = in.PodsPerCore - if err := api.Convert_bool_To_Pointer_bool(&in.EnableControllerAttachDetach, &out.EnableControllerAttachDetach, s); err != nil { - return err - } - out.SystemReserved = *(*map[string]string)(unsafe.Pointer(&in.SystemReserved)) - out.KubeReserved = *(*map[string]string)(unsafe.Pointer(&in.KubeReserved)) - out.ProtectKernelDefaults = in.ProtectKernelDefaults - if err := api.Convert_bool_To_Pointer_bool(&in.MakeIPTablesUtilChains, &out.MakeIPTablesUtilChains, s); err != nil { - return err - } - if err := api.Convert_int32_To_Pointer_int32(&in.IPTablesMasqueradeBit, &out.IPTablesMasqueradeBit, s); err != nil { - return err - } - if err := api.Convert_int32_To_Pointer_int32(&in.IPTablesDropBit, &out.IPTablesDropBit, s); err != nil { - return err - } - out.AllowedUnsafeSysctls = *(*[]string)(unsafe.Pointer(&in.AllowedUnsafeSysctls)) - out.FeatureGates = in.FeatureGates - out.EnableCRI = in.EnableCRI - out.ExperimentalFailSwapOn = in.ExperimentalFailSwapOn - out.ExperimentalCheckNodeCapabilitiesBeforeMount = in.ExperimentalCheckNodeCapabilitiesBeforeMount - return nil -} - -func Convert_componentconfig_KubeletConfiguration_To_v1alpha1_KubeletConfiguration(in *componentconfig.KubeletConfiguration, out *KubeletConfiguration, s conversion.Scope) error { - return autoConvert_componentconfig_KubeletConfiguration_To_v1alpha1_KubeletConfiguration(in, out, s) -} - -func autoConvert_v1alpha1_KubeletWebhookAuthentication_To_componentconfig_KubeletWebhookAuthentication(in *KubeletWebhookAuthentication, out *componentconfig.KubeletWebhookAuthentication, s conversion.Scope) error { - if err := api.Convert_Pointer_bool_To_bool(&in.Enabled, &out.Enabled, s); err != nil { - return err - } - out.CacheTTL = in.CacheTTL - return nil -} - -func Convert_v1alpha1_KubeletWebhookAuthentication_To_componentconfig_KubeletWebhookAuthentication(in *KubeletWebhookAuthentication, out *componentconfig.KubeletWebhookAuthentication, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeletWebhookAuthentication_To_componentconfig_KubeletWebhookAuthentication(in, out, s) -} - -func autoConvert_componentconfig_KubeletWebhookAuthentication_To_v1alpha1_KubeletWebhookAuthentication(in *componentconfig.KubeletWebhookAuthentication, out *KubeletWebhookAuthentication, s conversion.Scope) error { - if err := api.Convert_bool_To_Pointer_bool(&in.Enabled, &out.Enabled, s); err != nil { - return err - } - out.CacheTTL = in.CacheTTL - return nil -} - -func Convert_componentconfig_KubeletWebhookAuthentication_To_v1alpha1_KubeletWebhookAuthentication(in *componentconfig.KubeletWebhookAuthentication, out *KubeletWebhookAuthentication, s conversion.Scope) error { - return autoConvert_componentconfig_KubeletWebhookAuthentication_To_v1alpha1_KubeletWebhookAuthentication(in, out, s) -} - -func autoConvert_v1alpha1_KubeletWebhookAuthorization_To_componentconfig_KubeletWebhookAuthorization(in *KubeletWebhookAuthorization, out *componentconfig.KubeletWebhookAuthorization, s conversion.Scope) error { - out.CacheAuthorizedTTL = in.CacheAuthorizedTTL - out.CacheUnauthorizedTTL = in.CacheUnauthorizedTTL - return nil -} - -func Convert_v1alpha1_KubeletWebhookAuthorization_To_componentconfig_KubeletWebhookAuthorization(in *KubeletWebhookAuthorization, out *componentconfig.KubeletWebhookAuthorization, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeletWebhookAuthorization_To_componentconfig_KubeletWebhookAuthorization(in, out, s) -} - -func autoConvert_componentconfig_KubeletWebhookAuthorization_To_v1alpha1_KubeletWebhookAuthorization(in *componentconfig.KubeletWebhookAuthorization, out *KubeletWebhookAuthorization, s conversion.Scope) error { - out.CacheAuthorizedTTL = in.CacheAuthorizedTTL - out.CacheUnauthorizedTTL = in.CacheUnauthorizedTTL - return nil -} - -func Convert_componentconfig_KubeletWebhookAuthorization_To_v1alpha1_KubeletWebhookAuthorization(in *componentconfig.KubeletWebhookAuthorization, out *KubeletWebhookAuthorization, s conversion.Scope) error { - return autoConvert_componentconfig_KubeletWebhookAuthorization_To_v1alpha1_KubeletWebhookAuthorization(in, out, s) -} - -func autoConvert_v1alpha1_KubeletX509Authentication_To_componentconfig_KubeletX509Authentication(in *KubeletX509Authentication, out *componentconfig.KubeletX509Authentication, s conversion.Scope) error { - out.ClientCAFile = in.ClientCAFile - return nil -} - -func Convert_v1alpha1_KubeletX509Authentication_To_componentconfig_KubeletX509Authentication(in *KubeletX509Authentication, out *componentconfig.KubeletX509Authentication, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeletX509Authentication_To_componentconfig_KubeletX509Authentication(in, out, s) -} - -func autoConvert_componentconfig_KubeletX509Authentication_To_v1alpha1_KubeletX509Authentication(in *componentconfig.KubeletX509Authentication, out *KubeletX509Authentication, s conversion.Scope) error { - out.ClientCAFile = in.ClientCAFile - return nil -} - -func Convert_componentconfig_KubeletX509Authentication_To_v1alpha1_KubeletX509Authentication(in *componentconfig.KubeletX509Authentication, out *KubeletX509Authentication, s conversion.Scope) error { - return autoConvert_componentconfig_KubeletX509Authentication_To_v1alpha1_KubeletX509Authentication(in, out, s) -} - -func autoConvert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(in *LeaderElectionConfiguration, out *componentconfig.LeaderElectionConfiguration, s conversion.Scope) error { - if err := api.Convert_Pointer_bool_To_bool(&in.LeaderElect, &out.LeaderElect, s); err != nil { - return err - } - out.LeaseDuration = in.LeaseDuration - out.RenewDeadline = in.RenewDeadline - out.RetryPeriod = in.RetryPeriod - return nil -} - -func Convert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(in *LeaderElectionConfiguration, out *componentconfig.LeaderElectionConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(in, out, s) -} - -func autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in *componentconfig.LeaderElectionConfiguration, out *LeaderElectionConfiguration, s conversion.Scope) error { - if err := api.Convert_bool_To_Pointer_bool(&in.LeaderElect, &out.LeaderElect, s); err != nil { - return err - } - out.LeaseDuration = in.LeaseDuration - out.RenewDeadline = in.RenewDeadline - out.RetryPeriod = in.RetryPeriod - return nil -} - -func Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in *componentconfig.LeaderElectionConfiguration, out *LeaderElectionConfiguration, s conversion.Scope) error { - return autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in, out, s) -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.deepcopy.go b/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 6ca1d8a1..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,520 +0,0 @@ -// +build !ignore_autogenerated - -/* -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. -*/ - -// This file was autogenerated by deepcopy-gen. Do not edit it manually! - -package v1alpha1 - -import ( - conversion "k8s.io/client-go/pkg/conversion" - runtime "k8s.io/client-go/pkg/runtime" - reflect "reflect" -) - -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeProxyConfiguration, InType: reflect.TypeOf(&KubeProxyConfiguration{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeSchedulerConfiguration, InType: reflect.TypeOf(&KubeSchedulerConfiguration{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeletAnonymousAuthentication, InType: reflect.TypeOf(&KubeletAnonymousAuthentication{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeletAuthentication, InType: reflect.TypeOf(&KubeletAuthentication{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeletAuthorization, InType: reflect.TypeOf(&KubeletAuthorization{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeletConfiguration, InType: reflect.TypeOf(&KubeletConfiguration{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeletWebhookAuthentication, InType: reflect.TypeOf(&KubeletWebhookAuthentication{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeletWebhookAuthorization, InType: reflect.TypeOf(&KubeletWebhookAuthorization{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeletX509Authentication, InType: reflect.TypeOf(&KubeletX509Authentication{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_LeaderElectionConfiguration, InType: reflect.TypeOf(&LeaderElectionConfiguration{})}, - ) -} - -func DeepCopy_v1alpha1_KubeProxyConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeProxyConfiguration) - out := out.(*KubeProxyConfiguration) - out.TypeMeta = in.TypeMeta - out.BindAddress = in.BindAddress - out.ClusterCIDR = in.ClusterCIDR - out.HealthzBindAddress = in.HealthzBindAddress - out.HealthzPort = in.HealthzPort - out.HostnameOverride = in.HostnameOverride - if in.IPTablesMasqueradeBit != nil { - in, out := &in.IPTablesMasqueradeBit, &out.IPTablesMasqueradeBit - *out = new(int32) - **out = **in - } else { - out.IPTablesMasqueradeBit = nil - } - out.IPTablesSyncPeriod = in.IPTablesSyncPeriod - out.IPTablesMinSyncPeriod = in.IPTablesMinSyncPeriod - out.KubeconfigPath = in.KubeconfigPath - out.MasqueradeAll = in.MasqueradeAll - out.Master = in.Master - if in.OOMScoreAdj != nil { - in, out := &in.OOMScoreAdj, &out.OOMScoreAdj - *out = new(int32) - **out = **in - } else { - out.OOMScoreAdj = nil - } - out.Mode = in.Mode - out.PortRange = in.PortRange - out.ResourceContainer = in.ResourceContainer - out.UDPIdleTimeout = in.UDPIdleTimeout - out.ConntrackMax = in.ConntrackMax - out.ConntrackMaxPerCore = in.ConntrackMaxPerCore - out.ConntrackMin = in.ConntrackMin - out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout - out.ConntrackTCPCloseWaitTimeout = in.ConntrackTCPCloseWaitTimeout - return nil - } -} - -func DeepCopy_v1alpha1_KubeSchedulerConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeSchedulerConfiguration) - out := out.(*KubeSchedulerConfiguration) - out.TypeMeta = in.TypeMeta - out.Port = in.Port - out.Address = in.Address - out.AlgorithmProvider = in.AlgorithmProvider - out.PolicyConfigFile = in.PolicyConfigFile - if in.EnableProfiling != nil { - in, out := &in.EnableProfiling, &out.EnableProfiling - *out = new(bool) - **out = **in - } else { - out.EnableProfiling = nil - } - out.ContentType = in.ContentType - out.KubeAPIQPS = in.KubeAPIQPS - out.KubeAPIBurst = in.KubeAPIBurst - out.SchedulerName = in.SchedulerName - out.HardPodAffinitySymmetricWeight = in.HardPodAffinitySymmetricWeight - out.FailureDomains = in.FailureDomains - if err := DeepCopy_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1alpha1_KubeletAnonymousAuthentication(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeletAnonymousAuthentication) - out := out.(*KubeletAnonymousAuthentication) - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } else { - out.Enabled = nil - } - return nil - } -} - -func DeepCopy_v1alpha1_KubeletAuthentication(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeletAuthentication) - out := out.(*KubeletAuthentication) - out.X509 = in.X509 - if err := DeepCopy_v1alpha1_KubeletWebhookAuthentication(&in.Webhook, &out.Webhook, c); err != nil { - return err - } - if err := DeepCopy_v1alpha1_KubeletAnonymousAuthentication(&in.Anonymous, &out.Anonymous, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1alpha1_KubeletAuthorization(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeletAuthorization) - out := out.(*KubeletAuthorization) - out.Mode = in.Mode - out.Webhook = in.Webhook - return nil - } -} - -func DeepCopy_v1alpha1_KubeletConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeletConfiguration) - out := out.(*KubeletConfiguration) - out.TypeMeta = in.TypeMeta - out.PodManifestPath = in.PodManifestPath - out.SyncFrequency = in.SyncFrequency - out.FileCheckFrequency = in.FileCheckFrequency - out.HTTPCheckFrequency = in.HTTPCheckFrequency - out.ManifestURL = in.ManifestURL - out.ManifestURLHeader = in.ManifestURLHeader - if in.EnableServer != nil { - in, out := &in.EnableServer, &out.EnableServer - *out = new(bool) - **out = **in - } else { - out.EnableServer = nil - } - out.Address = in.Address - out.Port = in.Port - out.ReadOnlyPort = in.ReadOnlyPort - out.TLSCertFile = in.TLSCertFile - out.TLSPrivateKeyFile = in.TLSPrivateKeyFile - out.CertDirectory = in.CertDirectory - if err := DeepCopy_v1alpha1_KubeletAuthentication(&in.Authentication, &out.Authentication, c); err != nil { - return err - } - out.Authorization = in.Authorization - out.HostnameOverride = in.HostnameOverride - out.PodInfraContainerImage = in.PodInfraContainerImage - out.DockerEndpoint = in.DockerEndpoint - out.RootDirectory = in.RootDirectory - out.SeccompProfileRoot = in.SeccompProfileRoot - if in.AllowPrivileged != nil { - in, out := &in.AllowPrivileged, &out.AllowPrivileged - *out = new(bool) - **out = **in - } else { - out.AllowPrivileged = nil - } - if in.HostNetworkSources != nil { - in, out := &in.HostNetworkSources, &out.HostNetworkSources - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.HostNetworkSources = nil - } - if in.HostPIDSources != nil { - in, out := &in.HostPIDSources, &out.HostPIDSources - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.HostPIDSources = nil - } - if in.HostIPCSources != nil { - in, out := &in.HostIPCSources, &out.HostIPCSources - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.HostIPCSources = nil - } - if in.RegistryPullQPS != nil { - in, out := &in.RegistryPullQPS, &out.RegistryPullQPS - *out = new(int32) - **out = **in - } else { - out.RegistryPullQPS = nil - } - out.RegistryBurst = in.RegistryBurst - if in.EventRecordQPS != nil { - in, out := &in.EventRecordQPS, &out.EventRecordQPS - *out = new(int32) - **out = **in - } else { - out.EventRecordQPS = nil - } - out.EventBurst = in.EventBurst - if in.EnableDebuggingHandlers != nil { - in, out := &in.EnableDebuggingHandlers, &out.EnableDebuggingHandlers - *out = new(bool) - **out = **in - } else { - out.EnableDebuggingHandlers = nil - } - out.MinimumGCAge = in.MinimumGCAge - out.MaxPerPodContainerCount = in.MaxPerPodContainerCount - if in.MaxContainerCount != nil { - in, out := &in.MaxContainerCount, &out.MaxContainerCount - *out = new(int32) - **out = **in - } else { - out.MaxContainerCount = nil - } - out.CAdvisorPort = in.CAdvisorPort - out.HealthzPort = in.HealthzPort - out.HealthzBindAddress = in.HealthzBindAddress - if in.OOMScoreAdj != nil { - in, out := &in.OOMScoreAdj, &out.OOMScoreAdj - *out = new(int32) - **out = **in - } else { - out.OOMScoreAdj = nil - } - if in.RegisterNode != nil { - in, out := &in.RegisterNode, &out.RegisterNode - *out = new(bool) - **out = **in - } else { - out.RegisterNode = nil - } - out.ClusterDomain = in.ClusterDomain - out.MasterServiceNamespace = in.MasterServiceNamespace - out.ClusterDNS = in.ClusterDNS - out.StreamingConnectionIdleTimeout = in.StreamingConnectionIdleTimeout - out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency - out.ImageMinimumGCAge = in.ImageMinimumGCAge - if in.ImageGCHighThresholdPercent != nil { - in, out := &in.ImageGCHighThresholdPercent, &out.ImageGCHighThresholdPercent - *out = new(int32) - **out = **in - } else { - out.ImageGCHighThresholdPercent = nil - } - if in.ImageGCLowThresholdPercent != nil { - in, out := &in.ImageGCLowThresholdPercent, &out.ImageGCLowThresholdPercent - *out = new(int32) - **out = **in - } else { - out.ImageGCLowThresholdPercent = nil - } - out.LowDiskSpaceThresholdMB = in.LowDiskSpaceThresholdMB - out.VolumeStatsAggPeriod = in.VolumeStatsAggPeriod - out.NetworkPluginName = in.NetworkPluginName - out.NetworkPluginDir = in.NetworkPluginDir - out.CNIConfDir = in.CNIConfDir - out.CNIBinDir = in.CNIBinDir - out.NetworkPluginMTU = in.NetworkPluginMTU - out.VolumePluginDir = in.VolumePluginDir - out.CloudProvider = in.CloudProvider - out.CloudConfigFile = in.CloudConfigFile - out.KubeletCgroups = in.KubeletCgroups - out.RuntimeCgroups = in.RuntimeCgroups - out.SystemCgroups = in.SystemCgroups - out.CgroupRoot = in.CgroupRoot - if in.CgroupsPerQOS != nil { - in, out := &in.CgroupsPerQOS, &out.CgroupsPerQOS - *out = new(bool) - **out = **in - } else { - out.CgroupsPerQOS = nil - } - out.CgroupDriver = in.CgroupDriver - out.ContainerRuntime = in.ContainerRuntime - out.RemoteRuntimeEndpoint = in.RemoteRuntimeEndpoint - out.RemoteImageEndpoint = in.RemoteImageEndpoint - out.RuntimeRequestTimeout = in.RuntimeRequestTimeout - out.RktPath = in.RktPath - out.ExperimentalMounterPath = in.ExperimentalMounterPath - out.RktAPIEndpoint = in.RktAPIEndpoint - out.RktStage1Image = in.RktStage1Image - if in.LockFilePath != nil { - in, out := &in.LockFilePath, &out.LockFilePath - *out = new(string) - **out = **in - } else { - out.LockFilePath = nil - } - out.ExitOnLockContention = in.ExitOnLockContention - out.HairpinMode = in.HairpinMode - out.BabysitDaemons = in.BabysitDaemons - out.MaxPods = in.MaxPods - out.NvidiaGPUs = in.NvidiaGPUs - out.DockerExecHandlerName = in.DockerExecHandlerName - out.PodCIDR = in.PodCIDR - out.ResolverConfig = in.ResolverConfig - if in.CPUCFSQuota != nil { - in, out := &in.CPUCFSQuota, &out.CPUCFSQuota - *out = new(bool) - **out = **in - } else { - out.CPUCFSQuota = nil - } - if in.Containerized != nil { - in, out := &in.Containerized, &out.Containerized - *out = new(bool) - **out = **in - } else { - out.Containerized = nil - } - out.MaxOpenFiles = in.MaxOpenFiles - if in.ReconcileCIDR != nil { - in, out := &in.ReconcileCIDR, &out.ReconcileCIDR - *out = new(bool) - **out = **in - } else { - out.ReconcileCIDR = nil - } - if in.RegisterSchedulable != nil { - in, out := &in.RegisterSchedulable, &out.RegisterSchedulable - *out = new(bool) - **out = **in - } else { - out.RegisterSchedulable = nil - } - out.ContentType = in.ContentType - if in.KubeAPIQPS != nil { - in, out := &in.KubeAPIQPS, &out.KubeAPIQPS - *out = new(int32) - **out = **in - } else { - out.KubeAPIQPS = nil - } - out.KubeAPIBurst = in.KubeAPIBurst - if in.SerializeImagePulls != nil { - in, out := &in.SerializeImagePulls, &out.SerializeImagePulls - *out = new(bool) - **out = **in - } else { - out.SerializeImagePulls = nil - } - out.OutOfDiskTransitionFrequency = in.OutOfDiskTransitionFrequency - out.NodeIP = in.NodeIP - if in.NodeLabels != nil { - in, out := &in.NodeLabels, &out.NodeLabels - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.NodeLabels = nil - } - out.NonMasqueradeCIDR = in.NonMasqueradeCIDR - out.EnableCustomMetrics = in.EnableCustomMetrics - if in.EvictionHard != nil { - in, out := &in.EvictionHard, &out.EvictionHard - *out = new(string) - **out = **in - } else { - out.EvictionHard = nil - } - out.EvictionSoft = in.EvictionSoft - out.EvictionSoftGracePeriod = in.EvictionSoftGracePeriod - out.EvictionPressureTransitionPeriod = in.EvictionPressureTransitionPeriod - out.EvictionMaxPodGracePeriod = in.EvictionMaxPodGracePeriod - out.EvictionMinimumReclaim = in.EvictionMinimumReclaim - out.PodsPerCore = in.PodsPerCore - if in.EnableControllerAttachDetach != nil { - in, out := &in.EnableControllerAttachDetach, &out.EnableControllerAttachDetach - *out = new(bool) - **out = **in - } else { - out.EnableControllerAttachDetach = nil - } - if in.SystemReserved != nil { - in, out := &in.SystemReserved, &out.SystemReserved - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.SystemReserved = nil - } - if in.KubeReserved != nil { - in, out := &in.KubeReserved, &out.KubeReserved - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.KubeReserved = nil - } - out.ProtectKernelDefaults = in.ProtectKernelDefaults - if in.MakeIPTablesUtilChains != nil { - in, out := &in.MakeIPTablesUtilChains, &out.MakeIPTablesUtilChains - *out = new(bool) - **out = **in - } else { - out.MakeIPTablesUtilChains = nil - } - if in.IPTablesMasqueradeBit != nil { - in, out := &in.IPTablesMasqueradeBit, &out.IPTablesMasqueradeBit - *out = new(int32) - **out = **in - } else { - out.IPTablesMasqueradeBit = nil - } - if in.IPTablesDropBit != nil { - in, out := &in.IPTablesDropBit, &out.IPTablesDropBit - *out = new(int32) - **out = **in - } else { - out.IPTablesDropBit = nil - } - if in.AllowedUnsafeSysctls != nil { - in, out := &in.AllowedUnsafeSysctls, &out.AllowedUnsafeSysctls - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.AllowedUnsafeSysctls = nil - } - out.FeatureGates = in.FeatureGates - out.EnableCRI = in.EnableCRI - out.ExperimentalFailSwapOn = in.ExperimentalFailSwapOn - out.ExperimentalCheckNodeCapabilitiesBeforeMount = in.ExperimentalCheckNodeCapabilitiesBeforeMount - return nil - } -} - -func DeepCopy_v1alpha1_KubeletWebhookAuthentication(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeletWebhookAuthentication) - out := out.(*KubeletWebhookAuthentication) - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } else { - out.Enabled = nil - } - out.CacheTTL = in.CacheTTL - return nil - } -} - -func DeepCopy_v1alpha1_KubeletWebhookAuthorization(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeletWebhookAuthorization) - out := out.(*KubeletWebhookAuthorization) - out.CacheAuthorizedTTL = in.CacheAuthorizedTTL - out.CacheUnauthorizedTTL = in.CacheUnauthorizedTTL - return nil - } -} - -func DeepCopy_v1alpha1_KubeletX509Authentication(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeletX509Authentication) - out := out.(*KubeletX509Authentication) - out.ClientCAFile = in.ClientCAFile - return nil - } -} - -func DeepCopy_v1alpha1_LeaderElectionConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LeaderElectionConfiguration) - out := out.(*LeaderElectionConfiguration) - if in.LeaderElect != nil { - in, out := &in.LeaderElect, &out.LeaderElect - *out = new(bool) - **out = **in - } else { - out.LeaderElect = nil - } - out.LeaseDuration = in.LeaseDuration - out.RenewDeadline = in.RenewDeadline - out.RetryPeriod = in.RetryPeriod - return nil - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.defaults.go b/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.defaults.go deleted file mode 100644 index 83ab4654..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.defaults.go +++ /dev/null @@ -1,48 +0,0 @@ -// +build !ignore_autogenerated - -/* -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. -*/ - -// This file was autogenerated by defaulter-gen. Do not edit it manually! - -package v1alpha1 - -import ( - runtime "k8s.io/client-go/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(&KubeProxyConfiguration{}, func(obj interface{}) { SetObjectDefaults_KubeProxyConfiguration(obj.(*KubeProxyConfiguration)) }) - scheme.AddTypeDefaultingFunc(&KubeSchedulerConfiguration{}, func(obj interface{}) { SetObjectDefaults_KubeSchedulerConfiguration(obj.(*KubeSchedulerConfiguration)) }) - scheme.AddTypeDefaultingFunc(&KubeletConfiguration{}, func(obj interface{}) { SetObjectDefaults_KubeletConfiguration(obj.(*KubeletConfiguration)) }) - return nil -} - -func SetObjectDefaults_KubeProxyConfiguration(in *KubeProxyConfiguration) { - SetDefaults_KubeProxyConfiguration(in) -} - -func SetObjectDefaults_KubeSchedulerConfiguration(in *KubeSchedulerConfiguration) { - SetDefaults_KubeSchedulerConfiguration(in) - SetDefaults_LeaderElectionConfiguration(&in.LeaderElection) -} - -func SetObjectDefaults_KubeletConfiguration(in *KubeletConfiguration) { - SetDefaults_KubeletConfiguration(in) -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/doc.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/doc.go deleted file mode 100644 index 3401639c..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/doc.go +++ /dev/null @@ -1,21 +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. -*/ - -// +k8s:deepcopy-gen=package,register -// +groupName=imagepolicy.k8s.io -// +k8s:openapi-gen=true - -package imagepolicy diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/install/install.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/install/install.go deleted file mode 100644 index 113b24af..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/install/install.go +++ /dev/null @@ -1,43 +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 install installs the experimental API group, making it available as -// an option to all of the API encoding/decoding machinery. -package install - -import ( - "k8s.io/client-go/pkg/apimachinery/announced" - "k8s.io/client-go/pkg/apis/imagepolicy" - "k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1" - "k8s.io/client-go/pkg/util/sets" -) - -func init() { - if err := announced.NewGroupMetaFactory( - &announced.GroupMetaFactoryArgs{ - GroupName: imagepolicy.GroupName, - VersionPreferenceOrder: []string{v1alpha1.SchemeGroupVersion.Version}, - ImportPrefix: "k8s.io/client-go/pkg/apis/imagepolicy", - RootScopedKinds: sets.NewString("ImageReview"), - AddInternalObjectsToScheme: imagepolicy.AddToScheme, - }, - announced.VersionToSchemeFunc{ - v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme, - }, - ).Announce().RegisterAndEnable(); err != nil { - panic(err) - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/register.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/register.go deleted file mode 100644 index fb55f7dc..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/register.go +++ /dev/null @@ -1,56 +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 imagepolicy - -import ( - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/runtime" -) - -// GroupName is the group name use in this package -const GroupName = "imagepolicy.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - -// Kind takes an unqualified kind and returns a Group qualified GroupKind -func Kind(kind string) unversioned.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) unversioned.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &api.ListOptions{}, - &api.DeleteOptions{}, - &api.ExportOptions{}, - - &ImageReview{}, - ) - // versioned.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/types.generated.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/types.generated.go deleted file mode 100644 index 382e8acb..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/types.generated.go +++ /dev/null @@ -1,2194 +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. -*/ - -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ - -package imagepolicy - -import ( - "errors" - "fmt" - codec1978 "github.com/ugorji/go/codec" - pkg2_api "k8s.io/client-go/pkg/api" - pkg1_unversioned "k8s.io/client-go/pkg/api/unversioned" - pkg3_types "k8s.io/client-go/pkg/types" - "reflect" - "runtime" - time "time" -) - -const ( - // ----- content types ---- - codecSelferC_UTF81234 = 1 - codecSelferC_RAW1234 = 0 - // ----- value types used ---- - codecSelferValueTypeArray1234 = 10 - codecSelferValueTypeMap1234 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey1234 = 2 - codecSelfer_containerMapValue1234 = 3 - codecSelfer_containerMapEnd1234 = 4 - codecSelfer_containerArrayElem1234 = 6 - codecSelfer_containerArrayEnd1234 = 7 -) - -var ( - codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`) -) - -type codecSelfer1234 struct{} - -func init() { - if codec1978.GenVersion != 5 { - _, file, _, _ := runtime.Caller(0) - err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) - panic(err) - } - if false { // reference the types, but skip this branch at build/run time - var v0 pkg2_api.ObjectMeta - var v1 pkg1_unversioned.TypeMeta - var v2 pkg3_types.UID - var v3 time.Time - _, _, _, _ = v0, v1, v2, v3 - } -} - -func (x *ImageReview) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [19]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - yyq2[0] = x.Kind != "" - yyq2[1] = x.APIVersion != "" - yyq2[2] = x.Name != "" - yyq2[3] = x.GenerateName != "" - yyq2[4] = x.Namespace != "" - yyq2[5] = x.SelfLink != "" - yyq2[6] = x.UID != "" - yyq2[7] = x.ResourceVersion != "" - yyq2[8] = x.Generation != 0 - yyq2[9] = true - yyq2[10] = x.ObjectMeta.DeletionTimestamp != nil && x.DeletionTimestamp != nil - yyq2[11] = x.ObjectMeta.DeletionGracePeriodSeconds != nil && x.DeletionGracePeriodSeconds != nil - yyq2[12] = len(x.Labels) != 0 - yyq2[13] = len(x.Annotations) != 0 - yyq2[14] = len(x.OwnerReferences) != 0 - yyq2[15] = len(x.Finalizers) != 0 - yyq2[16] = x.ClusterName != "" - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(19) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[0] { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[1] { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[2] { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Name)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("name")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Name)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[3] { - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.GenerateName)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("generateName")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.GenerateName)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[4] { - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Namespace)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("namespace")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Namespace)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[5] { - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.SelfLink)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("selfLink")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.SelfLink)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[6] { - yym22 := z.EncBinary() - _ = yym22 - if false { - } else if z.HasExtensions() && z.EncExt(x.UID) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.UID)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[6] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("uid")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else if z.HasExtensions() && z.EncExt(x.UID) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.UID)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[7] { - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[7] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("resourceVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ResourceVersion)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[8] { - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeInt(int64(x.Generation)) - } - } else { - r.EncodeInt(0) - } - } else { - if yyq2[8] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("generation")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeInt(int64(x.Generation)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[9] { - yy31 := &x.CreationTimestamp - yym32 := z.EncBinary() - _ = yym32 - if false { - } else if z.HasExtensions() && z.EncExt(yy31) { - } else if yym32 { - z.EncBinaryMarshal(yy31) - } else if !yym32 && z.IsJSONHandle() { - z.EncJSONMarshal(yy31) - } else { - z.EncFallback(yy31) - } - } else { - r.EncodeNil() - } - } else { - if yyq2[9] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("creationTimestamp")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy33 := &x.CreationTimestamp - yym34 := z.EncBinary() - _ = yym34 - if false { - } else if z.HasExtensions() && z.EncExt(yy33) { - } else if yym34 { - z.EncBinaryMarshal(yy33) - } else if !yym34 && z.IsJSONHandle() { - z.EncJSONMarshal(yy33) - } else { - z.EncFallback(yy33) - } - } - } - var yyn35 bool - if x.ObjectMeta.DeletionTimestamp == nil { - yyn35 = true - goto LABEL35 - } - LABEL35: - if yyr2 || yy2arr2 { - if yyn35 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[10] { - if x.DeletionTimestamp == nil { - r.EncodeNil() - } else { - yym36 := z.EncBinary() - _ = yym36 - if false { - } else if z.HasExtensions() && z.EncExt(x.DeletionTimestamp) { - } else if yym36 { - z.EncBinaryMarshal(x.DeletionTimestamp) - } else if !yym36 && z.IsJSONHandle() { - z.EncJSONMarshal(x.DeletionTimestamp) - } else { - z.EncFallback(x.DeletionTimestamp) - } - } - } else { - r.EncodeNil() - } - } - } else { - if yyq2[10] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("deletionTimestamp")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn35 { - r.EncodeNil() - } else { - if x.DeletionTimestamp == nil { - r.EncodeNil() - } else { - yym37 := z.EncBinary() - _ = yym37 - if false { - } else if z.HasExtensions() && z.EncExt(x.DeletionTimestamp) { - } else if yym37 { - z.EncBinaryMarshal(x.DeletionTimestamp) - } else if !yym37 && z.IsJSONHandle() { - z.EncJSONMarshal(x.DeletionTimestamp) - } else { - z.EncFallback(x.DeletionTimestamp) - } - } - } - } - } - var yyn38 bool - if x.ObjectMeta.DeletionGracePeriodSeconds == nil { - yyn38 = true - goto LABEL38 - } - LABEL38: - if yyr2 || yy2arr2 { - if yyn38 { - r.EncodeNil() - } else { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[11] { - if x.DeletionGracePeriodSeconds == nil { - r.EncodeNil() - } else { - yy39 := *x.DeletionGracePeriodSeconds - yym40 := z.EncBinary() - _ = yym40 - if false { - } else { - r.EncodeInt(int64(yy39)) - } - } - } else { - r.EncodeNil() - } - } - } else { - if yyq2[11] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("deletionGracePeriodSeconds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if yyn38 { - r.EncodeNil() - } else { - if x.DeletionGracePeriodSeconds == nil { - r.EncodeNil() - } else { - yy41 := *x.DeletionGracePeriodSeconds - yym42 := z.EncBinary() - _ = yym42 - if false { - } else { - r.EncodeInt(int64(yy41)) - } - } - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[12] { - if x.Labels == nil { - r.EncodeNil() - } else { - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - z.F.EncMapStringStringV(x.Labels, false, e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2[12] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("labels")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Labels == nil { - r.EncodeNil() - } else { - yym45 := z.EncBinary() - _ = yym45 - if false { - } else { - z.F.EncMapStringStringV(x.Labels, false, e) - } - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[13] { - if x.Annotations == nil { - r.EncodeNil() - } else { - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - z.F.EncMapStringStringV(x.Annotations, false, e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2[13] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("annotations")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Annotations == nil { - r.EncodeNil() - } else { - yym48 := z.EncBinary() - _ = yym48 - if false { - } else { - z.F.EncMapStringStringV(x.Annotations, false, e) - } - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[14] { - if x.OwnerReferences == nil { - r.EncodeNil() - } else { - yym50 := z.EncBinary() - _ = yym50 - if false { - } else { - h.encSliceapi_OwnerReference(([]pkg2_api.OwnerReference)(x.OwnerReferences), e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2[14] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("ownerReferences")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.OwnerReferences == nil { - r.EncodeNil() - } else { - yym51 := z.EncBinary() - _ = yym51 - if false { - } else { - h.encSliceapi_OwnerReference(([]pkg2_api.OwnerReference)(x.OwnerReferences), e) - } - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[15] { - if x.Finalizers == nil { - r.EncodeNil() - } else { - yym53 := z.EncBinary() - _ = yym53 - if false { - } else { - z.F.EncSliceStringV(x.Finalizers, false, e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq2[15] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("finalizers")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Finalizers == nil { - r.EncodeNil() - } else { - yym54 := z.EncBinary() - _ = yym54 - if false { - } else { - z.F.EncSliceStringV(x.Finalizers, false, e) - } - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[16] { - yym56 := z.EncBinary() - _ = yym56 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ClusterName)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[16] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("clusterName")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym57 := z.EncBinary() - _ = yym57 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ClusterName)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy59 := &x.Spec - yy59.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy60 := &x.Spec - yy60.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy62 := &x.Status - yy62.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy63 := &x.Status - yy63.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ImageReview) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym64 := z.DecBinary() - _ = yym64 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct65 := r.ContainerType() - if yyct65 == codecSelferValueTypeMap1234 { - yyl65 := r.ReadMapStart() - if yyl65 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl65, d) - } - } else if yyct65 == codecSelferValueTypeArray1234 { - yyl65 := r.ReadArrayStart() - if yyl65 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl65, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ImageReview) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys66Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys66Slc - var yyhl66 bool = l >= 0 - for yyj66 := 0; ; yyj66++ { - if yyhl66 { - if yyj66 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys66Slc = r.DecodeBytes(yys66Slc, true, true) - yys66 := string(yys66Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys66 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = string(r.DecodeString()) - } - case "generateName": - if r.TryDecodeAsNil() { - x.GenerateName = "" - } else { - x.GenerateName = string(r.DecodeString()) - } - case "namespace": - if r.TryDecodeAsNil() { - x.Namespace = "" - } else { - x.Namespace = string(r.DecodeString()) - } - case "selfLink": - if r.TryDecodeAsNil() { - x.SelfLink = "" - } else { - x.SelfLink = string(r.DecodeString()) - } - case "uid": - if r.TryDecodeAsNil() { - x.UID = "" - } else { - x.UID = pkg3_types.UID(r.DecodeString()) - } - case "resourceVersion": - if r.TryDecodeAsNil() { - x.ResourceVersion = "" - } else { - x.ResourceVersion = string(r.DecodeString()) - } - case "generation": - if r.TryDecodeAsNil() { - x.Generation = 0 - } else { - x.Generation = int64(r.DecodeInt(64)) - } - case "creationTimestamp": - if r.TryDecodeAsNil() { - x.CreationTimestamp = pkg1_unversioned.Time{} - } else { - yyv76 := &x.CreationTimestamp - yym77 := z.DecBinary() - _ = yym77 - if false { - } else if z.HasExtensions() && z.DecExt(yyv76) { - } else if yym77 { - z.DecBinaryUnmarshal(yyv76) - } else if !yym77 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv76) - } else { - z.DecFallback(yyv76, false) - } - } - case "deletionTimestamp": - if x.ObjectMeta.DeletionTimestamp == nil { - x.ObjectMeta.DeletionTimestamp = new(pkg1_unversioned.Time) - } - if r.TryDecodeAsNil() { - if x.DeletionTimestamp != nil { - x.DeletionTimestamp = nil - } - } else { - if x.DeletionTimestamp == nil { - x.DeletionTimestamp = new(pkg1_unversioned.Time) - } - yym79 := z.DecBinary() - _ = yym79 - if false { - } else if z.HasExtensions() && z.DecExt(x.DeletionTimestamp) { - } else if yym79 { - z.DecBinaryUnmarshal(x.DeletionTimestamp) - } else if !yym79 && z.IsJSONHandle() { - z.DecJSONUnmarshal(x.DeletionTimestamp) - } else { - z.DecFallback(x.DeletionTimestamp, false) - } - } - case "deletionGracePeriodSeconds": - if x.ObjectMeta.DeletionGracePeriodSeconds == nil { - x.ObjectMeta.DeletionGracePeriodSeconds = new(int64) - } - if r.TryDecodeAsNil() { - if x.DeletionGracePeriodSeconds != nil { - x.DeletionGracePeriodSeconds = nil - } - } else { - if x.DeletionGracePeriodSeconds == nil { - x.DeletionGracePeriodSeconds = new(int64) - } - yym81 := z.DecBinary() - _ = yym81 - if false { - } else { - *((*int64)(x.DeletionGracePeriodSeconds)) = int64(r.DecodeInt(64)) - } - } - case "labels": - if r.TryDecodeAsNil() { - x.Labels = nil - } else { - yyv82 := &x.Labels - yym83 := z.DecBinary() - _ = yym83 - if false { - } else { - z.F.DecMapStringStringX(yyv82, false, d) - } - } - case "annotations": - if r.TryDecodeAsNil() { - x.Annotations = nil - } else { - yyv84 := &x.Annotations - yym85 := z.DecBinary() - _ = yym85 - if false { - } else { - z.F.DecMapStringStringX(yyv84, false, d) - } - } - case "ownerReferences": - if r.TryDecodeAsNil() { - x.OwnerReferences = nil - } else { - yyv86 := &x.OwnerReferences - yym87 := z.DecBinary() - _ = yym87 - if false { - } else { - h.decSliceapi_OwnerReference((*[]pkg2_api.OwnerReference)(yyv86), d) - } - } - case "finalizers": - if r.TryDecodeAsNil() { - x.Finalizers = nil - } else { - yyv88 := &x.Finalizers - yym89 := z.DecBinary() - _ = yym89 - if false { - } else { - z.F.DecSliceStringX(yyv88, false, d) - } - } - case "clusterName": - if r.TryDecodeAsNil() { - x.ClusterName = "" - } else { - x.ClusterName = string(r.DecodeString()) - } - case "Spec": - if r.TryDecodeAsNil() { - x.Spec = ImageReviewSpec{} - } else { - yyv91 := &x.Spec - yyv91.CodecDecodeSelf(d) - } - case "Status": - if r.TryDecodeAsNil() { - x.Status = ImageReviewStatus{} - } else { - yyv92 := &x.Status - yyv92.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys66) - } // end switch yys66 - } // end for yyj66 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ImageReview) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj93 int - var yyb93 bool - var yyhl93 bool = l >= 0 - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - x.Name = string(r.DecodeString()) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.GenerateName = "" - } else { - x.GenerateName = string(r.DecodeString()) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Namespace = "" - } else { - x.Namespace = string(r.DecodeString()) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.SelfLink = "" - } else { - x.SelfLink = string(r.DecodeString()) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.UID = "" - } else { - x.UID = pkg3_types.UID(r.DecodeString()) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ResourceVersion = "" - } else { - x.ResourceVersion = string(r.DecodeString()) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Generation = 0 - } else { - x.Generation = int64(r.DecodeInt(64)) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.CreationTimestamp = pkg1_unversioned.Time{} - } else { - yyv103 := &x.CreationTimestamp - yym104 := z.DecBinary() - _ = yym104 - if false { - } else if z.HasExtensions() && z.DecExt(yyv103) { - } else if yym104 { - z.DecBinaryUnmarshal(yyv103) - } else if !yym104 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv103) - } else { - z.DecFallback(yyv103, false) - } - } - if x.ObjectMeta.DeletionTimestamp == nil { - x.ObjectMeta.DeletionTimestamp = new(pkg1_unversioned.Time) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.DeletionTimestamp != nil { - x.DeletionTimestamp = nil - } - } else { - if x.DeletionTimestamp == nil { - x.DeletionTimestamp = new(pkg1_unversioned.Time) - } - yym106 := z.DecBinary() - _ = yym106 - if false { - } else if z.HasExtensions() && z.DecExt(x.DeletionTimestamp) { - } else if yym106 { - z.DecBinaryUnmarshal(x.DeletionTimestamp) - } else if !yym106 && z.IsJSONHandle() { - z.DecJSONUnmarshal(x.DeletionTimestamp) - } else { - z.DecFallback(x.DeletionTimestamp, false) - } - } - if x.ObjectMeta.DeletionGracePeriodSeconds == nil { - x.ObjectMeta.DeletionGracePeriodSeconds = new(int64) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.DeletionGracePeriodSeconds != nil { - x.DeletionGracePeriodSeconds = nil - } - } else { - if x.DeletionGracePeriodSeconds == nil { - x.DeletionGracePeriodSeconds = new(int64) - } - yym108 := z.DecBinary() - _ = yym108 - if false { - } else { - *((*int64)(x.DeletionGracePeriodSeconds)) = int64(r.DecodeInt(64)) - } - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Labels = nil - } else { - yyv109 := &x.Labels - yym110 := z.DecBinary() - _ = yym110 - if false { - } else { - z.F.DecMapStringStringX(yyv109, false, d) - } - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Annotations = nil - } else { - yyv111 := &x.Annotations - yym112 := z.DecBinary() - _ = yym112 - if false { - } else { - z.F.DecMapStringStringX(yyv111, false, d) - } - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.OwnerReferences = nil - } else { - yyv113 := &x.OwnerReferences - yym114 := z.DecBinary() - _ = yym114 - if false { - } else { - h.decSliceapi_OwnerReference((*[]pkg2_api.OwnerReference)(yyv113), d) - } - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Finalizers = nil - } else { - yyv115 := &x.Finalizers - yym116 := z.DecBinary() - _ = yym116 - if false { - } else { - z.F.DecSliceStringX(yyv115, false, d) - } - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ClusterName = "" - } else { - x.ClusterName = string(r.DecodeString()) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ImageReviewSpec{} - } else { - yyv118 := &x.Spec - yyv118.CodecDecodeSelf(d) - } - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ImageReviewStatus{} - } else { - yyv119 := &x.Status - yyv119.CodecDecodeSelf(d) - } - for { - yyj93++ - if yyhl93 { - yyb93 = yyj93 > l - } else { - yyb93 = r.CheckBreak() - } - if yyb93 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj93-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ImageReviewSpec) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym120 := z.EncBinary() - _ = yym120 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep121 := !z.EncBinary() - yy2arr121 := z.EncBasicHandle().StructToArray - var yyq121 [3]bool - _, _, _ = yysep121, yyq121, yy2arr121 - const yyr121 bool = false - var yynn121 int - if yyr121 || yy2arr121 { - r.EncodeArrayStart(3) - } else { - yynn121 = 3 - for _, b := range yyq121 { - if b { - yynn121++ - } - } - r.EncodeMapStart(yynn121) - yynn121 = 0 - } - if yyr121 || yy2arr121 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Containers == nil { - r.EncodeNil() - } else { - yym123 := z.EncBinary() - _ = yym123 - if false { - } else { - h.encSliceImageReviewContainerSpec(([]ImageReviewContainerSpec)(x.Containers), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Containers")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Containers == nil { - r.EncodeNil() - } else { - yym124 := z.EncBinary() - _ = yym124 - if false { - } else { - h.encSliceImageReviewContainerSpec(([]ImageReviewContainerSpec)(x.Containers), e) - } - } - } - if yyr121 || yy2arr121 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Annotations == nil { - r.EncodeNil() - } else { - yym126 := z.EncBinary() - _ = yym126 - if false { - } else { - z.F.EncMapStringStringV(x.Annotations, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Annotations")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Annotations == nil { - r.EncodeNil() - } else { - yym127 := z.EncBinary() - _ = yym127 - if false { - } else { - z.F.EncMapStringStringV(x.Annotations, false, e) - } - } - } - if yyr121 || yy2arr121 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym129 := z.EncBinary() - _ = yym129 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Namespace)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Namespace")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym130 := z.EncBinary() - _ = yym130 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Namespace)) - } - } - if yyr121 || yy2arr121 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ImageReviewSpec) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym131 := z.DecBinary() - _ = yym131 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct132 := r.ContainerType() - if yyct132 == codecSelferValueTypeMap1234 { - yyl132 := r.ReadMapStart() - if yyl132 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl132, d) - } - } else if yyct132 == codecSelferValueTypeArray1234 { - yyl132 := r.ReadArrayStart() - if yyl132 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl132, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ImageReviewSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys133Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys133Slc - var yyhl133 bool = l >= 0 - for yyj133 := 0; ; yyj133++ { - if yyhl133 { - if yyj133 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys133Slc = r.DecodeBytes(yys133Slc, true, true) - yys133 := string(yys133Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys133 { - case "Containers": - if r.TryDecodeAsNil() { - x.Containers = nil - } else { - yyv134 := &x.Containers - yym135 := z.DecBinary() - _ = yym135 - if false { - } else { - h.decSliceImageReviewContainerSpec((*[]ImageReviewContainerSpec)(yyv134), d) - } - } - case "Annotations": - if r.TryDecodeAsNil() { - x.Annotations = nil - } else { - yyv136 := &x.Annotations - yym137 := z.DecBinary() - _ = yym137 - if false { - } else { - z.F.DecMapStringStringX(yyv136, false, d) - } - } - case "Namespace": - if r.TryDecodeAsNil() { - x.Namespace = "" - } else { - x.Namespace = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys133) - } // end switch yys133 - } // end for yyj133 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ImageReviewSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj139 int - var yyb139 bool - var yyhl139 bool = l >= 0 - yyj139++ - if yyhl139 { - yyb139 = yyj139 > l - } else { - yyb139 = r.CheckBreak() - } - if yyb139 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Containers = nil - } else { - yyv140 := &x.Containers - yym141 := z.DecBinary() - _ = yym141 - if false { - } else { - h.decSliceImageReviewContainerSpec((*[]ImageReviewContainerSpec)(yyv140), d) - } - } - yyj139++ - if yyhl139 { - yyb139 = yyj139 > l - } else { - yyb139 = r.CheckBreak() - } - if yyb139 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Annotations = nil - } else { - yyv142 := &x.Annotations - yym143 := z.DecBinary() - _ = yym143 - if false { - } else { - z.F.DecMapStringStringX(yyv142, false, d) - } - } - yyj139++ - if yyhl139 { - yyb139 = yyj139 > l - } else { - yyb139 = r.CheckBreak() - } - if yyb139 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Namespace = "" - } else { - x.Namespace = string(r.DecodeString()) - } - for { - yyj139++ - if yyhl139 { - yyb139 = yyj139 > l - } else { - yyb139 = r.CheckBreak() - } - if yyb139 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj139-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ImageReviewContainerSpec) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym145 := z.EncBinary() - _ = yym145 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep146 := !z.EncBinary() - yy2arr146 := z.EncBasicHandle().StructToArray - var yyq146 [1]bool - _, _, _ = yysep146, yyq146, yy2arr146 - const yyr146 bool = false - var yynn146 int - if yyr146 || yy2arr146 { - r.EncodeArrayStart(1) - } else { - yynn146 = 1 - for _, b := range yyq146 { - if b { - yynn146++ - } - } - r.EncodeMapStart(yynn146) - yynn146 = 0 - } - if yyr146 || yy2arr146 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym148 := z.EncBinary() - _ = yym148 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Image)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Image")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym149 := z.EncBinary() - _ = yym149 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Image)) - } - } - if yyr146 || yy2arr146 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ImageReviewContainerSpec) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym150 := z.DecBinary() - _ = yym150 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct151 := r.ContainerType() - if yyct151 == codecSelferValueTypeMap1234 { - yyl151 := r.ReadMapStart() - if yyl151 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl151, d) - } - } else if yyct151 == codecSelferValueTypeArray1234 { - yyl151 := r.ReadArrayStart() - if yyl151 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl151, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ImageReviewContainerSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys152Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys152Slc - var yyhl152 bool = l >= 0 - for yyj152 := 0; ; yyj152++ { - if yyhl152 { - if yyj152 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys152Slc = r.DecodeBytes(yys152Slc, true, true) - yys152 := string(yys152Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys152 { - case "Image": - if r.TryDecodeAsNil() { - x.Image = "" - } else { - x.Image = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys152) - } // end switch yys152 - } // end for yyj152 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ImageReviewContainerSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj154 int - var yyb154 bool - var yyhl154 bool = l >= 0 - yyj154++ - if yyhl154 { - yyb154 = yyj154 > l - } else { - yyb154 = r.CheckBreak() - } - if yyb154 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Image = "" - } else { - x.Image = string(r.DecodeString()) - } - for { - yyj154++ - if yyhl154 { - yyb154 = yyj154 > l - } else { - yyb154 = r.CheckBreak() - } - if yyb154 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj154-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ImageReviewStatus) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym156 := z.EncBinary() - _ = yym156 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep157 := !z.EncBinary() - yy2arr157 := z.EncBasicHandle().StructToArray - var yyq157 [2]bool - _, _, _ = yysep157, yyq157, yy2arr157 - const yyr157 bool = false - var yynn157 int - if yyr157 || yy2arr157 { - r.EncodeArrayStart(2) - } else { - yynn157 = 2 - for _, b := range yyq157 { - if b { - yynn157++ - } - } - r.EncodeMapStart(yynn157) - yynn157 = 0 - } - if yyr157 || yy2arr157 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym159 := z.EncBinary() - _ = yym159 - if false { - } else { - r.EncodeBool(bool(x.Allowed)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Allowed")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym160 := z.EncBinary() - _ = yym160 - if false { - } else { - r.EncodeBool(bool(x.Allowed)) - } - } - if yyr157 || yy2arr157 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym162 := z.EncBinary() - _ = yym162 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Reason")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym163 := z.EncBinary() - _ = yym163 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) - } - } - if yyr157 || yy2arr157 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ImageReviewStatus) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym164 := z.DecBinary() - _ = yym164 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct165 := r.ContainerType() - if yyct165 == codecSelferValueTypeMap1234 { - yyl165 := r.ReadMapStart() - if yyl165 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl165, d) - } - } else if yyct165 == codecSelferValueTypeArray1234 { - yyl165 := r.ReadArrayStart() - if yyl165 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl165, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ImageReviewStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys166Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys166Slc - var yyhl166 bool = l >= 0 - for yyj166 := 0; ; yyj166++ { - if yyhl166 { - if yyj166 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys166Slc = r.DecodeBytes(yys166Slc, true, true) - yys166 := string(yys166Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys166 { - case "Allowed": - if r.TryDecodeAsNil() { - x.Allowed = false - } else { - x.Allowed = bool(r.DecodeBool()) - } - case "Reason": - if r.TryDecodeAsNil() { - x.Reason = "" - } else { - x.Reason = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys166) - } // end switch yys166 - } // end for yyj166 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ImageReviewStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj169 int - var yyb169 bool - var yyhl169 bool = l >= 0 - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Allowed = false - } else { - x.Allowed = bool(r.DecodeBool()) - } - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Reason = "" - } else { - x.Reason = string(r.DecodeString()) - } - for { - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj169-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) encSliceapi_OwnerReference(v []pkg2_api.OwnerReference, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv172 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy173 := &yyv172 - yy173.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceapi_OwnerReference(v *[]pkg2_api.OwnerReference, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv174 := *v - yyh174, yyl174 := z.DecSliceHelperStart() - var yyc174 bool - if yyl174 == 0 { - if yyv174 == nil { - yyv174 = []pkg2_api.OwnerReference{} - yyc174 = true - } else if len(yyv174) != 0 { - yyv174 = yyv174[:0] - yyc174 = true - } - } else if yyl174 > 0 { - var yyrr174, yyrl174 int - var yyrt174 bool - if yyl174 > cap(yyv174) { - - yyrg174 := len(yyv174) > 0 - yyv2174 := yyv174 - yyrl174, yyrt174 = z.DecInferLen(yyl174, z.DecBasicHandle().MaxInitLen, 72) - if yyrt174 { - if yyrl174 <= cap(yyv174) { - yyv174 = yyv174[:yyrl174] - } else { - yyv174 = make([]pkg2_api.OwnerReference, yyrl174) - } - } else { - yyv174 = make([]pkg2_api.OwnerReference, yyrl174) - } - yyc174 = true - yyrr174 = len(yyv174) - if yyrg174 { - copy(yyv174, yyv2174) - } - } else if yyl174 != len(yyv174) { - yyv174 = yyv174[:yyl174] - yyc174 = true - } - yyj174 := 0 - for ; yyj174 < yyrr174; yyj174++ { - yyh174.ElemContainerState(yyj174) - if r.TryDecodeAsNil() { - yyv174[yyj174] = pkg2_api.OwnerReference{} - } else { - yyv175 := &yyv174[yyj174] - yyv175.CodecDecodeSelf(d) - } - - } - if yyrt174 { - for ; yyj174 < yyl174; yyj174++ { - yyv174 = append(yyv174, pkg2_api.OwnerReference{}) - yyh174.ElemContainerState(yyj174) - if r.TryDecodeAsNil() { - yyv174[yyj174] = pkg2_api.OwnerReference{} - } else { - yyv176 := &yyv174[yyj174] - yyv176.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj174 := 0 - for ; !r.CheckBreak(); yyj174++ { - - if yyj174 >= len(yyv174) { - yyv174 = append(yyv174, pkg2_api.OwnerReference{}) // var yyz174 pkg2_api.OwnerReference - yyc174 = true - } - yyh174.ElemContainerState(yyj174) - if yyj174 < len(yyv174) { - if r.TryDecodeAsNil() { - yyv174[yyj174] = pkg2_api.OwnerReference{} - } else { - yyv177 := &yyv174[yyj174] - yyv177.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj174 < len(yyv174) { - yyv174 = yyv174[:yyj174] - yyc174 = true - } else if yyj174 == 0 && yyv174 == nil { - yyv174 = []pkg2_api.OwnerReference{} - yyc174 = true - } - } - yyh174.End() - if yyc174 { - *v = yyv174 - } -} - -func (x codecSelfer1234) encSliceImageReviewContainerSpec(v []ImageReviewContainerSpec, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv178 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy179 := &yyv178 - yy179.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceImageReviewContainerSpec(v *[]ImageReviewContainerSpec, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv180 := *v - yyh180, yyl180 := z.DecSliceHelperStart() - var yyc180 bool - if yyl180 == 0 { - if yyv180 == nil { - yyv180 = []ImageReviewContainerSpec{} - yyc180 = true - } else if len(yyv180) != 0 { - yyv180 = yyv180[:0] - yyc180 = true - } - } else if yyl180 > 0 { - var yyrr180, yyrl180 int - var yyrt180 bool - if yyl180 > cap(yyv180) { - - yyrg180 := len(yyv180) > 0 - yyv2180 := yyv180 - yyrl180, yyrt180 = z.DecInferLen(yyl180, z.DecBasicHandle().MaxInitLen, 16) - if yyrt180 { - if yyrl180 <= cap(yyv180) { - yyv180 = yyv180[:yyrl180] - } else { - yyv180 = make([]ImageReviewContainerSpec, yyrl180) - } - } else { - yyv180 = make([]ImageReviewContainerSpec, yyrl180) - } - yyc180 = true - yyrr180 = len(yyv180) - if yyrg180 { - copy(yyv180, yyv2180) - } - } else if yyl180 != len(yyv180) { - yyv180 = yyv180[:yyl180] - yyc180 = true - } - yyj180 := 0 - for ; yyj180 < yyrr180; yyj180++ { - yyh180.ElemContainerState(yyj180) - if r.TryDecodeAsNil() { - yyv180[yyj180] = ImageReviewContainerSpec{} - } else { - yyv181 := &yyv180[yyj180] - yyv181.CodecDecodeSelf(d) - } - - } - if yyrt180 { - for ; yyj180 < yyl180; yyj180++ { - yyv180 = append(yyv180, ImageReviewContainerSpec{}) - yyh180.ElemContainerState(yyj180) - if r.TryDecodeAsNil() { - yyv180[yyj180] = ImageReviewContainerSpec{} - } else { - yyv182 := &yyv180[yyj180] - yyv182.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj180 := 0 - for ; !r.CheckBreak(); yyj180++ { - - if yyj180 >= len(yyv180) { - yyv180 = append(yyv180, ImageReviewContainerSpec{}) // var yyz180 ImageReviewContainerSpec - yyc180 = true - } - yyh180.ElemContainerState(yyj180) - if yyj180 < len(yyv180) { - if r.TryDecodeAsNil() { - yyv180[yyj180] = ImageReviewContainerSpec{} - } else { - yyv183 := &yyv180[yyj180] - yyv183.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj180 < len(yyv180) { - yyv180 = yyv180[:yyj180] - yyc180 = true - } else if yyj180 == 0 && yyv180 == nil { - yyv180 = []ImageReviewContainerSpec{} - yyc180 = true - } - } - yyh180.End() - if yyc180 { - *v = yyv180 - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/types.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/types.go deleted file mode 100644 index d0fa6d2d..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/types.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 imagepolicy - -import ( - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/unversioned" -) - -// +genclient=true -// +nonNamespaced=true -// +noMethods=true - -// ImageReview checks if the set of images in a pod are allowed. -type ImageReview struct { - unversioned.TypeMeta - api.ObjectMeta - - // Spec holds information about the pod being evaluated - Spec ImageReviewSpec - - // Status is filled in by the backend and indicates whether the pod should be allowed. - Status ImageReviewStatus -} - -// ImageReviewSpec is a description of the pod creation request. -type ImageReviewSpec struct { - // Containers is a list of a subset of the information in each container of the Pod being created. - Containers []ImageReviewContainerSpec - // Annotations is a list of key-value pairs extracted from the Pod's annotations. - // It only includes keys which match the pattern `*.image-policy.k8s.io/*`. - // It is up to each webhook backend to determine how to interpret these annotations, if at all. - Annotations map[string]string - // Namespace is the namespace the pod is being created in. - Namespace string -} - -// ImageReviewContainerSpec is a description of a container within the pod creation request. -type ImageReviewContainerSpec struct { - // This can be in the form image:tag or image@SHA:012345679abcdef. - Image string - // In future, we may add command line overrides, exec health check command lines, and so on. -} - -// ImageReviewStatus is the result of the token authentication request. -type ImageReviewStatus struct { - // Allowed indicates that all images were allowed to be run. - Allowed bool - // Reason should be empty unless Allowed is false in which case it - // may contain a short description of what is wrong. Kubernetes - // may truncate excessively long errors when displaying to the user. - Reason string -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/doc.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/doc.go deleted file mode 100644 index cc8a147b..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/doc.go +++ /dev/null @@ -1,23 +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. -*/ - -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/imagepolicy -// +k8s:openapi-gen=true -// +k8s:defaulter-gen=TypeMeta - -// +groupName=imagepolicy.k8s.io -package v1alpha1 diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/generated.pb.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/generated.pb.go deleted file mode 100644 index d7113ff8..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/generated.pb.go +++ /dev/null @@ -1,1059 +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. -*/ - -// Code generated by protoc-gen-gogo. -// source: k8s.io/kubernetes/pkg/apis/imagepolicy/v1alpha1/generated.proto -// DO NOT EDIT! - -/* - Package v1alpha1 is a generated protocol buffer package. - - It is generated from these files: - k8s.io/kubernetes/pkg/apis/imagepolicy/v1alpha1/generated.proto - - It has these top-level messages: - ImageReview - ImageReviewContainerSpec - ImageReviewSpec - ImageReviewStatus -*/ -package v1alpha1 - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import strings "strings" -import reflect "reflect" -import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - -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. -const _ = proto.GoGoProtoPackageIsVersion1 - -func (m *ImageReview) Reset() { *m = ImageReview{} } -func (*ImageReview) ProtoMessage() {} -func (*ImageReview) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } - -func (m *ImageReviewContainerSpec) Reset() { *m = ImageReviewContainerSpec{} } -func (*ImageReviewContainerSpec) ProtoMessage() {} -func (*ImageReviewContainerSpec) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{1} -} - -func (m *ImageReviewSpec) Reset() { *m = ImageReviewSpec{} } -func (*ImageReviewSpec) ProtoMessage() {} -func (*ImageReviewSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } - -func (m *ImageReviewStatus) Reset() { *m = ImageReviewStatus{} } -func (*ImageReviewStatus) ProtoMessage() {} -func (*ImageReviewStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } - -func init() { - proto.RegisterType((*ImageReview)(nil), "k8s.io.client-go.pkg.apis.imagepolicy.v1alpha1.ImageReview") - proto.RegisterType((*ImageReviewContainerSpec)(nil), "k8s.io.client-go.pkg.apis.imagepolicy.v1alpha1.ImageReviewContainerSpec") - proto.RegisterType((*ImageReviewSpec)(nil), "k8s.io.client-go.pkg.apis.imagepolicy.v1alpha1.ImageReviewSpec") - proto.RegisterType((*ImageReviewStatus)(nil), "k8s.io.client-go.pkg.apis.imagepolicy.v1alpha1.ImageReviewStatus") -} -func (m *ImageReview) 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 *ImageReview) 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 *ImageReviewContainerSpec) 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 *ImageReviewContainerSpec) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - data[i] = 0xa - i++ - i = encodeVarintGenerated(data, i, uint64(len(m.Image))) - i += copy(data[i:], m.Image) - return i, nil -} - -func (m *ImageReviewSpec) 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 *ImageReviewSpec) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Containers) > 0 { - for _, msg := range m.Containers { - 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 - } - } - if len(m.Annotations) > 0 { - for k := range m.Annotations { - data[i] = 0x12 - i++ - v := m.Annotations[k] - mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) - 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(len(v))) - i += copy(data[i:], v) - } - } - data[i] = 0x1a - i++ - i = encodeVarintGenerated(data, i, uint64(len(m.Namespace))) - i += copy(data[i:], m.Namespace) - return i, nil -} - -func (m *ImageReviewStatus) 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 *ImageReviewStatus) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - data[i] = 0x8 - i++ - if m.Allowed { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - data[i] = 0x12 - i++ - i = encodeVarintGenerated(data, i, uint64(len(m.Reason))) - i += copy(data[i:], m.Reason) - 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 *ImageReview) 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 *ImageReviewContainerSpec) Size() (n int) { - var l int - _ = l - l = len(m.Image) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ImageReviewSpec) Size() (n int) { - var l int - _ = l - if len(m.Containers) > 0 { - for _, e := range m.Containers { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.Annotations) > 0 { - for k, v := range m.Annotations { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } - } - l = len(m.Namespace) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ImageReviewStatus) Size() (n int) { - var l int - _ = l - n += 2 - l = len(m.Reason) - 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 *ImageReview) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ImageReview{`, - `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_kubernetes_pkg_api_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ImageReviewSpec", "ImageReviewSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ImageReviewStatus", "ImageReviewStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ImageReviewContainerSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ImageReviewContainerSpec{`, - `Image:` + fmt.Sprintf("%v", this.Image) + `,`, - `}`, - }, "") - return s -} -func (this *ImageReviewSpec) String() string { - if this == nil { - return "nil" - } - keysForAnnotations := make([]string, 0, len(this.Annotations)) - for k := range this.Annotations { - keysForAnnotations = append(keysForAnnotations, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) - mapStringForAnnotations := "map[string]string{" - for _, k := range keysForAnnotations { - mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) - } - mapStringForAnnotations += "}" - s := strings.Join([]string{`&ImageReviewSpec{`, - `Containers:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Containers), "ImageReviewContainerSpec", "ImageReviewContainerSpec", 1), `&`, ``, 1) + `,`, - `Annotations:` + mapStringForAnnotations + `,`, - `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `}`, - }, "") - return s -} -func (this *ImageReviewStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ImageReviewStatus{`, - `Allowed:` + fmt.Sprintf("%v", this.Allowed) + `,`, - `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, - `}`, - }, "") - 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 *ImageReview) 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: ImageReview: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ImageReview: 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 *ImageReviewContainerSpec) 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: ImageReviewContainerSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ImageReviewContainerSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Image", 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.Image = 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 *ImageReviewSpec) 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: ImageReviewSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ImageReviewSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Containers", 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.Containers = append(m.Containers, ImageReviewContainerSpec{}) - if err := m.Containers[len(m.Containers)-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 Annotations", 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 - 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 stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLenmapvalue |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue := string(data[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - if m.Annotations == nil { - m.Annotations = make(map[string]string) - } - m.Annotations[mapkey] = mapvalue - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", 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.Namespace = 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 *ImageReviewStatus) 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: ImageReviewStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ImageReviewStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowed", 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.Allowed = bool(v != 0) - case 2: - 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 - 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") -) - -var fileDescriptorGenerated = []byte{ - // 573 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x92, 0x3f, 0x6f, 0xd3, 0x4e, - 0x18, 0xc7, 0xe3, 0xa4, 0xff, 0x72, 0xf9, 0xfd, 0x68, 0x7b, 0x30, 0x58, 0x19, 0xdc, 0x2a, 0x48, - 0xa8, 0x20, 0x7a, 0xa7, 0x54, 0x42, 0xaa, 0x18, 0x28, 0x35, 0x62, 0xe8, 0x00, 0x88, 0x63, 0x41, - 0x6c, 0x17, 0xe7, 0xa9, 0x7b, 0x8d, 0x73, 0x67, 0xf9, 0xce, 0xae, 0x3a, 0x20, 0x31, 0x32, 0x30, - 0xf0, 0x6e, 0x78, 0x0b, 0x1d, 0x3b, 0x32, 0x55, 0x24, 0xbc, 0x11, 0x94, 0xb3, 0x53, 0x9b, 0xa4, - 0x19, 0x50, 0x36, 0x3f, 0xff, 0x3e, 0xdf, 0xef, 0x3d, 0x8f, 0xd1, 0xd1, 0xe0, 0x50, 0x13, 0xa1, - 0xe8, 0x20, 0xed, 0x41, 0x22, 0xc1, 0x80, 0xa6, 0xf1, 0x20, 0xa4, 0x3c, 0x16, 0x9a, 0x8a, 0x21, - 0x0f, 0x21, 0x56, 0x91, 0x08, 0x2e, 0x69, 0xd6, 0xe5, 0x51, 0x7c, 0xc6, 0xbb, 0x34, 0x04, 0x09, - 0x09, 0x37, 0xd0, 0x27, 0x71, 0xa2, 0x8c, 0xc2, 0x34, 0x07, 0x90, 0x12, 0x40, 0xe2, 0x41, 0x48, - 0x26, 0x00, 0x52, 0x01, 0x90, 0x29, 0xa0, 0xbd, 0x1f, 0x0a, 0x73, 0x96, 0xf6, 0x48, 0xa0, 0x86, - 0x34, 0x54, 0xa1, 0xa2, 0x96, 0xd3, 0x4b, 0x4f, 0x6d, 0x64, 0x03, 0xfb, 0x95, 0xf3, 0xdb, 0x07, - 0x0b, 0x0d, 0xd2, 0x04, 0xb4, 0x4a, 0x93, 0x00, 0x66, 0x3d, 0xb5, 0x9f, 0x2d, 0x9e, 0x49, 0x65, - 0x06, 0x89, 0x16, 0x4a, 0x42, 0x7f, 0x6e, 0xec, 0xe9, 0xe2, 0xb1, 0x6c, 0xee, 0xe1, 0xed, 0xfd, - 0xbb, 0xbb, 0x93, 0x54, 0x1a, 0x31, 0x9c, 0xf7, 0xd4, 0xbd, 0xbb, 0x3d, 0x35, 0x22, 0xa2, 0x42, - 0x1a, 0x6d, 0x92, 0xd9, 0x91, 0xce, 0x8f, 0x3a, 0x6a, 0x9d, 0x4c, 0x56, 0xc8, 0x20, 0x13, 0x70, - 0x81, 0x3f, 0xa2, 0x8d, 0x21, 0x18, 0xde, 0xe7, 0x86, 0xbb, 0xce, 0xae, 0xb3, 0xd7, 0x3a, 0xd8, - 0x23, 0x0b, 0xb7, 0x4f, 0xb2, 0x2e, 0x79, 0xd7, 0x3b, 0x87, 0xc0, 0xbc, 0x01, 0xc3, 0x7d, 0x7c, - 0x75, 0xb3, 0x53, 0x1b, 0xdf, 0xec, 0xa0, 0x32, 0xc7, 0x6e, 0x69, 0xb8, 0x87, 0x56, 0x74, 0x0c, - 0x81, 0x5b, 0xb7, 0xd4, 0x97, 0xe4, 0x1f, 0x6f, 0x4a, 0x2a, 0x2e, 0x3f, 0xc4, 0x10, 0xf8, 0xff, - 0x15, 0x6a, 0x2b, 0x93, 0x88, 0x59, 0x36, 0x3e, 0x47, 0x6b, 0xda, 0x70, 0x93, 0x6a, 0xb7, 0x61, - 0x55, 0xfc, 0xa5, 0x54, 0x2c, 0xc9, 0xbf, 0x57, 0xe8, 0xac, 0xe5, 0x31, 0x2b, 0x14, 0x3a, 0x47, - 0xc8, 0xad, 0x34, 0xbf, 0x52, 0xd2, 0x70, 0x21, 0x21, 0x99, 0xb8, 0xc1, 0x0f, 0xd1, 0xaa, 0xa5, - 0xdb, 0x15, 0x36, 0xfd, 0xff, 0x0b, 0xc4, 0x6a, 0x3e, 0x90, 0xd7, 0x3a, 0xdf, 0x1a, 0x68, 0x73, - 0xe6, 0x51, 0xf8, 0x33, 0x42, 0xc1, 0x94, 0xa4, 0x5d, 0x67, 0xb7, 0xb1, 0xd7, 0x3a, 0x38, 0x59, - 0xe6, 0x11, 0x7f, 0xf9, 0x2a, 0x2f, 0x74, 0x9b, 0xd6, 0xac, 0x22, 0x88, 0xbf, 0x3a, 0xa8, 0xc5, - 0xa5, 0x54, 0x86, 0x1b, 0xa1, 0xa4, 0x76, 0xeb, 0xd6, 0xc0, 0xfb, 0x65, 0x6f, 0x45, 0x8e, 0x4b, - 0xe6, 0x6b, 0x69, 0x92, 0x4b, 0xff, 0x7e, 0x61, 0xa4, 0x55, 0xa9, 0xb0, 0xaa, 0x34, 0xa6, 0xa8, - 0x29, 0xf9, 0x10, 0x74, 0xcc, 0x03, 0xb0, 0xd7, 0x6c, 0xfa, 0xdb, 0xc5, 0x50, 0xf3, 0xed, 0xb4, - 0xc0, 0xca, 0x9e, 0xf6, 0x0b, 0xb4, 0x35, 0x2b, 0x83, 0xb7, 0x50, 0x63, 0x00, 0x97, 0xf9, 0x15, - 0xd8, 0xe4, 0x13, 0x3f, 0x40, 0xab, 0x19, 0x8f, 0x52, 0xb0, 0xbf, 0x61, 0x93, 0xe5, 0xc1, 0xf3, - 0xfa, 0xa1, 0xd3, 0x39, 0x45, 0xdb, 0x73, 0xc7, 0xc7, 0x8f, 0xd1, 0x3a, 0x8f, 0x22, 0x75, 0x01, - 0x7d, 0x0b, 0xd9, 0xf0, 0x37, 0x0b, 0x0f, 0xeb, 0xc7, 0x79, 0x9a, 0x4d, 0xeb, 0xf8, 0x11, 0x5a, - 0x4b, 0x80, 0x6b, 0x25, 0x73, 0x74, 0xf9, 0xdf, 0x30, 0x9b, 0x65, 0x45, 0xd5, 0x7f, 0x72, 0x35, - 0xf2, 0x6a, 0xd7, 0x23, 0xaf, 0xf6, 0x73, 0xe4, 0xd5, 0xbe, 0x8c, 0x3d, 0xe7, 0x6a, 0xec, 0x39, - 0xd7, 0x63, 0xcf, 0xf9, 0x35, 0xf6, 0x9c, 0xef, 0xbf, 0xbd, 0xda, 0xa7, 0x8d, 0xe9, 0x1e, 0xff, - 0x04, 0x00, 0x00, 0xff, 0xff, 0x5b, 0xde, 0x19, 0x74, 0x3a, 0x05, 0x00, 0x00, -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/generated.proto b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/generated.proto deleted file mode 100644 index 7b26db93..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/generated.proto +++ /dev/null @@ -1,81 +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. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.kubernetes.pkg.apis.imagepolicy.v1alpha1; - -import "k8s.io/kubernetes/pkg/api/resource/generated.proto"; -import "k8s.io/kubernetes/pkg/api/unversioned/generated.proto"; -import "k8s.io/kubernetes/pkg/api/v1/generated.proto"; -import "k8s.io/kubernetes/pkg/runtime/generated.proto"; -import "k8s.io/kubernetes/pkg/util/intstr/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1alpha1"; - -// ImageReview checks if the set of images in a pod are allowed. -message ImageReview { - // +optional - optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; - - // Spec holds information about the pod being evaluated - optional ImageReviewSpec spec = 2; - - // Status is filled in by the backend and indicates whether the pod should be allowed. - // +optional - optional ImageReviewStatus status = 3; -} - -// ImageReviewContainerSpec is a description of a container within the pod creation request. -message ImageReviewContainerSpec { - // This can be in the form image:tag or image@SHA:012345679abcdef. - // +optional - optional string image = 1; -} - -// ImageReviewSpec is a description of the pod creation request. -message ImageReviewSpec { - // Containers is a list of a subset of the information in each container of the Pod being created. - // +optional - repeated ImageReviewContainerSpec containers = 1; - - // Annotations is a list of key-value pairs extracted from the Pod's annotations. - // It only includes keys which match the pattern `*.image-policy.k8s.io/*`. - // It is up to each webhook backend to determine how to interpret these annotations, if at all. - // +optional - map annotations = 2; - - // Namespace is the namespace the pod is being created in. - // +optional - optional string namespace = 3; -} - -// ImageReviewStatus is the result of the token authentication request. -message ImageReviewStatus { - // Allowed indicates that all images were allowed to be run. - optional bool allowed = 1; - - // Reason should be empty unless Allowed is false in which case it - // may contain a short description of what is wrong. Kubernetes - // may truncate excessively long errors when displaying to the user. - // +optional - optional string reason = 2; -} - diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/register.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/register.go deleted file mode 100644 index 35d79328..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/register.go +++ /dev/null @@ -1,46 +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 v1alpha1 - -import ( - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/api/v1" - "k8s.io/client-go/pkg/runtime" -) - -// GroupName is the group name for this API. -const GroupName = "imagepolicy.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1alpha1"} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &v1.ListOptions{}, - &v1.DeleteOptions{}, - &v1.ExportOptions{}, - - &ImageReview{}, - ) - return nil -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/types.generated.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/types.generated.go deleted file mode 100644 index 8bb3ba09..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/types.generated.go +++ /dev/null @@ -1,1208 +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. -*/ - -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ - -package v1alpha1 - -import ( - "errors" - "fmt" - codec1978 "github.com/ugorji/go/codec" - pkg1_unversioned "k8s.io/client-go/pkg/api/unversioned" - pkg2_v1 "k8s.io/client-go/pkg/api/v1" - pkg3_types "k8s.io/client-go/pkg/types" - "reflect" - "runtime" - time "time" -) - -const ( - // ----- content types ---- - codecSelferC_UTF81234 = 1 - codecSelferC_RAW1234 = 0 - // ----- value types used ---- - codecSelferValueTypeArray1234 = 10 - codecSelferValueTypeMap1234 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey1234 = 2 - codecSelfer_containerMapValue1234 = 3 - codecSelfer_containerMapEnd1234 = 4 - codecSelfer_containerArrayElem1234 = 6 - codecSelfer_containerArrayEnd1234 = 7 -) - -var ( - codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`) -) - -type codecSelfer1234 struct{} - -func init() { - if codec1978.GenVersion != 5 { - _, file, _, _ := runtime.Caller(0) - err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) - panic(err) - } - if false { // reference the types, but skip this branch at build/run time - var v0 pkg1_unversioned.TypeMeta - var v1 pkg2_v1.ObjectMeta - var v2 pkg3_types.UID - var v3 time.Time - _, _, _, _ = v0, v1, v2, v3 - } -} - -func (x *ImageReview) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [5]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - yyq2[0] = x.Kind != "" - yyq2[1] = x.APIVersion != "" - yyq2[2] = true - yyq2[4] = true - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(5) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[0] { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[1] { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[2] { - yy10 := &x.ObjectMeta - yy10.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq2[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy11 := &x.ObjectMeta - yy11.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy13 := &x.Spec - yy13.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy14 := &x.Spec - yy14.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[4] { - yy16 := &x.Status - yy16.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq2[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy17 := &x.Status - yy17.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ImageReview) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym18 := z.DecBinary() - _ = yym18 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct19 := r.ContainerType() - if yyct19 == codecSelferValueTypeMap1234 { - yyl19 := r.ReadMapStart() - if yyl19 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl19, d) - } - } else if yyct19 == codecSelferValueTypeArray1234 { - yyl19 := r.ReadArrayStart() - if yyl19 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl19, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ImageReview) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys20Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys20Slc - var yyhl20 bool = l >= 0 - for yyj20 := 0; ; yyj20++ { - if yyhl20 { - if yyj20 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys20Slc = r.DecodeBytes(yys20Slc, true, true) - yys20 := string(yys20Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys20 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv23 := &x.ObjectMeta - yyv23.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ImageReviewSpec{} - } else { - yyv24 := &x.Spec - yyv24.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ImageReviewStatus{} - } else { - yyv25 := &x.Status - yyv25.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys20) - } // end switch yys20 - } // end for yyj20 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ImageReview) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj26 int - var yyb26 bool - var yyhl26 bool = l >= 0 - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg2_v1.ObjectMeta{} - } else { - yyv29 := &x.ObjectMeta - yyv29.CodecDecodeSelf(d) - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ImageReviewSpec{} - } else { - yyv30 := &x.Spec - yyv30.CodecDecodeSelf(d) - } - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ImageReviewStatus{} - } else { - yyv31 := &x.Status - yyv31.CodecDecodeSelf(d) - } - for { - yyj26++ - if yyhl26 { - yyb26 = yyj26 > l - } else { - yyb26 = r.CheckBreak() - } - if yyb26 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj26-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ImageReviewSpec) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym32 := z.EncBinary() - _ = yym32 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep33 := !z.EncBinary() - yy2arr33 := z.EncBasicHandle().StructToArray - var yyq33 [3]bool - _, _, _ = yysep33, yyq33, yy2arr33 - const yyr33 bool = false - yyq33[0] = len(x.Containers) != 0 - yyq33[1] = len(x.Annotations) != 0 - yyq33[2] = x.Namespace != "" - var yynn33 int - if yyr33 || yy2arr33 { - r.EncodeArrayStart(3) - } else { - yynn33 = 0 - for _, b := range yyq33 { - if b { - yynn33++ - } - } - r.EncodeMapStart(yynn33) - yynn33 = 0 - } - if yyr33 || yy2arr33 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq33[0] { - if x.Containers == nil { - r.EncodeNil() - } else { - yym35 := z.EncBinary() - _ = yym35 - if false { - } else { - h.encSliceImageReviewContainerSpec(([]ImageReviewContainerSpec)(x.Containers), e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq33[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("containers")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Containers == nil { - r.EncodeNil() - } else { - yym36 := z.EncBinary() - _ = yym36 - if false { - } else { - h.encSliceImageReviewContainerSpec(([]ImageReviewContainerSpec)(x.Containers), e) - } - } - } - } - if yyr33 || yy2arr33 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq33[1] { - if x.Annotations == nil { - r.EncodeNil() - } else { - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - z.F.EncMapStringStringV(x.Annotations, false, e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq33[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("annotations")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Annotations == nil { - r.EncodeNil() - } else { - yym39 := z.EncBinary() - _ = yym39 - if false { - } else { - z.F.EncMapStringStringV(x.Annotations, false, e) - } - } - } - } - if yyr33 || yy2arr33 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq33[2] { - yym41 := z.EncBinary() - _ = yym41 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Namespace)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq33[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("namespace")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym42 := z.EncBinary() - _ = yym42 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Namespace)) - } - } - } - if yyr33 || yy2arr33 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ImageReviewSpec) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym43 := z.DecBinary() - _ = yym43 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct44 := r.ContainerType() - if yyct44 == codecSelferValueTypeMap1234 { - yyl44 := r.ReadMapStart() - if yyl44 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl44, d) - } - } else if yyct44 == codecSelferValueTypeArray1234 { - yyl44 := r.ReadArrayStart() - if yyl44 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl44, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ImageReviewSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys45Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys45Slc - var yyhl45 bool = l >= 0 - for yyj45 := 0; ; yyj45++ { - if yyhl45 { - if yyj45 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys45Slc = r.DecodeBytes(yys45Slc, true, true) - yys45 := string(yys45Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys45 { - case "containers": - if r.TryDecodeAsNil() { - x.Containers = nil - } else { - yyv46 := &x.Containers - yym47 := z.DecBinary() - _ = yym47 - if false { - } else { - h.decSliceImageReviewContainerSpec((*[]ImageReviewContainerSpec)(yyv46), d) - } - } - case "annotations": - if r.TryDecodeAsNil() { - x.Annotations = nil - } else { - yyv48 := &x.Annotations - yym49 := z.DecBinary() - _ = yym49 - if false { - } else { - z.F.DecMapStringStringX(yyv48, false, d) - } - } - case "namespace": - if r.TryDecodeAsNil() { - x.Namespace = "" - } else { - x.Namespace = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys45) - } // end switch yys45 - } // end for yyj45 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ImageReviewSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj51 int - var yyb51 bool - var yyhl51 bool = l >= 0 - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Containers = nil - } else { - yyv52 := &x.Containers - yym53 := z.DecBinary() - _ = yym53 - if false { - } else { - h.decSliceImageReviewContainerSpec((*[]ImageReviewContainerSpec)(yyv52), d) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Annotations = nil - } else { - yyv54 := &x.Annotations - yym55 := z.DecBinary() - _ = yym55 - if false { - } else { - z.F.DecMapStringStringX(yyv54, false, d) - } - } - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Namespace = "" - } else { - x.Namespace = string(r.DecodeString()) - } - for { - yyj51++ - if yyhl51 { - yyb51 = yyj51 > l - } else { - yyb51 = r.CheckBreak() - } - if yyb51 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj51-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ImageReviewContainerSpec) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym57 := z.EncBinary() - _ = yym57 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep58 := !z.EncBinary() - yy2arr58 := z.EncBasicHandle().StructToArray - var yyq58 [1]bool - _, _, _ = yysep58, yyq58, yy2arr58 - const yyr58 bool = false - yyq58[0] = x.Image != "" - var yynn58 int - if yyr58 || yy2arr58 { - r.EncodeArrayStart(1) - } else { - yynn58 = 0 - for _, b := range yyq58 { - if b { - yynn58++ - } - } - r.EncodeMapStart(yynn58) - yynn58 = 0 - } - if yyr58 || yy2arr58 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq58[0] { - yym60 := z.EncBinary() - _ = yym60 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Image)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq58[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("image")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym61 := z.EncBinary() - _ = yym61 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Image)) - } - } - } - if yyr58 || yy2arr58 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ImageReviewContainerSpec) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym62 := z.DecBinary() - _ = yym62 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct63 := r.ContainerType() - if yyct63 == codecSelferValueTypeMap1234 { - yyl63 := r.ReadMapStart() - if yyl63 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl63, d) - } - } else if yyct63 == codecSelferValueTypeArray1234 { - yyl63 := r.ReadArrayStart() - if yyl63 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl63, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ImageReviewContainerSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys64Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys64Slc - var yyhl64 bool = l >= 0 - for yyj64 := 0; ; yyj64++ { - if yyhl64 { - if yyj64 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys64Slc = r.DecodeBytes(yys64Slc, true, true) - yys64 := string(yys64Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys64 { - case "image": - if r.TryDecodeAsNil() { - x.Image = "" - } else { - x.Image = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys64) - } // end switch yys64 - } // end for yyj64 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ImageReviewContainerSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj66 int - var yyb66 bool - var yyhl66 bool = l >= 0 - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l - } else { - yyb66 = r.CheckBreak() - } - if yyb66 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Image = "" - } else { - x.Image = string(r.DecodeString()) - } - for { - yyj66++ - if yyhl66 { - yyb66 = yyj66 > l - } else { - yyb66 = r.CheckBreak() - } - if yyb66 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj66-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ImageReviewStatus) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym68 := z.EncBinary() - _ = yym68 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep69 := !z.EncBinary() - yy2arr69 := z.EncBasicHandle().StructToArray - var yyq69 [2]bool - _, _, _ = yysep69, yyq69, yy2arr69 - const yyr69 bool = false - yyq69[1] = x.Reason != "" - var yynn69 int - if yyr69 || yy2arr69 { - r.EncodeArrayStart(2) - } else { - yynn69 = 1 - for _, b := range yyq69 { - if b { - yynn69++ - } - } - r.EncodeMapStart(yynn69) - yynn69 = 0 - } - if yyr69 || yy2arr69 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym71 := z.EncBinary() - _ = yym71 - if false { - } else { - r.EncodeBool(bool(x.Allowed)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("allowed")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym72 := z.EncBinary() - _ = yym72 - if false { - } else { - r.EncodeBool(bool(x.Allowed)) - } - } - if yyr69 || yy2arr69 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq69[1] { - yym74 := z.EncBinary() - _ = yym74 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq69[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("reason")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym75 := z.EncBinary() - _ = yym75 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) - } - } - } - if yyr69 || yy2arr69 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ImageReviewStatus) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym76 := z.DecBinary() - _ = yym76 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct77 := r.ContainerType() - if yyct77 == codecSelferValueTypeMap1234 { - yyl77 := r.ReadMapStart() - if yyl77 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl77, d) - } - } else if yyct77 == codecSelferValueTypeArray1234 { - yyl77 := r.ReadArrayStart() - if yyl77 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl77, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ImageReviewStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys78Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys78Slc - var yyhl78 bool = l >= 0 - for yyj78 := 0; ; yyj78++ { - if yyhl78 { - if yyj78 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys78Slc = r.DecodeBytes(yys78Slc, true, true) - yys78 := string(yys78Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys78 { - case "allowed": - if r.TryDecodeAsNil() { - x.Allowed = false - } else { - x.Allowed = bool(r.DecodeBool()) - } - case "reason": - if r.TryDecodeAsNil() { - x.Reason = "" - } else { - x.Reason = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys78) - } // end switch yys78 - } // end for yyj78 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ImageReviewStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj81 int - var yyb81 bool - var yyhl81 bool = l >= 0 - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Allowed = false - } else { - x.Allowed = bool(r.DecodeBool()) - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Reason = "" - } else { - x.Reason = string(r.DecodeString()) - } - for { - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj81-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) encSliceImageReviewContainerSpec(v []ImageReviewContainerSpec, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv84 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy85 := &yyv84 - yy85.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceImageReviewContainerSpec(v *[]ImageReviewContainerSpec, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv86 := *v - yyh86, yyl86 := z.DecSliceHelperStart() - var yyc86 bool - if yyl86 == 0 { - if yyv86 == nil { - yyv86 = []ImageReviewContainerSpec{} - yyc86 = true - } else if len(yyv86) != 0 { - yyv86 = yyv86[:0] - yyc86 = true - } - } else if yyl86 > 0 { - var yyrr86, yyrl86 int - var yyrt86 bool - if yyl86 > cap(yyv86) { - - yyrg86 := len(yyv86) > 0 - yyv286 := yyv86 - yyrl86, yyrt86 = z.DecInferLen(yyl86, z.DecBasicHandle().MaxInitLen, 16) - if yyrt86 { - if yyrl86 <= cap(yyv86) { - yyv86 = yyv86[:yyrl86] - } else { - yyv86 = make([]ImageReviewContainerSpec, yyrl86) - } - } else { - yyv86 = make([]ImageReviewContainerSpec, yyrl86) - } - yyc86 = true - yyrr86 = len(yyv86) - if yyrg86 { - copy(yyv86, yyv286) - } - } else if yyl86 != len(yyv86) { - yyv86 = yyv86[:yyl86] - yyc86 = true - } - yyj86 := 0 - for ; yyj86 < yyrr86; yyj86++ { - yyh86.ElemContainerState(yyj86) - if r.TryDecodeAsNil() { - yyv86[yyj86] = ImageReviewContainerSpec{} - } else { - yyv87 := &yyv86[yyj86] - yyv87.CodecDecodeSelf(d) - } - - } - if yyrt86 { - for ; yyj86 < yyl86; yyj86++ { - yyv86 = append(yyv86, ImageReviewContainerSpec{}) - yyh86.ElemContainerState(yyj86) - if r.TryDecodeAsNil() { - yyv86[yyj86] = ImageReviewContainerSpec{} - } else { - yyv88 := &yyv86[yyj86] - yyv88.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj86 := 0 - for ; !r.CheckBreak(); yyj86++ { - - if yyj86 >= len(yyv86) { - yyv86 = append(yyv86, ImageReviewContainerSpec{}) // var yyz86 ImageReviewContainerSpec - yyc86 = true - } - yyh86.ElemContainerState(yyj86) - if yyj86 < len(yyv86) { - if r.TryDecodeAsNil() { - yyv86[yyj86] = ImageReviewContainerSpec{} - } else { - yyv89 := &yyv86[yyj86] - yyv89.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj86 < len(yyv86) { - yyv86 = yyv86[:yyj86] - yyc86 = true - } else if yyj86 == 0 && yyv86 == nil { - yyv86 = []ImageReviewContainerSpec{} - yyc86 = true - } - } - yyh86.End() - if yyc86 { - *v = yyv86 - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/types.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/types.go deleted file mode 100644 index 26d23618..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/types.go +++ /dev/null @@ -1,74 +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 v1alpha1 - -import ( - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/api/v1" -) - -// +genclient=true -// +nonNamespaced=true -// +noMethods=true - -// ImageReview checks if the set of images in a pod are allowed. -type ImageReview struct { - unversioned.TypeMeta `json:",inline"` - // +optional - v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Spec holds information about the pod being evaluated - Spec ImageReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - - // Status is filled in by the backend and indicates whether the pod should be allowed. - // +optional - Status ImageReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// ImageReviewSpec is a description of the pod creation request. -type ImageReviewSpec struct { - // Containers is a list of a subset of the information in each container of the Pod being created. - // +optional - Containers []ImageReviewContainerSpec `json:"containers,omitempty" protobuf:"bytes,1,rep,name=containers"` - // Annotations is a list of key-value pairs extracted from the Pod's annotations. - // It only includes keys which match the pattern `*.image-policy.k8s.io/*`. - // It is up to each webhook backend to determine how to interpret these annotations, if at all. - // +optional - Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,2,rep,name=annotations"` - // Namespace is the namespace the pod is being created in. - // +optional - Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` -} - -// ImageReviewContainerSpec is a description of a container within the pod creation request. -type ImageReviewContainerSpec struct { - // This can be in the form image:tag or image@SHA:012345679abcdef. - // +optional - Image string `json:"image,omitempty" protobuf:"bytes,1,opt,name=image"` - // In future, we may add command line overrides, exec health check command lines, and so on. -} - -// ImageReviewStatus is the result of the token authentication request. -type ImageReviewStatus struct { - // Allowed indicates that all images were allowed to be run. - Allowed bool `json:"allowed" protobuf:"varint,1,opt,name=allowed"` - // Reason should be empty unless Allowed is false in which case it - // may contain a short description of what is wrong. Kubernetes - // may truncate excessively long errors when displaying to the user. - // +optional - Reason string `json:"reason,omitempty" protobuf:"bytes,2,opt,name=reason"` -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/types_swagger_doc_generated.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/types_swagger_doc_generated.go deleted file mode 100644 index f4b26f5e..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/types_swagger_doc_generated.go +++ /dev/null @@ -1,70 +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 v1alpha1 - -// This file contains a collection of methods that can be used from go-restful to -// generate Swagger API documentation for its models. Please read this PR for more -// information on the implementation: https://github.com/emicklei/go-restful/pull/215 -// -// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if -// they are on one line! For multiple line or blocks that you want to ignore use ---. -// Any context after a --- is ignored. -// -// Those methods can be generated by using hack/update-generated-swagger-docs.sh - -// AUTO-GENERATED FUNCTIONS START HERE -var map_ImageReview = map[string]string{ - "": "ImageReview checks if the set of images in a pod are allowed.", - "spec": "Spec holds information about the pod being evaluated", - "status": "Status is filled in by the backend and indicates whether the pod should be allowed.", -} - -func (ImageReview) SwaggerDoc() map[string]string { - return map_ImageReview -} - -var map_ImageReviewContainerSpec = map[string]string{ - "": "ImageReviewContainerSpec is a description of a container within the pod creation request.", - "image": "This can be in the form image:tag or image@SHA:012345679abcdef.", -} - -func (ImageReviewContainerSpec) SwaggerDoc() map[string]string { - return map_ImageReviewContainerSpec -} - -var map_ImageReviewSpec = map[string]string{ - "": "ImageReviewSpec is a description of the pod creation request.", - "containers": "Containers is a list of a subset of the information in each container of the Pod being created.", - "annotations": "Annotations is a list of key-value pairs extracted from the Pod's annotations. It only includes keys which match the pattern `*.image-policy.k8s.io/*`. It is up to each webhook backend to determine how to interpret these annotations, if at all.", - "namespace": "Namespace is the namespace the pod is being created in.", -} - -func (ImageReviewSpec) SwaggerDoc() map[string]string { - return map_ImageReviewSpec -} - -var map_ImageReviewStatus = map[string]string{ - "": "ImageReviewStatus is the result of the token authentication request.", - "allowed": "Allowed indicates that all images were allowed to be run.", - "reason": "Reason should be empty unless Allowed is false in which case it may contain a short description of what is wrong. Kubernetes may truncate excessively long errors when displaying to the user.", -} - -func (ImageReviewStatus) SwaggerDoc() map[string]string { - return map_ImageReviewStatus -} - -// AUTO-GENERATED FUNCTIONS END HERE diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/zz_generated.conversion.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index d4d09036..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,143 +0,0 @@ -// +build !ignore_autogenerated - -/* -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. -*/ - -// This file was autogenerated by conversion-gen. Do not edit it manually! - -package v1alpha1 - -import ( - imagepolicy "k8s.io/client-go/pkg/apis/imagepolicy" - conversion "k8s.io/client-go/pkg/conversion" - runtime "k8s.io/client-go/pkg/runtime" - unsafe "unsafe" -) - -func init() { - SchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(scheme *runtime.Scheme) error { - return scheme.AddGeneratedConversionFuncs( - Convert_v1alpha1_ImageReview_To_imagepolicy_ImageReview, - Convert_imagepolicy_ImageReview_To_v1alpha1_ImageReview, - Convert_v1alpha1_ImageReviewContainerSpec_To_imagepolicy_ImageReviewContainerSpec, - Convert_imagepolicy_ImageReviewContainerSpec_To_v1alpha1_ImageReviewContainerSpec, - Convert_v1alpha1_ImageReviewSpec_To_imagepolicy_ImageReviewSpec, - Convert_imagepolicy_ImageReviewSpec_To_v1alpha1_ImageReviewSpec, - Convert_v1alpha1_ImageReviewStatus_To_imagepolicy_ImageReviewStatus, - Convert_imagepolicy_ImageReviewStatus_To_v1alpha1_ImageReviewStatus, - ) -} - -func autoConvert_v1alpha1_ImageReview_To_imagepolicy_ImageReview(in *ImageReview, out *imagepolicy.ImageReview, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_v1alpha1_ImageReviewSpec_To_imagepolicy_ImageReviewSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_ImageReviewStatus_To_imagepolicy_ImageReviewStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_ImageReview_To_imagepolicy_ImageReview(in *ImageReview, out *imagepolicy.ImageReview, s conversion.Scope) error { - return autoConvert_v1alpha1_ImageReview_To_imagepolicy_ImageReview(in, out, s) -} - -func autoConvert_imagepolicy_ImageReview_To_v1alpha1_ImageReview(in *imagepolicy.ImageReview, out *ImageReview, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_imagepolicy_ImageReviewSpec_To_v1alpha1_ImageReviewSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_imagepolicy_ImageReviewStatus_To_v1alpha1_ImageReviewStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_imagepolicy_ImageReview_To_v1alpha1_ImageReview(in *imagepolicy.ImageReview, out *ImageReview, s conversion.Scope) error { - return autoConvert_imagepolicy_ImageReview_To_v1alpha1_ImageReview(in, out, s) -} - -func autoConvert_v1alpha1_ImageReviewContainerSpec_To_imagepolicy_ImageReviewContainerSpec(in *ImageReviewContainerSpec, out *imagepolicy.ImageReviewContainerSpec, s conversion.Scope) error { - out.Image = in.Image - return nil -} - -func Convert_v1alpha1_ImageReviewContainerSpec_To_imagepolicy_ImageReviewContainerSpec(in *ImageReviewContainerSpec, out *imagepolicy.ImageReviewContainerSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_ImageReviewContainerSpec_To_imagepolicy_ImageReviewContainerSpec(in, out, s) -} - -func autoConvert_imagepolicy_ImageReviewContainerSpec_To_v1alpha1_ImageReviewContainerSpec(in *imagepolicy.ImageReviewContainerSpec, out *ImageReviewContainerSpec, s conversion.Scope) error { - out.Image = in.Image - return nil -} - -func Convert_imagepolicy_ImageReviewContainerSpec_To_v1alpha1_ImageReviewContainerSpec(in *imagepolicy.ImageReviewContainerSpec, out *ImageReviewContainerSpec, s conversion.Scope) error { - return autoConvert_imagepolicy_ImageReviewContainerSpec_To_v1alpha1_ImageReviewContainerSpec(in, out, s) -} - -func autoConvert_v1alpha1_ImageReviewSpec_To_imagepolicy_ImageReviewSpec(in *ImageReviewSpec, out *imagepolicy.ImageReviewSpec, s conversion.Scope) error { - out.Containers = *(*[]imagepolicy.ImageReviewContainerSpec)(unsafe.Pointer(&in.Containers)) - out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) - out.Namespace = in.Namespace - return nil -} - -func Convert_v1alpha1_ImageReviewSpec_To_imagepolicy_ImageReviewSpec(in *ImageReviewSpec, out *imagepolicy.ImageReviewSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_ImageReviewSpec_To_imagepolicy_ImageReviewSpec(in, out, s) -} - -func autoConvert_imagepolicy_ImageReviewSpec_To_v1alpha1_ImageReviewSpec(in *imagepolicy.ImageReviewSpec, out *ImageReviewSpec, s conversion.Scope) error { - out.Containers = *(*[]ImageReviewContainerSpec)(unsafe.Pointer(&in.Containers)) - out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) - out.Namespace = in.Namespace - return nil -} - -func Convert_imagepolicy_ImageReviewSpec_To_v1alpha1_ImageReviewSpec(in *imagepolicy.ImageReviewSpec, out *ImageReviewSpec, s conversion.Scope) error { - return autoConvert_imagepolicy_ImageReviewSpec_To_v1alpha1_ImageReviewSpec(in, out, s) -} - -func autoConvert_v1alpha1_ImageReviewStatus_To_imagepolicy_ImageReviewStatus(in *ImageReviewStatus, out *imagepolicy.ImageReviewStatus, s conversion.Scope) error { - out.Allowed = in.Allowed - out.Reason = in.Reason - return nil -} - -func Convert_v1alpha1_ImageReviewStatus_To_imagepolicy_ImageReviewStatus(in *ImageReviewStatus, out *imagepolicy.ImageReviewStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_ImageReviewStatus_To_imagepolicy_ImageReviewStatus(in, out, s) -} - -func autoConvert_imagepolicy_ImageReviewStatus_To_v1alpha1_ImageReviewStatus(in *imagepolicy.ImageReviewStatus, out *ImageReviewStatus, s conversion.Scope) error { - out.Allowed = in.Allowed - out.Reason = in.Reason - return nil -} - -func Convert_imagepolicy_ImageReviewStatus_To_v1alpha1_ImageReviewStatus(in *imagepolicy.ImageReviewStatus, out *ImageReviewStatus, s conversion.Scope) error { - return autoConvert_imagepolicy_ImageReviewStatus_To_v1alpha1_ImageReviewStatus(in, out, s) -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/zz_generated.deepcopy.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index ba5c19d2..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,105 +0,0 @@ -// +build !ignore_autogenerated - -/* -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. -*/ - -// This file was autogenerated by deepcopy-gen. Do not edit it manually! - -package v1alpha1 - -import ( - v1 "k8s.io/client-go/pkg/api/v1" - conversion "k8s.io/client-go/pkg/conversion" - runtime "k8s.io/client-go/pkg/runtime" - reflect "reflect" -) - -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ImageReview, InType: reflect.TypeOf(&ImageReview{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ImageReviewContainerSpec, InType: reflect.TypeOf(&ImageReviewContainerSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ImageReviewSpec, InType: reflect.TypeOf(&ImageReviewSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ImageReviewStatus, InType: reflect.TypeOf(&ImageReviewStatus{})}, - ) -} - -func DeepCopy_v1alpha1_ImageReview(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ImageReview) - out := out.(*ImageReview) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1alpha1_ImageReviewSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_v1alpha1_ImageReviewContainerSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ImageReviewContainerSpec) - out := out.(*ImageReviewContainerSpec) - out.Image = in.Image - return nil - } -} - -func DeepCopy_v1alpha1_ImageReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ImageReviewSpec) - out := out.(*ImageReviewSpec) - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]ImageReviewContainerSpec, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Containers = nil - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Annotations = nil - } - out.Namespace = in.Namespace - return nil - } -} - -func DeepCopy_v1alpha1_ImageReviewStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ImageReviewStatus) - out := out.(*ImageReviewStatus) - out.Allowed = in.Allowed - out.Reason = in.Reason - return nil - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/zz_generated.deepcopy.go b/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/zz_generated.deepcopy.go deleted file mode 100644 index abe64ed7..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/imagepolicy/zz_generated.deepcopy.go +++ /dev/null @@ -1,105 +0,0 @@ -// +build !ignore_autogenerated - -/* -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. -*/ - -// This file was autogenerated by deepcopy-gen. Do not edit it manually! - -package imagepolicy - -import ( - api "k8s.io/client-go/pkg/api" - conversion "k8s.io/client-go/pkg/conversion" - runtime "k8s.io/client-go/pkg/runtime" - reflect "reflect" -) - -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_imagepolicy_ImageReview, InType: reflect.TypeOf(&ImageReview{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_imagepolicy_ImageReviewContainerSpec, InType: reflect.TypeOf(&ImageReviewContainerSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_imagepolicy_ImageReviewSpec, InType: reflect.TypeOf(&ImageReviewSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_imagepolicy_ImageReviewStatus, InType: reflect.TypeOf(&ImageReviewStatus{})}, - ) -} - -func DeepCopy_imagepolicy_ImageReview(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ImageReview) - out := out.(*ImageReview) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_imagepolicy_ImageReviewSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_imagepolicy_ImageReviewContainerSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ImageReviewContainerSpec) - out := out.(*ImageReviewContainerSpec) - out.Image = in.Image - return nil - } -} - -func DeepCopy_imagepolicy_ImageReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ImageReviewSpec) - out := out.(*ImageReviewSpec) - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]ImageReviewContainerSpec, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Containers = nil - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Annotations = nil - } - out.Namespace = in.Namespace - return nil - } -} - -func DeepCopy_imagepolicy_ImageReviewStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ImageReviewStatus) - out := out.(*ImageReviewStatus) - out.Allowed = in.Allowed - out.Reason = in.Reason - return nil - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/doc.go b/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/doc.go deleted file mode 100644 index 973b2e8c..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/doc.go +++ /dev/null @@ -1,18 +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. -*/ - -// +groupName=kubeadm.k8s.io -package kubeadm diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/env.go b/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/env.go deleted file mode 100644 index 687e89ed..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/env.go +++ /dev/null @@ -1,59 +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 kubeadm - -import ( - "fmt" - "os" - "runtime" - "strings" -) - -var GlobalEnvParams = SetEnvParams() - -// TODO(phase2) use componentconfig -// we need some params for testing etc, let's keep these hidden for now -func SetEnvParams() *EnvParams { - - envParams := map[string]string{ - // TODO(phase1+): Mode prefix and host_pki_path to another place as constants, and use them everywhere - // Right now they're used here and there, but not consequently - "kubernetes_dir": "/etc/kubernetes", - "host_pki_path": "/etc/kubernetes/pki", - "host_etcd_path": "/var/lib/etcd", - "hyperkube_image": "", - "discovery_image": fmt.Sprintf("gcr.io/google_containers/kube-discovery-%s:%s", runtime.GOARCH, "1.0"), - "etcd_image": "", - "component_loglevel": "--v=2", - } - - for k := range envParams { - if v := os.Getenv(fmt.Sprintf("KUBE_%s", strings.ToUpper(k))); v != "" { - envParams[k] = v - } - } - - return &EnvParams{ - KubernetesDir: envParams["kubernetes_dir"], - HostPKIPath: envParams["host_pki_path"], - HostEtcdPath: envParams["host_etcd_path"], - HyperkubeImage: envParams["hyperkube_image"], - DiscoveryImage: envParams["discovery_image"], - EtcdImage: envParams["etcd_image"], - ComponentLoglevel: envParams["component_loglevel"], - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/install/doc.go b/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/install/doc.go deleted file mode 100644 index 0ca2c59d..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/install/doc.go +++ /dev/null @@ -1,17 +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 install diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/install/install.go b/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/install/install.go deleted file mode 100644 index 88ff7b7f..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/install/install.go +++ /dev/null @@ -1,39 +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 install - -import ( - "k8s.io/client-go/pkg/apimachinery/announced" - "k8s.io/client-go/pkg/apis/kubeadm" - "k8s.io/client-go/pkg/apis/kubeadm/v1alpha1" -) - -func init() { - if err := announced.NewGroupMetaFactory( - &announced.GroupMetaFactoryArgs{ - GroupName: kubeadm.GroupName, - VersionPreferenceOrder: []string{v1alpha1.SchemeGroupVersion.Version}, - ImportPrefix: "k8s.io/client-go/pkg/apis/kubeadm", - AddInternalObjectsToScheme: kubeadm.AddToScheme, - }, - announced.VersionToSchemeFunc{ - v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme, - }, - ).Announce().RegisterAndEnable(); err != nil { - panic(err) - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/register.go b/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/register.go deleted file mode 100644 index ca88aba1..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/register.go +++ /dev/null @@ -1,60 +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 kubeadm - -import ( - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/runtime" -) - -// GroupName is the group name use in this package -const GroupName = "kubeadm.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -// Kind takes an unqualified kind and returns a Group qualified GroupKind -func Kind(kind string) unversioned.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) unversioned.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &MasterConfiguration{}, - &NodeConfiguration{}, - &ClusterInfo{}, - &api.ListOptions{}, - &api.DeleteOptions{}, - &api.ExportOptions{}, - ) - return nil -} - -func (obj *MasterConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } -func (obj *NodeConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } -func (obj *ClusterInfo) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/types.go b/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/types.go deleted file mode 100644 index f86f4ae4..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/types.go +++ /dev/null @@ -1,88 +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 kubeadm - -import "k8s.io/client-go/pkg/api/unversioned" - -type EnvParams struct { - KubernetesDir string - HostPKIPath string - HostEtcdPath string - HyperkubeImage string - DiscoveryImage string - EtcdImage string - ComponentLoglevel string -} - -type MasterConfiguration struct { - unversioned.TypeMeta - - Secrets Secrets - API API - Discovery Discovery - Etcd Etcd - Networking Networking - KubernetesVersion string - CloudProvider string -} - -type API struct { - AdvertiseAddresses []string - ExternalDNSNames []string - BindPort int32 -} - -type Discovery struct { - BindPort int32 -} - -type Networking struct { - ServiceSubnet string - PodSubnet string - DNSDomain string -} - -type Etcd struct { - Endpoints []string - CAFile string - CertFile string - KeyFile string -} - -type Secrets struct { - GivenToken string // dot-separated `.` set by the user - TokenID string // optional on master side, will be generated if not specified - Token []byte // optional on master side, will be generated if not specified - BearerToken string // set based on Token -} - -type NodeConfiguration struct { - unversioned.TypeMeta - - MasterAddresses []string - Secrets Secrets - APIPort int32 - DiscoveryPort int32 -} - -// ClusterInfo TODO add description -type ClusterInfo struct { - unversioned.TypeMeta - // TODO(phase1+) this may become simply `api.Config` - CertificateAuthorities []string `json:"certificateAuthorities"` - Endpoints []string `json:"endpoints"` -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/defaults.go b/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/defaults.go deleted file mode 100644 index 74d3ec2a..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/defaults.go +++ /dev/null @@ -1,69 +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 v1alpha1 - -import ( - "k8s.io/client-go/pkg/runtime" -) - -const ( - DefaultServiceDNSDomain = "cluster.local" - DefaultServicesSubnet = "10.96.0.0/12" - DefaultKubernetesVersion = "v1.4.4" - DefaultAPIBindPort = 6443 - DefaultDiscoveryBindPort = 9898 -) - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - RegisterDefaults(scheme) - return scheme.AddDefaultingFuncs( - SetDefaults_MasterConfiguration, - SetDefaults_NodeConfiguration, - ) -} - -func SetDefaults_MasterConfiguration(obj *MasterConfiguration) { - if obj.KubernetesVersion == "" { - obj.KubernetesVersion = DefaultKubernetesVersion - } - - if obj.API.BindPort == 0 { - obj.API.BindPort = DefaultAPIBindPort - } - - if obj.Discovery.BindPort == 0 { - obj.Discovery.BindPort = DefaultDiscoveryBindPort - } - - if obj.Networking.ServiceSubnet == "" { - obj.Networking.ServiceSubnet = DefaultServicesSubnet - } - - if obj.Networking.DNSDomain == "" { - obj.Networking.DNSDomain = DefaultServiceDNSDomain - } -} - -func SetDefaults_NodeConfiguration(obj *NodeConfiguration) { - if obj.APIPort == 0 { - obj.APIPort = DefaultAPIBindPort - } - - if obj.DiscoveryPort == 0 { - obj.DiscoveryPort = DefaultDiscoveryBindPort - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/doc.go b/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/doc.go deleted file mode 100644 index 7ca9c7c2..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/doc.go +++ /dev/null @@ -1,19 +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. -*/ - -// +k8s:defaulter-gen=TypeMeta -// +groupName=kubeadm.k8s.io -package v1alpha1 diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/register.go b/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/register.go deleted file mode 100644 index 924209fb..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/register.go +++ /dev/null @@ -1,60 +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 v1alpha1 - -import ( - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/api/v1" - "k8s.io/client-go/pkg/runtime" -) - -// GroupName is the group name use in this package -const GroupName = "kubeadm.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1alpha1"} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs) - AddToScheme = SchemeBuilder.AddToScheme -) - -// Kind takes an unqualified kind and returns a Group qualified GroupKind -func Kind(kind string) unversioned.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) unversioned.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &MasterConfiguration{}, - &NodeConfiguration{}, - &ClusterInfo{}, - &v1.ListOptions{}, - &v1.DeleteOptions{}, - &v1.ExportOptions{}, - ) - return nil -} - -func (obj *MasterConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } -func (obj *NodeConfiguration) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } -func (obj *ClusterInfo) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/types.go b/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/types.go deleted file mode 100644 index ecd80465..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/types.go +++ /dev/null @@ -1,78 +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 v1alpha1 - -import "k8s.io/client-go/pkg/api/unversioned" - -type MasterConfiguration struct { - unversioned.TypeMeta `json:",inline"` - - Secrets Secrets `json:"secrets"` - API API `json:"api"` - Etcd Etcd `json:"etcd"` - Discovery Discovery `json:"discovery"` - Networking Networking `json:"networking"` - KubernetesVersion string `json:"kubernetesVersion"` - CloudProvider string `json:"cloudProvider"` -} - -type API struct { - AdvertiseAddresses []string `json:"advertiseAddresses"` - ExternalDNSNames []string `json:"externalDNSNames"` - BindPort int32 `json:"bindPort"` -} - -type Discovery struct { - BindPort int32 `json:"bindPort"` -} - -type Networking struct { - ServiceSubnet string `json:"serviceSubnet"` - PodSubnet string `json:"podSubnet"` - DNSDomain string `json:"dnsDomain"` -} - -type Etcd struct { - Endpoints []string `json:"endpoints"` - CAFile string `json:"caFile"` - CertFile string `json:"certFile"` - KeyFile string `json:"keyFile"` -} - -type Secrets struct { - GivenToken string `json:"givenToken"` // dot-separated `.` set by the user - TokenID string `json:"tokenID"` // optional on master side, will be generated if not specified - Token []byte `json:"token"` // optional on master side, will be generated if not specified - BearerToken string `json:"bearerToken"` // set based on Token -} - -type NodeConfiguration struct { - unversioned.TypeMeta `json:",inline"` - - MasterAddresses []string `json:"masterAddresses"` - Secrets Secrets `json:"secrets"` - APIPort int32 `json:"apiPort"` - DiscoveryPort int32 `json:"discoveryPort"` -} - -// ClusterInfo TODO add description -type ClusterInfo struct { - unversioned.TypeMeta `json:",inline"` - // TODO(phase1+) this may become simply `api.Config` - CertificateAuthorities []string `json:"certificateAuthorities"` - Endpoints []string `json:"endpoints"` -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/zz_generated.defaults.go b/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/zz_generated.defaults.go deleted file mode 100644 index 0f6162b0..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/zz_generated.defaults.go +++ /dev/null @@ -1,42 +0,0 @@ -// +build !ignore_autogenerated - -/* -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. -*/ - -// This file was autogenerated by defaulter-gen. Do not edit it manually! - -package v1alpha1 - -import ( - runtime "k8s.io/client-go/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(&MasterConfiguration{}, func(obj interface{}) { SetObjectDefaults_MasterConfiguration(obj.(*MasterConfiguration)) }) - scheme.AddTypeDefaultingFunc(&NodeConfiguration{}, func(obj interface{}) { SetObjectDefaults_NodeConfiguration(obj.(*NodeConfiguration)) }) - return nil -} - -func SetObjectDefaults_MasterConfiguration(in *MasterConfiguration) { - SetDefaults_MasterConfiguration(in) -} - -func SetObjectDefaults_NodeConfiguration(in *NodeConfiguration) { - SetDefaults_NodeConfiguration(in) -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/doc.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/doc.go deleted file mode 100644 index 7a45fb7b..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/doc.go +++ /dev/null @@ -1,19 +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. -*/ - -// +k8s:deepcopy-gen=package,register - -package federation diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/install/install.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/install/install.go deleted file mode 100644 index 506713a2..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/install/install.go +++ /dev/null @@ -1,134 +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 install - -import ( - "fmt" - - "github.com/golang/glog" - - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/meta" - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/apimachinery" - "k8s.io/client-go/pkg/apimachinery/registered" - "k8s.io/client-go/pkg/federation/apis/federation" - "k8s.io/client-go/pkg/federation/apis/federation/v1beta1" - "k8s.io/client-go/pkg/runtime" - "k8s.io/client-go/pkg/util/sets" -) - -const importPrefix = "k8s.io/client-go/pkg/federation/apis/federation" - -var accessor = meta.NewAccessor() - -// availableVersions lists all known external versions for this group from most preferred to least preferred -var availableVersions = []unversioned.GroupVersion{v1beta1.SchemeGroupVersion} - -func init() { - registered.RegisterVersions(availableVersions) - externalVersions := []unversioned.GroupVersion{} - for _, v := range availableVersions { - if registered.IsAllowedVersion(v) { - externalVersions = append(externalVersions, v) - } - } - if len(externalVersions) == 0 { - glog.V(4).Infof("No version is registered for group %v", federation.GroupName) - return - } - - if err := registered.EnableVersions(externalVersions...); err != nil { - glog.V(4).Infof("%v", err) - return - } - if err := enableVersions(externalVersions); err != nil { - glog.V(4).Infof("%v", err) - return - } -} - -// TODO: enableVersions should be centralized rather than spread in each API -// group. -// We can combine registered.RegisterVersions, registered.EnableVersions and -// registered.RegisterGroup once we have moved enableVersions there. -func enableVersions(externalVersions []unversioned.GroupVersion) error { - addVersionsToScheme(externalVersions...) - preferredExternalVersion := externalVersions[0] - - groupMeta := apimachinery.GroupMeta{ - GroupVersion: preferredExternalVersion, - GroupVersions: externalVersions, - RESTMapper: newRESTMapper(externalVersions), - SelfLinker: runtime.SelfLinker(accessor), - InterfacesFor: interfacesFor, - } - - if err := registered.RegisterGroup(groupMeta); err != nil { - return err - } - return nil -} - -func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper { - // the list of kinds that are scoped at the root of the api hierarchy - // if a kind is not enumerated here, it is assumed to have a namespace scope - rootScoped := sets.NewString( - "Cluster", - ) - - ignoredKinds := sets.NewString() - - return api.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped) -} - -// interfacesFor returns the default Codec and ResourceVersioner for a given version -// string, or an error if the version is not known. -func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, error) { - switch version { - case v1beta1.SchemeGroupVersion: - return &meta.VersionInterfaces{ - ObjectConvertor: api.Scheme, - MetadataAccessor: accessor, - }, nil - default: - g, _ := registered.Group(federation.GroupName) - return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions) - } -} - -func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) { - // add the internal version to Scheme - if err := federation.AddToScheme(api.Scheme); err != nil { - // Programmer error, detect immediately - panic(err) - } - // add the enabled external versions to Scheme - for _, v := range externalVersions { - if !registered.IsEnabledVersion(v) { - glog.Errorf("Version %s is not enabled, so it will not be added to the Scheme.", v) - continue - } - switch v { - case v1beta1.SchemeGroupVersion: - if err := v1beta1.AddToScheme(api.Scheme); err != nil { - // Programmer error, detect immediately - panic(err) - } - } - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/register.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/register.go deleted file mode 100644 index 8a669a1c..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/register.go +++ /dev/null @@ -1,57 +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 federation - -import ( - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/runtime" -) - -// GroupName is the group name use in this package -const GroupName = "federation" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - -// Kind takes an unqualified kind and returns a Group qualified GroupKind -func Kind(kind string) unversioned.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) unversioned.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &Cluster{}, - &ClusterList{}, - &api.ListOptions{}, - &api.DeleteOptions{}, - ) - return nil -} - -func (obj *Cluster) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } -func (obj *ClusterList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/types.generated.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/types.generated.go deleted file mode 100644 index 2113488b..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/types.generated.go +++ /dev/null @@ -1,2954 +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. -*/ - -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ - -package federation - -import ( - "errors" - "fmt" - codec1978 "github.com/ugorji/go/codec" - pkg1_api "k8s.io/client-go/pkg/api" - pkg2_unversioned "k8s.io/client-go/pkg/api/unversioned" - pkg3_types "k8s.io/client-go/pkg/types" - "reflect" - "runtime" - time "time" -) - -const ( - // ----- content types ---- - codecSelferC_UTF81234 = 1 - codecSelferC_RAW1234 = 0 - // ----- value types used ---- - codecSelferValueTypeArray1234 = 10 - codecSelferValueTypeMap1234 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey1234 = 2 - codecSelfer_containerMapValue1234 = 3 - codecSelfer_containerMapEnd1234 = 4 - codecSelfer_containerArrayElem1234 = 6 - codecSelfer_containerArrayEnd1234 = 7 -) - -var ( - codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`) -) - -type codecSelfer1234 struct{} - -func init() { - if codec1978.GenVersion != 5 { - _, file, _, _ := runtime.Caller(0) - err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) - panic(err) - } - if false { // reference the types, but skip this branch at build/run time - var v0 pkg1_api.LocalObjectReference - var v1 pkg2_unversioned.Time - var v2 pkg3_types.UID - var v3 time.Time - _, _, _, _ = v0, v1, v2, v3 - } -} - -func (x *ServerAddressByClientCIDR) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ClientCIDR)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("clientCIDR")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ClientCIDR)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ServerAddress)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("serverAddress")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ServerAddress)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ServerAddressByClientCIDR) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct10 := r.ContainerType() - if yyct10 == codecSelferValueTypeMap1234 { - yyl10 := r.ReadMapStart() - if yyl10 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl10, d) - } - } else if yyct10 == codecSelferValueTypeArray1234 { - yyl10 := r.ReadArrayStart() - if yyl10 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl10, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ServerAddressByClientCIDR) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys11Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys11Slc - var yyhl11 bool = l >= 0 - for yyj11 := 0; ; yyj11++ { - if yyhl11 { - if yyj11 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys11Slc = r.DecodeBytes(yys11Slc, true, true) - yys11 := string(yys11Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys11 { - case "clientCIDR": - if r.TryDecodeAsNil() { - x.ClientCIDR = "" - } else { - x.ClientCIDR = string(r.DecodeString()) - } - case "serverAddress": - if r.TryDecodeAsNil() { - x.ServerAddress = "" - } else { - x.ServerAddress = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys11) - } // end switch yys11 - } // end for yyj11 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ServerAddressByClientCIDR) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ClientCIDR = "" - } else { - x.ClientCIDR = string(r.DecodeString()) - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ServerAddress = "" - } else { - x.ServerAddress = string(r.DecodeString()) - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ClusterSpec) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym17 := z.EncBinary() - _ = yym17 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep18 := !z.EncBinary() - yy2arr18 := z.EncBasicHandle().StructToArray - var yyq18 [2]bool - _, _, _ = yysep18, yyq18, yy2arr18 - const yyr18 bool = false - yyq18[1] = x.SecretRef != nil - var yynn18 int - if yyr18 || yy2arr18 { - r.EncodeArrayStart(2) - } else { - yynn18 = 1 - for _, b := range yyq18 { - if b { - yynn18++ - } - } - r.EncodeMapStart(yynn18) - yynn18 = 0 - } - if yyr18 || yy2arr18 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.ServerAddressByClientCIDRs == nil { - r.EncodeNil() - } else { - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - h.encSliceServerAddressByClientCIDR(([]ServerAddressByClientCIDR)(x.ServerAddressByClientCIDRs), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("serverAddressByClientCIDRs")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.ServerAddressByClientCIDRs == nil { - r.EncodeNil() - } else { - yym21 := z.EncBinary() - _ = yym21 - if false { - } else { - h.encSliceServerAddressByClientCIDR(([]ServerAddressByClientCIDR)(x.ServerAddressByClientCIDRs), e) - } - } - } - if yyr18 || yy2arr18 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq18[1] { - if x.SecretRef == nil { - r.EncodeNil() - } else { - x.SecretRef.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } else { - if yyq18[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("secretRef")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.SecretRef == nil { - r.EncodeNil() - } else { - x.SecretRef.CodecEncodeSelf(e) - } - } - } - if yyr18 || yy2arr18 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterSpec) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym23 := z.DecBinary() - _ = yym23 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct24 := r.ContainerType() - if yyct24 == codecSelferValueTypeMap1234 { - yyl24 := r.ReadMapStart() - if yyl24 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl24, d) - } - } else if yyct24 == codecSelferValueTypeArray1234 { - yyl24 := r.ReadArrayStart() - if yyl24 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl24, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys25Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys25Slc - var yyhl25 bool = l >= 0 - for yyj25 := 0; ; yyj25++ { - if yyhl25 { - if yyj25 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys25Slc = r.DecodeBytes(yys25Slc, true, true) - yys25 := string(yys25Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys25 { - case "serverAddressByClientCIDRs": - if r.TryDecodeAsNil() { - x.ServerAddressByClientCIDRs = nil - } else { - yyv26 := &x.ServerAddressByClientCIDRs - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - h.decSliceServerAddressByClientCIDR((*[]ServerAddressByClientCIDR)(yyv26), d) - } - } - case "secretRef": - if r.TryDecodeAsNil() { - if x.SecretRef != nil { - x.SecretRef = nil - } - } else { - if x.SecretRef == nil { - x.SecretRef = new(pkg1_api.LocalObjectReference) - } - x.SecretRef.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys25) - } // end switch yys25 - } // end for yyj25 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj29 int - var yyb29 bool - var yyhl29 bool = l >= 0 - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l - } else { - yyb29 = r.CheckBreak() - } - if yyb29 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ServerAddressByClientCIDRs = nil - } else { - yyv30 := &x.ServerAddressByClientCIDRs - yym31 := z.DecBinary() - _ = yym31 - if false { - } else { - h.decSliceServerAddressByClientCIDR((*[]ServerAddressByClientCIDR)(yyv30), d) - } - } - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l - } else { - yyb29 = r.CheckBreak() - } - if yyb29 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.SecretRef != nil { - x.SecretRef = nil - } - } else { - if x.SecretRef == nil { - x.SecretRef = new(pkg1_api.LocalObjectReference) - } - x.SecretRef.CodecDecodeSelf(d) - } - for { - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l - } else { - yyb29 = r.CheckBreak() - } - if yyb29 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj29-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x ClusterConditionType) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym33 := z.EncBinary() - _ = yym33 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) - } -} - -func (x *ClusterConditionType) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym34 := z.DecBinary() - _ = yym34 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - -func (x *ClusterCondition) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym35 := z.EncBinary() - _ = yym35 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep36 := !z.EncBinary() - yy2arr36 := z.EncBasicHandle().StructToArray - var yyq36 [6]bool - _, _, _ = yysep36, yyq36, yy2arr36 - const yyr36 bool = false - yyq36[2] = true - yyq36[3] = true - yyq36[4] = x.Reason != "" - yyq36[5] = x.Message != "" - var yynn36 int - if yyr36 || yy2arr36 { - r.EncodeArrayStart(6) - } else { - yynn36 = 2 - for _, b := range yyq36 { - if b { - yynn36++ - } - } - r.EncodeMapStart(yynn36) - yynn36 = 0 - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - x.Type.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("type")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - x.Type.CodecEncodeSelf(e) - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym39 := z.EncBinary() - _ = yym39 - if false { - } else if z.HasExtensions() && z.EncExt(x.Status) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Status)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym40 := z.EncBinary() - _ = yym40 - if false { - } else if z.HasExtensions() && z.EncExt(x.Status) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Status)) - } - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq36[2] { - yy42 := &x.LastProbeTime - yym43 := z.EncBinary() - _ = yym43 - if false { - } else if z.HasExtensions() && z.EncExt(yy42) { - } else if yym43 { - z.EncBinaryMarshal(yy42) - } else if !yym43 && z.IsJSONHandle() { - z.EncJSONMarshal(yy42) - } else { - z.EncFallback(yy42) - } - } else { - r.EncodeNil() - } - } else { - if yyq36[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("lastProbeTime")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy44 := &x.LastProbeTime - yym45 := z.EncBinary() - _ = yym45 - if false { - } else if z.HasExtensions() && z.EncExt(yy44) { - } else if yym45 { - z.EncBinaryMarshal(yy44) - } else if !yym45 && z.IsJSONHandle() { - z.EncJSONMarshal(yy44) - } else { - z.EncFallback(yy44) - } - } - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq36[3] { - yy47 := &x.LastTransitionTime - yym48 := z.EncBinary() - _ = yym48 - if false { - } else if z.HasExtensions() && z.EncExt(yy47) { - } else if yym48 { - z.EncBinaryMarshal(yy47) - } else if !yym48 && z.IsJSONHandle() { - z.EncJSONMarshal(yy47) - } else { - z.EncFallback(yy47) - } - } else { - r.EncodeNil() - } - } else { - if yyq36[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("lastTransitionTime")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy49 := &x.LastTransitionTime - yym50 := z.EncBinary() - _ = yym50 - if false { - } else if z.HasExtensions() && z.EncExt(yy49) { - } else if yym50 { - z.EncBinaryMarshal(yy49) - } else if !yym50 && z.IsJSONHandle() { - z.EncJSONMarshal(yy49) - } else { - z.EncFallback(yy49) - } - } - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq36[4] { - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq36[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("reason")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym53 := z.EncBinary() - _ = yym53 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) - } - } - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq36[5] { - yym55 := z.EncBinary() - _ = yym55 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Message)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq36[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("message")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym56 := z.EncBinary() - _ = yym56 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Message)) - } - } - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterCondition) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym57 := z.DecBinary() - _ = yym57 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct58 := r.ContainerType() - if yyct58 == codecSelferValueTypeMap1234 { - yyl58 := r.ReadMapStart() - if yyl58 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl58, d) - } - } else if yyct58 == codecSelferValueTypeArray1234 { - yyl58 := r.ReadArrayStart() - if yyl58 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl58, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys59Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys59Slc - var yyhl59 bool = l >= 0 - for yyj59 := 0; ; yyj59++ { - if yyhl59 { - if yyj59 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys59Slc = r.DecodeBytes(yys59Slc, true, true) - yys59 := string(yys59Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys59 { - case "type": - if r.TryDecodeAsNil() { - x.Type = "" - } else { - x.Type = ClusterConditionType(r.DecodeString()) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - x.Status = pkg1_api.ConditionStatus(r.DecodeString()) - } - case "lastProbeTime": - if r.TryDecodeAsNil() { - x.LastProbeTime = pkg2_unversioned.Time{} - } else { - yyv62 := &x.LastProbeTime - yym63 := z.DecBinary() - _ = yym63 - if false { - } else if z.HasExtensions() && z.DecExt(yyv62) { - } else if yym63 { - z.DecBinaryUnmarshal(yyv62) - } else if !yym63 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv62) - } else { - z.DecFallback(yyv62, false) - } - } - case "lastTransitionTime": - if r.TryDecodeAsNil() { - x.LastTransitionTime = pkg2_unversioned.Time{} - } else { - yyv64 := &x.LastTransitionTime - yym65 := z.DecBinary() - _ = yym65 - if false { - } else if z.HasExtensions() && z.DecExt(yyv64) { - } else if yym65 { - z.DecBinaryUnmarshal(yyv64) - } else if !yym65 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv64) - } else { - z.DecFallback(yyv64, false) - } - } - case "reason": - if r.TryDecodeAsNil() { - x.Reason = "" - } else { - x.Reason = string(r.DecodeString()) - } - case "message": - if r.TryDecodeAsNil() { - x.Message = "" - } else { - x.Message = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys59) - } // end switch yys59 - } // end for yyj59 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj68 int - var yyb68 bool - var yyhl68 bool = l >= 0 - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Type = "" - } else { - x.Type = ClusterConditionType(r.DecodeString()) - } - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = "" - } else { - x.Status = pkg1_api.ConditionStatus(r.DecodeString()) - } - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.LastProbeTime = pkg2_unversioned.Time{} - } else { - yyv71 := &x.LastProbeTime - yym72 := z.DecBinary() - _ = yym72 - if false { - } else if z.HasExtensions() && z.DecExt(yyv71) { - } else if yym72 { - z.DecBinaryUnmarshal(yyv71) - } else if !yym72 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv71) - } else { - z.DecFallback(yyv71, false) - } - } - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.LastTransitionTime = pkg2_unversioned.Time{} - } else { - yyv73 := &x.LastTransitionTime - yym74 := z.DecBinary() - _ = yym74 - if false { - } else if z.HasExtensions() && z.DecExt(yyv73) { - } else if yym74 { - z.DecBinaryUnmarshal(yyv73) - } else if !yym74 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv73) - } else { - z.DecFallback(yyv73, false) - } - } - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Reason = "" - } else { - x.Reason = string(r.DecodeString()) - } - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Message = "" - } else { - x.Message = string(r.DecodeString()) - } - for { - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj68-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym77 := z.EncBinary() - _ = yym77 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep78 := !z.EncBinary() - yy2arr78 := z.EncBasicHandle().StructToArray - var yyq78 [3]bool - _, _, _ = yysep78, yyq78, yy2arr78 - const yyr78 bool = false - yyq78[0] = len(x.Conditions) != 0 - yyq78[1] = len(x.Zones) != 0 - yyq78[2] = x.Region != "" - var yynn78 int - if yyr78 || yy2arr78 { - r.EncodeArrayStart(3) - } else { - yynn78 = 0 - for _, b := range yyq78 { - if b { - yynn78++ - } - } - r.EncodeMapStart(yynn78) - yynn78 = 0 - } - if yyr78 || yy2arr78 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq78[0] { - if x.Conditions == nil { - r.EncodeNil() - } else { - yym80 := z.EncBinary() - _ = yym80 - if false { - } else { - h.encSliceClusterCondition(([]ClusterCondition)(x.Conditions), e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq78[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("conditions")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Conditions == nil { - r.EncodeNil() - } else { - yym81 := z.EncBinary() - _ = yym81 - if false { - } else { - h.encSliceClusterCondition(([]ClusterCondition)(x.Conditions), e) - } - } - } - } - if yyr78 || yy2arr78 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq78[1] { - if x.Zones == nil { - r.EncodeNil() - } else { - yym83 := z.EncBinary() - _ = yym83 - if false { - } else { - z.F.EncSliceStringV(x.Zones, false, e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq78[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("zones")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Zones == nil { - r.EncodeNil() - } else { - yym84 := z.EncBinary() - _ = yym84 - if false { - } else { - z.F.EncSliceStringV(x.Zones, false, e) - } - } - } - } - if yyr78 || yy2arr78 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq78[2] { - yym86 := z.EncBinary() - _ = yym86 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Region)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq78[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("region")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym87 := z.EncBinary() - _ = yym87 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Region)) - } - } - } - if yyr78 || yy2arr78 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterStatus) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym88 := z.DecBinary() - _ = yym88 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct89 := r.ContainerType() - if yyct89 == codecSelferValueTypeMap1234 { - yyl89 := r.ReadMapStart() - if yyl89 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl89, d) - } - } else if yyct89 == codecSelferValueTypeArray1234 { - yyl89 := r.ReadArrayStart() - if yyl89 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl89, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys90Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys90Slc - var yyhl90 bool = l >= 0 - for yyj90 := 0; ; yyj90++ { - if yyhl90 { - if yyj90 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys90Slc = r.DecodeBytes(yys90Slc, true, true) - yys90 := string(yys90Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys90 { - case "conditions": - if r.TryDecodeAsNil() { - x.Conditions = nil - } else { - yyv91 := &x.Conditions - yym92 := z.DecBinary() - _ = yym92 - if false { - } else { - h.decSliceClusterCondition((*[]ClusterCondition)(yyv91), d) - } - } - case "zones": - if r.TryDecodeAsNil() { - x.Zones = nil - } else { - yyv93 := &x.Zones - yym94 := z.DecBinary() - _ = yym94 - if false { - } else { - z.F.DecSliceStringX(yyv93, false, d) - } - } - case "region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - x.Region = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys90) - } // end switch yys90 - } // end for yyj90 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj96 int - var yyb96 bool - var yyhl96 bool = l >= 0 - yyj96++ - if yyhl96 { - yyb96 = yyj96 > l - } else { - yyb96 = r.CheckBreak() - } - if yyb96 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Conditions = nil - } else { - yyv97 := &x.Conditions - yym98 := z.DecBinary() - _ = yym98 - if false { - } else { - h.decSliceClusterCondition((*[]ClusterCondition)(yyv97), d) - } - } - yyj96++ - if yyhl96 { - yyb96 = yyj96 > l - } else { - yyb96 = r.CheckBreak() - } - if yyb96 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Zones = nil - } else { - yyv99 := &x.Zones - yym100 := z.DecBinary() - _ = yym100 - if false { - } else { - z.F.DecSliceStringX(yyv99, false, d) - } - } - yyj96++ - if yyhl96 { - yyb96 = yyj96 > l - } else { - yyb96 = r.CheckBreak() - } - if yyb96 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - x.Region = string(r.DecodeString()) - } - for { - yyj96++ - if yyhl96 { - yyb96 = yyj96 > l - } else { - yyb96 = r.CheckBreak() - } - if yyb96 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj96-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *Cluster) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym102 := z.EncBinary() - _ = yym102 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep103 := !z.EncBinary() - yy2arr103 := z.EncBasicHandle().StructToArray - var yyq103 [5]bool - _, _, _ = yysep103, yyq103, yy2arr103 - const yyr103 bool = false - yyq103[0] = x.Kind != "" - yyq103[1] = x.APIVersion != "" - yyq103[2] = true - yyq103[3] = true - yyq103[4] = true - var yynn103 int - if yyr103 || yy2arr103 { - r.EncodeArrayStart(5) - } else { - yynn103 = 0 - for _, b := range yyq103 { - if b { - yynn103++ - } - } - r.EncodeMapStart(yynn103) - yynn103 = 0 - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq103[0] { - yym105 := z.EncBinary() - _ = yym105 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq103[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym106 := z.EncBinary() - _ = yym106 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq103[1] { - yym108 := z.EncBinary() - _ = yym108 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq103[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym109 := z.EncBinary() - _ = yym109 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq103[2] { - yy111 := &x.ObjectMeta - yy111.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq103[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy112 := &x.ObjectMeta - yy112.CodecEncodeSelf(e) - } - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq103[3] { - yy114 := &x.Spec - yy114.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq103[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy115 := &x.Spec - yy115.CodecEncodeSelf(e) - } - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq103[4] { - yy117 := &x.Status - yy117.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq103[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy118 := &x.Status - yy118.CodecEncodeSelf(e) - } - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *Cluster) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym119 := z.DecBinary() - _ = yym119 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct120 := r.ContainerType() - if yyct120 == codecSelferValueTypeMap1234 { - yyl120 := r.ReadMapStart() - if yyl120 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl120, d) - } - } else if yyct120 == codecSelferValueTypeArray1234 { - yyl120 := r.ReadArrayStart() - if yyl120 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl120, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *Cluster) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys121Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys121Slc - var yyhl121 bool = l >= 0 - for yyj121 := 0; ; yyj121++ { - if yyhl121 { - if yyj121 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys121Slc = r.DecodeBytes(yys121Slc, true, true) - yys121 := string(yys121Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys121 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg1_api.ObjectMeta{} - } else { - yyv124 := &x.ObjectMeta - yyv124.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ClusterSpec{} - } else { - yyv125 := &x.Spec - yyv125.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ClusterStatus{} - } else { - yyv126 := &x.Status - yyv126.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys121) - } // end switch yys121 - } // end for yyj121 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *Cluster) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj127 int - var yyb127 bool - var yyhl127 bool = l >= 0 - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg1_api.ObjectMeta{} - } else { - yyv130 := &x.ObjectMeta - yyv130.CodecDecodeSelf(d) - } - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ClusterSpec{} - } else { - yyv131 := &x.Spec - yyv131.CodecDecodeSelf(d) - } - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ClusterStatus{} - } else { - yyv132 := &x.Status - yyv132.CodecDecodeSelf(d) - } - for { - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj127-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ClusterList) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym133 := z.EncBinary() - _ = yym133 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep134 := !z.EncBinary() - yy2arr134 := z.EncBasicHandle().StructToArray - var yyq134 [4]bool - _, _, _ = yysep134, yyq134, yy2arr134 - const yyr134 bool = false - yyq134[0] = x.Kind != "" - yyq134[1] = x.APIVersion != "" - yyq134[2] = true - var yynn134 int - if yyr134 || yy2arr134 { - r.EncodeArrayStart(4) - } else { - yynn134 = 1 - for _, b := range yyq134 { - if b { - yynn134++ - } - } - r.EncodeMapStart(yynn134) - yynn134 = 0 - } - if yyr134 || yy2arr134 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq134[0] { - yym136 := z.EncBinary() - _ = yym136 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq134[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym137 := z.EncBinary() - _ = yym137 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr134 || yy2arr134 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq134[1] { - yym139 := z.EncBinary() - _ = yym139 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq134[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym140 := z.EncBinary() - _ = yym140 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr134 || yy2arr134 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq134[2] { - yy142 := &x.ListMeta - yym143 := z.EncBinary() - _ = yym143 - if false { - } else if z.HasExtensions() && z.EncExt(yy142) { - } else { - z.EncFallback(yy142) - } - } else { - r.EncodeNil() - } - } else { - if yyq134[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy144 := &x.ListMeta - yym145 := z.EncBinary() - _ = yym145 - if false { - } else if z.HasExtensions() && z.EncExt(yy144) { - } else { - z.EncFallback(yy144) - } - } - } - if yyr134 || yy2arr134 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym147 := z.EncBinary() - _ = yym147 - if false { - } else { - h.encSliceCluster(([]Cluster)(x.Items), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym148 := z.EncBinary() - _ = yym148 - if false { - } else { - h.encSliceCluster(([]Cluster)(x.Items), e) - } - } - } - if yyr134 || yy2arr134 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterList) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym149 := z.DecBinary() - _ = yym149 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct150 := r.ContainerType() - if yyct150 == codecSelferValueTypeMap1234 { - yyl150 := r.ReadMapStart() - if yyl150 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl150, d) - } - } else if yyct150 == codecSelferValueTypeArray1234 { - yyl150 := r.ReadArrayStart() - if yyl150 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl150, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys151Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys151Slc - var yyhl151 bool = l >= 0 - for yyj151 := 0; ; yyj151++ { - if yyhl151 { - if yyj151 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys151Slc = r.DecodeBytes(yys151Slc, true, true) - yys151 := string(yys151Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys151 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv154 := &x.ListMeta - yym155 := z.DecBinary() - _ = yym155 - if false { - } else if z.HasExtensions() && z.DecExt(yyv154) { - } else { - z.DecFallback(yyv154, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv156 := &x.Items - yym157 := z.DecBinary() - _ = yym157 - if false { - } else { - h.decSliceCluster((*[]Cluster)(yyv156), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys151) - } // end switch yys151 - } // end for yyj151 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj158 int - var yyb158 bool - var yyhl158 bool = l >= 0 - yyj158++ - if yyhl158 { - yyb158 = yyj158 > l - } else { - yyb158 = r.CheckBreak() - } - if yyb158 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj158++ - if yyhl158 { - yyb158 = yyj158 > l - } else { - yyb158 = r.CheckBreak() - } - if yyb158 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj158++ - if yyhl158 { - yyb158 = yyj158 > l - } else { - yyb158 = r.CheckBreak() - } - if yyb158 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv161 := &x.ListMeta - yym162 := z.DecBinary() - _ = yym162 - if false { - } else if z.HasExtensions() && z.DecExt(yyv161) { - } else { - z.DecFallback(yyv161, false) - } - } - yyj158++ - if yyhl158 { - yyb158 = yyj158 > l - } else { - yyb158 = r.CheckBreak() - } - if yyb158 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv163 := &x.Items - yym164 := z.DecBinary() - _ = yym164 - if false { - } else { - h.decSliceCluster((*[]Cluster)(yyv163), d) - } - } - for { - yyj158++ - if yyhl158 { - yyb158 = yyj158 > l - } else { - yyb158 = r.CheckBreak() - } - if yyb158 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj158-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *FederatedReplicaSetPreferences) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym165 := z.EncBinary() - _ = yym165 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep166 := !z.EncBinary() - yy2arr166 := z.EncBasicHandle().StructToArray - var yyq166 [2]bool - _, _, _ = yysep166, yyq166, yy2arr166 - const yyr166 bool = false - yyq166[0] = x.Rebalance != false - yyq166[1] = len(x.Clusters) != 0 - var yynn166 int - if yyr166 || yy2arr166 { - r.EncodeArrayStart(2) - } else { - yynn166 = 0 - for _, b := range yyq166 { - if b { - yynn166++ - } - } - r.EncodeMapStart(yynn166) - yynn166 = 0 - } - if yyr166 || yy2arr166 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq166[0] { - yym168 := z.EncBinary() - _ = yym168 - if false { - } else { - r.EncodeBool(bool(x.Rebalance)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq166[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("rebalance")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym169 := z.EncBinary() - _ = yym169 - if false { - } else { - r.EncodeBool(bool(x.Rebalance)) - } - } - } - if yyr166 || yy2arr166 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq166[1] { - if x.Clusters == nil { - r.EncodeNil() - } else { - yym171 := z.EncBinary() - _ = yym171 - if false { - } else { - h.encMapstringClusterReplicaSetPreferences((map[string]ClusterReplicaSetPreferences)(x.Clusters), e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq166[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("clusters")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Clusters == nil { - r.EncodeNil() - } else { - yym172 := z.EncBinary() - _ = yym172 - if false { - } else { - h.encMapstringClusterReplicaSetPreferences((map[string]ClusterReplicaSetPreferences)(x.Clusters), e) - } - } - } - } - if yyr166 || yy2arr166 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *FederatedReplicaSetPreferences) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym173 := z.DecBinary() - _ = yym173 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct174 := r.ContainerType() - if yyct174 == codecSelferValueTypeMap1234 { - yyl174 := r.ReadMapStart() - if yyl174 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl174, d) - } - } else if yyct174 == codecSelferValueTypeArray1234 { - yyl174 := r.ReadArrayStart() - if yyl174 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl174, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *FederatedReplicaSetPreferences) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys175Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys175Slc - var yyhl175 bool = l >= 0 - for yyj175 := 0; ; yyj175++ { - if yyhl175 { - if yyj175 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys175Slc = r.DecodeBytes(yys175Slc, true, true) - yys175 := string(yys175Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys175 { - case "rebalance": - if r.TryDecodeAsNil() { - x.Rebalance = false - } else { - x.Rebalance = bool(r.DecodeBool()) - } - case "clusters": - if r.TryDecodeAsNil() { - x.Clusters = nil - } else { - yyv177 := &x.Clusters - yym178 := z.DecBinary() - _ = yym178 - if false { - } else { - h.decMapstringClusterReplicaSetPreferences((*map[string]ClusterReplicaSetPreferences)(yyv177), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys175) - } // end switch yys175 - } // end for yyj175 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *FederatedReplicaSetPreferences) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj179 int - var yyb179 bool - var yyhl179 bool = l >= 0 - yyj179++ - if yyhl179 { - yyb179 = yyj179 > l - } else { - yyb179 = r.CheckBreak() - } - if yyb179 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Rebalance = false - } else { - x.Rebalance = bool(r.DecodeBool()) - } - yyj179++ - if yyhl179 { - yyb179 = yyj179 > l - } else { - yyb179 = r.CheckBreak() - } - if yyb179 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Clusters = nil - } else { - yyv181 := &x.Clusters - yym182 := z.DecBinary() - _ = yym182 - if false { - } else { - h.decMapstringClusterReplicaSetPreferences((*map[string]ClusterReplicaSetPreferences)(yyv181), d) - } - } - for { - yyj179++ - if yyhl179 { - yyb179 = yyj179 > l - } else { - yyb179 = r.CheckBreak() - } - if yyb179 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj179-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ClusterReplicaSetPreferences) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym183 := z.EncBinary() - _ = yym183 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep184 := !z.EncBinary() - yy2arr184 := z.EncBasicHandle().StructToArray - var yyq184 [3]bool - _, _, _ = yysep184, yyq184, yy2arr184 - const yyr184 bool = false - yyq184[0] = x.MinReplicas != 0 - yyq184[1] = x.MaxReplicas != nil - var yynn184 int - if yyr184 || yy2arr184 { - r.EncodeArrayStart(3) - } else { - yynn184 = 1 - for _, b := range yyq184 { - if b { - yynn184++ - } - } - r.EncodeMapStart(yynn184) - yynn184 = 0 - } - if yyr184 || yy2arr184 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq184[0] { - yym186 := z.EncBinary() - _ = yym186 - if false { - } else { - r.EncodeInt(int64(x.MinReplicas)) - } - } else { - r.EncodeInt(0) - } - } else { - if yyq184[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("minReplicas")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym187 := z.EncBinary() - _ = yym187 - if false { - } else { - r.EncodeInt(int64(x.MinReplicas)) - } - } - } - if yyr184 || yy2arr184 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq184[1] { - if x.MaxReplicas == nil { - r.EncodeNil() - } else { - yy189 := *x.MaxReplicas - yym190 := z.EncBinary() - _ = yym190 - if false { - } else { - r.EncodeInt(int64(yy189)) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq184[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("maxReplicas")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.MaxReplicas == nil { - r.EncodeNil() - } else { - yy191 := *x.MaxReplicas - yym192 := z.EncBinary() - _ = yym192 - if false { - } else { - r.EncodeInt(int64(yy191)) - } - } - } - } - if yyr184 || yy2arr184 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym194 := z.EncBinary() - _ = yym194 - if false { - } else { - r.EncodeInt(int64(x.Weight)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("Weight")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym195 := z.EncBinary() - _ = yym195 - if false { - } else { - r.EncodeInt(int64(x.Weight)) - } - } - if yyr184 || yy2arr184 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterReplicaSetPreferences) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym196 := z.DecBinary() - _ = yym196 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct197 := r.ContainerType() - if yyct197 == codecSelferValueTypeMap1234 { - yyl197 := r.ReadMapStart() - if yyl197 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl197, d) - } - } else if yyct197 == codecSelferValueTypeArray1234 { - yyl197 := r.ReadArrayStart() - if yyl197 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl197, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterReplicaSetPreferences) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys198Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys198Slc - var yyhl198 bool = l >= 0 - for yyj198 := 0; ; yyj198++ { - if yyhl198 { - if yyj198 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys198Slc = r.DecodeBytes(yys198Slc, true, true) - yys198 := string(yys198Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys198 { - case "minReplicas": - if r.TryDecodeAsNil() { - x.MinReplicas = 0 - } else { - x.MinReplicas = int64(r.DecodeInt(64)) - } - case "maxReplicas": - if r.TryDecodeAsNil() { - if x.MaxReplicas != nil { - x.MaxReplicas = nil - } - } else { - if x.MaxReplicas == nil { - x.MaxReplicas = new(int64) - } - yym201 := z.DecBinary() - _ = yym201 - if false { - } else { - *((*int64)(x.MaxReplicas)) = int64(r.DecodeInt(64)) - } - } - case "Weight": - if r.TryDecodeAsNil() { - x.Weight = 0 - } else { - x.Weight = int64(r.DecodeInt(64)) - } - default: - z.DecStructFieldNotFound(-1, yys198) - } // end switch yys198 - } // end for yyj198 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterReplicaSetPreferences) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj203 int - var yyb203 bool - var yyhl203 bool = l >= 0 - yyj203++ - if yyhl203 { - yyb203 = yyj203 > l - } else { - yyb203 = r.CheckBreak() - } - if yyb203 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.MinReplicas = 0 - } else { - x.MinReplicas = int64(r.DecodeInt(64)) - } - yyj203++ - if yyhl203 { - yyb203 = yyj203 > l - } else { - yyb203 = r.CheckBreak() - } - if yyb203 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.MaxReplicas != nil { - x.MaxReplicas = nil - } - } else { - if x.MaxReplicas == nil { - x.MaxReplicas = new(int64) - } - yym206 := z.DecBinary() - _ = yym206 - if false { - } else { - *((*int64)(x.MaxReplicas)) = int64(r.DecodeInt(64)) - } - } - yyj203++ - if yyhl203 { - yyb203 = yyj203 > l - } else { - yyb203 = r.CheckBreak() - } - if yyb203 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Weight = 0 - } else { - x.Weight = int64(r.DecodeInt(64)) - } - for { - yyj203++ - if yyhl203 { - yyb203 = yyj203 > l - } else { - yyb203 = r.CheckBreak() - } - if yyb203 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj203-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) encSliceServerAddressByClientCIDR(v []ServerAddressByClientCIDR, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv208 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy209 := &yyv208 - yy209.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceServerAddressByClientCIDR(v *[]ServerAddressByClientCIDR, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv210 := *v - yyh210, yyl210 := z.DecSliceHelperStart() - var yyc210 bool - if yyl210 == 0 { - if yyv210 == nil { - yyv210 = []ServerAddressByClientCIDR{} - yyc210 = true - } else if len(yyv210) != 0 { - yyv210 = yyv210[:0] - yyc210 = true - } - } else if yyl210 > 0 { - var yyrr210, yyrl210 int - var yyrt210 bool - if yyl210 > cap(yyv210) { - - yyrg210 := len(yyv210) > 0 - yyv2210 := yyv210 - yyrl210, yyrt210 = z.DecInferLen(yyl210, z.DecBasicHandle().MaxInitLen, 32) - if yyrt210 { - if yyrl210 <= cap(yyv210) { - yyv210 = yyv210[:yyrl210] - } else { - yyv210 = make([]ServerAddressByClientCIDR, yyrl210) - } - } else { - yyv210 = make([]ServerAddressByClientCIDR, yyrl210) - } - yyc210 = true - yyrr210 = len(yyv210) - if yyrg210 { - copy(yyv210, yyv2210) - } - } else if yyl210 != len(yyv210) { - yyv210 = yyv210[:yyl210] - yyc210 = true - } - yyj210 := 0 - for ; yyj210 < yyrr210; yyj210++ { - yyh210.ElemContainerState(yyj210) - if r.TryDecodeAsNil() { - yyv210[yyj210] = ServerAddressByClientCIDR{} - } else { - yyv211 := &yyv210[yyj210] - yyv211.CodecDecodeSelf(d) - } - - } - if yyrt210 { - for ; yyj210 < yyl210; yyj210++ { - yyv210 = append(yyv210, ServerAddressByClientCIDR{}) - yyh210.ElemContainerState(yyj210) - if r.TryDecodeAsNil() { - yyv210[yyj210] = ServerAddressByClientCIDR{} - } else { - yyv212 := &yyv210[yyj210] - yyv212.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj210 := 0 - for ; !r.CheckBreak(); yyj210++ { - - if yyj210 >= len(yyv210) { - yyv210 = append(yyv210, ServerAddressByClientCIDR{}) // var yyz210 ServerAddressByClientCIDR - yyc210 = true - } - yyh210.ElemContainerState(yyj210) - if yyj210 < len(yyv210) { - if r.TryDecodeAsNil() { - yyv210[yyj210] = ServerAddressByClientCIDR{} - } else { - yyv213 := &yyv210[yyj210] - yyv213.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj210 < len(yyv210) { - yyv210 = yyv210[:yyj210] - yyc210 = true - } else if yyj210 == 0 && yyv210 == nil { - yyv210 = []ServerAddressByClientCIDR{} - yyc210 = true - } - } - yyh210.End() - if yyc210 { - *v = yyv210 - } -} - -func (x codecSelfer1234) encSliceClusterCondition(v []ClusterCondition, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv214 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy215 := &yyv214 - yy215.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceClusterCondition(v *[]ClusterCondition, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv216 := *v - yyh216, yyl216 := z.DecSliceHelperStart() - var yyc216 bool - if yyl216 == 0 { - if yyv216 == nil { - yyv216 = []ClusterCondition{} - yyc216 = true - } else if len(yyv216) != 0 { - yyv216 = yyv216[:0] - yyc216 = true - } - } else if yyl216 > 0 { - var yyrr216, yyrl216 int - var yyrt216 bool - if yyl216 > cap(yyv216) { - - yyrg216 := len(yyv216) > 0 - yyv2216 := yyv216 - yyrl216, yyrt216 = z.DecInferLen(yyl216, z.DecBasicHandle().MaxInitLen, 112) - if yyrt216 { - if yyrl216 <= cap(yyv216) { - yyv216 = yyv216[:yyrl216] - } else { - yyv216 = make([]ClusterCondition, yyrl216) - } - } else { - yyv216 = make([]ClusterCondition, yyrl216) - } - yyc216 = true - yyrr216 = len(yyv216) - if yyrg216 { - copy(yyv216, yyv2216) - } - } else if yyl216 != len(yyv216) { - yyv216 = yyv216[:yyl216] - yyc216 = true - } - yyj216 := 0 - for ; yyj216 < yyrr216; yyj216++ { - yyh216.ElemContainerState(yyj216) - if r.TryDecodeAsNil() { - yyv216[yyj216] = ClusterCondition{} - } else { - yyv217 := &yyv216[yyj216] - yyv217.CodecDecodeSelf(d) - } - - } - if yyrt216 { - for ; yyj216 < yyl216; yyj216++ { - yyv216 = append(yyv216, ClusterCondition{}) - yyh216.ElemContainerState(yyj216) - if r.TryDecodeAsNil() { - yyv216[yyj216] = ClusterCondition{} - } else { - yyv218 := &yyv216[yyj216] - yyv218.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj216 := 0 - for ; !r.CheckBreak(); yyj216++ { - - if yyj216 >= len(yyv216) { - yyv216 = append(yyv216, ClusterCondition{}) // var yyz216 ClusterCondition - yyc216 = true - } - yyh216.ElemContainerState(yyj216) - if yyj216 < len(yyv216) { - if r.TryDecodeAsNil() { - yyv216[yyj216] = ClusterCondition{} - } else { - yyv219 := &yyv216[yyj216] - yyv219.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj216 < len(yyv216) { - yyv216 = yyv216[:yyj216] - yyc216 = true - } else if yyj216 == 0 && yyv216 == nil { - yyv216 = []ClusterCondition{} - yyc216 = true - } - } - yyh216.End() - if yyc216 { - *v = yyv216 - } -} - -func (x codecSelfer1234) encSliceCluster(v []Cluster, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv220 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy221 := &yyv220 - yy221.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceCluster(v *[]Cluster, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv222 := *v - yyh222, yyl222 := z.DecSliceHelperStart() - var yyc222 bool - if yyl222 == 0 { - if yyv222 == nil { - yyv222 = []Cluster{} - yyc222 = true - } else if len(yyv222) != 0 { - yyv222 = yyv222[:0] - yyc222 = true - } - } else if yyl222 > 0 { - var yyrr222, yyrl222 int - var yyrt222 bool - if yyl222 > cap(yyv222) { - - yyrg222 := len(yyv222) > 0 - yyv2222 := yyv222 - yyrl222, yyrt222 = z.DecInferLen(yyl222, z.DecBasicHandle().MaxInitLen, 352) - if yyrt222 { - if yyrl222 <= cap(yyv222) { - yyv222 = yyv222[:yyrl222] - } else { - yyv222 = make([]Cluster, yyrl222) - } - } else { - yyv222 = make([]Cluster, yyrl222) - } - yyc222 = true - yyrr222 = len(yyv222) - if yyrg222 { - copy(yyv222, yyv2222) - } - } else if yyl222 != len(yyv222) { - yyv222 = yyv222[:yyl222] - yyc222 = true - } - yyj222 := 0 - for ; yyj222 < yyrr222; yyj222++ { - yyh222.ElemContainerState(yyj222) - if r.TryDecodeAsNil() { - yyv222[yyj222] = Cluster{} - } else { - yyv223 := &yyv222[yyj222] - yyv223.CodecDecodeSelf(d) - } - - } - if yyrt222 { - for ; yyj222 < yyl222; yyj222++ { - yyv222 = append(yyv222, Cluster{}) - yyh222.ElemContainerState(yyj222) - if r.TryDecodeAsNil() { - yyv222[yyj222] = Cluster{} - } else { - yyv224 := &yyv222[yyj222] - yyv224.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj222 := 0 - for ; !r.CheckBreak(); yyj222++ { - - if yyj222 >= len(yyv222) { - yyv222 = append(yyv222, Cluster{}) // var yyz222 Cluster - yyc222 = true - } - yyh222.ElemContainerState(yyj222) - if yyj222 < len(yyv222) { - if r.TryDecodeAsNil() { - yyv222[yyj222] = Cluster{} - } else { - yyv225 := &yyv222[yyj222] - yyv225.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj222 < len(yyv222) { - yyv222 = yyv222[:yyj222] - yyc222 = true - } else if yyj222 == 0 && yyv222 == nil { - yyv222 = []Cluster{} - yyc222 = true - } - } - yyh222.End() - if yyc222 { - *v = yyv222 - } -} - -func (x codecSelfer1234) encMapstringClusterReplicaSetPreferences(v map[string]ClusterReplicaSetPreferences, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeMapStart(len(v)) - for yyk226, yyv226 := range v { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - yym227 := z.EncBinary() - _ = yym227 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(yyk226)) - } - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy228 := &yyv226 - yy228.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x codecSelfer1234) decMapstringClusterReplicaSetPreferences(v *map[string]ClusterReplicaSetPreferences, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv229 := *v - yyl229 := r.ReadMapStart() - yybh229 := z.DecBasicHandle() - if yyv229 == nil { - yyrl229, _ := z.DecInferLen(yyl229, yybh229.MaxInitLen, 40) - yyv229 = make(map[string]ClusterReplicaSetPreferences, yyrl229) - *v = yyv229 - } - var yymk229 string - var yymv229 ClusterReplicaSetPreferences - var yymg229 bool - if yybh229.MapValueReset { - yymg229 = true - } - if yyl229 > 0 { - for yyj229 := 0; yyj229 < yyl229; yyj229++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) - if r.TryDecodeAsNil() { - yymk229 = "" - } else { - yymk229 = string(r.DecodeString()) - } - - if yymg229 { - yymv229 = yyv229[yymk229] - } else { - yymv229 = ClusterReplicaSetPreferences{} - } - z.DecSendContainerState(codecSelfer_containerMapValue1234) - if r.TryDecodeAsNil() { - yymv229 = ClusterReplicaSetPreferences{} - } else { - yyv231 := &yymv229 - yyv231.CodecDecodeSelf(d) - } - - if yyv229 != nil { - yyv229[yymk229] = yymv229 - } - } - } else if yyl229 < 0 { - for yyj229 := 0; !r.CheckBreak(); yyj229++ { - z.DecSendContainerState(codecSelfer_containerMapKey1234) - if r.TryDecodeAsNil() { - yymk229 = "" - } else { - yymk229 = string(r.DecodeString()) - } - - if yymg229 { - yymv229 = yyv229[yymk229] - } else { - yymv229 = ClusterReplicaSetPreferences{} - } - z.DecSendContainerState(codecSelfer_containerMapValue1234) - if r.TryDecodeAsNil() { - yymv229 = ClusterReplicaSetPreferences{} - } else { - yyv233 := &yymv229 - yyv233.CodecDecodeSelf(d) - } - - if yyv229 != nil { - yyv229[yymk229] = yymv229 - } - } - } // else len==0: TODO: Should we clear map entries? - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/types.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/types.go deleted file mode 100644 index 9ab2743e..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/types.go +++ /dev/null @@ -1,155 +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 federation - -import ( - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/unversioned" -) - -// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. -type ServerAddressByClientCIDR struct { - // The CIDR with which clients can match their IP to figure out the server address that they should use. - ClientCIDR string `json:"clientCIDR" protobuf:"bytes,1,opt,name=clientCIDR"` - // Address of this server, suitable for a client that matches the above CIDR. - // This can be a hostname, hostname:port, IP or IP:port. - ServerAddress string `json:"serverAddress" protobuf:"bytes,2,opt,name=serverAddress"` -} - -// ClusterSpec describes the attributes of a kubernetes cluster. -type ClusterSpec struct { - // A map of client CIDR to server address. - // This is to help clients reach servers in the most network-efficient way possible. - // Clients can use the appropriate server address as per the CIDR that they match. - // In case of multiple matches, clients should use the longest matching CIDR. - ServerAddressByClientCIDRs []ServerAddressByClientCIDR `json:"serverAddressByClientCIDRs" patchStrategy:"merge" patchMergeKey:"clientCIDR"` - // Name of the secret containing kubeconfig to access this cluster. - // The secret is read from the kubernetes cluster that is hosting federation control plane. - // Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig". - // This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. - // This can be left empty if the cluster allows insecure access. - // +optional - SecretRef *api.LocalObjectReference `json:"secretRef,omitempty"` -} - -type ClusterConditionType string - -// These are valid conditions of a cluster. -const ( - // ClusterReady means the cluster is ready to accept workloads. - ClusterReady ClusterConditionType = "Ready" - // ClusterOffline means the cluster is temporarily down or not reachable - ClusterOffline ClusterConditionType = "Offline" -) - -// ClusterCondition describes current state of a cluster. -type ClusterCondition struct { - // Type of cluster condition, Complete or Failed. - Type ClusterConditionType `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status api.ConditionStatus `json:"status"` - // Last time the condition was checked. - // +optional - LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"` - // Last time the condition transit from one status to another. - // +optional - LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"` - // (brief) reason for the condition's last transition. - // +optional - Reason string `json:"reason,omitempty"` - // Human readable message indicating details about last transition. - // +optional - Message string `json:"message,omitempty"` -} - -// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally. -type ClusterStatus struct { - // Conditions is an array of current cluster conditions. - // +optional - Conditions []ClusterCondition `json:"conditions,omitempty"` - // Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. - // These will always be in the same region. - // +optional - Zones []string `json:"zones,omitempty"` - // Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'. - // +optional - Region string `json:"region,omitempty"` -} - -// +genclient=true -// +nonNamespaced=true - -// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. -type Cluster struct { - unversioned.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata - // +optional - api.ObjectMeta `json:"metadata,omitempty"` - - // Spec defines the behavior of the Cluster. - // +optional - Spec ClusterSpec `json:"spec,omitempty"` - // Status describes the current status of a Cluster - // +optional - Status ClusterStatus `json:"status,omitempty"` -} - -// A list of all the kubernetes clusters registered to the federation -type ClusterList struct { - unversioned.TypeMeta `json:",inline"` - // Standard list metadata. - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds - // +optional - unversioned.ListMeta `json:"metadata,omitempty"` - - // List of Cluster objects. - Items []Cluster `json:"items"` -} - -// Temporary/alpha structures to support custom replica assignments within FederatedReplicaSet. - -// A set of preferences that can be added to federated version of ReplicaSet as a json-serialized annotation. -// The preferences allow the user to express in which culsters he wants to put his replicas within the -// mentiond FederatedReplicaSet. -type FederatedReplicaSetPreferences struct { - // If set to true then already scheduled and running replicas may be moved to other clusters to - // in order to bring cluster replicasets towards a desired state. Otherwise, if set to false, - // up and running replicas will not be moved. - // +optional - Rebalance bool `json:"rebalance,omitempty"` - - // A mapping between cluser names and preferences regarding local replicasets in these clusters. - // "*" (if provided) applies to all clusters if an explicit mapping is not provided. If there is no - // "*" that clusters without explicit preferences should not have any replicas scheduled. - // +optional - Clusters map[string]ClusterReplicaSetPreferences `json:"clusters,omitempty"` -} - -// Preferences regarding number of replicas assigned to a cluster replicaset within a federated replicaset. -type ClusterReplicaSetPreferences struct { - // Minimum number of replicas that should be assigned to this Local ReplicaSet. 0 by default. - // +optional - MinReplicas int64 `json:"minReplicas,omitempty"` - - // Maximum number of replicas that should be assigned to this Local ReplicaSet. Unbounded if no value provided (default). - // +optional - MaxReplicas *int64 `json:"maxReplicas,omitempty"` - - // A number expressing the preference to put an additional replica to this LocalReplicaSet. 0 by default. - Weight int64 -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/conversion.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/conversion.go deleted file mode 100644 index 0591422c..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/conversion.go +++ /dev/null @@ -1,36 +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 v1beta1 - -import ( - "fmt" - - "k8s.io/client-go/pkg/runtime" -) - -func addConversionFuncs(scheme *runtime.Scheme) error { - return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.String(), "Cluster", - func(label, value string) (string, string, error) { - switch label { - case "metadata.name": - return label, value, nil - default: - return "", "", fmt.Errorf("field label not supported: %s", label) - } - }, - ) -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/defaults.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/defaults.go deleted file mode 100644 index 644ae49b..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/defaults.go +++ /dev/null @@ -1,25 +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 v1beta1 - -import ( - "k8s.io/client-go/pkg/runtime" -) - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - return nil -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/doc.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/doc.go deleted file mode 100644 index 2110288a..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/doc.go +++ /dev/null @@ -1,21 +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. -*/ - -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=k8s.io/kubernetes/federation/apis/federation -// +k8s:openapi-gen=true -// +k8s:defaulter-gen=TypeMeta -package v1beta1 diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/generated.pb.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/generated.pb.go deleted file mode 100644 index 0723f561..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/generated.pb.go +++ /dev/null @@ -1,1541 +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. -*/ - -// Code generated by protoc-gen-gogo. -// source: k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto -// DO NOT EDIT! - -/* - Package v1beta1 is a generated protocol buffer package. - - It is generated from these files: - k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto - - It has these top-level messages: - Cluster - ClusterCondition - ClusterList - ClusterSpec - ClusterStatus - ServerAddressByClientCIDR -*/ -package v1beta1 - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import k8s_io_kubernetes_pkg_api_v1 "k8s.io/client-go/pkg/api/v1" - -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. -const _ = proto.GoGoProtoPackageIsVersion1 - -func (m *Cluster) Reset() { *m = Cluster{} } -func (*Cluster) ProtoMessage() {} -func (*Cluster) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } - -func (m *ClusterCondition) Reset() { *m = ClusterCondition{} } -func (*ClusterCondition) ProtoMessage() {} -func (*ClusterCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } - -func (m *ClusterList) Reset() { *m = ClusterList{} } -func (*ClusterList) ProtoMessage() {} -func (*ClusterList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } - -func (m *ClusterSpec) Reset() { *m = ClusterSpec{} } -func (*ClusterSpec) ProtoMessage() {} -func (*ClusterSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } - -func (m *ClusterStatus) Reset() { *m = ClusterStatus{} } -func (*ClusterStatus) ProtoMessage() {} -func (*ClusterStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} } - -func (m *ServerAddressByClientCIDR) Reset() { *m = ServerAddressByClientCIDR{} } -func (*ServerAddressByClientCIDR) ProtoMessage() {} -func (*ServerAddressByClientCIDR) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{5} -} - -func init() { - proto.RegisterType((*Cluster)(nil), "k8s.io.client-go.federation.apis.federation.v1beta1.Cluster") - proto.RegisterType((*ClusterCondition)(nil), "k8s.io.client-go.federation.apis.federation.v1beta1.ClusterCondition") - proto.RegisterType((*ClusterList)(nil), "k8s.io.client-go.federation.apis.federation.v1beta1.ClusterList") - proto.RegisterType((*ClusterSpec)(nil), "k8s.io.client-go.federation.apis.federation.v1beta1.ClusterSpec") - proto.RegisterType((*ClusterStatus)(nil), "k8s.io.client-go.federation.apis.federation.v1beta1.ClusterStatus") - proto.RegisterType((*ServerAddressByClientCIDR)(nil), "k8s.io.client-go.federation.apis.federation.v1beta1.ServerAddressByClientCIDR") -} -func (m *Cluster) 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 *Cluster) 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 *ClusterCondition) 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 *ClusterCondition) 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.LastProbeTime.Size())) - n4, err := m.LastProbeTime.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - data[i] = 0x22 - i++ - i = encodeVarintGenerated(data, i, uint64(m.LastTransitionTime.Size())) - n5, err := m.LastTransitionTime.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n5 - data[i] = 0x2a - i++ - i = encodeVarintGenerated(data, i, uint64(len(m.Reason))) - i += copy(data[i:], m.Reason) - data[i] = 0x32 - i++ - i = encodeVarintGenerated(data, i, uint64(len(m.Message))) - i += copy(data[i:], m.Message) - return i, nil -} - -func (m *ClusterList) 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 *ClusterList) 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())) - n6, err := m.ListMeta.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n6 - 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 *ClusterSpec) 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 *ClusterSpec) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.ServerAddressByClientCIDRs) > 0 { - for _, msg := range m.ServerAddressByClientCIDRs { - 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 - } - } - if m.SecretRef != nil { - data[i] = 0x12 - i++ - i = encodeVarintGenerated(data, i, uint64(m.SecretRef.Size())) - n7, err := m.SecretRef.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n7 - } - return i, nil -} - -func (m *ClusterStatus) 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 *ClusterStatus) 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 - } - } - if len(m.Zones) > 0 { - for _, s := range m.Zones { - data[i] = 0x2a - 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] = 0x32 - i++ - i = encodeVarintGenerated(data, i, uint64(len(m.Region))) - i += copy(data[i:], m.Region) - return i, nil -} - -func (m *ServerAddressByClientCIDR) 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 *ServerAddressByClientCIDR) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - data[i] = 0xa - i++ - i = encodeVarintGenerated(data, i, uint64(len(m.ClientCIDR))) - i += copy(data[i:], m.ClientCIDR) - data[i] = 0x12 - i++ - i = encodeVarintGenerated(data, i, uint64(len(m.ServerAddress))) - i += copy(data[i:], m.ServerAddress) - 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 *Cluster) 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 *ClusterCondition) 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.LastProbeTime.Size() - 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 *ClusterList) 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 *ClusterSpec) Size() (n int) { - var l int - _ = l - if len(m.ServerAddressByClientCIDRs) > 0 { - for _, e := range m.ServerAddressByClientCIDRs { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if m.SecretRef != nil { - l = m.SecretRef.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *ClusterStatus) 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)) - } - } - if len(m.Zones) > 0 { - for _, s := range m.Zones { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - l = len(m.Region) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ServerAddressByClientCIDR) Size() (n int) { - var l int - _ = l - l = len(m.ClientCIDR) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.ServerAddress) - 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 *Cluster) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Cluster{`, - `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_kubernetes_pkg_api_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ClusterSpec", "ClusterSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ClusterStatus", "ClusterStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterCondition) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterCondition{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `LastProbeTime:` + strings.Replace(strings.Replace(this.LastProbeTime.String(), "Time", "k8s_io_kubernetes_pkg_api_unversioned.Time", 1), `&`, ``, 1) + `,`, - `LastTransitionTime:` + strings.Replace(strings.Replace(this.LastTransitionTime.String(), "Time", "k8s_io_kubernetes_pkg_api_unversioned.Time", 1), `&`, ``, 1) + `,`, - `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterList) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterList{`, - `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_kubernetes_pkg_api_unversioned.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "Cluster", "Cluster", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterSpec{`, - `ServerAddressByClientCIDRs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ServerAddressByClientCIDRs), "ServerAddressByClientCIDR", "ServerAddressByClientCIDR", 1), `&`, ``, 1) + `,`, - `SecretRef:` + strings.Replace(fmt.Sprintf("%v", this.SecretRef), "LocalObjectReference", "k8s_io_kubernetes_pkg_api_v1.LocalObjectReference", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterStatus{`, - `Conditions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Conditions), "ClusterCondition", "ClusterCondition", 1), `&`, ``, 1) + `,`, - `Zones:` + fmt.Sprintf("%v", this.Zones) + `,`, - `Region:` + fmt.Sprintf("%v", this.Region) + `,`, - `}`, - }, "") - return s -} -func (this *ServerAddressByClientCIDR) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ServerAddressByClientCIDR{`, - `ClientCIDR:` + fmt.Sprintf("%v", this.ClientCIDR) + `,`, - `ServerAddress:` + fmt.Sprintf("%v", this.ServerAddress) + `,`, - `}`, - }, "") - 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 *Cluster) 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: Cluster: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Cluster: 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 *ClusterCondition) 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: ClusterCondition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterCondition: 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 = ClusterConditionType(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 = k8s_io_kubernetes_pkg_api_v1.ConditionStatus(data[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastProbeTime", 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.LastProbeTime.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - 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 5: - 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 6: - 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 *ClusterList) 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: ClusterList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterList: 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, Cluster{}) - 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 *ClusterSpec) 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: ClusterSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServerAddressByClientCIDRs", 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.ServerAddressByClientCIDRs = append(m.ServerAddressByClientCIDRs, ServerAddressByClientCIDR{}) - if err := m.ServerAddressByClientCIDRs[len(m.ServerAddressByClientCIDRs)-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 SecretRef", 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.SecretRef == nil { - m.SecretRef = &k8s_io_kubernetes_pkg_api_v1.LocalObjectReference{} - } - if err := m.SecretRef.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 *ClusterStatus) 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: ClusterStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterStatus: 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, ClusterCondition{}) - if err := m.Conditions[len(m.Conditions)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Zones", 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.Zones = append(m.Zones, string(data[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Region", 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.Region = 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 *ServerAddressByClientCIDR) 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: ServerAddressByClientCIDR: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServerAddressByClientCIDR: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientCIDR", 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.ClientCIDR = string(data[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServerAddress", 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.ServerAddress = 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") -) - -var fileDescriptorGenerated = []byte{ - // 787 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x54, 0xdd, 0x6a, 0xe3, 0x46, - 0x14, 0xb6, 0xfc, 0x1b, 0x4f, 0xea, 0x36, 0x0c, 0x2d, 0xb8, 0xbe, 0x90, 0x83, 0x29, 0xc5, 0xa1, - 0x8d, 0x84, 0x4d, 0x0b, 0x81, 0xd2, 0x42, 0xe4, 0x50, 0x08, 0x38, 0xa4, 0x4c, 0x42, 0x29, 0x81, - 0x52, 0x64, 0xf9, 0x58, 0x51, 0x6d, 0x4b, 0x62, 0x66, 0xe4, 0x92, 0x5c, 0xf5, 0x01, 0x7a, 0xd1, - 0x87, 0xd8, 0x37, 0x58, 0xf6, 0x1d, 0x72, 0x99, 0x8b, 0xbd, 0x58, 0xf6, 0xc2, 0x6c, 0xbc, 0x6f, - 0x91, 0xab, 0x65, 0x46, 0x63, 0xd9, 0x8a, 0x63, 0xb3, 0x9b, 0xdc, 0xe9, 0x1c, 0x9d, 0xf3, 0x7d, - 0xdf, 0x9c, 0x3f, 0x74, 0x34, 0x3c, 0x60, 0x86, 0x17, 0x98, 0xc3, 0xa8, 0x07, 0xd4, 0x07, 0x0e, - 0xcc, 0x1c, 0x40, 0x1f, 0xa8, 0xcd, 0xbd, 0xc0, 0x37, 0xed, 0xd0, 0x4b, 0xd9, 0x93, 0x56, 0x0f, - 0xb8, 0xdd, 0x32, 0x5d, 0xf0, 0x85, 0x0b, 0xfa, 0x46, 0x48, 0x03, 0x1e, 0xe0, 0x1f, 0x62, 0x14, - 0x63, 0x81, 0x62, 0x2c, 0xb2, 0x0c, 0x81, 0xb2, 0x6c, 0x2b, 0x94, 0xda, 0xbe, 0xeb, 0xf1, 0xcb, - 0xa8, 0x67, 0x38, 0xc1, 0xd8, 0x74, 0x03, 0x37, 0x30, 0x25, 0x58, 0x2f, 0x1a, 0x48, 0x4b, 0x1a, - 0xf2, 0x2b, 0x26, 0xa9, 0xb5, 0x57, 0xa5, 0x86, 0x43, 0x57, 0x68, 0x34, 0x29, 0xb0, 0x20, 0xa2, - 0x0e, 0x3c, 0x14, 0x56, 0xfb, 0x71, 0x7d, 0x4e, 0xe4, 0x4f, 0x80, 0x32, 0x2f, 0xf0, 0xa1, 0xbf, - 0x92, 0xf6, 0xfd, 0xfa, 0xb4, 0xc9, 0xca, 0xeb, 0x6b, 0xfb, 0x8f, 0x47, 0xd3, 0xc8, 0xe7, 0xde, - 0x78, 0x55, 0x53, 0xeb, 0xf1, 0xf0, 0x88, 0x7b, 0x23, 0xd3, 0xf3, 0x39, 0xe3, 0xf4, 0x61, 0x4a, - 0xe3, 0x55, 0x16, 0x95, 0x3a, 0xa3, 0x88, 0x71, 0xa0, 0xf8, 0x0f, 0xb4, 0x35, 0x06, 0x6e, 0xf7, - 0x6d, 0x6e, 0x57, 0xb5, 0x5d, 0xad, 0xb9, 0xdd, 0x6e, 0x1a, 0xab, 0xe5, 0x0f, 0x87, 0xae, 0xa8, - 0xbb, 0x31, 0x69, 0x19, 0xa7, 0xbd, 0xbf, 0xc1, 0xe1, 0x27, 0xc0, 0x6d, 0x0b, 0xdf, 0x4c, 0xeb, - 0x99, 0xd9, 0xb4, 0x8e, 0x16, 0x3e, 0x92, 0xa0, 0x61, 0x07, 0xe5, 0x59, 0x08, 0x4e, 0x35, 0x2b, - 0x51, 0x0f, 0x8d, 0xa7, 0x34, 0xd5, 0x50, 0x32, 0xcf, 0x42, 0x70, 0xac, 0xcf, 0x14, 0x5d, 0x5e, - 0x58, 0x44, 0x82, 0xe3, 0x21, 0x2a, 0x32, 0x6e, 0xf3, 0x88, 0x55, 0x73, 0x92, 0xa6, 0xf3, 0x3c, - 0x1a, 0x09, 0x65, 0x7d, 0xae, 0x88, 0x8a, 0xb1, 0x4d, 0x14, 0x45, 0xe3, 0x6d, 0x0e, 0xed, 0xa8, - 0xc8, 0x4e, 0xe0, 0xf7, 0x3d, 0x01, 0x81, 0x0f, 0x50, 0x9e, 0x5f, 0x85, 0x20, 0x8b, 0x57, 0xb6, - 0xbe, 0x99, 0x6b, 0x3c, 0xbf, 0x0a, 0xe1, 0x7e, 0x5a, 0xff, 0xf2, 0x61, 0xbc, 0xf0, 0x13, 0x99, - 0x81, 0x7f, 0x4f, 0xb4, 0x67, 0x65, 0xee, 0x2f, 0x69, 0xda, 0xfb, 0x69, 0x7d, 0xe3, 0xe0, 0x18, - 0x09, 0x66, 0x5a, 0x26, 0xbe, 0x44, 0x95, 0x91, 0xcd, 0xf8, 0x6f, 0x34, 0xe8, 0xc1, 0xb9, 0x37, - 0x06, 0x55, 0x9a, 0xef, 0x36, 0xf4, 0x75, 0x69, 0x7a, 0x0d, 0x91, 0x62, 0x7d, 0xa5, 0xb4, 0x54, - 0xba, 0xcb, 0x48, 0x24, 0x0d, 0x8c, 0xff, 0x41, 0x58, 0x38, 0xce, 0xa9, 0xed, 0xb3, 0xf8, 0x75, - 0x82, 0x2e, 0xff, 0xe9, 0x74, 0x35, 0x45, 0x87, 0xbb, 0x2b, 0x70, 0xe4, 0x11, 0x0a, 0xfc, 0x2d, - 0x2a, 0x52, 0xb0, 0x59, 0xe0, 0x57, 0x0b, 0xb2, 0x74, 0x49, 0xc7, 0x88, 0xf4, 0x12, 0xf5, 0x17, - 0xef, 0xa1, 0xd2, 0x18, 0x18, 0xb3, 0x5d, 0xa8, 0x16, 0x65, 0xe0, 0x17, 0x2a, 0xb0, 0x74, 0x12, - 0xbb, 0xc9, 0xfc, 0x7f, 0xe3, 0x56, 0x43, 0xdb, 0xaa, 0x59, 0x5d, 0x8f, 0x71, 0xfc, 0xe7, 0xca, - 0x62, 0x98, 0x1f, 0xf9, 0x22, 0x91, 0x2e, 0xf7, 0x63, 0x47, 0x91, 0x6d, 0xcd, 0x3d, 0x4b, 0xdb, - 0xd1, 0x43, 0x05, 0x8f, 0xc3, 0x58, 0xf4, 0x3e, 0xd7, 0xdc, 0x6e, 0xff, 0xfc, 0xac, 0xb9, 0xb5, - 0x2a, 0x8a, 0xa9, 0x70, 0x2c, 0x30, 0x49, 0x0c, 0xdd, 0x78, 0x91, 0x4d, 0x9e, 0x24, 0x56, 0x06, - 0xbf, 0xd4, 0x50, 0x8d, 0x01, 0x9d, 0x00, 0x3d, 0xec, 0xf7, 0x29, 0x30, 0x66, 0x5d, 0x75, 0x46, - 0x1e, 0xf8, 0xbc, 0x73, 0x7c, 0x44, 0x58, 0x55, 0x93, 0x4a, 0x4e, 0x9f, 0xa6, 0xe4, 0x6c, 0x1d, - 0xae, 0xd5, 0x50, 0xda, 0x6a, 0x6b, 0x43, 0x18, 0xd9, 0x20, 0x0b, 0xff, 0x85, 0xca, 0x0c, 0x1c, - 0x0a, 0x9c, 0xc0, 0x40, 0x1d, 0x93, 0xf6, 0xe6, 0x13, 0xd5, 0x0d, 0x1c, 0x7b, 0x14, 0xdf, 0x24, - 0x02, 0x03, 0xa0, 0xe0, 0x3b, 0x60, 0x55, 0x66, 0xd3, 0x7a, 0xf9, 0x6c, 0x0e, 0x44, 0x16, 0x98, - 0x8d, 0xd7, 0x1a, 0xaa, 0xa4, 0x0e, 0x00, 0xbe, 0x46, 0xc8, 0x99, 0x2f, 0xd7, 0xbc, 0x2e, 0xbf, - 0x3e, 0xab, 0x43, 0xc9, 0xae, 0x2e, 0x8e, 0x66, 0xe2, 0x62, 0x64, 0x89, 0x0d, 0xd7, 0x51, 0xe1, - 0x3a, 0xf0, 0x81, 0x55, 0x0b, 0xbb, 0xb9, 0x66, 0xd9, 0x2a, 0x8b, 0xae, 0x5e, 0x08, 0x07, 0x89, - 0xfd, 0xf1, 0xec, 0xbb, 0x5e, 0xe0, 0xab, 0x91, 0x5e, 0x9a, 0x7d, 0xe1, 0x25, 0xea, 0x6f, 0xe3, - 0x3f, 0x0d, 0x7d, 0xbd, 0xb6, 0xe4, 0xb8, 0x8d, 0x90, 0x93, 0x58, 0xea, 0x78, 0x2d, 0xa4, 0x25, - 0x7f, 0xc8, 0x52, 0x14, 0xfe, 0x09, 0x55, 0x52, 0x7d, 0x52, 0x77, 0x2b, 0xb9, 0x15, 0x29, 0x36, - 0x92, 0x8e, 0xb5, 0xf6, 0x6e, 0xee, 0xf4, 0xcc, 0xed, 0x9d, 0x9e, 0x79, 0x73, 0xa7, 0x67, 0xfe, - 0x9d, 0xe9, 0xda, 0xcd, 0x4c, 0xd7, 0x6e, 0x67, 0xba, 0xf6, 0x6e, 0xa6, 0x6b, 0xff, 0xbf, 0xd7, - 0x33, 0x17, 0x25, 0x55, 0xb3, 0x0f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x48, 0x5d, 0x6b, 0x0c, 0x46, - 0x08, 0x00, 0x00, -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/generated.proto b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/generated.proto deleted file mode 100644 index 9ad46d69..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/generated.proto +++ /dev/null @@ -1,127 +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. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.kubernetes.federation.apis.federation.v1beta1; - -import "k8s.io/kubernetes/pkg/api/resource/generated.proto"; -import "k8s.io/kubernetes/pkg/api/unversioned/generated.proto"; -import "k8s.io/kubernetes/pkg/api/v1/generated.proto"; -import "k8s.io/kubernetes/pkg/runtime/generated.proto"; -import "k8s.io/kubernetes/pkg/util/intstr/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. -message Cluster { - // Standard object's metadata. - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata - // +optional - optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; - - // Spec defines the behavior of the Cluster. - // +optional - optional ClusterSpec spec = 2; - - // Status describes the current status of a Cluster - // +optional - optional ClusterStatus status = 3; -} - -// ClusterCondition describes current state of a cluster. -message ClusterCondition { - // Type of cluster condition, Complete or Failed. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // Last time the condition was checked. - // +optional - optional k8s.io.kubernetes.pkg.api.unversioned.Time lastProbeTime = 3; - - // Last time the condition transit from one status to another. - // +optional - optional k8s.io.kubernetes.pkg.api.unversioned.Time lastTransitionTime = 4; - - // (brief) reason for the condition's last transition. - // +optional - optional string reason = 5; - - // Human readable message indicating details about last transition. - // +optional - optional string message = 6; -} - -// A list of all the kubernetes clusters registered to the federation -message ClusterList { - // Standard list metadata. - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds - // +optional - optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1; - - // List of Cluster objects. - repeated Cluster items = 2; -} - -// ClusterSpec describes the attributes of a kubernetes cluster. -message ClusterSpec { - // A map of client CIDR to server address. - // This is to help clients reach servers in the most network-efficient way possible. - // Clients can use the appropriate server address as per the CIDR that they match. - // In case of multiple matches, clients should use the longest matching CIDR. - repeated ServerAddressByClientCIDR serverAddressByClientCIDRs = 1; - - // Name of the secret containing kubeconfig to access this cluster. - // The secret is read from the kubernetes cluster that is hosting federation control plane. - // Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig". - // This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. - // This can be left empty if the cluster allows insecure access. - // +optional - optional k8s.io.kubernetes.pkg.api.v1.LocalObjectReference secretRef = 2; -} - -// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally. -message ClusterStatus { - // Conditions is an array of current cluster conditions. - // +optional - repeated ClusterCondition conditions = 1; - - // Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. - // These will always be in the same region. - // +optional - repeated string zones = 5; - - // Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'. - // +optional - optional string region = 6; -} - -// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. -message ServerAddressByClientCIDR { - // The CIDR with which clients can match their IP to figure out the server address that they should use. - optional string clientCIDR = 1; - - // Address of this server, suitable for a client that matches the above CIDR. - // This can be a hostname, hostname:port, IP or IP:port. - optional string serverAddress = 2; -} - diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/register.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/register.go deleted file mode 100644 index 669b5625..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/register.go +++ /dev/null @@ -1,50 +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 v1beta1 - -import ( - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/api/v1" - "k8s.io/client-go/pkg/runtime" - versionedwatch "k8s.io/client-go/pkg/watch/versioned" -) - -// GroupName is the group name use in this package -const GroupName = "federation" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta1"} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs, addConversionFuncs) - AddToScheme = SchemeBuilder.AddToScheme -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &Cluster{}, - &ClusterList{}, - &v1.ListOptions{}, - &v1.DeleteOptions{}, - &v1.ExportOptions{}, - ) - versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} - -func (obj *Cluster) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } -func (obj *ClusterList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta } diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/types.generated.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/types.generated.go deleted file mode 100644 index 7a6cc62a..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/types.generated.go +++ /dev/null @@ -1,2334 +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. -*/ - -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ - -package v1beta1 - -import ( - "errors" - "fmt" - codec1978 "github.com/ugorji/go/codec" - pkg2_unversioned "k8s.io/client-go/pkg/api/unversioned" - pkg1_v1 "k8s.io/client-go/pkg/api/v1" - pkg3_types "k8s.io/client-go/pkg/types" - "reflect" - "runtime" - time "time" -) - -const ( - // ----- content types ---- - codecSelferC_UTF81234 = 1 - codecSelferC_RAW1234 = 0 - // ----- value types used ---- - codecSelferValueTypeArray1234 = 10 - codecSelferValueTypeMap1234 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey1234 = 2 - codecSelfer_containerMapValue1234 = 3 - codecSelfer_containerMapEnd1234 = 4 - codecSelfer_containerArrayElem1234 = 6 - codecSelfer_containerArrayEnd1234 = 7 -) - -var ( - codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`) -) - -type codecSelfer1234 struct{} - -func init() { - if codec1978.GenVersion != 5 { - _, file, _, _ := runtime.Caller(0) - err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) - panic(err) - } - if false { // reference the types, but skip this branch at build/run time - var v0 pkg2_unversioned.Time - var v1 pkg1_v1.LocalObjectReference - var v2 pkg3_types.UID - var v3 time.Time - _, _, _, _ = v0, v1, v2, v3 - } -} - -func (x *ServerAddressByClientCIDR) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ClientCIDR)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("clientCIDR")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ClientCIDR)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ServerAddress)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("serverAddress")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ServerAddress)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ServerAddressByClientCIDR) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym9 := z.DecBinary() - _ = yym9 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct10 := r.ContainerType() - if yyct10 == codecSelferValueTypeMap1234 { - yyl10 := r.ReadMapStart() - if yyl10 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl10, d) - } - } else if yyct10 == codecSelferValueTypeArray1234 { - yyl10 := r.ReadArrayStart() - if yyl10 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl10, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ServerAddressByClientCIDR) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys11Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys11Slc - var yyhl11 bool = l >= 0 - for yyj11 := 0; ; yyj11++ { - if yyhl11 { - if yyj11 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys11Slc = r.DecodeBytes(yys11Slc, true, true) - yys11 := string(yys11Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys11 { - case "clientCIDR": - if r.TryDecodeAsNil() { - x.ClientCIDR = "" - } else { - x.ClientCIDR = string(r.DecodeString()) - } - case "serverAddress": - if r.TryDecodeAsNil() { - x.ServerAddress = "" - } else { - x.ServerAddress = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys11) - } // end switch yys11 - } // end for yyj11 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ServerAddressByClientCIDR) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ClientCIDR = "" - } else { - x.ClientCIDR = string(r.DecodeString()) - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ServerAddress = "" - } else { - x.ServerAddress = string(r.DecodeString()) - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj14-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ClusterSpec) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym17 := z.EncBinary() - _ = yym17 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep18 := !z.EncBinary() - yy2arr18 := z.EncBasicHandle().StructToArray - var yyq18 [2]bool - _, _, _ = yysep18, yyq18, yy2arr18 - const yyr18 bool = false - yyq18[1] = x.SecretRef != nil - var yynn18 int - if yyr18 || yy2arr18 { - r.EncodeArrayStart(2) - } else { - yynn18 = 1 - for _, b := range yyq18 { - if b { - yynn18++ - } - } - r.EncodeMapStart(yynn18) - yynn18 = 0 - } - if yyr18 || yy2arr18 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.ServerAddressByClientCIDRs == nil { - r.EncodeNil() - } else { - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - h.encSliceServerAddressByClientCIDR(([]ServerAddressByClientCIDR)(x.ServerAddressByClientCIDRs), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("serverAddressByClientCIDRs")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.ServerAddressByClientCIDRs == nil { - r.EncodeNil() - } else { - yym21 := z.EncBinary() - _ = yym21 - if false { - } else { - h.encSliceServerAddressByClientCIDR(([]ServerAddressByClientCIDR)(x.ServerAddressByClientCIDRs), e) - } - } - } - if yyr18 || yy2arr18 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq18[1] { - if x.SecretRef == nil { - r.EncodeNil() - } else { - x.SecretRef.CodecEncodeSelf(e) - } - } else { - r.EncodeNil() - } - } else { - if yyq18[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("secretRef")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.SecretRef == nil { - r.EncodeNil() - } else { - x.SecretRef.CodecEncodeSelf(e) - } - } - } - if yyr18 || yy2arr18 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterSpec) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym23 := z.DecBinary() - _ = yym23 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct24 := r.ContainerType() - if yyct24 == codecSelferValueTypeMap1234 { - yyl24 := r.ReadMapStart() - if yyl24 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl24, d) - } - } else if yyct24 == codecSelferValueTypeArray1234 { - yyl24 := r.ReadArrayStart() - if yyl24 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl24, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys25Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys25Slc - var yyhl25 bool = l >= 0 - for yyj25 := 0; ; yyj25++ { - if yyhl25 { - if yyj25 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys25Slc = r.DecodeBytes(yys25Slc, true, true) - yys25 := string(yys25Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys25 { - case "serverAddressByClientCIDRs": - if r.TryDecodeAsNil() { - x.ServerAddressByClientCIDRs = nil - } else { - yyv26 := &x.ServerAddressByClientCIDRs - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - h.decSliceServerAddressByClientCIDR((*[]ServerAddressByClientCIDR)(yyv26), d) - } - } - case "secretRef": - if r.TryDecodeAsNil() { - if x.SecretRef != nil { - x.SecretRef = nil - } - } else { - if x.SecretRef == nil { - x.SecretRef = new(pkg1_v1.LocalObjectReference) - } - x.SecretRef.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys25) - } // end switch yys25 - } // end for yyj25 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj29 int - var yyb29 bool - var yyhl29 bool = l >= 0 - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l - } else { - yyb29 = r.CheckBreak() - } - if yyb29 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ServerAddressByClientCIDRs = nil - } else { - yyv30 := &x.ServerAddressByClientCIDRs - yym31 := z.DecBinary() - _ = yym31 - if false { - } else { - h.decSliceServerAddressByClientCIDR((*[]ServerAddressByClientCIDR)(yyv30), d) - } - } - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l - } else { - yyb29 = r.CheckBreak() - } - if yyb29 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.SecretRef != nil { - x.SecretRef = nil - } - } else { - if x.SecretRef == nil { - x.SecretRef = new(pkg1_v1.LocalObjectReference) - } - x.SecretRef.CodecDecodeSelf(d) - } - for { - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l - } else { - yyb29 = r.CheckBreak() - } - if yyb29 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj29-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x ClusterConditionType) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym33 := z.EncBinary() - _ = yym33 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) - } -} - -func (x *ClusterConditionType) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym34 := z.DecBinary() - _ = yym34 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - -func (x *ClusterCondition) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym35 := z.EncBinary() - _ = yym35 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep36 := !z.EncBinary() - yy2arr36 := z.EncBasicHandle().StructToArray - var yyq36 [6]bool - _, _, _ = yysep36, yyq36, yy2arr36 - const yyr36 bool = false - yyq36[2] = true - yyq36[3] = true - yyq36[4] = x.Reason != "" - yyq36[5] = x.Message != "" - var yynn36 int - if yyr36 || yy2arr36 { - r.EncodeArrayStart(6) - } else { - yynn36 = 2 - for _, b := range yyq36 { - if b { - yynn36++ - } - } - r.EncodeMapStart(yynn36) - yynn36 = 0 - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - x.Type.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("type")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - x.Type.CodecEncodeSelf(e) - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym39 := z.EncBinary() - _ = yym39 - if false { - } else if z.HasExtensions() && z.EncExt(x.Status) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Status)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym40 := z.EncBinary() - _ = yym40 - if false { - } else if z.HasExtensions() && z.EncExt(x.Status) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Status)) - } - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq36[2] { - yy42 := &x.LastProbeTime - yym43 := z.EncBinary() - _ = yym43 - if false { - } else if z.HasExtensions() && z.EncExt(yy42) { - } else if yym43 { - z.EncBinaryMarshal(yy42) - } else if !yym43 && z.IsJSONHandle() { - z.EncJSONMarshal(yy42) - } else { - z.EncFallback(yy42) - } - } else { - r.EncodeNil() - } - } else { - if yyq36[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("lastProbeTime")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy44 := &x.LastProbeTime - yym45 := z.EncBinary() - _ = yym45 - if false { - } else if z.HasExtensions() && z.EncExt(yy44) { - } else if yym45 { - z.EncBinaryMarshal(yy44) - } else if !yym45 && z.IsJSONHandle() { - z.EncJSONMarshal(yy44) - } else { - z.EncFallback(yy44) - } - } - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq36[3] { - yy47 := &x.LastTransitionTime - yym48 := z.EncBinary() - _ = yym48 - if false { - } else if z.HasExtensions() && z.EncExt(yy47) { - } else if yym48 { - z.EncBinaryMarshal(yy47) - } else if !yym48 && z.IsJSONHandle() { - z.EncJSONMarshal(yy47) - } else { - z.EncFallback(yy47) - } - } else { - r.EncodeNil() - } - } else { - if yyq36[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("lastTransitionTime")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy49 := &x.LastTransitionTime - yym50 := z.EncBinary() - _ = yym50 - if false { - } else if z.HasExtensions() && z.EncExt(yy49) { - } else if yym50 { - z.EncBinaryMarshal(yy49) - } else if !yym50 && z.IsJSONHandle() { - z.EncJSONMarshal(yy49) - } else { - z.EncFallback(yy49) - } - } - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq36[4] { - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq36[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("reason")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym53 := z.EncBinary() - _ = yym53 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Reason)) - } - } - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq36[5] { - yym55 := z.EncBinary() - _ = yym55 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Message)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq36[5] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("message")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym56 := z.EncBinary() - _ = yym56 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Message)) - } - } - } - if yyr36 || yy2arr36 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterCondition) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym57 := z.DecBinary() - _ = yym57 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct58 := r.ContainerType() - if yyct58 == codecSelferValueTypeMap1234 { - yyl58 := r.ReadMapStart() - if yyl58 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl58, d) - } - } else if yyct58 == codecSelferValueTypeArray1234 { - yyl58 := r.ReadArrayStart() - if yyl58 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl58, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterCondition) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys59Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys59Slc - var yyhl59 bool = l >= 0 - for yyj59 := 0; ; yyj59++ { - if yyhl59 { - if yyj59 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys59Slc = r.DecodeBytes(yys59Slc, true, true) - yys59 := string(yys59Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys59 { - case "type": - if r.TryDecodeAsNil() { - x.Type = "" - } else { - x.Type = ClusterConditionType(r.DecodeString()) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = "" - } else { - x.Status = pkg1_v1.ConditionStatus(r.DecodeString()) - } - case "lastProbeTime": - if r.TryDecodeAsNil() { - x.LastProbeTime = pkg2_unversioned.Time{} - } else { - yyv62 := &x.LastProbeTime - yym63 := z.DecBinary() - _ = yym63 - if false { - } else if z.HasExtensions() && z.DecExt(yyv62) { - } else if yym63 { - z.DecBinaryUnmarshal(yyv62) - } else if !yym63 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv62) - } else { - z.DecFallback(yyv62, false) - } - } - case "lastTransitionTime": - if r.TryDecodeAsNil() { - x.LastTransitionTime = pkg2_unversioned.Time{} - } else { - yyv64 := &x.LastTransitionTime - yym65 := z.DecBinary() - _ = yym65 - if false { - } else if z.HasExtensions() && z.DecExt(yyv64) { - } else if yym65 { - z.DecBinaryUnmarshal(yyv64) - } else if !yym65 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv64) - } else { - z.DecFallback(yyv64, false) - } - } - case "reason": - if r.TryDecodeAsNil() { - x.Reason = "" - } else { - x.Reason = string(r.DecodeString()) - } - case "message": - if r.TryDecodeAsNil() { - x.Message = "" - } else { - x.Message = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys59) - } // end switch yys59 - } // end for yyj59 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj68 int - var yyb68 bool - var yyhl68 bool = l >= 0 - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Type = "" - } else { - x.Type = ClusterConditionType(r.DecodeString()) - } - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = "" - } else { - x.Status = pkg1_v1.ConditionStatus(r.DecodeString()) - } - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.LastProbeTime = pkg2_unversioned.Time{} - } else { - yyv71 := &x.LastProbeTime - yym72 := z.DecBinary() - _ = yym72 - if false { - } else if z.HasExtensions() && z.DecExt(yyv71) { - } else if yym72 { - z.DecBinaryUnmarshal(yyv71) - } else if !yym72 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv71) - } else { - z.DecFallback(yyv71, false) - } - } - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.LastTransitionTime = pkg2_unversioned.Time{} - } else { - yyv73 := &x.LastTransitionTime - yym74 := z.DecBinary() - _ = yym74 - if false { - } else if z.HasExtensions() && z.DecExt(yyv73) { - } else if yym74 { - z.DecBinaryUnmarshal(yyv73) - } else if !yym74 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv73) - } else { - z.DecFallback(yyv73, false) - } - } - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Reason = "" - } else { - x.Reason = string(r.DecodeString()) - } - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Message = "" - } else { - x.Message = string(r.DecodeString()) - } - for { - yyj68++ - if yyhl68 { - yyb68 = yyj68 > l - } else { - yyb68 = r.CheckBreak() - } - if yyb68 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj68-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym77 := z.EncBinary() - _ = yym77 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep78 := !z.EncBinary() - yy2arr78 := z.EncBasicHandle().StructToArray - var yyq78 [3]bool - _, _, _ = yysep78, yyq78, yy2arr78 - const yyr78 bool = false - yyq78[0] = len(x.Conditions) != 0 - yyq78[1] = len(x.Zones) != 0 - yyq78[2] = x.Region != "" - var yynn78 int - if yyr78 || yy2arr78 { - r.EncodeArrayStart(3) - } else { - yynn78 = 0 - for _, b := range yyq78 { - if b { - yynn78++ - } - } - r.EncodeMapStart(yynn78) - yynn78 = 0 - } - if yyr78 || yy2arr78 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq78[0] { - if x.Conditions == nil { - r.EncodeNil() - } else { - yym80 := z.EncBinary() - _ = yym80 - if false { - } else { - h.encSliceClusterCondition(([]ClusterCondition)(x.Conditions), e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq78[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("conditions")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Conditions == nil { - r.EncodeNil() - } else { - yym81 := z.EncBinary() - _ = yym81 - if false { - } else { - h.encSliceClusterCondition(([]ClusterCondition)(x.Conditions), e) - } - } - } - } - if yyr78 || yy2arr78 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq78[1] { - if x.Zones == nil { - r.EncodeNil() - } else { - yym83 := z.EncBinary() - _ = yym83 - if false { - } else { - z.F.EncSliceStringV(x.Zones, false, e) - } - } - } else { - r.EncodeNil() - } - } else { - if yyq78[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("zones")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Zones == nil { - r.EncodeNil() - } else { - yym84 := z.EncBinary() - _ = yym84 - if false { - } else { - z.F.EncSliceStringV(x.Zones, false, e) - } - } - } - } - if yyr78 || yy2arr78 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq78[2] { - yym86 := z.EncBinary() - _ = yym86 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Region)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq78[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("region")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym87 := z.EncBinary() - _ = yym87 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Region)) - } - } - } - if yyr78 || yy2arr78 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterStatus) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym88 := z.DecBinary() - _ = yym88 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct89 := r.ContainerType() - if yyct89 == codecSelferValueTypeMap1234 { - yyl89 := r.ReadMapStart() - if yyl89 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl89, d) - } - } else if yyct89 == codecSelferValueTypeArray1234 { - yyl89 := r.ReadArrayStart() - if yyl89 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl89, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys90Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys90Slc - var yyhl90 bool = l >= 0 - for yyj90 := 0; ; yyj90++ { - if yyhl90 { - if yyj90 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys90Slc = r.DecodeBytes(yys90Slc, true, true) - yys90 := string(yys90Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys90 { - case "conditions": - if r.TryDecodeAsNil() { - x.Conditions = nil - } else { - yyv91 := &x.Conditions - yym92 := z.DecBinary() - _ = yym92 - if false { - } else { - h.decSliceClusterCondition((*[]ClusterCondition)(yyv91), d) - } - } - case "zones": - if r.TryDecodeAsNil() { - x.Zones = nil - } else { - yyv93 := &x.Zones - yym94 := z.DecBinary() - _ = yym94 - if false { - } else { - z.F.DecSliceStringX(yyv93, false, d) - } - } - case "region": - if r.TryDecodeAsNil() { - x.Region = "" - } else { - x.Region = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys90) - } // end switch yys90 - } // end for yyj90 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj96 int - var yyb96 bool - var yyhl96 bool = l >= 0 - yyj96++ - if yyhl96 { - yyb96 = yyj96 > l - } else { - yyb96 = r.CheckBreak() - } - if yyb96 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Conditions = nil - } else { - yyv97 := &x.Conditions - yym98 := z.DecBinary() - _ = yym98 - if false { - } else { - h.decSliceClusterCondition((*[]ClusterCondition)(yyv97), d) - } - } - yyj96++ - if yyhl96 { - yyb96 = yyj96 > l - } else { - yyb96 = r.CheckBreak() - } - if yyb96 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Zones = nil - } else { - yyv99 := &x.Zones - yym100 := z.DecBinary() - _ = yym100 - if false { - } else { - z.F.DecSliceStringX(yyv99, false, d) - } - } - yyj96++ - if yyhl96 { - yyb96 = yyj96 > l - } else { - yyb96 = r.CheckBreak() - } - if yyb96 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Region = "" - } else { - x.Region = string(r.DecodeString()) - } - for { - yyj96++ - if yyhl96 { - yyb96 = yyj96 > l - } else { - yyb96 = r.CheckBreak() - } - if yyb96 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj96-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *Cluster) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym102 := z.EncBinary() - _ = yym102 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep103 := !z.EncBinary() - yy2arr103 := z.EncBasicHandle().StructToArray - var yyq103 [5]bool - _, _, _ = yysep103, yyq103, yy2arr103 - const yyr103 bool = false - yyq103[0] = x.Kind != "" - yyq103[1] = x.APIVersion != "" - yyq103[2] = true - yyq103[3] = true - yyq103[4] = true - var yynn103 int - if yyr103 || yy2arr103 { - r.EncodeArrayStart(5) - } else { - yynn103 = 0 - for _, b := range yyq103 { - if b { - yynn103++ - } - } - r.EncodeMapStart(yynn103) - yynn103 = 0 - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq103[0] { - yym105 := z.EncBinary() - _ = yym105 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq103[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym106 := z.EncBinary() - _ = yym106 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq103[1] { - yym108 := z.EncBinary() - _ = yym108 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq103[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym109 := z.EncBinary() - _ = yym109 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq103[2] { - yy111 := &x.ObjectMeta - yy111.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq103[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy112 := &x.ObjectMeta - yy112.CodecEncodeSelf(e) - } - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq103[3] { - yy114 := &x.Spec - yy114.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq103[3] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("spec")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy115 := &x.Spec - yy115.CodecEncodeSelf(e) - } - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq103[4] { - yy117 := &x.Status - yy117.CodecEncodeSelf(e) - } else { - r.EncodeNil() - } - } else { - if yyq103[4] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("status")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy118 := &x.Status - yy118.CodecEncodeSelf(e) - } - } - if yyr103 || yy2arr103 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *Cluster) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym119 := z.DecBinary() - _ = yym119 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct120 := r.ContainerType() - if yyct120 == codecSelferValueTypeMap1234 { - yyl120 := r.ReadMapStart() - if yyl120 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl120, d) - } - } else if yyct120 == codecSelferValueTypeArray1234 { - yyl120 := r.ReadArrayStart() - if yyl120 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl120, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *Cluster) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys121Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys121Slc - var yyhl121 bool = l >= 0 - for yyj121 := 0; ; yyj121++ { - if yyhl121 { - if yyj121 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys121Slc = r.DecodeBytes(yys121Slc, true, true) - yys121 := string(yys121Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys121 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg1_v1.ObjectMeta{} - } else { - yyv124 := &x.ObjectMeta - yyv124.CodecDecodeSelf(d) - } - case "spec": - if r.TryDecodeAsNil() { - x.Spec = ClusterSpec{} - } else { - yyv125 := &x.Spec - yyv125.CodecDecodeSelf(d) - } - case "status": - if r.TryDecodeAsNil() { - x.Status = ClusterStatus{} - } else { - yyv126 := &x.Status - yyv126.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys121) - } // end switch yys121 - } // end for yyj121 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *Cluster) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj127 int - var yyb127 bool - var yyhl127 bool = l >= 0 - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ObjectMeta = pkg1_v1.ObjectMeta{} - } else { - yyv130 := &x.ObjectMeta - yyv130.CodecDecodeSelf(d) - } - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Spec = ClusterSpec{} - } else { - yyv131 := &x.Spec - yyv131.CodecDecodeSelf(d) - } - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Status = ClusterStatus{} - } else { - yyv132 := &x.Status - yyv132.CodecDecodeSelf(d) - } - for { - yyj127++ - if yyhl127 { - yyb127 = yyj127 > l - } else { - yyb127 = r.CheckBreak() - } - if yyb127 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj127-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *ClusterList) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym133 := z.EncBinary() - _ = yym133 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep134 := !z.EncBinary() - yy2arr134 := z.EncBasicHandle().StructToArray - var yyq134 [4]bool - _, _, _ = yysep134, yyq134, yy2arr134 - const yyr134 bool = false - yyq134[0] = x.Kind != "" - yyq134[1] = x.APIVersion != "" - yyq134[2] = true - var yynn134 int - if yyr134 || yy2arr134 { - r.EncodeArrayStart(4) - } else { - yynn134 = 1 - for _, b := range yyq134 { - if b { - yynn134++ - } - } - r.EncodeMapStart(yynn134) - yynn134 = 0 - } - if yyr134 || yy2arr134 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq134[0] { - yym136 := z.EncBinary() - _ = yym136 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq134[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym137 := z.EncBinary() - _ = yym137 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr134 || yy2arr134 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq134[1] { - yym139 := z.EncBinary() - _ = yym139 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq134[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym140 := z.EncBinary() - _ = yym140 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr134 || yy2arr134 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq134[2] { - yy142 := &x.ListMeta - yym143 := z.EncBinary() - _ = yym143 - if false { - } else if z.HasExtensions() && z.EncExt(yy142) { - } else { - z.EncFallback(yy142) - } - } else { - r.EncodeNil() - } - } else { - if yyq134[2] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy144 := &x.ListMeta - yym145 := z.EncBinary() - _ = yym145 - if false { - } else if z.HasExtensions() && z.EncExt(yy144) { - } else { - z.EncFallback(yy144) - } - } - } - if yyr134 || yy2arr134 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym147 := z.EncBinary() - _ = yym147 - if false { - } else { - h.encSliceCluster(([]Cluster)(x.Items), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("items")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.Items == nil { - r.EncodeNil() - } else { - yym148 := z.EncBinary() - _ = yym148 - if false { - } else { - h.encSliceCluster(([]Cluster)(x.Items), e) - } - } - } - if yyr134 || yy2arr134 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *ClusterList) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym149 := z.DecBinary() - _ = yym149 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct150 := r.ContainerType() - if yyct150 == codecSelferValueTypeMap1234 { - yyl150 := r.ReadMapStart() - if yyl150 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl150, d) - } - } else if yyct150 == codecSelferValueTypeArray1234 { - yyl150 := r.ReadArrayStart() - if yyl150 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl150, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *ClusterList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys151Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys151Slc - var yyhl151 bool = l >= 0 - for yyj151 := 0; ; yyj151++ { - if yyhl151 { - if yyj151 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys151Slc = r.DecodeBytes(yys151Slc, true, true) - yys151 := string(yys151Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys151 { - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - case "metadata": - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv154 := &x.ListMeta - yym155 := z.DecBinary() - _ = yym155 - if false { - } else if z.HasExtensions() && z.DecExt(yyv154) { - } else { - z.DecFallback(yyv154, false) - } - } - case "items": - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv156 := &x.Items - yym157 := z.DecBinary() - _ = yym157 - if false { - } else { - h.decSliceCluster((*[]Cluster)(yyv156), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys151) - } // end switch yys151 - } // end for yyj151 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *ClusterList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj158 int - var yyb158 bool - var yyhl158 bool = l >= 0 - yyj158++ - if yyhl158 { - yyb158 = yyj158 > l - } else { - yyb158 = r.CheckBreak() - } - if yyb158 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj158++ - if yyhl158 { - yyb158 = yyj158 > l - } else { - yyb158 = r.CheckBreak() - } - if yyb158 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - yyj158++ - if yyhl158 { - yyb158 = yyj158 > l - } else { - yyb158 = r.CheckBreak() - } - if yyb158 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ListMeta = pkg2_unversioned.ListMeta{} - } else { - yyv161 := &x.ListMeta - yym162 := z.DecBinary() - _ = yym162 - if false { - } else if z.HasExtensions() && z.DecExt(yyv161) { - } else { - z.DecFallback(yyv161, false) - } - } - yyj158++ - if yyhl158 { - yyb158 = yyj158 > l - } else { - yyb158 = r.CheckBreak() - } - if yyb158 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Items = nil - } else { - yyv163 := &x.Items - yym164 := z.DecBinary() - _ = yym164 - if false { - } else { - h.decSliceCluster((*[]Cluster)(yyv163), d) - } - } - for { - yyj158++ - if yyhl158 { - yyb158 = yyj158 > l - } else { - yyb158 = r.CheckBreak() - } - if yyb158 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj158-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) encSliceServerAddressByClientCIDR(v []ServerAddressByClientCIDR, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv165 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy166 := &yyv165 - yy166.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceServerAddressByClientCIDR(v *[]ServerAddressByClientCIDR, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv167 := *v - yyh167, yyl167 := z.DecSliceHelperStart() - var yyc167 bool - if yyl167 == 0 { - if yyv167 == nil { - yyv167 = []ServerAddressByClientCIDR{} - yyc167 = true - } else if len(yyv167) != 0 { - yyv167 = yyv167[:0] - yyc167 = true - } - } else if yyl167 > 0 { - var yyrr167, yyrl167 int - var yyrt167 bool - if yyl167 > cap(yyv167) { - - yyrg167 := len(yyv167) > 0 - yyv2167 := yyv167 - yyrl167, yyrt167 = z.DecInferLen(yyl167, z.DecBasicHandle().MaxInitLen, 32) - if yyrt167 { - if yyrl167 <= cap(yyv167) { - yyv167 = yyv167[:yyrl167] - } else { - yyv167 = make([]ServerAddressByClientCIDR, yyrl167) - } - } else { - yyv167 = make([]ServerAddressByClientCIDR, yyrl167) - } - yyc167 = true - yyrr167 = len(yyv167) - if yyrg167 { - copy(yyv167, yyv2167) - } - } else if yyl167 != len(yyv167) { - yyv167 = yyv167[:yyl167] - yyc167 = true - } - yyj167 := 0 - for ; yyj167 < yyrr167; yyj167++ { - yyh167.ElemContainerState(yyj167) - if r.TryDecodeAsNil() { - yyv167[yyj167] = ServerAddressByClientCIDR{} - } else { - yyv168 := &yyv167[yyj167] - yyv168.CodecDecodeSelf(d) - } - - } - if yyrt167 { - for ; yyj167 < yyl167; yyj167++ { - yyv167 = append(yyv167, ServerAddressByClientCIDR{}) - yyh167.ElemContainerState(yyj167) - if r.TryDecodeAsNil() { - yyv167[yyj167] = ServerAddressByClientCIDR{} - } else { - yyv169 := &yyv167[yyj167] - yyv169.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj167 := 0 - for ; !r.CheckBreak(); yyj167++ { - - if yyj167 >= len(yyv167) { - yyv167 = append(yyv167, ServerAddressByClientCIDR{}) // var yyz167 ServerAddressByClientCIDR - yyc167 = true - } - yyh167.ElemContainerState(yyj167) - if yyj167 < len(yyv167) { - if r.TryDecodeAsNil() { - yyv167[yyj167] = ServerAddressByClientCIDR{} - } else { - yyv170 := &yyv167[yyj167] - yyv170.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj167 < len(yyv167) { - yyv167 = yyv167[:yyj167] - yyc167 = true - } else if yyj167 == 0 && yyv167 == nil { - yyv167 = []ServerAddressByClientCIDR{} - yyc167 = true - } - } - yyh167.End() - if yyc167 { - *v = yyv167 - } -} - -func (x codecSelfer1234) encSliceClusterCondition(v []ClusterCondition, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv171 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy172 := &yyv171 - yy172.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceClusterCondition(v *[]ClusterCondition, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv173 := *v - yyh173, yyl173 := z.DecSliceHelperStart() - var yyc173 bool - if yyl173 == 0 { - if yyv173 == nil { - yyv173 = []ClusterCondition{} - yyc173 = true - } else if len(yyv173) != 0 { - yyv173 = yyv173[:0] - yyc173 = true - } - } else if yyl173 > 0 { - var yyrr173, yyrl173 int - var yyrt173 bool - if yyl173 > cap(yyv173) { - - yyrg173 := len(yyv173) > 0 - yyv2173 := yyv173 - yyrl173, yyrt173 = z.DecInferLen(yyl173, z.DecBasicHandle().MaxInitLen, 112) - if yyrt173 { - if yyrl173 <= cap(yyv173) { - yyv173 = yyv173[:yyrl173] - } else { - yyv173 = make([]ClusterCondition, yyrl173) - } - } else { - yyv173 = make([]ClusterCondition, yyrl173) - } - yyc173 = true - yyrr173 = len(yyv173) - if yyrg173 { - copy(yyv173, yyv2173) - } - } else if yyl173 != len(yyv173) { - yyv173 = yyv173[:yyl173] - yyc173 = true - } - yyj173 := 0 - for ; yyj173 < yyrr173; yyj173++ { - yyh173.ElemContainerState(yyj173) - if r.TryDecodeAsNil() { - yyv173[yyj173] = ClusterCondition{} - } else { - yyv174 := &yyv173[yyj173] - yyv174.CodecDecodeSelf(d) - } - - } - if yyrt173 { - for ; yyj173 < yyl173; yyj173++ { - yyv173 = append(yyv173, ClusterCondition{}) - yyh173.ElemContainerState(yyj173) - if r.TryDecodeAsNil() { - yyv173[yyj173] = ClusterCondition{} - } else { - yyv175 := &yyv173[yyj173] - yyv175.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj173 := 0 - for ; !r.CheckBreak(); yyj173++ { - - if yyj173 >= len(yyv173) { - yyv173 = append(yyv173, ClusterCondition{}) // var yyz173 ClusterCondition - yyc173 = true - } - yyh173.ElemContainerState(yyj173) - if yyj173 < len(yyv173) { - if r.TryDecodeAsNil() { - yyv173[yyj173] = ClusterCondition{} - } else { - yyv176 := &yyv173[yyj173] - yyv176.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj173 < len(yyv173) { - yyv173 = yyv173[:yyj173] - yyc173 = true - } else if yyj173 == 0 && yyv173 == nil { - yyv173 = []ClusterCondition{} - yyc173 = true - } - } - yyh173.End() - if yyc173 { - *v = yyv173 - } -} - -func (x codecSelfer1234) encSliceCluster(v []Cluster, e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv177 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy178 := &yyv177 - yy178.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x codecSelfer1234) decSliceCluster(v *[]Cluster, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv179 := *v - yyh179, yyl179 := z.DecSliceHelperStart() - var yyc179 bool - if yyl179 == 0 { - if yyv179 == nil { - yyv179 = []Cluster{} - yyc179 = true - } else if len(yyv179) != 0 { - yyv179 = yyv179[:0] - yyc179 = true - } - } else if yyl179 > 0 { - var yyrr179, yyrl179 int - var yyrt179 bool - if yyl179 > cap(yyv179) { - - yyrg179 := len(yyv179) > 0 - yyv2179 := yyv179 - yyrl179, yyrt179 = z.DecInferLen(yyl179, z.DecBasicHandle().MaxInitLen, 352) - if yyrt179 { - if yyrl179 <= cap(yyv179) { - yyv179 = yyv179[:yyrl179] - } else { - yyv179 = make([]Cluster, yyrl179) - } - } else { - yyv179 = make([]Cluster, yyrl179) - } - yyc179 = true - yyrr179 = len(yyv179) - if yyrg179 { - copy(yyv179, yyv2179) - } - } else if yyl179 != len(yyv179) { - yyv179 = yyv179[:yyl179] - yyc179 = true - } - yyj179 := 0 - for ; yyj179 < yyrr179; yyj179++ { - yyh179.ElemContainerState(yyj179) - if r.TryDecodeAsNil() { - yyv179[yyj179] = Cluster{} - } else { - yyv180 := &yyv179[yyj179] - yyv180.CodecDecodeSelf(d) - } - - } - if yyrt179 { - for ; yyj179 < yyl179; yyj179++ { - yyv179 = append(yyv179, Cluster{}) - yyh179.ElemContainerState(yyj179) - if r.TryDecodeAsNil() { - yyv179[yyj179] = Cluster{} - } else { - yyv181 := &yyv179[yyj179] - yyv181.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj179 := 0 - for ; !r.CheckBreak(); yyj179++ { - - if yyj179 >= len(yyv179) { - yyv179 = append(yyv179, Cluster{}) // var yyz179 Cluster - yyc179 = true - } - yyh179.ElemContainerState(yyj179) - if yyj179 < len(yyv179) { - if r.TryDecodeAsNil() { - yyv179[yyj179] = Cluster{} - } else { - yyv182 := &yyv179[yyj179] - yyv182.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj179 < len(yyv179) { - yyv179 = yyv179[:yyj179] - yyc179 = true - } else if yyj179 == 0 && yyv179 == nil { - yyv179 = []Cluster{} - yyc179 = true - } - } - yyh179.End() - if yyc179 { - *v = yyv179 - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/types.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/types.go deleted file mode 100644 index 99462df5..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/types.go +++ /dev/null @@ -1,122 +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 v1beta1 - -import ( - "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/api/v1" -) - -// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. -type ServerAddressByClientCIDR struct { - // The CIDR with which clients can match their IP to figure out the server address that they should use. - ClientCIDR string `json:"clientCIDR" protobuf:"bytes,1,opt,name=clientCIDR"` - // Address of this server, suitable for a client that matches the above CIDR. - // This can be a hostname, hostname:port, IP or IP:port. - ServerAddress string `json:"serverAddress" protobuf:"bytes,2,opt,name=serverAddress"` -} - -// ClusterSpec describes the attributes of a kubernetes cluster. -type ClusterSpec struct { - // A map of client CIDR to server address. - // This is to help clients reach servers in the most network-efficient way possible. - // Clients can use the appropriate server address as per the CIDR that they match. - // In case of multiple matches, clients should use the longest matching CIDR. - ServerAddressByClientCIDRs []ServerAddressByClientCIDR `json:"serverAddressByClientCIDRs" patchStrategy:"merge" patchMergeKey:"clientCIDR" protobuf:"bytes,1,rep,name=serverAddressByClientCIDRs"` - // Name of the secret containing kubeconfig to access this cluster. - // The secret is read from the kubernetes cluster that is hosting federation control plane. - // Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig". - // This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. - // This can be left empty if the cluster allows insecure access. - // +optional - SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,2,opt,name=secretRef"` -} - -type ClusterConditionType string - -// These are valid conditions of a cluster. -const ( - // ClusterReady means the cluster is ready to accept workloads. - ClusterReady ClusterConditionType = "Ready" - // ClusterOffline means the cluster is temporarily down or not reachable - ClusterOffline ClusterConditionType = "Offline" -) - -// ClusterCondition describes current state of a cluster. -type ClusterCondition struct { - // Type of cluster condition, Complete or Failed. - Type ClusterConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ClusterConditionType"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` - // Last time the condition was checked. - // +optional - LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"` - // Last time the condition transit from one status to another. - // +optional - LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` - // (brief) reason for the condition's last transition. - // +optional - Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"` - // Human readable message indicating details about last transition. - // +optional - Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` -} - -// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally. -type ClusterStatus struct { - // Conditions is an array of current cluster conditions. - // +optional - Conditions []ClusterCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"` - // Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. - // These will always be in the same region. - // +optional - Zones []string `json:"zones,omitempty" protobuf:"bytes,5,rep,name=zones"` - // Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'. - // +optional - Region string `json:"region,omitempty" protobuf:"bytes,6,opt,name=region"` -} - -// +genclient=true -// +nonNamespaced=true - -// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. -type Cluster struct { - unversioned.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata - // +optional - v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Spec defines the behavior of the Cluster. - // +optional - Spec ClusterSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - // Status describes the current status of a Cluster - // +optional - Status ClusterStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// A list of all the kubernetes clusters registered to the federation -type ClusterList struct { - unversioned.TypeMeta `json:",inline"` - // Standard list metadata. - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds - // +optional - unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // List of Cluster objects. - Items []Cluster `json:"items" protobuf:"bytes,2,rep,name=items"` -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/types_swagger_doc_generated.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/types_swagger_doc_generated.go deleted file mode 100644 index 55985fcb..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/types_swagger_doc_generated.go +++ /dev/null @@ -1,96 +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 v1beta1 - -// This file contains a collection of methods that can be used from go-restful to -// generate Swagger API documentation for its models. Please read this PR for more -// information on the implementation: https://github.com/emicklei/go-restful/pull/215 -// -// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if -// they are on one line! For multiple line or blocks that you want to ignore use ---. -// Any context after a --- is ignored. -// -// Those methods can be generated by using hack/update-generated-swagger-docs.sh - -// AUTO-GENERATED FUNCTIONS START HERE -var map_Cluster = map[string]string{ - "": "Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.", - "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", - "spec": "Spec defines the behavior of the Cluster.", - "status": "Status describes the current status of a Cluster", -} - -func (Cluster) SwaggerDoc() map[string]string { - return map_Cluster -} - -var map_ClusterCondition = map[string]string{ - "": "ClusterCondition describes current state of a cluster.", - "type": "Type of cluster condition, Complete or Failed.", - "status": "Status of the condition, one of True, False, Unknown.", - "lastProbeTime": "Last time the condition was checked.", - "lastTransitionTime": "Last time the condition transit from one status to another.", - "reason": "(brief) reason for the condition's last transition.", - "message": "Human readable message indicating details about last transition.", -} - -func (ClusterCondition) SwaggerDoc() map[string]string { - return map_ClusterCondition -} - -var map_ClusterList = map[string]string{ - "": "A list of all the kubernetes clusters registered to the federation", - "metadata": "Standard list metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds", - "items": "List of Cluster objects.", -} - -func (ClusterList) SwaggerDoc() map[string]string { - return map_ClusterList -} - -var map_ClusterSpec = map[string]string{ - "": "ClusterSpec describes the attributes of a kubernetes cluster.", - "serverAddressByClientCIDRs": "A map of client CIDR to server address. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR.", - "secretRef": "Name of the secret containing kubeconfig to access this cluster. The secret is read from the kubernetes cluster that is hosting federation control plane. Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key \"kubeconfig\". This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. This can be left empty if the cluster allows insecure access.", -} - -func (ClusterSpec) SwaggerDoc() map[string]string { - return map_ClusterSpec -} - -var map_ClusterStatus = map[string]string{ - "": "ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.", - "conditions": "Conditions is an array of current cluster conditions.", - "zones": "Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. These will always be in the same region.", - "region": "Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.", -} - -func (ClusterStatus) SwaggerDoc() map[string]string { - return map_ClusterStatus -} - -var map_ServerAddressByClientCIDR = map[string]string{ - "": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - "clientCIDR": "The CIDR with which clients can match their IP to figure out the server address that they should use.", - "serverAddress": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.", -} - -func (ServerAddressByClientCIDR) SwaggerDoc() map[string]string { - return map_ServerAddressByClientCIDR -} - -// AUTO-GENERATED FUNCTIONS END HERE diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/zz_generated.conversion.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/zz_generated.conversion.go deleted file mode 100644 index e6f32616..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,199 +0,0 @@ -// +build !ignore_autogenerated - -/* -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. -*/ - -// This file was autogenerated by conversion-gen. Do not edit it manually! - -package v1beta1 - -import ( - api "k8s.io/client-go/pkg/api" - v1 "k8s.io/client-go/pkg/api/v1" - conversion "k8s.io/client-go/pkg/conversion" - federation "k8s.io/client-go/pkg/federation/apis/federation" - runtime "k8s.io/client-go/pkg/runtime" - unsafe "unsafe" -) - -func init() { - SchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(scheme *runtime.Scheme) error { - return scheme.AddGeneratedConversionFuncs( - Convert_v1beta1_Cluster_To_federation_Cluster, - Convert_federation_Cluster_To_v1beta1_Cluster, - Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition, - Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition, - Convert_v1beta1_ClusterList_To_federation_ClusterList, - Convert_federation_ClusterList_To_v1beta1_ClusterList, - Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec, - Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec, - Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus, - Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus, - Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR, - Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR, - ) -} - -func autoConvert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error { - return autoConvert_v1beta1_Cluster_To_federation_Cluster(in, out, s) -} - -func autoConvert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error { - return autoConvert_federation_Cluster_To_v1beta1_Cluster(in, out, s) -} - -func autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error { - out.Type = federation.ClusterConditionType(in.Type) - out.Status = api.ConditionStatus(in.Status) - out.LastProbeTime = in.LastProbeTime - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in, out, s) -} - -func autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error { - out.Type = ClusterConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.LastProbeTime = in.LastProbeTime - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error { - return autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in, out, s) -} - -func autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]federation.Cluster)(unsafe.Pointer(&in.Items)) - return nil -} - -func Convert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in, out, s) -} - -func autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]Cluster)(unsafe.Pointer(&in.Items)) - return nil -} - -func Convert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error { - return autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in, out, s) -} - -func autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error { - out.ServerAddressByClientCIDRs = *(*[]federation.ServerAddressByClientCIDR)(unsafe.Pointer(&in.ServerAddressByClientCIDRs)) - out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -func Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in, out, s) -} - -func autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - out.ServerAddressByClientCIDRs = *(*[]ServerAddressByClientCIDR)(unsafe.Pointer(&in.ServerAddressByClientCIDRs)) - out.SecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -func Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - return autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in, out, s) -} - -func autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error { - out.Conditions = *(*[]federation.ClusterCondition)(unsafe.Pointer(&in.Conditions)) - out.Zones = *(*[]string)(unsafe.Pointer(&in.Zones)) - out.Region = in.Region - return nil -} - -func Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in, out, s) -} - -func autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - out.Conditions = *(*[]ClusterCondition)(unsafe.Pointer(&in.Conditions)) - out.Zones = *(*[]string)(unsafe.Pointer(&in.Zones)) - out.Region = in.Region - return nil -} - -func Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - return autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error { - out.ClientCIDR = in.ClientCIDR - out.ServerAddress = in.ServerAddress - return nil -} - -func Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error { - return autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in, out, s) -} - -func autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error { - out.ClientCIDR = in.ClientCIDR - out.ServerAddress = in.ServerAddress - return nil -} - -func Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error { - return autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in, out, s) -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/zz_generated.deepcopy.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index 16b06a16..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,159 +0,0 @@ -// +build !ignore_autogenerated - -/* -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. -*/ - -// This file was autogenerated by deepcopy-gen. Do not edit it manually! - -package v1beta1 - -import ( - v1 "k8s.io/client-go/pkg/api/v1" - conversion "k8s.io/client-go/pkg/conversion" - runtime "k8s.io/client-go/pkg/runtime" - reflect "reflect" -) - -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Cluster, InType: reflect.TypeOf(&Cluster{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterCondition, InType: reflect.TypeOf(&ClusterCondition{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterList, InType: reflect.TypeOf(&ClusterList{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterSpec, InType: reflect.TypeOf(&ClusterSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterStatus, InType: reflect.TypeOf(&ClusterStatus{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ServerAddressByClientCIDR, InType: reflect.TypeOf(&ServerAddressByClientCIDR{})}, - ) -} - -func DeepCopy_v1beta1_Cluster(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Cluster) - out := out.(*Cluster) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_ClusterSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_ClusterStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1beta1_ClusterCondition(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterCondition) - out := out.(*ClusterCondition) - out.Type = in.Type - out.Status = in.Status - out.LastProbeTime = in.LastProbeTime.DeepCopy() - out.LastTransitionTime = in.LastTransitionTime.DeepCopy() - out.Reason = in.Reason - out.Message = in.Message - return nil - } -} - -func DeepCopy_v1beta1_ClusterList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterList) - out := out.(*ClusterList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_Cluster(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_ClusterSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterSpec) - out := out.(*ClusterSpec) - if in.ServerAddressByClientCIDRs != nil { - in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs - *out = make([]ServerAddressByClientCIDR, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.ServerAddressByClientCIDRs = nil - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.LocalObjectReference) - **out = **in - } else { - out.SecretRef = nil - } - return nil - } -} - -func DeepCopy_v1beta1_ClusterStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterStatus) - out := out.(*ClusterStatus) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ClusterCondition, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_ClusterCondition(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Zones != nil { - in, out := &in.Zones, &out.Zones - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Zones = nil - } - out.Region = in.Region - return nil - } -} - -func DeepCopy_v1beta1_ServerAddressByClientCIDR(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServerAddressByClientCIDR) - out := out.(*ServerAddressByClientCIDR) - out.ClientCIDR = in.ClientCIDR - out.ServerAddress = in.ServerAddress - return nil - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/zz_generated.deepcopy.go b/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/zz_generated.deepcopy.go deleted file mode 100644 index 32e8bc36..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/federation/apis/federation/zz_generated.deepcopy.go +++ /dev/null @@ -1,200 +0,0 @@ -// +build !ignore_autogenerated - -/* -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. -*/ - -// This file was autogenerated by deepcopy-gen. Do not edit it manually! - -package federation - -import ( - api "k8s.io/client-go/pkg/api" - conversion "k8s.io/client-go/pkg/conversion" - runtime "k8s.io/client-go/pkg/runtime" - reflect "reflect" -) - -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_Cluster, InType: reflect.TypeOf(&Cluster{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterCondition, InType: reflect.TypeOf(&ClusterCondition{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterList, InType: reflect.TypeOf(&ClusterList{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterReplicaSetPreferences, InType: reflect.TypeOf(&ClusterReplicaSetPreferences{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterSpec, InType: reflect.TypeOf(&ClusterSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterStatus, InType: reflect.TypeOf(&ClusterStatus{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_FederatedReplicaSetPreferences, InType: reflect.TypeOf(&FederatedReplicaSetPreferences{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ServerAddressByClientCIDR, InType: reflect.TypeOf(&ServerAddressByClientCIDR{})}, - ) -} - -func DeepCopy_federation_Cluster(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Cluster) - out := out.(*Cluster) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_federation_ClusterSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_federation_ClusterStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_federation_ClusterCondition(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterCondition) - out := out.(*ClusterCondition) - out.Type = in.Type - out.Status = in.Status - out.LastProbeTime = in.LastProbeTime.DeepCopy() - out.LastTransitionTime = in.LastTransitionTime.DeepCopy() - out.Reason = in.Reason - out.Message = in.Message - return nil - } -} - -func DeepCopy_federation_ClusterList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterList) - out := out.(*ClusterList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - if err := DeepCopy_federation_Cluster(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_federation_ClusterReplicaSetPreferences(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterReplicaSetPreferences) - out := out.(*ClusterReplicaSetPreferences) - out.MinReplicas = in.MinReplicas - if in.MaxReplicas != nil { - in, out := &in.MaxReplicas, &out.MaxReplicas - *out = new(int64) - **out = **in - } else { - out.MaxReplicas = nil - } - out.Weight = in.Weight - return nil - } -} - -func DeepCopy_federation_ClusterSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterSpec) - out := out.(*ClusterSpec) - if in.ServerAddressByClientCIDRs != nil { - in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs - *out = make([]ServerAddressByClientCIDR, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.ServerAddressByClientCIDRs = nil - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(api.LocalObjectReference) - **out = **in - } else { - out.SecretRef = nil - } - return nil - } -} - -func DeepCopy_federation_ClusterStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterStatus) - out := out.(*ClusterStatus) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ClusterCondition, len(*in)) - for i := range *in { - if err := DeepCopy_federation_ClusterCondition(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Zones != nil { - in, out := &in.Zones, &out.Zones - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Zones = nil - } - out.Region = in.Region - return nil - } -} - -func DeepCopy_federation_FederatedReplicaSetPreferences(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*FederatedReplicaSetPreferences) - out := out.(*FederatedReplicaSetPreferences) - out.Rebalance = in.Rebalance - if in.Clusters != nil { - in, out := &in.Clusters, &out.Clusters - *out = make(map[string]ClusterReplicaSetPreferences) - for key, val := range *in { - newVal := new(ClusterReplicaSetPreferences) - if err := DeepCopy_federation_ClusterReplicaSetPreferences(&val, newVal, c); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Clusters = nil - } - return nil - } -} - -func DeepCopy_federation_ServerAddressByClientCIDR(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServerAddressByClientCIDR) - out := out.(*ServerAddressByClientCIDR) - out.ClientCIDR = in.ClientCIDR - out.ServerAddress = in.ServerAddress - return nil - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/doc.go b/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/doc.go deleted file mode 100644 index ebc1cc59..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/doc.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2015 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 qos contains helper functions for quality of service. -// For each resource (memory, CPU) Kubelet supports three classes of containers. -// Memory guaranteed containers will receive the highest priority and will get all the resources -// they need. -// Burstable containers will be guaranteed their request and can “burst” and use more resources -// when available. -// Best-Effort containers, which don’t specify a request, can use resources only if not being used -// by other pods. -package qos diff --git a/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/policy.go b/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/policy.go deleted file mode 100644 index 304be9df..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/policy.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2015 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 qos - -import ( - "k8s.io/client-go/pkg/api" -) - -const ( - // PodInfraOOMAdj is very docker specific. For arbitrary runtime, it may not make - // sense to set sandbox level oom score, e.g. a sandbox could only be a namespace - // without a process. - // TODO: Handle infra container oom score adj in a runtime agnostic way. - PodInfraOOMAdj int = -998 - KubeletOOMScoreAdj int = -999 - DockerOOMScoreAdj int = -999 - KubeProxyOOMScoreAdj int = -999 - guaranteedOOMScoreAdj int = -998 - besteffortOOMScoreAdj int = 1000 -) - -// GetContainerOOMAdjust returns the amount by which the OOM score of all processes in the -// container should be adjusted. -// The OOM score of a process is the percentage of memory it consumes -// multiplied by 10 (barring exceptional cases) + a configurable quantity which is between -1000 -// and 1000. Containers with higher OOM scores are killed if the system runs out of memory. -// See https://lwn.net/Articles/391222/ for more information. -func GetContainerOOMScoreAdjust(pod *api.Pod, container *api.Container, memoryCapacity int64) int { - switch GetPodQOS(pod) { - case Guaranteed: - // Guaranteed containers should be the last to get killed. - return guaranteedOOMScoreAdj - case BestEffort: - return besteffortOOMScoreAdj - } - - // Burstable containers are a middle tier, between Guaranteed and Best-Effort. Ideally, - // we want to protect Burstable containers that consume less memory than requested. - // The formula below is a heuristic. A container requesting for 10% of a system's - // memory will have an OOM score adjust of 900. If a process in container Y - // uses over 10% of memory, its OOM score will be 1000. The idea is that containers - // which use more than their request will have an OOM score of 1000 and will be prime - // targets for OOM kills. - // Note that this is a heuristic, it won't work if a container has many small processes. - memoryRequest := container.Resources.Requests.Memory().Value() - oomScoreAdjust := 1000 - (1000*memoryRequest)/memoryCapacity - // A guaranteed pod using 100% of memory can have an OOM score of 10. Ensure - // that burstable pods have a higher OOM score adjustment. - if int(oomScoreAdjust) < (1000 + guaranteedOOMScoreAdj) { - return (1000 + guaranteedOOMScoreAdj) - } - // Give burstable pods a higher chance of survival over besteffort pods. - if int(oomScoreAdjust) == besteffortOOMScoreAdj { - return int(oomScoreAdjust - 1) - } - return int(oomScoreAdjust) -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/qos.go b/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/qos.go deleted file mode 100644 index 0c408483..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/qos.go +++ /dev/null @@ -1,146 +0,0 @@ -/* -Copyright 2015 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 qos - -import ( - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/resource" - "k8s.io/client-go/pkg/util/sets" -) - -// isResourceGuaranteed returns true if the container's resource requirements are Guaranteed. -func isResourceGuaranteed(container *api.Container, resource api.ResourceName) bool { - // A container resource is guaranteed if its request == limit. - // If request == limit, the user is very confident of resource consumption. - req, hasReq := container.Resources.Requests[resource] - limit, hasLimit := container.Resources.Limits[resource] - if !hasReq || !hasLimit { - return false - } - return req.Cmp(limit) == 0 && req.Value() != 0 -} - -// isResourceBestEffort returns true if the container's resource requirements are best-effort. -func isResourceBestEffort(container *api.Container, resource api.ResourceName) bool { - // A container resource is best-effort if its request is unspecified or 0. - // If a request is specified, then the user expects some kind of resource guarantee. - req, hasReq := container.Resources.Requests[resource] - return !hasReq || req.Value() == 0 -} - -// GetPodQOS returns the QoS class of a pod. -// A pod is besteffort if none of its containers have specified any requests or limits. -// A pod is guaranteed only when requests and limits are specified for all the containers and they are equal. -// A pod is burstable if limits and requests do not match across all containers. -func GetPodQOS(pod *api.Pod) QOSClass { - requests := api.ResourceList{} - limits := api.ResourceList{} - zeroQuantity := resource.MustParse("0") - isGuaranteed := true - for _, container := range pod.Spec.Containers { - // process requests - for name, quantity := range container.Resources.Requests { - if !supportedQoSComputeResources.Has(string(name)) { - continue - } - if quantity.Cmp(zeroQuantity) == 1 { - delta := quantity.Copy() - if _, exists := requests[name]; !exists { - requests[name] = *delta - } else { - delta.Add(requests[name]) - requests[name] = *delta - } - } - } - // process limits - qosLimitsFound := sets.NewString() - for name, quantity := range container.Resources.Limits { - if !supportedQoSComputeResources.Has(string(name)) { - continue - } - if quantity.Cmp(zeroQuantity) == 1 { - qosLimitsFound.Insert(string(name)) - delta := quantity.Copy() - if _, exists := limits[name]; !exists { - limits[name] = *delta - } else { - delta.Add(limits[name]) - limits[name] = *delta - } - } - } - - if len(qosLimitsFound) != len(supportedQoSComputeResources) { - isGuaranteed = false - } - } - if len(requests) == 0 && len(limits) == 0 { - return BestEffort - } - // Check is requests match limits for all resources. - if isGuaranteed { - for name, req := range requests { - if lim, exists := limits[name]; !exists || lim.Cmp(req) != 0 { - isGuaranteed = false - break - } - } - } - if isGuaranteed && - len(requests) == len(limits) { - return Guaranteed - } - return Burstable -} - -// QOSList is a set of (resource name, QoS class) pairs. -type QOSList map[api.ResourceName]QOSClass - -// GetQOS returns a mapping of resource name to QoS class of a container -func GetQOS(container *api.Container) QOSList { - resourceToQOS := QOSList{} - for resource := range allResources(container) { - switch { - case isResourceGuaranteed(container, resource): - resourceToQOS[resource] = Guaranteed - case isResourceBestEffort(container, resource): - resourceToQOS[resource] = BestEffort - default: - resourceToQOS[resource] = Burstable - } - } - return resourceToQOS -} - -// supportedComputeResources is the list of compute resources for with QoS is supported. -var supportedQoSComputeResources = sets.NewString(string(api.ResourceCPU), string(api.ResourceMemory)) - -// allResources returns a set of all possible resources whose mapped key value is true if present on the container -func allResources(container *api.Container) map[api.ResourceName]bool { - resources := map[api.ResourceName]bool{} - for _, resource := range supportedQoSComputeResources.List() { - resources[api.ResourceName(resource)] = false - } - for resource := range container.Resources.Requests { - resources[resource] = true - } - for resource := range container.Resources.Limits { - resources[resource] = true - } - return resources -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/types.go b/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/types.go deleted file mode 100644 index e52dece4..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/kubelet/qos/types.go +++ /dev/null @@ -1,29 +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 qos - -// QOSClass defines the supported qos classes of Pods/Containers. -type QOSClass string - -const ( - // Guaranteed is the Guaranteed qos class. - Guaranteed QOSClass = "Guaranteed" - // Burstable is the Burstable qos class. - Burstable QOSClass = "Burstable" - // BestEffort is the BestEffort qos class. - BestEffort QOSClass = "BestEffort" -) diff --git a/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/constants.go b/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/constants.go deleted file mode 100644 index eeabba01..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/constants.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2015 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 types - -const ( - // system default DNS resolver configuration - ResolvConfDefault = "/etc/resolv.conf" -) diff --git a/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/doc.go b/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/doc.go deleted file mode 100644 index 0d9efe50..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2015 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. -*/ - -// Common types in the Kubelet. -package types diff --git a/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/labels.go b/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/labels.go deleted file mode 100644 index c4dad630..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/labels.go +++ /dev/null @@ -1,40 +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 types - -const ( - KubernetesPodNameLabel = "io.kubernetes.pod.name" - KubernetesPodNamespaceLabel = "io.kubernetes.pod.namespace" - KubernetesPodUIDLabel = "io.kubernetes.pod.uid" - KubernetesContainerNameLabel = "io.kubernetes.container.name" -) - -func GetContainerName(labels map[string]string) string { - return labels[KubernetesContainerNameLabel] -} - -func GetPodName(labels map[string]string) string { - return labels[KubernetesPodNameLabel] -} - -func GetPodUID(labels map[string]string) string { - return labels[KubernetesPodUIDLabel] -} - -func GetPodNamespace(labels map[string]string) string { - return labels[KubernetesPodNamespaceLabel] -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/pod_update.go b/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/pod_update.go deleted file mode 100644 index fb7ac4c9..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/pod_update.go +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright 2014 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 types - -import ( - "fmt" - - "k8s.io/client-go/pkg/api" -) - -const ConfigSourceAnnotationKey = "kubernetes.io/config.source" -const ConfigMirrorAnnotationKey = "kubernetes.io/config.mirror" -const ConfigFirstSeenAnnotationKey = "kubernetes.io/config.seen" -const ConfigHashAnnotationKey = "kubernetes.io/config.hash" - -// PodOperation defines what changes will be made on a pod configuration. -type PodOperation int - -const ( - // This is the current pod configuration - SET PodOperation = iota - // Pods with the given ids are new to this source - ADD - // Pods with the given ids are gracefully deleted from this source - DELETE - // Pods with the given ids have been removed from this source - REMOVE - // Pods with the given ids have been updated in this source - UPDATE - // Pods with the given ids have unexpected status in this source, - // kubelet should reconcile status with this source - RECONCILE - - // These constants identify the sources of pods - // Updates from a file - FileSource = "file" - // Updates from querying a web page - HTTPSource = "http" - // Updates from Kubernetes API Server - ApiserverSource = "api" - // Updates from all sources - AllSource = "*" - - NamespaceDefault = api.NamespaceDefault -) - -// PodUpdate defines an operation sent on the channel. You can add or remove single services by -// sending an array of size one and Op == ADD|REMOVE (with REMOVE, only the ID is required). -// For setting the state of the system to a given state for this source configuration, set -// Pods as desired and Op to SET, which will reset the system state to that specified in this -// operation for this source channel. To remove all pods, set Pods to empty object and Op to SET. -// -// Additionally, Pods should never be nil - it should always point to an empty slice. While -// functionally similar, this helps our unit tests properly check that the correct PodUpdates -// are generated. -type PodUpdate struct { - Pods []*api.Pod - Op PodOperation - Source string -} - -// Gets all validated sources from the specified sources. -func GetValidatedSources(sources []string) ([]string, error) { - validated := make([]string, 0, len(sources)) - for _, source := range sources { - switch source { - case AllSource: - return []string{FileSource, HTTPSource, ApiserverSource}, nil - case FileSource, HTTPSource, ApiserverSource: - validated = append(validated, source) - break - case "": - break - default: - return []string{}, fmt.Errorf("unknown pod source %q", source) - } - } - return validated, nil -} - -// GetPodSource returns the source of the pod based on the annotation. -func GetPodSource(pod *api.Pod) (string, error) { - if pod.Annotations != nil { - if source, ok := pod.Annotations[ConfigSourceAnnotationKey]; ok { - return source, nil - } - } - return "", fmt.Errorf("cannot get source of pod %q", pod.UID) -} - -// SyncPodType classifies pod updates, eg: create, update. -type SyncPodType int - -const ( - // SyncPodSync is when the pod is synced to ensure desired state - SyncPodSync SyncPodType = iota - // SyncPodUpdate is when the pod is updated from source - SyncPodUpdate - // SyncPodCreate is when the pod is created from source - SyncPodCreate - // SyncPodKill is when the pod is killed based on a trigger internal to the kubelet for eviction. - // If a SyncPodKill request is made to pod workers, the request is never dropped, and will always be processed. - SyncPodKill -) - -func (sp SyncPodType) String() string { - switch sp { - case SyncPodCreate: - return "create" - case SyncPodUpdate: - return "update" - case SyncPodSync: - return "sync" - case SyncPodKill: - return "kill" - default: - return "unknown" - } -} diff --git a/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/types.go b/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/types.go deleted file mode 100644 index 7009cea2..00000000 --- a/nfs/vendor/k8s.io/client-go/pkg/kubelet/types/types.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright 2015 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 types - -import ( - "net/http" - "time" - - "k8s.io/client-go/pkg/api" -) - -// TODO: Reconcile custom types in kubelet/types and this subpackage - -type HttpGetter interface { - Get(url string) (*http.Response, error) -} - -// Timestamp wraps around time.Time and offers utilities to format and parse -// the time using RFC3339Nano -type Timestamp struct { - time time.Time -} - -// NewTimestamp returns a Timestamp object using the current time. -func NewTimestamp() *Timestamp { - return &Timestamp{time.Now()} -} - -// ConvertToTimestamp takes a string, parses it using the RFC3339Nano layout, -// and converts it to a Timestamp object. -func ConvertToTimestamp(timeString string) *Timestamp { - parsed, _ := time.Parse(time.RFC3339Nano, timeString) - return &Timestamp{parsed} -} - -// Get returns the time as time.Time. -func (t *Timestamp) Get() time.Time { - return t.time -} - -// GetString returns the time in the string format using the RFC3339Nano -// layout. -func (t *Timestamp) GetString() string { - return t.time.Format(time.RFC3339Nano) -} - -// A type to help sort container statuses based on container names. -type SortedContainerStatuses []api.ContainerStatus - -func (s SortedContainerStatuses) Len() int { return len(s) } -func (s SortedContainerStatuses) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -func (s SortedContainerStatuses) Less(i, j int) bool { - return s[i].Name < s[j].Name -} - -// SortInitContainerStatuses ensures that statuses are in the order that their -// init container appears in the pod spec -func SortInitContainerStatuses(p *api.Pod, statuses []api.ContainerStatus) { - containers := p.Spec.InitContainers - current := 0 - for _, container := range containers { - for j := current; j < len(statuses); j++ { - if container.Name == statuses[j].Name { - statuses[current], statuses[j] = statuses[j], statuses[current] - current++ - break - } - } - } -} - -// Reservation represents reserved resources for non-pod components. -type Reservation struct { - // System represents resources reserved for non-kubernetes components. - System api.ResourceList - // Kubernetes represents resources reserved for kubernetes system components. - Kubernetes api.ResourceList -} diff --git a/nfs/vendor/k8s.io/client-go/tools/cache/testing/fake_controller_source.go b/nfs/vendor/k8s.io/client-go/tools/cache/testing/fake_controller_source.go deleted file mode 100644 index 6eb6ca87..00000000 --- a/nfs/vendor/k8s.io/client-go/tools/cache/testing/fake_controller_source.go +++ /dev/null @@ -1,262 +0,0 @@ -/* -Copyright 2015 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 framework - -import ( - "errors" - "math/rand" - "strconv" - "sync" - - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/meta" - "k8s.io/client-go/pkg/runtime" - "k8s.io/client-go/pkg/types" - "k8s.io/client-go/pkg/watch" -) - -func NewFakeControllerSource() *FakeControllerSource { - return &FakeControllerSource{ - Items: map[nnu]runtime.Object{}, - Broadcaster: watch.NewBroadcaster(100, watch.WaitIfChannelFull), - } -} - -func NewFakePVControllerSource() *FakePVControllerSource { - return &FakePVControllerSource{ - FakeControllerSource{ - Items: map[nnu]runtime.Object{}, - Broadcaster: watch.NewBroadcaster(100, watch.WaitIfChannelFull), - }} -} - -func NewFakePVCControllerSource() *FakePVCControllerSource { - return &FakePVCControllerSource{ - FakeControllerSource{ - Items: map[nnu]runtime.Object{}, - Broadcaster: watch.NewBroadcaster(100, watch.WaitIfChannelFull), - }} -} - -// FakeControllerSource implements listing/watching for testing. -type FakeControllerSource struct { - lock sync.RWMutex - Items map[nnu]runtime.Object - changes []watch.Event // one change per resourceVersion - Broadcaster *watch.Broadcaster -} - -type FakePVControllerSource struct { - FakeControllerSource -} - -type FakePVCControllerSource struct { - FakeControllerSource -} - -// namespace, name, uid to be used as a key. -type nnu struct { - namespace, name string - uid types.UID -} - -// Add adds an object to the set and sends an add event to watchers. -// obj's ResourceVersion is set. -func (f *FakeControllerSource) Add(obj runtime.Object) { - f.Change(watch.Event{Type: watch.Added, Object: obj}, 1) -} - -// Modify updates an object in the set and sends a modified event to watchers. -// obj's ResourceVersion is set. -func (f *FakeControllerSource) Modify(obj runtime.Object) { - f.Change(watch.Event{Type: watch.Modified, Object: obj}, 1) -} - -// Delete deletes an object from the set and sends a delete event to watchers. -// obj's ResourceVersion is set. -func (f *FakeControllerSource) Delete(lastValue runtime.Object) { - f.Change(watch.Event{Type: watch.Deleted, Object: lastValue}, 1) -} - -// AddDropWatch adds an object to the set but forgets to send an add event to -// watchers. -// obj's ResourceVersion is set. -func (f *FakeControllerSource) AddDropWatch(obj runtime.Object) { - f.Change(watch.Event{Type: watch.Added, Object: obj}, 0) -} - -// ModifyDropWatch updates an object in the set but forgets to send a modify -// event to watchers. -// obj's ResourceVersion is set. -func (f *FakeControllerSource) ModifyDropWatch(obj runtime.Object) { - f.Change(watch.Event{Type: watch.Modified, Object: obj}, 0) -} - -// DeleteDropWatch deletes an object from the set but forgets to send a delete -// event to watchers. -// obj's ResourceVersion is set. -func (f *FakeControllerSource) DeleteDropWatch(lastValue runtime.Object) { - f.Change(watch.Event{Type: watch.Deleted, Object: lastValue}, 0) -} - -func (f *FakeControllerSource) key(accessor meta.Object) nnu { - return nnu{accessor.GetNamespace(), accessor.GetName(), accessor.GetUID()} -} - -// Change records the given event (setting the object's resource version) and -// sends a watch event with the specified probability. -func (f *FakeControllerSource) Change(e watch.Event, watchProbability float64) { - f.lock.Lock() - defer f.lock.Unlock() - - accessor, err := meta.Accessor(e.Object) - if err != nil { - panic(err) // this is test code only - } - - resourceVersion := len(f.changes) + 1 - accessor.SetResourceVersion(strconv.Itoa(resourceVersion)) - f.changes = append(f.changes, e) - key := f.key(accessor) - switch e.Type { - case watch.Added, watch.Modified: - f.Items[key] = e.Object - case watch.Deleted: - delete(f.Items, key) - } - - if rand.Float64() < watchProbability { - f.Broadcaster.Action(e.Type, e.Object) - } -} - -func (f *FakeControllerSource) getListItemsLocked() ([]runtime.Object, error) { - list := make([]runtime.Object, 0, len(f.Items)) - for _, obj := range f.Items { - // Must make a copy to allow clients to modify the object. - // Otherwise, if they make a change and write it back, they - // will inadvertently change our canonical copy (in - // addition to racing with other clients). - objCopy, err := api.Scheme.DeepCopy(obj) - if err != nil { - return nil, err - } - list = append(list, objCopy.(runtime.Object)) - } - return list, nil -} - -// List returns a list object, with its resource version set. -func (f *FakeControllerSource) List(options api.ListOptions) (runtime.Object, error) { - f.lock.RLock() - defer f.lock.RUnlock() - list, err := f.getListItemsLocked() - if err != nil { - return nil, err - } - listObj := &api.List{} - if err := meta.SetList(listObj, list); err != nil { - return nil, err - } - objMeta, err := api.ListMetaFor(listObj) - if err != nil { - return nil, err - } - resourceVersion := len(f.changes) - objMeta.ResourceVersion = strconv.Itoa(resourceVersion) - return listObj, nil -} - -// List returns a list object, with its resource version set. -func (f *FakePVControllerSource) List(options api.ListOptions) (runtime.Object, error) { - f.lock.RLock() - defer f.lock.RUnlock() - list, err := f.FakeControllerSource.getListItemsLocked() - if err != nil { - return nil, err - } - listObj := &api.PersistentVolumeList{} - if err := meta.SetList(listObj, list); err != nil { - return nil, err - } - objMeta, err := api.ListMetaFor(listObj) - if err != nil { - return nil, err - } - resourceVersion := len(f.changes) - objMeta.ResourceVersion = strconv.Itoa(resourceVersion) - return listObj, nil -} - -// List returns a list object, with its resource version set. -func (f *FakePVCControllerSource) List(options api.ListOptions) (runtime.Object, error) { - f.lock.RLock() - defer f.lock.RUnlock() - list, err := f.FakeControllerSource.getListItemsLocked() - if err != nil { - return nil, err - } - listObj := &api.PersistentVolumeClaimList{} - if err := meta.SetList(listObj, list); err != nil { - return nil, err - } - objMeta, err := api.ListMetaFor(listObj) - if err != nil { - return nil, err - } - resourceVersion := len(f.changes) - objMeta.ResourceVersion = strconv.Itoa(resourceVersion) - return listObj, nil -} - -// Watch returns a watch, which will be pre-populated with all changes -// after resourceVersion. -func (f *FakeControllerSource) Watch(options api.ListOptions) (watch.Interface, error) { - f.lock.RLock() - defer f.lock.RUnlock() - rc, err := strconv.Atoi(options.ResourceVersion) - if err != nil { - return nil, err - } - if rc < len(f.changes) { - changes := []watch.Event{} - for _, c := range f.changes[rc:] { - // Must make a copy to allow clients to modify the - // object. Otherwise, if they make a change and write - // it back, they will inadvertently change the our - // canonical copy (in addition to racing with other - // clients). - objCopy, err := api.Scheme.DeepCopy(c.Object) - if err != nil { - return nil, err - } - changes = append(changes, watch.Event{Type: c.Type, Object: objCopy.(runtime.Object)}) - } - return f.Broadcaster.WatchWithPrefix(changes), nil - } else if rc > len(f.changes) { - return nil, errors.New("resource version in the future not supported by this fake") - } - return f.Broadcaster.Watch(), nil -} - -// Shutdown closes the underlying broadcaster, waiting for events to be -// delivered. It's an error to call any method after calling shutdown. This is -// enforced by Shutdown() leaving f locked. -func (f *FakeControllerSource) Shutdown() { - f.lock.Lock() // Purposely no unlock. - f.Broadcaster.Shutdown() -}