diff --git a/Gopkg.lock b/Gopkg.lock index aa7ec96e9b..4e4d120f95 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1,6 +1,12 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. +[[projects]] + branch = "master" + name = "github.com/beorn7/perks" + packages = ["quantile"] + revision = "3a771d992973f24aa725d07868b467d1ddfceafb" + [[projects]] name = "github.com/container-storage-interface/spec" packages = ["lib/go/csi/v0"] @@ -60,12 +66,6 @@ revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" version = "v1.1.0" -[[projects]] - branch = "master" - name = "github.com/google/btree" - packages = ["."] - revision = "e89373fe6b4a7413d7acd6da1725b83ef713e6e4" - [[projects]] branch = "master" name = "github.com/google/gofuzz" @@ -82,15 +82,6 @@ revision = "7c663266750e7d82587642f65e60bc4083f1f84e" version = "v0.2.0" -[[projects]] - branch = "master" - name = "github.com/gregjones/httpcache" - packages = [ - ".", - "diskcache" - ] - revision = "9cad4c3443a7200dd6400aef47183728de563a38" - [[projects]] branch = "master" name = "github.com/hashicorp/golang-lru" @@ -118,12 +109,6 @@ revision = "ca39e5af3ece67bbcda3d0f4f56a8e24d9f2dad4" version = "1.1.3" -[[projects]] - name = "github.com/juju/ratelimit" - packages = ["."] - revision = "59fac5042749a5afb9af70e813da1dd5474f0167" - version = "1.0.1" - [[projects]] branch = "master" name = "github.com/kubernetes-csi/csi-test" @@ -134,14 +119,22 @@ revision = "b17d456bc0eaad4c7bf233ded7cf0db4ea13c725" [[projects]] - branch = "master" name = "github.com/kubernetes-incubator/external-storage" packages = [ "lib/controller", + "lib/controller/metrics", "lib/leaderelection", - "lib/leaderelection/resourcelock" + "lib/leaderelection/resourcelock", + "lib/util" ] - revision = "7ddaa61b7b9d0cbc614e02229ef34532b316d423" + revision = "4530b2fca1e4bef4dbd2039cecbc9defa48232a2" + version = "v4.0.0-beta" + +[[projects]] + name = "github.com/matttproud/golang_protobuf_extensions" + packages = ["pbutil"] + revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" + version = "v1.0.1" [[projects]] name = "github.com/modern-go/concurrent" @@ -161,17 +154,41 @@ revision = "e790cca94e6cc75c7064b1332e63811d4aae1a53" version = "v1.1" +[[projects]] + name = "github.com/prometheus/client_golang" + packages = [ + "prometheus", + "prometheus/promhttp" + ] + revision = "c5b7fccd204277076155f10851dad72b76a49317" + version = "v0.8.0" + [[projects]] branch = "master" - name = "github.com/petar/GoLLRB" - packages = ["llrb"] - revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" + name = "github.com/prometheus/client_model" + packages = ["go"] + revision = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c" [[projects]] - name = "github.com/peterbourgon/diskv" - packages = ["."] - revision = "5f041e8faa004a95c88a202771f4cc3e991971e6" - version = "v2.0.1" + branch = "master" + name = "github.com/prometheus/common" + packages = [ + "expfmt", + "internal/bitbucket.org/ww/goautoneg", + "model" + ] + revision = "7600349dcfe1abd18d72d3a1770870d9800a7801" + +[[projects]] + branch = "master" + name = "github.com/prometheus/procfs" + packages = [ + ".", + "internal/util", + "nfs", + "xfs" + ] + revision = "ae68e2d4c00fed4943b5f6698d504a5fe083da8a" [[projects]] name = "github.com/spf13/pflag" @@ -229,6 +246,12 @@ revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" version = "v0.3.0" +[[projects]] + branch = "master" + name = "golang.org/x/time" + packages = ["rate"] + revision = "fbb02b2291d28baffd63558aa44b4b56f178d650" + [[projects]] branch = "master" name = "google.golang.org/genproto" @@ -428,7 +451,10 @@ "kubernetes/typed/storage/v1alpha1/fake", "kubernetes/typed/storage/v1beta1", "kubernetes/typed/storage/v1beta1/fake", + "pkg/apis/clientauthentication", + "pkg/apis/clientauthentication/v1alpha1", "pkg/version", + "plugin/pkg/client/auth/exec", "rest", "rest/watch", "testing", @@ -447,10 +473,12 @@ "util/cert", "util/flowcontrol", "util/homedir", - "util/integer" + "util/integer", + "util/retry", + "util/workqueue" ] - revision = "78700dec6369ba22221b72770783300f143df150" - version = "v6.0.0" + revision = "23781f4d6632d88e869066eaebb743857aa1ef9b" + version = "v7.0.0" [[projects]] branch = "master" @@ -464,8 +492,6 @@ "pkg/apis/core", "pkg/apis/core/helper", "pkg/apis/core/v1/helper", - "pkg/util/goroutinemap", - "pkg/util/goroutinemap/exponentialbackoff", "pkg/util/version" ] revision = "5ca598b4ba5abb89bb773071ce452e33fb66339d" @@ -474,6 +500,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "62fff1f86cb848d9337d9e57112b560d42d2ee9dc0c0a8b8a34fb2f68a4d03b0" + inputs-digest = "7ea59abb4ca6c2e6cbc21b8709b364369925598f6de753f408d48c1a91db0de4" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index a9babbb72f..8943a21039 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -46,7 +46,7 @@ [[constraint]] name = "k8s.io/client-go" - version = "v6.0.0" + version = "v7.0.0" [[constraint]] name = "k8s.io/api" diff --git a/vendor/github.com/google/btree/.travis.yml b/vendor/github.com/google/btree/.travis.yml deleted file mode 100644 index 4f2ee4d973..0000000000 --- a/vendor/github.com/google/btree/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: go diff --git a/vendor/github.com/google/btree/LICENSE b/vendor/github.com/google/btree/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/google/btree/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/google/btree/README.md b/vendor/github.com/google/btree/README.md deleted file mode 100644 index 6062a4dacd..0000000000 --- a/vendor/github.com/google/btree/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# BTree implementation for Go - -![Travis CI Build Status](https://api.travis-ci.org/google/btree.svg?branch=master) - -This package provides an in-memory B-Tree implementation for Go, useful as -an ordered, mutable data structure. - -The API is based off of the wonderful -http://godoc.org/github.com/petar/GoLLRB/llrb, and is meant to allow btree to -act as a drop-in replacement for gollrb trees. - -See http://godoc.org/github.com/google/btree for documentation. diff --git a/vendor/github.com/google/btree/btree.go b/vendor/github.com/google/btree/btree.go deleted file mode 100644 index 7e4551d73b..0000000000 --- a/vendor/github.com/google/btree/btree.go +++ /dev/null @@ -1,881 +0,0 @@ -// Copyright 2014 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 btree implements in-memory B-Trees of arbitrary degree. -// -// btree implements an in-memory B-Tree for use as an ordered data structure. -// It is not meant for persistent storage solutions. -// -// It has a flatter structure than an equivalent red-black or other binary tree, -// which in some cases yields better memory usage and/or performance. -// See some discussion on the matter here: -// http://google-opensource.blogspot.com/2013/01/c-containers-that-save-memory-and-time.html -// Note, though, that this project is in no way related to the C++ B-Tree -// implementation written about there. -// -// Within this tree, each node contains a slice of items and a (possibly nil) -// slice of children. For basic numeric values or raw structs, this can cause -// efficiency differences when compared to equivalent C++ template code that -// stores values in arrays within the node: -// * Due to the overhead of storing values as interfaces (each -// value needs to be stored as the value itself, then 2 words for the -// interface pointing to that value and its type), resulting in higher -// memory use. -// * Since interfaces can point to values anywhere in memory, values are -// most likely not stored in contiguous blocks, resulting in a higher -// number of cache misses. -// These issues don't tend to matter, though, when working with strings or other -// heap-allocated structures, since C++-equivalent structures also must store -// pointers and also distribute their values across the heap. -// -// This implementation is designed to be a drop-in replacement to gollrb.LLRB -// trees, (http://github.com/petar/gollrb), an excellent and probably the most -// widely used ordered tree implementation in the Go ecosystem currently. -// Its functions, therefore, exactly mirror those of -// llrb.LLRB where possible. Unlike gollrb, though, we currently don't -// support storing multiple equivalent values. -package btree - -import ( - "fmt" - "io" - "sort" - "strings" - "sync" -) - -// Item represents a single object in the tree. -type Item interface { - // Less tests whether the current item is less than the given argument. - // - // This must provide a strict weak ordering. - // If !a.Less(b) && !b.Less(a), we treat this to mean a == b (i.e. we can only - // hold one of either a or b in the tree). - Less(than Item) bool -} - -const ( - DefaultFreeListSize = 32 -) - -var ( - nilItems = make(items, 16) - nilChildren = make(children, 16) -) - -// FreeList represents a free list of btree nodes. By default each -// BTree has its own FreeList, but multiple BTrees can share the same -// FreeList. -// Two Btrees using the same freelist are safe for concurrent write access. -type FreeList struct { - mu sync.Mutex - freelist []*node -} - -// NewFreeList creates a new free list. -// size is the maximum size of the returned free list. -func NewFreeList(size int) *FreeList { - return &FreeList{freelist: make([]*node, 0, size)} -} - -func (f *FreeList) newNode() (n *node) { - f.mu.Lock() - index := len(f.freelist) - 1 - if index < 0 { - f.mu.Unlock() - return new(node) - } - n = f.freelist[index] - f.freelist[index] = nil - f.freelist = f.freelist[:index] - f.mu.Unlock() - return -} - -// freeNode adds the given node to the list, returning true if it was added -// and false if it was discarded. -func (f *FreeList) freeNode(n *node) (out bool) { - f.mu.Lock() - if len(f.freelist) < cap(f.freelist) { - f.freelist = append(f.freelist, n) - out = true - } - f.mu.Unlock() - return -} - -// ItemIterator allows callers of Ascend* to iterate in-order over portions of -// the tree. When this function returns false, iteration will stop and the -// associated Ascend* function will immediately return. -type ItemIterator func(i Item) bool - -// New creates a new B-Tree with the given degree. -// -// New(2), for example, will create a 2-3-4 tree (each node contains 1-3 items -// and 2-4 children). -func New(degree int) *BTree { - return NewWithFreeList(degree, NewFreeList(DefaultFreeListSize)) -} - -// NewWithFreeList creates a new B-Tree that uses the given node free list. -func NewWithFreeList(degree int, f *FreeList) *BTree { - if degree <= 1 { - panic("bad degree") - } - return &BTree{ - degree: degree, - cow: ©OnWriteContext{freelist: f}, - } -} - -// items stores items in a node. -type items []Item - -// insertAt inserts a value into the given index, pushing all subsequent values -// forward. -func (s *items) insertAt(index int, item Item) { - *s = append(*s, nil) - if index < len(*s) { - copy((*s)[index+1:], (*s)[index:]) - } - (*s)[index] = item -} - -// removeAt removes a value at a given index, pulling all subsequent values -// back. -func (s *items) removeAt(index int) Item { - item := (*s)[index] - copy((*s)[index:], (*s)[index+1:]) - (*s)[len(*s)-1] = nil - *s = (*s)[:len(*s)-1] - return item -} - -// pop removes and returns the last element in the list. -func (s *items) pop() (out Item) { - index := len(*s) - 1 - out = (*s)[index] - (*s)[index] = nil - *s = (*s)[:index] - return -} - -// truncate truncates this instance at index so that it contains only the -// first index items. index must be less than or equal to length. -func (s *items) truncate(index int) { - var toClear items - *s, toClear = (*s)[:index], (*s)[index:] - for len(toClear) > 0 { - toClear = toClear[copy(toClear, nilItems):] - } -} - -// find returns the index where the given item should be inserted into this -// list. 'found' is true if the item already exists in the list at the given -// index. -func (s items) find(item Item) (index int, found bool) { - i := sort.Search(len(s), func(i int) bool { - return item.Less(s[i]) - }) - if i > 0 && !s[i-1].Less(item) { - return i - 1, true - } - return i, false -} - -// children stores child nodes in a node. -type children []*node - -// insertAt inserts a value into the given index, pushing all subsequent values -// forward. -func (s *children) insertAt(index int, n *node) { - *s = append(*s, nil) - if index < len(*s) { - copy((*s)[index+1:], (*s)[index:]) - } - (*s)[index] = n -} - -// removeAt removes a value at a given index, pulling all subsequent values -// back. -func (s *children) removeAt(index int) *node { - n := (*s)[index] - copy((*s)[index:], (*s)[index+1:]) - (*s)[len(*s)-1] = nil - *s = (*s)[:len(*s)-1] - return n -} - -// pop removes and returns the last element in the list. -func (s *children) pop() (out *node) { - index := len(*s) - 1 - out = (*s)[index] - (*s)[index] = nil - *s = (*s)[:index] - return -} - -// truncate truncates this instance at index so that it contains only the -// first index children. index must be less than or equal to length. -func (s *children) truncate(index int) { - var toClear children - *s, toClear = (*s)[:index], (*s)[index:] - for len(toClear) > 0 { - toClear = toClear[copy(toClear, nilChildren):] - } -} - -// node is an internal node in a tree. -// -// It must at all times maintain the invariant that either -// * len(children) == 0, len(items) unconstrained -// * len(children) == len(items) + 1 -type node struct { - items items - children children - cow *copyOnWriteContext -} - -func (n *node) mutableFor(cow *copyOnWriteContext) *node { - if n.cow == cow { - return n - } - out := cow.newNode() - if cap(out.items) >= len(n.items) { - out.items = out.items[:len(n.items)] - } else { - out.items = make(items, len(n.items), cap(n.items)) - } - copy(out.items, n.items) - // Copy children - if cap(out.children) >= len(n.children) { - out.children = out.children[:len(n.children)] - } else { - out.children = make(children, len(n.children), cap(n.children)) - } - copy(out.children, n.children) - return out -} - -func (n *node) mutableChild(i int) *node { - c := n.children[i].mutableFor(n.cow) - n.children[i] = c - return c -} - -// split splits the given node at the given index. The current node shrinks, -// and this function returns the item that existed at that index and a new node -// containing all items/children after it. -func (n *node) split(i int) (Item, *node) { - item := n.items[i] - next := n.cow.newNode() - next.items = append(next.items, n.items[i+1:]...) - n.items.truncate(i) - if len(n.children) > 0 { - next.children = append(next.children, n.children[i+1:]...) - n.children.truncate(i + 1) - } - return item, next -} - -// maybeSplitChild checks if a child should be split, and if so splits it. -// Returns whether or not a split occurred. -func (n *node) maybeSplitChild(i, maxItems int) bool { - if len(n.children[i].items) < maxItems { - return false - } - first := n.mutableChild(i) - item, second := first.split(maxItems / 2) - n.items.insertAt(i, item) - n.children.insertAt(i+1, second) - return true -} - -// insert inserts an item into the subtree rooted at this node, making sure -// no nodes in the subtree exceed maxItems items. Should an equivalent item be -// be found/replaced by insert, it will be returned. -func (n *node) insert(item Item, maxItems int) Item { - i, found := n.items.find(item) - if found { - out := n.items[i] - n.items[i] = item - return out - } - if len(n.children) == 0 { - n.items.insertAt(i, item) - return nil - } - if n.maybeSplitChild(i, maxItems) { - inTree := n.items[i] - switch { - case item.Less(inTree): - // no change, we want first split node - case inTree.Less(item): - i++ // we want second split node - default: - out := n.items[i] - n.items[i] = item - return out - } - } - return n.mutableChild(i).insert(item, maxItems) -} - -// get finds the given key in the subtree and returns it. -func (n *node) get(key Item) Item { - i, found := n.items.find(key) - if found { - return n.items[i] - } else if len(n.children) > 0 { - return n.children[i].get(key) - } - return nil -} - -// min returns the first item in the subtree. -func min(n *node) Item { - if n == nil { - return nil - } - for len(n.children) > 0 { - n = n.children[0] - } - if len(n.items) == 0 { - return nil - } - return n.items[0] -} - -// max returns the last item in the subtree. -func max(n *node) Item { - if n == nil { - return nil - } - for len(n.children) > 0 { - n = n.children[len(n.children)-1] - } - if len(n.items) == 0 { - return nil - } - return n.items[len(n.items)-1] -} - -// toRemove details what item to remove in a node.remove call. -type toRemove int - -const ( - removeItem toRemove = iota // removes the given item - removeMin // removes smallest item in the subtree - removeMax // removes largest item in the subtree -) - -// remove removes an item from the subtree rooted at this node. -func (n *node) remove(item Item, minItems int, typ toRemove) Item { - var i int - var found bool - switch typ { - case removeMax: - if len(n.children) == 0 { - return n.items.pop() - } - i = len(n.items) - case removeMin: - if len(n.children) == 0 { - return n.items.removeAt(0) - } - i = 0 - case removeItem: - i, found = n.items.find(item) - if len(n.children) == 0 { - if found { - return n.items.removeAt(i) - } - return nil - } - default: - panic("invalid type") - } - // If we get to here, we have children. - if len(n.children[i].items) <= minItems { - return n.growChildAndRemove(i, item, minItems, typ) - } - child := n.mutableChild(i) - // Either we had enough items to begin with, or we've done some - // merging/stealing, because we've got enough now and we're ready to return - // stuff. - if found { - // The item exists at index 'i', and the child we've selected can give us a - // predecessor, since if we've gotten here it's got > minItems items in it. - out := n.items[i] - // We use our special-case 'remove' call with typ=maxItem to pull the - // predecessor of item i (the rightmost leaf of our immediate left child) - // and set it into where we pulled the item from. - n.items[i] = child.remove(nil, minItems, removeMax) - return out - } - // Final recursive call. Once we're here, we know that the item isn't in this - // node and that the child is big enough to remove from. - return child.remove(item, minItems, typ) -} - -// growChildAndRemove grows child 'i' to make sure it's possible to remove an -// item from it while keeping it at minItems, then calls remove to actually -// remove it. -// -// Most documentation says we have to do two sets of special casing: -// 1) item is in this node -// 2) item is in child -// In both cases, we need to handle the two subcases: -// A) node has enough values that it can spare one -// B) node doesn't have enough values -// For the latter, we have to check: -// a) left sibling has node to spare -// b) right sibling has node to spare -// c) we must merge -// To simplify our code here, we handle cases #1 and #2 the same: -// If a node doesn't have enough items, we make sure it does (using a,b,c). -// We then simply redo our remove call, and the second time (regardless of -// whether we're in case 1 or 2), we'll have enough items and can guarantee -// that we hit case A. -func (n *node) growChildAndRemove(i int, item Item, minItems int, typ toRemove) Item { - if i > 0 && len(n.children[i-1].items) > minItems { - // Steal from left child - child := n.mutableChild(i) - stealFrom := n.mutableChild(i - 1) - stolenItem := stealFrom.items.pop() - child.items.insertAt(0, n.items[i-1]) - n.items[i-1] = stolenItem - if len(stealFrom.children) > 0 { - child.children.insertAt(0, stealFrom.children.pop()) - } - } else if i < len(n.items) && len(n.children[i+1].items) > minItems { - // steal from right child - child := n.mutableChild(i) - stealFrom := n.mutableChild(i + 1) - stolenItem := stealFrom.items.removeAt(0) - child.items = append(child.items, n.items[i]) - n.items[i] = stolenItem - if len(stealFrom.children) > 0 { - child.children = append(child.children, stealFrom.children.removeAt(0)) - } - } else { - if i >= len(n.items) { - i-- - } - child := n.mutableChild(i) - // merge with right child - mergeItem := n.items.removeAt(i) - mergeChild := n.children.removeAt(i + 1) - child.items = append(child.items, mergeItem) - child.items = append(child.items, mergeChild.items...) - child.children = append(child.children, mergeChild.children...) - n.cow.freeNode(mergeChild) - } - return n.remove(item, minItems, typ) -} - -type direction int - -const ( - descend = direction(-1) - ascend = direction(+1) -) - -// iterate provides a simple method for iterating over elements in the tree. -// -// When ascending, the 'start' should be less than 'stop' and when descending, -// the 'start' should be greater than 'stop'. Setting 'includeStart' to true -// will force the iterator to include the first item when it equals 'start', -// thus creating a "greaterOrEqual" or "lessThanEqual" rather than just a -// "greaterThan" or "lessThan" queries. -func (n *node) iterate(dir direction, start, stop Item, includeStart bool, hit bool, iter ItemIterator) (bool, bool) { - var ok bool - switch dir { - case ascend: - for i := 0; i < len(n.items); i++ { - if start != nil && n.items[i].Less(start) { - continue - } - if len(n.children) > 0 { - if hit, ok = n.children[i].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - if !includeStart && !hit && start != nil && !start.Less(n.items[i]) { - hit = true - continue - } - hit = true - if stop != nil && !n.items[i].Less(stop) { - return hit, false - } - if !iter(n.items[i]) { - return hit, false - } - } - if len(n.children) > 0 { - if hit, ok = n.children[len(n.children)-1].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - case descend: - for i := len(n.items) - 1; i >= 0; i-- { - if start != nil && !n.items[i].Less(start) { - if !includeStart || hit || start.Less(n.items[i]) { - continue - } - } - if len(n.children) > 0 { - if hit, ok = n.children[i+1].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - if stop != nil && !stop.Less(n.items[i]) { - return hit, false // continue - } - hit = true - if !iter(n.items[i]) { - return hit, false - } - } - if len(n.children) > 0 { - if hit, ok = n.children[0].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - } - return hit, true -} - -// Used for testing/debugging purposes. -func (n *node) print(w io.Writer, level int) { - fmt.Fprintf(w, "%sNODE:%v\n", strings.Repeat(" ", level), n.items) - for _, c := range n.children { - c.print(w, level+1) - } -} - -// BTree is an implementation of a B-Tree. -// -// BTree stores Item instances in an ordered structure, allowing easy insertion, -// removal, and iteration. -// -// Write operations are not safe for concurrent mutation by multiple -// goroutines, but Read operations are. -type BTree struct { - degree int - length int - root *node - cow *copyOnWriteContext -} - -// copyOnWriteContext pointers determine node ownership... a tree with a write -// context equivalent to a node's write context is allowed to modify that node. -// A tree whose write context does not match a node's is not allowed to modify -// it, and must create a new, writable copy (IE: it's a Clone). -// -// When doing any write operation, we maintain the invariant that the current -// node's context is equal to the context of the tree that requested the write. -// We do this by, before we descend into any node, creating a copy with the -// correct context if the contexts don't match. -// -// Since the node we're currently visiting on any write has the requesting -// tree's context, that node is modifiable in place. Children of that node may -// not share context, but before we descend into them, we'll make a mutable -// copy. -type copyOnWriteContext struct { - freelist *FreeList -} - -// Clone clones the btree, lazily. Clone should not be called concurrently, -// but the original tree (t) and the new tree (t2) can be used concurrently -// once the Clone call completes. -// -// The internal tree structure of b is marked read-only and shared between t and -// t2. Writes to both t and t2 use copy-on-write logic, creating new nodes -// whenever one of b's original nodes would have been modified. Read operations -// should have no performance degredation. Write operations for both t and t2 -// will initially experience minor slow-downs caused by additional allocs and -// copies due to the aforementioned copy-on-write logic, but should converge to -// the original performance characteristics of the original tree. -func (t *BTree) Clone() (t2 *BTree) { - // Create two entirely new copy-on-write contexts. - // This operation effectively creates three trees: - // the original, shared nodes (old b.cow) - // the new b.cow nodes - // the new out.cow nodes - cow1, cow2 := *t.cow, *t.cow - out := *t - t.cow = &cow1 - out.cow = &cow2 - return &out -} - -// maxItems returns the max number of items to allow per node. -func (t *BTree) maxItems() int { - return t.degree*2 - 1 -} - -// minItems returns the min number of items to allow per node (ignored for the -// root node). -func (t *BTree) minItems() int { - return t.degree - 1 -} - -func (c *copyOnWriteContext) newNode() (n *node) { - n = c.freelist.newNode() - n.cow = c - return -} - -type freeType int - -const ( - ftFreelistFull freeType = iota // node was freed (available for GC, not stored in freelist) - ftStored // node was stored in the freelist for later use - ftNotOwned // node was ignored by COW, since it's owned by another one -) - -// freeNode frees a node within a given COW context, if it's owned by that -// context. It returns what happened to the node (see freeType const -// documentation). -func (c *copyOnWriteContext) freeNode(n *node) freeType { - if n.cow == c { - // clear to allow GC - n.items.truncate(0) - n.children.truncate(0) - n.cow = nil - if c.freelist.freeNode(n) { - return ftStored - } else { - return ftFreelistFull - } - } else { - return ftNotOwned - } -} - -// ReplaceOrInsert adds the given item to the tree. If an item in the tree -// already equals the given one, it is removed from the tree and returned. -// Otherwise, nil is returned. -// -// nil cannot be added to the tree (will panic). -func (t *BTree) ReplaceOrInsert(item Item) Item { - if item == nil { - panic("nil item being added to BTree") - } - if t.root == nil { - t.root = t.cow.newNode() - t.root.items = append(t.root.items, item) - t.length++ - return nil - } else { - t.root = t.root.mutableFor(t.cow) - if len(t.root.items) >= t.maxItems() { - item2, second := t.root.split(t.maxItems() / 2) - oldroot := t.root - t.root = t.cow.newNode() - t.root.items = append(t.root.items, item2) - t.root.children = append(t.root.children, oldroot, second) - } - } - out := t.root.insert(item, t.maxItems()) - if out == nil { - t.length++ - } - return out -} - -// Delete removes an item equal to the passed in item from the tree, returning -// it. If no such item exists, returns nil. -func (t *BTree) Delete(item Item) Item { - return t.deleteItem(item, removeItem) -} - -// DeleteMin removes the smallest item in the tree and returns it. -// If no such item exists, returns nil. -func (t *BTree) DeleteMin() Item { - return t.deleteItem(nil, removeMin) -} - -// DeleteMax removes the largest item in the tree and returns it. -// If no such item exists, returns nil. -func (t *BTree) DeleteMax() Item { - return t.deleteItem(nil, removeMax) -} - -func (t *BTree) deleteItem(item Item, typ toRemove) Item { - if t.root == nil || len(t.root.items) == 0 { - return nil - } - t.root = t.root.mutableFor(t.cow) - out := t.root.remove(item, t.minItems(), typ) - if len(t.root.items) == 0 && len(t.root.children) > 0 { - oldroot := t.root - t.root = t.root.children[0] - t.cow.freeNode(oldroot) - } - if out != nil { - t.length-- - } - return out -} - -// AscendRange calls the iterator for every value in the tree within the range -// [greaterOrEqual, lessThan), until iterator returns false. -func (t *BTree) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, greaterOrEqual, lessThan, true, false, iterator) -} - -// AscendLessThan calls the iterator for every value in the tree within the range -// [first, pivot), until iterator returns false. -func (t *BTree) AscendLessThan(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, nil, pivot, false, false, iterator) -} - -// AscendGreaterOrEqual calls the iterator for every value in the tree within -// the range [pivot, last], until iterator returns false. -func (t *BTree) AscendGreaterOrEqual(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, pivot, nil, true, false, iterator) -} - -// Ascend calls the iterator for every value in the tree within the range -// [first, last], until iterator returns false. -func (t *BTree) Ascend(iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, nil, nil, false, false, iterator) -} - -// DescendRange calls the iterator for every value in the tree within the range -// [lessOrEqual, greaterThan), until iterator returns false. -func (t *BTree) DescendRange(lessOrEqual, greaterThan Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, lessOrEqual, greaterThan, true, false, iterator) -} - -// DescendLessOrEqual calls the iterator for every value in the tree within the range -// [pivot, first], until iterator returns false. -func (t *BTree) DescendLessOrEqual(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, pivot, nil, true, false, iterator) -} - -// DescendGreaterThan calls the iterator for every value in the tree within -// the range (pivot, last], until iterator returns false. -func (t *BTree) DescendGreaterThan(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, nil, pivot, false, false, iterator) -} - -// Descend calls the iterator for every value in the tree within the range -// [last, first], until iterator returns false. -func (t *BTree) Descend(iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, nil, nil, false, false, iterator) -} - -// Get looks for the key item in the tree, returning it. It returns nil if -// unable to find that item. -func (t *BTree) Get(key Item) Item { - if t.root == nil { - return nil - } - return t.root.get(key) -} - -// Min returns the smallest item in the tree, or nil if the tree is empty. -func (t *BTree) Min() Item { - return min(t.root) -} - -// Max returns the largest item in the tree, or nil if the tree is empty. -func (t *BTree) Max() Item { - return max(t.root) -} - -// Has returns true if the given key is in the tree. -func (t *BTree) Has(key Item) bool { - return t.Get(key) != nil -} - -// Len returns the number of items currently in the tree. -func (t *BTree) Len() int { - return t.length -} - -// Clear removes all items from the btree. If addNodesToFreelist is true, -// t's nodes are added to its freelist as part of this call, until the freelist -// is full. Otherwise, the root node is simply dereferenced and the subtree -// left to Go's normal GC processes. -// -// This can be much faster -// than calling Delete on all elements, because that requires finding/removing -// each element in the tree and updating the tree accordingly. It also is -// somewhat faster than creating a new tree to replace the old one, because -// nodes from the old tree are reclaimed into the freelist for use by the new -// one, instead of being lost to the garbage collector. -// -// This call takes: -// O(1): when addNodesToFreelist is false, this is a single operation. -// O(1): when the freelist is already full, it breaks out immediately -// O(freelist size): when the freelist is empty and the nodes are all owned -// by this tree, nodes are added to the freelist until full. -// O(tree size): when all nodes are owned by another tree, all nodes are -// iterated over looking for nodes to add to the freelist, and due to -// ownership, none are. -func (t *BTree) Clear(addNodesToFreelist bool) { - if t.root != nil && addNodesToFreelist { - t.root.reset(t.cow) - } - t.root, t.length = nil, 0 -} - -// reset returns a subtree to the freelist. It breaks out immediately if the -// freelist is full, since the only benefit of iterating is to fill that -// freelist up. Returns true if parent reset call should continue. -func (n *node) reset(c *copyOnWriteContext) bool { - for _, child := range n.children { - if !child.reset(c) { - return false - } - } - return c.freeNode(n) != ftFreelistFull -} - -// Int implements the Item interface for integers. -type Int int - -// Less returns true if int(a) < int(b). -func (a Int) Less(b Item) bool { - return a < b.(Int) -} diff --git a/vendor/github.com/google/btree/btree_mem.go b/vendor/github.com/google/btree/btree_mem.go deleted file mode 100644 index cb95b7fa1b..0000000000 --- a/vendor/github.com/google/btree/btree_mem.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2014 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. - -// +build ignore - -// This binary compares memory usage between btree and gollrb. -package main - -import ( - "flag" - "fmt" - "math/rand" - "runtime" - "time" - - "github.com/google/btree" - "github.com/petar/GoLLRB/llrb" -) - -var ( - size = flag.Int("size", 1000000, "size of the tree to build") - degree = flag.Int("degree", 8, "degree of btree") - gollrb = flag.Bool("llrb", false, "use llrb instead of btree") -) - -func main() { - flag.Parse() - vals := rand.Perm(*size) - var t, v interface{} - v = vals - var stats runtime.MemStats - for i := 0; i < 10; i++ { - runtime.GC() - } - fmt.Println("-------- BEFORE ----------") - runtime.ReadMemStats(&stats) - fmt.Printf("%+v\n", stats) - start := time.Now() - if *gollrb { - tr := llrb.New() - for _, v := range vals { - tr.ReplaceOrInsert(llrb.Int(v)) - } - t = tr // keep it around - } else { - tr := btree.New(*degree) - for _, v := range vals { - tr.ReplaceOrInsert(btree.Int(v)) - } - t = tr // keep it around - } - fmt.Printf("%v inserts in %v\n", *size, time.Since(start)) - fmt.Println("-------- AFTER ----------") - runtime.ReadMemStats(&stats) - fmt.Printf("%+v\n", stats) - for i := 0; i < 10; i++ { - runtime.GC() - } - fmt.Println("-------- AFTER GC ----------") - runtime.ReadMemStats(&stats) - fmt.Printf("%+v\n", stats) - if t == v { - fmt.Println("to make sure vals and tree aren't GC'd") - } -} diff --git a/vendor/github.com/google/btree/btree_test.go b/vendor/github.com/google/btree/btree_test.go deleted file mode 100644 index 9eeb136a5e..0000000000 --- a/vendor/github.com/google/btree/btree_test.go +++ /dev/null @@ -1,770 +0,0 @@ -// Copyright 2014 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 btree - -import ( - "flag" - "fmt" - "math/rand" - "reflect" - "sort" - "sync" - "testing" - "time" -) - -func init() { - seed := time.Now().Unix() - fmt.Println(seed) - rand.Seed(seed) -} - -// perm returns a random permutation of n Int items in the range [0, n). -func perm(n int) (out []Item) { - for _, v := range rand.Perm(n) { - out = append(out, Int(v)) - } - return -} - -// rang returns an ordered list of Int items in the range [0, n). -func rang(n int) (out []Item) { - for i := 0; i < n; i++ { - out = append(out, Int(i)) - } - return -} - -// all extracts all items from a tree in order as a slice. -func all(t *BTree) (out []Item) { - t.Ascend(func(a Item) bool { - out = append(out, a) - return true - }) - return -} - -// rangerev returns a reversed ordered list of Int items in the range [0, n). -func rangrev(n int) (out []Item) { - for i := n - 1; i >= 0; i-- { - out = append(out, Int(i)) - } - return -} - -// allrev extracts all items from a tree in reverse order as a slice. -func allrev(t *BTree) (out []Item) { - t.Descend(func(a Item) bool { - out = append(out, a) - return true - }) - return -} - -var btreeDegree = flag.Int("degree", 32, "B-Tree degree") - -func TestBTree(t *testing.T) { - tr := New(*btreeDegree) - const treeSize = 10000 - for i := 0; i < 10; i++ { - if min := tr.Min(); min != nil { - t.Fatalf("empty min, got %+v", min) - } - if max := tr.Max(); max != nil { - t.Fatalf("empty max, got %+v", max) - } - for _, item := range perm(treeSize) { - if x := tr.ReplaceOrInsert(item); x != nil { - t.Fatal("insert found item", item) - } - } - for _, item := range perm(treeSize) { - if x := tr.ReplaceOrInsert(item); x == nil { - t.Fatal("insert didn't find item", item) - } - } - if min, want := tr.Min(), Item(Int(0)); min != want { - t.Fatalf("min: want %+v, got %+v", want, min) - } - if max, want := tr.Max(), Item(Int(treeSize-1)); max != want { - t.Fatalf("max: want %+v, got %+v", want, max) - } - got := all(tr) - want := rang(treeSize) - if !reflect.DeepEqual(got, want) { - t.Fatalf("mismatch:\n got: %v\nwant: %v", got, want) - } - - gotrev := allrev(tr) - wantrev := rangrev(treeSize) - if !reflect.DeepEqual(gotrev, wantrev) { - t.Fatalf("mismatch:\n got: %v\nwant: %v", got, want) - } - - for _, item := range perm(treeSize) { - if x := tr.Delete(item); x == nil { - t.Fatalf("didn't find %v", item) - } - } - if got = all(tr); len(got) > 0 { - t.Fatalf("some left!: %v", got) - } - } -} - -func ExampleBTree() { - tr := New(*btreeDegree) - for i := Int(0); i < 10; i++ { - tr.ReplaceOrInsert(i) - } - fmt.Println("len: ", tr.Len()) - fmt.Println("get3: ", tr.Get(Int(3))) - fmt.Println("get100: ", tr.Get(Int(100))) - fmt.Println("del4: ", tr.Delete(Int(4))) - fmt.Println("del100: ", tr.Delete(Int(100))) - fmt.Println("replace5: ", tr.ReplaceOrInsert(Int(5))) - fmt.Println("replace100:", tr.ReplaceOrInsert(Int(100))) - fmt.Println("min: ", tr.Min()) - fmt.Println("delmin: ", tr.DeleteMin()) - fmt.Println("max: ", tr.Max()) - fmt.Println("delmax: ", tr.DeleteMax()) - fmt.Println("len: ", tr.Len()) - // Output: - // len: 10 - // get3: 3 - // get100: - // del4: 4 - // del100: - // replace5: 5 - // replace100: - // min: 0 - // delmin: 0 - // max: 100 - // delmax: 100 - // len: 8 -} - -func TestDeleteMin(t *testing.T) { - tr := New(3) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - for v := tr.DeleteMin(); v != nil; v = tr.DeleteMin() { - got = append(got, v) - } - if want := rang(100); !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } -} - -func TestDeleteMax(t *testing.T) { - tr := New(3) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - for v := tr.DeleteMax(); v != nil; v = tr.DeleteMax() { - got = append(got, v) - } - // Reverse our list. - for i := 0; i < len(got)/2; i++ { - got[i], got[len(got)-i-1] = got[len(got)-i-1], got[i] - } - if want := rang(100); !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } -} - -func TestAscendRange(t *testing.T) { - tr := New(2) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.AscendRange(Int(40), Int(60), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rang(100)[40:60]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.AscendRange(Int(40), Int(60), func(a Item) bool { - if a.(Int) > 50 { - return false - } - got = append(got, a) - return true - }) - if want := rang(100)[40:51]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } -} - -func TestDescendRange(t *testing.T) { - tr := New(2) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.DescendRange(Int(60), Int(40), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rangrev(100)[39:59]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendrange:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.DescendRange(Int(60), Int(40), func(a Item) bool { - if a.(Int) < 50 { - return false - } - got = append(got, a) - return true - }) - if want := rangrev(100)[39:50]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendrange:\n got: %v\nwant: %v", got, want) - } -} -func TestAscendLessThan(t *testing.T) { - tr := New(*btreeDegree) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.AscendLessThan(Int(60), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rang(100)[:60]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.AscendLessThan(Int(60), func(a Item) bool { - if a.(Int) > 50 { - return false - } - got = append(got, a) - return true - }) - if want := rang(100)[:51]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } -} - -func TestDescendLessOrEqual(t *testing.T) { - tr := New(*btreeDegree) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.DescendLessOrEqual(Int(40), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rangrev(100)[59:]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendlessorequal:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.DescendLessOrEqual(Int(60), func(a Item) bool { - if a.(Int) < 50 { - return false - } - got = append(got, a) - return true - }) - if want := rangrev(100)[39:50]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendlessorequal:\n got: %v\nwant: %v", got, want) - } -} -func TestAscendGreaterOrEqual(t *testing.T) { - tr := New(*btreeDegree) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.AscendGreaterOrEqual(Int(40), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rang(100)[40:]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.AscendGreaterOrEqual(Int(40), func(a Item) bool { - if a.(Int) > 50 { - return false - } - got = append(got, a) - return true - }) - if want := rang(100)[40:51]; !reflect.DeepEqual(got, want) { - t.Fatalf("ascendrange:\n got: %v\nwant: %v", got, want) - } -} - -func TestDescendGreaterThan(t *testing.T) { - tr := New(*btreeDegree) - for _, v := range perm(100) { - tr.ReplaceOrInsert(v) - } - var got []Item - tr.DescendGreaterThan(Int(40), func(a Item) bool { - got = append(got, a) - return true - }) - if want := rangrev(100)[:59]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendgreaterthan:\n got: %v\nwant: %v", got, want) - } - got = got[:0] - tr.DescendGreaterThan(Int(40), func(a Item) bool { - if a.(Int) < 50 { - return false - } - got = append(got, a) - return true - }) - if want := rangrev(100)[:50]; !reflect.DeepEqual(got, want) { - t.Fatalf("descendgreaterthan:\n got: %v\nwant: %v", got, want) - } -} - -const benchmarkTreeSize = 10000 - -func BenchmarkInsert(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - b.StartTimer() - i := 0 - for i < b.N { - tr := New(*btreeDegree) - for _, item := range insertP { - tr.ReplaceOrInsert(item) - i++ - if i >= b.N { - return - } - } - } -} - -func BenchmarkDeleteInsert(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, item := range insertP { - tr.ReplaceOrInsert(item) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - tr.Delete(insertP[i%benchmarkTreeSize]) - tr.ReplaceOrInsert(insertP[i%benchmarkTreeSize]) - } -} - -func BenchmarkDeleteInsertCloneOnce(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, item := range insertP { - tr.ReplaceOrInsert(item) - } - tr = tr.Clone() - b.StartTimer() - for i := 0; i < b.N; i++ { - tr.Delete(insertP[i%benchmarkTreeSize]) - tr.ReplaceOrInsert(insertP[i%benchmarkTreeSize]) - } -} - -func BenchmarkDeleteInsertCloneEachTime(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, item := range insertP { - tr.ReplaceOrInsert(item) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - tr = tr.Clone() - tr.Delete(insertP[i%benchmarkTreeSize]) - tr.ReplaceOrInsert(insertP[i%benchmarkTreeSize]) - } -} - -func BenchmarkDelete(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - removeP := perm(benchmarkTreeSize) - b.StartTimer() - i := 0 - for i < b.N { - b.StopTimer() - tr := New(*btreeDegree) - for _, v := range insertP { - tr.ReplaceOrInsert(v) - } - b.StartTimer() - for _, item := range removeP { - tr.Delete(item) - i++ - if i >= b.N { - return - } - } - if tr.Len() > 0 { - panic(tr.Len()) - } - } -} - -func BenchmarkGet(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - removeP := perm(benchmarkTreeSize) - b.StartTimer() - i := 0 - for i < b.N { - b.StopTimer() - tr := New(*btreeDegree) - for _, v := range insertP { - tr.ReplaceOrInsert(v) - } - b.StartTimer() - for _, item := range removeP { - tr.Get(item) - i++ - if i >= b.N { - return - } - } - } -} - -func BenchmarkGetCloneEachTime(b *testing.B) { - b.StopTimer() - insertP := perm(benchmarkTreeSize) - removeP := perm(benchmarkTreeSize) - b.StartTimer() - i := 0 - for i < b.N { - b.StopTimer() - tr := New(*btreeDegree) - for _, v := range insertP { - tr.ReplaceOrInsert(v) - } - b.StartTimer() - for _, item := range removeP { - tr = tr.Clone() - tr.Get(item) - i++ - if i >= b.N { - return - } - } - } -} - -type byInts []Item - -func (a byInts) Len() int { - return len(a) -} - -func (a byInts) Less(i, j int) bool { - return a[i].(Int) < a[j].(Int) -} - -func (a byInts) Swap(i, j int) { - a[i], a[j] = a[j], a[i] -} - -func BenchmarkAscend(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := 0 - tr.Ascend(func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j++ - return true - }) - } -} - -func BenchmarkDescend(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := len(arr) - 1 - tr.Descend(func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j-- - return true - }) - } -} -func BenchmarkAscendRange(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := 100 - tr.AscendRange(Int(100), arr[len(arr)-100], func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j++ - return true - }) - if j != len(arr)-100 { - b.Fatalf("expected: %v, got %v", len(arr)-100, j) - } - } -} - -func BenchmarkDescendRange(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := len(arr) - 100 - tr.DescendRange(arr[len(arr)-100], Int(100), func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j-- - return true - }) - if j != 100 { - b.Fatalf("expected: %v, got %v", len(arr)-100, j) - } - } -} -func BenchmarkAscendGreaterOrEqual(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := 100 - k := 0 - tr.AscendGreaterOrEqual(Int(100), func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j++ - k++ - return true - }) - if j != len(arr) { - b.Fatalf("expected: %v, got %v", len(arr), j) - } - if k != len(arr)-100 { - b.Fatalf("expected: %v, got %v", len(arr)-100, k) - } - } -} -func BenchmarkDescendLessOrEqual(b *testing.B) { - arr := perm(benchmarkTreeSize) - tr := New(*btreeDegree) - for _, v := range arr { - tr.ReplaceOrInsert(v) - } - sort.Sort(byInts(arr)) - b.ResetTimer() - for i := 0; i < b.N; i++ { - j := len(arr) - 100 - k := len(arr) - tr.DescendLessOrEqual(arr[len(arr)-100], func(item Item) bool { - if item.(Int) != arr[j].(Int) { - b.Fatalf("mismatch: expected: %v, got %v", arr[j].(Int), item.(Int)) - } - j-- - k-- - return true - }) - if j != -1 { - b.Fatalf("expected: %v, got %v", -1, j) - } - if k != 99 { - b.Fatalf("expected: %v, got %v", 99, k) - } - } -} - -const cloneTestSize = 10000 - -func cloneTest(t *testing.T, b *BTree, start int, p []Item, wg *sync.WaitGroup, trees *[]*BTree) { - t.Logf("Starting new clone at %v", start) - *trees = append(*trees, b) - for i := start; i < cloneTestSize; i++ { - b.ReplaceOrInsert(p[i]) - if i%(cloneTestSize/5) == 0 { - wg.Add(1) - go cloneTest(t, b.Clone(), i+1, p, wg, trees) - } - } - wg.Done() -} - -func TestCloneConcurrentOperations(t *testing.T) { - b := New(*btreeDegree) - trees := []*BTree{} - p := perm(cloneTestSize) - var wg sync.WaitGroup - wg.Add(1) - go cloneTest(t, b, 0, p, &wg, &trees) - wg.Wait() - want := rang(cloneTestSize) - t.Logf("Starting equality checks on %d trees", len(trees)) - for i, tree := range trees { - if !reflect.DeepEqual(want, all(tree)) { - t.Errorf("tree %v mismatch", i) - } - } - t.Log("Removing half from first half") - toRemove := rang(cloneTestSize)[cloneTestSize/2:] - for i := 0; i < len(trees)/2; i++ { - tree := trees[i] - wg.Add(1) - go func() { - for _, item := range toRemove { - tree.Delete(item) - } - wg.Done() - }() - } - wg.Wait() - t.Log("Checking all values again") - for i, tree := range trees { - var wantpart []Item - if i < len(trees)/2 { - wantpart = want[:cloneTestSize/2] - } else { - wantpart = want - } - if got := all(tree); !reflect.DeepEqual(wantpart, got) { - t.Errorf("tree %v mismatch, want %v got %v", i, len(want), len(got)) - } - } -} - -func BenchmarkDeleteAndRestore(b *testing.B) { - items := perm(16392) - b.ResetTimer() - b.Run(`CopyBigFreeList`, func(b *testing.B) { - fl := NewFreeList(16392) - tr := NewWithFreeList(*btreeDegree, fl) - for _, v := range items { - tr.ReplaceOrInsert(v) - } - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - dels := make([]Item, 0, tr.Len()) - tr.Ascend(ItemIterator(func(b Item) bool { - dels = append(dels, b) - return true - })) - for _, del := range dels { - tr.Delete(del) - } - // tr is now empty, we make a new empty copy of it. - tr = NewWithFreeList(*btreeDegree, fl) - for _, v := range items { - tr.ReplaceOrInsert(v) - } - } - }) - b.Run(`Copy`, func(b *testing.B) { - tr := New(*btreeDegree) - for _, v := range items { - tr.ReplaceOrInsert(v) - } - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - dels := make([]Item, 0, tr.Len()) - tr.Ascend(ItemIterator(func(b Item) bool { - dels = append(dels, b) - return true - })) - for _, del := range dels { - tr.Delete(del) - } - // tr is now empty, we make a new empty copy of it. - tr = New(*btreeDegree) - for _, v := range items { - tr.ReplaceOrInsert(v) - } - } - }) - b.Run(`ClearBigFreelist`, func(b *testing.B) { - fl := NewFreeList(16392) - tr := NewWithFreeList(*btreeDegree, fl) - for _, v := range items { - tr.ReplaceOrInsert(v) - } - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - tr.Clear(true) - for _, v := range items { - tr.ReplaceOrInsert(v) - } - } - }) - b.Run(`Clear`, func(b *testing.B) { - tr := New(*btreeDegree) - for _, v := range items { - tr.ReplaceOrInsert(v) - } - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - tr.Clear(true) - for _, v := range items { - tr.ReplaceOrInsert(v) - } - } - }) -} diff --git a/vendor/github.com/gregjones/httpcache/.travis.yml b/vendor/github.com/gregjones/httpcache/.travis.yml deleted file mode 100644 index b5ffbe03d8..0000000000 --- a/vendor/github.com/gregjones/httpcache/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -sudo: false -language: go -go: - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - master -matrix: - allow_failures: - - go: master - fast_finish: true -install: - - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). -script: - - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d .) - - go tool vet . - - go test -v -race ./... diff --git a/vendor/github.com/gregjones/httpcache/LICENSE.txt b/vendor/github.com/gregjones/httpcache/LICENSE.txt deleted file mode 100644 index 81316beb0c..0000000000 --- a/vendor/github.com/gregjones/httpcache/LICENSE.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright © 2012 Greg Jones (greg.jones@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/gregjones/httpcache/README.md b/vendor/github.com/gregjones/httpcache/README.md deleted file mode 100644 index 09c9e7c173..0000000000 --- a/vendor/github.com/gregjones/httpcache/README.md +++ /dev/null @@ -1,25 +0,0 @@ -httpcache -========= - -[![Build Status](https://travis-ci.org/gregjones/httpcache.svg?branch=master)](https://travis-ci.org/gregjones/httpcache) [![GoDoc](https://godoc.org/github.com/gregjones/httpcache?status.svg)](https://godoc.org/github.com/gregjones/httpcache) - -Package httpcache provides a http.RoundTripper implementation that works as a mostly [RFC 7234](https://tools.ietf.org/html/rfc7234) compliant cache for http responses. - -It is only suitable for use as a 'private' cache (i.e. for a web-browser or an API-client and not for a shared proxy). - -Cache Backends --------------- - -- The built-in 'memory' cache stores responses in an in-memory map. -- [`github.com/gregjones/httpcache/diskcache`](https://github.com/gregjones/httpcache/tree/master/diskcache) provides a filesystem-backed cache using the [diskv](https://github.com/peterbourgon/diskv) library. -- [`github.com/gregjones/httpcache/memcache`](https://github.com/gregjones/httpcache/tree/master/memcache) provides memcache implementations, for both App Engine and 'normal' memcache servers. -- [`sourcegraph.com/sourcegraph/s3cache`](https://sourcegraph.com/github.com/sourcegraph/s3cache) uses Amazon S3 for storage. -- [`github.com/gregjones/httpcache/leveldbcache`](https://github.com/gregjones/httpcache/tree/master/leveldbcache) provides a filesystem-backed cache using [leveldb](https://github.com/syndtr/goleveldb/leveldb). -- [`github.com/die-net/lrucache`](https://github.com/die-net/lrucache) provides an in-memory cache that will evict least-recently used entries. -- [`github.com/die-net/lrucache/twotier`](https://github.com/die-net/lrucache/tree/master/twotier) allows caches to be combined, for example to use lrucache above with a persistent disk-cache. -- [`github.com/birkelund/boltdbcache`](https://github.com/birkelund/boltdbcache) provides a BoltDB implementation (based on the [bbolt](https://github.com/coreos/bbolt) fork). - -License -------- - -- [MIT License](LICENSE.txt) diff --git a/vendor/github.com/gregjones/httpcache/diskcache/diskcache.go b/vendor/github.com/gregjones/httpcache/diskcache/diskcache.go deleted file mode 100644 index 42e3129d82..0000000000 --- a/vendor/github.com/gregjones/httpcache/diskcache/diskcache.go +++ /dev/null @@ -1,61 +0,0 @@ -// Package diskcache provides an implementation of httpcache.Cache that uses the diskv package -// to supplement an in-memory map with persistent storage -// -package diskcache - -import ( - "bytes" - "crypto/md5" - "encoding/hex" - "github.com/peterbourgon/diskv" - "io" -) - -// Cache is an implementation of httpcache.Cache that supplements the in-memory map with persistent storage -type Cache struct { - d *diskv.Diskv -} - -// Get returns the response corresponding to key if present -func (c *Cache) Get(key string) (resp []byte, ok bool) { - key = keyToFilename(key) - resp, err := c.d.Read(key) - if err != nil { - return []byte{}, false - } - return resp, true -} - -// Set saves a response to the cache as key -func (c *Cache) Set(key string, resp []byte) { - key = keyToFilename(key) - c.d.WriteStream(key, bytes.NewReader(resp), true) -} - -// Delete removes the response with key from the cache -func (c *Cache) Delete(key string) { - key = keyToFilename(key) - c.d.Erase(key) -} - -func keyToFilename(key string) string { - h := md5.New() - io.WriteString(h, key) - return hex.EncodeToString(h.Sum(nil)) -} - -// New returns a new Cache that will store files in basePath -func New(basePath string) *Cache { - return &Cache{ - d: diskv.New(diskv.Options{ - BasePath: basePath, - CacheSizeMax: 100 * 1024 * 1024, // 100MB - }), - } -} - -// NewWithDiskv returns a new Cache using the provided Diskv as underlying -// storage. -func NewWithDiskv(d *diskv.Diskv) *Cache { - return &Cache{d} -} diff --git a/vendor/github.com/gregjones/httpcache/diskcache/diskcache_test.go b/vendor/github.com/gregjones/httpcache/diskcache/diskcache_test.go deleted file mode 100644 index 35c76cbd1c..0000000000 --- a/vendor/github.com/gregjones/httpcache/diskcache/diskcache_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package diskcache - -import ( - "bytes" - "io/ioutil" - "os" - "testing" -) - -func TestDiskCache(t *testing.T) { - tempDir, err := ioutil.TempDir("", "httpcache") - if err != nil { - t.Fatalf("TempDir: %v", err) - } - defer os.RemoveAll(tempDir) - - cache := New(tempDir) - - key := "testKey" - _, ok := cache.Get(key) - if ok { - t.Fatal("retrieved key before adding it") - } - - val := []byte("some bytes") - cache.Set(key, val) - - retVal, ok := cache.Get(key) - if !ok { - t.Fatal("could not retrieve an element we just added") - } - if !bytes.Equal(retVal, val) { - t.Fatal("retrieved a different value than what we put in") - } - - cache.Delete(key) - - _, ok = cache.Get(key) - if ok { - t.Fatal("deleted key still present") - } -} diff --git a/vendor/github.com/gregjones/httpcache/httpcache.go b/vendor/github.com/gregjones/httpcache/httpcache.go deleted file mode 100644 index f6a2ec4a53..0000000000 --- a/vendor/github.com/gregjones/httpcache/httpcache.go +++ /dev/null @@ -1,551 +0,0 @@ -// Package httpcache provides a http.RoundTripper implementation that works as a -// mostly RFC-compliant cache for http responses. -// -// It is only suitable for use as a 'private' cache (i.e. for a web-browser or an API-client -// and not for a shared proxy). -// -package httpcache - -import ( - "bufio" - "bytes" - "errors" - "io" - "io/ioutil" - "net/http" - "net/http/httputil" - "strings" - "sync" - "time" -) - -const ( - stale = iota - fresh - transparent - // XFromCache is the header added to responses that are returned from the cache - XFromCache = "X-From-Cache" -) - -// A Cache interface is used by the Transport to store and retrieve responses. -type Cache interface { - // Get returns the []byte representation of a cached response and a bool - // set to true if the value isn't empty - Get(key string) (responseBytes []byte, ok bool) - // Set stores the []byte representation of a response against a key - Set(key string, responseBytes []byte) - // Delete removes the value associated with the key - Delete(key string) -} - -// cacheKey returns the cache key for req. -func cacheKey(req *http.Request) string { - if req.Method == http.MethodGet { - return req.URL.String() - } else { - return req.Method + " " + req.URL.String() - } -} - -// CachedResponse returns the cached http.Response for req if present, and nil -// otherwise. -func CachedResponse(c Cache, req *http.Request) (resp *http.Response, err error) { - cachedVal, ok := c.Get(cacheKey(req)) - if !ok { - return - } - - b := bytes.NewBuffer(cachedVal) - return http.ReadResponse(bufio.NewReader(b), req) -} - -// MemoryCache is an implemtation of Cache that stores responses in an in-memory map. -type MemoryCache struct { - mu sync.RWMutex - items map[string][]byte -} - -// Get returns the []byte representation of the response and true if present, false if not -func (c *MemoryCache) Get(key string) (resp []byte, ok bool) { - c.mu.RLock() - resp, ok = c.items[key] - c.mu.RUnlock() - return resp, ok -} - -// Set saves response resp to the cache with key -func (c *MemoryCache) Set(key string, resp []byte) { - c.mu.Lock() - c.items[key] = resp - c.mu.Unlock() -} - -// Delete removes key from the cache -func (c *MemoryCache) Delete(key string) { - c.mu.Lock() - delete(c.items, key) - c.mu.Unlock() -} - -// NewMemoryCache returns a new Cache that will store items in an in-memory map -func NewMemoryCache() *MemoryCache { - c := &MemoryCache{items: map[string][]byte{}} - return c -} - -// Transport is an implementation of http.RoundTripper that will return values from a cache -// where possible (avoiding a network request) and will additionally add validators (etag/if-modified-since) -// to repeated requests allowing servers to return 304 / Not Modified -type Transport struct { - // The RoundTripper interface actually used to make requests - // If nil, http.DefaultTransport is used - Transport http.RoundTripper - Cache Cache - // If true, responses returned from the cache will be given an extra header, X-From-Cache - MarkCachedResponses bool -} - -// NewTransport returns a new Transport with the -// provided Cache implementation and MarkCachedResponses set to true -func NewTransport(c Cache) *Transport { - return &Transport{Cache: c, MarkCachedResponses: true} -} - -// Client returns an *http.Client that caches responses. -func (t *Transport) Client() *http.Client { - return &http.Client{Transport: t} -} - -// varyMatches will return false unless all of the cached values for the headers listed in Vary -// match the new request -func varyMatches(cachedResp *http.Response, req *http.Request) bool { - for _, header := range headerAllCommaSepValues(cachedResp.Header, "vary") { - header = http.CanonicalHeaderKey(header) - if header != "" && req.Header.Get(header) != cachedResp.Header.Get("X-Varied-"+header) { - return false - } - } - return true -} - -// RoundTrip takes a Request and returns a Response -// -// If there is a fresh Response already in cache, then it will be returned without connecting to -// the server. -// -// If there is a stale Response, then any validators it contains will be set on the new request -// to give the server a chance to respond with NotModified. If this happens, then the cached Response -// will be returned. -func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error) { - cacheKey := cacheKey(req) - cacheable := (req.Method == "GET" || req.Method == "HEAD") && req.Header.Get("range") == "" - var cachedResp *http.Response - if cacheable { - cachedResp, err = CachedResponse(t.Cache, req) - } else { - // Need to invalidate an existing value - t.Cache.Delete(cacheKey) - } - - transport := t.Transport - if transport == nil { - transport = http.DefaultTransport - } - - if cacheable && cachedResp != nil && err == nil { - if t.MarkCachedResponses { - cachedResp.Header.Set(XFromCache, "1") - } - - if varyMatches(cachedResp, req) { - // Can only use cached value if the new request doesn't Vary significantly - freshness := getFreshness(cachedResp.Header, req.Header) - if freshness == fresh { - return cachedResp, nil - } - - if freshness == stale { - var req2 *http.Request - // Add validators if caller hasn't already done so - etag := cachedResp.Header.Get("etag") - if etag != "" && req.Header.Get("etag") == "" { - req2 = cloneRequest(req) - req2.Header.Set("if-none-match", etag) - } - lastModified := cachedResp.Header.Get("last-modified") - if lastModified != "" && req.Header.Get("last-modified") == "" { - if req2 == nil { - req2 = cloneRequest(req) - } - req2.Header.Set("if-modified-since", lastModified) - } - if req2 != nil { - req = req2 - } - } - } - - resp, err = transport.RoundTrip(req) - if err == nil && req.Method == "GET" && resp.StatusCode == http.StatusNotModified { - // Replace the 304 response with the one from cache, but update with some new headers - endToEndHeaders := getEndToEndHeaders(resp.Header) - for _, header := range endToEndHeaders { - cachedResp.Header[header] = resp.Header[header] - } - resp = cachedResp - } else if (err != nil || (cachedResp != nil && resp.StatusCode >= 500)) && - req.Method == "GET" && canStaleOnError(cachedResp.Header, req.Header) { - // In case of transport failure and stale-if-error activated, returns cached content - // when available - return cachedResp, nil - } else { - if err != nil || resp.StatusCode != http.StatusOK { - t.Cache.Delete(cacheKey) - } - if err != nil { - return nil, err - } - } - } else { - reqCacheControl := parseCacheControl(req.Header) - if _, ok := reqCacheControl["only-if-cached"]; ok { - resp = newGatewayTimeoutResponse(req) - } else { - resp, err = transport.RoundTrip(req) - if err != nil { - return nil, err - } - } - } - - if cacheable && canStore(parseCacheControl(req.Header), parseCacheControl(resp.Header)) { - for _, varyKey := range headerAllCommaSepValues(resp.Header, "vary") { - varyKey = http.CanonicalHeaderKey(varyKey) - fakeHeader := "X-Varied-" + varyKey - reqValue := req.Header.Get(varyKey) - if reqValue != "" { - resp.Header.Set(fakeHeader, reqValue) - } - } - switch req.Method { - case "GET": - // Delay caching until EOF is reached. - resp.Body = &cachingReadCloser{ - R: resp.Body, - OnEOF: func(r io.Reader) { - resp := *resp - resp.Body = ioutil.NopCloser(r) - respBytes, err := httputil.DumpResponse(&resp, true) - if err == nil { - t.Cache.Set(cacheKey, respBytes) - } - }, - } - default: - respBytes, err := httputil.DumpResponse(resp, true) - if err == nil { - t.Cache.Set(cacheKey, respBytes) - } - } - } else { - t.Cache.Delete(cacheKey) - } - return resp, nil -} - -// ErrNoDateHeader indicates that the HTTP headers contained no Date header. -var ErrNoDateHeader = errors.New("no Date header") - -// Date parses and returns the value of the Date header. -func Date(respHeaders http.Header) (date time.Time, err error) { - dateHeader := respHeaders.Get("date") - if dateHeader == "" { - err = ErrNoDateHeader - return - } - - return time.Parse(time.RFC1123, dateHeader) -} - -type realClock struct{} - -func (c *realClock) since(d time.Time) time.Duration { - return time.Since(d) -} - -type timer interface { - since(d time.Time) time.Duration -} - -var clock timer = &realClock{} - -// getFreshness will return one of fresh/stale/transparent based on the cache-control -// values of the request and the response -// -// fresh indicates the response can be returned -// stale indicates that the response needs validating before it is returned -// transparent indicates the response should not be used to fulfil the request -// -// Because this is only a private cache, 'public' and 'private' in cache-control aren't -// signficant. Similarly, smax-age isn't used. -func getFreshness(respHeaders, reqHeaders http.Header) (freshness int) { - respCacheControl := parseCacheControl(respHeaders) - reqCacheControl := parseCacheControl(reqHeaders) - if _, ok := reqCacheControl["no-cache"]; ok { - return transparent - } - if _, ok := respCacheControl["no-cache"]; ok { - return stale - } - if _, ok := reqCacheControl["only-if-cached"]; ok { - return fresh - } - - date, err := Date(respHeaders) - if err != nil { - return stale - } - currentAge := clock.since(date) - - var lifetime time.Duration - var zeroDuration time.Duration - - // If a response includes both an Expires header and a max-age directive, - // the max-age directive overrides the Expires header, even if the Expires header is more restrictive. - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err = time.ParseDuration(maxAge + "s") - if err != nil { - lifetime = zeroDuration - } - } else { - expiresHeader := respHeaders.Get("Expires") - if expiresHeader != "" { - expires, err := time.Parse(time.RFC1123, expiresHeader) - if err != nil { - lifetime = zeroDuration - } else { - lifetime = expires.Sub(date) - } - } - } - - if maxAge, ok := reqCacheControl["max-age"]; ok { - // the client is willing to accept a response whose age is no greater than the specified time in seconds - lifetime, err = time.ParseDuration(maxAge + "s") - if err != nil { - lifetime = zeroDuration - } - } - if minfresh, ok := reqCacheControl["min-fresh"]; ok { - // the client wants a response that will still be fresh for at least the specified number of seconds. - minfreshDuration, err := time.ParseDuration(minfresh + "s") - if err == nil { - currentAge = time.Duration(currentAge + minfreshDuration) - } - } - - if maxstale, ok := reqCacheControl["max-stale"]; ok { - // Indicates that the client is willing to accept a response that has exceeded its expiration time. - // If max-stale is assigned a value, then the client is willing to accept a response that has exceeded - // its expiration time by no more than the specified number of seconds. - // If no value is assigned to max-stale, then the client is willing to accept a stale response of any age. - // - // Responses served only because of a max-stale value are supposed to have a Warning header added to them, - // but that seems like a hassle, and is it actually useful? If so, then there needs to be a different - // return-value available here. - if maxstale == "" { - return fresh - } - maxstaleDuration, err := time.ParseDuration(maxstale + "s") - if err == nil { - currentAge = time.Duration(currentAge - maxstaleDuration) - } - } - - if lifetime > currentAge { - return fresh - } - - return stale -} - -// Returns true if either the request or the response includes the stale-if-error -// cache control extension: https://tools.ietf.org/html/rfc5861 -func canStaleOnError(respHeaders, reqHeaders http.Header) bool { - respCacheControl := parseCacheControl(respHeaders) - reqCacheControl := parseCacheControl(reqHeaders) - - var err error - lifetime := time.Duration(-1) - - if staleMaxAge, ok := respCacheControl["stale-if-error"]; ok { - if staleMaxAge != "" { - lifetime, err = time.ParseDuration(staleMaxAge + "s") - if err != nil { - return false - } - } else { - return true - } - } - if staleMaxAge, ok := reqCacheControl["stale-if-error"]; ok { - if staleMaxAge != "" { - lifetime, err = time.ParseDuration(staleMaxAge + "s") - if err != nil { - return false - } - } else { - return true - } - } - - if lifetime >= 0 { - date, err := Date(respHeaders) - if err != nil { - return false - } - currentAge := clock.since(date) - if lifetime > currentAge { - return true - } - } - - return false -} - -func getEndToEndHeaders(respHeaders http.Header) []string { - // These headers are always hop-by-hop - hopByHopHeaders := map[string]struct{}{ - "Connection": struct{}{}, - "Keep-Alive": struct{}{}, - "Proxy-Authenticate": struct{}{}, - "Proxy-Authorization": struct{}{}, - "Te": struct{}{}, - "Trailers": struct{}{}, - "Transfer-Encoding": struct{}{}, - "Upgrade": struct{}{}, - } - - for _, extra := range strings.Split(respHeaders.Get("connection"), ",") { - // any header listed in connection, if present, is also considered hop-by-hop - if strings.Trim(extra, " ") != "" { - hopByHopHeaders[http.CanonicalHeaderKey(extra)] = struct{}{} - } - } - endToEndHeaders := []string{} - for respHeader, _ := range respHeaders { - if _, ok := hopByHopHeaders[respHeader]; !ok { - endToEndHeaders = append(endToEndHeaders, respHeader) - } - } - return endToEndHeaders -} - -func canStore(reqCacheControl, respCacheControl cacheControl) (canStore bool) { - if _, ok := respCacheControl["no-store"]; ok { - return false - } - if _, ok := reqCacheControl["no-store"]; ok { - return false - } - return true -} - -func newGatewayTimeoutResponse(req *http.Request) *http.Response { - var braw bytes.Buffer - braw.WriteString("HTTP/1.1 504 Gateway Timeout\r\n\r\n") - resp, err := http.ReadResponse(bufio.NewReader(&braw), req) - if err != nil { - panic(err) - } - return resp -} - -// cloneRequest returns a clone of the provided *http.Request. -// The clone is a shallow copy of the struct and its Header map. -// (This function copyright goauth2 authors: https://code.google.com/p/goauth2) -func cloneRequest(r *http.Request) *http.Request { - // shallow copy of the struct - r2 := new(http.Request) - *r2 = *r - // deep copy of the Header - r2.Header = make(http.Header) - for k, s := range r.Header { - r2.Header[k] = s - } - return r2 -} - -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// headerAllCommaSepValues returns all comma-separated values (each -// with whitespace trimmed) for header name in headers. According to -// Section 4.2 of the HTTP/1.1 spec -// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2), -// values from multiple occurrences of a header should be concatenated, if -// the header's value is a comma-separated list. -func headerAllCommaSepValues(headers http.Header, name string) []string { - var vals []string - for _, val := range headers[http.CanonicalHeaderKey(name)] { - fields := strings.Split(val, ",") - for i, f := range fields { - fields[i] = strings.TrimSpace(f) - } - vals = append(vals, fields...) - } - return vals -} - -// cachingReadCloser is a wrapper around ReadCloser R that calls OnEOF -// handler with a full copy of the content read from R when EOF is -// reached. -type cachingReadCloser struct { - // Underlying ReadCloser. - R io.ReadCloser - // OnEOF is called with a copy of the content of R when EOF is reached. - OnEOF func(io.Reader) - - buf bytes.Buffer // buf stores a copy of the content of R. -} - -// Read reads the next len(p) bytes from R or until R is drained. The -// return value n is the number of bytes read. If R has no data to -// return, err is io.EOF and OnEOF is called with a full copy of what -// has been read so far. -func (r *cachingReadCloser) Read(p []byte) (n int, err error) { - n, err = r.R.Read(p) - r.buf.Write(p[:n]) - if err == io.EOF { - r.OnEOF(bytes.NewReader(r.buf.Bytes())) - } - return n, err -} - -func (r *cachingReadCloser) Close() error { - return r.R.Close() -} - -// NewMemoryCacheTransport returns a new Transport using the in-memory cache implementation -func NewMemoryCacheTransport() *Transport { - c := NewMemoryCache() - t := NewTransport(c) - return t -} diff --git a/vendor/github.com/gregjones/httpcache/httpcache_test.go b/vendor/github.com/gregjones/httpcache/httpcache_test.go deleted file mode 100644 index a504641804..0000000000 --- a/vendor/github.com/gregjones/httpcache/httpcache_test.go +++ /dev/null @@ -1,1475 +0,0 @@ -package httpcache - -import ( - "bytes" - "errors" - "flag" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "os" - "strconv" - "testing" - "time" -) - -var s struct { - server *httptest.Server - client http.Client - transport *Transport - done chan struct{} // Closed to unlock infinite handlers. -} - -type fakeClock struct { - elapsed time.Duration -} - -func (c *fakeClock) since(t time.Time) time.Duration { - return c.elapsed -} - -func TestMain(m *testing.M) { - flag.Parse() - setup() - code := m.Run() - teardown() - os.Exit(code) -} - -func setup() { - tp := NewMemoryCacheTransport() - client := http.Client{Transport: tp} - s.transport = tp - s.client = client - s.done = make(chan struct{}) - - mux := http.NewServeMux() - s.server = httptest.NewServer(mux) - - mux.HandleFunc("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - })) - - mux.HandleFunc("/method", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - w.Write([]byte(r.Method)) - })) - - mux.HandleFunc("/range", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - lm := "Fri, 14 Dec 2010 01:01:50 GMT" - if r.Header.Get("if-modified-since") == lm { - w.WriteHeader(http.StatusNotModified) - return - } - w.Header().Set("last-modified", lm) - if r.Header.Get("range") == "bytes=4-9" { - w.WriteHeader(http.StatusPartialContent) - w.Write([]byte(" text ")) - return - } - w.Write([]byte("Some text content")) - })) - - mux.HandleFunc("/nostore", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "no-store") - })) - - mux.HandleFunc("/etag", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - etag := "124567" - if r.Header.Get("if-none-match") == etag { - w.WriteHeader(http.StatusNotModified) - return - } - w.Header().Set("etag", etag) - })) - - mux.HandleFunc("/lastmodified", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - lm := "Fri, 14 Dec 2010 01:01:50 GMT" - if r.Header.Get("if-modified-since") == lm { - w.WriteHeader(http.StatusNotModified) - return - } - w.Header().Set("last-modified", lm) - })) - - mux.HandleFunc("/varyaccept", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - w.Header().Set("Content-Type", "text/plain") - w.Header().Set("Vary", "Accept") - w.Write([]byte("Some text content")) - })) - - mux.HandleFunc("/doublevary", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - w.Header().Set("Content-Type", "text/plain") - w.Header().Set("Vary", "Accept, Accept-Language") - w.Write([]byte("Some text content")) - })) - mux.HandleFunc("/2varyheaders", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - w.Header().Set("Content-Type", "text/plain") - w.Header().Add("Vary", "Accept") - w.Header().Add("Vary", "Accept-Language") - w.Write([]byte("Some text content")) - })) - mux.HandleFunc("/varyunused", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "max-age=3600") - w.Header().Set("Content-Type", "text/plain") - w.Header().Set("Vary", "X-Madeup-Header") - w.Write([]byte("Some text content")) - })) - - mux.HandleFunc("/cachederror", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - etag := "abc" - if r.Header.Get("if-none-match") == etag { - w.WriteHeader(http.StatusNotModified) - return - } - w.Header().Set("etag", etag) - w.WriteHeader(http.StatusNotFound) - w.Write([]byte("Not found")) - })) - - updateFieldsCounter := 0 - mux.HandleFunc("/updatefields", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("X-Counter", strconv.Itoa(updateFieldsCounter)) - w.Header().Set("Etag", `"e"`) - updateFieldsCounter++ - if r.Header.Get("if-none-match") != "" { - w.WriteHeader(http.StatusNotModified) - return - } - w.Write([]byte("Some text content")) - })) - - // Take 3 seconds to return 200 OK (for testing client timeouts). - mux.HandleFunc("/3seconds", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - time.Sleep(3 * time.Second) - })) - - mux.HandleFunc("/infinite", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - for { - select { - case <-s.done: - return - default: - w.Write([]byte{0}) - } - } - })) -} - -func teardown() { - close(s.done) - s.server.Close() -} - -func resetTest() { - s.transport.Cache = NewMemoryCache() - clock = &realClock{} -} - -// TestCacheableMethod ensures that uncacheable method does not get stored -// in cache and get incorrectly used for a following cacheable method request. -func TestCacheableMethod(t *testing.T) { - resetTest() - { - req, err := http.NewRequest("POST", s.server.URL+"/method", nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), "POST"; got != want { - t.Errorf("got %q, want %q", got, want) - } - if resp.StatusCode != http.StatusOK { - t.Errorf("response status code isn't 200 OK: %v", resp.StatusCode) - } - } - { - req, err := http.NewRequest("GET", s.server.URL+"/method", nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), "GET"; got != want { - t.Errorf("got wrong body %q, want %q", got, want) - } - if resp.StatusCode != http.StatusOK { - t.Errorf("response status code isn't 200 OK: %v", resp.StatusCode) - } - if resp.Header.Get(XFromCache) != "" { - t.Errorf("XFromCache header isn't blank") - } - } -} - -func TestDontServeHeadResponseToGetRequest(t *testing.T) { - resetTest() - url := s.server.URL + "/" - req, err := http.NewRequest(http.MethodHead, url, nil) - if err != nil { - t.Fatal(err) - } - _, err = s.client.Do(req) - if err != nil { - t.Fatal(err) - } - req, err = http.NewRequest(http.MethodGet, url, nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - if resp.Header.Get(XFromCache) != "" { - t.Errorf("Cache should not match") - } -} - -func TestDontStorePartialRangeInCache(t *testing.T) { - resetTest() - { - req, err := http.NewRequest("GET", s.server.URL+"/range", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("range", "bytes=4-9") - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), " text "; got != want { - t.Errorf("got %q, want %q", got, want) - } - if resp.StatusCode != http.StatusPartialContent { - t.Errorf("response status code isn't 206 Partial Content: %v", resp.StatusCode) - } - } - { - req, err := http.NewRequest("GET", s.server.URL+"/range", nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), "Some text content"; got != want { - t.Errorf("got %q, want %q", got, want) - } - if resp.StatusCode != http.StatusOK { - t.Errorf("response status code isn't 200 OK: %v", resp.StatusCode) - } - if resp.Header.Get(XFromCache) != "" { - t.Error("XFromCache header isn't blank") - } - } - { - req, err := http.NewRequest("GET", s.server.URL+"/range", nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), "Some text content"; got != want { - t.Errorf("got %q, want %q", got, want) - } - if resp.StatusCode != http.StatusOK { - t.Errorf("response status code isn't 200 OK: %v", resp.StatusCode) - } - if resp.Header.Get(XFromCache) != "1" { - t.Errorf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } - { - req, err := http.NewRequest("GET", s.server.URL+"/range", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("range", "bytes=4-9") - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - var buf bytes.Buffer - _, err = io.Copy(&buf, resp.Body) - if err != nil { - t.Fatal(err) - } - err = resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if got, want := buf.String(), " text "; got != want { - t.Errorf("got %q, want %q", got, want) - } - if resp.StatusCode != http.StatusPartialContent { - t.Errorf("response status code isn't 206 Partial Content: %v", resp.StatusCode) - } - } -} - -func TestCacheOnlyIfBodyRead(t *testing.T) { - resetTest() - { - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - // We do not read the body - resp.Body.Close() - } - { - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatalf("XFromCache header isn't blank") - } - } -} - -func TestOnlyReadBodyOnDemand(t *testing.T) { - resetTest() - - req, err := http.NewRequest("GET", s.server.URL+"/infinite", nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) // This shouldn't hang forever. - if err != nil { - t.Fatal(err) - } - buf := make([]byte, 10) // Only partially read the body. - _, err = resp.Body.Read(buf) - if err != nil { - t.Fatal(err) - } - resp.Body.Close() -} - -func TestGetOnlyIfCachedHit(t *testing.T) { - resetTest() - { - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - req.Header.Add("cache-control", "only-if-cached") - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - if resp.StatusCode != http.StatusOK { - t.Fatalf("response status code isn't 200 OK: %v", resp.StatusCode) - } - } -} - -func TestGetOnlyIfCachedMiss(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - req.Header.Add("cache-control", "only-if-cached") - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - if resp.StatusCode != http.StatusGatewayTimeout { - t.Fatalf("response status code isn't 504 GatewayTimeout: %v", resp.StatusCode) - } -} - -func TestGetNoStoreRequest(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL, nil) - if err != nil { - t.Fatal(err) - } - req.Header.Add("Cache-Control", "no-store") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } -} - -func TestGetNoStoreResponse(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/nostore", nil) - if err != nil { - t.Fatal(err) - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } -} - -func TestGetWithEtag(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/etag", nil) - if err != nil { - t.Fatal(err) - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - // additional assertions to verify that 304 response is converted properly - if resp.StatusCode != http.StatusOK { - t.Fatalf("response status code isn't 200 OK: %v", resp.StatusCode) - } - if _, ok := resp.Header["Connection"]; ok { - t.Fatalf("Connection header isn't absent") - } - } -} - -func TestGetWithLastModified(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/lastmodified", nil) - if err != nil { - t.Fatal(err) - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } -} - -func TestGetWithVary(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/varyaccept", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("Accept", "text/plain") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get("Vary") != "Accept" { - t.Fatalf(`Vary header isn't "Accept": %v`, resp.Header.Get("Vary")) - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } - req.Header.Set("Accept", "text/html") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - req.Header.Set("Accept", "") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } -} - -func TestGetWithDoubleVary(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/doublevary", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("Accept", "text/plain") - req.Header.Set("Accept-Language", "da, en-gb;q=0.8, en;q=0.7") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get("Vary") == "" { - t.Fatalf(`Vary header is blank`) - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } - req.Header.Set("Accept-Language", "") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - req.Header.Set("Accept-Language", "da") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } -} - -func TestGetWith2VaryHeaders(t *testing.T) { - resetTest() - // Tests that multiple Vary headers' comma-separated lists are - // merged. See https://github.com/gregjones/httpcache/issues/27. - const ( - accept = "text/plain" - acceptLanguage = "da, en-gb;q=0.8, en;q=0.7" - ) - req, err := http.NewRequest("GET", s.server.URL+"/2varyheaders", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("Accept", accept) - req.Header.Set("Accept-Language", acceptLanguage) - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get("Vary") == "" { - t.Fatalf(`Vary header is blank`) - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } - req.Header.Set("Accept-Language", "") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - req.Header.Set("Accept-Language", "da") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - req.Header.Set("Accept-Language", acceptLanguage) - req.Header.Set("Accept", "") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - } - req.Header.Set("Accept", "image/png") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "" { - t.Fatal("XFromCache header isn't blank") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } -} - -func TestGetVaryUnused(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/varyunused", nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("Accept", "text/plain") - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get("Vary") == "" { - t.Fatalf(`Vary header is blank`) - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - } -} - -func TestUpdateFields(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/updatefields", nil) - if err != nil { - t.Fatal(err) - } - var counter, counter2 string - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - counter = resp.Header.Get("x-counter") - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.Header.Get(XFromCache) != "1" { - t.Fatalf(`XFromCache header isn't "1": %v`, resp.Header.Get(XFromCache)) - } - counter2 = resp.Header.Get("x-counter") - } - if counter == counter2 { - t.Fatalf(`both "x-counter" values are equal: %v %v`, counter, counter2) - } -} - -// This tests the fix for https://github.com/gregjones/httpcache/issues/74. -// Previously, after validating a cached response, its StatusCode -// was incorrectly being replaced. -func TestCachedErrorsKeepStatus(t *testing.T) { - resetTest() - req, err := http.NewRequest("GET", s.server.URL+"/cachederror", nil) - if err != nil { - t.Fatal(err) - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - io.Copy(ioutil.Discard, resp.Body) - } - { - resp, err := s.client.Do(req) - if err != nil { - t.Fatal(err) - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusNotFound { - t.Fatalf("Status code isn't 404: %d", resp.StatusCode) - } - } -} - -func TestParseCacheControl(t *testing.T) { - resetTest() - h := http.Header{} - for range parseCacheControl(h) { - t.Fatal("cacheControl should be empty") - } - - h.Set("cache-control", "no-cache") - { - cc := parseCacheControl(h) - if _, ok := cc["foo"]; ok { - t.Error(`Value "foo" shouldn't exist`) - } - noCache, ok := cc["no-cache"] - if !ok { - t.Fatalf(`"no-cache" value isn't set`) - } - if noCache != "" { - t.Fatalf(`"no-cache" value isn't blank: %v`, noCache) - } - } - h.Set("cache-control", "no-cache, max-age=3600") - { - cc := parseCacheControl(h) - noCache, ok := cc["no-cache"] - if !ok { - t.Fatalf(`"no-cache" value isn't set`) - } - if noCache != "" { - t.Fatalf(`"no-cache" value isn't blank: %v`, noCache) - } - if cc["max-age"] != "3600" { - t.Fatalf(`"max-age" value isn't "3600": %v`, cc["max-age"]) - } - } -} - -func TestNoCacheRequestExpiration(t *testing.T) { - resetTest() - respHeaders := http.Header{} - respHeaders.Set("Cache-Control", "max-age=7200") - - reqHeaders := http.Header{} - reqHeaders.Set("Cache-Control", "no-cache") - if getFreshness(respHeaders, reqHeaders) != transparent { - t.Fatal("freshness isn't transparent") - } -} - -func TestNoCacheResponseExpiration(t *testing.T) { - resetTest() - respHeaders := http.Header{} - respHeaders.Set("Cache-Control", "no-cache") - respHeaders.Set("Expires", "Wed, 19 Apr 3000 11:43:00 GMT") - - reqHeaders := http.Header{} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestReqMustRevalidate(t *testing.T) { - resetTest() - // not paying attention to request setting max-stale means never returning stale - // responses, so always acting as if must-revalidate is set - respHeaders := http.Header{} - - reqHeaders := http.Header{} - reqHeaders.Set("Cache-Control", "must-revalidate") - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestRespMustRevalidate(t *testing.T) { - resetTest() - respHeaders := http.Header{} - respHeaders.Set("Cache-Control", "must-revalidate") - - reqHeaders := http.Header{} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestFreshExpiration(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("expires", now.Add(time.Duration(2)*time.Second).Format(time.RFC1123)) - - reqHeaders := http.Header{} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - clock = &fakeClock{elapsed: 3 * time.Second} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestMaxAge(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("cache-control", "max-age=2") - - reqHeaders := http.Header{} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - clock = &fakeClock{elapsed: 3 * time.Second} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestMaxAgeZero(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("cache-control", "max-age=0") - - reqHeaders := http.Header{} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestBothMaxAge(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("cache-control", "max-age=2") - - reqHeaders := http.Header{} - reqHeaders.Set("cache-control", "max-age=0") - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestMinFreshWithExpires(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("expires", now.Add(time.Duration(2)*time.Second).Format(time.RFC1123)) - - reqHeaders := http.Header{} - reqHeaders.Set("cache-control", "min-fresh=1") - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - reqHeaders = http.Header{} - reqHeaders.Set("cache-control", "min-fresh=2") - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func TestEmptyMaxStale(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("cache-control", "max-age=20") - - reqHeaders := http.Header{} - reqHeaders.Set("cache-control", "max-stale") - clock = &fakeClock{elapsed: 10 * time.Second} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - clock = &fakeClock{elapsed: 60 * time.Second} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } -} - -func TestMaxStaleValue(t *testing.T) { - resetTest() - now := time.Now() - respHeaders := http.Header{} - respHeaders.Set("date", now.Format(time.RFC1123)) - respHeaders.Set("cache-control", "max-age=10") - - reqHeaders := http.Header{} - reqHeaders.Set("cache-control", "max-stale=20") - clock = &fakeClock{elapsed: 5 * time.Second} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - clock = &fakeClock{elapsed: 15 * time.Second} - if getFreshness(respHeaders, reqHeaders) != fresh { - t.Fatal("freshness isn't fresh") - } - - clock = &fakeClock{elapsed: 30 * time.Second} - if getFreshness(respHeaders, reqHeaders) != stale { - t.Fatal("freshness isn't stale") - } -} - -func containsHeader(headers []string, header string) bool { - for _, v := range headers { - if http.CanonicalHeaderKey(v) == http.CanonicalHeaderKey(header) { - return true - } - } - return false -} - -func TestGetEndToEndHeaders(t *testing.T) { - resetTest() - var ( - headers http.Header - end2end []string - ) - - headers = http.Header{} - headers.Set("content-type", "text/html") - headers.Set("te", "deflate") - - end2end = getEndToEndHeaders(headers) - if !containsHeader(end2end, "content-type") { - t.Fatal(`doesn't contain "content-type" header`) - } - if containsHeader(end2end, "te") { - t.Fatal(`doesn't contain "te" header`) - } - - headers = http.Header{} - headers.Set("connection", "content-type") - headers.Set("content-type", "text/csv") - headers.Set("te", "deflate") - end2end = getEndToEndHeaders(headers) - if containsHeader(end2end, "connection") { - t.Fatal(`doesn't contain "connection" header`) - } - if containsHeader(end2end, "content-type") { - t.Fatal(`doesn't contain "content-type" header`) - } - if containsHeader(end2end, "te") { - t.Fatal(`doesn't contain "te" header`) - } - - headers = http.Header{} - end2end = getEndToEndHeaders(headers) - if len(end2end) != 0 { - t.Fatal(`non-zero end2end headers`) - } - - headers = http.Header{} - headers.Set("connection", "content-type") - end2end = getEndToEndHeaders(headers) - if len(end2end) != 0 { - t.Fatal(`non-zero end2end headers`) - } -} - -type transportMock struct { - response *http.Response - err error -} - -func (t transportMock) RoundTrip(req *http.Request) (resp *http.Response, err error) { - return t.response, t.err -} - -func TestStaleIfErrorRequest(t *testing.T) { - resetTest() - now := time.Now() - tmock := transportMock{ - response: &http.Response{ - Status: http.StatusText(http.StatusOK), - StatusCode: http.StatusOK, - Header: http.Header{ - "Date": []string{now.Format(time.RFC1123)}, - "Cache-Control": []string{"no-cache"}, - }, - Body: ioutil.NopCloser(bytes.NewBuffer([]byte("some data"))), - }, - err: nil, - } - tp := NewMemoryCacheTransport() - tp.Transport = &tmock - - // First time, response is cached on success - r, _ := http.NewRequest("GET", "http://somewhere.com/", nil) - r.Header.Set("Cache-Control", "stale-if-error") - resp, err := tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - // On failure, response is returned from the cache - tmock.response = nil - tmock.err = errors.New("some error") - resp, err = tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } -} - -func TestStaleIfErrorRequestLifetime(t *testing.T) { - resetTest() - now := time.Now() - tmock := transportMock{ - response: &http.Response{ - Status: http.StatusText(http.StatusOK), - StatusCode: http.StatusOK, - Header: http.Header{ - "Date": []string{now.Format(time.RFC1123)}, - "Cache-Control": []string{"no-cache"}, - }, - Body: ioutil.NopCloser(bytes.NewBuffer([]byte("some data"))), - }, - err: nil, - } - tp := NewMemoryCacheTransport() - tp.Transport = &tmock - - // First time, response is cached on success - r, _ := http.NewRequest("GET", "http://somewhere.com/", nil) - r.Header.Set("Cache-Control", "stale-if-error=100") - resp, err := tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - // On failure, response is returned from the cache - tmock.response = nil - tmock.err = errors.New("some error") - resp, err = tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - - // Same for http errors - tmock.response = &http.Response{StatusCode: http.StatusInternalServerError} - tmock.err = nil - resp, err = tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - - // If failure last more than max stale, error is returned - clock = &fakeClock{elapsed: 200 * time.Second} - _, err = tp.RoundTrip(r) - if err != tmock.err { - t.Fatalf("got err %v, want %v", err, tmock.err) - } -} - -func TestStaleIfErrorResponse(t *testing.T) { - resetTest() - now := time.Now() - tmock := transportMock{ - response: &http.Response{ - Status: http.StatusText(http.StatusOK), - StatusCode: http.StatusOK, - Header: http.Header{ - "Date": []string{now.Format(time.RFC1123)}, - "Cache-Control": []string{"no-cache, stale-if-error"}, - }, - Body: ioutil.NopCloser(bytes.NewBuffer([]byte("some data"))), - }, - err: nil, - } - tp := NewMemoryCacheTransport() - tp.Transport = &tmock - - // First time, response is cached on success - r, _ := http.NewRequest("GET", "http://somewhere.com/", nil) - resp, err := tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - // On failure, response is returned from the cache - tmock.response = nil - tmock.err = errors.New("some error") - resp, err = tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } -} - -func TestStaleIfErrorResponseLifetime(t *testing.T) { - resetTest() - now := time.Now() - tmock := transportMock{ - response: &http.Response{ - Status: http.StatusText(http.StatusOK), - StatusCode: http.StatusOK, - Header: http.Header{ - "Date": []string{now.Format(time.RFC1123)}, - "Cache-Control": []string{"no-cache, stale-if-error=100"}, - }, - Body: ioutil.NopCloser(bytes.NewBuffer([]byte("some data"))), - }, - err: nil, - } - tp := NewMemoryCacheTransport() - tp.Transport = &tmock - - // First time, response is cached on success - r, _ := http.NewRequest("GET", "http://somewhere.com/", nil) - resp, err := tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - // On failure, response is returned from the cache - tmock.response = nil - tmock.err = errors.New("some error") - resp, err = tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - - // If failure last more than max stale, error is returned - clock = &fakeClock{elapsed: 200 * time.Second} - _, err = tp.RoundTrip(r) - if err != tmock.err { - t.Fatalf("got err %v, want %v", err, tmock.err) - } -} - -// This tests the fix for https://github.com/gregjones/httpcache/issues/74. -// Previously, after a stale response was used after encountering an error, -// its StatusCode was being incorrectly replaced. -func TestStaleIfErrorKeepsStatus(t *testing.T) { - resetTest() - now := time.Now() - tmock := transportMock{ - response: &http.Response{ - Status: http.StatusText(http.StatusNotFound), - StatusCode: http.StatusNotFound, - Header: http.Header{ - "Date": []string{now.Format(time.RFC1123)}, - "Cache-Control": []string{"no-cache"}, - }, - Body: ioutil.NopCloser(bytes.NewBuffer([]byte("some data"))), - }, - err: nil, - } - tp := NewMemoryCacheTransport() - tp.Transport = &tmock - - // First time, response is cached on success - r, _ := http.NewRequest("GET", "http://somewhere.com/", nil) - r.Header.Set("Cache-Control", "stale-if-error") - resp, err := tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - _, err = ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - // On failure, response is returned from the cache - tmock.response = nil - tmock.err = errors.New("some error") - resp, err = tp.RoundTrip(r) - if err != nil { - t.Fatal(err) - } - if resp == nil { - t.Fatal("resp is nil") - } - if resp.StatusCode != http.StatusNotFound { - t.Fatalf("Status wasn't 404: %d", resp.StatusCode) - } -} - -// Test that http.Client.Timeout is respected when cache transport is used. -// That is so as long as request cancellation is propagated correctly. -// In the past, that required CancelRequest to be implemented correctly, -// but modern http.Client uses Request.Cancel (or request context) instead, -// so we don't have to do anything. -func TestClientTimeout(t *testing.T) { - if testing.Short() { - t.Skip("skipping timeout test in short mode") // Because it takes at least 3 seconds to run. - } - resetTest() - client := &http.Client{ - Transport: NewMemoryCacheTransport(), - Timeout: time.Second, - } - started := time.Now() - resp, err := client.Get(s.server.URL + "/3seconds") - taken := time.Since(started) - if err == nil { - t.Error("got nil error, want timeout error") - } - if resp != nil { - t.Error("got non-nil resp, want nil resp") - } - if taken >= 2*time.Second { - t.Error("client.Do took 2+ seconds, want < 2 seconds") - } -} diff --git a/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache.go b/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache.go deleted file mode 100644 index 9bcb7e2771..0000000000 --- a/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache.go +++ /dev/null @@ -1,51 +0,0 @@ -// Package leveldbcache provides an implementation of httpcache.Cache that -// uses github.com/syndtr/goleveldb/leveldb -package leveldbcache - -import ( - "github.com/syndtr/goleveldb/leveldb" -) - -// Cache is an implementation of httpcache.Cache with leveldb storage -type Cache struct { - db *leveldb.DB -} - -// Get returns the response corresponding to key if present -func (c *Cache) Get(key string) (resp []byte, ok bool) { - var err error - resp, err = c.db.Get([]byte(key), nil) - if err != nil { - return []byte{}, false - } - return resp, true -} - -// Set saves a response to the cache as key -func (c *Cache) Set(key string, resp []byte) { - c.db.Put([]byte(key), resp, nil) -} - -// Delete removes the response with key from the cache -func (c *Cache) Delete(key string) { - c.db.Delete([]byte(key), nil) -} - -// New returns a new Cache that will store leveldb in path -func New(path string) (*Cache, error) { - cache := &Cache{} - - var err error - cache.db, err = leveldb.OpenFile(path, nil) - - if err != nil { - return nil, err - } - return cache, nil -} - -// NewWithDB returns a new Cache using the provided leveldb as underlying -// storage. -func NewWithDB(db *leveldb.DB) *Cache { - return &Cache{db} -} diff --git a/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache_test.go b/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache_test.go deleted file mode 100644 index b885c01695..0000000000 --- a/vendor/github.com/gregjones/httpcache/leveldbcache/leveldbcache_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package leveldbcache - -import ( - "bytes" - "io/ioutil" - "os" - "path/filepath" - "testing" -) - -func TestDiskCache(t *testing.T) { - tempDir, err := ioutil.TempDir("", "httpcache") - if err != nil { - t.Fatalf("TempDir: %v", err) - } - defer os.RemoveAll(tempDir) - - cache, err := New(filepath.Join(tempDir, "db")) - if err != nil { - t.Fatalf("New leveldb,: %v", err) - } - - key := "testKey" - _, ok := cache.Get(key) - if ok { - t.Fatal("retrieved key before adding it") - } - - val := []byte("some bytes") - cache.Set(key, val) - - retVal, ok := cache.Get(key) - if !ok { - t.Fatal("could not retrieve an element we just added") - } - if !bytes.Equal(retVal, val) { - t.Fatal("retrieved a different value than what we put in") - } - - cache.Delete(key) - - _, ok = cache.Get(key) - if ok { - t.Fatal("deleted key still present") - } -} diff --git a/vendor/github.com/gregjones/httpcache/memcache/appengine.go b/vendor/github.com/gregjones/httpcache/memcache/appengine.go deleted file mode 100644 index e68d9bc092..0000000000 --- a/vendor/github.com/gregjones/httpcache/memcache/appengine.go +++ /dev/null @@ -1,61 +0,0 @@ -// +build appengine - -// Package memcache provides an implementation of httpcache.Cache that uses App -// Engine's memcache package to store cached responses. -// -// When not built for Google App Engine, this package will provide an -// implementation that connects to a specified memcached server. See the -// memcache.go file in this package for details. -package memcache - -import ( - "appengine" - "appengine/memcache" -) - -// Cache is an implementation of httpcache.Cache that caches responses in App -// Engine's memcache. -type Cache struct { - appengine.Context -} - -// cacheKey modifies an httpcache key for use in memcache. Specifically, it -// prefixes keys to avoid collision with other data stored in memcache. -func cacheKey(key string) string { - return "httpcache:" + key -} - -// Get returns the response corresponding to key if present. -func (c *Cache) Get(key string) (resp []byte, ok bool) { - item, err := memcache.Get(c.Context, cacheKey(key)) - if err != nil { - if err != memcache.ErrCacheMiss { - c.Context.Errorf("error getting cached response: %v", err) - } - return nil, false - } - return item.Value, true -} - -// Set saves a response to the cache as key. -func (c *Cache) Set(key string, resp []byte) { - item := &memcache.Item{ - Key: cacheKey(key), - Value: resp, - } - if err := memcache.Set(c.Context, item); err != nil { - c.Context.Errorf("error caching response: %v", err) - } -} - -// Delete removes the response with key from the cache. -func (c *Cache) Delete(key string) { - if err := memcache.Delete(c.Context, cacheKey(key)); err != nil { - c.Context.Errorf("error deleting cached response: %v", err) - } -} - -// New returns a new Cache for the given context. -func New(ctx appengine.Context) *Cache { - return &Cache{ctx} -} diff --git a/vendor/github.com/gregjones/httpcache/memcache/appengine_test.go b/vendor/github.com/gregjones/httpcache/memcache/appengine_test.go deleted file mode 100644 index 818b2776ea..0000000000 --- a/vendor/github.com/gregjones/httpcache/memcache/appengine_test.go +++ /dev/null @@ -1,44 +0,0 @@ -// +build appengine - -package memcache - -import ( - "bytes" - "testing" - - "appengine/aetest" -) - -func TestAppEngine(t *testing.T) { - ctx, err := aetest.NewContext(nil) - if err != nil { - t.Fatal(err) - } - defer ctx.Close() - - cache := New(ctx) - - key := "testKey" - _, ok := cache.Get(key) - if ok { - t.Fatal("retrieved key before adding it") - } - - val := []byte("some bytes") - cache.Set(key, val) - - retVal, ok := cache.Get(key) - if !ok { - t.Fatal("could not retrieve an element we just added") - } - if !bytes.Equal(retVal, val) { - t.Fatal("retrieved a different value than what we put in") - } - - cache.Delete(key) - - _, ok = cache.Get(key) - if ok { - t.Fatal("deleted key still present") - } -} diff --git a/vendor/github.com/gregjones/httpcache/memcache/memcache.go b/vendor/github.com/gregjones/httpcache/memcache/memcache.go deleted file mode 100644 index 462f0e5419..0000000000 --- a/vendor/github.com/gregjones/httpcache/memcache/memcache.go +++ /dev/null @@ -1,60 +0,0 @@ -// +build !appengine - -// Package memcache provides an implementation of httpcache.Cache that uses -// gomemcache to store cached responses. -// -// When built for Google App Engine, this package will provide an -// implementation that uses App Engine's memcache service. See the -// appengine.go file in this package for details. -package memcache - -import ( - "github.com/bradfitz/gomemcache/memcache" -) - -// Cache is an implementation of httpcache.Cache that caches responses in a -// memcache server. -type Cache struct { - *memcache.Client -} - -// cacheKey modifies an httpcache key for use in memcache. Specifically, it -// prefixes keys to avoid collision with other data stored in memcache. -func cacheKey(key string) string { - return "httpcache:" + key -} - -// Get returns the response corresponding to key if present. -func (c *Cache) Get(key string) (resp []byte, ok bool) { - item, err := c.Client.Get(cacheKey(key)) - if err != nil { - return nil, false - } - return item.Value, true -} - -// Set saves a response to the cache as key. -func (c *Cache) Set(key string, resp []byte) { - item := &memcache.Item{ - Key: cacheKey(key), - Value: resp, - } - c.Client.Set(item) -} - -// Delete removes the response with key from the cache. -func (c *Cache) Delete(key string) { - c.Client.Delete(cacheKey(key)) -} - -// New returns a new Cache using the provided memcache server(s) with equal -// weight. If a server is listed multiple times, it gets a proportional amount -// of weight. -func New(server ...string) *Cache { - return NewWithClient(memcache.New(server...)) -} - -// NewWithClient returns a new Cache with the given memcache client. -func NewWithClient(client *memcache.Client) *Cache { - return &Cache{client} -} diff --git a/vendor/github.com/gregjones/httpcache/memcache/memcache_test.go b/vendor/github.com/gregjones/httpcache/memcache/memcache_test.go deleted file mode 100644 index 4dcc547c6e..0000000000 --- a/vendor/github.com/gregjones/httpcache/memcache/memcache_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// +build !appengine - -package memcache - -import ( - "bytes" - "net" - "testing" -) - -const testServer = "localhost:11211" - -func TestMemCache(t *testing.T) { - conn, err := net.Dial("tcp", testServer) - if err != nil { - // TODO: rather than skip the test, fall back to a faked memcached server - t.Skipf("skipping test; no server running at %s", testServer) - } - conn.Write([]byte("flush_all\r\n")) // flush memcache - conn.Close() - - cache := New(testServer) - - key := "testKey" - _, ok := cache.Get(key) - if ok { - t.Fatal("retrieved key before adding it") - } - - val := []byte("some bytes") - cache.Set(key, val) - - retVal, ok := cache.Get(key) - if !ok { - t.Fatal("could not retrieve an element we just added") - } - if !bytes.Equal(retVal, val) { - t.Fatal("retrieved a different value than what we put in") - } - - cache.Delete(key) - - _, ok = cache.Get(key) - if ok { - t.Fatal("deleted key still present") - } -} diff --git a/vendor/github.com/gregjones/httpcache/redis/redis.go b/vendor/github.com/gregjones/httpcache/redis/redis.go deleted file mode 100644 index 3143d44388..0000000000 --- a/vendor/github.com/gregjones/httpcache/redis/redis.go +++ /dev/null @@ -1,43 +0,0 @@ -// Package redis provides a redis interface for http caching. -package redis - -import ( - "github.com/garyburd/redigo/redis" - "github.com/gregjones/httpcache" -) - -// cache is an implementation of httpcache.Cache that caches responses in a -// redis server. -type cache struct { - redis.Conn -} - -// cacheKey modifies an httpcache key for use in redis. Specifically, it -// prefixes keys to avoid collision with other data stored in redis. -func cacheKey(key string) string { - return "rediscache:" + key -} - -// Get returns the response corresponding to key if present. -func (c cache) Get(key string) (resp []byte, ok bool) { - item, err := redis.Bytes(c.Do("GET", cacheKey(key))) - if err != nil { - return nil, false - } - return item, true -} - -// Set saves a response to the cache as key. -func (c cache) Set(key string, resp []byte) { - c.Do("SET", cacheKey(key), resp) -} - -// Delete removes the response with key from the cache. -func (c cache) Delete(key string) { - c.Do("DEL", cacheKey(key)) -} - -// NewWithClient returns a new Cache with the given redis connection. -func NewWithClient(client redis.Conn) httpcache.Cache { - return cache{client} -} diff --git a/vendor/github.com/gregjones/httpcache/redis/redis_test.go b/vendor/github.com/gregjones/httpcache/redis/redis_test.go deleted file mode 100644 index 72f6f619ae..0000000000 --- a/vendor/github.com/gregjones/httpcache/redis/redis_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package redis - -import ( - "bytes" - "testing" - - "github.com/garyburd/redigo/redis" -) - -func TestRedisCache(t *testing.T) { - conn, err := redis.Dial("tcp", "localhost:6379") - if err != nil { - // TODO: rather than skip the test, fall back to a faked redis server - t.Skipf("skipping test; no server running at localhost:6379") - } - conn.Do("FLUSHALL") - - cache := NewWithClient(conn) - - key := "testKey" - _, ok := cache.Get(key) - if ok { - t.Fatal("retrieved key before adding it") - } - - val := []byte("some bytes") - cache.Set(key, val) - - retVal, ok := cache.Get(key) - if !ok { - t.Fatal("could not retrieve an element we just added") - } - if !bytes.Equal(retVal, val) { - t.Fatal("retrieved a different value than what we put in") - } - - cache.Delete(key) - - _, ok = cache.Get(key) - if ok { - t.Fatal("deleted key still present") - } -} diff --git a/vendor/github.com/juju/ratelimit/LICENSE b/vendor/github.com/juju/ratelimit/LICENSE deleted file mode 100644 index ade9307b39..0000000000 --- a/vendor/github.com/juju/ratelimit/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -All files in this repository are licensed as follows. If you contribute -to this repository, it is assumed that you license your contribution -under the same license unless you state otherwise. - -All files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file. - -This software is licensed under the LGPLv3, included below. - -As a special exception to the GNU Lesser General Public License version 3 -("LGPL3"), the copyright holders of this Library give you permission to -convey to a third party a Combined Work that links statically or dynamically -to this Library without providing any Minimal Corresponding Source or -Minimal Application Code as set out in 4d or providing the installation -information set out in section 4e, provided that you comply with the other -provisions of LGPL3 and provided that you meet, for the Application the -terms and conditions of the license(s) which apply to the Application. - -Except as stated in this special exception, the provisions of LGPL3 will -continue to comply in full to this Library. If you modify this Library, you -may apply this exception to your version of this Library, but you are not -obliged to do so. If you do not wish to do so, delete this exception -statement from your version. This exception does not (and cannot) modify any -license terms which apply to the Application, with which you must still -comply. - - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/vendor/github.com/juju/ratelimit/README.md b/vendor/github.com/juju/ratelimit/README.md deleted file mode 100644 index a0fdfe2b12..0000000000 --- a/vendor/github.com/juju/ratelimit/README.md +++ /dev/null @@ -1,117 +0,0 @@ -# ratelimit --- - import "github.com/juju/ratelimit" - -The ratelimit package provides an efficient token bucket implementation. See -http://en.wikipedia.org/wiki/Token_bucket. - -## Usage - -#### func Reader - -```go -func Reader(r io.Reader, bucket *Bucket) io.Reader -``` -Reader returns a reader that is rate limited by the given token bucket. Each -token in the bucket represents one byte. - -#### func Writer - -```go -func Writer(w io.Writer, bucket *Bucket) io.Writer -``` -Writer returns a writer that is rate limited by the given token bucket. Each -token in the bucket represents one byte. - -#### type Bucket - -```go -type Bucket struct { -} -``` - -Bucket represents a token bucket that fills at a predetermined rate. Methods on -Bucket may be called concurrently. - -#### func NewBucket - -```go -func NewBucket(fillInterval time.Duration, capacity int64) *Bucket -``` -NewBucket returns a new token bucket that fills at the rate of one token every -fillInterval, up to the given maximum capacity. Both arguments must be positive. -The bucket is initially full. - -#### func NewBucketWithQuantum - -```go -func NewBucketWithQuantum(fillInterval time.Duration, capacity, quantum int64) *Bucket -``` -NewBucketWithQuantum is similar to NewBucket, but allows the specification of -the quantum size - quantum tokens are added every fillInterval. - -#### func NewBucketWithRate - -```go -func NewBucketWithRate(rate float64, capacity int64) *Bucket -``` -NewBucketWithRate returns a token bucket that fills the bucket at the rate of -rate tokens per second up to the given maximum capacity. Because of limited -clock resolution, at high rates, the actual rate may be up to 1% different from -the specified rate. - -#### func (*Bucket) Rate - -```go -func (tb *Bucket) Rate() float64 -``` -Rate returns the fill rate of the bucket, in tokens per second. - -#### func (*Bucket) Take - -```go -func (tb *Bucket) Take(count int64) time.Duration -``` -Take takes count tokens from the bucket without blocking. It returns the time -that the caller should wait until the tokens are actually available. - -Note that if the request is irrevocable - there is no way to return tokens to -the bucket once this method commits us to taking them. - -#### func (*Bucket) TakeAvailable - -```go -func (tb *Bucket) TakeAvailable(count int64) int64 -``` -TakeAvailable takes up to count immediately available tokens from the bucket. It -returns the number of tokens removed, or zero if there are no available tokens. -It does not block. - -#### func (*Bucket) TakeMaxDuration - -```go -func (tb *Bucket) TakeMaxDuration(count int64, maxWait time.Duration) (time.Duration, bool) -``` -TakeMaxDuration is like Take, except that it will only take tokens from the -bucket if the wait time for the tokens is no greater than maxWait. - -If it would take longer than maxWait for the tokens to become available, it does -nothing and reports false, otherwise it returns the time that the caller should -wait until the tokens are actually available, and reports true. - -#### func (*Bucket) Wait - -```go -func (tb *Bucket) Wait(count int64) -``` -Wait takes count tokens from the bucket, waiting until they are available. - -#### func (*Bucket) WaitMaxDuration - -```go -func (tb *Bucket) WaitMaxDuration(count int64, maxWait time.Duration) bool -``` -WaitMaxDuration is like Wait except that it will only take tokens from the -bucket if it needs to wait for no greater than maxWait. It reports whether any -tokens have been removed from the bucket If no tokens have been removed, it -returns immediately. diff --git a/vendor/github.com/juju/ratelimit/ratelimit.go b/vendor/github.com/juju/ratelimit/ratelimit.go deleted file mode 100644 index bd9ef10385..0000000000 --- a/vendor/github.com/juju/ratelimit/ratelimit.go +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3 with static-linking exception. -// See LICENCE file for details. - -// Package ratelimit provides an efficient token bucket implementation -// that can be used to limit the rate of arbitrary things. -// See http://en.wikipedia.org/wiki/Token_bucket. -package ratelimit - -import ( - "math" - "strconv" - "sync" - "time" -) - -// The algorithm that this implementation uses does computational work -// only when tokens are removed from the bucket, and that work completes -// in short, bounded-constant time (Bucket.Wait benchmarks at 175ns on -// my laptop). -// -// Time is measured in equal measured ticks, a given interval -// (fillInterval) apart. On each tick a number of tokens (quantum) are -// added to the bucket. -// -// When any of the methods are called the bucket updates the number of -// tokens that are in the bucket, and it records the current tick -// number too. Note that it doesn't record the current time - by -// keeping things in units of whole ticks, it's easy to dish out tokens -// at exactly the right intervals as measured from the start time. -// -// This allows us to calculate the number of tokens that will be -// available at some time in the future with a few simple arithmetic -// operations. -// -// The main reason for being able to transfer multiple tokens on each tick -// is so that we can represent rates greater than 1e9 (the resolution of the Go -// time package) tokens per second, but it's also useful because -// it means we can easily represent situations like "a person gets -// five tokens an hour, replenished on the hour". - -// Bucket represents a token bucket that fills at a predetermined rate. -// Methods on Bucket may be called concurrently. -type Bucket struct { - clock Clock - - // startTime holds the moment when the bucket was - // first created and ticks began. - startTime time.Time - - // capacity holds the overall capacity of the bucket. - capacity int64 - - // quantum holds how many tokens are added on - // each tick. - quantum int64 - - // fillInterval holds the interval between each tick. - fillInterval time.Duration - - // mu guards the fields below it. - mu sync.Mutex - - // availableTokens holds the number of available - // tokens as of the associated latestTick. - // It will be negative when there are consumers - // waiting for tokens. - availableTokens int64 - - // latestTick holds the latest tick for which - // we know the number of tokens in the bucket. - latestTick int64 -} - -// NewBucket returns a new token bucket that fills at the -// rate of one token every fillInterval, up to the given -// maximum capacity. Both arguments must be -// positive. The bucket is initially full. -func NewBucket(fillInterval time.Duration, capacity int64) *Bucket { - return NewBucketWithClock(fillInterval, capacity, nil) -} - -// NewBucketWithClock is identical to NewBucket but injects a testable clock -// interface. -func NewBucketWithClock(fillInterval time.Duration, capacity int64, clock Clock) *Bucket { - return NewBucketWithQuantumAndClock(fillInterval, capacity, 1, clock) -} - -// rateMargin specifes the allowed variance of actual -// rate from specified rate. 1% seems reasonable. -const rateMargin = 0.01 - -// NewBucketWithRate returns a token bucket that fills the bucket -// at the rate of rate tokens per second up to the given -// maximum capacity. Because of limited clock resolution, -// at high rates, the actual rate may be up to 1% different from the -// specified rate. -func NewBucketWithRate(rate float64, capacity int64) *Bucket { - return NewBucketWithRateAndClock(rate, capacity, nil) -} - -// NewBucketWithRateAndClock is identical to NewBucketWithRate but injects a -// testable clock interface. -func NewBucketWithRateAndClock(rate float64, capacity int64, clock Clock) *Bucket { - // Use the same bucket each time through the loop - // to save allocations. - tb := NewBucketWithQuantumAndClock(1, capacity, 1, clock) - for quantum := int64(1); quantum < 1<<50; quantum = nextQuantum(quantum) { - fillInterval := time.Duration(1e9 * float64(quantum) / rate) - if fillInterval <= 0 { - continue - } - tb.fillInterval = fillInterval - tb.quantum = quantum - if diff := math.Abs(tb.Rate() - rate); diff/rate <= rateMargin { - return tb - } - } - panic("cannot find suitable quantum for " + strconv.FormatFloat(rate, 'g', -1, 64)) -} - -// nextQuantum returns the next quantum to try after q. -// We grow the quantum exponentially, but slowly, so we -// get a good fit in the lower numbers. -func nextQuantum(q int64) int64 { - q1 := q * 11 / 10 - if q1 == q { - q1++ - } - return q1 -} - -// NewBucketWithQuantum is similar to NewBucket, but allows -// the specification of the quantum size - quantum tokens -// are added every fillInterval. -func NewBucketWithQuantum(fillInterval time.Duration, capacity, quantum int64) *Bucket { - return NewBucketWithQuantumAndClock(fillInterval, capacity, quantum, nil) -} - -// NewBucketWithQuantumAndClock is like NewBucketWithQuantum, but -// also has a clock argument that allows clients to fake the passing -// of time. If clock is nil, the system clock will be used. -func NewBucketWithQuantumAndClock(fillInterval time.Duration, capacity, quantum int64, clock Clock) *Bucket { - if clock == nil { - clock = realClock{} - } - if fillInterval <= 0 { - panic("token bucket fill interval is not > 0") - } - if capacity <= 0 { - panic("token bucket capacity is not > 0") - } - if quantum <= 0 { - panic("token bucket quantum is not > 0") - } - return &Bucket{ - clock: clock, - startTime: clock.Now(), - latestTick: 0, - fillInterval: fillInterval, - capacity: capacity, - quantum: quantum, - availableTokens: capacity, - } -} - -// Wait takes count tokens from the bucket, waiting until they are -// available. -func (tb *Bucket) Wait(count int64) { - if d := tb.Take(count); d > 0 { - tb.clock.Sleep(d) - } -} - -// WaitMaxDuration is like Wait except that it will -// only take tokens from the bucket if it needs to wait -// for no greater than maxWait. It reports whether -// any tokens have been removed from the bucket -// If no tokens have been removed, it returns immediately. -func (tb *Bucket) WaitMaxDuration(count int64, maxWait time.Duration) bool { - d, ok := tb.TakeMaxDuration(count, maxWait) - if d > 0 { - tb.clock.Sleep(d) - } - return ok -} - -const infinityDuration time.Duration = 0x7fffffffffffffff - -// Take takes count tokens from the bucket without blocking. It returns -// the time that the caller should wait until the tokens are actually -// available. -// -// Note that if the request is irrevocable - there is no way to return -// tokens to the bucket once this method commits us to taking them. -func (tb *Bucket) Take(count int64) time.Duration { - tb.mu.Lock() - defer tb.mu.Unlock() - d, _ := tb.take(tb.clock.Now(), count, infinityDuration) - return d -} - -// TakeMaxDuration is like Take, except that -// it will only take tokens from the bucket if the wait -// time for the tokens is no greater than maxWait. -// -// If it would take longer than maxWait for the tokens -// to become available, it does nothing and reports false, -// otherwise it returns the time that the caller should -// wait until the tokens are actually available, and reports -// true. -func (tb *Bucket) TakeMaxDuration(count int64, maxWait time.Duration) (time.Duration, bool) { - tb.mu.Lock() - defer tb.mu.Unlock() - return tb.take(tb.clock.Now(), count, maxWait) -} - -// TakeAvailable takes up to count immediately available tokens from the -// bucket. It returns the number of tokens removed, or zero if there are -// no available tokens. It does not block. -func (tb *Bucket) TakeAvailable(count int64) int64 { - tb.mu.Lock() - defer tb.mu.Unlock() - return tb.takeAvailable(tb.clock.Now(), count) -} - -// takeAvailable is the internal version of TakeAvailable - it takes the -// current time as an argument to enable easy testing. -func (tb *Bucket) takeAvailable(now time.Time, count int64) int64 { - if count <= 0 { - return 0 - } - tb.adjustavailableTokens(tb.currentTick(now)) - if tb.availableTokens <= 0 { - return 0 - } - if count > tb.availableTokens { - count = tb.availableTokens - } - tb.availableTokens -= count - return count -} - -// Available returns the number of available tokens. It will be negative -// when there are consumers waiting for tokens. Note that if this -// returns greater than zero, it does not guarantee that calls that take -// tokens from the buffer will succeed, as the number of available -// tokens could have changed in the meantime. This method is intended -// primarily for metrics reporting and debugging. -func (tb *Bucket) Available() int64 { - return tb.available(tb.clock.Now()) -} - -// available is the internal version of available - it takes the current time as -// an argument to enable easy testing. -func (tb *Bucket) available(now time.Time) int64 { - tb.mu.Lock() - defer tb.mu.Unlock() - tb.adjustavailableTokens(tb.currentTick(now)) - return tb.availableTokens -} - -// Capacity returns the capacity that the bucket was created with. -func (tb *Bucket) Capacity() int64 { - return tb.capacity -} - -// Rate returns the fill rate of the bucket, in tokens per second. -func (tb *Bucket) Rate() float64 { - return 1e9 * float64(tb.quantum) / float64(tb.fillInterval) -} - -// take is the internal version of Take - it takes the current time as -// an argument to enable easy testing. -func (tb *Bucket) take(now time.Time, count int64, maxWait time.Duration) (time.Duration, bool) { - if count <= 0 { - return 0, true - } - - tick := tb.currentTick(now) - tb.adjustavailableTokens(tick) - avail := tb.availableTokens - count - if avail >= 0 { - tb.availableTokens = avail - return 0, true - } - // Round up the missing tokens to the nearest multiple - // of quantum - the tokens won't be available until - // that tick. - - // endTick holds the tick when all the requested tokens will - // become available. - endTick := tick + (-avail+tb.quantum-1)/tb.quantum - endTime := tb.startTime.Add(time.Duration(endTick) * tb.fillInterval) - waitTime := endTime.Sub(now) - if waitTime > maxWait { - return 0, false - } - tb.availableTokens = avail - return waitTime, true -} - -// currentTick returns the current time tick, measured -// from tb.startTime. -func (tb *Bucket) currentTick(now time.Time) int64 { - return int64(now.Sub(tb.startTime) / tb.fillInterval) -} - -// adjustavailableTokens adjusts the current number of tokens -// available in the bucket at the given time, which must -// be in the future (positive) with respect to tb.latestTick. -func (tb *Bucket) adjustavailableTokens(tick int64) { - if tb.availableTokens >= tb.capacity { - return - } - tb.availableTokens += (tick - tb.latestTick) * tb.quantum - if tb.availableTokens > tb.capacity { - tb.availableTokens = tb.capacity - } - tb.latestTick = tick - return -} - -// Clock represents the passage of time in a way that -// can be faked out for tests. -type Clock interface { - // Now returns the current time. - Now() time.Time - // Sleep sleeps for at least the given duration. - Sleep(d time.Duration) -} - -// realClock implements Clock in terms of standard time functions. -type realClock struct{} - -// Now implements Clock.Now by calling time.Now. -func (realClock) Now() time.Time { - return time.Now() -} - -// Now implements Clock.Sleep by calling time.Sleep. -func (realClock) Sleep(d time.Duration) { - time.Sleep(d) -} diff --git a/vendor/github.com/juju/ratelimit/ratelimit_test.go b/vendor/github.com/juju/ratelimit/ratelimit_test.go deleted file mode 100644 index 3de0cad6e0..0000000000 --- a/vendor/github.com/juju/ratelimit/ratelimit_test.go +++ /dev/null @@ -1,396 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3 with static-linking exception. -// See LICENCE file for details. - -package ratelimit - -import ( - "math" - "testing" - "time" - - gc "gopkg.in/check.v1" -) - -func TestPackage(t *testing.T) { - gc.TestingT(t) -} - -type rateLimitSuite struct{} - -var _ = gc.Suite(rateLimitSuite{}) - -type takeReq struct { - time time.Duration - count int64 - expectWait time.Duration -} - -var takeTests = []struct { - about string - fillInterval time.Duration - capacity int64 - reqs []takeReq -}{{ - about: "serial requests", - fillInterval: 250 * time.Millisecond, - capacity: 10, - reqs: []takeReq{{ - time: 0, - count: 0, - expectWait: 0, - }, { - time: 0, - count: 10, - expectWait: 0, - }, { - time: 0, - count: 1, - expectWait: 250 * time.Millisecond, - }, { - time: 250 * time.Millisecond, - count: 1, - expectWait: 250 * time.Millisecond, - }}, -}, { - about: "concurrent requests", - fillInterval: 250 * time.Millisecond, - capacity: 10, - reqs: []takeReq{{ - time: 0, - count: 10, - expectWait: 0, - }, { - time: 0, - count: 2, - expectWait: 500 * time.Millisecond, - }, { - time: 0, - count: 2, - expectWait: 1000 * time.Millisecond, - }, { - time: 0, - count: 1, - expectWait: 1250 * time.Millisecond, - }}, -}, { - about: "more than capacity", - fillInterval: 1 * time.Millisecond, - capacity: 10, - reqs: []takeReq{{ - time: 0, - count: 10, - expectWait: 0, - }, { - time: 20 * time.Millisecond, - count: 15, - expectWait: 5 * time.Millisecond, - }}, -}, { - about: "sub-quantum time", - fillInterval: 10 * time.Millisecond, - capacity: 10, - reqs: []takeReq{{ - time: 0, - count: 10, - expectWait: 0, - }, { - time: 7 * time.Millisecond, - count: 1, - expectWait: 3 * time.Millisecond, - }, { - time: 8 * time.Millisecond, - count: 1, - expectWait: 12 * time.Millisecond, - }}, -}, { - about: "within capacity", - fillInterval: 10 * time.Millisecond, - capacity: 5, - reqs: []takeReq{{ - time: 0, - count: 5, - expectWait: 0, - }, { - time: 60 * time.Millisecond, - count: 5, - expectWait: 0, - }, { - time: 60 * time.Millisecond, - count: 1, - expectWait: 10 * time.Millisecond, - }, { - time: 80 * time.Millisecond, - count: 2, - expectWait: 10 * time.Millisecond, - }}, -}} - -var availTests = []struct { - about string - capacity int64 - fillInterval time.Duration - take int64 - sleep time.Duration - - expectCountAfterTake int64 - expectCountAfterSleep int64 -}{{ - about: "should fill tokens after interval", - capacity: 5, - fillInterval: time.Second, - take: 5, - sleep: time.Second, - expectCountAfterTake: 0, - expectCountAfterSleep: 1, -}, { - about: "should fill tokens plus existing count", - capacity: 2, - fillInterval: time.Second, - take: 1, - sleep: time.Second, - expectCountAfterTake: 1, - expectCountAfterSleep: 2, -}, { - about: "shouldn't fill before interval", - capacity: 2, - fillInterval: 2 * time.Second, - take: 1, - sleep: time.Second, - expectCountAfterTake: 1, - expectCountAfterSleep: 1, -}, { - about: "should fill only once after 1*interval before 2*interval", - capacity: 2, - fillInterval: 2 * time.Second, - take: 1, - sleep: 3 * time.Second, - expectCountAfterTake: 1, - expectCountAfterSleep: 2, -}} - -func (rateLimitSuite) TestTake(c *gc.C) { - for i, test := range takeTests { - tb := NewBucket(test.fillInterval, test.capacity) - for j, req := range test.reqs { - d, ok := tb.take(tb.startTime.Add(req.time), req.count, infinityDuration) - c.Assert(ok, gc.Equals, true) - if d != req.expectWait { - c.Fatalf("test %d.%d, %s, got %v want %v", i, j, test.about, d, req.expectWait) - } - } - } -} - -func (rateLimitSuite) TestTakeMaxDuration(c *gc.C) { - for i, test := range takeTests { - tb := NewBucket(test.fillInterval, test.capacity) - for j, req := range test.reqs { - if req.expectWait > 0 { - d, ok := tb.take(tb.startTime.Add(req.time), req.count, req.expectWait-1) - c.Assert(ok, gc.Equals, false) - c.Assert(d, gc.Equals, time.Duration(0)) - } - d, ok := tb.take(tb.startTime.Add(req.time), req.count, req.expectWait) - c.Assert(ok, gc.Equals, true) - if d != req.expectWait { - c.Fatalf("test %d.%d, %s, got %v want %v", i, j, test.about, d, req.expectWait) - } - } - } -} - -type takeAvailableReq struct { - time time.Duration - count int64 - expect int64 -} - -var takeAvailableTests = []struct { - about string - fillInterval time.Duration - capacity int64 - reqs []takeAvailableReq -}{{ - about: "serial requests", - fillInterval: 250 * time.Millisecond, - capacity: 10, - reqs: []takeAvailableReq{{ - time: 0, - count: 0, - expect: 0, - }, { - time: 0, - count: 10, - expect: 10, - }, { - time: 0, - count: 1, - expect: 0, - }, { - time: 250 * time.Millisecond, - count: 1, - expect: 1, - }}, -}, { - about: "concurrent requests", - fillInterval: 250 * time.Millisecond, - capacity: 10, - reqs: []takeAvailableReq{{ - time: 0, - count: 5, - expect: 5, - }, { - time: 0, - count: 2, - expect: 2, - }, { - time: 0, - count: 5, - expect: 3, - }, { - time: 0, - count: 1, - expect: 0, - }}, -}, { - about: "more than capacity", - fillInterval: 1 * time.Millisecond, - capacity: 10, - reqs: []takeAvailableReq{{ - time: 0, - count: 10, - expect: 10, - }, { - time: 20 * time.Millisecond, - count: 15, - expect: 10, - }}, -}, { - about: "within capacity", - fillInterval: 10 * time.Millisecond, - capacity: 5, - reqs: []takeAvailableReq{{ - time: 0, - count: 5, - expect: 5, - }, { - time: 60 * time.Millisecond, - count: 5, - expect: 5, - }, { - time: 70 * time.Millisecond, - count: 1, - expect: 1, - }}, -}} - -func (rateLimitSuite) TestTakeAvailable(c *gc.C) { - for i, test := range takeAvailableTests { - tb := NewBucket(test.fillInterval, test.capacity) - for j, req := range test.reqs { - d := tb.takeAvailable(tb.startTime.Add(req.time), req.count) - if d != req.expect { - c.Fatalf("test %d.%d, %s, got %v want %v", i, j, test.about, d, req.expect) - } - } - } -} - -func (rateLimitSuite) TestPanics(c *gc.C) { - c.Assert(func() { NewBucket(0, 1) }, gc.PanicMatches, "token bucket fill interval is not > 0") - c.Assert(func() { NewBucket(-2, 1) }, gc.PanicMatches, "token bucket fill interval is not > 0") - c.Assert(func() { NewBucket(1, 0) }, gc.PanicMatches, "token bucket capacity is not > 0") - c.Assert(func() { NewBucket(1, -2) }, gc.PanicMatches, "token bucket capacity is not > 0") -} - -func isCloseTo(x, y, tolerance float64) bool { - return math.Abs(x-y)/y < tolerance -} - -func (rateLimitSuite) TestRate(c *gc.C) { - tb := NewBucket(1, 1) - if !isCloseTo(tb.Rate(), 1e9, 0.00001) { - c.Fatalf("got %v want 1e9", tb.Rate()) - } - tb = NewBucket(2*time.Second, 1) - if !isCloseTo(tb.Rate(), 0.5, 0.00001) { - c.Fatalf("got %v want 0.5", tb.Rate()) - } - tb = NewBucketWithQuantum(100*time.Millisecond, 1, 5) - if !isCloseTo(tb.Rate(), 50, 0.00001) { - c.Fatalf("got %v want 50", tb.Rate()) - } -} - -func checkRate(c *gc.C, rate float64) { - tb := NewBucketWithRate(rate, 1<<62) - if !isCloseTo(tb.Rate(), rate, rateMargin) { - c.Fatalf("got %g want %v", tb.Rate(), rate) - } - d, ok := tb.take(tb.startTime, 1<<62, infinityDuration) - c.Assert(ok, gc.Equals, true) - c.Assert(d, gc.Equals, time.Duration(0)) - - // Check that the actual rate is as expected by - // asking for a not-quite multiple of the bucket's - // quantum and checking that the wait time - // correct. - d, ok = tb.take(tb.startTime, tb.quantum*2-tb.quantum/2, infinityDuration) - c.Assert(ok, gc.Equals, true) - expectTime := 1e9 * float64(tb.quantum) * 2 / rate - if !isCloseTo(float64(d), expectTime, rateMargin) { - c.Fatalf("rate %g: got %g want %v", rate, float64(d), expectTime) - } -} - -func (rateLimitSuite) NewBucketWithRate(c *gc.C) { - for rate := float64(1); rate < 1e6; rate += 7 { - checkRate(c, rate) - } - for _, rate := range []float64{ - 1024 * 1024 * 1024, - 1e-5, - 0.9e-5, - 0.5, - 0.9, - 0.9e8, - 3e12, - 4e18, - float64(1<<63 - 1), - } { - checkRate(c, rate) - checkRate(c, rate/3) - checkRate(c, rate*1.3) - } -} - -func TestAvailable(t *testing.T) { - for i, tt := range availTests { - tb := NewBucket(tt.fillInterval, tt.capacity) - if c := tb.takeAvailable(tb.startTime, tt.take); c != tt.take { - t.Fatalf("#%d: %s, take = %d, want = %d", i, tt.about, c, tt.take) - } - if c := tb.available(tb.startTime); c != tt.expectCountAfterTake { - t.Fatalf("#%d: %s, after take, available = %d, want = %d", i, tt.about, c, tt.expectCountAfterTake) - } - if c := tb.available(tb.startTime.Add(tt.sleep)); c != tt.expectCountAfterSleep { - t.Fatalf("#%d: %s, after some time it should fill in new tokens, available = %d, want = %d", - i, tt.about, c, tt.expectCountAfterSleep) - } - } - -} - -func BenchmarkWait(b *testing.B) { - tb := NewBucket(1, 16*1024) - for i := b.N - 1; i >= 0; i-- { - tb.Wait(1) - } -} - -func BenchmarkNewBucket(b *testing.B) { - for i := b.N - 1; i >= 0; i-- { - NewBucketWithRate(4e18, 1<<62) - } -} diff --git a/vendor/github.com/juju/ratelimit/reader.go b/vendor/github.com/juju/ratelimit/reader.go deleted file mode 100644 index 6403bf78d4..0000000000 --- a/vendor/github.com/juju/ratelimit/reader.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3 with static-linking exception. -// See LICENCE file for details. - -package ratelimit - -import "io" - -type reader struct { - r io.Reader - bucket *Bucket -} - -// Reader returns a reader that is rate limited by -// the given token bucket. Each token in the bucket -// represents one byte. -func Reader(r io.Reader, bucket *Bucket) io.Reader { - return &reader{ - r: r, - bucket: bucket, - } -} - -func (r *reader) Read(buf []byte) (int, error) { - n, err := r.r.Read(buf) - if n <= 0 { - return n, err - } - r.bucket.Wait(int64(n)) - return n, err -} - -type writer struct { - w io.Writer - bucket *Bucket -} - -// Writer returns a reader that is rate limited by -// the given token bucket. Each token in the bucket -// represents one byte. -func Writer(w io.Writer, bucket *Bucket) io.Writer { - return &writer{ - w: w, - bucket: bucket, - } -} - -func (w *writer) Write(buf []byte) (int, error) { - w.bucket.Wait(int64(len(buf))) - return w.w.Write(buf) -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/.gitignore b/vendor/github.com/kubernetes-incubator/external-storage/.gitignore index 01567f3b10..5a6c588ca0 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/.gitignore +++ b/vendor/github.com/kubernetes-incubator/external-storage/.gitignore @@ -66,9 +66,6 @@ flycheck_*.el /snapshot/deploy/docker/controller/snapshot-controller /snapshot/deploy/docker/provisioner/snapshot-provisioner -# cinder binary -/openstack/standalone-cinder/cinder-provisioner - # digitalocean binaries /digitalocean/digitalocean-flexplugin /digitalocean/deploy/docker/digitalocean-flexplugin diff --git a/vendor/github.com/kubernetes-incubator/external-storage/.travis.yml b/vendor/github.com/kubernetes-incubator/external-storage/.travis.yml index 245fee56a1..3ab3d181d4 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/.travis.yml +++ b/vendor/github.com/kubernetes-incubator/external-storage/.travis.yml @@ -1,13 +1,24 @@ +os: + - osx + - linux + language: go go: - 1.8.3 services: docker +go_import_path: github.com/kubernetes-incubator/external-storage + env: - - TEST_SUITE=local-volume - - TEST_SUITE=everything-else - - TEST_SUITE=nfs ETCD_VER=v3.0.14 KUBE_VERSION=1.5.4 - - TEST_SUITE=nfs ETCD_VER=v3.0.17 KUBE_VERSION=1.6.0 + - TEST_SUITE=osx + - TEST_SUITE=linux-local-volume + - TEST_SUITE=linux-everything-else + - TEST_SUITE=linux-nfs ETCD_VER=v3.0.14 KUBE_VERSION=1.5.4 + - TEST_SUITE=linux-nfs ETCD_VER=v3.0.17 KUBE_VERSION=1.6.0 + +before_install: + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then ulimit -n 8192; fi + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then mkdir -p $GOPATH/bin; fi install: true @@ -19,4 +30,4 @@ deploy: script: ./deploy.sh on: tags: true - condition: $TEST_SUITE = local-volume + condition: $TEST_SUITE = linux-local-volume diff --git a/vendor/github.com/kubernetes-incubator/external-storage/Makefile b/vendor/github.com/kubernetes-incubator/external-storage/Makefile index 1f171521da..9342c53375 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/Makefile +++ b/vendor/github.com/kubernetes-incubator/external-storage/Makefile @@ -12,14 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -all: aws/efs ceph/cephfs ceph/rbd flex gluster/block gluster/glusterfs gluster/file iscsi/targetd local-volume/provisioner nfs-client nfs snapshot openstack/standalone-cinder openstack-sharedfilesystems +all: aws/efs ceph/cephfs ceph/rbd flex gluster/block gluster/glusterfs gluster/file iscsi/targetd local-volume/provisioner nfs-client nfs snapshot .PHONY: all -clean: clean-aws/efs clean-ceph/cephfs clean-ceph/rbd clean-flex clean-gluster/block clean-gluster/glusterfs clean-iscsi/targetd clean-local-volume/provisioner clean-nfs-client clean-nfs clean-openebs clean-snapshot clean-openstack/standalone-cinder clean-openstack-sharedfilesystems +clean: clean-aws/efs clean-ceph/cephfs clean-ceph/rbd clean-flex clean-gluster/block clean-gluster/glusterfs clean-iscsi/targetd clean-local-volume/provisioner clean-nfs-client clean-nfs clean-openebs clean-snapshot .PHONY: clean - -test: test-aws/efs test-local-volume/provisioner test-nfs test-snapshot test-openstack/standalone-cinder test-openstack-sharedfilesystems +test: test-aws/efs test-local-volume/provisioner test-nfs test-snapshot .PHONY: test verify: @@ -127,6 +126,11 @@ test-local-volume/provisioner: go test ./... .PHONY: test-local-volume/provisioner +test-local-volume/helm: + cd local-volume/helm; \ + ./test/run.sh +.PHONY: test-local-volume/helm + clean-local-volume/provisioner: cd local-volume/provisioner; \ make clean @@ -182,42 +186,11 @@ clean-snapshot: make clean .PHONY: clean-snapshot -openstack/standalone-cinder: - cd openstack/standalone-cinder; \ - make -.PHONY: openstack/standalone-cinder - -test-openstack/standalone-cinder: - cd openstack/standalone-cinder; \ - make test -.PHONY: test-openstack/standalone-cinder - -clean-openstack/standalone-cinder: - cd openstack/standalone-cinder; \ - make clean -.PHONY: clean-openstack/standalone-cinder - test-snapshot: cd snapshot; \ make test .PHONY: test-snapshot -openstack-sharedfilesystems: - cd openstack-sharedfilesystems; \ - make container -.PHONY: openstack-sharedfilesystems - -test-openstack-sharedfilesystems: - cd openstack-sharedfilesystems; \ - make test -.PHONY: test-openstack-sharedfilesystems - -clean-openstack-sharedfilesystems: - cd openstack-sharedfilesystems; \ - make clean -.PHONY: clean-openstack-sharedfilesystems - - push-cephfs-provisioner: cd ceph/cephfs; \ make push @@ -268,16 +241,16 @@ push-nfs-provisioner: make push .PHONY: push-nfs-provisioner +push-flex-provisioner: + cd flex; \ + make push +.PHONY: push-flex-provisioner + push-openebs-provisioner: cd openebs; \ make push .PHONY: push-openebs-provisioner -push-openstack-sharedfilesystems: - cd openstack-sharedfilesystems; \ - make push -.PHONY: push-openstack-sharedfilesystems - deploy-openebs-provisioner: cd openebs; \ make deploy diff --git a/vendor/github.com/kubernetes-incubator/external-storage/README.md b/vendor/github.com/kubernetes-incubator/external-storage/README.md index b7cb371233..ee07dc6411 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/README.md +++ b/vendor/github.com/kubernetes-incubator/external-storage/README.md @@ -7,7 +7,7 @@ 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'? -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. +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/concepts/storage/storage-classes/#provisioner) that run as part of the Kubernetes controller manager, external ones can be deployed & updated independently. 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). diff --git a/vendor/github.com/kubernetes-incubator/external-storage/aws/efs/cmd/efs-provisioner/efs-provisioner.go b/vendor/github.com/kubernetes-incubator/external-storage/aws/efs/cmd/efs-provisioner/efs-provisioner.go index c0a4134aeb..2f6dc8ad02 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/aws/efs/cmd/efs-provisioner/efs-provisioner.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/aws/efs/cmd/efs-provisioner/efs-provisioner.go @@ -171,6 +171,7 @@ func (p *efsProvisioner) Provision(options controller.VolumeOptions) (*v1.Persis ReadOnly: false, }, }, + MountOptions: []string{"vers=4.1"}, }, } if gidAllocate { diff --git a/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/Dockerfile b/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/Dockerfile index ae2e74aff5..6804b70cd2 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/Dockerfile +++ b/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/Dockerfile @@ -14,7 +14,7 @@ FROM centos:7 -ENV CEPH_VERSION "luminous" +ENV CEPH_VERSION "mimic" RUN rpm -Uvh https://download.ceph.com/rpm-$CEPH_VERSION/el7/noarch/ceph-release-1-1.el7.noarch.rpm && \ yum install -y epel-release && \ yum install -y --nogpgcheck ceph-common python-cephfs && \ diff --git a/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/OWNERS b/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/OWNERS index d8b94486e0..ff50b615cf 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/OWNERS +++ b/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/OWNERS @@ -1,2 +1,3 @@ approvers: - rootfs + - cofyc diff --git a/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/cephfs-provisioner.go b/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/cephfs-provisioner.go index 19c6f3957e..2d6ac55ceb 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/cephfs-provisioner.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/cephfs-provisioner.go @@ -23,6 +23,7 @@ import ( "fmt" "os" "os/exec" + "strconv" "strings" "github.com/golang/glog" @@ -60,13 +61,16 @@ type cephFSProvisioner struct { identity string // Namespace secrets will be created in. If empty, secrets will be created in each PVC's namespace. secretNamespace string + // enable PVC quota + enableQuota bool } -func newCephFSProvisioner(client kubernetes.Interface, id string, secretNamespace string) controller.Provisioner { +func newCephFSProvisioner(client kubernetes.Interface, id string, secretNamespace string, enableQuota bool) controller.Provisioner { return &cephFSProvisioner{ client: client, identity: id, secretNamespace: secretNamespace, + enableQuota: enableQuota, } } @@ -112,23 +116,39 @@ func (p *cephFSProvisioner) Provision(options controller.VolumeOptions) (*v1.Per if options.PVC.Spec.Selector != nil { return nil, fmt.Errorf("claim Selector is not supported") } - cluster, adminID, adminSecret, mon, err := p.parseParameters(options.Parameters) + cluster, adminID, adminSecret, pvcRoot, mon, deterministicNames, err := p.parseParameters(options.Parameters) if err != nil { return nil, err } - // create random share name - share := fmt.Sprintf("kubernetes-dynamic-pvc-%s", uuid.NewUUID()) - // create random user id - user := fmt.Sprintf("kubernetes-dynamic-user-%s", uuid.NewUUID()) + var share, user string + if deterministicNames { + share = fmt.Sprintf(options.PVC.Name) + user = fmt.Sprintf("k8s.%s.%s", options.PVC.Namespace, options.PVC.Name) + } else { + // create random share name + share = fmt.Sprintf("kubernetes-dynamic-pvc-%s", uuid.NewUUID()) + // create random user id + user = fmt.Sprintf("kubernetes-dynamic-user-%s", uuid.NewUUID()) + } // provision share // create cmd - cmd := exec.Command(provisionCmd, "-n", share, "-u", user) + args := []string{"-n", share, "-u", user} + if p.enableQuota { + capacity := options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] + requestBytes := strconv.FormatInt(capacity.Value(), 10) + args = append(args, "-s", requestBytes) + } + cmd := exec.Command(provisionCmd, args...) // set env cmd.Env = []string{ "CEPH_CLUSTER_NAME=" + cluster, "CEPH_MON=" + strings.Join(mon[:], ","), "CEPH_AUTH_ID=" + adminID, - "CEPH_AUTH_KEY=" + adminSecret} + "CEPH_AUTH_KEY=" + adminSecret, + "CEPH_VOLUME_ROOT=" + pvcRoot} + if deterministicNames { + cmd.Env = append(cmd.Env, "CEPH_VOLUME_GROUP="+options.PVC.Namespace) + } output, cmdErr := cmd.CombinedOutput() if cmdErr != nil { @@ -175,7 +195,10 @@ func (p *cephFSProvisioner) Provision(options controller.VolumeOptions) (*v1.Per Spec: v1.PersistentVolumeSpec{ PersistentVolumeReclaimPolicy: options.PersistentVolumeReclaimPolicy, AccessModes: options.PVC.Spec.AccessModes, - Capacity: v1.ResourceList{ //FIXME: kernel cephfs doesn't enforce quota, capacity is not meaningless here. + Capacity: v1.ResourceList{ + // Quotas are supported by the userspace client(ceph-fuse, libcephfs), or kernel client >= 4.17 but only on mimic clusters. + // In other cases capacity is meaningless here. + // If quota is enabled, provisioner will set ceph.quota.max_bytes on volume path. v1.ResourceName(v1.ResourceStorage): options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)], }, PersistentVolumeSource: v1.PersistentVolumeSource{ @@ -183,8 +206,7 @@ func (p *cephFSProvisioner) Provision(options controller.VolumeOptions) (*v1.Per Monitors: mon, Path: res.Path[strings.Index(res.Path, "/"):], SecretRef: &v1.SecretReference{ - Name: secretName, - // TODO https://github.com/kubernetes-incubator/external-storage/issues/309 + Name: secretName, Namespace: nameSpace, }, User: user, @@ -219,7 +241,7 @@ func (p *cephFSProvisioner) Delete(volume *v1.PersistentVolume) error { if err != nil { return err } - cluster, adminID, adminSecret, mon, err := p.parseParameters(class.Parameters) + cluster, adminID, adminSecret, pvcRoot, mon, _, err := p.parseParameters(class.Parameters) if err != nil { return err } @@ -231,7 +253,8 @@ func (p *cephFSProvisioner) Delete(volume *v1.PersistentVolume) error { "CEPH_CLUSTER_NAME=" + cluster, "CEPH_MON=" + strings.Join(mon[:], ","), "CEPH_AUTH_ID=" + adminID, - "CEPH_AUTH_KEY=" + adminSecret} + "CEPH_AUTH_KEY=" + adminSecret, + "CEPH_VOLUME_ROOT=" + pvcRoot} output, cmdErr := cmd.CombinedOutput() if cmdErr != nil { @@ -254,16 +277,19 @@ func (p *cephFSProvisioner) Delete(volume *v1.PersistentVolume) error { return nil } -func (p *cephFSProvisioner) parseParameters(parameters map[string]string) (string, string, string, []string, error) { +func (p *cephFSProvisioner) parseParameters(parameters map[string]string) (string, string, string, string, []string, bool, error) { var ( - err error - mon []string - cluster, adminID, adminSecretName, adminSecretNamespace, adminSecret string + err error + mon []string + cluster, adminID, adminSecretName, adminSecretNamespace, adminSecret, pvcRoot string + deterministicNames bool ) adminSecretNamespace = "default" adminID = "admin" cluster = "ceph" + pvcRoot = "/volumes/kubernetes" + deterministicNames = false for k, v := range parameters { switch strings.ToLower(k) { @@ -280,21 +306,26 @@ func (p *cephFSProvisioner) parseParameters(parameters map[string]string) (strin adminSecretName = v case "adminsecretnamespace": adminSecretNamespace = v + case "claimroot": + pvcRoot = v + case "deterministicnames": + // On error, strconv.ParseBool() returns false; leave that, as it is a perfectly fine default + deterministicNames, _ = strconv.ParseBool(v) default: - return "", "", "", nil, fmt.Errorf("invalid option %q", k) + return "", "", "", "", nil, false, fmt.Errorf("invalid option %q", k) } } // sanity check if adminSecretName == "" { - return "", "", "", nil, fmt.Errorf("missing Ceph admin secret name") + return "", "", "", "", nil, false, fmt.Errorf("missing Ceph admin secret name") } if adminSecret, err = p.parsePVSecret(adminSecretNamespace, adminSecretName); err != nil { - return "", "", "", nil, fmt.Errorf("failed to get admin secret from [%q/%q]: %v", adminSecretNamespace, adminSecretName, err) + return "", "", "", "", nil, false, fmt.Errorf("failed to get admin secret from [%q/%q]: %v", adminSecretNamespace, adminSecretName, err) } if len(mon) < 1 { - return "", "", "", nil, fmt.Errorf("missing Ceph monitors") + return "", "", "", "", nil, false, fmt.Errorf("missing Ceph monitors") } - return cluster, adminID, adminSecret, mon, nil + return cluster, adminID, adminSecret, pvcRoot, mon, deterministicNames, nil } func (p *cephFSProvisioner) parsePVSecret(namespace, secretName string) (string, error) { @@ -318,6 +349,8 @@ var ( kubeconfig = flag.String("kubeconfig", "", "Absolute path to the kubeconfig") id = flag.String("id", "", "Unique provisioner identity") secretNamespace = flag.String("secret-namespace", "", "Namespace secrets will be created in (default: '', created in each PVC's namespace)") + enableQuota = flag.Bool("enable-quota", false, "Enable PVC quota") + metricsPort = flag.Int("metrics-port", 0, "The port of the metrics server (set to non-zero to enable)") ) func main() { @@ -368,7 +401,7 @@ func main() { // Create the provisioner: it implements the Provisioner interface expected by // the controller glog.Infof("Creating CephFS provisioner %s with identity: %s, secret namespace: %s", prName, prID, *secretNamespace) - cephFSProvisioner := newCephFSProvisioner(clientset, prID, *secretNamespace) + cephFSProvisioner := newCephFSProvisioner(clientset, prID, *secretNamespace, *enableQuota) // Start the provision controller which will dynamically provision cephFS // PVs @@ -377,6 +410,7 @@ func main() { prName, cephFSProvisioner, serverVersion.GitVersion, + controller.MetricsPort(int32(*metricsPort)), ) pc.Run(wait.NeverStop) diff --git a/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/cephfs_provisioner/cephfs_provisioner.py b/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/cephfs_provisioner/cephfs_provisioner.py index 352494467c..9011e283f1 100755 --- a/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/cephfs_provisioner/cephfs_provisioner.py +++ b/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/cephfs_provisioner/cephfs_provisioner.py @@ -42,7 +42,9 @@ class CephFSNativeDriver(object): def __init__(self, *args, **kwargs): self._volume_client = None - + # Default volume_prefix to None; the CephFSVolumeClient constructor uses a ternary operator on the input argument to default it to /volumes + self.volume_prefix = os.environ.get('CEPH_VOLUME_ROOT', None) + self.volume_group = os.environ.get('CEPH_VOLUME_GROUP', VOlUME_GROUP) def _create_conf(self, cluster_name, mons): """ Create conf using monitors @@ -82,7 +84,7 @@ def volume_client(self): cluster_name = os.environ["CEPH_CLUSTER_NAME"] except KeyError: cluster_name = "ceph" - try: + try: mons = os.environ["CEPH_MON"] except KeyError: raise ValueError("Missing CEPH_MON env") @@ -90,7 +92,7 @@ def volume_client(self): auth_id = os.environ["CEPH_AUTH_ID"] except KeyError: raise ValueError("Missing CEPH_AUTH_ID") - try: + try: auth_key = os.environ["CEPH_AUTH_KEY"] except: raise ValueError("Missing CEPH_AUTH_KEY") @@ -99,7 +101,7 @@ def volume_client(self): self._create_keyring(cluster_name, auth_id, auth_key) self._volume_client = ceph_volume_client.CephFSVolumeClient( - auth_id, conf_path, cluster_name) + auth_id, conf_path, cluster_name, volume_prefix = self.volume_prefix) try: self._volume_client.connect(None) except Exception: @@ -202,7 +204,7 @@ def cap_update(orig, want, unwanted): def create_share(self, path, user_id, size=None): """Create a CephFS volume. """ - volume_path = ceph_volume_client.VolumePath(VOlUME_GROUP, path) + volume_path = ceph_volume_client.VolumePath(self.volume_group, path) # Create the CephFS volume volume = self.volume_client.create_volume(volume_path, size=size) @@ -237,7 +239,6 @@ def _deauthorize(self, volume_path, auth_id): """ client_entity = "client.{0}".format(auth_id) path = self.volume_client._get_path(volume_path) - path = self.volume_client._get_path(volume_path) pool_name = self.volume_client._get_ancestor_xattr(path, "ceph.dir.layout.pool") namespace = self.volume_client.fs.getxattr(path, "ceph.dir.layout.pool_namespace") @@ -286,7 +287,7 @@ def cap_remove(orig, want): return def delete_share(self, path, user_id): - volume_path = ceph_volume_client.VolumePath(VOlUME_GROUP, path) + volume_path = ceph_volume_client.VolumePath(self.volume_group, path) self._deauthorize(volume_path, user_id) self.volume_client.delete_volume(volume_path) self.volume_client.purge_volume(volume_path) @@ -296,15 +297,19 @@ def __del__(self): self._volume_client.disconnect() self._volume_client = None +def usage(): + print "Usage: " + sys.argv[0] + " --remove -n share_name -u ceph_user_id -s size" + def main(): create = True share = "" user = "" + size = None cephfs = CephFSNativeDriver() try: - opts, args = getopt.getopt(sys.argv[1:], "rn:u:", ["remove"]) + opts, args = getopt.getopt(sys.argv[1:], "rn:u:s:", ["remove"]) except getopt.GetoptError: - print "Usage: " + sys.argv[0] + " --remove -n share_name -u ceph_user_id" + usage() sys.exit(1) for opt, arg in opts: @@ -312,18 +317,20 @@ def main(): share = arg elif opt == '-u': user = arg + elif opt == '-s': + size = arg elif opt in ("-r", "--remove"): create = False if share == "" or user == "": - print "Usage: " + sys.argv[0] + " --remove -n share_name -u ceph_user_id" + usage() sys.exit(1) - if create == True: - print cephfs.create_share(share, user) + if create: + print cephfs.create_share(share, user, size=size) else: - cephfs.delete_share(share, user) - - + cephfs.delete_share(share, user) + + if __name__ == "__main__": main() diff --git a/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/example/class.yaml b/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/example/class.yaml index 91c73c0648..c841f23679 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/example/class.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/ceph/cephfs/example/class.yaml @@ -8,4 +8,5 @@ parameters: adminId: admin adminSecretName: ceph-secret-admin adminSecretNamespace: "kube-system" + claimRoot: /volumes/kubernetes diff --git a/vendor/github.com/kubernetes-incubator/external-storage/ceph/rbd/Dockerfile b/vendor/github.com/kubernetes-incubator/external-storage/ceph/rbd/Dockerfile index 586aa5992d..b4ac2a60b9 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/ceph/rbd/Dockerfile +++ b/vendor/github.com/kubernetes-incubator/external-storage/ceph/rbd/Dockerfile @@ -14,7 +14,7 @@ FROM centos:7 -ENV CEPH_VERSION "luminous" +ENV CEPH_VERSION "mimic" RUN rpm -Uvh https://download.ceph.com/rpm-$CEPH_VERSION/el7/noarch/ceph-release-1-1.el7.noarch.rpm && \ yum install -y epel-release && \ yum install -y --nogpgcheck ceph-common && \ diff --git a/vendor/github.com/kubernetes-incubator/external-storage/ceph/rbd/cmd/rbd-provisioner/main.go b/vendor/github.com/kubernetes-incubator/external-storage/ceph/rbd/cmd/rbd-provisioner/main.go index 41f036de3a..1b8515cd24 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/ceph/rbd/cmd/rbd-provisioner/main.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/ceph/rbd/cmd/rbd-provisioner/main.go @@ -30,9 +30,10 @@ import ( ) var ( - master = flag.String("master", "", "Master URL") - kubeconfig = flag.String("kubeconfig", "", "Absolute path to the kubeconfig") - id = flag.String("id", "", "Unique provisioner identity") + master = flag.String("master", "", "Master URL") + kubeconfig = flag.String("kubeconfig", "", "Absolute path to the kubeconfig") + id = flag.String("id", "", "Unique provisioner identity") + metricsPort = flag.Int("metrics-port", 0, "The port of the metrics server (set to non-zero to enable)") ) const ( @@ -91,6 +92,7 @@ func main() { prName, rbdProvisioner, serverVersion.GitVersion, + controller.MetricsPort(int32(*metricsPort)), ) pc.Run(wait.NeverStop) diff --git a/vendor/github.com/kubernetes-incubator/external-storage/deploy.sh b/vendor/github.com/kubernetes-incubator/external-storage/deploy.sh index 6968749e43..b336bd44df 100755 --- a/vendor/github.com/kubernetes-incubator/external-storage/deploy.sh +++ b/vendor/github.com/kubernetes-incubator/external-storage/deploy.sh @@ -25,6 +25,7 @@ docker login -u "${QUAY_USERNAME}" -p "${QUAY_PASSWORD}" quay.io provisioners=( efs-provisioner cephfs-provisioner +flex-provisioner glusterblock-provisioner glusterfile-provisioner glusterfs-simple-provisioner @@ -37,7 +38,7 @@ openebs-provisioner rbd-provisioner ) -regex="^($(IFS=\|; echo "${provisioners[*]}"))-(v[0-9]\.[0-9]\.[0-9])$" +regex="^($(IFS=\|; echo "${provisioners[*]}"))-(v[0-9]+\.[0-9]+\.[0-9]+-k8s1.10)$" if [[ "${TRAVIS_TAG}" =~ $regex ]]; then PROVISIONER="${BASH_REMATCH[1]}" export VERSION="${BASH_REMATCH[2]}" diff --git a/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/cmd/digitalocean-flexplugin/main.go b/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/cmd/digitalocean-flexplugin/main.go index 7f3f918907..620f3becfa 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/cmd/digitalocean-flexplugin/main.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/cmd/digitalocean-flexplugin/main.go @@ -17,17 +17,18 @@ limitations under the License. package main import ( + "context" "encoding/json" "fmt" - "github.com/digitalocean/godo" - "github.com/digitalocean/godo/context" - "golang.org/x/oauth2" "io/ioutil" "net/http" "os" "path/filepath" "strings" "time" + + "github.com/digitalocean/godo" + "golang.org/x/oauth2" ) // Stolen from: https://github.com/digitalocean/digitalocean-cloud-controller-manager/blob/5a64f9a0729ece886c65c59dcc2a0ecbe7f3b6eb/do/cloud.go#L47 @@ -110,7 +111,7 @@ func (c *cloud) findNode(nodeName string) (int, error) { } func (c *cloud) getVolumeByName(volumeName string) (string, error) { - opt := &godo.ListVolumeParams{ListOptions: &godo.ListOptions{}} + opt := &godo.ListVolumeParams{ListOptions: &godo.ListOptions{PerPage: 200}} // get all volumes by looping over pages for { volumes, resp, err := c.client.Storage.ListVolumes(c.ctx, opt) diff --git a/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/cmd/digitalocean-provisioner/main.go b/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/cmd/digitalocean-provisioner/main.go index 9f6d3fb7db..5b6d9e6ac2 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/cmd/digitalocean-provisioner/main.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/cmd/digitalocean-provisioner/main.go @@ -21,8 +21,9 @@ import ( "os" "strings" + "context" + "github.com/digitalocean/godo" - "github.com/digitalocean/godo/context" "github.com/golang/glog" vol "github.com/kubernetes-incubator/external-storage/digitalocean/pkg/volume" "github.com/kubernetes-incubator/external-storage/lib/controller" diff --git a/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/manifests/sc.yaml b/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/manifests/sc.yaml index ce822222e8..457d40efbf 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/manifests/sc.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/manifests/sc.yaml @@ -2,6 +2,8 @@ apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: default + annotations: + storageclass.kubernetes.io/is-default-class: "true" parameters: zone: provisioner: external/digitalocean diff --git a/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/pkg/volume/provision.go b/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/pkg/volume/provision.go index 42bb7fb281..190bc2962c 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/pkg/volume/provision.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/digitalocean/pkg/volume/provision.go @@ -17,9 +17,10 @@ limitations under the License. package volume import ( + "context" "fmt" + "github.com/digitalocean/godo" - "github.com/digitalocean/godo/context" "github.com/golang/glog" "github.com/kubernetes-incubator/external-storage/lib/controller" "github.com/kubernetes-incubator/external-storage/lib/util" @@ -110,7 +111,7 @@ func (p *digitaloceanProvisioner) Provision(options controller.VolumeOptions) (* }, PersistentVolumeSource: v1.PersistentVolumeSource{ - FlexVolume: &v1.FlexVolumeSource{ + FlexVolume: &v1.FlexPersistentVolumeSource{ Driver: fmt.Sprintf("%s/%s", flexvolumeVendor, flexvolumeDriver), Options: map[string]string{}, ReadOnly: false, diff --git a/vendor/github.com/kubernetes-incubator/external-storage/flex/Makefile b/vendor/github.com/kubernetes-incubator/external-storage/flex/Makefile index 308ddc018e..93f5c84ff2 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/flex/Makefile +++ b/vendor/github.com/kubernetes-incubator/external-storage/flex/Makefile @@ -21,7 +21,7 @@ ifeq ($(VERSION),) endif IMAGE = $(REGISTRY)flex-provisioner:$(VERSION) -MUTABLE_IMAGE = $(REGISTRY)deploy/docker/flex-provisioner:latest +MUTABLE_IMAGE = $(REGISTRY)flex-provisioner:latest all build: CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o flex-provisioner ./cmd/flex-provisioner diff --git a/vendor/github.com/kubernetes-incubator/external-storage/flex/README.md b/vendor/github.com/kubernetes-incubator/external-storage/flex/README.md index 1105ae71ad..b793a50a42 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/flex/README.md +++ b/vendor/github.com/kubernetes-incubator/external-storage/flex/README.md @@ -18,5 +18,19 @@ make **To Deploy** -You can use the example provisioner pod to deploy ```kubectl create -f examples/pod-provisioner.yaml``` +You can use the example provisioner pod to deploy: +``` +mkdir -p /usr/libexec/kubernetes/kubelet-plugins/volume/exec/flex +cp deploy/flex-provision.sh /usr/libexec/kubernetes/kubelet-plugins/volume/exec/flex/flex +chmod ugo+x /usr/libexec/kubernetes/kubelet-plugins/volume/exec/flex/flex + +kubectl create -f deploy/manifests/pod-provisioner.yaml \ + -f deploy/manifests/rbac.yaml \ + -f deploy/manifests/sc.yaml +``` + +You can test it with: +``` +kubectl create -f examples/pvc.yaml -f examples/pod-application.yaml +``` diff --git a/vendor/github.com/kubernetes-incubator/external-storage/flex/cmd/flex-provisioner/main.go b/vendor/github.com/kubernetes-incubator/external-storage/flex/cmd/flex-provisioner/main.go index 930e279fde..61278b18a9 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/flex/cmd/flex-provisioner/main.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/flex/cmd/flex-provisioner/main.go @@ -36,6 +36,7 @@ var ( 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.") execCommand = flag.String("execCommand", "/opt/storage/flex-provision.sh", "The provisioner executable.") + flexDriver = flag.String("flexDriver", "flex", "The FlexVolume driver.") ) func main() { @@ -51,6 +52,10 @@ func main() { glog.Fatalf("Invalid flags specified: must provide provisioner exec command") } + if flexDriver == nil || *flexDriver == "" { + glog.Fatalf("Invalid flags specified: must provide FlexVolume driver") + } + // Create the client according to whether we are running in or out-of-cluster var config *rest.Config var err error @@ -78,7 +83,7 @@ func main() { // Create the provisioner: it implements the Provisioner interface expected by // the controller - flexProvisioner := vol.NewFlexProvisioner(clientset, *execCommand) + flexProvisioner := vol.NewFlexProvisioner(clientset, *execCommand, *flexDriver) // Start the provision controller which will dynamically provision NFS PVs pc := controller.NewProvisionController( diff --git a/vendor/github.com/kubernetes-incubator/external-storage/flex/deploy/docker/Dockerfile b/vendor/github.com/kubernetes-incubator/external-storage/flex/deploy/docker/Dockerfile index 2091079a7d..8055c77b48 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/flex/deploy/docker/Dockerfile +++ b/vendor/github.com/kubernetes-incubator/external-storage/flex/deploy/docker/Dockerfile @@ -12,18 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM centos:7 -MAINTAINER bradley childs, bchilds@gmail.com -RUN yum update -y - -# install the shell flex script that the provisioner uses. -RUN mkdir -p /opt/storage_drivers -COPY flex-provision.sh /opt/storage/flex-provision.sh +FROM launcher.gcr.io/google/debian9 # install the go kube piece of provisioner COPY flex-provisioner /opt/storage_drivers/flex-provisioner - ENTRYPOINT ["/opt/storage_drivers/flex-provisioner"] - -# "github.com/kubernetes-incubator/external-storage/lib/controller" \ No newline at end of file diff --git a/vendor/github.com/kubernetes-incubator/external-storage/flex/deploy/docker/flex-provision.sh b/vendor/github.com/kubernetes-incubator/external-storage/flex/deploy/docker/flex-provision.sh deleted file mode 100755 index 7b5fa7e861..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/flex/deploy/docker/flex-provision.sh +++ /dev/null @@ -1,158 +0,0 @@ -#!/bin/sh - -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Set this to true to log the call output to /tmp/flex-provisioner.log -INTERNAL_DEBUG=true - -INTERNAL_DEBUG=${INTERNAL_DEBUG:-"false"} - -usage() { - echo "Invalid usage of flex provisioner CLI.. :" - debug "Invalid usage of flex provisioner CLI.. :" - exit 1 -} - -err() { - echo -ne $* 1>&2 -} - -log() { - echo -n $* >&1 - debug "log() called:"$* -} - -# Saves debug output to a log file. -debug() { - if [ "${INTERNAL_DEBUG}" == "true" ]; then - echo $* >> /tmp/flex-provisioner.log - fi -} - -# checks if the resource is mounted -ismounted() { - debug "ismounted() called" - echo 0 -} - -# deletes a provisioned volume -delete(){ - debug "delete() called" - log "{\"status\": \"Success\"}" - exit 0 -} - -# provisions a volume -provision(){ - debug "provision() called" - log "{\"status\": \"Success\"}" - exit 0 -} - -# get volume's name -getvolumename() { - debug "getvolumename() called" - log "{\"status\": \"Success\"}" - exit 0 -} - -# attaches a volume to host -attach() { - debug "attach() called" - log "{\"status\": \"Success\"}" - exit 0 -} - -# detaches a volume from host -detach() { - debug "detach() called" - log "{\"status\": \"Success\"}" - exit 0 -} - -# mounts the volume to global path -domountdevice() { - debug "domountdevice() called" - log "{\"status\": \"Success\"}" - exit 0 -} - -# mounts the volume -domount() { - debug "domount() called" - log "{\"status\": \"Success\"}" - exit 0 -} - -# unmounts the global path -unmountdevice() { - debug "unmountdevice() called" - log "{\"status\": \"Success\"}" - exit 0 -} - -# unmounts the volume -unmount() { - debug "unmount() called" - log "{\"status\": \"Success\"}" - exit 0 -} - -# log CLI -# debug $@ - -log "hello" - -op=$1 - -if [ "$op" = "init" ]; then - log "{\"status\": \"Success\"}" - exit 0 -fi - -shift -case "$op" in - getvolumename) - getvolumename $* - ;; - attach) - attach $* - ;; - detach) - detach $* - ;; - provision) - provision $* - ;; - delete) - delete $* - ;; - mountdevice) - domountdevice $* - ;; - mount) - domount $* - ;; - unmountdevice) - unmountdevice $* - ;; - unmount) - unmount $* - ;; - *) - usage -esac - -exit 1 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/flex/examples/pod-provisioner.yaml b/vendor/github.com/kubernetes-incubator/external-storage/flex/examples/pod-provisioner.yaml deleted file mode 100644 index a108c6e141..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/flex/examples/pod-provisioner.yaml +++ /dev/null @@ -1,13 +0,0 @@ -kind: Pod -apiVersion: v1 -metadata: - name: flex-provisioner -spec: - containers: - - name: flex-provisioner - image: childsb/flex-provisioner - securityContext: - args: - - "-provisioner=external/flex-simple" - - "-execCommand=/opt/storage/flex-provision.sh" - imagePullPolicy: "IfNotPresent" diff --git a/vendor/github.com/kubernetes-incubator/external-storage/flex/examples/sc.yaml b/vendor/github.com/kubernetes-incubator/external-storage/flex/examples/sc.yaml deleted file mode 100644 index ad816fa4ba..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/flex/examples/sc.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: default-shared -provisioner: external/flex-simple -parameters: diff --git a/vendor/github.com/kubernetes-incubator/external-storage/flex/pkg/volume/driver-call.go b/vendor/github.com/kubernetes-incubator/external-storage/flex/pkg/volume/driver-call.go index f994bc36c5..ae353a2769 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/flex/pkg/volume/driver-call.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/flex/pkg/volume/driver-call.go @@ -20,8 +20,9 @@ import ( "encoding/json" "errors" "fmt" - "github.com/golang/glog" "time" + + "github.com/golang/glog" ) const ( @@ -180,6 +181,7 @@ func defaultCapabilities() *DriverCapabilities { func handleCmdResponse(cmd string, output []byte) (*DriverStatus, error) { status := DriverStatus{ Capabilities: defaultCapabilities(), + Message: "", } if err := json.Unmarshal(output, &status); err != nil { glog.Errorf("Failed to unmarshal output for command: %s, output: %q, error: %s", cmd, string(output), err.Error()) diff --git a/vendor/github.com/kubernetes-incubator/external-storage/flex/pkg/volume/provision.go b/vendor/github.com/kubernetes-incubator/external-storage/flex/pkg/volume/provision.go index bb4c481b05..750f6f3bdd 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/flex/pkg/volume/provision.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/flex/pkg/volume/provision.go @@ -36,16 +36,17 @@ const ( ) // NewFlexProvisioner creates a new flex provisioner -func NewFlexProvisioner(client kubernetes.Interface, execCommand string) controller.Provisioner { - return newFlexProvisionerInternal(client, execCommand) +func NewFlexProvisioner(client kubernetes.Interface, execCommand string, flexDriver string) controller.Provisioner { + return newFlexProvisionerInternal(client, execCommand, flexDriver) } -func newFlexProvisionerInternal(client kubernetes.Interface, execCommand string) *flexProvisioner { +func newFlexProvisionerInternal(client kubernetes.Interface, execCommand string, flexDriver string) *flexProvisioner { var identity types.UID provisioner := &flexProvisioner{ client: client, execCommand: execCommand, + flexDriver: flexDriver, identity: identity, runner: exec.New(), } @@ -56,6 +57,7 @@ func newFlexProvisionerInternal(client kubernetes.Interface, execCommand string) type flexProvisioner struct { client kubernetes.Interface execCommand string + flexDriver string identity types.UID runner exec.Interface } @@ -75,8 +77,8 @@ func (p *flexProvisioner) Provision(options controller.VolumeOptions) (*v1.Persi annotations[annProvisionerID] = string(p.identity) /* - This PV won't work since there's nothing backing it. the flex script - is in flex/flex/flex (that many layers are required for the flex volume plugin) + The flex script for flexDriver=/ is in + /usr/libexec/kubernetes/kubelet-plugins/volume/exec/~/ */ pv := &v1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ @@ -92,7 +94,7 @@ func (p *flexProvisioner) Provision(options controller.VolumeOptions) (*v1.Persi }, PersistentVolumeSource: v1.PersistentVolumeSource{ FlexVolume: &v1.FlexPersistentVolumeSource{ - Driver: "flex", + Driver: p.flexDriver, Options: map[string]string{}, ReadOnly: false, }, @@ -111,7 +113,11 @@ func (p *flexProvisioner) createVolume(volumeOptions controller.VolumeOptions) e call.AppendSpec(volumeOptions.Parameters, extraOptions) output, err := call.Run() if err != nil { - glog.Errorf("Failed to create volume %s, output: %s, error: %s", volumeOptions, output.Message, err.Error()) + if output == nil || output.Message == "" { + glog.Errorf("Failed to create volume %s, output: %s, error: %s", volumeOptions, "", err.Error()) + } else { + glog.Errorf("Failed to create volume %s, output: %s, error: %s", volumeOptions, output.Message, err.Error()) + } return err } return nil diff --git a/vendor/github.com/kubernetes-incubator/external-storage/gluster/glusterfs/pkg/volume/provision.go b/vendor/github.com/kubernetes-incubator/external-storage/gluster/glusterfs/pkg/volume/provision.go index df6a1ce670..4a4b77091f 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/gluster/glusterfs/pkg/volume/provision.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/gluster/glusterfs/pkg/volume/provision.go @@ -184,6 +184,7 @@ func (p *glusterfsProvisioner) createBricks( cmds = []string{ fmt.Sprintf("mkdir -p %s", path), fmt.Sprintf("chown :%v %s", gid, path), + fmt.Sprintf("chmod 0771 %s", path), } err := p.ExecuteCommands(host, cmds, cfg) if err != nil { diff --git a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/Dockerfile b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/Dockerfile index b880af2c93..625fd82652 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/Dockerfile +++ b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/Dockerfile @@ -14,5 +14,5 @@ FROM centos:7 LABEL authors="Raffaele Spazzoli " -ADD iscsi-controller /iscsi-controller +ADD targetd /iscsi-controller ENTRYPOINT ["/iscsi-controller"] diff --git a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/Makefile b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/Makefile index 051d72e2d0..bd2aead2c5 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/Makefile +++ b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/Makefile @@ -44,7 +44,6 @@ container: build quick-container .PHONY: container quick-container: - mv targetd iscsi-controller docker build -t $(MUTABLE_IMAGE) . docker tag $(MUTABLE_IMAGE) $(IMAGE) .PHONY: quick-container diff --git a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/README.md b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/README.md index 93db96e17d..b1eafac9c1 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/README.md +++ b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/README.md @@ -256,8 +256,8 @@ storage classes should look like the following kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: - name: iscsi -provisioner: iscsi + name: iscsi-targetd-vg-targetd +provisioner: iscsi-targetd parameters: # this id where the iscsi server is running targetPortal: 192.168.99.100:3260 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/cmd/start.go b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/cmd/start.go index bc1e19007d..9b0c6cc649 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/cmd/start.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/cmd/start.go @@ -96,7 +96,7 @@ var startcontrollerCmd = &cobra.Command{ func init() { RootCmd.AddCommand(startcontrollerCmd) - startcontrollerCmd.Flags().String("provisioner-name", "iscsi-provisioner", "name of this provisioner, must match what is passed int the storage class annotation") + startcontrollerCmd.Flags().String("provisioner-name", "iscsi-targetd", "name of this provisioner, must match what is passed in the storage class annotation") viper.BindPFlag("provisioner-name", startcontrollerCmd.Flags().Lookup("provisioner-name")) startcontrollerCmd.Flags().Duration("resync-period", controller.DefaultResyncPeriod, "how often to poll the master API for updates") viper.BindPFlag("resync-period", startcontrollerCmd.Flags().Lookup("resync-period")) diff --git a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/kubernetes/iscsi-provisioner-class.yaml b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/kubernetes/iscsi-provisioner-class.yaml index 791ddae73f..fe16d59bd0 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/kubernetes/iscsi-provisioner-class.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/kubernetes/iscsi-provisioner-class.yaml @@ -32,4 +32,4 @@ parameters: # fsType: xfs # Whether the volume should be mounted in readonly mode, default false -# readonly: false \ No newline at end of file +# readonly: false diff --git a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/openshift/iscsi-provisioner-class.yaml b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/openshift/iscsi-provisioner-class.yaml index aa61c65de1..c14aafe3ca 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/openshift/iscsi-provisioner-class.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/openshift/iscsi-provisioner-class.yaml @@ -32,4 +32,3 @@ parameters: # whether or not to use chap authentication for session operations chapAuthSession: "true" - \ No newline at end of file diff --git a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/provisioner/iscsi-provisioner.go b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/provisioner/iscsi-provisioner.go index c6157c0570..150b4dcf8d 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/provisioner/iscsi-provisioner.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/iscsi/targetd/provisioner/iscsi-provisioner.go @@ -475,3 +475,7 @@ func (p *iscsiProvisioner) getConnection() (*jsonrpc2.Client, error) { log.Debugln("targetd client created") return client, nil } + +func (p *iscsiProvisioner) SupportsBlock() bool { + return true +} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/controller.go b/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/controller.go index 24855622bb..d8a6e17cb9 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/controller.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/controller.go @@ -18,22 +18,31 @@ package controller import ( "fmt" + "net" + "net/http" "os/exec" - "reflect" + "strconv" "strings" "sync" "time" "github.com/golang/glog" + "github.com/kubernetes-incubator/external-storage/lib/controller/metrics" "github.com/kubernetes-incubator/external-storage/lib/leaderelection" rl "github.com/kubernetes-incubator/external-storage/lib/leaderelection/resourcelock" + "github.com/kubernetes-incubator/external-storage/lib/util" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promhttp" + "golang.org/x/time/rate" "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" storagebeta "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/uuid" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" @@ -41,8 +50,8 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" ref "k8s.io/client-go/tools/reference" + "k8s.io/client-go/util/workqueue" "k8s.io/kubernetes/pkg/apis/core/v1/helper" - "k8s.io/kubernetes/pkg/util/goroutinemap" utilversion "k8s.io/kubernetes/pkg/util/version" ) @@ -88,19 +97,21 @@ type ProvisionController struct { // * 1.6: storage classes enter GA kubeVersion *utilversion.Version - claimSource cache.ListerWatcher - claimController cache.Controller + // TODO remove this + claimSource cache.ListerWatcher + claimInformer cache.SharedInformer - volumeSource cache.ListerWatcher - volumeController cache.Controller + claims cache.Store + claimController cache.Controller volumeInformer cache.SharedInformer - classSource cache.ListerWatcher - classController cache.Controller + volumes cache.Store + volumeController cache.Controller classInformer cache.SharedInformer + classes cache.Store + classController cache.Controller - volumes cache.Store - claims cache.Store - classes cache.Store + claimQueue workqueue.RateLimitingInterface + volumeQueue workqueue.RateLimitingInterface // Identity of this controller, generated at creation time and not persisted // across restarts. Useful only for debugging, for seeing the source of @@ -111,16 +122,20 @@ type ProvisionController struct { resyncPeriod time.Duration - // Map of scheduled/running operations. - runningOperations goroutinemap.GoRoutineMap + exponentialBackOffOnError bool + threadiness int createProvisionedPVRetryCount int createProvisionedPVInterval time.Duration failedProvisionThreshold, failedDeleteThreshold int - // Map of failed claims to provisions/volumes to deletes - failedProvisionStats, failedDeleteStats map[types.UID]int - failedProvisionStatsMutex, failedDeleteStatsMutex *sync.Mutex + + // The port for metrics server to serve on. + metricsPort int32 + // The IP address for metrics server to serve on. + metricsAddress string + // The path of metrics endpoint path. + metricsPath string // Parameters of leaderelection.LeaderElectionConfig. Leader election is for // when multiple controllers are running: they race to lock (lead) every PVC @@ -137,7 +152,9 @@ type ProvisionController struct { const ( // DefaultResyncPeriod is used when option function ResyncPeriod is omitted - DefaultResyncPeriod = 15 * time.Second + DefaultResyncPeriod = 15 * time.Minute + // DefaultThreadiness is used when option function Threadiness is omitted + DefaultThreadiness = 4 // DefaultExponentialBackOffOnError is used when option function ExponentialBackOffOnError is omitted DefaultExponentialBackOffOnError = true // DefaultCreateProvisionedPVRetryCount is used when option function CreateProvisionedPVRetryCount is omitted @@ -156,6 +173,12 @@ const ( DefaultRetryPeriod = 2 * time.Second // DefaultTermLimit is used when option function TermLimit is omitted DefaultTermLimit = 30 * time.Second + // DefaultMetricsPort is used when option function MetricsPort is omitted + DefaultMetricsPort = 0 + // DefaultMetricsAddress is used when option function MetricsAddress is omitted + DefaultMetricsAddress = "0.0.0.0" + // DefaultMetricsPath is used when option function MetricsPath is omitted + DefaultMetricsPath = "/metrics" ) var errRuntime = fmt.Errorf("cannot call option functions after controller has Run") @@ -163,7 +186,7 @@ var errRuntime = fmt.Errorf("cannot call option functions after controller has R // ResyncPeriod is how often the controller relists PVCs, PVs, & storage // classes. OnUpdate will be called even if nothing has changed, meaning failed // operations may be retried on a PVC/PV every resyncPeriod regardless of -// whether it changed. Defaults to 15 seconds. +// whether it changed. Defaults to 15 minutes. func ResyncPeriod(resyncPeriod time.Duration) func(*ProvisionController) error { return func(c *ProvisionController) error { if c.HasRun() { @@ -174,6 +197,18 @@ func ResyncPeriod(resyncPeriod time.Duration) func(*ProvisionController) error { } } +// Threadiness is the number of claim and volume workers each to launch. +// Defaults to 4. +func Threadiness(threadiness int) func(*ProvisionController) error { + return func(c *ProvisionController) error { + if c.HasRun() { + return errRuntime + } + c.threadiness = threadiness + return nil + } +} + // ExponentialBackOffOnError determines whether to exponentially back off from // failures of Provision and Delete. Defaults to true. func ExponentialBackOffOnError(exponentialBackOffOnError bool) func(*ProvisionController) error { @@ -181,7 +216,7 @@ func ExponentialBackOffOnError(exponentialBackOffOnError bool) func(*ProvisionCo if c.HasRun() { return errRuntime } - c.runningOperations = goroutinemap.NewGoRoutineMap(exponentialBackOffOnError) + c.exponentialBackOffOnError = exponentialBackOffOnError return nil } } @@ -214,7 +249,10 @@ func CreateProvisionedPVInterval(createProvisionedPVInterval time.Duration) func // failures of Provision. Defaults to 15. func FailedProvisionThreshold(failedProvisionThreshold int) func(*ProvisionController) error { return func(c *ProvisionController) error { - c.SetFailedProvisionThreshold(failedProvisionThreshold) + if c.HasRun() { + return errRuntime + } + c.failedProvisionThreshold = failedProvisionThreshold return nil } } @@ -223,7 +261,10 @@ func FailedProvisionThreshold(failedProvisionThreshold int) func(*ProvisionContr // of Delete. Defaults to 15. func FailedDeleteThreshold(failedDeleteThreshold int) func(*ProvisionController) error { return func(c *ProvisionController) error { - c.SetFailedDeleteThreshold(failedDeleteThreshold) + if c.HasRun() { + return errRuntime + } + c.failedDeleteThreshold = failedDeleteThreshold return nil } } @@ -316,6 +357,46 @@ func ClassesInformer(informer cache.SharedInformer) func(*ProvisionController) e } } +// MetricsPort sets the port that metrics server serves on. Default: 0, set to non-zero to enable. +func MetricsPort(metricsPort int32) func(*ProvisionController) error { + return func(c *ProvisionController) error { + if c.HasRun() { + return errRuntime + } + c.metricsPort = metricsPort + return nil + } +} + +// MetricsAddress sets the ip address that metrics serve serves on. +func MetricsAddress(metricsAddress string) func(*ProvisionController) error { + return func(c *ProvisionController) error { + if c.HasRun() { + return errRuntime + } + c.metricsAddress = metricsAddress + return nil + } +} + +// MetricsPath sets the endpoint path of metrics server. +func MetricsPath(metricsPath string) func(*ProvisionController) error { + return func(c *ProvisionController) error { + if c.HasRun() { + return errRuntime + } + c.metricsPath = metricsPath + return nil + } +} + +// HasRun returns whether the controller has Run +func (ctrl *ProvisionController) HasRun() bool { + ctrl.hasRunLock.Lock() + defer ctrl.hasRunLock.Unlock() + return ctrl.hasRun +} + // NewProvisionController creates a new provision controller using // the given configuration parameters and with private (non-shared) informers. func NewProvisionController( @@ -326,7 +407,10 @@ func NewProvisionController( options ...func(*ProvisionController) error, ) *ProvisionController { identity := uuid.NewUUID() + + v1.AddToScheme(scheme.Scheme) broadcaster := record.NewBroadcaster() + broadcaster.StartLogging(glog.Infof) broadcaster.StartRecordingToSink(&corev1.EventSinkImpl{Interface: client.CoreV1().Events(v1.NamespaceAll)}) var eventRecorder record.EventRecorder out, err := exec.Command("hostname").Output() @@ -336,9 +420,6 @@ func NewProvisionController( eventRecorder = broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: fmt.Sprintf("%s %s %s", provisionerName, strings.TrimSpace(string(out)), string(identity))}) } - // TODO: GetReference fails otherwise - v1.AddToScheme(scheme.Scheme) - controller := &ProvisionController{ client: client, provisionerName: provisionerName, @@ -347,19 +428,18 @@ func NewProvisionController( identity: identity, eventRecorder: eventRecorder, resyncPeriod: DefaultResyncPeriod, - runningOperations: goroutinemap.NewGoRoutineMap(DefaultExponentialBackOffOnError), + threadiness: DefaultThreadiness, createProvisionedPVRetryCount: DefaultCreateProvisionedPVRetryCount, createProvisionedPVInterval: DefaultCreateProvisionedPVInterval, failedProvisionThreshold: DefaultFailedProvisionThreshold, failedDeleteThreshold: DefaultFailedDeleteThreshold, - failedProvisionStats: make(map[types.UID]int), - failedDeleteStats: make(map[types.UID]int), - failedProvisionStatsMutex: &sync.Mutex{}, - failedDeleteStatsMutex: &sync.Mutex{}, leaseDuration: DefaultLeaseDuration, renewDeadline: DefaultRenewDeadline, retryPeriod: DefaultRetryPeriod, termLimit: DefaultTermLimit, + metricsPort: DefaultMetricsPort, + metricsAddress: DefaultMetricsAddress, + metricsPath: DefaultMetricsPath, leaderElectors: make(map[types.UID]*leaderelection.LeaderElector), leaderElectorsMutex: &sync.Mutex{}, hasRun: false, @@ -370,10 +450,22 @@ func NewProvisionController( option(controller) } + ratelimiter := workqueue.NewMaxOfRateLimiter( + workqueue.NewItemExponentialFailureRateLimiter(15*time.Second, 1000*time.Second), + &workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(10), 100)}, + ) + if !controller.exponentialBackOffOnError { + ratelimiter = workqueue.NewMaxOfRateLimiter( + &workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(10), 100)}, + ) + } + controller.claimQueue = workqueue.NewNamedRateLimitingQueue(ratelimiter, "claims") + controller.volumeQueue = workqueue.NewNamedRateLimitingQueue(ratelimiter, "volumes") + // ---------------------- // PersistentVolumeClaims - controller.claimSource = &cache.ListWatch{ + claimSource := &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return client.CoreV1().PersistentVolumeClaims(v1.NamespaceAll).List(options) }, @@ -381,11 +473,12 @@ func NewProvisionController( return client.CoreV1().PersistentVolumeClaims(v1.NamespaceAll).Watch(options) }, } + controller.claimSource = claimSource claimHandler := cache.ResourceEventHandlerFuncs{ - AddFunc: controller.addClaim, - UpdateFunc: controller.updateClaim, - DeleteFunc: nil, + AddFunc: func(obj interface{}) { controller.enqueueWork(controller.claimQueue, obj) }, + UpdateFunc: func(oldObj, newObj interface{}) { controller.enqueueWork(controller.claimQueue, newObj) }, + DeleteFunc: func(obj interface{}) { controller.forgetWork(controller.claimQueue, obj) }, } if controller.claimInformer != nil { @@ -396,7 +489,7 @@ func NewProvisionController( } else { controller.claims, controller.claimController = cache.NewInformer( - controller.claimSource, + claimSource, &v1.PersistentVolumeClaim{}, controller.resyncPeriod, claimHandler, @@ -406,7 +499,7 @@ func NewProvisionController( // ----------------- // PersistentVolumes - controller.volumeSource = &cache.ListWatch{ + volumeSource := &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return client.CoreV1().PersistentVolumes().List(options) }, @@ -416,9 +509,9 @@ func NewProvisionController( } volumeHandler := cache.ResourceEventHandlerFuncs{ - AddFunc: nil, - UpdateFunc: controller.updateVolume, - DeleteFunc: nil, + AddFunc: func(obj interface{}) { controller.enqueueWork(controller.volumeQueue, obj) }, + UpdateFunc: func(oldObj, newObj interface{}) { controller.enqueueWork(controller.volumeQueue, newObj) }, + DeleteFunc: func(obj interface{}) { controller.forgetWork(controller.volumeQueue, obj) }, } if controller.volumeInformer != nil { @@ -429,7 +522,7 @@ func NewProvisionController( } else { controller.volumes, controller.volumeController = cache.NewInformer( - controller.volumeSource, + volumeSource, &v1.PersistentVolume{}, controller.resyncPeriod, volumeHandler, @@ -440,9 +533,10 @@ func NewProvisionController( // StorageClasses var versionedClassType runtime.Object + var classSource cache.ListerWatcher if controller.kubeVersion.AtLeast(utilversion.MustParseSemantic("v1.6.0")) { versionedClassType = &storage.StorageClass{} - controller.classSource = &cache.ListWatch{ + classSource = &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return client.StorageV1().StorageClasses().List(options) }, @@ -452,7 +546,7 @@ func NewProvisionController( } } else { versionedClassType = &storagebeta.StorageClass{} - controller.classSource = &cache.ListWatch{ + classSource = &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { return client.StorageV1beta1().StorageClasses().List(options) }, @@ -477,7 +571,7 @@ func NewProvisionController( controller.classInformer.GetController() } else { controller.classes, controller.classController = cache.NewInformer( - controller.classSource, + classSource, versionedClassType, controller.resyncPeriod, classHandler, @@ -487,134 +581,237 @@ func NewProvisionController( return controller } +// enqueueWork takes an obj and converts it into a namespace/name string which +// is then put onto the given work queue. +func (ctrl *ProvisionController) enqueueWork(queue workqueue.RateLimitingInterface, obj interface{}) { + var key string + var err error + if key, err = cache.DeletionHandlingMetaNamespaceKeyFunc(obj); err != nil { + utilruntime.HandleError(err) + return + } + // Re-Adding is harmless but try to add it to the queue only if it is not + // already there, because if it is already there we *must* be retrying it + if queue.NumRequeues(key) == 0 { + queue.Add(key) + } +} + +// forgetWork Forgets an obj from the given work queue, telling the queue to +// stop tracking its retries because e.g. the obj was deleted +func (ctrl *ProvisionController) forgetWork(queue workqueue.RateLimitingInterface, obj interface{}) { + var key string + var err error + if key, err = cache.DeletionHandlingMetaNamespaceKeyFunc(obj); err != nil { + utilruntime.HandleError(err) + return + } + queue.Forget(key) + queue.Done(key) +} + // Run starts all of this controller's control loops func (ctrl *ProvisionController) Run(stopCh <-chan struct{}) { glog.Infof("Starting provisioner controller %s!", string(ctrl.identity)) + defer utilruntime.HandleCrash() + defer ctrl.claimQueue.ShutDown() + defer ctrl.volumeQueue.ShutDown() + ctrl.hasRunLock.Lock() ctrl.hasRun = true ctrl.hasRunLock.Unlock() + if ctrl.metricsPort > 0 { + prometheus.MustRegister([]prometheus.Collector{ + metrics.PersistentVolumeClaimProvisionTotal, + metrics.PersistentVolumeClaimProvisionFailedTotal, + metrics.PersistentVolumeClaimProvisionDurationSeconds, + metrics.PersistentVolumeDeleteTotal, + metrics.PersistentVolumeDeleteFailedTotal, + metrics.PersistentVolumeDeleteDurationSeconds, + }...) + http.Handle(ctrl.metricsPath, promhttp.Handler()) + address := net.JoinHostPort(ctrl.metricsAddress, strconv.FormatInt(int64(ctrl.metricsPort), 10)) + glog.Infof("Starting metrics server at %s\n", address) + go wait.Forever(func() { + err := http.ListenAndServe(address, nil) + if err != nil { + glog.Errorf("Failed to listen on %s: %v", address, err) + } + }, 5*time.Second) + } + go ctrl.claimController.Run(stopCh) go ctrl.volumeController.Run(stopCh) go ctrl.classController.Run(stopCh) + + for i := 0; i < ctrl.threadiness; i++ { + go wait.Until(ctrl.runClaimWorker, time.Second, stopCh) + go wait.Until(ctrl.runVolumeWorker, time.Second, stopCh) + } + + glog.Infof("Started provisioner controller %s!", string(ctrl.identity)) + <-stopCh } -// HasRun returns whether the controller has Run -func (ctrl *ProvisionController) HasRun() bool { - ctrl.hasRunLock.Lock() - defer ctrl.hasRunLock.Unlock() - return ctrl.hasRun +func (ctrl *ProvisionController) runClaimWorker() { + for ctrl.processNextClaimWorkItem() { + } } -// SetFailedProvisionThreshold sets the value of failedProvisionThreshold -func (ctrl *ProvisionController) SetFailedProvisionThreshold(threshold int) { - ctrl.failedProvisionStatsMutex.Lock() - ctrl.failedProvisionThreshold = threshold - ctrl.failedProvisionStatsMutex.Unlock() +func (ctrl *ProvisionController) runVolumeWorker() { + for ctrl.processNextVolumeWorkItem() { + } } -// SetFailedDeleteThreshold sets the value of failedDeleteThreshold -func (ctrl *ProvisionController) SetFailedDeleteThreshold(threshold int) { - ctrl.failedDeleteStatsMutex.Lock() - ctrl.failedDeleteThreshold = threshold - ctrl.failedDeleteStatsMutex.Unlock() -} +// processNextClaimWorkItem processes items from claimQueue +func (ctrl *ProvisionController) processNextClaimWorkItem() bool { + obj, shutdown := ctrl.claimQueue.Get() -// On add claim, check if the added claim should have a volume provisioned for -// it and provision one if so. -func (ctrl *ProvisionController) addClaim(obj interface{}) { - claim, ok := obj.(*v1.PersistentVolumeClaim) - if !ok { - glog.Errorf("Expected PersistentVolumeClaim but addClaim received %+v", obj) - return + if shutdown { + return false } - if ctrl.shouldProvision(claim) { - ctrl.leaderElectorsMutex.Lock() - le, ok := ctrl.leaderElectors[claim.UID] - ctrl.leaderElectorsMutex.Unlock() - if ok && le.IsLeader() { - opName := fmt.Sprintf("provision-%s[%s]", claimToClaimKey(claim), string(claim.UID)) - ctrl.scheduleOperation(opName, func() error { - err := ctrl.provisionClaimOperation(claim) - ctrl.updateProvisionStats(claim, err) - return err - }) - } else { - opName := fmt.Sprintf("lock-provision-%s[%s]", claimToClaimKey(claim), string(claim.UID)) - ctrl.scheduleOperation(opName, func() error { - ctrl.lockProvisionClaimOperation(claim) - return nil - }) + err := func(obj interface{}) error { + defer ctrl.claimQueue.Done(obj) + var key string + var ok bool + if key, ok = obj.(string); !ok { + ctrl.claimQueue.Forget(obj) + return fmt.Errorf("expected string in workqueue but got %#v", obj) + } + + if err := ctrl.syncClaimHandler(key); err != nil { + if ctrl.claimQueue.NumRequeues(obj) < ctrl.failedProvisionThreshold { + glog.Warningf("retrying syncing claim %q because failures %v < threshold %v", key, ctrl.claimQueue.NumRequeues(obj), ctrl.failedProvisionThreshold) + ctrl.claimQueue.AddRateLimited(obj) + } else { + glog.Errorf("giving up syncing claim %q because failures %v >= threshold %v", key, ctrl.claimQueue.NumRequeues(obj), ctrl.failedProvisionThreshold) + // Done but do not Forget: it will not be in the queue but NumRequeues + // will be saved until the obj is deleted from kubernetes + } + return fmt.Errorf("error syncing claim %q: %s", key, err.Error()) } + + ctrl.claimQueue.Forget(obj) + return nil + }(obj) + + if err != nil { + utilruntime.HandleError(err) + return true } + + return true } -// On update claim, pass the new claim to addClaim. Updates occur at least every -// resyncPeriod. -func (ctrl *ProvisionController) updateClaim(oldObj, newObj interface{}) { - // If they are exactly the same it must be a forced resync (every - // resyncPeriod). - if reflect.DeepEqual(oldObj, newObj) { - ctrl.addClaim(newObj) - return - } +// processNextVolumeWorkItem processes items from volumeQueue +func (ctrl *ProvisionController) processNextVolumeWorkItem() bool { + obj, shutdown := ctrl.volumeQueue.Get() - // If not a forced resync, we filter out the frequent leader election record - // annotation changes by checking if the only update is in the annotation - oldClaim, ok := oldObj.(*v1.PersistentVolumeClaim) - if !ok { - glog.Errorf("Expected PersistentVolumeClaim but handler received %#v", oldObj) - return + if shutdown { + return false } - newClaim, ok := newObj.(*v1.PersistentVolumeClaim) - if !ok { - glog.Errorf("Expected PersistentVolumeClaim but handler received %#v", newObj) - return + + err := func(obj interface{}) error { + defer ctrl.volumeQueue.Done(obj) + var key string + var ok bool + if key, ok = obj.(string); !ok { + ctrl.volumeQueue.Forget(obj) + return fmt.Errorf("expected string in workqueue but got %#v", obj) + } + + if err := ctrl.syncVolumeHandler(key); err != nil { + if ctrl.volumeQueue.NumRequeues(obj) < ctrl.failedDeleteThreshold { + glog.Warningf("retrying syncing volume %q because failures %v < threshold %v", key, ctrl.volumeQueue.NumRequeues(obj), ctrl.failedProvisionThreshold) + ctrl.volumeQueue.AddRateLimited(obj) + } else { + glog.Errorf("giving up syncing volume %q because failures %v >= threshold %v", key, ctrl.volumeQueue.NumRequeues(obj), ctrl.failedProvisionThreshold) + // Done but do not Forget: it will not be in the queue but NumRequeues + // will be saved until the obj is deleted from kubernetes + } + return fmt.Errorf("error syncing volume %q: %s", key, err.Error()) + } + + ctrl.volumeQueue.Forget(obj) + return nil + }(obj) + + if err != nil { + utilruntime.HandleError(err) + return true } - skipAddClaim, err := ctrl.isOnlyRecordUpdate(oldClaim, newClaim) + return true +} + +// syncClaimHandler gets the claim from informer's cache then calls syncClaim +func (ctrl *ProvisionController) syncClaimHandler(key string) error { + claimObj, exists, err := ctrl.claims.GetByKey(key) if err != nil { - glog.Errorf("Error checking if only record was updated in claim: %v", oldClaim) - return + return err } + if !exists { + utilruntime.HandleError(fmt.Errorf("claim %q in work queue no longer exists", key)) + return nil + } + + return ctrl.syncClaim(claimObj) +} - if !skipAddClaim { - ctrl.addClaim(newObj) +// syncVolumeHandler gets the volume from informer's cache then calls syncVolume +func (ctrl *ProvisionController) syncVolumeHandler(key string) error { + volumeObj, exists, err := ctrl.volumes.GetByKey(key) + if err != nil { + return err + } + if !exists { + utilruntime.HandleError(fmt.Errorf("volume %q in work queue no longer exists", key)) + return nil } + + return ctrl.syncVolume(volumeObj) } -// On update volume, check if the updated volume should be deleted and delete if -// so. Updates occur at least every resyncPeriod. -func (ctrl *ProvisionController) updateVolume(oldObj, newObj interface{}) { - volume, ok := newObj.(*v1.PersistentVolume) +// syncClaim checks if the claim should have a volume provisioned for it and +// provisions one if so. +func (ctrl *ProvisionController) syncClaim(obj interface{}) error { + claim, ok := obj.(*v1.PersistentVolumeClaim) if !ok { - glog.Errorf("Expected PersistentVolume but handler received %#v", newObj) - return + return fmt.Errorf("expected claim but got %+v", obj) } - if ctrl.shouldDelete(volume) { - opName := fmt.Sprintf("delete-%s[%s]", volume.Name, string(volume.UID)) - ctrl.scheduleOperation(opName, func() error { - err := ctrl.deleteVolumeOperation(volume) - ctrl.updateDeleteStats(volume, err) + if ctrl.shouldProvision(claim) { + ctrl.leaderElectorsMutex.Lock() + le, ok := ctrl.leaderElectors[claim.UID] + ctrl.leaderElectorsMutex.Unlock() + if ok && le.IsLeader() { + startTime := time.Now() + err := ctrl.provisionClaimOperation(claim) + ctrl.updateProvisionStats(claim, err, startTime) return err - }) + } + err := ctrl.lockProvisionClaimOperation(claim) + return err } + return nil } -// isOnlyRecordUpdate checks if the only update between the old & new claim is -// the leader election record annotation. -func (ctrl *ProvisionController) isOnlyRecordUpdate(oldClaim, newClaim *v1.PersistentVolumeClaim) (bool, error) { - old, err := ctrl.removeRecord(oldClaim) - if err != nil { - return false, err +// syncVolume checks if the volume should be deleted and deletes if so +func (ctrl *ProvisionController) syncVolume(obj interface{}) error { + volume, ok := obj.(*v1.PersistentVolume) + if !ok { + return fmt.Errorf("expected volume but got %+v", obj) } - new, err := ctrl.removeRecord(newClaim) - if err != nil { - return false, err + + if ctrl.shouldDelete(volume) { + startTime := time.Now() + err := ctrl.deleteVolumeOperation(volume) + ctrl.updateDeleteStats(volume, err, startTime) + return err } - return reflect.DeepEqual(old, new), nil + return nil } // removeRecord returns a claim with its leader election record annotation and @@ -631,17 +828,9 @@ func (ctrl *ProvisionController) removeRecord(claim *v1.PersistentVolumeClaim) ( return claimClone, nil } +// shouldProvision returns whether a claim should have a volume provisioned for +// it, i.e. whether a Provision is "desired" func (ctrl *ProvisionController) shouldProvision(claim *v1.PersistentVolumeClaim) bool { - ctrl.failedProvisionStatsMutex.Lock() - if failureCount, exists := ctrl.failedProvisionStats[claim.UID]; exists == true { - if failureCount >= ctrl.failedProvisionThreshold && ctrl.failedProvisionThreshold > 0 { - glog.Errorf("Exceeded failedProvisionThreshold threshold: %d, for claim %q, provisioner will not attempt retries for this claim", ctrl.failedProvisionThreshold, claimToClaimKey(claim)) - ctrl.failedProvisionStatsMutex.Unlock() - return false - } - } - ctrl.failedProvisionStatsMutex.Unlock() - if claim.Spec.VolumeName != "" { return false } @@ -678,17 +867,9 @@ func (ctrl *ProvisionController) shouldProvision(claim *v1.PersistentVolumeClaim return false } +// shouldDelete returns whether a volume should have its backing volume +// deleted, i.e. whether a Delete is "desired" func (ctrl *ProvisionController) shouldDelete(volume *v1.PersistentVolume) bool { - ctrl.failedDeleteStatsMutex.Lock() - if failureCount, exists := ctrl.failedDeleteStats[volume.UID]; exists == true { - if failureCount >= ctrl.failedDeleteThreshold && ctrl.failedDeleteThreshold > 0 { - glog.Errorf("Exceeded failedDeleteThreshold threshold: %d, for volume %q, provisioner will not attempt retries for this volume", ctrl.failedDeleteThreshold, volume.Name) - ctrl.failedDeleteStatsMutex.Unlock() - return false - } - } - ctrl.failedDeleteStatsMutex.Unlock() - // In 1.5+ we delete only if the volume is in state Released. In 1.4 we must // delete if the volume is in state Failed too. if ctrl.kubeVersion.AtLeast(utilversion.MustParseSemantic("v1.5.0")) { @@ -716,13 +897,23 @@ func (ctrl *ProvisionController) shouldDelete(volume *v1.PersistentVolume) bool return true } +// canProvision returns error if provisioner can't provision claim. +func (ctrl *ProvisionController) canProvision(claim *v1.PersistentVolumeClaim) error { + // Check if this provisioner supports Block volume + if util.CheckPersistentVolumeClaimModeBlock(claim) && !ctrl.supportsBlock() { + return fmt.Errorf("%s does not support block volume provisioning", ctrl.provisionerName) + } + + return nil +} + // lockProvisionClaimOperation wraps provisionClaimOperation. In case other // controllers are serving the same claims, to prevent them all from creating // volumes for a claim & racing to submit their PV, each controller creates a // LeaderElector to instead race for the leadership (lock), where only the -// leader is tasked with provisioning & may try to do so -func (ctrl *ProvisionController) lockProvisionClaimOperation(claim *v1.PersistentVolumeClaim) { - stoppedLeading := false +// leader is tasked with provisioning & may try to do so. Returns error, which +// indicates whether provisioning should be retried (requeue the claim) or not +func (ctrl *ProvisionController) lockProvisionClaimOperation(claim *v1.PersistentVolumeClaim) error { rl := rl.ProvisionPVCLock{ PVCMeta: claim.ObjectMeta, Client: ctrl.client, @@ -731,6 +922,7 @@ func (ctrl *ProvisionController) lockProvisionClaimOperation(claim *v1.Persisten EventRecorder: ctrl.eventRecorder, }, } + var provisionErr error le, err := leaderelection.NewLeaderElector(leaderelection.Config{ Lock: &rl, LeaseDuration: ctrl.leaseDuration, @@ -739,21 +931,17 @@ func (ctrl *ProvisionController) lockProvisionClaimOperation(claim *v1.Persisten TermLimit: ctrl.termLimit, Callbacks: leaderelection.LeaderCallbacks{ OnStartedLeading: func(_ <-chan struct{}) { - opName := fmt.Sprintf("provision-%s[%s]", claimToClaimKey(claim), string(claim.UID)) - ctrl.scheduleOperation(opName, func() error { - err := ctrl.provisionClaimOperation(claim) - ctrl.updateProvisionStats(claim, err) - return err - }) + startTime := time.Now() + provisionErr = ctrl.provisionClaimOperation(claim) + ctrl.updateProvisionStats(claim, provisionErr, startTime) }, OnStoppedLeading: func() { - stoppedLeading = true }, }, }) if err != nil { glog.Errorf("Error creating LeaderElector, can't provision for claim %q: %v", claimToClaimKey(claim), err) - return + return err } ctrl.leaderElectorsMutex.Lock() @@ -767,69 +955,46 @@ func (ctrl *ProvisionController) lockProvisionClaimOperation(claim *v1.Persisten successCh, err := ctrl.watchProvisioning(claim, stopCh) if err != nil { glog.Errorf("Error watching for provisioning success, can't provision for claim %q: %v", claimToClaimKey(claim), err) + return err } le.Run(successCh) close(stopCh) - // If we were the leader and stopped, give others a chance to acquire - // (whether they exist & want to or not). Else, there must have been a - // success so just proceed. - if stoppedLeading { - time.Sleep(ctrl.leaseDuration + ctrl.retryPeriod) - } - ctrl.leaderElectorsMutex.Lock() delete(ctrl.leaderElectors, claim.UID) ctrl.leaderElectorsMutex.Unlock() -} -func (ctrl *ProvisionController) updateProvisionStats(claim *v1.PersistentVolumeClaim, err error) { - ctrl.failedProvisionStatsMutex.Lock() - defer ctrl.failedProvisionStatsMutex.Unlock() + return provisionErr +} - // Do not record the failed claim info when failedProvisionThreshold is not set - if ctrl.failedProvisionThreshold <= 0 { - return +func (ctrl *ProvisionController) updateProvisionStats(claim *v1.PersistentVolumeClaim, err error, startTime time.Time) { + class := "" + if claim.Spec.StorageClassName != nil { + class = *claim.Spec.StorageClassName } - if err != nil { - if failureCount, exists := ctrl.failedProvisionStats[claim.UID]; exists == true { - failureCount = failureCount + 1 - ctrl.failedProvisionStats[claim.UID] = failureCount - } else { - ctrl.failedProvisionStats[claim.UID] = 1 - } + metrics.PersistentVolumeClaimProvisionFailedTotal.WithLabelValues(class).Inc() } else { - delete(ctrl.failedProvisionStats, claim.UID) + metrics.PersistentVolumeClaimProvisionDurationSeconds.WithLabelValues(class).Observe(time.Since(startTime).Seconds()) + metrics.PersistentVolumeClaimProvisionTotal.WithLabelValues(class).Inc() } } -func (ctrl *ProvisionController) updateDeleteStats(volume *v1.PersistentVolume, err error) { - ctrl.failedDeleteStatsMutex.Lock() - defer ctrl.failedDeleteStatsMutex.Unlock() - - // Do not record the failed volume info when failedDeleteThreshold is not set - if ctrl.failedDeleteThreshold <= 0 { - return - } - +func (ctrl *ProvisionController) updateDeleteStats(volume *v1.PersistentVolume, err error, startTime time.Time) { + class := volume.Spec.StorageClassName if err != nil { - if failureCount, exists := ctrl.failedDeleteStats[volume.UID]; exists == true { - failureCount = failureCount + 1 - ctrl.failedDeleteStats[volume.UID] = failureCount - } else { - ctrl.failedDeleteStats[volume.UID] = 1 - } + metrics.PersistentVolumeDeleteFailedTotal.WithLabelValues(class).Inc() } else { - delete(ctrl.failedDeleteStats, volume.UID) + metrics.PersistentVolumeDeleteDurationSeconds.WithLabelValues(class).Observe(time.Since(startTime).Seconds()) + metrics.PersistentVolumeDeleteTotal.WithLabelValues(class).Inc() } } // provisionClaimOperation attempts to provision a volume for the given claim. -// Returns an error for use by goroutinemap when expbackoff is enabled: if nil, -// the operation is deleted, else the operation may be retried with expbackoff. +// Returns error, which indicates whether provisioning should be retried +// (requeue the claim) or not func (ctrl *ProvisionController) provisionClaimOperation(claim *v1.PersistentVolumeClaim) error { // Most code here is identical to that found in controller.go of kube's PV controller... claimClass := helper.GetPersistentVolumeClaimClass(claim) @@ -867,6 +1032,14 @@ func (ctrl *ProvisionController) provisionClaimOperation(claim *v1.PersistentVol return nil } + // Check if this provisioner can provision this claim. + if err := ctrl.canProvision(claim); err != nil { + ctrl.eventRecorder.Event(claim, v1.EventTypeWarning, "ProvisioningFailed", err.Error()) + glog.Errorf("Failed to provision volume for claim %q with StorageClass %q: %v", + claimToClaimKey(claim), claimClass, err) + return nil + } + reclaimPolicy := v1.PersistentVolumeReclaimDelete if ctrl.kubeVersion.AtLeast(utilversion.MustParseSemantic("v1.8.0")) { reclaimPolicy, err = ctrl.fetchReclaimPolicy(claimClass) @@ -875,11 +1048,17 @@ func (ctrl *ProvisionController) provisionClaimOperation(claim *v1.PersistentVol } } + mountOptions, err := ctrl.fetchMountOptions(claimClass) + if err != nil { + return err + } + options := VolumeOptions{ PersistentVolumeReclaimPolicy: reclaimPolicy, - PVName: pvName, - PVC: claim, - Parameters: parameters, + PVName: pvName, + PVC: claim, + MountOptions: mountOptions, + Parameters: parameters, } ctrl.eventRecorder.Event(claim, v1.EventTypeNormal, "Provisioning", fmt.Sprintf("External provisioner is provisioning volume for claim %q", claimToClaimKey(claim))) @@ -1111,6 +1290,9 @@ func (ctrl *ProvisionController) getPVCEventWatch(claim *v1.PersistentVolumeClai }) } +// deleteVolumeOperation attempts to delete the volume backing the given +// volume. Returns error, which indicates whether deletion should be retried +// (requeue the volume) or not func (ctrl *ProvisionController) deleteVolumeOperation(volume *v1.PersistentVolume) error { glog.V(4).Infof("deleteVolumeOperation [%s] started", volume.Name) @@ -1148,7 +1330,7 @@ func (ctrl *ProvisionController) deleteVolumeOperation(volume *v1.PersistentVolu // Oops, could not delete the volume and therefore the controller will // try to delete the volume again on next update. glog.Infof("failed to delete volume %q from database: %v", volume.Name, err) - return nil + return err } glog.Infof("volume %q deleted from database", volume.Name) @@ -1161,21 +1343,6 @@ func (ctrl *ProvisionController) getProvisionedVolumeNameForClaim(claim *v1.Pers return "pvc-" + string(claim.UID) } -// scheduleOperation starts given asynchronous operation on given volume. It -// makes sure the operation is already not running. -func (ctrl *ProvisionController) scheduleOperation(operationName string, operation func() error) { - glog.Infof("scheduleOperation[%s]", operationName) - - err := ctrl.runningOperations.Run(operationName, operation) - if err != nil { - if goroutinemap.IsAlreadyExists(err) { - glog.V(4).Infof("operation %q is already running, skipping", operationName) - } else { - glog.Errorf("Error scheduling operaion %q: %v", operationName, err) - } - } -} - func (ctrl *ProvisionController) getStorageClassFields(name string) (string, map[string]string, error) { classObj, found, err := ctrl.classes.GetByKey(name) if err != nil { @@ -1219,3 +1386,32 @@ func (ctrl *ProvisionController) fetchReclaimPolicy(storageClassName string) (v1 return v1.PersistentVolumeReclaimDelete, fmt.Errorf("Cannot convert object to StorageClass: %+v", classObj) } + +func (ctrl *ProvisionController) fetchMountOptions(storageClassName string) ([]string, error) { + classObj, found, err := ctrl.classes.GetByKey(storageClassName) + if err != nil { + return nil, err + } + if !found { + return nil, fmt.Errorf("StorageClass %q not found", storageClassName) + } + + switch class := classObj.(type) { + case *storage.StorageClass: + return class.MountOptions, nil + case *storagebeta.StorageClass: + return class.MountOptions, nil + } + + return nil, fmt.Errorf("Cannot convert object to StorageClass: %+v", classObj) +} + +// supportsBlock returns whether a provisioner supports block volume. +// Provisioners that implement BlockProvisioner interface and return true to SupportsBlock +// will be regarded as supported for block volume. +func (ctrl *ProvisionController) supportsBlock() bool { + if blockProvisioner, ok := ctrl.provisioner.(BlockProvisioner); ok { + return blockProvisioner.SupportsBlock() + } + return false +} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/controller_test.go b/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/controller_test.go index bc90d5307f..0036a2e266 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/controller_test.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/controller_test.go @@ -25,7 +25,6 @@ import ( "testing" "time" - rl "github.com/kubernetes-incubator/external-storage/lib/leaderelection/resourcelock" "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" storagebeta "k8s.io/api/storage/v1beta1" @@ -33,6 +32,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" @@ -223,8 +223,11 @@ func TestController(t *testing.T) { stopCh := make(chan struct{}) go ctrl.Run(stopCh) + // When we shutdown while something is happening the fake client panics + // with send on closed channel...but the test passed, so ignore + utilruntime.ReallyCrash = false + time.Sleep(2 * resyncPeriod) - ctrl.runningOperations.Wait() pvList, _ := client.CoreV1().PersistentVolumes().List(metav1.ListOptions{}) if !reflect.DeepEqual(test.expectedVolumes, pvList.Items) { @@ -290,7 +293,7 @@ func TestMultipleControllers(t *testing.T) { } for i := 0; i < test.numControllers; i++ { - go ctrls[i].addClaim(newClaim("claim-1", "uid-1-1", "class-1", test.provisionerName, "", nil)) + go ctrls[i].syncClaim(newClaim("claim-1", "uid-1-1", "class-1", test.provisionerName, "", nil)) } // Sleep for 3 election retry periods @@ -492,47 +495,89 @@ func TestShouldDelete(t *testing.T) { } } -func TestIsOnlyRecordUpdate(t *testing.T) { +func TestCanProvision(t *testing.T) { + const ( + provisionerName = "foo.bar/baz" + blockErrFormat = "%s does not support block volume provisioning" + ) + tests := []struct { - name string - old *v1.PersistentVolumeClaim - new *v1.PersistentVolumeClaim - expectedIs bool + name string + provisioner Provisioner + claim *v1.PersistentVolumeClaim + serverGitVersion string + expectedCan error }{ + // volumeMode tests for provisioner w/o BlockProvisoner I/F + { + name: "Undefined volumeMode PV request to provisioner w/o BlockProvisoner I/F", + provisioner: newTestProvisioner(), + claim: newClaim("claim-1", "1-1", "class-1", provisionerName, "", nil), + expectedCan: nil, + }, + { + name: "FileSystem volumeMode PV request to provisioner w/o BlockProvisoner I/F", + provisioner: newTestProvisioner(), + claim: newClaimWithVolumeMode("claim-1", "1-1", "class-1", provisionerName, "", nil, v1.PersistentVolumeFilesystem), + expectedCan: nil, + }, { - 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: "Block volumeMode PV request to provisioner w/o BlockProvisoner I/F", + provisioner: newTestProvisioner(), + claim: newClaimWithVolumeMode("claim-1", "1-1", "class-1", provisionerName, "", nil, v1.PersistentVolumeBlock), + expectedCan: fmt.Errorf(blockErrFormat, provisionerName), }, + // volumeMode tests for BlockProvisioner that returns false { - 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: "Undefined volumeMode PV request to BlockProvisoner that returns false", + provisioner: newTestBlockProvisioner(false), + claim: newClaim("claim-1", "1-1", "class-1", provisionerName, "", nil), + expectedCan: nil, }, { - 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: "FileSystem volumeMode PV request to BlockProvisoner that returns false", + provisioner: newTestBlockProvisioner(false), + claim: newClaimWithVolumeMode("claim-1", "1-1", "class-1", provisionerName, "", nil, v1.PersistentVolumeFilesystem), + expectedCan: nil, }, { - 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, + name: "Block volumeMode PV request to BlockProvisoner that returns false", + provisioner: newTestBlockProvisioner(false), + claim: newClaimWithVolumeMode("claim-1", "1-1", "class-1", provisionerName, "", nil, v1.PersistentVolumeBlock), + expectedCan: fmt.Errorf(blockErrFormat, provisionerName), + }, + // volumeMode tests for BlockProvisioner that returns true + { + name: "Undefined volumeMode PV request to BlockProvisoner that returns true", + provisioner: newTestBlockProvisioner(true), + claim: newClaim("claim-1", "1-1", "class-1", provisionerName, "", nil), + expectedCan: nil, + }, + { + name: "FileSystem volumeMode PV request to BlockProvisoner that returns true", + provisioner: newTestBlockProvisioner(true), + claim: newClaimWithVolumeMode("claim-1", "1-1", "class-1", provisionerName, "", nil, v1.PersistentVolumeFilesystem), + expectedCan: nil, + }, + { + name: "Block volumeMode PV request to BlockProvisioner that returns true", + provisioner: newTestBlockProvisioner(true), + claim: newClaimWithVolumeMode("claim-1", "1-1", "class-1", provisionerName, "", nil, v1.PersistentVolumeBlock), + expectedCan: nil, }, } for _, test := range tests { - client := fake.NewSimpleClientset() - provisioner := newTestProvisioner() - ctrl := newTestProvisionController(client, "foo.bar/baz", provisioner, "v1.5.0") + client := fake.NewSimpleClientset(test.claim) + serverVersion := defaultServerVersion + if test.serverGitVersion != "" { + serverVersion = test.serverGitVersion + } + ctrl := newTestProvisionController(client, provisionerName, test.provisioner, serverVersion) - is, _ := ctrl.isOnlyRecordUpdate(test.old, test.new) - if test.expectedIs != is { + can := ctrl.canProvision(test.claim) + if !reflect.DeepEqual(test.expectedCan, can) { t.Logf("test case: %s", test.name) - t.Errorf("expected is only record update %v but got %v\n", test.expectedIs, is) + t.Errorf("expected can provision %v but got %v\n", test.expectedCan, can) } } } @@ -593,9 +638,12 @@ func TestControllerSharedInformers(t *testing.T) { go ctrl.Run(stopCh) go informersFactory.Start(stopCh) + // When we shutdown while something is happening the fake client panics + // with send on closed channel...but the test passed, so ignore + utilruntime.ReallyCrash = false + informersFactory.WaitForCacheSync(stopCh) time.Sleep(2 * sharedResyncPeriod) - ctrl.runningOperations.Wait() pvList, _ := client.Core().PersistentVolumes().List(metav1.ListOptions{}) if (len(test.expectedVolumes) > 0 || len(pvList.Items) > 0) && @@ -619,7 +667,6 @@ func newTestProvisionController( provisioner, serverGitVersion, ResyncPeriod(resyncPeriod), - ExponentialBackOffOnError(false), CreateProvisionedPVInterval(10*time.Millisecond), LeaseDuration(2*resyncPeriod), RenewDeadline(resyncPeriod), @@ -652,7 +699,6 @@ func newTestProvisionControllerSharedInformers( provisioner, serverGitVersion, ResyncPeriod(resyncPeriod), - ExponentialBackOffOnError(false), CreateProvisionedPVInterval(10*time.Millisecond), LeaseDuration(2*resyncPeriod), RenewDeadline(resyncPeriod), @@ -725,6 +771,12 @@ func newClaim(name, claimUID, class, provisioner, volumeName string, annotations return claim } +func newClaimWithVolumeMode(name, claimUID, class, provisioner, volumeName string, annotations map[string]string, volumeMode v1.PersistentVolumeMode) *v1.PersistentVolumeClaim { + claim := newClaim(name, claimUID, class, provisioner, volumeName, annotations) + claim.Spec.VolumeMode = &volumeMode + return claim +} + func newVolume(name string, phase v1.PersistentVolumePhase, policy v1.PersistentVolumeReclaimPolicy, annotations map[string]string) *v1.PersistentVolume { pv := &v1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ @@ -827,6 +879,22 @@ func (p *testQualifiedProvisioner) ShouldProvision(claim *v1.PersistentVolumeCla return p.answer } +func newTestBlockProvisioner(answer bool) *testBlockProvisioner { + return &testBlockProvisioner{newTestProvisioner(), answer} +} + +type testBlockProvisioner struct { + *testProvisioner + answer bool +} + +var _ Provisioner = &testBlockProvisioner{} +var _ BlockProvisioner = &testBlockProvisioner{} + +func (p *testBlockProvisioner) SupportsBlock() bool { + return p.answer +} + func (p *testProvisioner) Provision(options VolumeOptions) (*v1.PersistentVolume, error) { p.provisionCalls <- true diff --git a/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/volume.go b/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/volume.go index a714ce1ba5..e8d5849f13 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/volume.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/lib/controller/volume.go @@ -47,6 +47,14 @@ type Qualifier interface { ShouldProvision(*v1.PersistentVolumeClaim) bool } +// BlockProvisioner is an optional interface implemented by provisioners to determine +// whether it supports block volume. +type BlockProvisioner interface { + Provisioner + // SupportsBlock returns whether provisioner supports block volume. + SupportsBlock() bool +} + // IgnoredError is the value for Delete to return to indicate that the call has // been ignored and no action taken. In case multiple provisioners are serving // the same storage class, provisioners may ignore PVs they are not responsible @@ -68,6 +76,10 @@ type VolumeOptions struct { // PV.Name of the appropriate PersistentVolume. Used to generate cloud // volume name. PVName string + + // PV mount options. Not validated - mount of the PVs will simply fail if one is invalid. + MountOptions []string + // PVC is reference to the claim that lead to provisioning of a new PV. // Provisioners *must* create a PV that would be matched by this PVC, // i.e. with required capacity, accessMode, labels matching PVC.Selector and diff --git a/vendor/github.com/kubernetes-incubator/external-storage/lib/util/util.go b/vendor/github.com/kubernetes-incubator/external-storage/lib/util/util.go index ec60bfaf5b..fee69b55ec 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/lib/util/util.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/lib/util/util.go @@ -59,3 +59,9 @@ func AccessModesContainedInAll(indexedModes []v1.PersistentVolumeAccessMode, req } return true } + +// CheckPersistentVolumeClaimModeBlock checks VolumeMode. +// If the mode is Block, return true otherwise return false. +func CheckPersistentVolumeClaimModeBlock(pvc *v1.PersistentVolumeClaim) bool { + return pvc.Spec.VolumeMode != nil && *pvc.Spec.VolumeMode == v1.PersistentVolumeBlock +} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/README.md b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/README.md index 941e4d41e0..feaed7d563 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/README.md +++ b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/README.md @@ -6,11 +6,11 @@ In order to be able to use **helm** to render templates, it has to be installed to generate templates. ## Helm Installation -On Linux, run these two commands to download and copy helm binary into /usr/bin directory. +On Linux or Mac OS, run these two commands to download and copy helm binary into /usr/local/bin directory. ``` console -export HELM_URL=http://storage.googleapis.com/kubernetes-helm/helm-v2.7.2-linux-amd64.tar.gz -curl "$HELM_URL" | sudo tar --strip-components 1 -C /usr/bin linux-amd64/helm -zxf - +export HELM_URL=http://storage.googleapis.com/kubernetes-helm/helm-v2.7.2-$(uname | tr A-Z a-z)-amd64.tar.gz +curl "$HELM_URL" | sudo tar --strip-components 1 -C /usr/local/bin -zxf - $(uname | tr A-Z a-z)-amd64/helm ``` Provisioner's spec generation process has been tested with helm version 2.7.2. @@ -44,21 +44,52 @@ The generated specs can be further customized as needed (usually not necessary), Default values.yaml is located in local-volume/helm/provisioner folder, user should not remove variables from this file but can change any values of these variables. -## Advanced options - -### Set engine -In order to generate the environment specific provisioner's spec, **--set engine={gcepre19,gcepost19,gke,baremetal}** parameter -can be used in helm template command. Example for GKE environment, the command line will look like: - -``` console -helm template ./helm/provisioner --set engine=gke > ./provisioner/deployment/kubernetes/provisioner_generated.yaml +## Configurations + +The following table lists the configurable parameters of the local volume +provisioner chart and their default values. + +| Parameter | Description | Type | Default | +| --- | --- | --- | --- | +| common.rbac | Generating RBAC (Role Based Access Control) objects. | bool | `true` | +| common.namespace | Namespace where provisioner runs. | str | `default` | +| common.useAlphaAPI | If running against pre-1.10 k8s version, the `useAlphaAPI` flag must be enabled. | bool | `false` | +| common.useJobForCleaning | Is set to true, provisioner will use jobs-based block cleaning. | bool | `false` | +| common.minResyncPeriod | Resync period in reflectors will be random between `minResyncPeriod` and `2*minResyncPeriod`. | str | `5m0s` +| common.configMapName | Provisioner ConfigMap name. | str | `local-provisioner-config` | +| classes.[n].name | StorageClass name. | str | `-` | +| classes.[n].hostDir | Path on the host where local volumes of this storage class are mounted under. | str | `-` | +| classes.[n].mountDir | Optionally specify mount path of local volumes. By default, we use same path as hostDir in container. | str | `-` | +| classes.[n].blockCleanerCommand | List of command and arguments of block cleaner command. | list | `-` | +| classes.[n].storageClass | Create storage class for this class and configure it optionally. | bool/map | `false` | +| classes.[n].storageClass.reclaimPolicy | Specify reclaimPolicy of storage class, available: Delete/Retain. | str | `Delete` | +| daemonset.name | Provisioner DaemonSet name. | str | `local-volume-provisioner` | +| daemonset.image | Provisioner image. | str | `quay.io/external_storage/local-volume-provisioner:v2.1.0` | +| daemonset.imagePullPolicy | Provisioner DaemonSet image pull policy. | str | `-` | +| daemonset.serviceAccount | Provisioner DaemonSet service account. | str | `local-storage-admin` | +| daemonset.kubeConfigEnv | Specify the location of kubernetes config file. | str | `-` | +| daemonset.nodeLabels | List of node labels to be copied to the PVs created by the provisioner. | list | `-` | +| daemonset.tolerations | List of tolerations to be applied to the Provisioner DaemonSet. | list | `-` | +| daemonset.resources | Map of resource request and limits to be applied to the Provisioner Daemonset. | map | `-` | +Note: `classes` is a list of objects, you can specify one or more classes. + +## Examples + +To try out one of the [examples](examples/). you can run, e.g. for gce: + +```console +$ helm template ./helm/provisioner -f helm/examples/gce.yaml > ./provisioner/deployment/kubernetes/provisioner_generated.yaml ``` -Parameter **--set engine=** can be used in conjunction with custom values.yaml file in the same command line. -### Generating RBAC (Role Based Access Control) specs -By default, common.rbac is set to "true" which generates the necessary ServiceAccount, ClusterRole, and ClusterRoleBinding -for an RBAC enabled kubernetes cluster. If your cluster does not use RBAC, you should add --set common.rbac=false when -running your helm install command, such as: - -``` console -helm template ./helm/provisioner --set common.rbac=false > ./provisioner/deployment/kubernetes/provisioner_generated.yaml +Currently you can try the following examples: + +* [examples/baremetal-cleanbyjobs.yaml](examples/baremetal-cleanbyjobs.yaml) +* [examples/baremetal-resyncperiod.yaml](examples/baremetal-resyncperiod.yaml) +* [examples/baremetal-tolerations.yaml](examples/baremetal-tolerations.yaml) +* [examples/baremetal-with-resource-limits.yaml](examples/baremetal-with-resource-limits.yaml) +* [examples/baremetal-without-rbac.yaml](examples/baremetal-without-rbac.yaml) +* [examples/baremetal.yaml](examples/baremetal.yaml) +* [examples/gce-pre1.9.yaml](examples/gce-pre1.9.yaml) +* [examples/gce-retain.yaml](examples/gce-retain.yaml) +* [examples/gce.yaml](examples/gce.yaml) +* [examples/gke.yaml](examples/gke.yaml) diff --git a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/templates/provisioner-cluster-role-binding.yaml b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/templates/provisioner-cluster-role-binding.yaml index 120c7bff66..807641aaff 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/templates/provisioner-cluster-role-binding.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/templates/provisioner-cluster-role-binding.yaml @@ -36,12 +36,12 @@ roleRef: kind: ClusterRole name: local-storage-provisioner-node-clusterrole apiGroup: rbac.authorization.k8s.io -{{- end }} +{{- if .Values.common.useJobForCleaning }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: - name: jobsrole + name: local-storage-provisioner-jobs-role namespace: {{ .Values.common.namespace }} rules: - apiGroups: @@ -54,7 +54,7 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: local-storage-provisioner-job-binding + name: local-storage-provisioner-jobs-rolebinding namespace: {{ .Values.common.namespace }} subjects: - kind: ServiceAccount @@ -62,5 +62,7 @@ subjects: namespace: {{ .Values.common.namespace }} roleRef: kind: Role - name: jobsrole + name: local-storage-provisioner apiGroup: rbac.authorization.k8s.io +{{- end }} +{{- end }} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/templates/provisioner.yaml b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/templates/provisioner.yaml index 8d7ebea461..93669d7d6f 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/templates/provisioner.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/templates/provisioner.yaml @@ -1,96 +1,69 @@ -{{- define "configStorageClass" }} -{{- $classPath := . }} -{{- range $tmp, $val := $classPath }} - {{- range $storageClass, $classConfig := $val }} -{{ $storageClass }}: - hostDir: {{ $classConfig.hostDir }} - mountDir: {{ if $classConfig.mountDir }} {{$classConfig.mountDir }} {{ else }} {{ $classConfig.hostDir }} {{ end }} - {{- if $classConfig.blockCleanerCommand }} - blockCleanerCommand: - {{- range $tmp, $val := $classConfig.blockCleanerCommand }} - - "{{ $val -}}"{{- end}} - {{- end }} -{{- end}} -{{- end}} -{{- end }} -{{- define "configVolumes" }} -{{- $classPath := . }} -{{- range $tmp, $val := $classPath }} - {{- range $storageClass, $classConfig := $val }} -- name: {{ $storageClass }} - hostPath: - path: {{ $classConfig.hostDir }} - {{- end}} -{{- end}} -{{- end }} -{{- define "configVolumeMounts" }} -{{- $classPath := . }} -{{- range $tmp, $val := $classPath }} - {{- range $storageClass, $classConfig := $val }} -- mountPath: {{ if $classConfig.mountDir }} {{$classConfig.mountDir }} {{ else }} {{ $classConfig.hostDir }} {{ end }} - name: {{ $storageClass }} - mountPropagation: "HostToContainer" - {{- end}} -{{- end}} -{{- end }} -{{- $configMapName := .Values.configmap.configMapName }} -{{- $provisionerNamespace := .Values.common.namespace }} -{{- $useAlphaAPI := .Values.common.useAlphaAPI }} -{{- $useJobForCleaning := .Values.common.useJobForCleaning }} -{{- $provisionerName := .Values.daemonset.name }} -{{- $imageFull := .Values.daemonset.image }} -{{- $imagePullPolicy := .Values.daemonset.imagePullPolicy }} -{{- $serviceAccount := .Values.daemonset.serviceAccount }} -{{- $kubeConfigEnv := .Values.daemonset.kubeConfigEnv }} -{{- $nodeLabels := .Values.daemonset.nodeLabels }} -{{- $engine := .Values.engine | default "baremetal" }} apiVersion: v1 kind: ConfigMap metadata: - name: {{ $configMapName }} - namespace: {{ $provisionerNamespace }} + name: {{ .Values.common.configMapName }} + namespace: {{ .Values.common.namespace }} data: -{{- if $nodeLabels }} +{{- if .Values.daemonset.nodeLabels }} nodeLabelsForPV: | - {{- range $label := $nodeLabels }} + {{- range $label := .Values.daemonset.nodeLabels }} - {{$label}} {{- end }} {{- end }} -{{- if $useAlphaAPI }} +{{- if .Values.common.useAlphaAPI }} useAlphaAPI: "true" {{- end }} -{{- if $useJobForCleaning }} +{{- if .Values.common.useJobForCleaning }} useJobForCleaning: "yes" +{{- end}} +{{- if .Values.common.minResyncPeriod }} + minResyncPeriod: {{ .Values.common.minResyncPeriod | quote }} {{- end}} storageClassMap: | -{{- if eq ( $engine | lower ) "gcepre19" }} {{ include "configStorageClass" (.Values.configmap.gcePre19.storageClass) | indent 4 }} {{ end }} -{{- if eq ( $engine | lower ) "gcepost19" }} {{ include "configStorageClass" (.Values.configmap.gcePost19.storageClass) | indent 4 }} {{ end }} -{{- if eq ( $engine | lower ) "gke" }} {{ include "configStorageClass" (.Values.configmap.gke.storageClass) | indent 4 }} {{ end }} -{{- if eq ( $engine | lower ) "baremetal" }} {{ include "configStorageClass" (.Values.configmap.baremetal.storageClass) | indent 4 }} {{ end }} + {{- range $classConfig := .Values.classes }} + {{ $classConfig.name }}: + hostDir: {{ $classConfig.hostDir }} + mountDir: {{ if $classConfig.mountDir }} {{- $classConfig.mountDir -}} {{ else }} {{- $classConfig.hostDir -}} {{ end }} + {{- if $classConfig.blockCleanerCommand }} + blockCleanerCommand: + {{- range $val := $classConfig.blockCleanerCommand }} + - "{{ $val -}}"{{- end}} + {{- end }} + {{- end }} --- apiVersion: extensions/v1beta1 kind: DaemonSet metadata: - name: {{ $provisionerName }} - namespace: {{ $provisionerNamespace }} + name: {{ .Values.daemonset.name }} + namespace: {{ .Values.common.namespace }} labels: app: local-volume-provisioner spec: selector: matchLabels: - app: local-volume-provisioner + app: local-volume-provisioner template: metadata: labels: app: local-volume-provisioner spec: - serviceAccountName: {{$serviceAccount}} + serviceAccountName: {{.Values.daemonset.serviceAccount}} +{{- if .Values.daemonset.tolerations }} + tolerations: +{{ .Values.daemonset.tolerations | toYaml | trim | indent 8 }} +{{- end }} containers: - - image: "{{ $imageFull }}" - imagePullPolicy: {{ $imagePullPolicy | quote }} - name: provisioner + - image: "{{ .Values.daemonset.image }}" + {{- if .Values.daemonset.imagePullPolicy }} + imagePullPolicy: {{ .Values.daemonset.imagePullPolicy | quote }} + {{- end }} + name: provisioner securityContext: privileged: true +{{- if .Values.daemonset.resources }} + resources: +{{ .Values.daemonset.resources | toYaml | trim | indent 12 }} +{{- end }} env: - name: MY_NODE_NAME valueFrom: @@ -101,25 +74,44 @@ spec: fieldRef: fieldPath: metadata.namespace - name: JOB_CONTAINER_IMAGE - value: "{{ $imageFull }}" - -{{- if $kubeConfigEnv }} + value: "{{ .Values.daemonset.image }}" + {{- if .Values.daemonset.kubeConfigEnv }} - name: KUBECONFIG - value: {{$kubeConfigEnv}} -{{- end }} + value: {{.Values.daemonset.kubeConfigEnv}} + {{- end }} volumeMounts: - - mountPath: /etc/provisioner/config + - mountPath: /etc/provisioner/config name: provisioner-config readOnly: true -{{- if eq ( $engine | lower ) "gcepre19" }} {{ include "configVolumeMounts" (.Values.configmap.gcePre19.storageClass) | indent 12 }} {{ end }} -{{- if eq ( $engine | lower ) "gcepost19" }} {{ include "configVolumeMounts" (.Values.configmap.gcePost19.storageClass) | indent 12 }} {{ end }} -{{- if eq ( $engine | lower ) "gke" }} {{ include "configVolumeMounts" (.Values.configmap.gke.storageClass) | indent 12 }} {{ end }} -{{- if eq ( $engine | lower ) "baremetal" }} {{ include "configVolumeMounts" (.Values.configmap.baremetal.storageClass) | indent 12 }} {{ end }} + - mountPath: /dev + name: provisioner-dev + {{- range $classConfig := .Values.classes }} + - mountPath: {{ if $classConfig.mountDir }} {{- $classConfig.mountDir -}} {{ else }} {{- $classConfig.hostDir -}} {{ end }} + name: {{ $classConfig.name }} + mountPropagation: "HostToContainer" + {{- end }} volumes: - name: provisioner-config configMap: - name: {{ $configMapName }} -{{- if eq ( $engine | lower ) "gcepre19" }} {{ include "configVolumes" (.Values.configmap.gcePre19.storageClass) | indent 8 }} {{ end }} -{{- if eq ( $engine | lower ) "gcepost19" }} {{ include "configVolumes" (.Values.configmap.gcePost19.storageClass) | indent 8 }} {{ end }} -{{- if eq ( $engine | lower ) "gke" }} {{ include "configVolumes" (.Values.configmap.gke.storageClass) | indent 8 }} {{ end }} -{{- if eq ( $engine | lower ) "baremetal" }} {{ include "configVolumes" (.Values.configmap.baremetal.storageClass) | indent 8 }} {{ end }} + name: {{ .Values.common.configMapName }} + - name: provisioner-dev + hostPath: + path: /dev + {{- range $classConfig := .Values.classes }} + - name: {{ $classConfig.name }} + hostPath: + path: {{ $classConfig.hostDir }} + {{- end }} +{{- range $val := .Values.classes }} +{{- if $val.storageClass }} +{{- $reclaimPolicy := $val.reclaimPolicy | default "Delete" }} +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: {{ $val.name }} +provisioner: kubernetes.io/no-provisioner +volumeBindingMode: WaitForFirstConsumer +reclaimPolicy: {{ $reclaimPolicy }} +{{- end }} +{{- end }} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/values.yaml b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/values.yaml index d09dfb96f2..5a3e8973b1 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/values.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/helm/provisioner/values.yaml @@ -1,3 +1,6 @@ +# +# Common options. +# common: # # Defines whether to generate service account and role bindings. @@ -17,66 +20,45 @@ common: # will use Jobs to clean. # useJobForCleaning: false -configmap: # - # Defines the name of configmap used by Provisioner + # Resync period in reflectors will be random between minResyncPeriod and + # 2*minResyncPeriod. Default: 5m0s. # - configMapName: "local-provisioner-config" + #minResyncPeriod: 5m0s # - # Defines storage classes in a format: - # - # storageClass: - # - {storage class name}: - # hostDir: "{path on the host where local volume of this storage class are mounted}" - # mountDir: "{Optional path where a local volume will be mounted inside of a container}" - # - # Note: At least one storage class must be configuredi, baremetal is used as default if no - # explicit environment is specified in helm template command line. - baremetal: - storageClass: - - fast-disks: - hostDir: /mnt/fast-disks - blockCleanerCommand: - # Do a quick reset of the block device during its cleanup. - # - "/scripts/quick_reset.sh" - # or use dd to zero out block dev in two iterations by uncommenting these lines - # - "/scripts/dd_zero.sh" - # - "2" - # or run shred utility for 2 iteration.s - - "/scripts/shred.sh" - - "2" - # or blkdiscard utility by uncommenting the line below. - # - "/scripts/blkdiscard.sh" - - # - # Storage classes for GCE Pre-1.9 - gcePre19: - storageClass: - - local-scsi: - hostDir: "/mnt/disks" - blockCleanerCommand: - - "/scripts/quick_reset.sh" - # - # Storage classes for GCE 1.9+ - gcePost19: - storageClass: - - local-scsi: - hostDir: "/mnt/disks/by-uuid/google-local-ssds-scsi-fs" - blockCleanerCommand: - - "/scripts/quick_reset.sh" - - local-nvme: - hostDir: "/mnt/disks/by-uuid/google-local-ssds-nvme-fs" - blockCleanerCommand: - - "/scripts/quick_reset.sh" - # - # Storage classes for GKE - gke: - storageClass: - - local-scsi: - hostDir: "/mnt/disks" - blockCleanerCommand: - - "/scripts/quick_reset.sh" + # Defines the name of configmap used by Provisioner # + configMapName: "local-provisioner-config" +# +# Configure storage classes. +# +classes: +- name: fast-disks # Defines name of storage classe. + # Path on the host where local volumes of this storage class are mounted + # under. + hostDir: /mnt/fast-disks + # Optionally specify mount path of local volumes. By default, we use same + # path as hostDir in container. + # mountDir: /mnt/fast-disks + blockCleanerCommand: + # Do a quick reset of the block device during its cleanup. + # - "/scripts/quick_reset.sh" + # or use dd to zero out block dev in two iterations by uncommenting these lines + # - "/scripts/dd_zero.sh" + # - "2" + # or run shred utility for 2 iteration.s + - "/scripts/shred.sh" + - "2" + # or blkdiscard utility by uncommenting the line below. + # - "/scripts/blkdiscard.sh" + # Uncomment to create storage class object with default configuration. + # storageClass: true + # Uncomment to create storage class object and configure it. + # storageClass: + # reclaimPolicy: Delete # Avaiable reclaim policies: Delete/Retain, defaults: Delete. +# +# Configure DaemonSet for provisioner. +# daemonset: # # Defines the name of a Provisioner @@ -89,7 +71,7 @@ daemonset: # # Defines Image download policy, see kubernetes documentation for available values. # - imagePullPolicy: Always + #imagePullPolicy: Always # # Defines a name of the service account which Provisioner will use to communicate with API server. # @@ -103,3 +85,13 @@ daemonset: # nodeLabels: # - failure-domain.beta.kubernetes.io/zone # - failure-domain.beta.kubernetes.io/region + # + # If configured, tolerations will add a toleration field to the DaemonSet PodSpec. + # + # Node tolerations for local-volume-provisioner scheduling to nodes with taints. + # Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + tolerations: [] + # + # If configured, resources will set the requests/limits field to the Daemonset PodSpec. + # Ref: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + resources: {} \ No newline at end of file diff --git a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/cmd/main.go b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/cmd/main.go index 12e8a0b1b1..873a210ced 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/cmd/main.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/cmd/main.go @@ -19,8 +19,10 @@ package main import ( "flag" "log" + "math/rand" "net/http" "os" + "time" "github.com/golang/glog" "github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/common" @@ -42,6 +44,7 @@ var ( ) func main() { + rand.Seed(time.Now().UTC().UnixNano()) flag.StringVar(&optListenAddress, "listen-address", ":8080", "address on which to expose metrics") flag.StringVar(&optMetricsPath, "metrics-path", "/metrics", "path under which to expose metrics") flag.Set("logtostderr", "true") @@ -49,11 +52,13 @@ func main() { provisionerConfig := common.ProvisionerConfiguration{ StorageClassConfig: make(map[string]common.MountConfig), + MinResyncPeriod: metav1.Duration{5 * time.Minute}, } if err := common.LoadProvisionerConfigs(common.ProvisionerConfigPath, &provisionerConfig); err != nil { glog.Fatalf("Error parsing Provisioner's configuration: %#v. Exiting...\n", err) } - glog.Infof("Configuration parsing has been completed, ready to run...") + glog.Infof("Loaded configuration: %+v", provisionerConfig) + glog.Infof("Ready to run...") nodeName := os.Getenv("MY_NODE_NAME") if nodeName == "" { @@ -82,6 +87,7 @@ func main() { NodeLabelsForPV: provisionerConfig.NodeLabelsForPV, UseAlphaAPI: provisionerConfig.UseAlphaAPI, UseJobForCleaning: provisionerConfig.UseJobForCleaning, + MinResyncPeriod: provisionerConfig.MinResyncPeriod, Namespace: namespace, JobContainerImage: jobImage, }) diff --git a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/common/common.go b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/common/common.go index 6a76104814..ecb573f645 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/common/common.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/common/common.go @@ -92,6 +92,9 @@ type UserConfig struct { Namespace string // Image of container to use for jobs (optional) JobContainerImage string + // MinResyncPeriod is minimum resync period. Resync period in reflectors + // will be random between MinResyncPeriod and 2*MinResyncPeriod. + MinResyncPeriod metav1.Duration } // MountConfig stores a configuration for discoverying a specific storageclass @@ -164,6 +167,9 @@ type ProvisionerConfiguration struct { // default is false. // +optional UseJobForCleaning bool `json:"useJobForCleaning" yaml:"useJobForCleaning"` + // MinResyncPeriod is minimum resync period. Resync period in reflectors + // will be random between MinResyncPeriod and 2*MinResyncPeriod. + MinResyncPeriod metav1.Duration `json:"minResyncPeriod" yaml:"minResyncPeriod"` } // CreateLocalPVSpec returns a PV spec that can be used for PV creation diff --git a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/common/common_test.go b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/common/common_test.go index e84187db50..82632e6853 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/common/common_test.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/common/common_test.go @@ -19,8 +19,12 @@ package common import ( "io/ioutil" "os" + "path/filepath" + "reflect" "testing" + "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/rest" ) @@ -79,15 +83,63 @@ func TestLoadProvisionerConfigs(t *testing.T) { defer func() { os.RemoveAll(tmpConfigPath) }() - provisionerConfig := &ProvisionerConfiguration{ - StorageClassConfig: make(map[string]MountConfig), + testcases := []struct { + data map[string]string + expected ProvisionerConfiguration + }{ + { + nil, + ProvisionerConfiguration{}, + }, + { + map[string]string{ + "useAlphaAPI": "true", + }, + ProvisionerConfiguration{ + UseAlphaAPI: true, + }, + }, + { + map[string]string{ + "storageClassMap": `local-storage: + hostDir: /mnt/disks + mountDir: /mnt/disks + blockCleanerCommand: + - "/scripts/shred.sh" + - "2" +`, + "useAlphaAPI": "true", + "minResyncPeriod": "1h30m", + }, + ProvisionerConfiguration{ + StorageClassConfig: map[string]MountConfig{ + "local-storage": { + HostDir: "/mnt/disks", + MountDir: "/mnt/disks", + BlockCleanerCommand: []string{"/scripts/shred.sh", "2"}, + }, + }, + UseAlphaAPI: true, + MinResyncPeriod: metav1.Duration{ + Duration: time.Hour + time.Minute*30, + }, + }, + }, } - err = LoadProvisionerConfigs(tmpConfigPath, provisionerConfig) - if err != nil { - t.Fatalf("LoadProvisionerConfigs error: %v", err) - } - - if provisionerConfig.UseAlphaAPI == true { - t.Errorf("UseAlphaAPI should default to false") + for _, v := range testcases { + for name, value := range v.data { + err1 := ioutil.WriteFile(filepath.Join(tmpConfigPath, name), []byte(value), 0644) + if err1 != nil { + t.Fatalf("Failed to write data into directory %s", tmpConfigPath) + } + } + provisionerConfig := ProvisionerConfiguration{} + err = LoadProvisionerConfigs(tmpConfigPath, &provisionerConfig) + if err != nil { + t.Fatalf("LoadProvisionerConfigs error: %v", err) + } + if !reflect.DeepEqual(provisionerConfig, v.expected) { + t.Errorf("Failed to parse config from data %q, expected %+v, got %+v", v.data, v.expected, provisionerConfig) + } } } diff --git a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/controller/controller.go b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/controller/controller.go index c895f33302..a83b2d15a5 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/controller/controller.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/controller/controller.go @@ -18,6 +18,7 @@ package controller import ( "fmt" + "math/rand" "time" "github.com/golang/glog" @@ -49,6 +50,11 @@ func StartLocalController(client *kubernetes.Clientset, ptable deleter.ProcTable broadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: v1core.New(client.CoreV1().RESTClient()).Events("")}) recorder := broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: provisionerName}) + // We choose a random resync period between MinResyncPeriod and 2 * + // MinResyncPeriod, so that local provisioners deployed on multiple nodes + // at same time don't list the apiserver simultaneously. + resyncPeriod := time.Duration(config.MinResyncPeriod.Seconds()*(1+rand.Float64())) * time.Second + runtimeConfig := &common.RuntimeConfig{ UserConfig: config, Cache: cache.NewVolumeCache(), @@ -58,7 +64,7 @@ func StartLocalController(client *kubernetes.Clientset, ptable deleter.ProcTable Name: provisionerName, Recorder: recorder, Mounter: mount.New("" /* default mount path */), - InformerFactory: informers.NewSharedInformerFactory(client, 0), + InformerFactory: informers.NewSharedInformerFactory(client, resyncPeriod), } populator.NewPopulator(runtimeConfig) diff --git a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/deleter/jobcontroller.go b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/deleter/jobcontroller.go index 9a430b80f9..461a74728f 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/deleter/jobcontroller.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/local-volume/provisioner/pkg/deleter/jobcontroller.go @@ -37,8 +37,7 @@ import ( ) const ( - resyncPeriod = 120 * time.Second - maxRetries = 10 + maxRetries = 10 // JobContainerName is name of the container running the cleanup process. JobContainerName = "cleaner" // JobNamePrefix is the prefix of the name of the cleaning job. @@ -82,7 +81,7 @@ func NewJobController(labelmap map[string]string, config *common.RuntimeConfig) options.LabelSelector = labels.SelectorFromSet(labelset).String() } - informer := config.InformerFactory.InformerFor(&batch_v1.Job{}, func(client kubernetes.Interface, _ time.Duration) cache.SharedIndexInformer { + informer := config.InformerFactory.InformerFor(&batch_v1.Job{}, func(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( cache.NewFilteredListWatchFromClient(client.BatchV1().RESTClient(), "jobs", namespace, optionsModifier), &batch_v1.Job{}, diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs-client/README.md b/vendor/github.com/kubernetes-incubator/external-storage/nfs-client/README.md index 1a212d58a6..cfb6db425a 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs-client/README.md +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs-client/README.md @@ -1,50 +1,106 @@ -# kubernetes nfs-client-provisioner +# Kubernetes NFS-Client Provisioner [![Docker Repository on Quay](https://quay.io/repository/external_storage/nfs-client-provisioner/status "Docker Repository on Quay")](https://quay.io/repository/external_storage/nfs-client-provisioner) -- pv provisioned as ${namespace}-${pvcName}-${pvName} -- pv recycled as archieved-${namespace}-${pvcName}-${pvName} -# deploy -- modify and deploy `deploy/deployment.yaml` -- modify and deploy `deploy/class.yaml` +`nfs-client` is an automatic provisioner that used your *already configured* NFS server, automatically creating Persistent Volumes. -## ARM based -To deploy on ARM based (Raspberry PI) use `deploy/deployment-arm.yaml` instead of `deploy/deployment.yaml` +- Persistent volumes are provisioned as ${namespace}-${pvcName}-${pvName} +- Persistent volumes which are recycled as archieved-${namespace}-${pvcName}-${pvName} -# authorization +# How to deploy nfs-client to your cluster. -If your cluster has RBAC enabled or you are running OpenShift you must -authorize the provisioner. If you are in a namespace/project other than -"default" either edit `deploy/auth/clusterrolebinding.yaml` or edit the `oadm -policy` command accordingly. +To note, you must *already* have an NFS Server. -## RBAC -```console -$ kubectl create -f deploy/auth/serviceaccount.yaml +1. Editing: + +Note: To deploy to an ARM-based environment, use: `deploy/deployment-arm.yaml` instead, otherwise use `deploy/deployment.yaml`. +Modify `deploy/deployment.yaml` and change the values to your own NFS server: + + +```yaml + env: + - name: PROVISIONER_NAME + value: fuseim.pri/ifs + - name: NFS_SERVER + value: 10.10.10.60 + - name: NFS_PATH + value: /ifs/kubernetes + volumes: + - name: nfs-client-root + nfs: + server: 10.10.10.60 + path: /ifs/kubernetes +``` + +Modify `deploy/class.yaml` to match the same value indicated by `PROVISIONER_NAME`: + +```yaml +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: managed-nfs-storage +provisioner: fuseim.pri/ifs # or choose another name, must match deployment's env PROVISIONER_NAME' +``` + +2. Authorization + +If your cluster has RBAC enabled or you are running OpenShift you must authorize the provisioner. If you are in a namespace/project other than "default" either edit `deploy/auth/clusterrolebinding.yaml` or edit the `oadm policy` command accordingly. + +Kubernetes: + +```sh +$ kubectl create -f deploy/auth/serviceaccount.yaml -f deploy/auth/clusterrole.yaml -f deploy/auth/clusterrolebinding.yaml serviceaccount "nfs-client-provisioner" created -$ kubectl create -f deploy/auth/clusterrole.yaml clusterrole "nfs-client-provisioner-runner" created -$ kubectl create -f deploy/auth/clusterrolebinding.yaml clusterrolebinding "run-nfs-client-provisioner" created -$ kubectl patch deployment nfs-client-provisioner -p '{"spec":{"template":{"spec":{"serviceAccount":"nfs-client-provisioner"}}}}' ``` -## OpenShift -```console -$ oc create -f deploy/auth/serviceaccount.yaml +OpenShift: + +```sh +$ oc create -f deploy/auth/openshift-clusterrole.yaml -f deploy/auth/serviceaccount.yaml serviceaccount "nfs-client-provisioner" created -$ oc create -f deploy/auth/openshift-clusterrole.yaml clusterrole "nfs-client-provisioner-runner" created $ oadm policy add-scc-to-user hostmount-anyuid system:serviceaccount:default:nfs-client-provisioner $ oadm policy add-cluster-role-to-user nfs-client-provisioner-runner system:serviceaccount:default:nfs-client-provisioner -$ oc patch deployment nfs-client-provisioner -p '{"spec":{"template":{"spec":{"serviceAccount":"nfs-client-provisioner"}}}}' ``` -# test -- `kubectl create -f deploy/test-claim.yaml` -- `kubectl create -f deploy/test-pod.yaml` -- check the folder and file "SUCCESS" created -- `kubectl delete -f deploy/test-pod.yaml` -- `kubectl delete -f deploy/test-claim.yaml` -- check the folder renamed to `archived-???` +3. Finally, test your environment! + +Now we'll test your NFS provisioner. + +Deploy: + +```sh +$ kubectl create -f deploy/test-claim.yaml -f deploy/test-pod.yaml +``` + +Now check your NFS Server for the file `SUCCESS`. + +```sh +kubectl delete -f deploy/test-pod.yaml -f deploy/test-claim.yaml +``` + +Now check the folder renamed to `archived-???`. + +4. Deploying your own PersistentVolumeClaim + +To deploy your own PVC, make sure that you have the correct `storage-class` as indicated by your `deploy/class.yaml` file. + +For example: + +```yaml +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: test-claim + annotations: + volume.beta.kubernetes.io/storage-class: "managed-nfs-storage" +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 1Mi +``` diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/README.md b/vendor/github.com/kubernetes-incubator/external-storage/nfs/README.md index d8ad8dbd9b..1c0cd88b42 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/README.md +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/README.md @@ -2,7 +2,7 @@ [![Docker Repository on Quay](https://quay.io/repository/kubernetes_incubator/nfs-provisioner/status "Docker Repository on Quay")](https://quay.io/repository/kubernetes_incubator/nfs-provisioner) ``` -quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 +quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 ``` 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. diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/clusterrolebinding.yaml b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/clusterrolebinding.yaml index 3e4d68572c..37410aff8b 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/clusterrolebinding.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/clusterrolebinding.yaml @@ -2,10 +2,12 @@ kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: run-nfs-provisioner + namespace: default subjects: - kind: ServiceAccount name: nfs-provisioner namespace: default +# update namespace above to your namespace in order to make this work roleRef: kind: ClusterRole name: nfs-provisioner-runner diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/daemonset-sa.yaml b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/daemonset-sa.yaml index 933928e6c7..6c16195998 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/daemonset-sa.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/daemonset-sa.yaml @@ -13,7 +13,7 @@ spec: app: nfs-provisioner containers: - name: nfs-provisioner - image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 + image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 ports: - name: nfs containerPort: 2049 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/deployment-sa.yaml b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/deployment-sa.yaml index 2202d615b9..07efa30e4e 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/deployment-sa.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/deployment-sa.yaml @@ -34,7 +34,7 @@ spec: serviceAccount: nfs-provisioner containers: - name: nfs-provisioner - image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 + image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 ports: - name: nfs containerPort: 2049 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/pod-sa.yaml b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/pod-sa.yaml index d74b163c57..5b72949bde 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/pod-sa.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/pod-sa.yaml @@ -6,7 +6,7 @@ spec: serviceAccount: nfs-provisioner containers: - name: nfs-provisioner - image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 + image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 ports: - name: nfs containerPort: 2049 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/statefulset-sa.yaml b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/statefulset-sa.yaml index a1c7f23266..c6bea4c79a 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/statefulset-sa.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/auth/statefulset-sa.yaml @@ -36,7 +36,7 @@ spec: terminationGracePeriodSeconds: 0 containers: - name: nfs-provisioner - image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 + image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 ports: - name: nfs containerPort: 2049 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/daemonset.yaml b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/daemonset.yaml index 51c21354c9..d80f052ef6 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/daemonset.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/daemonset.yaml @@ -12,7 +12,7 @@ spec: app: nfs-provisioner containers: - name: nfs-provisioner - image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 + image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 ports: - name: nfs containerPort: 2049 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/deployment.yaml b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/deployment.yaml index 9e1307bc17..fee735c262 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/deployment.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/deployment.yaml @@ -33,7 +33,7 @@ spec: spec: containers: - name: nfs-provisioner - image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 + image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 ports: - name: nfs containerPort: 2049 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/pod.yaml b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/pod.yaml index 07b9a88eba..a7c3d8d09f 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/pod.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/pod.yaml @@ -5,7 +5,7 @@ metadata: spec: containers: - name: nfs-provisioner - image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 + image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 ports: - name: nfs containerPort: 2049 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/statefulset.yaml b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/statefulset.yaml index d35d003d8f..0cea5f1b9c 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/statefulset.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/statefulset.yaml @@ -35,7 +35,7 @@ spec: terminationGracePeriodSeconds: 0 containers: - name: nfs-provisioner - image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 + image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 ports: - name: nfs containerPort: 2049 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/docs/demo/deployment.yaml b/vendor/github.com/kubernetes-incubator/external-storage/nfs/docs/demo/deployment.yaml index 9e350d5e5d..7048691720 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/docs/demo/deployment.yaml +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/docs/demo/deployment.yaml @@ -33,7 +33,7 @@ spec: spec: containers: - name: nfs-provisioner - image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 + image: quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 ports: - name: nfs containerPort: 2049 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/nfs/docs/deployment.md b/vendor/github.com/kubernetes-incubator/external-storage/nfs/docs/deployment.md index 607590aeb6..52017db956 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/nfs/docs/deployment.md +++ b/vendor/github.com/kubernetes-incubator/external-storage/nfs/docs/deployment.md @@ -22,7 +22,7 @@ $ make container If you are running in Kubernetes, it will pull the image from Quay for you. Or you can do it yourself. ``` -$ docker pull quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 +$ docker pull quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 ``` ## Deploying the provisioner @@ -103,7 +103,7 @@ You may want to specify the hostname the NFS server exports from, i.e. the serve $ docker run --cap-add DAC_READ_SEARCH --cap-add SYS_RESOURCE \ --security-opt seccomp:deploy/docker/nfs-provisioner-seccomp.json \ -v $HOME/.kube:/.kube:Z \ -quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 \ +quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 \ -provisioner=example.com/nfs \ -kubeconfig=/.kube/config ``` @@ -111,7 +111,7 @@ or ``` $ docker run --cap-add DAC_READ_SEARCH --cap-add SYS_RESOURCE \ --security-opt seccomp:deploy/docker/nfs-provisioner-seccomp.json \ -quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 \ +quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 \ -provisioner=example.com/nfs \ -master=http://172.17.0.1:8080 ``` @@ -126,7 +126,7 @@ With the two above options, the run command will look something like this. $ docker run --privileged \ -v $HOME/.kube:/.kube:Z \ -v /xfs:/export:Z \ -quay.io/kubernetes_incubator/nfs-provisioner:v1.0.8 \ +quay.io/kubernetes_incubator/nfs-provisioner:v1.0.9 \ -provisioner=example.com/nfs \ -kubeconfig=/.kube/config \ -enable-xfs-quota=true diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openebs/pkg/v1/maya_api_test.go b/vendor/github.com/kubernetes-incubator/external-storage/openebs/pkg/v1/maya_api_test.go index 362ca3c0e0..5ca368aabb 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/openebs/pkg/v1/maya_api_test.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/openebs/pkg/v1/maya_api_test.go @@ -137,7 +137,7 @@ func TestCreateVsm(t *testing.T) { vs := mayav1.VolumeSpec{} vs.Metadata.Name = c.vname vs.Metadata.Labels.Storage = c.size - message, err := EvaluateCreateVolume(c.ovt, c.vname, c.size) + message, err := EvaluateCreateVolume(c.ovt, vs) if !reflect.DeepEqual(err, c.expectedErr) { t.Fatalf("Expected error %v got %v", c.expectedErr, err) diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/DESIGN.md b/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/DESIGN.md deleted file mode 100644 index e9d61656c1..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/DESIGN.md +++ /dev/null @@ -1,160 +0,0 @@ -# OpenStack Manila External Provisioner - - -## Deployment Strategy into OpenShift -Similar to other external provisioners, i.e. Manila external provisioner will be distributed in a Docker image and deployed manually in a pod into OpenShift. - - -## Security -Only supplemental group will be used. - -### Supplemental Group -The [gidallocator package](https://github.com/wongma7/efs-provisioner/blob/master/pkg/gidallocator/allocator.go) will be used to allocate a GID for each provisioned share. The GID is given as a supplemental group to the process(es) running in a pod that mounted the provisioned share. -In addition, Manila access control for the provisioned share will be set to `ip 0.0.0.0` immediately after creation so that according to the Manila documentation the share can be mounted from any machine. - -### Supplemental Group and Manila Access Control Feature -In addition, the below approach is left for a potential future improvement: -- Use Supplemental group as described in the Supplemental group section. -- At the time of provisioning generate a certificate and access control to the provisioned share will be allowed only using the certificate. -- Implement a new (Flex Volume or out-of-tree or in-tree) plugin for mounting Manila share using the generated certificate. - - -## `gophercloud` Library -The [`gophercloud` library](https://github.com/gophercloud/gophercloud) will be used for communication with Manila API. - -### Authentication to Manila Service -`gophercloud`library reads values for authentication from environment variables. The below environment variable combinations were successfully used for authentication against Keystone version Newton `2:10.0.0-0ubuntu1`: - -``` -OS_USERNAME=demo -OS_PASSWORD=openstack -OS_AUTH_URL=http://localhost:35357/v3 -OS_DOMAIN_NAME=Default -OS_TENANT_NAME=demo -``` - -``` -OS_USERID=7e22ce01934c47dcae0f90e96cdfcf03 -OS_PASSWORD=openstack -OS_AUTH_URL=http://localhost:35357/v3 -OS_TENANT_ID=ecbc0da9369f41e3a8a17e49a425ff2d -``` - -``` -OS_USERNAME=demo -OS_PASSWORD=openstack -OS_AUTH_URL=http://localhost:35357/v3 -OS_DOMAIN_ID=default -OS_TENANT_NAME=demo -``` - -``` -OS_USERNAME=demo -OS_PASSWORD=openstack -OS_AUTH_URL=http://localhost:35357/v3 -OS_DOMAIN_ID=default -OS_TENANT_ID=ecbc0da9369f41e3a8a17e49a425ff2d -``` - -Note: the `OS_REGION_NAME` environment variable shall be read by the provisioner and shall be used for selecting a Manila service endpoint. The `gophercloud` library doesn't support the `OS_REGION_NAME` environment variable and it will take very significant effort to introduce this env. variable into the library. - -#### Authentication Token Limited Validity -Authentication token created during authentication and used in follow-up API calls has limited validity and should expire after 1 hour. That's why the provisioner shall authenticate every time just before it is going to either provision or delete a share. - -### Share Creation and Deletion -[`Create`, `Delete` and `Get` methods](https://github.com/gophercloud/gophercloud/blob/master/openstack/sharedfilesystems/v2/shares/requests.go) are already available and will be needed to create a new share or delete an existing share. - -Important: the deletion shall be implemented in such a way that even though the share still contains some data the share is deleted. This behaviour may depend on the used Manila back-end. - -### Access Control -Access control must be set to every newly created share, otherwise the share can't be mounted. - -The necessary API calls are already implemented in the gophercloud library. - - -## Testing -[Testing pyramid](https://testing.googleblog.com/2015/04/just-say-no-to-more-end-to-end-tests.html) will be followed, however, end-to-end tests will be skipped because of lack of OpenStack Manila test environment that will be capable of running OpenShift and provisioning NFS shares. - -### Unit tests -Unit tests that will be result of test driven development. - -### Integration tests -No integration tests are planned. - -### Kubernetes E2E tests -It is not possible to add automated E2E tests into Kubernetes CI. - -As there is no OpenStack environment with Manila service that can provision NFS share types Kubernetes E2E tests will not be performed. - -### OpenShift E2E tests -OpenStack environment with Manila service that can provision NFS share types is not available so E2E tests will not be performed. - -Currently, it is not possible to add automated tests of the provisioner to OpenShift CI. - - -## A Share Creation -Share creation consists of: -- [Create request](http://developer.openstack.org/api-ref/shared-file-systems/?expanded=create-share-detail#create-share) that either fails or results in a share being in state `creating`. -- `created` state waiting loop: because a successful share create request results in a `creating` share it is necessary to wait for a share to be created afterwards. So a waiting loop that periodically [shows the share status](http://developer.openstack.org/api-ref/shared-file-systems/?expanded=create-share-detail#show-share-details) after 1, 2, 4, 8, etc. seconds and waits until the status changes to `created` or the waiting timeouts (configurable timeout; default 180 seconds). -- Access control settings will be set to `ip 0.0.0.0` for every newly created share. - - -## Storage Class Example(s) -``` -apiVersion: storage.k8s.io/v1beta1 -kind: StorageClass -metadata: - name: manilaNFSshare -provisioner: kubernetes.io/manila -parameters: - type: default - zones: nova1, nova2, nova3 -``` -Optional parameter(s): -- `type` share type configured by administrator of Manila service. -- `zones` a set of zones; one of the zones will be used as the `availability_zone` in the [Create request](http://developer.openstack.org/api-ref/shared-file-systems/?expanded=create-share-detail#create-share). In case the `zones` parameter is not specified the `availability_zone` in the [Create request](http://developer.openstack.org/api-ref/shared-file-systems/?expanded=create-share-detail#create-share) is filled with default zone `nova`. - -Unavailable parameter(s): -- `share_proto` that is a mandatory parameter in the [Create request](http://developer.openstack.org/api-ref/shared-file-systems/?expanded=create-share-detail#create-share). The value of `NFS` will be always used. - -[Create request](http://developer.openstack.org/api-ref/shared-file-systems/?expanded=create-share-detail#create-share) optional parameters that won't be supported in Storage Class: -- `volume_type` - -**IMPORTANT**: OpenStack Nova availability zones must match Manila availability 1:1, otherwise a share may be provisioned in an availability zone where the Kubernetes cluster doesn't have a node. - -**IMPORTANT**: [Generic Storage Topology solution that works well with CSI and Local Storage](https://docs.google.com/spreadsheets/d/1t4z5DYKjX2ZDlkTpCnp18icRAQqOE85C1T1r2gqJVck/edit#gid=1993207982) design is planned for Kubernetes 1.9. Manila external provisioner should be re-designed according to the Generic Storage Topology design. - -## PVC Example(s) -``` -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: tinyshare - annotations: - "volume.beta.kubernetes.io/storage-class": "manilaNFSshare" -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2G -``` -Mandatory parameter(s): -- `storage` and the requested storage size must be whole integer number in GBs. In case it it not it is rounded to the closest higher value in GBs. - -Ignored parameter(s): -- `accessModes` are ignored. A PV created on a PVC demand will contain all access modes supported by the corresponding filesystem specified in the corresponding Storage Class (note: currently, only NFS is supported that's why all ReadWriteOnce, ReadOnlyMany and ReadWriteMany access modes are filled into the PV). - -[Create request](http://developer.openstack.org/api-ref/shared-file-systems/?expanded=create-share-detail#create-share) optional parameters that won't be supported in PVC: -- `name` -- `description` -- `display_name` -- `display_description` -- `snapshot_id` -- `is_public` -- `metadata` -- `share_network_id` -- `consistency_group_id` - -## A Share Deletion -The `func Delete()` always authenticates to the Manila API using environment variables like `OS_TENANT_ID`, etc. In case the `OS_TENANT_ID` is different than `OS_TENANT_ID` used to provision the share, the share cannot be deleted by the provisioner. In such case shares must be deleted manually. diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/Dockerfile b/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/Dockerfile deleted file mode 100644 index 1815970cbb..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2018 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM alpine:3.6 -RUN apk update --no-cache && apk add ca-certificates -COPY manila-provisioner / -ENTRYPOINT ["/manila-provisioner"] diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/Makefile b/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/Makefile deleted file mode 100644 index 21c7c76adb..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 2018 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ifeq ($(REGISTRY),) - REGISTRY = quay.io/external_storage/ -endif -ifeq ($(VERSION),) - VERSION = latest -endif -IMAGE = $(REGISTRY)manila-provisioner:$(VERSION) -MUTABLE_IMAGE = $(REGISTRY)manila-provisioner:latest - -all: manila-provisioner - -build: - @mkdir -p .go/src/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/vendor - @mkdir -p .go/bin - @mkdir -p .go/stdlib - docker run \ - --rm \ - -e "CGO_ENABLED=0" \ - -u $$(id -u):$$(id -g) \ - -v $$(pwd)/.go:/go \ - -v $$(pwd):/go/src/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems \ - -v "$${PWD%/*}/vendor":/go/src/github.com/kubernetes-incubator/external-storage/vendor \ - -v "$${PWD%/*}/lib":/go/src/github.com/kubernetes-incubator/external-storage/lib \ - -v $$(pwd):/go/bin \ - -v $$(pwd)/.go/stdlib:/usr/local/go/pkg/linux_amd64_asdf \ - -w /go/src/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/ \ - golang:1.8.3-alpine \ - go install -installsuffix "asdf" ./cmd/manila-provisioner -.PHONY: all build - -manila-provisioner: - CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o _output/bin/manila-provisioner cmd/manila-provisioner/main.go -.PHONY: manila-provisioner - -container: build quick-container -.PHONY: container - -quick-container: - docker build -t $(MUTABLE_IMAGE) . - docker tag $(MUTABLE_IMAGE) $(IMAGE) -.PHONY: quick-container - -push: container - docker push $(IMAGE) - docker push $(MUTABLE_IMAGE) -.PHONY: push - -test: - go test `go list ./... | grep -v 'vendor'` -.PHONY: test - -clean: - -rm -rf .go - -rm -f manila-provisioner - -rm -rf _output -.PHONY: clean diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/OWNERS b/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/OWNERS deleted file mode 100644 index 3eb6ecae92..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -approvers: - - pospispa - - jsafrane - - rootfs - - wongma7 diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/cmd/manila-provisioner/main.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/cmd/manila-provisioner/main.go deleted file mode 100644 index 3853f5e84f..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/cmd/manila-provisioner/main.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "flag" - "fmt" - "os" - - "github.com/golang/glog" - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack" - "github.com/gophercloud/gophercloud/openstack/sharedfilesystems/apiversions" - "github.com/gophercloud/gophercloud/openstack/sharedfilesystems/v2/shares" - "github.com/kubernetes-incubator/external-storage/lib/controller" - sharedfilesystems "github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/pkg/sharedfilesystems" - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" -) - -const ( - provisionerName = "externalstorage.k8s.io/manila" - minimumSupportedManilaMicroversion = "2.21" -) - -type manilaProvisioner struct { -} - -var ( - _ controller.Provisioner = &manilaProvisioner{} - kubeconfig = flag.String("kubeconfig", "", "Path to a kube config. Only required if out-of-cluster.") -) - -func main() { - flag.Parse() - flag.Set("logtostderr", "true") - - // Create an InClusterConfig and use it to create a client for the controller - // to use to communicate with Kubernetes - config, err := buildConfig(*kubeconfig) - 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) - } - - // Start the provision controller which will dynamically provision Manila PVs - provisioner := controller.NewProvisionController( - clientset, - provisionerName, - &manilaProvisioner{}, - serverVersion.GitVersion, - ) - - provisioner.Run(wait.NeverStop) -} - -func buildConfig(kubeconfig string) (*rest.Config, error) { - if kubeconfig != "" { - return clientcmd.BuildConfigFromFlags("", kubeconfig) - } - return rest.InClusterConfig() -} - -// Provision creates a new Manila share and returns a PV object representing it. -func (p *manilaProvisioner) Provision(pvc controller.VolumeOptions) (*v1.PersistentVolume, error) { - if pvc.PVC.Spec.Selector != nil { - return nil, fmt.Errorf("claim Selector is not supported") - } - - client := createManilaV2Client() - - var err error - var createdShare shares.Share - var createReq shares.CreateOpts - if createReq, err = sharedfilesystems.PrepareCreateRequest(pvc); err != nil { - return nil, fmt.Errorf("failed to create Create Request: %v", err) - } - glog.V(4).Infof("successfully created a share Create Request: %v", createReq) - var createReqResponse *shares.Share - if createReqResponse, err = shares.Create(client, createReq).Extract(); err != nil { - return nil, fmt.Errorf("failed to create a share: %v", err) - } - glog.V(3).Infof("successfully created a share: (%v)", createReqResponse) - createdShare = *createReqResponse - if err = sharedfilesystems.WaitTillAvailable(client, createdShare.ID); err != nil { - errMsg := fmt.Errorf("waiting for the share %q to become created failed: %v", createdShare.ID, err) - glog.Errorf("%v", errMsg) - if resultingErr := deleteShare(client, createdShare.ID); resultingErr != nil { - return nil, resultingErr - } - return nil, errMsg - } - glog.V(4).Infof("the share %q is now in state created", createdShare.ID) - - grantAccessReq := shares.GrantAccessOpts{ - AccessType: "ip", - AccessTo: "0.0.0.0/0", - AccessLevel: "rw", - } - var grantAccessReqResponse *shares.AccessRight - if grantAccessReqResponse, err = shares.GrantAccess(client, createdShare.ID, grantAccessReq).Extract(); err != nil { - errMsg := fmt.Errorf("failed to grant access to the share %q: %v", createdShare.ID, err) - glog.Errorf("%v", errMsg) - if resultingErr := deleteShare(client, createdShare.ID); resultingErr != nil { - return nil, resultingErr - } - return nil, errMsg - } - glog.V(4).Infof("granted access to the share %q: (%v)", createdShare.ID, grantAccessReqResponse) - - var chosenLocation shares.ExportLocation - var getExportLocationsReqResponse []shares.ExportLocation - if getExportLocationsReqResponse, err = shares.GetExportLocations(client, createdShare.ID).Extract(); err != nil { - errMsg := fmt.Errorf("failed to get export locations for the share %q: %v", createdShare.ID, err) - glog.Errorf("%v", errMsg) - if resultingErr := deleteShare(client, createdShare.ID); resultingErr != nil { - return nil, resultingErr - } - return nil, errMsg - } - glog.V(4).Infof("got export locations for the share %q: (%v)", createdShare.ID, getExportLocationsReqResponse) - if chosenLocation, err = sharedfilesystems.ChooseExportLocation(getExportLocationsReqResponse); err != nil { - errMsg := fmt.Errorf("failed to choose an export location for the share %q: %q", createdShare.ID, err.Error()) - fmt.Printf("%v", errMsg) - if resultingErr := deleteShare(client, createdShare.ID); resultingErr != nil { - return nil, resultingErr - } - return nil, errMsg - } - glog.V(4).Infof("selected export location for the share %q is: (%v)", createdShare.ID, chosenLocation) - pv, err := sharedfilesystems.FillInPV(pvc, createdShare, chosenLocation) - if err != nil { - errMsg := fmt.Errorf("failed to fill in PV for the share %q: %q", createdShare.ID, err.Error()) - glog.Errorf("%v", errMsg) - if resultingErr := deleteShare(client, createdShare.ID); resultingErr != nil { - return nil, resultingErr - } - return nil, errMsg - } - glog.V(4).Infof("resulting PV for the share %q: (%v)", createdShare.ID, pv) - - return pv, nil -} - -// Delete deletes the share the volume is associated with -func (p *manilaProvisioner) Delete(volume *v1.PersistentVolume) error { - client := createManilaV2Client() - shareID, err := sharedfilesystems.GetShareIDfromPV(volume) - if err != nil { - glog.Errorf("%q", err.Error()) - return err - } - return deleteShare(client, shareID) -} - -func deleteShare(client *gophercloud.ServiceClient, shareID string) error { - deleteResult := shares.Delete(client, shareID) - glog.V(4).Infof("share %q delete result: (%v)", shareID, deleteResult) - if deleteResult.Err != nil { - errMsg := fmt.Sprintf("failed to delete share %q", shareID) - glog.Errorf("%q", errMsg) - return fmt.Errorf("%q", errMsg) - } - return nil -} - -func createManilaV2Client() *gophercloud.ServiceClient { - regionName := os.Getenv("OS_REGION_NAME") - authOpts, err := openstack.AuthOptionsFromEnv() - if err != nil { - glog.Fatalf("%v", err) - } - glog.V(1).Infof("successfully read options from environment variables: OS_AUTH_URL(%q), OS_USERNAME/OS_USERID(%q/%q), OS_TENANT_NAME/OS_TENANT_ID(%q,%q), OS_DOMAIN_NAME/OS_DOMAIN_ID(%q,%q)", authOpts.IdentityEndpoint, authOpts.Username, authOpts.UserID) - provider, err := openstack.AuthenticatedClient(authOpts) - if err != nil { - glog.Fatalf("authentication failed: %v", err) - } - glog.V(4).Infof("successfully created provider client: (%v)", provider) - client, err := openstack.NewSharedFileSystemV2(provider, gophercloud.EndpointOpts{Region: regionName}) - if err != nil { - glog.Fatalf("failed to create Manila v2 client: %v", err) - } - client.Microversion = minimumSupportedManilaMicroversion - serverVer, err := apiversions.Get(client, "v2").Extract() - if err != nil { - glog.Fatalf("failed to get Manila v2 API min/max microversions: %v", err) - } - glog.V(4).Infof("received server's microvesion data structure: (%v)", serverVer) - glog.V(3).Infof("server's min microversion is: %q, max microversion is: %q", serverVer.MinVersion, serverVer.Version) - if err = sharedfilesystems.ValidMicroversion(serverVer.MinVersion); err != nil { - glog.Fatalf("server's minimum microversion is invalid: (%v)", serverVer.MinVersion) - } - if err = sharedfilesystems.ValidMicroversion(serverVer.Version); err != nil { - glog.Fatalf("server's maximum microversion is invalid: (%v)", serverVer.Version) - } - clientMajor, clientMinor := sharedfilesystems.SplitMicroversion(client.Microversion) - minMajor, minMinor := sharedfilesystems.SplitMicroversion(serverVer.MinVersion) - if clientMajor < minMajor || (clientMajor == minMajor && clientMinor < minMinor) { - glog.Fatalf("client microversion (%q) is smaller than the server's minimum microversion (%q)", client.Microversion, serverVer.MinVersion) - } - maxMajor, maxMinor := sharedfilesystems.SplitMicroversion(serverVer.Version) - if maxMajor < clientMajor || (maxMajor == clientMajor && maxMinor < clientMinor) { - glog.Fatalf("client microversion (%q) is bigger than the server's maximum microversion (%q)", client.Microversion, serverVer.Version) - } - glog.V(4).Infof("successfully created Manila v2 client: (%v)", client) - return client -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/pkg/sharedfilesystems/microversions.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/pkg/sharedfilesystems/microversions.go deleted file mode 100644 index 8d0993e62a..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/pkg/sharedfilesystems/microversions.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Functions in this file shall ideally be moved into the github.com/gophercloud/gophercloud library - -package sharedfilesystems - -import ( - "fmt" - "regexp" - "strconv" - "strings" -) - -// SplitMicroversion splits OpenStack microversion represented as string into Major and Minor versions represented as ints -func SplitMicroversion(mv string) (major, minor int) { - if err := ValidMicroversion(mv); err != nil { - return - } - - mvParts := strings.Split(mv, ".") - major, _ = strconv.Atoi(mvParts[0]) - minor, _ = strconv.Atoi(mvParts[1]) - - return -} - -// ValidMicroversion checks whether the microversion provided as a string is a valid OpenStack microversion -func ValidMicroversion(mv string) (err error) { - mvRe := regexp.MustCompile("^\\d+\\.\\d+$") - if v := mvRe.MatchString(mv); v { - return - } - - err = fmt.Errorf("invalid microversion: %q", mv) - return -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/pkg/sharedfilesystems/sharedfilesystems.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/pkg/sharedfilesystems/sharedfilesystems.go deleted file mode 100644 index c6a0ec483e..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/pkg/sharedfilesystems/sharedfilesystems.go +++ /dev/null @@ -1,232 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sharedfilesystems - -import ( - "fmt" - "strconv" - "strings" - - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack/sharedfilesystems/v2/shares" - "github.com/kubernetes-incubator/external-storage/lib/controller" - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/pkg/controller/volume/persistentvolume" - "k8s.io/kubernetes/pkg/volume" - "k8s.io/kubernetes/pkg/volume/util" -) - -const ( - // ZonesSCParamName is the name of the Storage Class parameter in which a set of zones is specified. - // The persistent volume will be dynamically provisioned in one of these zones. - ZonesSCParamName = "zones" - // TypeSCParamName is the name of a share type configured by administrator of Manila service. - TypeSCParamName = "type" - // ProtocolNFS is the NFS shared filesystems protocol - ProtocolNFS = "NFS" - // ManilaAnnotationShareIDName identifies provisioned Share ID - ManilaAnnotationShareIDName = "manila.external-storage.incubator.kubernetes.io/" + "ID" - // shareAvailabilityTimeout is a timeout in secs for waiting until a newly created share becomes available. - shareAvailabilityTimeout = 120 /* secs */ -) - -func getPVCStorageSize(pvc *v1.PersistentVolumeClaim) (int, error) { - var storageSize resource.Quantity - var ok bool - errStorageSizeNotConfigured := fmt.Errorf("requested storage capacity must be set") - if pvc.Spec.Resources.Requests == nil { - return 0, errStorageSizeNotConfigured - } - if storageSize, ok = pvc.Spec.Resources.Requests[v1.ResourceStorage]; !ok { - return 0, errStorageSizeNotConfigured - } - if storageSize.IsZero() { - return 0, fmt.Errorf("requested storage size must not have zero value") - } - if storageSize.Sign() == -1 { - return 0, fmt.Errorf("requested storage size must be greater than zero") - } - canonicalValue, _ := storageSize.AsScale(resource.Giga) - var buf []byte - storageSizeAsByte, _ := canonicalValue.AsCanonicalBytes(buf) - var i int - var err error - if i, err = strconv.Atoi(string(storageSizeAsByte)); err != nil { - return 0, fmt.Errorf("requested storage size is not a number") - } - return i, nil -} - -// PrepareCreateRequest return: -// - success: ready to send shared filesystem create request data structure constructed from Persistent Volume Claim and corresponding Storage Class -// - failure: an error -func PrepareCreateRequest(options controller.VolumeOptions) (shares.CreateOpts, error) { - var storageSize int - var err error - // mandatory parameter - if storageSize, err = getPVCStorageSize(options.PVC); err != nil { - return shares.CreateOpts{}, err - } - - shareType := "" - zone := "nova" - for index, value := range options.Parameters { - switch strings.ToLower(index) { - case ZonesSCParamName: - setOfZones, err := util.ZonesToSet(value) - if err != nil { - return shares.CreateOpts{}, err - } - zone = volume.ChooseZoneForVolume(setOfZones, options.PVC.Name) - case TypeSCParamName: - shareType = value - default: - return shares.CreateOpts{}, fmt.Errorf("invalid parameter %q", index) - } - } - - shareName := "pvc-" + string(options.PVC.UID) - // Currently only the NFS shares are supported, that's why the NFS is hardcoded. - return shares.CreateOpts{ - ShareProto: ProtocolNFS, - Size: storageSize, - Name: shareName, - ShareType: shareType, - Metadata: map[string]string{ - persistentvolume.CloudVolumeCreatedForClaimNamespaceTag: options.PVC.Namespace, - persistentvolume.CloudVolumeCreatedForClaimNameTag: options.PVC.Name, - persistentvolume.CloudVolumeCreatedForVolumeNameTag: shareName, - }, - AvailabilityZone: zone, - }, nil -} - -// WaitTillAvailable keeps querying Manila API for a share status until it is available. The waiting can: -// - succeed: in this case the is/becomes available -// - timeout: error is returned. -// - another error occurs: error is returned. -func WaitTillAvailable(client *gophercloud.ServiceClient, shareID string) error { - desiredStatus := "available" - return gophercloud.WaitFor(shareAvailabilityTimeout, func() (bool, error) { - current, err := shares.Get(client, shareID).Extract() - if err != nil { - return false, err - } - - if current.Status == desiredStatus { - return true, nil - } - return false, nil - }) -} - -// ChooseExportLocation chooses one ExportLocation according to the below rules: -// 1. Path is not empty, i.e. is not an empty string or does not contain spaces and tabs only -// 2. IsAdminOnly == false -// 3. Preferred == true are preferred over Preferred == false -// 4. Locations with lower slice index are preferred over locations with higher slice index -// In case no location complies with the above rules an error is returned. -func ChooseExportLocation(locs []shares.ExportLocation) (shares.ExportLocation, error) { - if len(locs) == 0 { - return shares.ExportLocation{}, fmt.Errorf("Error: received an empty list of export locations") - } - foundMatchingNotPreferred := false - var matchingNotPreferred shares.ExportLocation - for _, loc := range locs { - if loc.IsAdminOnly || strings.TrimSpace(loc.Path) == "" { - continue - } - if loc.Preferred { - return loc, nil - } - if !foundMatchingNotPreferred { - matchingNotPreferred = loc - foundMatchingNotPreferred = true - } - } - if foundMatchingNotPreferred { - return matchingNotPreferred, nil - } - return shares.ExportLocation{}, fmt.Errorf("cannot find any non-admin export location") -} - -// FillInPV creates the PV data structure from original PVC, provisioned share and the share export location -func FillInPV(options controller.VolumeOptions, share shares.Share, exportLocation shares.ExportLocation) (*v1.PersistentVolume, error) { - - storageSize := resource.MustParse(fmt.Sprintf("%dG", share.Size)) - PVAccessMode := getPVAccessMode(options.PVC.Spec.AccessModes) - server, path, err := getServerAndPath(exportLocation.Path) - if err != nil { - return nil, err - } - - pv := &v1.PersistentVolume{ - ObjectMeta: metav1.ObjectMeta{ - Name: options.PVName, - Annotations: map[string]string{ - ManilaAnnotationShareIDName: share.ID, - }, - }, - Spec: v1.PersistentVolumeSpec{ - PersistentVolumeReclaimPolicy: options.PersistentVolumeReclaimPolicy, - AccessModes: PVAccessMode, - Capacity: v1.ResourceList{ - v1.ResourceStorage: storageSize, - }, - PersistentVolumeSource: v1.PersistentVolumeSource{ - NFS: &v1.NFSVolumeSource{ - Server: server, - Path: path, - ReadOnly: false, - }, - }, - }, - } - - return pv, nil -} - -// GetShareIDfromPV returns: -// - an error in case there is no shareID stored in volume.ObjectMeta.Annotations[ManilaAnnotationShareIDName] -func GetShareIDfromPV(volume *v1.PersistentVolume) (string, error) { - if shareID, exists := volume.ObjectMeta.Annotations[ManilaAnnotationShareIDName]; exists { - return shareID, nil - } - return "", fmt.Errorf("did not find share ID in annotatins in PV (%v)", volume) -} - -// FIXME: for IPv6 -func getServerAndPath(exportLocationPath string) (string, string, error) { - split := strings.SplitN(exportLocationPath, ":", 2) - if len(split) == 2 { - return split[0], split[1], nil - } - return "", "", fmt.Errorf("failed to split export location %q into server and path parts", exportLocationPath) -} - -func getPVAccessMode(PVCAccessMode []v1.PersistentVolumeAccessMode) []v1.PersistentVolumeAccessMode { - if len(PVCAccessMode) > 0 { - return PVCAccessMode - } - return []v1.PersistentVolumeAccessMode{ - v1.ReadWriteOnce, - v1.ReadOnlyMany, - v1.ReadWriteMany, - } -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/pkg/sharedfilesystems/sharedfilesystems_test.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/pkg/sharedfilesystems/sharedfilesystems_test.go deleted file mode 100644 index ed55ff3855..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack-sharedfilesystems/pkg/sharedfilesystems/sharedfilesystems_test.go +++ /dev/null @@ -1,990 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sharedfilesystems - -import ( - "reflect" - "testing" - "time" - - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/kubernetes/pkg/controller/volume/persistentvolume" - "k8s.io/kubernetes/pkg/volume" - "k8s.io/kubernetes/pkg/volume/util" - - "github.com/gophercloud/gophercloud/openstack/sharedfilesystems/v2/shares" - "github.com/kubernetes-incubator/external-storage/lib/controller" -) - -const ( - fakeUID = types.UID("unique-uid") - fakeShareName = "pvc-" + string(fakeUID) - fakePVCName = "pvc" - fakeNamespace = "foo" - fakeShareID = "de64eb77-05cb-4502-a6e5-7e8552c352f3" - fakeReclaimPolicy = "Delete" - fakeZoneName = "nova" - fakePVName = "pv" - fakeShareTypeName = "default" -) - -func TestPrepareCreateRequest(t *testing.T) { - functionUnderTest := "PrepareCreateRequest" - - zonesForSCMultiZoneTestCase := "nova1, nova2, nova3" - setOfZonesForSCMultiZoneTestCase, _ := util.ZonesToSet(zonesForSCMultiZoneTestCase) - pvcNameForSCMultiZoneTestCase := "pvc" - expectedResultForSCMultiZoneTestCase := volume.ChooseZoneForVolume(setOfZonesForSCMultiZoneTestCase, pvcNameForSCMultiZoneTestCase) - pvcNameForSCNoZonesSpecifiedTestCase := "pvc" - expectedResultForSCNoZonesSpecifiedTestCase := "nova" - succCaseStorageSize, _ := resource.ParseQuantity("2G") - // First part: want no error - succCases := []struct { - volumeOptions controller.VolumeOptions - want shares.CreateOpts - }{ - // Will very probably start failing if the func volume.ChooseZoneForVolume is replaced by another function in the implementation - { - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: pvcNameForSCNoZonesSpecifiedTestCase, - Namespace: fakeNamespace, - UID: fakeUID}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: succCaseStorageSize, - }, - }, - }, - }, - Parameters: map[string]string{}, - }, - want: shares.CreateOpts{ - ShareProto: ProtocolNFS, - Name: fakeShareName, - AvailabilityZone: expectedResultForSCNoZonesSpecifiedTestCase, - Size: 2, - }, - }, - { - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVCName, - Namespace: fakeNamespace, - UID: fakeUID}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: succCaseStorageSize, - }, - }, - }, - }, - Parameters: map[string]string{ZonesSCParamName: fakeZoneName}, - }, - want: shares.CreateOpts{ - ShareProto: ProtocolNFS, - Name: fakeShareName, - AvailabilityZone: fakeZoneName, - Size: 2, - }, - }, - { - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVCName, - Namespace: fakeNamespace, - UID: fakeUID}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: succCaseStorageSize, - }, - }, - }, - }, - Parameters: map[string]string{"ZoNes": fakeZoneName}, - }, - want: shares.CreateOpts{ - ShareProto: ProtocolNFS, - Name: fakeShareName, - AvailabilityZone: fakeZoneName, - Size: 2, - }, - }, - // Will very probably start failing if the func volume.ChooseZoneForVolume is replaced by another function in the implementation - { - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: pvcNameForSCMultiZoneTestCase, - Namespace: fakeNamespace, - UID: fakeUID}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: succCaseStorageSize, - }, - }, - }, - }, - Parameters: map[string]string{ZonesSCParamName: zonesForSCMultiZoneTestCase}, - }, - want: shares.CreateOpts{ - ShareProto: ProtocolNFS, - Name: fakeShareName, - AvailabilityZone: expectedResultForSCMultiZoneTestCase, - Size: 2, - }, - }, - // PVC accessModes parameters are being ignored. - { - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVCName, - Namespace: fakeNamespace, - UID: fakeUID}, - Spec: v1.PersistentVolumeClaimSpec{ - AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadOnlyMany}, - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: succCaseStorageSize, - }, - }, - }, - }, - Parameters: map[string]string{ZonesSCParamName: fakeZoneName}, - }, - want: shares.CreateOpts{ - ShareProto: ProtocolNFS, - Name: fakeShareName, - AvailabilityZone: fakeZoneName, - Size: 2, - }, - }, - // In case the requested storage size in GB is not a whole number because of the chosen units the storage size in GB is rounded up to the nearest integer - { - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVCName, - Namespace: fakeNamespace, - UID: fakeUID}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("2Gi"), - }, - }, - }, - }, - Parameters: map[string]string{ZonesSCParamName: fakeZoneName}, - }, - want: shares.CreateOpts{ - ShareProto: ProtocolNFS, - Name: fakeShareName, - AvailabilityZone: fakeZoneName, - Size: 3, - }, - }, - // In case the requested storage size is not a whole number the storage size is rounded up to the nearest integer - { - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVCName, - Namespace: fakeNamespace, - UID: fakeUID}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("2.2G"), - }, - }, - }, - }, - Parameters: map[string]string{ZonesSCParamName: fakeZoneName}, - }, - want: shares.CreateOpts{ - ShareProto: ProtocolNFS, - Name: fakeShareName, - AvailabilityZone: fakeZoneName, - Size: 3, - }, - }, - // Optional parameter "type" is present in the Storage Class - { - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVCName, - Namespace: fakeNamespace, - UID: fakeUID}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("2.2G"), - }, - }, - }, - }, - Parameters: map[string]string{ZonesSCParamName: fakeZoneName, TypeSCParamName: fakeShareTypeName}, - }, - want: shares.CreateOpts{ - ShareProto: ProtocolNFS, - Name: fakeShareName, - ShareType: fakeShareTypeName, - AvailabilityZone: fakeZoneName, - Size: 3, - }, - }, - } - for i, succCase := range succCases { - tags := make(map[string]string) - tags[persistentvolume.CloudVolumeCreatedForClaimNamespaceTag] = fakeNamespace - tags[persistentvolume.CloudVolumeCreatedForClaimNameTag] = succCase.volumeOptions.PVC.Name - tags[persistentvolume.CloudVolumeCreatedForVolumeNameTag] = succCase.want.Name - succCase.want.Metadata = tags - if request, err := PrepareCreateRequest(succCase.volumeOptions); err != nil { - t.Errorf("Test case %v: %v(%v) RETURNED (%v, %v), WANT (%v, %v)", i, functionUnderTest, succCase.volumeOptions, request, err, succCase.want, nil) - } else if !reflect.DeepEqual(request, succCase.want) { - t.Errorf("Test case %v: %v(%v) RETURNED (%v, %v), WANT (%v, %v)", i, functionUnderTest, succCase.volumeOptions, request, err, succCase.want, nil) - } - } - - // Second part: want an error - errCases := []struct { - testCaseName string - volumeOptions controller.VolumeOptions - }{ - { - testCaseName: "unknown Storage Class option", - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{Name: "pvc", Namespace: "foo"}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("2G"), - }, - }, - }, - }, - Parameters: map[string]string{"foo": "bar"}, - }, - }, - { - testCaseName: "zero storage capacity", - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{Name: "pvc", Namespace: "foo"}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("0G"), - }, - }, - }, - }, - Parameters: map[string]string{}, - }, - }, - { - testCaseName: "negative storage capacity", - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{Name: "pvc", Namespace: "foo"}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("-1G"), - }, - }, - }, - }, - Parameters: map[string]string{}, - }, - }, - { - testCaseName: "storage size not configured 1", - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{Name: "pvc", Namespace: "foo"}, - Spec: v1.PersistentVolumeClaimSpec{}, - }, - Parameters: map[string]string{}, - }, - }, - { - testCaseName: "storage size not configured 2", - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{Name: "pvc", Namespace: "foo"}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceCPU: resource.Quantity{}, - }, - }, - }, - }, - Parameters: map[string]string{}, - }, - }, - } - for _, errCase := range errCases { - if request, err := PrepareCreateRequest(errCase.volumeOptions); err == nil { - t.Errorf("Test case %q: %v(%v) RETURNED (%v, %v), WANT (%v, %v)", errCase.testCaseName, functionUnderTest, errCase.volumeOptions, request, err, "N/A", "an error") - } - } -} - -const ( - validPath = "ip://directory" - preferredPath = "ip://preferred/directory" - emptyPath = "" - spacesOnlyPath = " " - shareExportLocationID1 = "123456-1" - shareExportLocationID2 = "1234567-1" - shareExportLocationID3 = "1234567-2" - shareExportLocationID4 = "7654321-1" - shareID1 = "123456" - shareID2 = "1234567" -) - -func TestChooseExportLocationSuccess(t *testing.T) { - tests := []struct { - testCaseName string - locs []shares.ExportLocation - want shares.ExportLocation - }{ - { - testCaseName: "Match first item:", - locs: []shares.ExportLocation{ - { - Path: validPath, - ShareInstanceID: shareID1, - IsAdminOnly: false, - ID: shareExportLocationID1, - Preferred: false, - }, - }, - want: shares.ExportLocation{ - Path: validPath, - ShareInstanceID: shareID1, - IsAdminOnly: false, - ID: shareExportLocationID1, - Preferred: false, - }, - }, - { - testCaseName: "Match preferred location:", - locs: []shares.ExportLocation{ - { - Path: validPath, - ShareInstanceID: shareID2, - IsAdminOnly: false, - ID: shareExportLocationID2, - Preferred: false, - }, - { - Path: preferredPath, - ShareInstanceID: shareID2, - IsAdminOnly: false, - ID: shareExportLocationID3, - Preferred: true, - }, - }, - want: shares.ExportLocation{ - Path: preferredPath, - ShareInstanceID: shareID2, - IsAdminOnly: false, - ID: shareExportLocationID3, - Preferred: true, - }, - }, - { - testCaseName: "Match first not-preferred location that matches shareID:", - locs: []shares.ExportLocation{ - { - Path: validPath, - ShareInstanceID: shareID2, - IsAdminOnly: false, - ID: shareExportLocationID2, - Preferred: false, - }, - { - Path: preferredPath, - ShareInstanceID: shareID2, - IsAdminOnly: false, - ID: shareExportLocationID3, - Preferred: false, - }, - }, - want: shares.ExportLocation{ - Path: validPath, - ShareInstanceID: shareID2, - IsAdminOnly: false, - ID: shareExportLocationID2, - Preferred: false, - }, - }, - } - - for _, tt := range tests { - if got, err := ChooseExportLocation(tt.locs); err != nil { - t.Errorf("%q ChooseExportLocation(%v) = (%v, %q) want (%v, nil)", tt.testCaseName, tt.locs, got, err.Error(), tt.want) - } else if !reflect.DeepEqual(tt.want, got) { - t.Errorf("%q ChooseExportLocation(%v) = (%v, nil) want (%v, nil)", tt.testCaseName, tt.locs, got, tt.want) - } - } -} - -func TestChooseExportLocationNotFound(t *testing.T) { - tests := []struct { - testCaseName string - locs []shares.ExportLocation - }{ - { - testCaseName: "Empty slice:", - locs: []shares.ExportLocation{}, - }, - { - testCaseName: "Locations for admins only:", - locs: []shares.ExportLocation{ - { - Path: validPath, - ShareInstanceID: shareID1, - IsAdminOnly: true, - ID: shareExportLocationID1, - Preferred: false, - }, - }, - }, - { - testCaseName: "Preferred locations for admins only:", - locs: []shares.ExportLocation{ - { - Path: validPath, - ShareInstanceID: shareID1, - IsAdminOnly: true, - ID: shareExportLocationID1, - Preferred: true, - }, - }, - }, - { - testCaseName: "Empty path:", - locs: []shares.ExportLocation{ - { - Path: emptyPath, - ShareInstanceID: shareID1, - IsAdminOnly: false, - ID: shareExportLocationID1, - Preferred: false, - }, - }, - }, - { - testCaseName: "Empty path in preferred location:", - locs: []shares.ExportLocation{ - { - Path: emptyPath, - ShareInstanceID: shareID1, - IsAdminOnly: false, - ID: shareExportLocationID1, - Preferred: true, - }, - }, - }, - { - testCaseName: "Path containing spaces only:", - locs: []shares.ExportLocation{ - { - Path: spacesOnlyPath, - ShareInstanceID: shareID1, - IsAdminOnly: false, - ID: shareExportLocationID1, - Preferred: false, - }, - }, - }, - { - testCaseName: "Preferred path containing spaces only:", - locs: []shares.ExportLocation{ - { - Path: spacesOnlyPath, - ShareInstanceID: shareID1, - IsAdminOnly: false, - ID: shareExportLocationID1, - Preferred: true, - }, - }, - }, - } - for _, tt := range tests { - if got, err := ChooseExportLocation(tt.locs); err == nil { - t.Errorf("%q ChooseExportLocation(%v) = (%v, nil) want (\"N/A\", \"an error\")", tt.testCaseName, tt.locs, got) - } - } -} - -func TestFillInPV(t *testing.T) { - functionUnderTest := "FillInPV" - tests := []struct { - testCaseName string - volumeOptions controller.VolumeOptions - share shares.Share - exportLocation shares.ExportLocation - want *v1.PersistentVolume - }{ - { - testCaseName: "Storage size in GB is a whole number", - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVCName, - Namespace: fakeNamespace, - UID: fakeUID}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("2G"), - }, - }, - }, - }, - Parameters: map[string]string{ZonesSCParamName: fakeZoneName}, - }, - share: shares.Share{ - AvailabilityZone: fakeZoneName, - Description: "", - DisplayDescription: "", - DisplayName: "", - HasReplicas: false, - Host: "", - ID: fakeShareID, - IsPublic: false, - Links: []map[string]string{ - {"href:http://controller:8786/v2/ecbc0da9369f41e3a8a17e49a425ff2d/shares/de64eb77-05cb-4502-a6e5-7e8552c352f3": "rel:self"}, - {"href:http://controller:8786/ecbc0da9369f41e3a8a17e49a425ff2d/shares/de64eb77-05cb-4502-a6e5-7e8552c352f3": "rel:bookmark"}, - }, - Metadata: map[string]string{persistentvolume.CloudVolumeCreatedForClaimNamespaceTag: fakeNamespace, persistentvolume.CloudVolumeCreatedForClaimNameTag: fakePVCName, persistentvolume.CloudVolumeCreatedForVolumeNameTag: fakeShareName}, - Name: fakeShareName, - ProjectID: "ecbc0da9369f41e3a8a17e49a425ff2d", - ReplicationType: "", - ShareNetworkID: "", - ShareProto: ProtocolNFS, - ShareServerID: "", - ShareType: "e60e2fa9-d2e8-4772-b24b-c45a54e05e53", - ShareTypeName: "default_share_type", - Size: 2, - SnapshotID: "", - Status: "creating", - TaskState: "", - VolumeType: "default_share_type", - ConsistencyGroupID: "", - SnapshotSupport: true, - SourceCgsnapshotMemberID: "", - CreatedAt: time.Date(2015, time.August, 27, 11, 33, 21, 0, time.UTC), - }, - exportLocation: shares.ExportLocation{ - Path: "127.0.0.1:/var/lib/manila/mnt/share-0ee809f3-edd3-4603-973a-8049311f8d00", - ShareInstanceID: "", - IsAdminOnly: false, - ID: "68e3aeb3-0c8f-4a55-804f-ee2d26ebf814", - Preferred: false, - }, - want: &v1.PersistentVolume{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVName, - Annotations: map[string]string{ - ManilaAnnotationShareIDName: fakeShareID, - }, - }, - Spec: v1.PersistentVolumeSpec{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - AccessModes: []v1.PersistentVolumeAccessMode{ - v1.ReadWriteOnce, - v1.ReadOnlyMany, - v1.ReadWriteMany, - }, - Capacity: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("2G"), - }, - PersistentVolumeSource: v1.PersistentVolumeSource{ - NFS: &v1.NFSVolumeSource{ - Server: "127.0.0.1", - Path: "/var/lib/manila/mnt/share-0ee809f3-edd3-4603-973a-8049311f8d00", - ReadOnly: false, - }, - }, - }, - }, - }, - { - testCaseName: "Storage size in GB must be rounded up", - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVCName, - Namespace: fakeNamespace, - UID: fakeUID}, - Spec: v1.PersistentVolumeClaimSpec{ - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("2Gi"), - }, - }, - }, - }, - Parameters: map[string]string{ZonesSCParamName: fakeZoneName}, - }, - share: shares.Share{ - AvailabilityZone: fakeZoneName, - Description: "", - DisplayDescription: "", - DisplayName: "", - HasReplicas: false, - Host: "", - ID: fakeShareID, - IsPublic: false, - Links: []map[string]string{ - {"href:http://controller:8786/v2/ecbc0da9369f41e3a8a17e49a425ff2d/shares/de64eb77-05cb-4502-a6e5-7e8552c352f3": "rel:self"}, - {"href:http://controller:8786/ecbc0da9369f41e3a8a17e49a425ff2d/shares/de64eb77-05cb-4502-a6e5-7e8552c352f3": "rel:bookmark"}, - }, - Metadata: map[string]string{persistentvolume.CloudVolumeCreatedForClaimNamespaceTag: fakeNamespace, persistentvolume.CloudVolumeCreatedForClaimNameTag: fakePVCName, persistentvolume.CloudVolumeCreatedForVolumeNameTag: fakeShareName}, - Name: fakeShareName, - ProjectID: "ecbc0da9369f41e3a8a17e49a425ff2d", - ReplicationType: "", - ShareNetworkID: "", - ShareProto: ProtocolNFS, - ShareServerID: "", - ShareType: "e60e2fa9-d2e8-4772-b24b-c45a54e05e53", - ShareTypeName: "default_share_type", - Size: 3, - SnapshotID: "", - Status: "creating", - TaskState: "", - VolumeType: "default_share_type", - ConsistencyGroupID: "", - SnapshotSupport: true, - SourceCgsnapshotMemberID: "", - CreatedAt: time.Date(2015, time.August, 27, 11, 33, 21, 0, time.UTC), - }, - exportLocation: shares.ExportLocation{ - Path: "127.0.0.1:/var/lib/manila/mnt/share-0ee809f3-edd3-4603-973a-8049311f8d00", - ShareInstanceID: "", - IsAdminOnly: false, - ID: "68e3aeb3-0c8f-4a55-804f-ee2d26ebf814", - Preferred: false, - }, - want: &v1.PersistentVolume{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVName, - Annotations: map[string]string{ - ManilaAnnotationShareIDName: fakeShareID, - }, - }, - Spec: v1.PersistentVolumeSpec{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - AccessModes: []v1.PersistentVolumeAccessMode{ - v1.ReadWriteOnce, - v1.ReadOnlyMany, - v1.ReadWriteMany, - }, - Capacity: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("3G"), - }, - PersistentVolumeSource: v1.PersistentVolumeSource{ - NFS: &v1.NFSVolumeSource{ - Server: "127.0.0.1", - Path: "/var/lib/manila/mnt/share-0ee809f3-edd3-4603-973a-8049311f8d00", - ReadOnly: false, - }, - }, - }, - }, - }, - { - testCaseName: "Access Mode is configured in PVC", - volumeOptions: controller.VolumeOptions{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - PVName: fakePVName, - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVCName, - Namespace: fakeNamespace, - UID: fakeUID}, - Spec: v1.PersistentVolumeClaimSpec{ - AccessModes: []v1.PersistentVolumeAccessMode{ - v1.ReadOnlyMany, - v1.ReadWriteOnce, - }, - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("2G"), - }, - }, - }, - }, - Parameters: map[string]string{ZonesSCParamName: fakeZoneName}, - }, - share: shares.Share{ - AvailabilityZone: fakeZoneName, - Description: "", - DisplayDescription: "", - DisplayName: "", - HasReplicas: false, - Host: "", - ID: fakeShareID, - IsPublic: false, - Links: []map[string]string{ - {"href:http://controller:8786/v2/ecbc0da9369f41e3a8a17e49a425ff2d/shares/de64eb77-05cb-4502-a6e5-7e8552c352f3": "rel:self"}, - {"href:http://controller:8786/ecbc0da9369f41e3a8a17e49a425ff2d/shares/de64eb77-05cb-4502-a6e5-7e8552c352f3": "rel:bookmark"}, - }, - Metadata: map[string]string{persistentvolume.CloudVolumeCreatedForClaimNamespaceTag: fakeNamespace, persistentvolume.CloudVolumeCreatedForClaimNameTag: fakePVCName, persistentvolume.CloudVolumeCreatedForVolumeNameTag: fakeShareName}, - Name: fakeShareName, - ProjectID: "ecbc0da9369f41e3a8a17e49a425ff2d", - ReplicationType: "", - ShareNetworkID: "", - ShareProto: ProtocolNFS, - ShareServerID: "", - ShareType: "e60e2fa9-d2e8-4772-b24b-c45a54e05e53", - ShareTypeName: "default_share_type", - Size: 2, - SnapshotID: "", - Status: "creating", - TaskState: "", - VolumeType: "default_share_type", - ConsistencyGroupID: "", - SnapshotSupport: true, - SourceCgsnapshotMemberID: "", - CreatedAt: time.Date(2015, time.August, 27, 11, 33, 21, 0, time.UTC), - }, - exportLocation: shares.ExportLocation{ - Path: "127.0.0.1:/var/lib/manila/mnt/share-0ee809f3-edd3-4603-973a-8049311f8d00", - ShareInstanceID: "", - IsAdminOnly: false, - ID: "68e3aeb3-0c8f-4a55-804f-ee2d26ebf814", - Preferred: false, - }, - want: &v1.PersistentVolume{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVName, - Annotations: map[string]string{ - ManilaAnnotationShareIDName: fakeShareID, - }, - }, - Spec: v1.PersistentVolumeSpec{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - AccessModes: []v1.PersistentVolumeAccessMode{ - v1.ReadOnlyMany, - v1.ReadWriteOnce, - }, - Capacity: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("2G"), - }, - PersistentVolumeSource: v1.PersistentVolumeSource{ - NFS: &v1.NFSVolumeSource{ - Server: "127.0.0.1", - Path: "/var/lib/manila/mnt/share-0ee809f3-edd3-4603-973a-8049311f8d00", - ReadOnly: false, - }, - }, - }, - }, - }, - } - for _, tt := range tests { - if got, err := FillInPV(tt.volumeOptions, tt.share, tt.exportLocation); err != nil { - t.Errorf("Test case: %q; %v(%v, %v, %v) = (%v, %v) WANT (%v, nil)", tt.testCaseName, functionUnderTest, tt.volumeOptions, tt.share, tt.exportLocation, got, err.Error(), tt.want) - } else if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Test case: %q; %v(%v, %v, %v) = (%v, %v) WANT (%v, nil)", tt.testCaseName, functionUnderTest, tt.volumeOptions, tt.share, tt.exportLocation, got, err, tt.want) - } - } -} - -func TestGetServerAndPath(t *testing.T) { - functionUnderTest := "getServerAndPath" - // want success - exportLocationPath := "10.0.0.2:/var/lib/manila-shares/mnt/share-0ee809f3-edd3-4603-973a-8049311f8d00" - wantServer := "10.0.0.2" - wantPath := "/var/lib/manila-shares/mnt/share-0ee809f3-edd3-4603-973a-8049311f8d00" - if gotServer, gotPath, err := getServerAndPath(exportLocationPath); err != nil { - t.Errorf("%v(%q) = (%q, %q, %q) WANT (%q, %q, nil)", functionUnderTest, exportLocationPath, gotServer, gotPath, err.Error(), wantServer, wantPath) - } else if gotServer != wantServer || gotPath != wantPath { - t.Errorf("%v(%q) = (%q, %q, %q) WANT (%q, %q, nil)", functionUnderTest, exportLocationPath, gotServer, gotPath, err, wantServer, wantPath) - } - // want an error - exportLocationPath = "127.0.0.1string/without/colon" - if gotServer, gotPath, err := getServerAndPath(exportLocationPath); err == nil { - t.Errorf("%v(%q) = (%q, %q, %q) WANT (\"\", \"\", \"an error\")", functionUnderTest, exportLocationPath, gotServer, gotPath, err) - } -} - -func TestGetShareIDfromPV(t *testing.T) { - functionUnderTest := "GetShareIDfromPV" - // want success - succCases := []struct { - volume *v1.PersistentVolume - want string - }{ - { - volume: &v1.PersistentVolume{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVName, - Annotations: map[string]string{ - ManilaAnnotationShareIDName: fakeShareID, - }, - }, - Spec: v1.PersistentVolumeSpec{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - AccessModes: []v1.PersistentVolumeAccessMode{ - v1.ReadWriteOnce, - v1.ReadOnlyMany, - v1.ReadWriteMany, - }, - Capacity: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("3G"), - }, - PersistentVolumeSource: v1.PersistentVolumeSource{ - NFS: &v1.NFSVolumeSource{ - Server: "127.0.0.1", - Path: "/var/lib/manila/mnt/share-0ee809f3-edd3-4603-973a-8049311f8d00", - ReadOnly: false, - }, - }, - }, - }, - want: fakeShareID, - }, - } - for _, succCase := range succCases { - if got, err := GetShareIDfromPV(succCase.volume); err != nil { - t.Errorf("%v(%v) = (%q, %q) WANT (%q, nil)", functionUnderTest, succCase.volume, got, err.Error(), succCase.want) - } else if got != succCase.want { - t.Errorf("%v(%v) = (%q, nil) WANT (%q, nil)", functionUnderTest, succCase.volume, got, succCase.want) - } - } - - // want an error - errCases := []struct { - testCaseName string - volume *v1.PersistentVolume - }{ - { - testCaseName: "Empty Annotations field", - volume: &v1.PersistentVolume{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVName, - }, - Spec: v1.PersistentVolumeSpec{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - AccessModes: []v1.PersistentVolumeAccessMode{ - v1.ReadWriteOnce, - v1.ReadOnlyMany, - v1.ReadWriteMany, - }, - Capacity: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("3G"), - }, - PersistentVolumeSource: v1.PersistentVolumeSource{ - NFS: &v1.NFSVolumeSource{ - Server: "127.0.0.1", - Path: "/var/lib/manila/mnt/share-0ee809f3-edd3-4603-973a-8049311f8d00", - ReadOnly: false, - }, - }, - }, - }, - }, - { - testCaseName: ManilaAnnotationShareIDName + " key doesn't exist in Annotations", - volume: &v1.PersistentVolume{ - ObjectMeta: metav1.ObjectMeta{ - Name: fakePVName, - Annotations: map[string]string{ - "foo": "bar", - }, - }, - Spec: v1.PersistentVolumeSpec{ - PersistentVolumeReclaimPolicy: fakeReclaimPolicy, - AccessModes: []v1.PersistentVolumeAccessMode{ - v1.ReadWriteOnce, - v1.ReadOnlyMany, - v1.ReadWriteMany, - }, - Capacity: v1.ResourceList{ - v1.ResourceStorage: resource.MustParse("3G"), - }, - PersistentVolumeSource: v1.PersistentVolumeSource{ - NFS: &v1.NFSVolumeSource{ - Server: "127.0.0.1", - Path: "/var/lib/manila/mnt/share-0ee809f3-edd3-4603-973a-8049311f8d00", - ReadOnly: false, - }, - }, - }, - }, - }, - } - for _, errCase := range errCases { - if got, err := GetShareIDfromPV(errCase.volume); err == nil { - t.Errorf("%q: %v(%v) = (%q, nil) WANT (\"any result\", \"an error\")", errCase.testCaseName, functionUnderTest, errCase.volume, got) - } - } - -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/Dockerfile b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/Dockerfile deleted file mode 100644 index e253bc8a0a..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM alpine:latest - -COPY cinder-provisioner / - -ENTRYPOINT ["/cinder-provisioner"] diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/Makefile b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/Makefile deleted file mode 100644 index 18ec12f2d7..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ifeq ($(REGISTRY),) - REGISTRY = quay.io/external_storage/ -endif - -ifeq ($(VERSION),) - VERSION = latest -endif - -IMAGE = $(REGISTRY)standalone-cinder-provisioner:$(VERSION) -MUTABLE_IMAGE = $(REGISTRY)standalone-cinder-provisioner:latest - -.PHONY: all build container test - -all: build - -build: - CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o cinder-provisioner ./cmd/cinder-provisioner - -container: build - docker build -t $(MUTABLE_IMAGE) . - docker tag $(MUTABLE_IMAGE) $(IMAGE) - -test: - go test -cover ./pkg/provisioner ./pkg/volumeservice - -clean: - -rm cinder-provisioner - diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/README.md b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/README.md deleted file mode 100644 index d61e0a4f53..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/README.md +++ /dev/null @@ -1,102 +0,0 @@ -## Standalone-cinder external provisioner -The standalone-cinder external provisioner fulfills persistent -volume claims by creating cinder volumes and mapping them -to natively supported volume sources. This approach allows -cinder to be used as a storage service whether or not the -cluster is deployed on Openstack. By mapping cinder -volume connection information to native volume sources, -persistent volumes can be attached and mounted using the -standard kubelet machinery and without help from cinder. - -### Mapping cinder volumes to native PVs -The provisioner works by mapping cinder volume connections -(iscsi, rbd, fc, etc) to the corresponding native/raw kubernetes -volume types. New cinder types can be supported in the provisioner -by creating a new implementation of the volunmeMapper interface. The -implementation is responsible for building a PersistentVolumeSource -from cinder connection information and for setup and teardown of any -authentication (CHAP secret, cephx secret, etc) if required. - -Support for cinder backends without a corresponding kubernetes raw -volume implementation could be added in the future by providing a -FlexVolume implementation for the type. - -### Connecting to cinder -The provisioner directly uses the gophercloud SDK to connect to -cinder (as opposed to use of the cloudprovider interface). The -intention is to support two modes of operation: a conventional -cinder deployment with keystone managing authentication and -providing the service catalog, and a standalone configuration where -cinder is accessed directly. - -Cinder deployments can be used by supplying a cloud -config file identical to the one you would use to configure an -openstack cloud provider or by specifying authentication parameters -in the environment. - -```ini -# Example configuration: keystone auth via cloudconfig -[Global] -auth-url=http://keystone-host:5000/v2.0 -username=admin -password=Passw0rd! -region=RegionOne -tenant-id=637b7373213d439d8119285244481456 -``` - -```ini -# Example configuration: noauth via cloudconfig -[Global] -cinder-endpoint=http://cinder-host:8776/v2 -username=admin -tenant-name=admin -``` - -```sh -# Example configuration: keystone auth via environment variables -OS_AUTH_URL=http://keystone-host:5000/v2.0 -OS_USERNAME=admin -OS_PASSWORD=Passw0rd! -OS_TENANT_ID=637b7373213d439d8119285244481456 -OS_REGION_NAME=RegionOne -``` - -```sh -# Example configuration: noauth via environment variables -OS_CINDER_ENDPOINT=http://cinder-host:8776/v2 -OS_USERNAME=admin -OS_TENANT_NAME=admin -``` - -### Workflows -| User | Kubernetes | Provisioner | Cinder | -| ---------- | ------------ | ------------ | ------------ | -| **Provision storage** | | | | -| Issue a PVC for a 100GB RWO volume | | | | -| | Posted the PVC on API server | | | -| | | Acquire the PVC and call cinder create | | -| | | | Create 100GB volume and return info | -| | | Call cinder reserve | | -| | | | Volume is marked as reserved/attaching | -| | | Call cinder os-initialize_connection | | -| | | | Create connection on storage server and return info (ISCSI target and LUN info) | -| | | Create PV using ISCSI as raw volume type using connection info || -| | Bind the PV to the PVC | | | -| **Use storage** | | | | -| Create a Pod including the PVC | | | | -| | Attach ISCSI PV to node | | | -| | Create filesystem on device and mount into Pod | | | -| | Pod is running | | | -| Delete Pod | | | | -| | Pod is stopped | | | -| | Unmount filesystem | | | -| | Detach ISCSI PV | | | -| **Delete storage** | | | | -| Delete PVC | | | | -| | | Call cinder os-terminate_connection | | -| | | | Remove connection on storage server | -| | | Call cinder unreserve | | -| | | | Volume is marked as available | -| | | Call cinder delete | | -| | | | Delete volume from storage | -| | Delete PV | | | diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/cmd/cinder-provisioner/cinder-provisioner.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/cmd/cinder-provisioner/cinder-provisioner.go deleted file mode 100644 index 6b93b9153d..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/cmd/cinder-provisioner/cinder-provisioner.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "flag" - - "github.com/golang/glog" - "github.com/kubernetes-incubator/external-storage/lib/controller" - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner" - - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" -) - -var ( - master = flag.String("master", "", "Master URL") - kubeconfig = flag.String("kubeconfig", "", "Absolute path to the kubeconfig") - id = flag.String("id", "", "Unique provisioner identity") - cloudconfig = flag.String("cloudconfig", "", "Path to OpenStack config file") -) - -func main() { - flag.Parse() - flag.Set("logtostderr", "true") - - var config *rest.Config - var err error - if *master != "" || *kubeconfig != "" { - config, err = clientcmd.BuildConfigFromFlags(*master, *kubeconfig) - } else { - config, err = rest.InClusterConfig() - } - prID := provisioner.ProvisionerName - if *id != "" { - prID = *id - } - 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 - cinderProvisioner, err := provisioner.NewCinderProvisioner(clientset, prID, *cloudconfig) - if err != nil { - glog.Fatalf("Error creating Cinder provisioner: %v", err) - } - - // Start the provision controller which will dynamically provision cinder - // PVs - pc := controller.NewProvisionController( - clientset, - provisioner.ProvisionerName, - cinderProvisioner, - serverVersion.GitVersion, - ) - - pc.Run(wait.NeverStop) -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/deployment.yaml b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/deployment.yaml deleted file mode 100644 index a4226f4257..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/deployment.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: standalone-cinder-provisioner -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - labels: - app: standalone-cinder-provisioner - spec: - containers: - - name: standalone-cinder-provisioner - image: "quay.io/external_storage/standalone-cinder-provisioner:latest" - imagePullPolicy: IfNotPresent - env: - - name: OS_AUTH_URL - value: http://192.168.2.16:5000/v2.0 - - name: OS_USERNAME - value: admin - - name: OS_PASSWORD - value: password - - name: OS_TENANT_ID - value: 522e341dd2884e88a466a5c68ca54aa4 - - name: OS_REGION_NAME - value: RegionOne diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/clusterbroker.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/clusterbroker.go deleted file mode 100644 index abcd5443b8..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/clusterbroker.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "github.com/golang/glog" - "k8s.io/api/core/v1" -) - -// clusterBroker provides a mechanism for tests to override calls kubernetes with mocks. -type clusterBroker interface { - createSecret(p *cinderProvisioner, ns string, secret *v1.Secret) error - deleteSecret(p *cinderProvisioner, ns string, secretName string) error -} - -type k8sClusterBroker struct { - clusterBroker -} - -func (k8sClusterBroker) createSecret(p *cinderProvisioner, ns string, secret *v1.Secret) error { - _, err := p.Client.CoreV1().Secrets(ns).Create(secret) - if err != nil { - glog.Errorf("Failed to create chap secret in namespace %s: %v", ns, err) - return err - } - glog.V(3).Infof("Secret %s created", secret.ObjectMeta.Name) - return nil -} - -func (*k8sClusterBroker) deleteSecret(p *cinderProvisioner, ns string, secretName string) error { - err := p.Client.CoreV1().Secrets(ns).Delete(secretName, nil) - if err != nil { - glog.Errorf("Failed to remove secret %s from namespace %s: %v", secretName, ns, err) - return err - } - glog.V(3).Infof("Successfully deleted secret %s", secretName) - return nil -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/iscsi.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/iscsi.go deleted file mode 100644 index 1e2407243d..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/iscsi.go +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "github.com/golang/glog" - "github.com/kubernetes-incubator/external-storage/lib/controller" - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice" - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const iscsiType = "iscsi" - -type iscsiMapper struct { - volumeMapper - cb clusterBroker -} - -func getChapSecretName(connection volumeservice.VolumeConnection, options controller.VolumeOptions) string { - if connection.Data.AuthMethod == "CHAP" { - return options.PVName + "-secret" - } - return "" -} - -func (m *iscsiMapper) BuildPVSource(conn volumeservice.VolumeConnection, options controller.VolumeOptions) (*v1.PersistentVolumeSource, error) { - ret := &v1.PersistentVolumeSource{ - ISCSI: &v1.ISCSIPersistentVolumeSource{ - // TODO: Need some way to specify the initiator name - TargetPortal: conn.Data.TargetPortal, - IQN: conn.Data.TargetIqn, - Lun: conn.Data.TargetLun, - SessionCHAPAuth: false, - }, - } - secretName := getChapSecretName(conn, options) - if secretName != "" { - ret.ISCSI.SessionCHAPAuth = true - ret.ISCSI.SecretRef = &v1.SecretReference{ - Name: secretName, - } - } - return ret, nil -} - -func (m *iscsiMapper) AuthSetup(p *cinderProvisioner, options controller.VolumeOptions, conn volumeservice.VolumeConnection) error { - // Create a secret for the CHAP credentials - secretName := getChapSecretName(conn, options) - if secretName == "" { - glog.V(3).Info("No CHAP authentication secret necessary") - return nil - } - secret := &v1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: secretName, - }, - Type: "kubernetes.io/iscsi-chap", - Data: map[string][]byte{ - "node.session.auth.username": []byte(conn.Data.AuthUsername), - "node.session.auth.password": []byte(conn.Data.AuthPassword), - }, - } - namespace := options.PVC.Namespace - return m.cb.createSecret(p, namespace, secret) -} - -func (m *iscsiMapper) AuthTeardown(p *cinderProvisioner, pv *v1.PersistentVolume) error { - // Delete the CHAP credentials - if pv.Spec.ISCSI.SecretRef == nil { - glog.V(3).Info("No associated secret to delete") - return nil - } - - secretName := pv.Spec.ISCSI.SecretRef.Name - secretNamespace := pv.Spec.ClaimRef.Namespace - return m.cb.deleteSecret(p, secretNamespace, secretName) -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/iscsi_test.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/iscsi_test.go deleted file mode 100644 index 9431bb5440..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/iscsi_test.go +++ /dev/null @@ -1,216 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "github.com/kubernetes-incubator/external-storage/lib/controller" - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/api/core/v1" -) - -var _ = Describe("Iscsi Mapper", func() { - Describe("the CHAP secret name", func() { - var ( - secretName string - conn volumeservice.VolumeConnection - ) - options := createVolumeOptions() - - JustBeforeEach(func() { - secretName = getChapSecretName(conn, options) - }) - - Context("when the authentication method is CHAP", func() { - BeforeEach(func() { - conn.Data.AuthMethod = "CHAP" - }) - It("should be based on the PV name", func() { - Expect(secretName).To(Equal("testpv-secret")) - }) - }) - - Context("when the authentication method is not CHAP", func() { - BeforeEach(func() { - conn.Data.AuthMethod = "not chap" - }) - It("should be blank", func() { - Expect(secretName).To(Equal("")) - }) - }) - }) - - Describe("the persistent volume source", func() { - var ( - mapper iscsiMapper - err error - source *v1.PersistentVolumeSource - secretName string - conn volumeservice.VolumeConnection - ) - options := controller.VolumeOptions{ - PVName: "myPV", - } - - BeforeEach(func() { - conn = createIscsiConnectionInfo() - mapper = iscsiMapper{} - }) - - JustBeforeEach(func() { - secretName = getChapSecretName(conn, options) - source, err = mapper.BuildPVSource(conn, options) - }) - - It("should be populated with iscsi connection info", func() { - Expect(source.ISCSI.TargetPortal).To(Equal("portal")) - Expect(source.ISCSI.IQN).To(Equal("iqn")) - Expect(source.ISCSI.Lun).To(Equal(int32(3))) - Expect(source.ISCSI.SessionCHAPAuth).To(BeFalse()) - }) - - Context("when CHAP authentication is enabled", func() { - BeforeEach(func() { - conn.Data.AuthMethod = "CHAP" - }) - It("should contain a reference to a CHAP secret", func() { - Expect(source.ISCSI.SessionCHAPAuth).To(BeTrue()) - Expect(source.ISCSI.SecretRef).To(Not(BeNil())) - Expect(source.ISCSI.SecretRef.Name).To(Equal(secretName)) - }) - }) - }) - - Describe("Authorization setup", func() { - var ( - cb *fakeClusterBroker - mapper iscsiMapper - conn volumeservice.VolumeConnection - options controller.VolumeOptions - err error - ) - - BeforeEach(func() { - cb = &fakeClusterBroker{} - mapper = iscsiMapper{cb: cb} - conn = createIscsiConnectionInfo() - options = createVolumeOptions() - }) - - JustBeforeEach(func() { - err = mapper.AuthSetup(&cinderProvisioner{}, options, conn) - }) - - Context("when the connection supplies CHAP credentials", func() { - BeforeEach(func() { - conn.Data.AuthMethod = "CHAP" - conn.Data.AuthUsername = "user" - conn.Data.AuthPassword = "pass" - }) - - It("should create a CHAP secret", func() { - Expect(cb.CreatedSecret).To(Not(BeNil())) - Expect(cb.CreatedSecret.Type).To(Equal(v1.SecretType("kubernetes.io/iscsi-chap"))) - Expect(cb.CreatedSecret.Name).To(Equal("testpv-secret")) - user := string(cb.CreatedSecret.Data["node.session.auth.username"][:]) - pass := string(cb.CreatedSecret.Data["node.session.auth.password"][:]) - Expect(user).To(Equal("user")) - Expect(pass).To(Equal("pass")) - }) - - It("should target the namespace where the PVC resides", func() { - Expect(cb.Namespace).To(Equal(options.PVC.Namespace)) - }) - }) - - Context("when the connection does not require CHAP authentication", func() { - It("should not create a CHAP secret", func() { - Expect(cb.CreatedSecret).To(BeNil()) - }) - }) - }) - - Describe("Authorization Teardown", func() { - var ( - cb *fakeClusterBroker - mapper iscsiMapper - pv *v1.PersistentVolume - err error - ) - - BeforeEach(func() { - pv = createPersistentVolume() - pv.Spec.PersistentVolumeSource.ISCSI = &v1.ISCSIPersistentVolumeSource{} - }) - - JustBeforeEach(func() { - cb = &fakeClusterBroker{} - mapper = iscsiMapper{cb: cb} - err = mapper.AuthTeardown(&cinderProvisioner{}, pv) - }) - - Context("when the PV contains a secret reference", func() { - BeforeEach(func() { - pv.Spec.ISCSI.SecretRef = &v1.SecretReference{ - Name: "secretName", - } - }) - - It("should delete the secret", func() { - Expect(cb.DeletedSecret).To(Equal("secretName")) - Expect(cb.Namespace).To(Equal("testNs")) - }) - }) - - Context("when the PV does not contain a secret reference", func() { - It("should not delete any secret", func() { - Expect(cb.DeletedSecret).To(BeEmpty()) - }) - }) - }) -}) - -func createIscsiConnectionInfo() volumeservice.VolumeConnection { - return volumeservice.VolumeConnection{ - DriverVolumeType: iscsiType, - Data: volumeservice.VolumeConnectionDetails{ - TargetPortal: "portal", - TargetIqn: "iqn", - TargetLun: 3, - }, - } -} - -type fakeClusterBroker struct { - clusterBroker - CreatedSecret *v1.Secret - DeletedSecret string - Namespace string -} - -func (cb *fakeClusterBroker) createSecret(p *cinderProvisioner, ns string, secret *v1.Secret) error { - cb.CreatedSecret = secret - cb.Namespace = ns - return nil -} - -func (cb *fakeClusterBroker) deleteSecret(p *cinderProvisioner, ns string, secretName string) error { - cb.DeletedSecret = secretName - cb.Namespace = ns - return nil -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/mapper.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/mapper.go deleted file mode 100644 index cb4fb1a345..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/mapper.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "errors" - "fmt" - - "github.com/golang/glog" - "github.com/kubernetes-incubator/external-storage/lib/controller" - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice" - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type volumeMapper interface { - // BuildPVSource should build a PersistentVolumeSource from cinder connection - // information and context from the cluster such as the PVC. - BuildPVSource(conn volumeservice.VolumeConnection, options controller.VolumeOptions) (*v1.PersistentVolumeSource, error) - // AuthSetup should perform any authentication setup such as secret creation - // that would be required before a host can connect to the volume. - AuthSetup(p *cinderProvisioner, options controller.VolumeOptions, conn volumeservice.VolumeConnection) error - // AuthTeardown should perform any necessary cleanup related to authentication - // as the volume is being deleted. - AuthTeardown(p *cinderProvisioner, pv *v1.PersistentVolume) error -} - -func newVolumeMapperFromConnection(conn volumeservice.VolumeConnection) (volumeMapper, error) { - switch conn.DriverVolumeType { - default: - msg := fmt.Sprintf("Unsupported persistent volume type: %s", conn.DriverVolumeType) - return nil, errors.New(msg) - case iscsiType: - return &iscsiMapper{cb: &k8sClusterBroker{}}, nil - case rbdType: - return new(rbdMapper), nil - } -} - -func newVolumeMapperFromPV(pv *v1.PersistentVolume) (volumeMapper, error) { - if pv.Spec.ISCSI != nil { - return &iscsiMapper{cb: &k8sClusterBroker{}}, nil - } else if pv.Spec.RBD != nil { - return new(rbdMapper), nil - } else { - return nil, errors.New("Unsupported persistent volume source") - } -} - -func buildPV(m volumeMapper, p *cinderProvisioner, options controller.VolumeOptions, conn volumeservice.VolumeConnection, volumeID string) (*v1.PersistentVolume, error) { - pvSource, err := m.BuildPVSource(conn, options) - if err != nil { - glog.Errorf("Failed to build PV Source element: %v", err) - return nil, err - } - - pv := &v1.PersistentVolume{ - ObjectMeta: metav1.ObjectMeta{ - Name: options.PVName, - Namespace: options.PVC.Namespace, - Annotations: map[string]string{ - ProvisionerIDAnn: p.Identity, - CinderVolumeID: volumeID, - }, - }, - 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: *pvSource, - }, - } - return pv, nil -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/mapper_test.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/mapper_test.go deleted file mode 100644 index a22e7f6099..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/mapper_test.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" -) - -var _ = Describe("Mapper", func() { - Describe("creating a volume mapper from cinder connection information", func() { - var ( - conn volumeservice.VolumeConnection - mapper volumeMapper - err error - ) - - JustBeforeEach(func() { - mapper, err = newVolumeMapperFromConnection(conn) - }) - - Context("when the connection type is iscsi", func() { - BeforeEach(func() { - conn = volumeservice.VolumeConnection{ - DriverVolumeType: iscsiType, - } - }) - - It("should yield an iscsiMapper", func() { - Expect(mapper).Should(BeAssignableToTypeOf(&iscsiMapper{})) - }) - }) - - Context("when the connection type is rbd", func() { - BeforeEach(func() { - conn = volumeservice.VolumeConnection{ - DriverVolumeType: rbdType, - } - }) - - It("should yield an rbdMapper", func() { - Expect(mapper).Should(BeAssignableToTypeOf(&rbdMapper{})) - }) - }) - - Context("when the connection type is not supported", func() { - BeforeEach(func() { - conn = volumeservice.VolumeConnection{ - DriverVolumeType: "Unsupported", - } - }) - - It("should yield nil", func() { - Expect(mapper).Should(BeNil()) - }) - - It("should produce an error", func() { - Expect(err).Should(Not(BeNil())) - }) - }) - }) - - Describe("creating a volume mapper from a PV", func() { - var ( - pv v1.PersistentVolume - source v1.PersistentVolumeSource - mapper volumeMapper - err error - ) - - BeforeEach(func() { - pv = v1.PersistentVolume{ - Spec: v1.PersistentVolumeSpec{}, - } - }) - - JustBeforeEach(func() { - pv.Spec.PersistentVolumeSource = source - mapper, err = newVolumeMapperFromPV(&pv) - }) - - Context("with an ISCSI PV", func() { - BeforeEach(func() { - source = v1.PersistentVolumeSource{ - ISCSI: &v1.ISCSIPersistentVolumeSource{}, - } - }) - - It("should yield an iscsiMapper", func() { - Expect(mapper).Should(BeAssignableToTypeOf(&iscsiMapper{})) - }) - }) - - Context("with an RBD PV", func() { - BeforeEach(func() { - source = v1.PersistentVolumeSource{ - RBD: &v1.RBDPersistentVolumeSource{}, - } - }) - - It("should yield an iscsiMapper", func() { - Expect(mapper).Should(BeAssignableToTypeOf(&rbdMapper{})) - }) - }) - - Context("with an unsupported persistent volume source", func() { - BeforeEach(func() { - source = v1.PersistentVolumeSource{} - }) - - It("should yield nil", func() { - Expect(mapper).Should(BeNil()) - }) - - It("should produce an error", func() { - Expect(err).Should(Not(BeNil())) - }) - }) - }) - - Describe("Building a persistent volume", func() { - var ( - mapper *fakeMapper - pv *v1.PersistentVolume - err error - ) - p := createCinderProvisioner() - options := createVolumeOptions() - conn := volumeservice.VolumeConnection{} - volumeID := "volumeid" - - BeforeEach(func() { - mapper = &fakeMapper{} - }) - - JustBeforeEach(func() { - pv, err = buildPV(mapper, p, options, conn, volumeID) - }) - - Context("when building the PV source fails", func() { - BeforeEach(func() { - mapper.failBuildPVSource = true - }) - It("should also fail", func() { - Expect(pv).To(BeNil()) - Expect(err).To(Not(BeNil())) - }) - }) - - It("should yield a valid PV associated with this provisioner", func() { - annotations := map[string]string{ - ProvisionerIDAnn: "identity", - CinderVolumeID: "volumeid", - } - accessModes := []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce} - quantity, parseErr := resource.ParseQuantity("1Gi") - Expect(parseErr).To(BeNil()) - capacity := v1.ResourceList{ - v1.ResourceStorage: quantity, - } - - Expect(pv).To(Not(BeNil())) - Expect(err).To(BeNil()) - Expect(pv.Name).To(Equal("testpv")) - Expect(pv.Namespace).To(Equal("testns")) - Expect(pv.Annotations).To(Equal(annotations)) - Expect(pv.Spec.PersistentVolumeReclaimPolicy).To(Equal(v1.PersistentVolumeReclaimDelete)) - Expect(pv.Spec.AccessModes).To(Equal(accessModes)) - Expect(pv.Spec.Capacity).To(Equal(capacity)) - Expect(pv.Spec.PersistentVolumeSource).To(Not(BeNil())) - }) - }) -}) diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/mapperbroker.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/mapperbroker.go deleted file mode 100644 index 0a2551700c..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/mapperbroker.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "github.com/kubernetes-incubator/external-storage/lib/controller" - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice" - "k8s.io/api/core/v1" -) - -type mapperBroker interface { - newVolumeMapperFromConnection(conn volumeservice.VolumeConnection) (volumeMapper, error) - newVolumeMapperFromPV(pv *v1.PersistentVolume) (volumeMapper, error) - buildPV(m volumeMapper, p *cinderProvisioner, options controller.VolumeOptions, conn volumeservice.VolumeConnection, volumeID string) (*v1.PersistentVolume, error) -} - -type volumeMapperBroker struct { - mapperBroker -} - -func (mb *volumeMapperBroker) newVolumeMapperFromConnection(conn volumeservice.VolumeConnection) (volumeMapper, error) { - return newVolumeMapperFromConnection(conn) -} - -func (mb *volumeMapperBroker) newVolumeMapperFromPV(pv *v1.PersistentVolume) (volumeMapper, error) { - return newVolumeMapperFromPV(pv) -} - -func (mb *volumeMapperBroker) buildPV(m volumeMapper, p *cinderProvisioner, options controller.VolumeOptions, conn volumeservice.VolumeConnection, volumeID string) (*v1.PersistentVolume, error) { - return buildPV(m, p, options, conn, volumeID) -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/provisioner.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/provisioner.go deleted file mode 100644 index 3913646860..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/provisioner.go +++ /dev/null @@ -1,241 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "errors" - "fmt" - "strings" - - "github.com/golang/glog" - "github.com/gophercloud/gophercloud" - "github.com/kubernetes-incubator/external-storage/lib/controller" - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice" - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/uuid" - "k8s.io/client-go/kubernetes" - - volumes_v2 "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes" -) - -const ( - // ProvisionerName is the unique name of this provisioner - ProvisionerName = "openstack.org/standalone-cinder" - - // ProvisionerIDAnn is an annotation to identify a particular instance of this provisioner - ProvisionerIDAnn = "standaloneCinderProvisionerIdentity" - - // CinderVolumeID is an annotation to store the ID of the associated cinder volume - CinderVolumeID = "cinderVolumeId" -) - -type cinderProvisioner struct { - // Openstack cinder client - VolumeService *gophercloud.ServiceClient - - // Kubernetes Client. Use to create secret - Client kubernetes.Interface - // Identity of this cinderProvisioner, generated. Used to identify "this" - // provisioner's PVs. - Identity string - - vsb volumeServiceBroker - mb mapperBroker -} - -// NewCinderProvisioner returns a Provisioner that creates volumes using a -// standalone cinder instance and produces PersistentVolumes that use native -// kubernetes PersistentVolumeSources. -func NewCinderProvisioner(client kubernetes.Interface, id, configFilePath string) (controller.Provisioner, error) { - volumeService, err := volumeservice.GetVolumeService(configFilePath) - if err != nil { - return nil, fmt.Errorf("failed to get volume service: %v", err) - } - - return &cinderProvisioner{ - VolumeService: volumeService, - Client: client, - Identity: id, - vsb: &gophercloudBroker{}, - mb: &volumeMapperBroker{}, - }, nil -} - -func getCreateOptions(options controller.VolumeOptions) (volumes_v2.CreateOpts, error) { - name := fmt.Sprintf("cinder-dynamic-pvc-%s", uuid.NewUUID()) - capacity := options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] - sizeBytes := capacity.Value() - // Cinder works with gigabytes, convert to GiB with rounding up - sizeGB := int((sizeBytes + 1024*1024*1024 - 1) / (1024 * 1024 * 1024)) - volType := "" - availability := "nova" - // Apply ProvisionerParameters (case-insensitive). We leave validation of - // the values to the cloud provider. - for k, v := range options.Parameters { - switch strings.ToLower(k) { - case "type": - volType = v - case "availability": - availability = v - default: - return volumes_v2.CreateOpts{}, fmt.Errorf("invalid option %q", k) - } - } - - return volumes_v2.CreateOpts{ - Name: name, - Size: sizeGB, - VolumeType: volType, - AvailabilityZone: availability, - }, nil -} - -// Provision creates a storage asset and returns a PV object representing it. -func (p *cinderProvisioner) Provision(options controller.VolumeOptions) (*v1.PersistentVolume, error) { - var ( - volumeID string - connection volumeservice.VolumeConnection - mapper volumeMapper - pv *v1.PersistentVolume - cleanupErr error - ) - - if options.PVC.Spec.Selector != nil { - return nil, fmt.Errorf("claim Selector is not supported") - } - - // TODO: Check access mode - createOptions, err := getCreateOptions(options) - if err != nil { - glog.Error(err) - goto ERROR - } - volumeID, err = p.vsb.createCinderVolume(p.VolumeService, createOptions) - if err != nil { - glog.Errorf("Failed to create volume") - goto ERROR - } - - err = p.vsb.waitForAvailableCinderVolume(p.VolumeService, volumeID) - if err != nil { - glog.Errorf("Volume %s did not become available", volumeID) - goto ERROR_DELETE - } - - err = p.vsb.reserveCinderVolume(p.VolumeService, volumeID) - if err != nil { - glog.Errorf("Failed to reserve volume %s: %v", volumeID, err) - goto ERROR_DELETE - } - - connection, err = p.vsb.connectCinderVolume(p.VolumeService, volumeID) - if err != nil { - glog.Errorf("Failed to connect volume %s: %v", volumeID, err) - goto ERROR_UNRESERVE - } - - mapper, err = p.mb.newVolumeMapperFromConnection(connection) - if err != nil { - glog.Errorf("Unable to create volume mapper: %v", err) - goto ERROR_DISCONNECT - } - - err = mapper.AuthSetup(p, options, connection) - if err != nil { - glog.Errorf("Failed to prepare volume auth: %v", err) - goto ERROR_DISCONNECT - } - - pv, err = p.mb.buildPV(mapper, p, options, connection, volumeID) - if err != nil { - glog.Errorf("Failed to build PV: %v", err) - goto ERROR_DISCONNECT - } - return pv, nil - -ERROR_DISCONNECT: - cleanupErr = p.vsb.disconnectCinderVolume(p.VolumeService, volumeID) - if cleanupErr != nil { - glog.Errorf("Failed to disconnect volume %s: %v", volumeID, cleanupErr) - } - glog.V(3).Infof("Volume %s disconnected", volumeID) -ERROR_UNRESERVE: - cleanupErr = p.vsb.unreserveCinderVolume(p.VolumeService, volumeID) - if cleanupErr != nil { - glog.Errorf("Failed to unreserve volume %s: %v", volumeID, cleanupErr) - } - glog.V(3).Infof("Volume %s unreserved", volumeID) -ERROR_DELETE: - cleanupErr = p.vsb.deleteCinderVolume(p.VolumeService, volumeID) - if cleanupErr != nil { - glog.Errorf("Failed to delete volume %s: %v", volumeID, cleanupErr) - } - glog.V(3).Infof("Volume %s deleted", volumeID) -ERROR: - return nil, err // Return the original error -} - -// Delete removes the storage asset that was created by Provision represented -// by the given PV. -func (p *cinderProvisioner) Delete(pv *v1.PersistentVolume) error { - ann, ok := pv.Annotations[ProvisionerIDAnn] - if !ok { - return errors.New("identity annotation not found on PV") - } - if ann != p.Identity { - return &controller.IgnoredError{ - Reason: "identity annotation on PV does not match ours", - } - } - // TODO when beta is removed, have to check kube version and pick v1/beta - // accordingly: maybe the controller lib should offer a function for that - - volumeID, ok := pv.Annotations[CinderVolumeID] - if !ok { - return errors.New(CinderVolumeID + " annotation not found on PV") - } - - mapper, err := p.mb.newVolumeMapperFromPV(pv) - if err != nil { - glog.Errorf("Failed to instantiate mapper: %s", err) - return err - } - - mapper.AuthTeardown(p, pv) - - err = p.vsb.disconnectCinderVolume(p.VolumeService, volumeID) - if err != nil { - glog.Errorf("Failed to disconnect volume %s: %v", volumeID, err) - return err - } - - err = p.vsb.unreserveCinderVolume(p.VolumeService, volumeID) - if err != nil { - // TODO: Create placeholder PV? - glog.Errorf("Failed to unreserve volume %s: %v", volumeID, err) - return err - } - - err = p.vsb.deleteCinderVolume(p.VolumeService, volumeID) - if err != nil { - glog.Errorf("Failed to delete volume %s: %v", volumeID, err) - return err - } - - glog.V(2).Infof("Successfully deleted cinder volume %s", volumeID) - return nil -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/provisioner_suite_test.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/provisioner_suite_test.go deleted file mode 100644 index 2d301db858..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/provisioner_suite_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestProvisioner(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Provisioner Suite") -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/provisioner_test.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/provisioner_test.go deleted file mode 100644 index 41967fe31e..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/provisioner_test.go +++ /dev/null @@ -1,397 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "bytes" - "errors" - - "github.com/gophercloud/gophercloud" - volumes_v2 "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes" - "github.com/kubernetes-incubator/external-storage/lib/controller" - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var _ = Describe("Provisioner", func() { - Describe("Create volume options parsing", func() { - var ( - err error - options controller.VolumeOptions - createOptions volumes_v2.CreateOpts - ) - BeforeEach(func() { - options = createVolumeOptions() - }) - JustBeforeEach(func() { - createOptions, err = getCreateOptions(options) - }) - - Context("when an unrecognized option is specified in the storage class", func() { - BeforeEach(func() { - options.Parameters = map[string]string{ - "foo": "bar", - } - }) - - It("should fail", func() { - Expect(createOptions).To(Equal(volumes_v2.CreateOpts{})) - Expect(err).ToNot(BeNil()) - }) - }) - - Context("when recognized options are used", func() { - BeforeEach(func() { - options.Parameters = map[string]string{ - "type": "gold", - "availability": "zone", - } - }) - - It("should be reflected in the create options", func() { - Expect(err).To(BeNil()) - Expect(createOptions.AvailabilityZone).To(Equal("zone")) - Expect(createOptions.VolumeType).To(Equal("gold")) - }) - }) - }) - - Describe("A provision operation", func() { - var ( - pv *v1.PersistentVolume - p *cinderProvisioner - vsb *fakeVolumeServiceBroker - mb *fakeMapperBroker - options controller.VolumeOptions - cleanup string - err error - ) - - BeforeEach(func() { - vsb = &fakeVolumeServiceBroker{} - mb = newFakeMapperBroker() - p = createCinderProvisioner() - p.vsb = vsb - p.mb = mb - options = createVolumeOptions() - }) - - JustBeforeEach(func() { - pv, err = p.Provision(options) - }) - - It("should return a persistent volume", func() { - Expect(pv).To(Not(BeNil())) - Expect(err).To(BeNil()) - }) - - Context("when a claim selector is specified", func() { - BeforeEach(func() { - options.PVC.Spec.Selector = &metav1.LabelSelector{} - }) - - It("should fail", func() { - Expect(pv).To(BeNil()) - Expect(err).To(Not(BeNil())) - }) - }) - - Context("when an unrecognized option is specified in the storage class", func() { - BeforeEach(func() { - options.Parameters = map[string]string{ - "foo": "bar", - } - }) - - It("should fail", func() { - Expect(pv).To(BeNil()) - Expect(err).To(Not(BeNil())) - }) - }) - - Context("when creating a volume fails", func() { - BeforeEach(func() { - vsb.mightFail.set("createCinderVolume") - }) - It("should fail", func() { - Expect(pv).To(BeNil()) - Expect(err).To(Not(BeNil())) - }) - }) - - Context("when the volume does not become available", func() { - BeforeEach(func() { - vsb.mightFail.set("waitForAvailableCinderVolume") - cleanup = "deleteCinderVolume." - }) - It("should fail and delete the volume", func() { - Expect(pv).To(BeNil()) - Expect(err).To(Not(BeNil())) - Expect(vsb.cleanupLog.String()).To(Equal(cleanup)) - }) - }) - - Context("when reserving the volume fails", func() { - BeforeEach(func() { - vsb.mightFail.set("reserveCinderVolume") - cleanup = "deleteCinderVolume." - }) - It("should fail and delete the volume", func() { - Expect(pv).To(BeNil()) - Expect(err).To(Not(BeNil())) - Expect(vsb.cleanupLog.String()).To(Equal(cleanup)) - }) - }) - - Context("when connecting the volume fails", func() { - BeforeEach(func() { - vsb.mightFail.set("connectCinderVolume") - cleanup = "unreserveCinderVolume.deleteCinderVolume." - }) - It("should fail and the volume should be unreserved and deleted", func() { - Expect(pv).To(BeNil()) - Expect(err).To(Not(BeNil())) - Expect(vsb.cleanupLog.String()).To(Equal(cleanup)) - }) - }) - - Context("when getting a volumeMapper fails", func() { - BeforeEach(func() { - mb.mightFail.set("newVolumeMapperFromConnection") - cleanup = "disconnectCinderVolume.unreserveCinderVolume.deleteCinderVolume." - }) - It("should fail and the volume should be disconnected, unreserved and deleted", func() { - Expect(pv).To(BeNil()) - Expect(err).To(Not(BeNil())) - Expect(vsb.cleanupLog.String()).To(Equal(cleanup)) - }) - }) - - Context("when preparing volume authentication fails", func() { - BeforeEach(func() { - mb.FakeVolumeMapper.mightFail.set("AuthSetup") - cleanup = "disconnectCinderVolume.unreserveCinderVolume.deleteCinderVolume." - }) - It("should fail and the volume should be disconnected, unreserved and deleted", func() { - Expect(pv).To(BeNil()) - Expect(err).To(Not(BeNil())) - Expect(vsb.cleanupLog.String()).To(Equal(cleanup)) - }) - }) - - Context("when building the PV fails", func() { - BeforeEach(func() { - mb.mightFail.set("buildPV") - cleanup = "disconnectCinderVolume.unreserveCinderVolume.deleteCinderVolume." - }) - It("should fail and the volume should be disconnected, unreserved and deleted", func() { - Expect(pv).To(BeNil()) - Expect(err).To(Not(BeNil())) - Expect(vsb.cleanupLog.String()).To(Equal(cleanup)) - }) - }) - }) - - Describe("A delete operation", func() { - var ( - err error - vsb *fakeVolumeServiceBroker - mb *fakeMapperBroker - p *cinderProvisioner - pv *v1.PersistentVolume - ) - - BeforeEach(func() { - vsb = &fakeVolumeServiceBroker{} - mb = newFakeMapperBroker() - p = createCinderProvisioner() - p.vsb = vsb - p.mb = mb - pv = createPersistentVolume() - }) - - JustBeforeEach(func() { - err = p.Delete(pv) - }) - - It("should complete successfully", func() { - Expect(err).To(BeNil()) - }) - - Context("when the provisioner ID annotation is missing from the PV", func() { - BeforeEach(func() { - delete(pv.Annotations, ProvisionerIDAnn) - }) - - It("should fail", func() { - Expect(err).To(Not(BeNil())) - }) - }) - - Context("when the provisioner ID annotation does not match our provisioner", func() { - BeforeEach(func() { - pv.Annotations[ProvisionerIDAnn] = "a different provisioner" - }) - - It("should fail with an IgnoredError", func() { - Expect(err).To(Not(BeNil())) - Expect(err).To(BeAssignableToTypeOf(&controller.IgnoredError{})) - }) - }) - - Context("when the cinder volume ID annotation is missing from the PV", func() { - BeforeEach(func() { - delete(pv.Annotations, CinderVolumeID) - }) - - It("should fail", func() { - Expect(err).To(Not(BeNil())) - }) - }) - - Context("when getting a volumeMapper fails", func() { - BeforeEach(func() { - mb.mightFail.set("newVolumeMapperFromPV") - }) - It("should fail", func() { - Expect(err).To(Not(BeNil())) - }) - }) - - Context("when teardown of volume authentication fails", func() { - BeforeEach(func() { - mb.FakeVolumeMapper.mightFail.set("AuthTeardown") - }) - It("should still succeed", func() { - Expect(err).To(BeNil()) - }) - }) - - Context("when disconnecting the volume fails", func() { - BeforeEach(func() { - vsb.mightFail.set("disconnectCinderVolume") - }) - It("should fail", func() { - Expect(err).To(Not(BeNil())) - }) - }) - - Context("when unreserving the volume fails", func() { - BeforeEach(func() { - vsb.mightFail.set("unreserveCinderVolume") - }) - It("should fail", func() { - Expect(err).To(Not(BeNil())) - }) - }) - - Context("when deleting the volume fails", func() { - BeforeEach(func() { - vsb.mightFail.set("deleteCinderVolume") - }) - It("should fail", func() { - Expect(err).To(Not(BeNil())) - }) - }) - }) -}) - -type fakeVolumeServiceBroker struct { - cleanupLog bytes.Buffer - mightFail failureInjector - volumeServiceBroker -} - -func (vsb *fakeVolumeServiceBroker) createCinderVolume(vs *gophercloud.ServiceClient, options volumes_v2.CreateOpts) (string, error) { - if vsb.mightFail.isSet("createCinderVolume") { - return "", errors.New("injected error for testing") - } - return "cinderVolumeID", nil -} - -func (vsb *fakeVolumeServiceBroker) waitForAvailableCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return vsb.mightFail.ret("waitForAvailableCinderVolume") -} - -func (vsb *fakeVolumeServiceBroker) reserveCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return vsb.mightFail.ret("reserveCinderVolume") -} - -func (vsb *fakeVolumeServiceBroker) connectCinderVolume(vs *gophercloud.ServiceClient, volumeID string) (volumeservice.VolumeConnection, error) { - if vsb.mightFail.isSet("connectCinderVolume") { - return volumeservice.VolumeConnection{}, errors.New("injected error for testing") - } - return volumeservice.VolumeConnection{}, nil -} - -func (vsb *fakeVolumeServiceBroker) _cleanupRet(fn string) error { - if vsb.mightFail.isSet(fn) { - return errors.New("injected error for testing") - } - vsb.cleanupLog.WriteString(fn) - vsb.cleanupLog.WriteString(".") - return nil -} - -func (vsb *fakeVolumeServiceBroker) disconnectCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return vsb._cleanupRet("disconnectCinderVolume") -} - -func (vsb *fakeVolumeServiceBroker) unreserveCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return vsb._cleanupRet("unreserveCinderVolume") -} - -func (vsb *fakeVolumeServiceBroker) deleteCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return vsb._cleanupRet("deleteCinderVolume") -} - -type fakeMapperBroker struct { - mightFail failureInjector - FakeVolumeMapper *fakeMapper - - mapperBroker -} - -func newFakeMapperBroker() *fakeMapperBroker { - ret := fakeMapperBroker{} - ret.FakeVolumeMapper = &fakeMapper{} - return &ret -} - -func (mb *fakeMapperBroker) newVolumeMapperFromConnection(conn volumeservice.VolumeConnection) (volumeMapper, error) { - if mb.mightFail.isSet("newVolumeMapperFromConnection") { - return nil, errors.New("injected error for testing") - } - return mb.FakeVolumeMapper, nil -} - -func (mb *fakeMapperBroker) newVolumeMapperFromPV(pv *v1.PersistentVolume) (volumeMapper, error) { - if mb.mightFail.isSet("newVolumeMapperFromPV") { - return nil, errors.New("injected error for testing") - } - return mb.FakeVolumeMapper, nil -} - -func (mb *fakeMapperBroker) buildPV(m volumeMapper, p *cinderProvisioner, options controller.VolumeOptions, conn volumeservice.VolumeConnection, volumeID string) (*v1.PersistentVolume, error) { - if mb.mightFail.isSet("buildPV") { - return nil, errors.New("injected error for testing") - } - return &v1.PersistentVolume{}, nil -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/rbd.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/rbd.go deleted file mode 100644 index aed9bbc77f..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/rbd.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "errors" - "fmt" - "strings" - - "github.com/golang/glog" - "github.com/kubernetes-incubator/external-storage/lib/controller" - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice" - - "k8s.io/api/core/v1" - "k8s.io/kubernetes/pkg/apis/core/v1/helper" -) - -const rbdType = "rbd" - -type rbdMapper struct { - volumeMapper -} - -func getMonitors(conn volumeservice.VolumeConnection) []string { - if len(conn.Data.Hosts) != len(conn.Data.Ports) { - glog.Errorf("Error parsing rbd connection info: 'hosts' and 'ports' have different lengths") - return nil - } - mons := make([]string, len(conn.Data.Hosts)) - for i := range conn.Data.Hosts { - mons[i] = fmt.Sprintf("%s:%s", conn.Data.Hosts[i], conn.Data.Ports[i]) - } - return mons -} - -func getRbdSecretName(pvc *v1.PersistentVolumeClaim) string { - return fmt.Sprintf("%s-cephx-secret", helper.GetPersistentVolumeClaimClass(pvc)) -} - -func (m *rbdMapper) BuildPVSource(conn volumeservice.VolumeConnection, options controller.VolumeOptions) (*v1.PersistentVolumeSource, error) { - mons := getMonitors(conn) - if mons == nil { - return nil, errors.New("No monitors could be parsed from connection info") - } - splitName := strings.SplitN(conn.Data.Name, "/", 2) - if len(splitName) != 2 { - return nil, errors.New("Field 'name' cannot be split into pool and image") - } - - return &v1.PersistentVolumeSource{ - RBD: &v1.RBDPersistentVolumeSource{ - CephMonitors: mons, - RBDPool: splitName[0], - RBDImage: splitName[1], - RadosUser: conn.Data.AuthUsername, - SecretRef: &v1.SecretReference{ - Name: getRbdSecretName(options.PVC), - }, - }, - }, nil -} - -func (m *rbdMapper) AuthSetup(p *cinderProvisioner, options controller.VolumeOptions, conn volumeservice.VolumeConnection) error { - return nil -} - -func (m *rbdMapper) AuthTeardown(p *cinderProvisioner, pv *v1.PersistentVolume) error { - return nil -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/rbd_test.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/rbd_test.go deleted file mode 100644 index 12301ed46a..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/rbd_test.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "github.com/kubernetes-incubator/external-storage/lib/controller" - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/api/core/v1" -) - -var _ = Describe("Rbd Mapper", func() { - Describe("Parsing ceph monitor information", func() { - var ( - conn volumeservice.VolumeConnection - monitors []string - ) - - BeforeEach(func() { - conn = createIscsiConnectionInfo() - }) - - JustBeforeEach(func() { - monitors = getMonitors(conn) - }) - - Context("when no monitors are given", func() { - It("should return an empty list", func() { - Expect(monitors).To(BeEmpty()) - }) - }) - - Context("when the number of hosts and ports are not equal", func() { - BeforeEach(func() { - conn.Data.Hosts = []string{"hostA"} - conn.Data.Ports = []string{"1", "2"} - }) - - It("should return nil", func() { - Expect(monitors).To(BeNil()) - }) - }) - - Context("when the lists are of equal length", func() { - BeforeEach(func() { - conn.Data.Hosts = []string{"hostA", "hostB"} - conn.Data.Ports = []string{"1", "2"} - }) - - It("should merge them into a single list", func() { - expected := []string{"hostA:1", "hostB:2"} - Expect(monitors).To(Equal(expected)) - }) - }) - }) - - Describe("the persistent volume source", func() { - var ( - mapper rbdMapper - conn volumeservice.VolumeConnection - options controller.VolumeOptions - source *v1.PersistentVolumeSource - err error - ) - - BeforeEach(func() { - conn = createRbdConnectionInfo() - options = createVolumeOptions() - mapper = rbdMapper{} - }) - - JustBeforeEach(func() { - source, err = mapper.BuildPVSource(conn, options) - }) - - Context("when the connection information is valid", func() { - BeforeEach(func() { - conn.Data.Hosts = []string{"hostA", "hostB"} - conn.Data.Ports = []string{"1", "2"} - conn.Data.Name = "pool/image" - }) - - It("should be populated with the RBD connection info", func() { - expectedMonitors := []string{"hostA:1", "hostB:2"} - Expect(source.RBD.CephMonitors).To(Equal(expectedMonitors)) - Expect(source.RBD.RBDPool).To(Equal("pool")) - Expect(source.RBD.RBDImage).To(Equal("image")) - Expect(source.RBD.RadosUser).To(Equal("admin")) - Expect(source.RBD.SecretRef.Name).To(Equal("storageclass-cephx-secret")) - }) - }) - - Context("when the connection field 'name' cannot be split into pool and image", func() { - BeforeEach(func() { - conn.Data.Name = "has-no-slash" - }) - - It("should be nil", func() { - Expect(source).To(BeNil()) - }) - }) - - Context("when no monitors can be parsed", func() { - BeforeEach(func() { - conn.Data.Hosts = []string{"hostA", "hostB"} - conn.Data.Ports = []string{"1"} - }) - - It("should be nil", func() { - Expect(source).To(BeNil()) - }) - }) - - Context("When the connection field 'name' contains an extra '/'", func() { - BeforeEach(func() { - conn.Data.Name = "pool/image/foo" - }) - - It("should have an image field containing a '/'", func() { - Expect(source.RBD.RBDImage).To(Equal("image/foo")) - }) - }) - }) - - Describe("Authorization", func() { - var ( - mapper rbdMapper - err error - ) - - Context("when called to setup", func() { - It("should do nothing and always succeed", func() { - err = mapper.AuthSetup(&cinderProvisioner{}, controller.VolumeOptions{}, - volumeservice.VolumeConnection{}) - Expect(err).To(BeNil()) - }) - }) - - Context("when called to tear down", func() { - It("should do nothing and always succeed", func() { - err = mapper.AuthTeardown(&cinderProvisioner{}, &v1.PersistentVolume{}) - Expect(err).To(BeNil()) - }) - }) - }) -}) - -func createRbdConnectionInfo() volumeservice.VolumeConnection { - return volumeservice.VolumeConnection{ - DriverVolumeType: rbdType, - Data: volumeservice.VolumeConnectionDetails{ - AuthUsername: "admin", - }, - } -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/testutils_test.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/testutils_test.go deleted file mode 100644 index 7bb91ffc4a..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/testutils_test.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "errors" - "github.com/golang/glog" - "github.com/kubernetes-incubator/external-storage/lib/controller" - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice" - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func createVolumeOptions() controller.VolumeOptions { - var storageClass = "storageclass" - - capacity, err := resource.ParseQuantity("1Gi") - if err != nil { - glog.Error("Programmer error, cannot parse quantity string") - return controller.VolumeOptions{} - } - - return controller.VolumeOptions{ - PVName: "testpv", - PVC: &v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "testns", - }, - Spec: v1.PersistentVolumeClaimSpec{ - StorageClassName: &storageClass, - AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceName(v1.ResourceStorage): capacity, - }, - }, - }, - }, - PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, - } -} - -func createPersistentVolume() *v1.PersistentVolume { - return &v1.PersistentVolume{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - ProvisionerIDAnn: "identity", - CinderVolumeID: "cinderVolumeID", - }, - }, - Spec: v1.PersistentVolumeSpec{ - PersistentVolumeSource: v1.PersistentVolumeSource{}, - ClaimRef: &v1.ObjectReference{ - Namespace: "testNs", - }, - }, - } -} - -func createCinderProvisioner() *cinderProvisioner { - return &cinderProvisioner{ - Identity: "identity", - } -} - -type failureInjector struct { - failOn map[string]bool -} - -func (vsb *failureInjector) set(method string) { - if vsb.failOn == nil { - vsb.failOn = make(map[string]bool) - } - vsb.failOn[method] = true -} - -func (vsb *failureInjector) isSet(method string) bool { - if vsb.failOn == nil { - return false - } - value, ok := vsb.failOn[method] - if !ok { - return false - } - return value -} - -func (vsb *failureInjector) ret(method string) error { - if vsb.isSet(method) { - return errors.New("injected error for testing") - } - return nil -} - -type fakeMapper struct { - mightFail failureInjector - volumeMapper - failBuildPVSource bool -} - -func (m *fakeMapper) BuildPVSource(conn volumeservice.VolumeConnection, options controller.VolumeOptions) (*v1.PersistentVolumeSource, error) { - if m.failBuildPVSource { - return nil, errors.New("Injected error for testing") - } - return &v1.PersistentVolumeSource{}, nil -} - -func (m *fakeMapper) AuthSetup(p *cinderProvisioner, options controller.VolumeOptions, conn volumeservice.VolumeConnection) error { - return m.mightFail.ret("AuthSetup") -} - -func (m *fakeMapper) AuthTeardown(p *cinderProvisioner, pv *v1.PersistentVolume) error { - return m.mightFail.ret("AuthTeardown") -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/vsbroker.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/vsbroker.go deleted file mode 100644 index bdb63fcb0b..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/provisioner/vsbroker.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package provisioner - -import ( - "github.com/gophercloud/gophercloud" - volumes_v2 "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes" - "github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice" -) - -// volumeServiceBroker provides a mechanism for tests to override calls to cinder with mocks. -type volumeServiceBroker interface { - createCinderVolume(vs *gophercloud.ServiceClient, options volumes_v2.CreateOpts) (string, error) - waitForAvailableCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error - reserveCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error - connectCinderVolume(vs *gophercloud.ServiceClient, volumeID string) (volumeservice.VolumeConnection, error) - disconnectCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error - unreserveCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error - deleteCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error - getCinderVolumeStatus(vs *gophercloud.ServiceClient, volumeID string) (string, error) -} - -type gophercloudBroker struct { - volumeServiceBroker -} - -func (vsb *gophercloudBroker) createCinderVolume(vs *gophercloud.ServiceClient, options volumes_v2.CreateOpts) (string, error) { - return volumeservice.CreateCinderVolume(vs, options) -} - -func (vsb *gophercloudBroker) waitForAvailableCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return volumeservice.WaitForAvailableCinderVolume(vs, volumeID) -} - -func (vsb *gophercloudBroker) reserveCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return volumeservice.ReserveCinderVolume(vs, volumeID) -} - -func (vsb *gophercloudBroker) connectCinderVolume(vs *gophercloud.ServiceClient, volumeID string) (volumeservice.VolumeConnection, error) { - return volumeservice.ConnectCinderVolume(vs, volumeID) -} - -func (vsb *gophercloudBroker) disconnectCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return volumeservice.DisconnectCinderVolume(vs, volumeID) -} - -func (vsb *gophercloudBroker) unreserveCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return volumeservice.UnreserveCinderVolume(vs, volumeID) -} - -func (vsb *gophercloudBroker) deleteCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return volumeservice.DeleteCinderVolume(vs, volumeID) -} - -func (vsb *gophercloudBroker) getCinderVolumeStatus(vs *gophercloud.ServiceClient, volumeID string) (string, error) { - return volumeservice.GetCinderVolumeStatus(vs, volumeID) -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/actions.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/actions.go deleted file mode 100644 index 67fe3dfbbf..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/actions.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package volumeservice - -import ( - "strings" - "time" - - "github.com/golang/glog" - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/volumeactions" - volumes_v2 "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes" - "k8s.io/apimachinery/pkg/util/wait" -) - -const initiatorName = "iqn.1994-05.com.redhat:a13fc3d1cc22" -const interval = 3 * time.Second -const timeout = 60 * time.Second - -// VolumeConnectionDetails represent the type-specific values for a given -// DriverVolumeType. Depending on the volume type, fields may be absent or -// have a semantically different meaning. -type VolumeConnectionDetails struct { - VolumeID string `json:"volume_id"` - Name string `json:"name"` - - AuthMethod string `json:"auth_method"` - AuthUsername string `json:"auth_username"` - AuthPassword string `json:"auth_password"` - SecretType string `json:"secret_type"` - - TargetPortal string `json:"target_portal"` - TargetIqn string `json:"target_iqn"` - TargetLun int32 `json:"target_lun"` - - ClusterName string `json:"cluster_name"` - Hosts []string `json:"hosts"` - Ports []string `json:"ports"` -} - -// VolumeConnection represents the connection information returned from the -// cinder os-initialize_connection API call -type VolumeConnection struct { - DriverVolumeType string `json:"driver_volume_type"` - Data VolumeConnectionDetails `json:"data"` -} - -type rcvVolumeConnection struct { - ConnectionInfo VolumeConnection `json:"connection_info"` -} - -// CreateCinderVolume creates a new volume in cinder according to the PVC specifications -func CreateCinderVolume(vs *gophercloud.ServiceClient, options volumes_v2.CreateOpts) (string, error) { - vol, err := volumes_v2.Create(vs, &options).Extract() - - if err != nil { - glog.Errorf("Failed to create a %d GiB volume: %v", options.Size, err) - return "", err - } - - glog.V(2).Infof("Created volume %v in Availability Zone: %v", vol.ID, vol.AvailabilityZone) - return vol.ID, nil -} - -// WaitForAvailableCinderVolume waits for a newly created cinder volume to -// become available. The connection information cannot be retrieved from cinder -// until the volume is available. -func WaitForAvailableCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return wait.Poll(interval, timeout, func() (bool, error) { - status, err := GetCinderVolumeStatus(vs, volumeID) - return strings.ToLower(status) == "available", err - }) -} - -// ReserveCinderVolume marks the volume as 'Attaching' in cinder. This prevents -// the volume from being used for another purpose. -func ReserveCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return volumeactions.Reserve(vs, volumeID).ExtractErr() -} - -// ConnectCinderVolume retrieves connection information for a cinder volume. -// Depending on the type of volume, cinder may perform setup on a storage server -// such as mapping a LUN to a particular ISCSI initiator. -func ConnectCinderVolume(vs *gophercloud.ServiceClient, volumeID string) (VolumeConnection, error) { - opt := volumeactions.InitializeConnectionOpts{ - Host: "localhost", - IP: "127.0.0.1", - Initiator: initiatorName, - } - var rcv rcvVolumeConnection - err := volumeactions.InitializeConnection(vs, volumeID, &opt).ExtractInto(&rcv) - if err != nil { - glog.Errorf("failed to initialize connection :%v", err) - return VolumeConnection{}, err - } - glog.V(3).Infof("Received connection info: %v", rcv) - return rcv.ConnectionInfo, nil -} - -// DisconnectCinderVolume removes a connection to a cinder volume. Depending on -// the volume type, this may cause cinder to clean up the connection at a -// storage server (i.e. remove a LUN mapping). -func DisconnectCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - opt := volumeactions.TerminateConnectionOpts{ - Host: "localhost", - IP: "127.0.0.1", - Initiator: initiatorName, - } - - err := volumeactions.TerminateConnection(vs, volumeID, &opt).Result.Err - if err != nil { - glog.Errorf("Failed to terminate connection to volume %s: %v", - volumeID, err) - return err - } - - return nil -} - -// UnreserveCinderVolume marks a cinder volume in 'Attaching' state as 'Available'. -func UnreserveCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - return volumeactions.Unreserve(vs, volumeID).ExtractErr() -} - -// DeleteCinderVolume removes a volume from cinder which will cause it to be -// deleted on the storage server. -func DeleteCinderVolume(vs *gophercloud.ServiceClient, volumeID string) error { - err := volumes_v2.Delete(vs, volumeID).ExtractErr() - if err != nil { - glog.Errorf("Cannot delete volume %s: %v", volumeID, err) - } - - return err -} - -// GetCinderVolumeStatus get the given cinder volume status. -func GetCinderVolumeStatus(vs *gophercloud.ServiceClient, volumeID string) (string, error) { - volume, err := volumes_v2.Get(vs, volumeID).Extract() - if err != nil { - glog.Errorf("Failed to get volume:%v ", volumeID) - return "", err - } - return volume.Status, nil -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/connection.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/connection.go deleted file mode 100644 index c84ff40d9f..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/connection.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package volumeservice - -import ( - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "net/http" - "os" - - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack" - "github.com/gophercloud/gophercloud/openstack/blockstorage/noauth" - "github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/trusts" - tokens3 "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens" - gcfg "gopkg.in/gcfg.v1" - - "github.com/golang/glog" - netutil "k8s.io/apimachinery/pkg/util/net" - certutil "k8s.io/client-go/util/cert" -) - -type cinderConfig struct { - Global cinderConfigGlobal -} - -type cinderConfigGlobal struct { - CinderEndpoint string `gcfg:"cinder-endpoint"` - AuthURL string `gcfg:"auth-url"` - Username string - UserID string `gcfg:"user-id"` - Password string - TenantID string `gcfg:"tenant-id"` - TenantName string `gcfg:"tenant-name"` - TrustID string `gcfg:"trust-id"` - DomainID string `gcfg:"domain-id"` - DomainName string `gcfg:"domain-name"` - Region string - CAFile string `gcfg:"ca-file"` -} - -func (cfg cinderConfig) toAuthOptions() gophercloud.AuthOptions { - return gophercloud.AuthOptions{ - IdentityEndpoint: cfg.Global.AuthURL, - Username: cfg.Global.Username, - UserID: cfg.Global.UserID, - Password: cfg.Global.Password, - TenantID: cfg.Global.TenantID, - TenantName: cfg.Global.TenantName, - DomainID: cfg.Global.DomainID, - DomainName: cfg.Global.DomainName, - - // Persistent service, so we need to be able to renew tokens. - AllowReauth: true, - } -} - -func (cfg cinderConfig) toAuth3Options() tokens3.AuthOptions { - return tokens3.AuthOptions{ - IdentityEndpoint: cfg.Global.AuthURL, - Username: cfg.Global.Username, - UserID: cfg.Global.UserID, - Password: cfg.Global.Password, - DomainID: cfg.Global.DomainID, - DomainName: cfg.Global.DomainName, - AllowReauth: true, - } -} - -func getConfigFromEnv() cinderConfig { - return cinderConfig{ - Global: cinderConfigGlobal{ - AuthURL: os.Getenv("OS_AUTH_URL"), - CinderEndpoint: os.Getenv("OS_CINDER_ENDPOINT"), - Username: os.Getenv("OS_USERNAME"), - Password: os.Getenv("OS_PASSWORD"), // TODO: Replace with secret - TenantID: os.Getenv("OS_TENANT_ID"), - Region: os.Getenv("OS_REGION_NAME"), - DomainName: os.Getenv("OS_USER_DOMAIN_NAME"), - }, - } -} - -func getConfig(configFilePath string) (cinderConfig, error) { - if configFilePath != "" { - var configFile *os.File - var config cinderConfig - configFile, err := os.Open(configFilePath) - if err != nil { - glog.Errorf("Couldn't open configuration %s: %#v", - configFilePath, err) - return cinderConfig{}, err - } - - defer configFile.Close() - - err = gcfg.ReadInto(&config, configFile) - if err != nil { - glog.Errorf("Couldn't read configuration: %#v", err) - return cinderConfig{}, err - } - return config, nil - } - envConfig := getConfigFromEnv() - if envConfig != (cinderConfig{}) { - return envConfig, nil - } - - // Pass explicit nil so plugins can actually check for nil. See - // "Why is my nil error value not equal to nil?" in golang.org/doc/faq. - glog.Fatal("Configuration missing: no config file specified and " + - "environment variables are not set.") - return cinderConfig{}, errors.New("Missing configuration") -} - -func getKeystoneVolumeService(cfg cinderConfig) (*gophercloud.ServiceClient, error) { - provider, err := openstack.NewClient(cfg.Global.AuthURL) - if err != nil { - return nil, err - } - if cfg.Global.CAFile != "" { - var roots *x509.CertPool - roots, err = certutil.NewPool(cfg.Global.CAFile) - if err != nil { - return nil, err - } - config := &tls.Config{} - config.RootCAs = roots - provider.HTTPClient.Transport = netutil.SetOldTransportDefaults(&http.Transport{TLSClientConfig: config}) - - } - if cfg.Global.TrustID != "" { - opts := cfg.toAuth3Options() - authOptsExt := trusts.AuthOptsExt{ - TrustID: cfg.Global.TrustID, - AuthOptionsBuilder: &opts, - } - err = openstack.AuthenticateV3(provider, authOptsExt, gophercloud.EndpointOpts{}) - } else { - err = openstack.Authenticate(provider, cfg.toAuthOptions()) - } - - if err != nil { - return nil, err - } - - volumeService, err := openstack.NewBlockStorageV2(provider, - gophercloud.EndpointOpts{ - Region: cfg.Global.Region, - }) - if err != nil { - return nil, fmt.Errorf("failed to get volume service: %v", err) - } - return volumeService, nil -} - -func getNoAuthVolumeService(cfg cinderConfig) (*gophercloud.ServiceClient, error) { - provider, err := noauth.NewClient(gophercloud.AuthOptions{ - Username: cfg.Global.Username, - TenantName: cfg.Global.TenantName, - }) - if err != nil { - return nil, err - } - - client, err := noauth.NewBlockStorageV2(provider, noauth.EndpointOpts{ - CinderEndpoint: cfg.Global.CinderEndpoint, - }) - if err != nil { - return nil, fmt.Errorf("failed to get volume service: %v", err) - } - - return client, nil -} - -// GetVolumeService returns a connected cinder client based on configuration -// specified in configFilePath or the environment. -func GetVolumeService(configFilePath string) (*gophercloud.ServiceClient, error) { - config, err := getConfig(configFilePath) - if err != nil { - return nil, err - } - - if config.Global.CinderEndpoint != "" { - return getNoAuthVolumeService(config) - } - return getKeystoneVolumeService(config) -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/volumeservice_suite_test.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/volumeservice_suite_test.go deleted file mode 100644 index dc83a702b0..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/volumeservice_suite_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package volumeservice_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestVolumeservice(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Volumeservice Suite") -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/volumeservice_test.go b/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/volumeservice_test.go deleted file mode 100644 index b81ebe1982..0000000000 --- a/vendor/github.com/kubernetes-incubator/external-storage/openstack/standalone-cinder/pkg/volumeservice/volumeservice_test.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package volumeservice - -import ( - "fmt" - "io/ioutil" - "os" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -const ( - AuthURL = "http://keystone-host:5000/v2.0" - CinderEndpoint = "http://cinder-host:8776/v2" -) - -var _ = Describe("Volume Service", func() { - Describe("Connection configuration parsing", func() { - var ( - config cinderConfig - err error - ) - - Context("when config file path is empty", func() { - BeforeEach(func() { - os.Setenv("OS_AUTH_URL", AuthURL) - os.Setenv("OS_CINDER_ENDPOINT", CinderEndpoint) - os.Setenv("OS_USERNAME", "USERNAME") - os.Setenv("OS_PASSWORD", "PASSWORD") - os.Setenv("OS_TENANT_ID", "TENANT_ID") - os.Setenv("OS_REGION_NAME", "REGION_NAME") - os.Setenv("OS_USER_DOMAIN_NAME", "USER_DOMAIN_NAME") - }) - - JustBeforeEach(func() { - config, err = getConfig("") - }) - - It("should take the configuration from the environment", func() { - ValidateConfig(config) - }) - }) - - Context("when config file path is specified", func() { - var ( - tmpFile string - ) - - BeforeEach(func() { - var file *os.File - data := []byte(fmt.Sprintf(` - [Global] - auth-url=%s - cinder-endpoint=%s - `, AuthURL, CinderEndpoint)) - - file, err = ioutil.TempFile(os.TempDir(), "cinderConfig") - Expect(err).To(BeNil()) - tmpFile = file.Name() - err = ioutil.WriteFile(tmpFile, data, 0644) - Expect(err).To(BeNil()) - - }) - AfterEach(func() { - os.Remove(tmpFile) - }) - - JustBeforeEach(func() { - config, err = getConfig(tmpFile) - }) - - It("should read the configuration from the file", func() { - ValidateConfig(config) - }) - - Context("when the config file path does not exist", func() { - BeforeEach(func() { - os.Remove(tmpFile) - }) - It("should fail", func() { - Expect(err).NotTo(BeNil()) - }) - }) - }) - }) -}) - -func ValidateConfig(config cinderConfig) { - Expect(config.Global.AuthURL).To(Equal(AuthURL)) - Expect(config.Global.CinderEndpoint).To(Equal(CinderEndpoint)) -} diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/README.md b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/README.md index 341404505c..1b0db7e880 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/README.md +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/README.md @@ -16,6 +16,11 @@ Pre-alpha - [AWS EBS](doc/examples/aws/README.md) - [GCE PD](doc/examples/gce/README.md) + +## Docs + + - [User Guide](doc/user-guide.md) + - [Kubernetes Snapshotting Proposal](doc/volume-snapshotting-proposal.md) ## Snapshot Volume Plugin Interface diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/cmd/snapshot-pv-provisioner/snapshot-pv-provisioner.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/cmd/snapshot-pv-provisioner/snapshot-pv-provisioner.go index 8f56754db5..d8a95e77e6 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/cmd/snapshot-pv-provisioner/snapshot-pv-provisioner.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/cmd/snapshot-pv-provisioner/snapshot-pv-provisioner.go @@ -69,31 +69,12 @@ func newSnapshotProvisioner(client kubernetes.Interface, crdclient *rest.RESTCli var _ controller.Provisioner = &snapshotProvisioner{} -func (p *snapshotProvisioner) getPVFromVolumeSnapshotDataSpec(snapshotDataSpec *crdv1.VolumeSnapshotDataSpec) (*v1.PersistentVolume, error) { - if snapshotDataSpec.PersistentVolumeRef == nil { - return nil, fmt.Errorf("VolumeSnapshotDataSpec is not bound to any PV") - } - pvName := snapshotDataSpec.PersistentVolumeRef.Name - if pvName == "" { - return nil, fmt.Errorf("The PV name is not specified in snapshotdata %#v", *snapshotDataSpec) - } - pv, err := p.client.CoreV1().PersistentVolumes().Get(pvName, metav1.GetOptions{}) - if err != nil { - return nil, fmt.Errorf("Failed to retrieve PV %s from the API server: %q", pvName, err) - } - return pv, nil -} - func (p *snapshotProvisioner) snapshotRestore(snapshotName string, snapshotData crdv1.VolumeSnapshotData, options controller.VolumeOptions) (*v1.PersistentVolumeSource, map[string]string, error) { // validate the PV supports snapshot and restore spec := &snapshotData.Spec - pv, err := p.getPVFromVolumeSnapshotDataSpec(spec) - if err != nil { - return nil, nil, err - } - volumeType := crdv1.GetSupportedVolumeFromPVSpec(&pv.Spec) + volumeType := crdv1.GetSupportedVolumeFromSnapshotDataSpec(spec) if len(volumeType) == 0 { - return nil, nil, fmt.Errorf("unsupported volume type found in PV %#v", *spec) + return nil, nil, fmt.Errorf("unsupported volume type found in SnapshotData %#v", *spec) } plugin, ok := volumePlugins[volumeType] if !ok { diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/actual_state_of_world.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/actual_state_of_world.go index 9f2718d422..d96bd402e7 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/actual_state_of_world.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/actual_state_of_world.go @@ -70,7 +70,7 @@ func (asw *actualStateOfWorld) AddSnapshot(snapshot *crdv1.VolumeSnapshot) error asw.Lock() defer asw.Unlock() - snapshotName := MakeSnapshotName(snapshot.Metadata.Namespace, snapshot.Metadata.Name) + snapshotName := MakeSnapshotName(snapshot) glog.Infof("Adding new snapshot to actual state of world: %s", snapshotName) asw.snapshots[snapshotName] = snapshot return nil diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/desired_state_of_world.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/desired_state_of_world.go index 0b34cbfb26..22af75ec21 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/desired_state_of_world.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/desired_state_of_world.go @@ -72,7 +72,7 @@ func (dsw *desiredStateOfWorld) AddSnapshot(snapshot *crdv1.VolumeSnapshot) erro dsw.Lock() defer dsw.Unlock() - snapshotName := MakeSnapshotName(snapshot.Metadata.Namespace, snapshot.Metadata.Name) + snapshotName := MakeSnapshotName(snapshot) glog.Infof("Adding new snapshot to desired state of world: %s", snapshotName) dsw.snapshots[snapshotName] = snapshot return nil diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/util.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/util.go index 5c200fa6aa..13eab0e6c2 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/util.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/cache/util.go @@ -22,22 +22,11 @@ reference them. package cache import ( - "fmt" - "strings" + crdv1 "github.com/kubernetes-incubator/external-storage/snapshot/pkg/apis/crd/v1" ) // MakeSnapshotName makes a full name for a snapshot that includes // the namespace and the short name -func MakeSnapshotName(namespace, name string) string { - return namespace + "/" + name -} - -// GetNameAndNameSpaceFromSnapshotName retrieves the namespace and -// the short name of a snapshot from its full name -func GetNameAndNameSpaceFromSnapshotName(name string) (string, string, error) { - strs := strings.Split(name, "/") - if len(strs) != 2 { - return "", "", fmt.Errorf("invalid snapshot name") - } - return strs[0], strs[1], nil +func MakeSnapshotName(snapshot *crdv1.VolumeSnapshot) string { + return snapshot.Metadata.Namespace + "/" + snapshot.Metadata.Name + "-" + string(snapshot.Metadata.UID) } diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/populator/desired_state_of_world_populator.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/populator/desired_state_of_world_populator.go index 0cb126e066..33be421665 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/populator/desired_state_of_world_populator.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/populator/desired_state_of_world_populator.go @@ -93,7 +93,7 @@ func (dswp *desiredStateOfWorldPopulator) findAndRemoveDeletedSnapshots() { } if !exists { glog.V(1).Infof("Removing snapshot %s from dsw because it does not exist in snapshot informer.", snapshotUID) - dswp.desiredStateOfWorld.DeleteSnapshot(cache.MakeSnapshotName(snapshot.Metadata.Namespace, snapshot.Metadata.Name)) + dswp.desiredStateOfWorld.DeleteSnapshot(cache.MakeSnapshotName(snapshot)) } } } @@ -102,7 +102,7 @@ func (dswp *desiredStateOfWorldPopulator) findAndAddActiveSnapshots() { for _, obj := range dswp.snapshotStore.List() { snapshot := obj.(*crdv1.VolumeSnapshot) - snapshotName := cache.MakeSnapshotName(snapshot.Metadata.Namespace, snapshot.Metadata.Name) + snapshotName := cache.MakeSnapshotName(snapshot) if !dswp.desiredStateOfWorld.SnapshotExists(snapshotName) { glog.V(1).Infof("Adding snapshot %s to dsw because it exists in snapshot informer.", snapshotName) dswp.desiredStateOfWorld.AddSnapshot(snapshot) diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/snapshot-controller/snapshot-controller.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/snapshot-controller/snapshot-controller.go index eef8d78f71..b7611a69c4 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/snapshot-controller/snapshot-controller.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/snapshot-controller/snapshot-controller.go @@ -220,6 +220,6 @@ func (c *snapshotController) onSnapshotDelete(obj interface{}) { // the snapshot itself snapshot := deletedSnapshot.DeepCopy() glog.Infof("[CONTROLLER] OnDelete %s, snapshot name: %s/%s\n", snapshot.Metadata.SelfLink, snapshot.Metadata.Namespace, snapshot.Metadata.Name) - c.desiredStateOfWorld.DeleteSnapshot(cache.MakeSnapshotName(snapshot.Metadata.Namespace, snapshot.Metadata.Name)) + c.desiredStateOfWorld.DeleteSnapshot(cache.MakeSnapshotName(snapshot)) } diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/snapshotter/snapshotter.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/snapshotter/snapshotter.go index 68de19b62f..54a449d154 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/snapshotter/snapshotter.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/controller/snapshotter/snapshotter.go @@ -119,11 +119,8 @@ func (vs *volumeSnapshotter) getPVFromVolumeSnapshot(uniqueSnapshotName string, if pvcName == "" { return nil, fmt.Errorf("The PVC name is not specified in snapshot %s", uniqueSnapshotName) } - snapNameSpace, _, err := cache.GetNameAndNameSpaceFromSnapshotName(uniqueSnapshotName) - if err != nil { - return nil, fmt.Errorf("Snapshot %s is malformed: %s", uniqueSnapshotName, err) - } - pvc, err := vs.coreClient.CoreV1().PersistentVolumeClaims(snapNameSpace).Get(pvcName, metav1.GetOptions{}) + + pvc, err := vs.coreClient.CoreV1().PersistentVolumeClaims(snapshot.Metadata.Namespace).Get(pvcName, metav1.GetOptions{}) if err != nil { return nil, fmt.Errorf("Failed to retrieve PVC %s from the API server: %q", pvcName, err) } @@ -373,7 +370,7 @@ func (vs *volumeSnapshotter) updateSnapshotIfExists(uniqueSnapshotName string, s // triggered through cloud provider, bind it and return pending state if snapshotDataObj = vs.getSnapshotDataFromSnapshotName(uniqueSnapshotName); snapshotDataObj != nil { glog.Infof("Find snapshot data object %s from snapshot %s", snapshotDataObj.Metadata.Name, uniqueSnapshotName) - snapshotObj, err := vs.bindandUpdateVolumeSnapshot(uniqueSnapshotName, snapshotDataObj.Metadata.Name, nil) + snapshotObj, err := vs.bindandUpdateVolumeSnapshot(snapshot, snapshotDataObj.Metadata.Name, nil) if err != nil { return statusError, snapshot, err } @@ -395,7 +392,7 @@ func (vs *volumeSnapshotter) updateSnapshotIfExists(uniqueSnapshotName string, s return statusError, snapshot, err } glog.Infof("updateSnapshotIfExists: update VolumeSnapshot status and bind VolumeSnapshotData to VolumeSnapshot %s.", uniqueSnapshotName) - snapshotObj, err := vs.bindandUpdateVolumeSnapshot(uniqueSnapshotName, snapshotDataObj.Metadata.Name, conditions) + snapshotObj, err := vs.bindandUpdateVolumeSnapshot(snapshot, snapshotDataObj.Metadata.Name, conditions) if err != nil { return statusError, nil, err } @@ -455,7 +452,7 @@ func (vs *volumeSnapshotter) findSnapshotByTags(uniqueSnapshotName string, snaps tags := vs.findVolumeSnapshotMetadata(snapshot) if tags != nil { plugin, err := vs.getPlugin(uniqueSnapshotName, snapshot) - if plugin == nil { + if err != nil { glog.Errorf("Failed to get volume plugin. %v", err) return nil, nil, fmt.Errorf("Failed to get volume plugin to create snapshot %s", uniqueSnapshotName) } @@ -506,7 +503,7 @@ func (vs *volumeSnapshotter) createSnapshot(uniqueSnapshotName string, snapshot } glog.Infof("createSnapshot: Update VolumeSnapshot status and bind VolumeSnapshotData to VolumeSnapshot %s.", uniqueSnapshotName) - snapshotObj, err := vs.bindandUpdateVolumeSnapshot(uniqueSnapshotName, snapshotDataObj.Metadata.Name, snapStatus) + snapshotObj, err := vs.bindandUpdateVolumeSnapshot(snapshot, snapshotDataObj.Metadata.Name, snapStatus) if err != nil { glog.Errorf("createSnapshot: Error updating volume snapshot %s: %v", uniqueSnapshotName, err) return fmt.Errorf("Failed to update VolumeSnapshot for snapshot %s", uniqueSnapshotName) @@ -530,9 +527,10 @@ func (vs *volumeSnapshotter) createVolumeSnapshotData(uniqueSnapshotName, pvName conditions := *snapStatus ind := len(conditions) - 1 lastCondition = crdv1.VolumeSnapshotDataCondition{ - Type: (crdv1.VolumeSnapshotDataConditionType)(conditions[ind].Type), - Status: conditions[ind].Status, - Message: conditions[ind].Message, + Type: (crdv1.VolumeSnapshotDataConditionType)(conditions[ind].Type), + Status: conditions[ind].Status, + Message: conditions[ind].Message, + LastTransitionTime: metav1.Now(), } } // Generate snapshotData name with the UID of snapshot object @@ -633,7 +631,7 @@ func (vs *volumeSnapshotter) getSnapshotPromoteFunc(uniqueSnapshotName string, s } func (vs *volumeSnapshotter) CreateVolumeSnapshot(snapshot *crdv1.VolumeSnapshot) { - snapshotName := cache.MakeSnapshotName(snapshot.Metadata.Namespace, snapshot.Metadata.Name) + snapshotName := cache.MakeSnapshotName(snapshot) operationName := snapshotOpCreatePrefix + snapshotName + snapshot.Spec.PersistentVolumeClaimName //glog.Infof("Snapshotter is about to create volume snapshot operation named %s, spec %#v", operationName, snapshot.Spec) @@ -652,7 +650,7 @@ func (vs *volumeSnapshotter) CreateVolumeSnapshot(snapshot *crdv1.VolumeSnapshot } func (vs *volumeSnapshotter) DeleteVolumeSnapshot(snapshot *crdv1.VolumeSnapshot) { - snapshotName := cache.MakeSnapshotName(snapshot.Metadata.Namespace, snapshot.Metadata.Name) + snapshotName := cache.MakeSnapshotName(snapshot) operationName := snapshotOpDeletePrefix + snapshotName + snapshot.Spec.PersistentVolumeClaimName glog.V(4).Infof("Snapshotter is about to delete volume snapshot operation named %s", operationName) @@ -671,7 +669,7 @@ func (vs *volumeSnapshotter) DeleteVolumeSnapshot(snapshot *crdv1.VolumeSnapshot } func (vs *volumeSnapshotter) PromoteVolumeSnapshotToPV(snapshot *crdv1.VolumeSnapshot) { - snapshotName := cache.MakeSnapshotName(snapshot.Metadata.Namespace, snapshot.Metadata.Name) + snapshotName := cache.MakeSnapshotName(snapshot) operationName := snapshotOpPromotePrefix + snapshotName + snapshot.Spec.PersistentVolumeClaimName glog.Infof("Snapshotter is about to create volume snapshot operation named %s", operationName) @@ -706,10 +704,11 @@ func (vs *volumeSnapshotter) updateVolumeSnapshotMetadata(snapshot *crdv1.Volume // Copy the snapshot object before updating it snapshotCopy := snapshotObj.DeepCopy() - tags := make(map[string]string) - tags[snapshotMetadataTimeStamp] = fmt.Sprintf("%d", time.Now().UnixNano()) - tags[snapshotMetadataPVName] = pvName - snapshotCopy.Metadata.Labels = tags + if snapshotCopy.Metadata.Labels == nil { + snapshotCopy.Metadata.Labels = make(map[string]string) + } + snapshotCopy.Metadata.Labels[snapshotMetadataTimeStamp] = fmt.Sprintf("%d", time.Now().UnixNano()) + snapshotCopy.Metadata.Labels[snapshotMetadataPVName] = pvName glog.Infof("updateVolumeSnapshotMetadata: Metadata UID: %s Metadata Name: %s Metadata Namespace: %s Setting tags in Metadata Labels: %#v.", snapshotCopy.Metadata.UID, snapshotCopy.Metadata.Name, snapshotCopy.Metadata.Namespace, snapshotCopy.Metadata.Labels) @@ -735,6 +734,62 @@ func (vs *volumeSnapshotter) updateVolumeSnapshotMetadata(snapshot *crdv1.Volume return &cloudTags, nil } +// Propagates the VolumeSnapshot condition to VolumeSnapshotData +func (vs *volumeSnapshotter) propagateVolumeSnapshotCondition(snapshotDataName string, condition *crdv1.VolumeSnapshotCondition) error { + var snapshotDataObj crdv1.VolumeSnapshotData + err := vs.restClient.Get(). + Name(snapshotDataName). + Resource(crdv1.VolumeSnapshotDataResourcePlural). + Do().Into(&snapshotDataObj) + if err != nil { + return err + } + + newCondition := &crdv1.VolumeSnapshotDataCondition{ + Type: (crdv1.VolumeSnapshotDataConditionType)(condition.Type), + Status: condition.Status, + Message: condition.Message, + LastTransitionTime: condition.LastTransitionTime, + } + oldStatus := snapshotDataObj.Status.DeepCopy() + + status := snapshotDataObj.Status + isEqual := false + if oldStatus.Conditions == nil || len(oldStatus.Conditions) == 0 || newCondition.Type != oldStatus.Conditions[len(oldStatus.Conditions)-1].Type { + status.Conditions = append(status.Conditions, *newCondition) + } else { + oldCondition := oldStatus.Conditions[len(oldStatus.Conditions)-1] + if newCondition.Status == oldCondition.Status { + newCondition.LastTransitionTime = oldCondition.LastTransitionTime + } + status.Conditions[len(status.Conditions)-1] = *newCondition + isEqual = newCondition.Type == oldCondition.Type && + newCondition.Status == oldCondition.Status && + newCondition.Reason == oldCondition.Reason && + newCondition.Message == oldCondition.Message && + newCondition.LastTransitionTime.Equal(&oldCondition.LastTransitionTime) + } + if !isEqual { + var newSnapshotDataObj crdv1.VolumeSnapshotData + snapshotDataObj.Status = status + if snapshotDataObj.Status.CreationTimestamp.IsZero() && newCondition.Type == crdv1.VolumeSnapshotDataConditionReady { + snapshotDataObj.Status.CreationTimestamp = newCondition.LastTransitionTime + } + err = vs.restClient.Put(). + Name(snapshotDataName). + Resource(crdv1.VolumeSnapshotDataResourcePlural). + Body(&snapshotDataObj). + Do().Into(&newSnapshotDataObj) + if err != nil { + return err + } + glog.Infof("VolumeSnapshot status propagated to VolumeSnapshotData") + return nil + } + + return nil +} + // Update VolumeSnapshot status if the condition is changed. func (vs *volumeSnapshotter) UpdateVolumeSnapshotStatus(snapshot *crdv1.VolumeSnapshot, condition *crdv1.VolumeSnapshotCondition) (*crdv1.VolumeSnapshot, error) { var snapshotObj crdv1.VolumeSnapshot @@ -779,6 +834,10 @@ func (vs *volumeSnapshotter) UpdateVolumeSnapshotStatus(snapshot *crdv1.VolumeSn return nil, err } glog.Infof("UpdateVolumeSnapshotStatus finishes %+v", newSnapshotObj) + err = vs.propagateVolumeSnapshotCondition(snapshotObj.Spec.SnapshotDataName, &snapshotObj.Status.Conditions[len(snapshotObj.Status.Conditions)-1]) + if err != nil { + return nil, err + } return &newSnapshotObj, nil } @@ -786,22 +845,19 @@ func (vs *volumeSnapshotter) UpdateVolumeSnapshotStatus(snapshot *crdv1.VolumeSn } // Bind the VolumeSnapshot and VolumeSnapshotData and udpate the status -func (vs *volumeSnapshotter) bindandUpdateVolumeSnapshot(uniqueSnapshotName string, snapshotDataName string, status *[]crdv1.VolumeSnapshotCondition) (*crdv1.VolumeSnapshot, error) { +func (vs *volumeSnapshotter) bindandUpdateVolumeSnapshot(snapshot *crdv1.VolumeSnapshot, snapshotDataName string, status *[]crdv1.VolumeSnapshotCondition) (*crdv1.VolumeSnapshot, error) { var snapshotObj crdv1.VolumeSnapshot glog.Infof("In bindVolumeSnapshotDataToVolumeSnapshot") // Get a fresh copy of the VolumeSnapshot from the API server - snapNameSpace, snapName, err := cache.GetNameAndNameSpaceFromSnapshotName(uniqueSnapshotName) - if err != nil { - return nil, fmt.Errorf("Error getting namespace and name from VolumeSnapshot name %s: %v", uniqueSnapshotName, err) - } - glog.Infof("bindVolumeSnapshotDataToVolumeSnapshot: Namespace %s Name %s", snapNameSpace, snapName) - err = vs.restClient.Get(). - Name(snapName). + glog.Infof("bindVolumeSnapshotDataToVolumeSnapshot: Namespace %s Name %s", snapshot.Metadata.Namespace, snapshot.Metadata.Name) + err := vs.restClient.Get(). + Name(snapshot.Metadata.Name). Resource(crdv1.VolumeSnapshotResourcePlural). - Namespace(snapNameSpace). + Namespace(snapshot.Metadata.Namespace). Do().Into(&snapshotObj) + uniqueSnapshotName := cache.MakeSnapshotName(snapshot) // TODO: Is copy needed here? snapshotCopy := snapshotObj.DeepCopy() @@ -813,9 +869,9 @@ func (vs *volumeSnapshotter) bindandUpdateVolumeSnapshot(uniqueSnapshotName stri // TODO: Make diff of the two objects and then use restClient.Patch to update it var result crdv1.VolumeSnapshot err = vs.restClient.Put(). - Name(snapName). + Name(snapshot.Metadata.Name). Resource(crdv1.VolumeSnapshotResourcePlural). - Namespace(snapNameSpace). + Namespace(snapshot.Metadata.Namespace). Body(snapshotCopy). Do().Into(&result) if err != nil { diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/awsebs/processor.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/awsebs/processor.go index b85b8b6e7e..46eeb3b6c5 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/awsebs/processor.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/awsebs/processor.go @@ -110,11 +110,7 @@ func (a *awsEBSPlugin) FindSnapshot(tags *map[string]string) (*crdv1.VolumeSnaps glog.Infof("FindSnapshot by tags: %#v", *tags) // TODO: Implement FindSnapshot - return &crdv1.VolumeSnapshotDataSource{ - AWSElasticBlockStore: &crdv1.AWSElasticBlockStoreVolumeSnapshotSource{ - SnapshotID: "", - }, - }, nil, nil + return nil, nil, fmt.Errorf("Snapshot not found") } func (a *awsEBSPlugin) SnapshotRestore(snapshotData *crdv1.VolumeSnapshotData, pvc *v1.PersistentVolumeClaim, pvName string, parameters map[string]string) (*v1.PersistentVolumeSource, map[string]string, error) { diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/cinder/processor.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/cinder/processor.go index 706683bd45..7faec91843 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/cinder/processor.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/cinder/processor.go @@ -221,5 +221,5 @@ func (c *cinderPlugin) FindSnapshot(tags *map[string]string) (*crdv1.VolumeSnaps }, c.convertSnapshotStatus(statuses[0]), nil } - return nil, nil, nil + return nil, nil, fmt.Errorf("Snapshot not found") } diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/gcepd/processor.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/gcepd/processor.go index 4c01f24062..df54d8afa2 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/gcepd/processor.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/gcepd/processor.go @@ -190,11 +190,7 @@ func (plugin *gcePersistentDiskPlugin) FindSnapshot(tags *map[string]string) (*c glog.Infof("FindSnapshot by tags: %#v", *tags) // TODO: Implement FindSnapshot - return &crdv1.VolumeSnapshotDataSource{ - GCEPersistentDiskSnapshot: &crdv1.GCEPersistentDiskSnapshotSource{ - SnapshotName: "", - }, - }, nil, nil + return nil, nil, fmt.Errorf("Snapshot not found") } func (plugin *gcePersistentDiskPlugin) VolumeDelete(pv *v1.PersistentVolume) error { diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/gluster/snapshot.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/gluster/snapshot.go index 4d2870c89d..3385680849 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/gluster/snapshot.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/gluster/snapshot.go @@ -174,11 +174,7 @@ func (h *glusterfsPlugin) FindSnapshot(tags *map[string]string) (*crdv1.VolumeSn glog.Infof("FindSnapshot by tags: %#v", *tags) // TODO: Implement FindSnapshot - return &crdv1.VolumeSnapshotDataSource{ - GlusterSnapshotVolume: &crdv1.GlusterVolumeSnapshotSource{ - SnapshotID: "", - }, - }, nil, nil + return nil, nil, fmt.Errorf("Snapshot not found") } func (h *glusterfsPlugin) SnapshotRestore(snapshotData *crdv1.VolumeSnapshotData, _ *v1.PersistentVolumeClaim, _ string, _ map[string]string) (*v1.PersistentVolumeSource, map[string]string, error) { diff --git a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/hostpath/processor.go b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/hostpath/processor.go index ffd14eb8ea..6078a9e2f4 100644 --- a/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/hostpath/processor.go +++ b/vendor/github.com/kubernetes-incubator/external-storage/snapshot/pkg/volume/hostpath/processor.go @@ -143,11 +143,7 @@ func (h *hostPathPlugin) FindSnapshot(tags *map[string]string) (*crdv1.VolumeSna glog.Infof("FindSnapshot by tags: %#v", *tags) // TODO: Implement FindSnapshot - return &crdv1.VolumeSnapshotDataSource{ - HostPath: &crdv1.HostPathVolumeSnapshotSource{ - Path: "", - }, - }, nil, nil + return nil, nil, fmt.Errorf("Snapshot not found") } func (h *hostPathPlugin) SnapshotRestore(snapshotData *crdv1.VolumeSnapshotData, _ *v1.PersistentVolumeClaim, _ string, _ map[string]string) (*v1.PersistentVolumeSource, map[string]string, error) { diff --git a/vendor/github.com/kubernetes-incubator/external-storage/test.sh b/vendor/github.com/kubernetes-incubator/external-storage/test.sh index 79b88a9432..0ff0e69565 100755 --- a/vendor/github.com/kubernetes-incubator/external-storage/test.sh +++ b/vendor/github.com/kubernetes-incubator/external-storage/test.sh @@ -19,6 +19,31 @@ set -o nounset set -o pipefail set -o xtrace +# This file is used by travisci to test PRs. +# It installs several dependencies on the test machine that are +# required to run the tests. + +function install_helm() { + local OS=$(uname | tr A-Z a-z) + local VERSION=v2.7.2 + local ARCH=amd64 + local HELM_URL=http://storage.googleapis.com/kubernetes-helm/helm-${VERSION}-${OS}-${ARCH}.tar.gz + curl -s "$HELM_URL" | sudo tar --strip-components 1 -C /usr/local/bin -zxf - ${OS}-${ARCH}/helm +} + +# Skip duplicate build and test runs through the CI, that occur because we are now running on osx and linux. +# Skipping these steps saves time and travis-ci resources. +if [ "$TRAVIS_OS_NAME" = "osx" ]; then + if [ "$TEST_SUITE" != "osx" ]; then + exit 0 + fi +fi +if [ "$TRAVIS_OS_NAME" != "osx" ]; then + if [ "$TEST_SUITE" = "osx" ]; then + exit 0 + fi +fi + # Install glide, golint, cfssl curl https://glide.sh/get | sh go get -u github.com/golang/lint/golint @@ -27,7 +52,19 @@ go get -u github.com/alecthomas/gometalinter gometalinter --install make verify -if [ "$TEST_SUITE" = "nfs" ]; then +if [ "$TRAVIS_OS_NAME" = "osx" ]; then + if [ "$TEST_SUITE" = "osx" ]; then + # Presently travis-ci does not support docker on osx. + echo '#!/bin/bash' > docker + echo 'echo "***docker not currently supported on osx travis-ci, skipping docker commands for osx***"' >> docker + chmod u+x docker + export PATH=$(pwd):${PATH} + make + make test + install_helm + make test-local-volume/helm + fi +elif [ "$TEST_SUITE" = "linux-nfs" ]; then # Install nfs, cfssl sudo apt-get -qq update sudo apt-get install -y nfs-common @@ -72,7 +109,7 @@ if [ "$TEST_SUITE" = "nfs" ]; then # Build nfs-provisioner and run tests make nfs make test-nfs-all -elif [ "$TEST_SUITE" = "everything-else" ]; then +elif [ "$TEST_SUITE" = "linux-everything-else" ]; then pushd ./lib go test ./controller go test ./allocator @@ -94,8 +131,9 @@ elif [ "$TEST_SUITE" = "everything-else" ]; then make nfs-client make snapshot make test-snapshot - make test-openstack/standalone-cinder -elif [ "$TEST_SUITE" = "local-volume" ]; then +elif [ "$TEST_SUITE" = "linux-local-volume" ]; then make local-volume/provisioner make test-local-volume/provisioner + install_helm + make test-local-volume/helm fi diff --git a/vendor/github.com/petar/GoLLRB/.gitignore b/vendor/github.com/petar/GoLLRB/.gitignore deleted file mode 100644 index e333b2dbf7..0000000000 --- a/vendor/github.com/petar/GoLLRB/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -syntax:glob -*.[568ao] -*.ao -*.so -*.pyc -*.swp -*.swo -._* -.nfs.* -[568a].out -*~ -*.orig -*.pb.go -core -_obj -_test -src/pkg/Make.deps -_testmain.go - -syntax:regexp -^pkg/ -^src/cmd/(.*)/6?\1$ -^.*/core.[0-9]*$ diff --git a/vendor/github.com/petar/GoLLRB/AUTHORS b/vendor/github.com/petar/GoLLRB/AUTHORS deleted file mode 100644 index 78d1de4956..0000000000 --- a/vendor/github.com/petar/GoLLRB/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -Petar Maymounkov -Vadim Vygonets -Ian Smith -Martin Bruse diff --git a/vendor/github.com/petar/GoLLRB/LICENSE b/vendor/github.com/petar/GoLLRB/LICENSE deleted file mode 100644 index b75312c787..0000000000 --- a/vendor/github.com/petar/GoLLRB/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2010, Petar Maymounkov -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -(*) Redistributions of source code must retain the above copyright notice, this list -of conditions and the following disclaimer. - -(*) Redistributions in binary form must reproduce the above copyright notice, this -list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -(*) Neither the name of Petar Maymounkov nor the names of its contributors may be -used to endorse or promote products derived from this software without specific -prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/petar/GoLLRB/README.md b/vendor/github.com/petar/GoLLRB/README.md deleted file mode 100644 index 742ca0bd56..0000000000 --- a/vendor/github.com/petar/GoLLRB/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# GoLLRB - -GoLLRB is a Left-Leaning Red-Black (LLRB) implementation of 2-3 balanced binary -search trees in Go Language. - -## Overview - -As of this writing and to the best of the author's knowledge, -Go still does not have a balanced binary search tree (BBST) data structure. -These data structures are quite useful in a variety of cases. A BBST maintains -elements in sorted order under dynamic updates (inserts and deletes) and can -support various order-specific queries. Furthermore, in practice one often -implements other common data structures like Priority Queues, using BBST's. - -2-3 trees (a type of BBST's), as well as the runtime-similar 2-3-4 trees, are -the de facto standard BBST algoritms found in implementations of Python, Java, -and other libraries. The LLRB method of implementing 2-3 trees is a recent -improvement over the traditional implementation. The LLRB approach was -discovered relatively recently (in 2008) by Robert Sedgewick of Princeton -University. - -GoLLRB is a Go implementation of LLRB 2-3 trees. - -## Maturity - -GoLLRB has been used in some pretty heavy-weight machine learning tasks over many gigabytes of data. -I consider it to be in stable, perhaps even production, shape. There are no known bugs. - -## Installation - -With a healthy Go Language installed, simply run `go get github.com/petar/GoLLRB/llrb` - -## Example - - package main - - import ( - "fmt" - "github.com/petar/GoLLRB/llrb" - ) - - func lessInt(a, b interface{}) bool { return a.(int) < b.(int) } - - func main() { - tree := llrb.New(lessInt) - tree.ReplaceOrInsert(1) - tree.ReplaceOrInsert(2) - tree.ReplaceOrInsert(3) - tree.ReplaceOrInsert(4) - tree.DeleteMin() - tree.Delete(4) - c := tree.IterAscend() - for { - u := <-c - if u == nil { - break - } - fmt.Printf("%d\n", int(u.(int))) - } - } - -## About - -GoLLRB was written by [Petar Maymounkov](http://pdos.csail.mit.edu/~petar/). - -Follow me on [Twitter @maymounkov](http://www.twitter.com/maymounkov)! diff --git a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-LLRB.pdf b/vendor/github.com/petar/GoLLRB/doc/Sedgewick-LLRB.pdf deleted file mode 100644 index a399b06ae0..0000000000 Binary files a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-LLRB.pdf and /dev/null differ diff --git a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-RedBlackBST.java b/vendor/github.com/petar/GoLLRB/doc/Sedgewick-RedBlackBST.java deleted file mode 100644 index 55ac177f8c..0000000000 --- a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-RedBlackBST.java +++ /dev/null @@ -1,475 +0,0 @@ -public class RedBlackBST, Value> -{ - private static final int BST = 0; - private static final int TD234 = 1; - private static final int BU23 = 2; - private static final boolean RED = true; - private static final boolean BLACK = false; - - private Node root; // root of the BST - private int k; // ordinal for drawing - private final int species; // species kind of tree for insert - private int heightBLACK; // black height of tree - - RedBlackBST(int species) - { this.species = species; } - - private class Node - { - Key key; // key - Value value; // associated data - Node left, right; // left and right subtrees - boolean color; // color of parent link - private int N; // number of nodes in tree rooted here - private int height; // height of tree rooted here - private double xc, yc; // for drawing - - Node(Key key, Value value) - { - this.key = key; - this.value = value; - this.color = RED; - this.N = 1; - this.height = 1; - } - } - - public int size() - { return size(root); } - - private int size(Node x) - { - if (x == null) return 0; - else return x.N; - } - - public int rootRank() - { - if (root == null) return 0; - else return size(root.left); - } - - public int height() - { return height(root); } - - public int heightB() - { return heightBLACK; } - - private int height(Node x) - { - if (x == null) return 0; - else return x.height; - } - - public boolean contains(Key key) - { return (get(key) != null); } - - public Value get(Key key) - { return get(root, key); } - - private Value get(Node x, Key key) - { - if (x == null) return null; - if (eq (key, x.key)) return x.value; - if (less(key, x.key)) return get(x.left, key); - else return get(x.right, key); - } - - public Key min() - { - if (root == null) return null; - else return min(root); - } - - private Key min(Node x) - { - if (x.left == null) return x.key; - else return min(x.left); - } - - public Key max() - { - if (root == null) return null; - else return max(root); - } - - private Key max(Node x) - { - if (x.right == null) return x.key; - else return max(x.right); - } - - public void put(Key key, Value value) - { - root = insert(root, key, value); - if (isRed(root)) heightBLACK++; - root.color = BLACK; - } - - private Node insert(Node h, Key key, Value value) - { - if (h == null) - return new Node(key, value); - - if (species == TD234) - if (isRed(h.left) && isRed(h.right)) - colorFlip(h); - - if (eq(key, h.key)) - h.value = value; - else if (less(key, h.key)) - h.left = insert(h.left, key, value); - else - h.right = insert(h.right, key, value); - - if (species == BST) return setN(h); - - if (isRed(h.right)) - h = rotateLeft(h); - - if (isRed(h.left) && isRed(h.left.left)) - h = rotateRight(h); - - if (species == BU23) - if (isRed(h.left) && isRed(h.right)) - colorFlip(h); - - return setN(h); - } - - public void deleteMin() - { - root = deleteMin(root); - root.color = BLACK; - } - - private Node deleteMin(Node h) - { - if (h.left == null) - return null; - - if (!isRed(h.left) && !isRed(h.left.left)) - h = moveRedLeft(h); - - h.left = deleteMin(h.left); - - return fixUp(h); - } - - public void deleteMax() - { - root = deleteMax(root); - root.color = BLACK; - } - - private Node deleteMax(Node h) - { - // if (h.right == null) - // { - // if (h.left != null) - // h.left.color = BLACK; - // return h.left; - // } - - if (isRed(h.left)) - h = rotateRight(h); - - if (h.right == null) - return null; - - if (!isRed(h.right) && !isRed(h.right.left)) - h = moveRedRight(h); - - h.right = deleteMax(h.right); - - return fixUp(h); - } - - public void delete(Key key) - { - root = delete(root, key); - root.color = BLACK; - } - - private Node delete(Node h, Key key) - { - if (less(key, h.key)) - { - if (!isRed(h.left) && !isRed(h.left.left)) - h = moveRedLeft(h); - h.left = delete(h.left, key); - } - else - { - if (isRed(h.left)) - h = rotateRight(h); - if (eq(key, h.key) && (h.right == null)) - return null; - if (!isRed(h.right) && !isRed(h.right.left)) - h = moveRedRight(h); - if (eq(key, h.key)) - { - h.value = get(h.right, min(h.right)); - h.key = min(h.right); - h.right = deleteMin(h.right); - } - else h.right = delete(h.right, key); - } - - return fixUp(h); - } - -// Helper methods - - private boolean less(Key a, Key b) { return a.compareTo(b) < 0; } - private boolean eq (Key a, Key b) { return a.compareTo(b) == 0; } - - private boolean isRed(Node x) - { - if (x == null) return false; - return (x.color == RED); - } - - private void colorFlip(Node h) - { - h.color = !h.color; - h.left.color = !h.left.color; - h.right.color = !h.right.color; - } - - private Node rotateLeft(Node h) - { // Make a right-leaning 3-node lean to the left. - Node x = h.right; - h.right = x.left; - x.left = setN(h); - x.color = x.left.color; - x.left.color = RED; - return setN(x); - } - - private Node rotateRight(Node h) - { // Make a left-leaning 3-node lean to the right. - Node x = h.left; - h.left = x.right; - x.right = setN(h); - x.color = x.right.color; - x.right.color = RED; - return setN(x); - } - - private Node moveRedLeft(Node h) - { // Assuming that h is red and both h.left and h.left.left - // are black, make h.left or one of its children red. - colorFlip(h); - if (isRed(h.right.left)) - { - h.right = rotateRight(h.right); - h = rotateLeft(h); - colorFlip(h); - } - return h; - } - - private Node moveRedRight(Node h) - { // Assuming that h is red and both h.right and h.right.left - // are black, make h.right or one of its children red. - colorFlip(h); - if (isRed(h.left.left)) - { - h = rotateRight(h); - colorFlip(h); - } - return h; - } - - private Node fixUp(Node h) - { - if (isRed(h.right)) - h = rotateLeft(h); - - if (isRed(h.left) && isRed(h.left.left)) - h = rotateRight(h); - - if (isRed(h.left) && isRed(h.right)) - colorFlip(h); - - return setN(h); - } - - private Node setN(Node h) - { - h.N = size(h.left) + size(h.right) + 1; - if (height(h.left) > height(h.right)) h.height = height(h.left) + 1; - else h.height = height(h.right) + 1; - return h; - } - - public String toString() - { - if (root == null) return ""; - else return heightB() + " " + toString(root); - } - - public String toString(Node x) - { - String s = "("; - if (x.left == null) s += "("; else s += toString(x.left); - if (isRed(x)) s += "*"; - if (x.right == null) s += ")"; else s += toString(x.right); - return s + ")"; - } - -// Methods for tree drawing - - public void draw(double y, double lineWidth, double nodeSize) - { - k = 0; - setcoords(root, y); - StdDraw.setPenColor(StdDraw.BLACK); - StdDraw.setPenRadius(lineWidth); - drawlines(root); - StdDraw.setPenColor(StdDraw.WHITE); - drawnodes(root, nodeSize); - } - - public void setcoords(Node x, double d) - { - if (x == null) return; - setcoords(x.left, d-.04); - x.xc = (0.5 + k++)/size(); x.yc = d - .04; - setcoords(x.right, d-.04); - } - - public void drawlines(Node x) - { - if (x == null) return; - drawlines(x.left); - if (x.left != null) - { - if (x.left.color == RED) StdDraw.setPenColor(StdDraw.RED); - else StdDraw.setPenColor(StdDraw.BLACK); - StdDraw.line(x.xc, x.yc, x.left.xc, x.left.yc); - } - if (x.right != null) - { - if (x.right.color == RED) StdDraw.setPenColor(StdDraw.RED); - else StdDraw.setPenColor(StdDraw.BLACK); - StdDraw.line(x.xc, x.yc, x.right.xc, x.right.yc); - } - drawlines(x.right); - } - - public void drawnodes(Node x, double nodeSize) - { - if (x == null) return; - drawnodes(x.left, nodeSize); - StdDraw.filledCircle(x.xc, x.yc, nodeSize); - drawnodes(x.right, nodeSize); - } - - public void mark(Key key) - { - StdDraw.setPenColor(StdDraw.BLACK); - marknodes(key, root); - } - - public void marknodes(Key key, Node x) - { - if (x == null) return; - marknodes(key, x.left); - if (eq(key, x.key)) - StdDraw.filledCircle(x.xc, x.yc, .004); - marknodes(key, x.right); - } - - public int ipl() - { return ipl(root); } - - public int ipl(Node x) - { - if (x == null) return 0; - return size(x) - 1 + ipl(x.left) + ipl(x.right); - } - - public int sizeRed() - { return sizeRed(root); } - - public int sizeRed(Node x) - { - if (x == null) return 0; - if (isRed(x)) return 1 + sizeRed(x.left) + sizeRed(x.right); - else return sizeRed(x.left) + sizeRed(x.right); - } - -// Integrity checks - - public boolean check() - { // Is this tree a red-black tree? - return isBST() && is234() && isBalanced(); - } - - private boolean isBST() - { // Is this tree a BST? - return isBST(root, min(), max()); - } - - private boolean isBST(Node x, Key min, Key max) - { // Are all the values in the BST rooted at x between min and max, - // and does the same property hold for both subtrees? - if (x == null) return true; - if (less(x.key, min) || less(max, x.key)) return false; - return isBST(x.left, min, x.key) && isBST(x.right, x.key, max); - } - - private boolean is234() { return is234(root); } - private boolean is234(Node x) - { // Does the tree have no red right links, and at most two (left) - // red links in a row on any path? - if (x == null) return true; - if (isRed(x.right)) return false; - if (isRed(x)) - if (isRed(x.left)) - if (isRed(x.left.left)) return false; - return is234(x.left) && is234(x.right); - } - - private boolean isBalanced() - { // Do all paths from root to leaf have same number of black edges? - int black = 0; // number of black links on path from root to min - Node x = root; - while (x != null) - { - if (!isRed(x)) black++; - x = x.left; - } - return isBalanced(root, black); - } - - private boolean isBalanced(Node x, int black) - { // Does every path from the root to a leaf have the given number - // of black links? - if (x == null && black == 0) return true; - else if (x == null && black != 0) return false; - if (!isRed(x)) black--; - return isBalanced(x.left, black) && isBalanced(x.right, black); - } - - - public static void main(String[] args) - { - StdDraw.setPenRadius(.0025); - int species = Integer.parseInt(args[0]); - RedBlackBST st; - st = new RedBlackBST(species); - int[] a = { 3, 1, 4, 2, 5, 9, 6, 8, 7 }; - for (int i = 0; i < a.length; i++) - st.put(a[i], i); - StdOut.println(st); - StdDraw.clear(StdDraw.LIGHT_GRAY); - st.draw(.95, .0025, .008); - StdOut.println(st.min() + " " + st.max() + " " + st.check()); - StdOut.println(st.ipl()); - StdOut.println(st.heightB()); - } - -} diff --git a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-Talk-Penn2008.pdf b/vendor/github.com/petar/GoLLRB/doc/Sedgewick-Talk-Penn2008.pdf deleted file mode 100644 index 07861abeda..0000000000 Binary files a/vendor/github.com/petar/GoLLRB/doc/Sedgewick-Talk-Penn2008.pdf and /dev/null differ diff --git a/vendor/github.com/petar/GoLLRB/example/ex1.go b/vendor/github.com/petar/GoLLRB/example/ex1.go deleted file mode 100644 index 6ebe4a6862..0000000000 --- a/vendor/github.com/petar/GoLLRB/example/ex1.go +++ /dev/null @@ -1,26 +0,0 @@ -package main - -import ( - "fmt" - "github.com/petar/GoLLRB/llrb" -) - -func lessInt(a, b interface{}) bool { return a.(int) < b.(int) } - -func main() { - tree := llrb.New(lessInt) - tree.ReplaceOrInsert(1) - tree.ReplaceOrInsert(2) - tree.ReplaceOrInsert(3) - tree.ReplaceOrInsert(4) - tree.DeleteMin() - tree.Delete(4) - c := tree.IterAscend() - for { - u := <-c - if u == nil { - break - } - fmt.Printf("%d\n", int(u.(int))) - } -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/avgvar.go b/vendor/github.com/petar/GoLLRB/llrb/avgvar.go deleted file mode 100644 index 2d7e2a3262..0000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/avgvar.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2010 Petar Maymounkov. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package llrb - -import "math" - -// avgVar maintains the average and variance of a stream of numbers -// in a space-efficient manner. -type avgVar struct { - count int64 - sum, sumsq float64 -} - -func (av *avgVar) Init() { - av.count = 0 - av.sum = 0.0 - av.sumsq = 0.0 -} - -func (av *avgVar) Add(sample float64) { - av.count++ - av.sum += sample - av.sumsq += sample * sample -} - -func (av *avgVar) GetCount() int64 { return av.count } - -func (av *avgVar) GetAvg() float64 { return av.sum / float64(av.count) } - -func (av *avgVar) GetTotal() float64 { return av.sum } - -func (av *avgVar) GetVar() float64 { - a := av.GetAvg() - return av.sumsq/float64(av.count) - a*a -} - -func (av *avgVar) GetStdDev() float64 { return math.Sqrt(av.GetVar()) } diff --git a/vendor/github.com/petar/GoLLRB/llrb/iterator.go b/vendor/github.com/petar/GoLLRB/llrb/iterator.go deleted file mode 100644 index ee7b27f442..0000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/iterator.go +++ /dev/null @@ -1,93 +0,0 @@ -package llrb - -type ItemIterator func(i Item) bool - -//func (t *Tree) Ascend(iterator ItemIterator) { -// t.AscendGreaterOrEqual(Inf(-1), iterator) -//} - -func (t *LLRB) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) { - t.ascendRange(t.root, greaterOrEqual, lessThan, iterator) -} - -func (t *LLRB) ascendRange(h *Node, inf, sup Item, iterator ItemIterator) bool { - if h == nil { - return true - } - if !less(h.Item, sup) { - return t.ascendRange(h.Left, inf, sup, iterator) - } - if less(h.Item, inf) { - return t.ascendRange(h.Right, inf, sup, iterator) - } - - if !t.ascendRange(h.Left, inf, sup, iterator) { - return false - } - if !iterator(h.Item) { - return false - } - return t.ascendRange(h.Right, inf, sup, iterator) -} - -// AscendGreaterOrEqual will call iterator once for each element greater or equal to -// pivot in ascending order. It will stop whenever the iterator returns false. -func (t *LLRB) AscendGreaterOrEqual(pivot Item, iterator ItemIterator) { - t.ascendGreaterOrEqual(t.root, pivot, iterator) -} - -func (t *LLRB) ascendGreaterOrEqual(h *Node, pivot Item, iterator ItemIterator) bool { - if h == nil { - return true - } - if !less(h.Item, pivot) { - if !t.ascendGreaterOrEqual(h.Left, pivot, iterator) { - return false - } - if !iterator(h.Item) { - return false - } - } - return t.ascendGreaterOrEqual(h.Right, pivot, iterator) -} - -func (t *LLRB) AscendLessThan(pivot Item, iterator ItemIterator) { - t.ascendLessThan(t.root, pivot, iterator) -} - -func (t *LLRB) ascendLessThan(h *Node, pivot Item, iterator ItemIterator) bool { - if h == nil { - return true - } - if !t.ascendLessThan(h.Left, pivot, iterator) { - return false - } - if !iterator(h.Item) { - return false - } - if less(h.Item, pivot) { - return t.ascendLessThan(h.Left, pivot, iterator) - } - return true -} - -// DescendLessOrEqual will call iterator once for each element less than the -// pivot in descending order. It will stop whenever the iterator returns false. -func (t *LLRB) DescendLessOrEqual(pivot Item, iterator ItemIterator) { - t.descendLessOrEqual(t.root, pivot, iterator) -} - -func (t *LLRB) descendLessOrEqual(h *Node, pivot Item, iterator ItemIterator) bool { - if h == nil { - return true - } - if less(h.Item, pivot) || !less(pivot, h.Item) { - if !t.descendLessOrEqual(h.Right, pivot, iterator) { - return false - } - if !iterator(h.Item) { - return false - } - } - return t.descendLessOrEqual(h.Left, pivot, iterator) -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/iterator_test.go b/vendor/github.com/petar/GoLLRB/llrb/iterator_test.go deleted file mode 100644 index db5e12c92e..0000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/iterator_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package llrb - -import ( - "reflect" - "testing" -) - -func TestAscendGreaterOrEqual(t *testing.T) { - tree := New() - tree.InsertNoReplace(Int(4)) - tree.InsertNoReplace(Int(6)) - tree.InsertNoReplace(Int(1)) - tree.InsertNoReplace(Int(3)) - var ary []Item - tree.AscendGreaterOrEqual(Int(-1), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected := []Item{Int(1), Int(3), Int(4), Int(6)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } - ary = nil - tree.AscendGreaterOrEqual(Int(3), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected = []Item{Int(3), Int(4), Int(6)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } - ary = nil - tree.AscendGreaterOrEqual(Int(2), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected = []Item{Int(3), Int(4), Int(6)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } -} - -func TestDescendLessOrEqual(t *testing.T) { - tree := New() - tree.InsertNoReplace(Int(4)) - tree.InsertNoReplace(Int(6)) - tree.InsertNoReplace(Int(1)) - tree.InsertNoReplace(Int(3)) - var ary []Item - tree.DescendLessOrEqual(Int(10), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected := []Item{Int(6), Int(4), Int(3), Int(1)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } - ary = nil - tree.DescendLessOrEqual(Int(4), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected = []Item{Int(4), Int(3), Int(1)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } - ary = nil - tree.DescendLessOrEqual(Int(5), func(i Item) bool { - ary = append(ary, i) - return true - }) - expected = []Item{Int(4), Int(3), Int(1)} - if !reflect.DeepEqual(ary, expected) { - t.Errorf("expected %v but got %v", expected, ary) - } -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/llrb-stats.go b/vendor/github.com/petar/GoLLRB/llrb/llrb-stats.go deleted file mode 100644 index 47126a3be9..0000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/llrb-stats.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2010 Petar Maymounkov. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package llrb - -// GetHeight() returns an item in the tree with key @key, and it's height in the tree -func (t *LLRB) GetHeight(key Item) (result Item, depth int) { - return t.getHeight(t.root, key) -} - -func (t *LLRB) getHeight(h *Node, item Item) (Item, int) { - if h == nil { - return nil, 0 - } - if less(item, h.Item) { - result, depth := t.getHeight(h.Left, item) - return result, depth + 1 - } - if less(h.Item, item) { - result, depth := t.getHeight(h.Right, item) - return result, depth + 1 - } - return h.Item, 0 -} - -// HeightStats() returns the average and standard deviation of the height -// of elements in the tree -func (t *LLRB) HeightStats() (avg, stddev float64) { - av := &avgVar{} - heightStats(t.root, 0, av) - return av.GetAvg(), av.GetStdDev() -} - -func heightStats(h *Node, d int, av *avgVar) { - if h == nil { - return - } - av.Add(float64(d)) - if h.Left != nil { - heightStats(h.Left, d+1, av) - } - if h.Right != nil { - heightStats(h.Right, d+1, av) - } -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/llrb.go b/vendor/github.com/petar/GoLLRB/llrb/llrb.go deleted file mode 100644 index 81373fbfdf..0000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/llrb.go +++ /dev/null @@ -1,456 +0,0 @@ -// Copyright 2010 Petar Maymounkov. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// A Left-Leaning Red-Black (LLRB) implementation of 2-3 balanced binary search trees, -// based on the following work: -// -// http://www.cs.princeton.edu/~rs/talks/LLRB/08Penn.pdf -// http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf -// http://www.cs.princeton.edu/~rs/talks/LLRB/Java/RedBlackBST.java -// -// 2-3 trees (and the run-time equivalent 2-3-4 trees) are the de facto standard BST -// algoritms found in implementations of Python, Java, and other libraries. The LLRB -// implementation of 2-3 trees is a recent improvement on the traditional implementation, -// observed and documented by Robert Sedgewick. -// -package llrb - -// Tree is a Left-Leaning Red-Black (LLRB) implementation of 2-3 trees -type LLRB struct { - count int - root *Node -} - -type Node struct { - Item - Left, Right *Node // Pointers to left and right child nodes - Black bool // If set, the color of the link (incoming from the parent) is black - // In the LLRB, new nodes are always red, hence the zero-value for node -} - -type Item interface { - Less(than Item) bool -} - -// -func less(x, y Item) bool { - if x == pinf { - return false - } - if x == ninf { - return true - } - return x.Less(y) -} - -// Inf returns an Item that is "bigger than" any other item, if sign is positive. -// Otherwise it returns an Item that is "smaller than" any other item. -func Inf(sign int) Item { - if sign == 0 { - panic("sign") - } - if sign > 0 { - return pinf - } - return ninf -} - -var ( - ninf = nInf{} - pinf = pInf{} -) - -type nInf struct{} - -func (nInf) Less(Item) bool { - return true -} - -type pInf struct{} - -func (pInf) Less(Item) bool { - return false -} - -// New() allocates a new tree -func New() *LLRB { - return &LLRB{} -} - -// SetRoot sets the root node of the tree. -// It is intended to be used by functions that deserialize the tree. -func (t *LLRB) SetRoot(r *Node) { - t.root = r -} - -// Root returns the root node of the tree. -// It is intended to be used by functions that serialize the tree. -func (t *LLRB) Root() *Node { - return t.root -} - -// Len returns the number of nodes in the tree. -func (t *LLRB) Len() int { return t.count } - -// Has returns true if the tree contains an element whose order is the same as that of key. -func (t *LLRB) Has(key Item) bool { - return t.Get(key) != nil -} - -// Get retrieves an element from the tree whose order is the same as that of key. -func (t *LLRB) Get(key Item) Item { - h := t.root - for h != nil { - switch { - case less(key, h.Item): - h = h.Left - case less(h.Item, key): - h = h.Right - default: - return h.Item - } - } - return nil -} - -// Min returns the minimum element in the tree. -func (t *LLRB) Min() Item { - h := t.root - if h == nil { - return nil - } - for h.Left != nil { - h = h.Left - } - return h.Item -} - -// Max returns the maximum element in the tree. -func (t *LLRB) Max() Item { - h := t.root - if h == nil { - return nil - } - for h.Right != nil { - h = h.Right - } - return h.Item -} - -func (t *LLRB) ReplaceOrInsertBulk(items ...Item) { - for _, i := range items { - t.ReplaceOrInsert(i) - } -} - -func (t *LLRB) InsertNoReplaceBulk(items ...Item) { - for _, i := range items { - t.InsertNoReplace(i) - } -} - -// ReplaceOrInsert inserts item into the tree. If an existing -// element has the same order, it is removed from the tree and returned. -func (t *LLRB) ReplaceOrInsert(item Item) Item { - if item == nil { - panic("inserting nil item") - } - var replaced Item - t.root, replaced = t.replaceOrInsert(t.root, item) - t.root.Black = true - if replaced == nil { - t.count++ - } - return replaced -} - -func (t *LLRB) replaceOrInsert(h *Node, item Item) (*Node, Item) { - if h == nil { - return newNode(item), nil - } - - h = walkDownRot23(h) - - var replaced Item - if less(item, h.Item) { // BUG - h.Left, replaced = t.replaceOrInsert(h.Left, item) - } else if less(h.Item, item) { - h.Right, replaced = t.replaceOrInsert(h.Right, item) - } else { - replaced, h.Item = h.Item, item - } - - h = walkUpRot23(h) - - return h, replaced -} - -// InsertNoReplace inserts item into the tree. If an existing -// element has the same order, both elements remain in the tree. -func (t *LLRB) InsertNoReplace(item Item) { - if item == nil { - panic("inserting nil item") - } - t.root = t.insertNoReplace(t.root, item) - t.root.Black = true - t.count++ -} - -func (t *LLRB) insertNoReplace(h *Node, item Item) *Node { - if h == nil { - return newNode(item) - } - - h = walkDownRot23(h) - - if less(item, h.Item) { - h.Left = t.insertNoReplace(h.Left, item) - } else { - h.Right = t.insertNoReplace(h.Right, item) - } - - return walkUpRot23(h) -} - -// Rotation driver routines for 2-3 algorithm - -func walkDownRot23(h *Node) *Node { return h } - -func walkUpRot23(h *Node) *Node { - if isRed(h.Right) && !isRed(h.Left) { - h = rotateLeft(h) - } - - if isRed(h.Left) && isRed(h.Left.Left) { - h = rotateRight(h) - } - - if isRed(h.Left) && isRed(h.Right) { - flip(h) - } - - return h -} - -// Rotation driver routines for 2-3-4 algorithm - -func walkDownRot234(h *Node) *Node { - if isRed(h.Left) && isRed(h.Right) { - flip(h) - } - - return h -} - -func walkUpRot234(h *Node) *Node { - if isRed(h.Right) && !isRed(h.Left) { - h = rotateLeft(h) - } - - if isRed(h.Left) && isRed(h.Left.Left) { - h = rotateRight(h) - } - - return h -} - -// DeleteMin deletes the minimum element in the tree and returns the -// deleted item or nil otherwise. -func (t *LLRB) DeleteMin() Item { - var deleted Item - t.root, deleted = deleteMin(t.root) - if t.root != nil { - t.root.Black = true - } - if deleted != nil { - t.count-- - } - return deleted -} - -// deleteMin code for LLRB 2-3 trees -func deleteMin(h *Node) (*Node, Item) { - if h == nil { - return nil, nil - } - if h.Left == nil { - return nil, h.Item - } - - if !isRed(h.Left) && !isRed(h.Left.Left) { - h = moveRedLeft(h) - } - - var deleted Item - h.Left, deleted = deleteMin(h.Left) - - return fixUp(h), deleted -} - -// DeleteMax deletes the maximum element in the tree and returns -// the deleted item or nil otherwise -func (t *LLRB) DeleteMax() Item { - var deleted Item - t.root, deleted = deleteMax(t.root) - if t.root != nil { - t.root.Black = true - } - if deleted != nil { - t.count-- - } - return deleted -} - -func deleteMax(h *Node) (*Node, Item) { - if h == nil { - return nil, nil - } - if isRed(h.Left) { - h = rotateRight(h) - } - if h.Right == nil { - return nil, h.Item - } - if !isRed(h.Right) && !isRed(h.Right.Left) { - h = moveRedRight(h) - } - var deleted Item - h.Right, deleted = deleteMax(h.Right) - - return fixUp(h), deleted -} - -// Delete deletes an item from the tree whose key equals key. -// The deleted item is return, otherwise nil is returned. -func (t *LLRB) Delete(key Item) Item { - var deleted Item - t.root, deleted = t.delete(t.root, key) - if t.root != nil { - t.root.Black = true - } - if deleted != nil { - t.count-- - } - return deleted -} - -func (t *LLRB) delete(h *Node, item Item) (*Node, Item) { - var deleted Item - if h == nil { - return nil, nil - } - if less(item, h.Item) { - if h.Left == nil { // item not present. Nothing to delete - return h, nil - } - if !isRed(h.Left) && !isRed(h.Left.Left) { - h = moveRedLeft(h) - } - h.Left, deleted = t.delete(h.Left, item) - } else { - if isRed(h.Left) { - h = rotateRight(h) - } - // If @item equals @h.Item and no right children at @h - if !less(h.Item, item) && h.Right == nil { - return nil, h.Item - } - // PETAR: Added 'h.Right != nil' below - if h.Right != nil && !isRed(h.Right) && !isRed(h.Right.Left) { - h = moveRedRight(h) - } - // If @item equals @h.Item, and (from above) 'h.Right != nil' - if !less(h.Item, item) { - var subDeleted Item - h.Right, subDeleted = deleteMin(h.Right) - if subDeleted == nil { - panic("logic") - } - deleted, h.Item = h.Item, subDeleted - } else { // Else, @item is bigger than @h.Item - h.Right, deleted = t.delete(h.Right, item) - } - } - - return fixUp(h), deleted -} - -// Internal node manipulation routines - -func newNode(item Item) *Node { return &Node{Item: item} } - -func isRed(h *Node) bool { - if h == nil { - return false - } - return !h.Black -} - -func rotateLeft(h *Node) *Node { - x := h.Right - if x.Black { - panic("rotating a black link") - } - h.Right = x.Left - x.Left = h - x.Black = h.Black - h.Black = false - return x -} - -func rotateRight(h *Node) *Node { - x := h.Left - if x.Black { - panic("rotating a black link") - } - h.Left = x.Right - x.Right = h - x.Black = h.Black - h.Black = false - return x -} - -// REQUIRE: Left and Right children must be present -func flip(h *Node) { - h.Black = !h.Black - h.Left.Black = !h.Left.Black - h.Right.Black = !h.Right.Black -} - -// REQUIRE: Left and Right children must be present -func moveRedLeft(h *Node) *Node { - flip(h) - if isRed(h.Right.Left) { - h.Right = rotateRight(h.Right) - h = rotateLeft(h) - flip(h) - } - return h -} - -// REQUIRE: Left and Right children must be present -func moveRedRight(h *Node) *Node { - flip(h) - if isRed(h.Left.Left) { - h = rotateRight(h) - flip(h) - } - return h -} - -func fixUp(h *Node) *Node { - if isRed(h.Right) { - h = rotateLeft(h) - } - - if isRed(h.Left) && isRed(h.Left.Left) { - h = rotateRight(h) - } - - if isRed(h.Left) && isRed(h.Right) { - flip(h) - } - - return h -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/llrb_test.go b/vendor/github.com/petar/GoLLRB/llrb/llrb_test.go deleted file mode 100644 index b7bc978007..0000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/llrb_test.go +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright 2010 Petar Maymounkov. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package llrb - -import ( - "math" - "math/rand" - "testing" -) - -func TestCases(t *testing.T) { - tree := New() - tree.ReplaceOrInsert(Int(1)) - tree.ReplaceOrInsert(Int(1)) - if tree.Len() != 1 { - t.Errorf("expecting len 1") - } - if !tree.Has(Int(1)) { - t.Errorf("expecting to find key=1") - } - - tree.Delete(Int(1)) - if tree.Len() != 0 { - t.Errorf("expecting len 0") - } - if tree.Has(Int(1)) { - t.Errorf("not expecting to find key=1") - } - - tree.Delete(Int(1)) - if tree.Len() != 0 { - t.Errorf("expecting len 0") - } - if tree.Has(Int(1)) { - t.Errorf("not expecting to find key=1") - } -} - -func TestReverseInsertOrder(t *testing.T) { - tree := New() - n := 100 - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(n - i)) - } - i := 0 - tree.AscendGreaterOrEqual(Int(0), func(item Item) bool { - i++ - if item.(Int) != Int(i) { - t.Errorf("bad order: got %d, expect %d", item.(Int), i) - } - return true - }) -} - -func TestRange(t *testing.T) { - tree := New() - order := []String{ - "ab", "aba", "abc", "a", "aa", "aaa", "b", "a-", "a!", - } - for _, i := range order { - tree.ReplaceOrInsert(i) - } - k := 0 - tree.AscendRange(String("ab"), String("ac"), func(item Item) bool { - if k > 3 { - t.Fatalf("returned more items than expected") - } - i1 := order[k] - i2 := item.(String) - if i1 != i2 { - t.Errorf("expecting %s, got %s", i1, i2) - } - k++ - return true - }) -} - -func TestRandomInsertOrder(t *testing.T) { - tree := New() - n := 1000 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - j := 0 - tree.AscendGreaterOrEqual(Int(0), func(item Item) bool { - if item.(Int) != Int(j) { - t.Fatalf("bad order") - } - j++ - return true - }) -} - -func TestRandomReplace(t *testing.T) { - tree := New() - n := 100 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - perm = rand.Perm(n) - for i := 0; i < n; i++ { - if replaced := tree.ReplaceOrInsert(Int(perm[i])); replaced == nil || replaced.(Int) != Int(perm[i]) { - t.Errorf("error replacing") - } - } -} - -func TestRandomInsertSequentialDelete(t *testing.T) { - tree := New() - n := 1000 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - for i := 0; i < n; i++ { - tree.Delete(Int(i)) - } -} - -func TestRandomInsertDeleteNonExistent(t *testing.T) { - tree := New() - n := 100 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - if tree.Delete(Int(200)) != nil { - t.Errorf("deleted non-existent item") - } - if tree.Delete(Int(-2)) != nil { - t.Errorf("deleted non-existent item") - } - for i := 0; i < n; i++ { - if u := tree.Delete(Int(i)); u == nil || u.(Int) != Int(i) { - t.Errorf("delete failed") - } - } - if tree.Delete(Int(200)) != nil { - t.Errorf("deleted non-existent item") - } - if tree.Delete(Int(-2)) != nil { - t.Errorf("deleted non-existent item") - } -} - -func TestRandomInsertPartialDeleteOrder(t *testing.T) { - tree := New() - n := 100 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - for i := 1; i < n-1; i++ { - tree.Delete(Int(i)) - } - j := 0 - tree.AscendGreaterOrEqual(Int(0), func(item Item) bool { - switch j { - case 0: - if item.(Int) != Int(0) { - t.Errorf("expecting 0") - } - case 1: - if item.(Int) != Int(n-1) { - t.Errorf("expecting %d", n-1) - } - } - j++ - return true - }) -} - -func TestRandomInsertStats(t *testing.T) { - tree := New() - n := 100000 - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.ReplaceOrInsert(Int(perm[i])) - } - avg, _ := tree.HeightStats() - expAvg := math.Log2(float64(n)) - 1.5 - if math.Abs(avg-expAvg) >= 2.0 { - t.Errorf("too much deviation from expected average height") - } -} - -func BenchmarkInsert(b *testing.B) { - tree := New() - for i := 0; i < b.N; i++ { - tree.ReplaceOrInsert(Int(b.N - i)) - } -} - -func BenchmarkDelete(b *testing.B) { - b.StopTimer() - tree := New() - for i := 0; i < b.N; i++ { - tree.ReplaceOrInsert(Int(b.N - i)) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - tree.Delete(Int(i)) - } -} - -func BenchmarkDeleteMin(b *testing.B) { - b.StopTimer() - tree := New() - for i := 0; i < b.N; i++ { - tree.ReplaceOrInsert(Int(b.N - i)) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - tree.DeleteMin() - } -} - -func TestInsertNoReplace(t *testing.T) { - tree := New() - n := 1000 - for q := 0; q < 2; q++ { - perm := rand.Perm(n) - for i := 0; i < n; i++ { - tree.InsertNoReplace(Int(perm[i])) - } - } - j := 0 - tree.AscendGreaterOrEqual(Int(0), func(item Item) bool { - if item.(Int) != Int(j/2) { - t.Fatalf("bad order") - } - j++ - return true - }) -} diff --git a/vendor/github.com/petar/GoLLRB/llrb/util.go b/vendor/github.com/petar/GoLLRB/llrb/util.go deleted file mode 100644 index 63dbdb2df0..0000000000 --- a/vendor/github.com/petar/GoLLRB/llrb/util.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2010 Petar Maymounkov. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package llrb - -type Int int - -func (x Int) Less(than Item) bool { - return x < than.(Int) -} - -type String string - -func (x String) Less(than Item) bool { - return x < than.(String) -} diff --git a/vendor/github.com/peterbourgon/diskv/LICENSE b/vendor/github.com/peterbourgon/diskv/LICENSE deleted file mode 100644 index 41ce7f16e1..0000000000 --- a/vendor/github.com/peterbourgon/diskv/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2012 Peter Bourgon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/peterbourgon/diskv/README.md b/vendor/github.com/peterbourgon/diskv/README.md deleted file mode 100644 index 3474739edc..0000000000 --- a/vendor/github.com/peterbourgon/diskv/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# What is diskv? - -Diskv (disk-vee) is a simple, persistent key-value store written in the Go -language. It starts with an incredibly simple API for storing arbitrary data on -a filesystem by key, and builds several layers of performance-enhancing -abstraction on top. The end result is a conceptually simple, but highly -performant, disk-backed storage system. - -[![Build Status][1]][2] - -[1]: https://drone.io/github.com/peterbourgon/diskv/status.png -[2]: https://drone.io/github.com/peterbourgon/diskv/latest - - -# Installing - -Install [Go 1][3], either [from source][4] or [with a prepackaged binary][5]. -Then, - -```bash -$ go get github.com/peterbourgon/diskv -``` - -[3]: http://golang.org -[4]: http://golang.org/doc/install/source -[5]: http://golang.org/doc/install - - -# Usage - -```go -package main - -import ( - "fmt" - "github.com/peterbourgon/diskv" -) - -func main() { - // Simplest transform function: put all the data files into the base dir. - flatTransform := func(s string) []string { return []string{} } - - // Initialize a new diskv store, rooted at "my-data-dir", with a 1MB cache. - d := diskv.New(diskv.Options{ - BasePath: "my-data-dir", - Transform: flatTransform, - CacheSizeMax: 1024 * 1024, - }) - - // Write three bytes to the key "alpha". - key := "alpha" - d.Write(key, []byte{'1', '2', '3'}) - - // Read the value back out of the store. - value, _ := d.Read(key) - fmt.Printf("%v\n", value) - - // Erase the key+value from the store (and the disk). - d.Erase(key) -} -``` - -More complex examples can be found in the "examples" subdirectory. - - -# Theory - -## Basic idea - -At its core, diskv is a map of a key (`string`) to arbitrary data (`[]byte`). -The data is written to a single file on disk, with the same name as the key. -The key determines where that file will be stored, via a user-provided -`TransformFunc`, which takes a key and returns a slice (`[]string`) -corresponding to a path list where the key file will be stored. The simplest -TransformFunc, - -```go -func SimpleTransform (key string) []string { - return []string{} -} -``` - -will place all keys in the same, base directory. The design is inspired by -[Redis diskstore][6]; a TransformFunc which emulates the default diskstore -behavior is available in the content-addressable-storage example. - -[6]: http://groups.google.com/group/redis-db/browse_thread/thread/d444bc786689bde9?pli=1 - -**Note** that your TransformFunc should ensure that one valid key doesn't -transform to a subset of another valid key. That is, it shouldn't be possible -to construct valid keys that resolve to directory names. As a concrete example, -if your TransformFunc splits on every 3 characters, then - -```go -d.Write("abcabc", val) // OK: written to /abc/abc/abcabc -d.Write("abc", val) // Error: attempted write to /abc/abc, but it's a directory -``` - -This will be addressed in an upcoming version of diskv. - -Probably the most important design principle behind diskv is that your data is -always flatly available on the disk. diskv will never do anything that would -prevent you from accessing, copying, backing up, or otherwise interacting with -your data via common UNIX commandline tools. - -## Adding a cache - -An in-memory caching layer is provided by combining the BasicStore -functionality with a simple map structure, and keeping it up-to-date as -appropriate. Since the map structure in Go is not threadsafe, it's combined -with a RWMutex to provide safe concurrent access. - -## Adding order - -diskv is a key-value store and therefore inherently unordered. An ordering -system can be injected into the store by passing something which satisfies the -diskv.Index interface. (A default implementation, using Google's -[btree][7] package, is provided.) Basically, diskv keeps an ordered (by a -user-provided Less function) index of the keys, which can be queried. - -[7]: https://github.com/google/btree - -## Adding compression - -Something which implements the diskv.Compression interface may be passed -during store creation, so that all Writes and Reads are filtered through -a compression/decompression pipeline. Several default implementations, -using stdlib compression algorithms, are provided. Note that data is cached -compressed; the cost of decompression is borne with each Read. - -## Streaming - -diskv also now provides ReadStream and WriteStream methods, to allow very large -data to be handled efficiently. - - -# Future plans - - * Needs plenty of robust testing: huge datasets, etc... - * More thorough benchmarking - * Your suggestions for use-cases I haven't thought of diff --git a/vendor/github.com/peterbourgon/diskv/basic_test.go b/vendor/github.com/peterbourgon/diskv/basic_test.go deleted file mode 100644 index 0ef0b17fe2..0000000000 --- a/vendor/github.com/peterbourgon/diskv/basic_test.go +++ /dev/null @@ -1,336 +0,0 @@ -package diskv - -import ( - "bytes" - "errors" - "testing" - "time" -) - -func cmpBytes(a, b []byte) bool { - if len(a) != len(b) { - return false - } - for i := 0; i < len(a); i++ { - if a[i] != b[i] { - return false - } - } - return true -} - -func (d *Diskv) isCached(key string) bool { - d.mu.RLock() - defer d.mu.RUnlock() - _, ok := d.cache[key] - return ok -} - -func TestWriteReadErase(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - }) - defer d.EraseAll() - k, v := "a", []byte{'b'} - if err := d.Write(k, v); err != nil { - t.Fatalf("write: %s", err) - } - if readVal, err := d.Read(k); err != nil { - t.Fatalf("read: %s", err) - } else if bytes.Compare(v, readVal) != 0 { - t.Fatalf("read: expected %s, got %s", v, readVal) - } - if err := d.Erase(k); err != nil { - t.Fatalf("erase: %s", err) - } -} - -func TestWRECache(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - }) - defer d.EraseAll() - k, v := "xxx", []byte{' ', ' ', ' '} - if d.isCached(k) { - t.Fatalf("key cached before Write and Read") - } - if err := d.Write(k, v); err != nil { - t.Fatalf("write: %s", err) - } - if d.isCached(k) { - t.Fatalf("key cached before Read") - } - if readVal, err := d.Read(k); err != nil { - t.Fatalf("read: %s", err) - } else if bytes.Compare(v, readVal) != 0 { - t.Fatalf("read: expected %s, got %s", v, readVal) - } - for i := 0; i < 10 && !d.isCached(k); i++ { - time.Sleep(10 * time.Millisecond) - } - if !d.isCached(k) { - t.Fatalf("key not cached after Read") - } - if err := d.Erase(k); err != nil { - t.Fatalf("erase: %s", err) - } - if d.isCached(k) { - t.Fatalf("key cached after Erase") - } -} - -func TestStrings(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - }) - defer d.EraseAll() - - keys := map[string]bool{"a": false, "b": false, "c": false, "d": false} - v := []byte{'1'} - for k := range keys { - if err := d.Write(k, v); err != nil { - t.Fatalf("write: %s: %s", k, err) - } - } - - for k := range d.Keys(nil) { - if _, present := keys[k]; present { - t.Logf("got: %s", k) - keys[k] = true - } else { - t.Fatalf("strings() returns unknown key: %s", k) - } - } - - for k, found := range keys { - if !found { - t.Errorf("never got %s", k) - } - } -} - -func TestZeroByteCache(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 0, - }) - defer d.EraseAll() - - k, v := "a", []byte{'1', '2', '3'} - if err := d.Write(k, v); err != nil { - t.Fatalf("Write: %s", err) - } - - if d.isCached(k) { - t.Fatalf("key cached, expected not-cached") - } - - if _, err := d.Read(k); err != nil { - t.Fatalf("Read: %s", err) - } - - if d.isCached(k) { - t.Fatalf("key cached, expected not-cached") - } -} - -func TestOneByteCache(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1, - }) - defer d.EraseAll() - - k1, k2, v1, v2 := "a", "b", []byte{'1'}, []byte{'1', '2'} - if err := d.Write(k1, v1); err != nil { - t.Fatal(err) - } - - if v, err := d.Read(k1); err != nil { - t.Fatal(err) - } else if !cmpBytes(v, v1) { - t.Fatalf("Read: expected %s, got %s", string(v1), string(v)) - } - - for i := 0; i < 10 && !d.isCached(k1); i++ { - time.Sleep(10 * time.Millisecond) - } - if !d.isCached(k1) { - t.Fatalf("expected 1-byte value to be cached, but it wasn't") - } - - if err := d.Write(k2, v2); err != nil { - t.Fatal(err) - } - if _, err := d.Read(k2); err != nil { - t.Fatalf("--> %s", err) - } - - for i := 0; i < 10 && (!d.isCached(k1) || d.isCached(k2)); i++ { - time.Sleep(10 * time.Millisecond) // just wait for lazy-cache - } - if !d.isCached(k1) { - t.Fatalf("1-byte value was uncached for no reason") - } - - if d.isCached(k2) { - t.Fatalf("2-byte value was cached, but cache max size is 1") - } -} - -func TestStaleCache(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1, - }) - defer d.EraseAll() - - k, first, second := "a", "first", "second" - if err := d.Write(k, []byte(first)); err != nil { - t.Fatal(err) - } - - v, err := d.Read(k) - if err != nil { - t.Fatal(err) - } - if string(v) != first { - t.Errorf("expected '%s', got '%s'", first, v) - } - - if err := d.Write(k, []byte(second)); err != nil { - t.Fatal(err) - } - - v, err = d.Read(k) - if err != nil { - t.Fatal(err) - } - - if string(v) != second { - t.Errorf("expected '%s', got '%s'", second, v) - } -} - -func TestHas(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - }) - defer d.EraseAll() - - for k, v := range map[string]string{ - "a": "1", - "foo": "2", - "012345": "3", - } { - d.Write(k, []byte(v)) - } - - d.Read("foo") // cache one of them - if !d.isCached("foo") { - t.Errorf("'foo' didn't get cached") - } - - for _, tuple := range []struct { - key string - expected bool - }{ - {"a", true}, - {"b", false}, - {"foo", true}, - {"bar", false}, - {"01234", false}, - {"012345", true}, - {"0123456", false}, - } { - if expected, got := tuple.expected, d.Has(tuple.key); expected != got { - t.Errorf("Has(%s): expected %v, got %v", tuple.key, expected, got) - } - } -} - -type BrokenReader struct{} - -func (BrokenReader) Read(p []byte) (n int, err error) { - return 0, errors.New("failed to read") -} - -func TestRemovesIncompleteFiles(t *testing.T) { - opts := Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - } - d := New(opts) - defer d.EraseAll() - - key, stream, sync := "key", BrokenReader{}, false - - if err := d.WriteStream(key, stream, sync); err == nil { - t.Fatalf("Expected i/o copy error, none received.") - } - - if _, err := d.Read(key); err == nil { - t.Fatal("Could read the key, but it shouldn't exist") - } -} - -func TestTempDir(t *testing.T) { - opts := Options{ - BasePath: "test-data", - TempDir: "test-data-temp", - CacheSizeMax: 1024, - } - d := New(opts) - defer d.EraseAll() - - k, v := "a", []byte{'b'} - if err := d.Write(k, v); err != nil { - t.Fatalf("write: %s", err) - } - if readVal, err := d.Read(k); err != nil { - t.Fatalf("read: %s", err) - } else if bytes.Compare(v, readVal) != 0 { - t.Fatalf("read: expected %s, got %s", v, readVal) - } - if err := d.Erase(k); err != nil { - t.Fatalf("erase: %s", err) - } -} - -type CrashingReader struct{} - -func (CrashingReader) Read(p []byte) (n int, err error) { - panic("System has crashed while reading the stream") -} - -func TestAtomicWrite(t *testing.T) { - opts := Options{ - BasePath: "test-data", - // Test would fail if TempDir is not set here. - TempDir: "test-data-temp", - CacheSizeMax: 1024, - } - d := New(opts) - defer d.EraseAll() - - key := "key" - func() { - defer func() { - recover() // Ignore panicking error - }() - - stream := CrashingReader{} - d.WriteStream(key, stream, false) - }() - - if d.Has(key) { - t.Fatal("Has key, but it shouldn't exist") - } - if _, ok := <-d.Keys(nil); ok { - t.Fatal("Store isn't empty") - } -} diff --git a/vendor/github.com/peterbourgon/diskv/compression.go b/vendor/github.com/peterbourgon/diskv/compression.go deleted file mode 100644 index 5192b02733..0000000000 --- a/vendor/github.com/peterbourgon/diskv/compression.go +++ /dev/null @@ -1,64 +0,0 @@ -package diskv - -import ( - "compress/flate" - "compress/gzip" - "compress/zlib" - "io" -) - -// Compression is an interface that Diskv uses to implement compression of -// data. Writer takes a destination io.Writer and returns a WriteCloser that -// compresses all data written through it. Reader takes a source io.Reader and -// returns a ReadCloser that decompresses all data read through it. You may -// define these methods on your own type, or use one of the NewCompression -// helpers. -type Compression interface { - Writer(dst io.Writer) (io.WriteCloser, error) - Reader(src io.Reader) (io.ReadCloser, error) -} - -// NewGzipCompression returns a Gzip-based Compression. -func NewGzipCompression() Compression { - return NewGzipCompressionLevel(flate.DefaultCompression) -} - -// NewGzipCompressionLevel returns a Gzip-based Compression with the given level. -func NewGzipCompressionLevel(level int) Compression { - return &genericCompression{ - wf: func(w io.Writer) (io.WriteCloser, error) { return gzip.NewWriterLevel(w, level) }, - rf: func(r io.Reader) (io.ReadCloser, error) { return gzip.NewReader(r) }, - } -} - -// NewZlibCompression returns a Zlib-based Compression. -func NewZlibCompression() Compression { - return NewZlibCompressionLevel(flate.DefaultCompression) -} - -// NewZlibCompressionLevel returns a Zlib-based Compression with the given level. -func NewZlibCompressionLevel(level int) Compression { - return NewZlibCompressionLevelDict(level, nil) -} - -// NewZlibCompressionLevelDict returns a Zlib-based Compression with the given -// level, based on the given dictionary. -func NewZlibCompressionLevelDict(level int, dict []byte) Compression { - return &genericCompression{ - func(w io.Writer) (io.WriteCloser, error) { return zlib.NewWriterLevelDict(w, level, dict) }, - func(r io.Reader) (io.ReadCloser, error) { return zlib.NewReaderDict(r, dict) }, - } -} - -type genericCompression struct { - wf func(w io.Writer) (io.WriteCloser, error) - rf func(r io.Reader) (io.ReadCloser, error) -} - -func (g *genericCompression) Writer(dst io.Writer) (io.WriteCloser, error) { - return g.wf(dst) -} - -func (g *genericCompression) Reader(src io.Reader) (io.ReadCloser, error) { - return g.rf(src) -} diff --git a/vendor/github.com/peterbourgon/diskv/compression_test.go b/vendor/github.com/peterbourgon/diskv/compression_test.go deleted file mode 100644 index 2d61420372..0000000000 --- a/vendor/github.com/peterbourgon/diskv/compression_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package diskv - -import ( - "compress/flate" - "fmt" - "math/rand" - "os" - "testing" - "time" -) - -func init() { - rand.Seed(time.Now().UnixNano()) -} - -func testCompressionWith(t *testing.T, c Compression, name string) { - d := New(Options{ - BasePath: "compression-test", - CacheSizeMax: 0, - Compression: c, - }) - defer d.EraseAll() - - sz := 4096 - val := make([]byte, sz) - for i := 0; i < sz; i++ { - val[i] = byte('a' + rand.Intn(26)) // {a-z}; should compress some - } - - key := "a" - if err := d.Write(key, val); err != nil { - t.Fatalf("write failed: %s", err) - } - - targetFile := fmt.Sprintf("%s%c%s", d.BasePath, os.PathSeparator, key) - fi, err := os.Stat(targetFile) - if err != nil { - t.Fatalf("%s: %s", targetFile, err) - } - - if fi.Size() >= int64(sz) { - t.Fatalf("%s: size=%d, expected smaller", targetFile, fi.Size()) - } - t.Logf("%s compressed %d to %d", name, sz, fi.Size()) - - readVal, err := d.Read(key) - if len(readVal) != sz { - t.Fatalf("read: expected size=%d, got size=%d", sz, len(readVal)) - } - - for i := 0; i < sz; i++ { - if readVal[i] != val[i] { - t.Fatalf("i=%d: expected %v, got %v", i, val[i], readVal[i]) - } - } -} - -func TestGzipDefault(t *testing.T) { - testCompressionWith(t, NewGzipCompression(), "gzip") -} - -func TestGzipBestCompression(t *testing.T) { - testCompressionWith(t, NewGzipCompressionLevel(flate.BestCompression), "gzip-max") -} - -func TestGzipBestSpeed(t *testing.T) { - testCompressionWith(t, NewGzipCompressionLevel(flate.BestSpeed), "gzip-min") -} - -func TestZlib(t *testing.T) { - testCompressionWith(t, NewZlibCompression(), "zlib") -} diff --git a/vendor/github.com/peterbourgon/diskv/diskv.go b/vendor/github.com/peterbourgon/diskv/diskv.go deleted file mode 100644 index 524dc0a6e3..0000000000 --- a/vendor/github.com/peterbourgon/diskv/diskv.go +++ /dev/null @@ -1,624 +0,0 @@ -// Diskv (disk-vee) is a simple, persistent, key-value store. -// It stores all data flatly on the filesystem. - -package diskv - -import ( - "bytes" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "sync" - "syscall" -) - -const ( - defaultBasePath = "diskv" - defaultFilePerm os.FileMode = 0666 - defaultPathPerm os.FileMode = 0777 -) - -var ( - defaultTransform = func(s string) []string { return []string{} } - errCanceled = errors.New("canceled") - errEmptyKey = errors.New("empty key") - errBadKey = errors.New("bad key") - errImportDirectory = errors.New("can't import a directory") -) - -// TransformFunction transforms a key into a slice of strings, with each -// element in the slice representing a directory in the file path where the -// key's entry will eventually be stored. -// -// For example, if TransformFunc transforms "abcdef" to ["ab", "cde", "f"], -// the final location of the data file will be /ab/cde/f/abcdef -type TransformFunction func(s string) []string - -// Options define a set of properties that dictate Diskv behavior. -// All values are optional. -type Options struct { - BasePath string - Transform TransformFunction - CacheSizeMax uint64 // bytes - PathPerm os.FileMode - FilePerm os.FileMode - // If TempDir is set, it will enable filesystem atomic writes by - // writing temporary files to that location before being moved - // to BasePath. - // Note that TempDir MUST be on the same device/partition as - // BasePath. - TempDir string - - Index Index - IndexLess LessFunction - - Compression Compression -} - -// Diskv implements the Diskv interface. You shouldn't construct Diskv -// structures directly; instead, use the New constructor. -type Diskv struct { - Options - mu sync.RWMutex - cache map[string][]byte - cacheSize uint64 -} - -// New returns an initialized Diskv structure, ready to use. -// If the path identified by baseDir already contains data, -// it will be accessible, but not yet cached. -func New(o Options) *Diskv { - if o.BasePath == "" { - o.BasePath = defaultBasePath - } - if o.Transform == nil { - o.Transform = defaultTransform - } - if o.PathPerm == 0 { - o.PathPerm = defaultPathPerm - } - if o.FilePerm == 0 { - o.FilePerm = defaultFilePerm - } - - d := &Diskv{ - Options: o, - cache: map[string][]byte{}, - cacheSize: 0, - } - - if d.Index != nil && d.IndexLess != nil { - d.Index.Initialize(d.IndexLess, d.Keys(nil)) - } - - return d -} - -// Write synchronously writes the key-value pair to disk, making it immediately -// available for reads. Write relies on the filesystem to perform an eventual -// sync to physical media. If you need stronger guarantees, see WriteStream. -func (d *Diskv) Write(key string, val []byte) error { - return d.WriteStream(key, bytes.NewBuffer(val), false) -} - -// WriteStream writes the data represented by the io.Reader to the disk, under -// the provided key. If sync is true, WriteStream performs an explicit sync on -// the file as soon as it's written. -// -// bytes.Buffer provides io.Reader semantics for basic data types. -func (d *Diskv) WriteStream(key string, r io.Reader, sync bool) error { - if len(key) <= 0 { - return errEmptyKey - } - - d.mu.Lock() - defer d.mu.Unlock() - - return d.writeStreamWithLock(key, r, sync) -} - -// createKeyFileWithLock either creates the key file directly, or -// creates a temporary file in TempDir if it is set. -func (d *Diskv) createKeyFileWithLock(key string) (*os.File, error) { - if d.TempDir != "" { - if err := os.MkdirAll(d.TempDir, d.PathPerm); err != nil { - return nil, fmt.Errorf("temp mkdir: %s", err) - } - f, err := ioutil.TempFile(d.TempDir, "") - if err != nil { - return nil, fmt.Errorf("temp file: %s", err) - } - - if err := f.Chmod(d.FilePerm); err != nil { - f.Close() // error deliberately ignored - os.Remove(f.Name()) // error deliberately ignored - return nil, fmt.Errorf("chmod: %s", err) - } - return f, nil - } - - mode := os.O_WRONLY | os.O_CREATE | os.O_TRUNC // overwrite if exists - f, err := os.OpenFile(d.completeFilename(key), mode, d.FilePerm) - if err != nil { - return nil, fmt.Errorf("open file: %s", err) - } - return f, nil -} - -// writeStream does no input validation checking. -func (d *Diskv) writeStreamWithLock(key string, r io.Reader, sync bool) error { - if err := d.ensurePathWithLock(key); err != nil { - return fmt.Errorf("ensure path: %s", err) - } - - f, err := d.createKeyFileWithLock(key) - if err != nil { - return fmt.Errorf("create key file: %s", err) - } - - wc := io.WriteCloser(&nopWriteCloser{f}) - if d.Compression != nil { - wc, err = d.Compression.Writer(f) - if err != nil { - f.Close() // error deliberately ignored - os.Remove(f.Name()) // error deliberately ignored - return fmt.Errorf("compression writer: %s", err) - } - } - - if _, err := io.Copy(wc, r); err != nil { - f.Close() // error deliberately ignored - os.Remove(f.Name()) // error deliberately ignored - return fmt.Errorf("i/o copy: %s", err) - } - - if err := wc.Close(); err != nil { - f.Close() // error deliberately ignored - os.Remove(f.Name()) // error deliberately ignored - return fmt.Errorf("compression close: %s", err) - } - - if sync { - if err := f.Sync(); err != nil { - f.Close() // error deliberately ignored - os.Remove(f.Name()) // error deliberately ignored - return fmt.Errorf("file sync: %s", err) - } - } - - if err := f.Close(); err != nil { - return fmt.Errorf("file close: %s", err) - } - - if f.Name() != d.completeFilename(key) { - if err := os.Rename(f.Name(), d.completeFilename(key)); err != nil { - os.Remove(f.Name()) // error deliberately ignored - return fmt.Errorf("rename: %s", err) - } - } - - if d.Index != nil { - d.Index.Insert(key) - } - - d.bustCacheWithLock(key) // cache only on read - - return nil -} - -// Import imports the source file into diskv under the destination key. If the -// destination key already exists, it's overwritten. If move is true, the -// source file is removed after a successful import. -func (d *Diskv) Import(srcFilename, dstKey string, move bool) (err error) { - if dstKey == "" { - return errEmptyKey - } - - if fi, err := os.Stat(srcFilename); err != nil { - return err - } else if fi.IsDir() { - return errImportDirectory - } - - d.mu.Lock() - defer d.mu.Unlock() - - if err := d.ensurePathWithLock(dstKey); err != nil { - return fmt.Errorf("ensure path: %s", err) - } - - if move { - if err := syscall.Rename(srcFilename, d.completeFilename(dstKey)); err == nil { - d.bustCacheWithLock(dstKey) - return nil - } else if err != syscall.EXDEV { - // If it failed due to being on a different device, fall back to copying - return err - } - } - - f, err := os.Open(srcFilename) - if err != nil { - return err - } - defer f.Close() - err = d.writeStreamWithLock(dstKey, f, false) - if err == nil && move { - err = os.Remove(srcFilename) - } - return err -} - -// Read reads the key and returns the value. -// If the key is available in the cache, Read won't touch the disk. -// If the key is not in the cache, Read will have the side-effect of -// lazily caching the value. -func (d *Diskv) Read(key string) ([]byte, error) { - rc, err := d.ReadStream(key, false) - if err != nil { - return []byte{}, err - } - defer rc.Close() - return ioutil.ReadAll(rc) -} - -// ReadStream reads the key and returns the value (data) as an io.ReadCloser. -// If the value is cached from a previous read, and direct is false, -// ReadStream will use the cached value. Otherwise, it will return a handle to -// the file on disk, and cache the data on read. -// -// If direct is true, ReadStream will lazily delete any cached value for the -// key, and return a direct handle to the file on disk. -// -// If compression is enabled, ReadStream taps into the io.Reader stream prior -// to decompression, and caches the compressed data. -func (d *Diskv) ReadStream(key string, direct bool) (io.ReadCloser, error) { - d.mu.RLock() - defer d.mu.RUnlock() - - if val, ok := d.cache[key]; ok { - if !direct { - buf := bytes.NewBuffer(val) - if d.Compression != nil { - return d.Compression.Reader(buf) - } - return ioutil.NopCloser(buf), nil - } - - go func() { - d.mu.Lock() - defer d.mu.Unlock() - d.uncacheWithLock(key, uint64(len(val))) - }() - } - - return d.readWithRLock(key) -} - -// read ignores the cache, and returns an io.ReadCloser representing the -// decompressed data for the given key, streamed from the disk. Clients should -// acquire a read lock on the Diskv and check the cache themselves before -// calling read. -func (d *Diskv) readWithRLock(key string) (io.ReadCloser, error) { - filename := d.completeFilename(key) - - fi, err := os.Stat(filename) - if err != nil { - return nil, err - } - if fi.IsDir() { - return nil, os.ErrNotExist - } - - f, err := os.Open(filename) - if err != nil { - return nil, err - } - - var r io.Reader - if d.CacheSizeMax > 0 { - r = newSiphon(f, d, key) - } else { - r = &closingReader{f} - } - - var rc = io.ReadCloser(ioutil.NopCloser(r)) - if d.Compression != nil { - rc, err = d.Compression.Reader(r) - if err != nil { - return nil, err - } - } - - return rc, nil -} - -// closingReader provides a Reader that automatically closes the -// embedded ReadCloser when it reaches EOF -type closingReader struct { - rc io.ReadCloser -} - -func (cr closingReader) Read(p []byte) (int, error) { - n, err := cr.rc.Read(p) - if err == io.EOF { - if closeErr := cr.rc.Close(); closeErr != nil { - return n, closeErr // close must succeed for Read to succeed - } - } - return n, err -} - -// siphon is like a TeeReader: it copies all data read through it to an -// internal buffer, and moves that buffer to the cache at EOF. -type siphon struct { - f *os.File - d *Diskv - key string - buf *bytes.Buffer -} - -// newSiphon constructs a siphoning reader that represents the passed file. -// When a successful series of reads ends in an EOF, the siphon will write -// the buffered data to Diskv's cache under the given key. -func newSiphon(f *os.File, d *Diskv, key string) io.Reader { - return &siphon{ - f: f, - d: d, - key: key, - buf: &bytes.Buffer{}, - } -} - -// Read implements the io.Reader interface for siphon. -func (s *siphon) Read(p []byte) (int, error) { - n, err := s.f.Read(p) - - if err == nil { - return s.buf.Write(p[0:n]) // Write must succeed for Read to succeed - } - - if err == io.EOF { - s.d.cacheWithoutLock(s.key, s.buf.Bytes()) // cache may fail - if closeErr := s.f.Close(); closeErr != nil { - return n, closeErr // close must succeed for Read to succeed - } - return n, err - } - - return n, err -} - -// Erase synchronously erases the given key from the disk and the cache. -func (d *Diskv) Erase(key string) error { - d.mu.Lock() - defer d.mu.Unlock() - - d.bustCacheWithLock(key) - - // erase from index - if d.Index != nil { - d.Index.Delete(key) - } - - // erase from disk - filename := d.completeFilename(key) - if s, err := os.Stat(filename); err == nil { - if s.IsDir() { - return errBadKey - } - if err = os.Remove(filename); err != nil { - return err - } - } else { - // Return err as-is so caller can do os.IsNotExist(err). - return err - } - - // clean up and return - d.pruneDirsWithLock(key) - return nil -} - -// EraseAll will delete all of the data from the store, both in the cache and on -// the disk. Note that EraseAll doesn't distinguish diskv-related data from non- -// diskv-related data. Care should be taken to always specify a diskv base -// directory that is exclusively for diskv data. -func (d *Diskv) EraseAll() error { - d.mu.Lock() - defer d.mu.Unlock() - d.cache = make(map[string][]byte) - d.cacheSize = 0 - if d.TempDir != "" { - os.RemoveAll(d.TempDir) // errors ignored - } - return os.RemoveAll(d.BasePath) -} - -// Has returns true if the given key exists. -func (d *Diskv) Has(key string) bool { - d.mu.Lock() - defer d.mu.Unlock() - - if _, ok := d.cache[key]; ok { - return true - } - - filename := d.completeFilename(key) - s, err := os.Stat(filename) - if err != nil { - return false - } - if s.IsDir() { - return false - } - - return true -} - -// Keys returns a channel that will yield every key accessible by the store, -// in undefined order. If a cancel channel is provided, closing it will -// terminate and close the keys channel. -func (d *Diskv) Keys(cancel <-chan struct{}) <-chan string { - return d.KeysPrefix("", cancel) -} - -// KeysPrefix returns a channel that will yield every key accessible by the -// store with the given prefix, in undefined order. If a cancel channel is -// provided, closing it will terminate and close the keys channel. If the -// provided prefix is the empty string, all keys will be yielded. -func (d *Diskv) KeysPrefix(prefix string, cancel <-chan struct{}) <-chan string { - var prepath string - if prefix == "" { - prepath = d.BasePath - } else { - prepath = d.pathFor(prefix) - } - c := make(chan string) - go func() { - filepath.Walk(prepath, walker(c, prefix, cancel)) - close(c) - }() - return c -} - -// walker returns a function which satisfies the filepath.WalkFunc interface. -// It sends every non-directory file entry down the channel c. -func walker(c chan<- string, prefix string, cancel <-chan struct{}) filepath.WalkFunc { - return func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - - if info.IsDir() || !strings.HasPrefix(info.Name(), prefix) { - return nil // "pass" - } - - select { - case c <- info.Name(): - case <-cancel: - return errCanceled - } - - return nil - } -} - -// pathFor returns the absolute path for location on the filesystem where the -// data for the given key will be stored. -func (d *Diskv) pathFor(key string) string { - return filepath.Join(d.BasePath, filepath.Join(d.Transform(key)...)) -} - -// ensurePathWithLock is a helper function that generates all necessary -// directories on the filesystem for the given key. -func (d *Diskv) ensurePathWithLock(key string) error { - return os.MkdirAll(d.pathFor(key), d.PathPerm) -} - -// completeFilename returns the absolute path to the file for the given key. -func (d *Diskv) completeFilename(key string) string { - return filepath.Join(d.pathFor(key), key) -} - -// cacheWithLock attempts to cache the given key-value pair in the store's -// cache. It can fail if the value is larger than the cache's maximum size. -func (d *Diskv) cacheWithLock(key string, val []byte) error { - valueSize := uint64(len(val)) - if err := d.ensureCacheSpaceWithLock(valueSize); err != nil { - return fmt.Errorf("%s; not caching", err) - } - - // be very strict about memory guarantees - if (d.cacheSize + valueSize) > d.CacheSizeMax { - panic(fmt.Sprintf("failed to make room for value (%d/%d)", valueSize, d.CacheSizeMax)) - } - - d.cache[key] = val - d.cacheSize += valueSize - return nil -} - -// cacheWithoutLock acquires the store's (write) mutex and calls cacheWithLock. -func (d *Diskv) cacheWithoutLock(key string, val []byte) error { - d.mu.Lock() - defer d.mu.Unlock() - return d.cacheWithLock(key, val) -} - -func (d *Diskv) bustCacheWithLock(key string) { - if val, ok := d.cache[key]; ok { - d.uncacheWithLock(key, uint64(len(val))) - } -} - -func (d *Diskv) uncacheWithLock(key string, sz uint64) { - d.cacheSize -= sz - delete(d.cache, key) -} - -// pruneDirsWithLock deletes empty directories in the path walk leading to the -// key k. Typically this function is called after an Erase is made. -func (d *Diskv) pruneDirsWithLock(key string) error { - pathlist := d.Transform(key) - for i := range pathlist { - dir := filepath.Join(d.BasePath, filepath.Join(pathlist[:len(pathlist)-i]...)) - - // thanks to Steven Blenkinsop for this snippet - switch fi, err := os.Stat(dir); true { - case err != nil: - return err - case !fi.IsDir(): - panic(fmt.Sprintf("corrupt dirstate at %s", dir)) - } - - nlinks, err := filepath.Glob(filepath.Join(dir, "*")) - if err != nil { - return err - } else if len(nlinks) > 0 { - return nil // has subdirs -- do not prune - } - if err = os.Remove(dir); err != nil { - return err - } - } - - return nil -} - -// ensureCacheSpaceWithLock deletes entries from the cache in arbitrary order -// until the cache has at least valueSize bytes available. -func (d *Diskv) ensureCacheSpaceWithLock(valueSize uint64) error { - if valueSize > d.CacheSizeMax { - return fmt.Errorf("value size (%d bytes) too large for cache (%d bytes)", valueSize, d.CacheSizeMax) - } - - safe := func() bool { return (d.cacheSize + valueSize) <= d.CacheSizeMax } - - for key, val := range d.cache { - if safe() { - break - } - - d.uncacheWithLock(key, uint64(len(val))) - } - - if !safe() { - panic(fmt.Sprintf("%d bytes still won't fit in the cache! (max %d bytes)", valueSize, d.CacheSizeMax)) - } - - return nil -} - -// nopWriteCloser wraps an io.Writer and provides a no-op Close method to -// satisfy the io.WriteCloser interface. -type nopWriteCloser struct { - io.Writer -} - -func (wc *nopWriteCloser) Write(p []byte) (int, error) { return wc.Writer.Write(p) } -func (wc *nopWriteCloser) Close() error { return nil } diff --git a/vendor/github.com/peterbourgon/diskv/examples/content-addressable-store/cas.go b/vendor/github.com/peterbourgon/diskv/examples/content-addressable-store/cas.go deleted file mode 100644 index a3abaaf775..0000000000 --- a/vendor/github.com/peterbourgon/diskv/examples/content-addressable-store/cas.go +++ /dev/null @@ -1,63 +0,0 @@ -package main - -import ( - "crypto/md5" - "fmt" - "io" - - "github.com/peterbourgon/diskv" -) - -const transformBlockSize = 2 // grouping of chars per directory depth - -func blockTransform(s string) []string { - var ( - sliceSize = len(s) / transformBlockSize - pathSlice = make([]string, sliceSize) - ) - for i := 0; i < sliceSize; i++ { - from, to := i*transformBlockSize, (i*transformBlockSize)+transformBlockSize - pathSlice[i] = s[from:to] - } - return pathSlice -} - -func main() { - d := diskv.New(diskv.Options{ - BasePath: "data", - Transform: blockTransform, - CacheSizeMax: 1024 * 1024, // 1MB - }) - - for _, valueStr := range []string{ - "I am the very model of a modern Major-General", - "I've information vegetable, animal, and mineral", - "I know the kings of England, and I quote the fights historical", - "From Marathon to Waterloo, in order categorical", - "I'm very well acquainted, too, with matters mathematical", - "I understand equations, both the simple and quadratical", - "About binomial theorem I'm teeming with a lot o' news", - "With many cheerful facts about the square of the hypotenuse", - } { - d.Write(md5sum(valueStr), []byte(valueStr)) - } - - var keyCount int - for key := range d.Keys(nil) { - val, err := d.Read(key) - if err != nil { - panic(fmt.Sprintf("key %s had no value", key)) - } - fmt.Printf("%s: %s\n", key, val) - keyCount++ - } - fmt.Printf("%d total keys\n", keyCount) - - // d.EraseAll() // leave it commented out to see how data is kept on disk -} - -func md5sum(s string) string { - h := md5.New() - io.WriteString(h, s) - return fmt.Sprintf("%x", h.Sum(nil)) -} diff --git a/vendor/github.com/peterbourgon/diskv/examples/super-simple-store/super-simple-store.go b/vendor/github.com/peterbourgon/diskv/examples/super-simple-store/super-simple-store.go deleted file mode 100644 index b5da11d646..0000000000 --- a/vendor/github.com/peterbourgon/diskv/examples/super-simple-store/super-simple-store.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/peterbourgon/diskv" -) - -func main() { - d := diskv.New(diskv.Options{ - BasePath: "my-diskv-data-directory", - Transform: func(s string) []string { return []string{} }, - CacheSizeMax: 1024 * 1024, // 1MB - }) - - key := "alpha" - if err := d.Write(key, []byte{'1', '2', '3'}); err != nil { - panic(err) - } - - value, err := d.Read(key) - if err != nil { - panic(err) - } - fmt.Printf("%v\n", value) - - if err := d.Erase(key); err != nil { - panic(err) - } -} diff --git a/vendor/github.com/peterbourgon/diskv/import_test.go b/vendor/github.com/peterbourgon/diskv/import_test.go deleted file mode 100644 index a08ac7c70c..0000000000 --- a/vendor/github.com/peterbourgon/diskv/import_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package diskv_test - -import ( - "bytes" - "io/ioutil" - "os" - - "github.com/peterbourgon/diskv" - - "testing" -) - -func TestImportMove(t *testing.T) { - b := []byte(`0123456789`) - f, err := ioutil.TempFile("", "temp-test") - if err != nil { - t.Fatal(err) - } - if _, err := f.Write(b); err != nil { - t.Fatal(err) - } - f.Close() - - d := diskv.New(diskv.Options{ - BasePath: "test-import-move", - }) - defer d.EraseAll() - - key := "key" - - if err := d.Write(key, []byte(`TBD`)); err != nil { - t.Fatal(err) - } - - if err := d.Import(f.Name(), key, true); err != nil { - t.Fatal(err) - } - - if _, err := os.Stat(f.Name()); err == nil || !os.IsNotExist(err) { - t.Errorf("expected temp file to be gone, but err = %v", err) - } - - if !d.Has(key) { - t.Errorf("%q not present", key) - } - - if buf, err := d.Read(key); err != nil || bytes.Compare(b, buf) != 0 { - t.Errorf("want %q, have %q (err = %v)", string(b), string(buf), err) - } -} - -func TestImportCopy(t *testing.T) { - b := []byte(`¡åéîòü!`) - - f, err := ioutil.TempFile("", "temp-test") - if err != nil { - t.Fatal(err) - } - if _, err := f.Write(b); err != nil { - t.Fatal(err) - } - f.Close() - - d := diskv.New(diskv.Options{ - BasePath: "test-import-copy", - }) - defer d.EraseAll() - - if err := d.Import(f.Name(), "key", false); err != nil { - t.Fatal(err) - } - - if _, err := os.Stat(f.Name()); err != nil { - t.Errorf("expected temp file to remain, but got err = %v", err) - } -} diff --git a/vendor/github.com/peterbourgon/diskv/index.go b/vendor/github.com/peterbourgon/diskv/index.go deleted file mode 100644 index 96fee5152b..0000000000 --- a/vendor/github.com/peterbourgon/diskv/index.go +++ /dev/null @@ -1,115 +0,0 @@ -package diskv - -import ( - "sync" - - "github.com/google/btree" -) - -// Index is a generic interface for things that can -// provide an ordered list of keys. -type Index interface { - Initialize(less LessFunction, keys <-chan string) - Insert(key string) - Delete(key string) - Keys(from string, n int) []string -} - -// LessFunction is used to initialize an Index of keys in a specific order. -type LessFunction func(string, string) bool - -// btreeString is a custom data type that satisfies the BTree Less interface, -// making the strings it wraps sortable by the BTree package. -type btreeString struct { - s string - l LessFunction -} - -// Less satisfies the BTree.Less interface using the btreeString's LessFunction. -func (s btreeString) Less(i btree.Item) bool { - return s.l(s.s, i.(btreeString).s) -} - -// BTreeIndex is an implementation of the Index interface using google/btree. -type BTreeIndex struct { - sync.RWMutex - LessFunction - *btree.BTree -} - -// Initialize populates the BTree tree with data from the keys channel, -// according to the passed less function. It's destructive to the BTreeIndex. -func (i *BTreeIndex) Initialize(less LessFunction, keys <-chan string) { - i.Lock() - defer i.Unlock() - i.LessFunction = less - i.BTree = rebuild(less, keys) -} - -// Insert inserts the given key (only) into the BTree tree. -func (i *BTreeIndex) Insert(key string) { - i.Lock() - defer i.Unlock() - if i.BTree == nil || i.LessFunction == nil { - panic("uninitialized index") - } - i.BTree.ReplaceOrInsert(btreeString{s: key, l: i.LessFunction}) -} - -// Delete removes the given key (only) from the BTree tree. -func (i *BTreeIndex) Delete(key string) { - i.Lock() - defer i.Unlock() - if i.BTree == nil || i.LessFunction == nil { - panic("uninitialized index") - } - i.BTree.Delete(btreeString{s: key, l: i.LessFunction}) -} - -// Keys yields a maximum of n keys in order. If the passed 'from' key is empty, -// Keys will return the first n keys. If the passed 'from' key is non-empty, the -// first key in the returned slice will be the key that immediately follows the -// passed key, in key order. -func (i *BTreeIndex) Keys(from string, n int) []string { - i.RLock() - defer i.RUnlock() - - if i.BTree == nil || i.LessFunction == nil { - panic("uninitialized index") - } - - if i.BTree.Len() <= 0 { - return []string{} - } - - btreeFrom := btreeString{s: from, l: i.LessFunction} - skipFirst := true - if len(from) <= 0 || !i.BTree.Has(btreeFrom) { - // no such key, so fabricate an always-smallest item - btreeFrom = btreeString{s: "", l: func(string, string) bool { return true }} - skipFirst = false - } - - keys := []string{} - iterator := func(i btree.Item) bool { - keys = append(keys, i.(btreeString).s) - return len(keys) < n - } - i.BTree.AscendGreaterOrEqual(btreeFrom, iterator) - - if skipFirst && len(keys) > 0 { - keys = keys[1:] - } - - return keys -} - -// rebuildIndex does the work of regenerating the index -// with the given keys. -func rebuild(less LessFunction, keys <-chan string) *btree.BTree { - tree := btree.New(2) - for key := range keys { - tree.ReplaceOrInsert(btreeString{s: key, l: less}) - } - return tree -} diff --git a/vendor/github.com/peterbourgon/diskv/index_test.go b/vendor/github.com/peterbourgon/diskv/index_test.go deleted file mode 100644 index 72f52a9ff9..0000000000 --- a/vendor/github.com/peterbourgon/diskv/index_test.go +++ /dev/null @@ -1,148 +0,0 @@ -package diskv - -import ( - "bytes" - "reflect" - "testing" - "time" -) - -func strLess(a, b string) bool { return a < b } - -func cmpStrings(a, b []string) bool { - if len(a) != len(b) { - return false - } - for i := 0; i < len(a); i++ { - if a[i] != b[i] { - return false - } - } - return true -} - -func (d *Diskv) isIndexed(key string) bool { - if d.Index == nil { - return false - } - - for _, got := range d.Index.Keys("", 1000) { - if got == key { - return true - } - } - return false -} - -func TestIndexOrder(t *testing.T) { - d := New(Options{ - BasePath: "index-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 1024, - Index: &BTreeIndex{}, - IndexLess: strLess, - }) - defer d.EraseAll() - - v := []byte{'1', '2', '3'} - d.Write("a", v) - if !d.isIndexed("a") { - t.Fatalf("'a' not indexed after write") - } - d.Write("1", v) - d.Write("m", v) - d.Write("-", v) - d.Write("A", v) - - expectedKeys := []string{"-", "1", "A", "a", "m"} - keys := []string{} - for _, key := range d.Index.Keys("", 100) { - keys = append(keys, key) - } - - if !cmpStrings(keys, expectedKeys) { - t.Fatalf("got %s, expected %s", keys, expectedKeys) - } -} - -func TestIndexLoad(t *testing.T) { - d1 := New(Options{ - BasePath: "index-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 1024, - }) - defer d1.EraseAll() - - val := []byte{'1', '2', '3'} - keys := []string{"a", "b", "c", "d", "e", "f", "g"} - for _, key := range keys { - d1.Write(key, val) - } - - d2 := New(Options{ - BasePath: "index-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 1024, - Index: &BTreeIndex{}, - IndexLess: strLess, - }) - defer d2.EraseAll() - - // check d2 has properly loaded existing d1 data - for _, key := range keys { - if !d2.isIndexed(key) { - t.Fatalf("key '%s' not indexed on secondary", key) - } - } - - // cache one - if readValue, err := d2.Read(keys[0]); err != nil { - t.Fatalf("%s", err) - } else if bytes.Compare(val, readValue) != 0 { - t.Fatalf("%s: got %s, expected %s", keys[0], readValue, val) - } - - // make sure it got cached - for i := 0; i < 10 && !d2.isCached(keys[0]); i++ { - time.Sleep(10 * time.Millisecond) - } - if !d2.isCached(keys[0]) { - t.Fatalf("key '%s' not cached", keys[0]) - } - - // kill the disk - d1.EraseAll() - - // cached value should still be there in the second - if readValue, err := d2.Read(keys[0]); err != nil { - t.Fatalf("%s", err) - } else if bytes.Compare(val, readValue) != 0 { - t.Fatalf("%s: got %s, expected %s", keys[0], readValue, val) - } - - // but not in the original - if _, err := d1.Read(keys[0]); err == nil { - t.Fatalf("expected error reading from flushed store") - } -} - -func TestIndexKeysEmptyFrom(t *testing.T) { - d := New(Options{ - BasePath: "index-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 1024, - Index: &BTreeIndex{}, - IndexLess: strLess, - }) - defer d.EraseAll() - - for _, k := range []string{"a", "c", "z", "b", "x", "b", "y"} { - d.Write(k, []byte("1")) - } - - want := []string{"a", "b", "c", "x", "y", "z"} - have := d.Index.Keys("", 99) - if !reflect.DeepEqual(want, have) { - t.Errorf("want %v, have %v", want, have) - } -} diff --git a/vendor/github.com/peterbourgon/diskv/issues_test.go b/vendor/github.com/peterbourgon/diskv/issues_test.go deleted file mode 100644 index 0b0b109082..0000000000 --- a/vendor/github.com/peterbourgon/diskv/issues_test.go +++ /dev/null @@ -1,121 +0,0 @@ -package diskv - -import ( - "bytes" - "io/ioutil" - "sync" - "testing" - "time" -) - -// ReadStream from cache shouldn't panic on a nil dereference from a nonexistent -// Compression :) -func TestIssue2A(t *testing.T) { - d := New(Options{ - BasePath: "test-issue-2a", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 1024, - }) - defer d.EraseAll() - - input := "abcdefghijklmnopqrstuvwxy" - key, writeBuf, sync := "a", bytes.NewBufferString(input), false - if err := d.WriteStream(key, writeBuf, sync); err != nil { - t.Fatal(err) - } - - for i := 0; i < 2; i++ { - began := time.Now() - rc, err := d.ReadStream(key, false) - if err != nil { - t.Fatal(err) - } - buf, err := ioutil.ReadAll(rc) - if err != nil { - t.Fatal(err) - } - if !cmpBytes(buf, []byte(input)) { - t.Fatalf("read #%d: '%s' != '%s'", i+1, string(buf), input) - } - rc.Close() - t.Logf("read #%d in %s", i+1, time.Since(began)) - } -} - -// ReadStream on a key that resolves to a directory should return an error. -func TestIssue2B(t *testing.T) { - blockTransform := func(s string) []string { - transformBlockSize := 3 - sliceSize := len(s) / transformBlockSize - pathSlice := make([]string, sliceSize) - for i := 0; i < sliceSize; i++ { - from, to := i*transformBlockSize, (i*transformBlockSize)+transformBlockSize - pathSlice[i] = s[from:to] - } - return pathSlice - } - - d := New(Options{ - BasePath: "test-issue-2b", - Transform: blockTransform, - CacheSizeMax: 0, - }) - defer d.EraseAll() - - v := []byte{'1', '2', '3'} - if err := d.Write("abcabc", v); err != nil { - t.Fatal(err) - } - - _, err := d.ReadStream("abc", false) - if err == nil { - t.Fatal("ReadStream('abc') should return error") - } - t.Logf("ReadStream('abc') returned error: %v", err) -} - -// Ensure ReadStream with direct=true isn't racy. -func TestIssue17(t *testing.T) { - var ( - basePath = "test-data" - ) - - dWrite := New(Options{ - BasePath: basePath, - CacheSizeMax: 0, - }) - defer dWrite.EraseAll() - - dRead := New(Options{ - BasePath: basePath, - CacheSizeMax: 50, - }) - - cases := map[string]string{ - "a": `1234567890`, - "b": `2345678901`, - "c": `3456789012`, - "d": `4567890123`, - "e": `5678901234`, - } - - for k, v := range cases { - if err := dWrite.Write(k, []byte(v)); err != nil { - t.Fatalf("during write: %s", err) - } - dRead.Read(k) // ensure it's added to cache - } - - var wg sync.WaitGroup - start := make(chan struct{}) - for k, v := range cases { - wg.Add(1) - go func(k, v string) { - <-start - dRead.ReadStream(k, true) - wg.Done() - }(k, v) - } - close(start) - wg.Wait() -} diff --git a/vendor/github.com/peterbourgon/diskv/keys_test.go b/vendor/github.com/peterbourgon/diskv/keys_test.go deleted file mode 100644 index 222e1c4441..0000000000 --- a/vendor/github.com/peterbourgon/diskv/keys_test.go +++ /dev/null @@ -1,231 +0,0 @@ -package diskv_test - -import ( - "reflect" - "runtime" - "strings" - "testing" - - "github.com/peterbourgon/diskv" -) - -var ( - keysTestData = map[string]string{ - "ab01cd01": "When we started building CoreOS", - "ab01cd02": "we looked at all the various components available to us", - "ab01cd03": "re-using the best tools", - "ef01gh04": "and building the ones that did not exist", - "ef02gh05": "We believe strongly in the Unix philosophy", - "xxxxxxxx": "tools should be independently useful", - } - - prefixes = []string{ - "", // all - "a", - "ab", - "ab0", - "ab01", - "ab01cd0", - "ab01cd01", - "ab01cd01x", // none - "b", // none - "b0", // none - "0", // none - "01", // none - "e", - "ef", - "efx", // none - "ef01gh0", - "ef01gh04", - "ef01gh05", - "ef01gh06", // none - } -) - -func TestKeysFlat(t *testing.T) { - transform := func(s string) []string { - if s == "" { - t.Fatalf(`transform should not be called with ""`) - } - return []string{} - } - d := diskv.New(diskv.Options{ - BasePath: "test-data", - Transform: transform, - }) - defer d.EraseAll() - - for k, v := range keysTestData { - d.Write(k, []byte(v)) - } - - checkKeys(t, d.Keys(nil), keysTestData) -} - -func TestKeysNested(t *testing.T) { - d := diskv.New(diskv.Options{ - BasePath: "test-data", - Transform: blockTransform(2), - }) - defer d.EraseAll() - - for k, v := range keysTestData { - d.Write(k, []byte(v)) - } - - checkKeys(t, d.Keys(nil), keysTestData) -} - -func TestKeysPrefixFlat(t *testing.T) { - d := diskv.New(diskv.Options{ - BasePath: "test-data", - }) - defer d.EraseAll() - - for k, v := range keysTestData { - d.Write(k, []byte(v)) - } - - for _, prefix := range prefixes { - checkKeys(t, d.KeysPrefix(prefix, nil), filterPrefix(keysTestData, prefix)) - } -} - -func TestKeysPrefixNested(t *testing.T) { - d := diskv.New(diskv.Options{ - BasePath: "test-data", - Transform: blockTransform(2), - }) - defer d.EraseAll() - - for k, v := range keysTestData { - d.Write(k, []byte(v)) - } - - for _, prefix := range prefixes { - checkKeys(t, d.KeysPrefix(prefix, nil), filterPrefix(keysTestData, prefix)) - } -} - -func TestKeysCancel(t *testing.T) { - d := diskv.New(diskv.Options{ - BasePath: "test-data", - }) - defer d.EraseAll() - - for k, v := range keysTestData { - d.Write(k, []byte(v)) - } - - var ( - cancel = make(chan struct{}) - received = 0 - cancelAfter = len(keysTestData) / 2 - ) - - for key := range d.Keys(cancel) { - received++ - - if received >= cancelAfter { - close(cancel) - runtime.Gosched() // allow walker to detect cancel - } - - t.Logf("received %d: %q", received, key) - } - - if want, have := cancelAfter, received; want != have { - t.Errorf("want %d, have %d") - } -} - -func checkKeys(t *testing.T, c <-chan string, want map[string]string) { - for k := range c { - if _, ok := want[k]; !ok { - t.Errorf("%q yielded but not expected", k) - continue - } - - delete(want, k) - t.Logf("%q yielded OK", k) - } - - if len(want) != 0 { - t.Errorf("%d expected key(s) not yielded: %s", len(want), strings.Join(flattenKeys(want), ", ")) - } -} - -func blockTransform(blockSize int) func(string) []string { - return func(s string) []string { - var ( - sliceSize = len(s) / blockSize - pathSlice = make([]string, sliceSize) - ) - for i := 0; i < sliceSize; i++ { - from, to := i*blockSize, (i*blockSize)+blockSize - pathSlice[i] = s[from:to] - } - return pathSlice - } -} - -func filterPrefix(in map[string]string, prefix string) map[string]string { - out := map[string]string{} - for k, v := range in { - if strings.HasPrefix(k, prefix) { - out[k] = v - } - } - return out -} - -func TestFilterPrefix(t *testing.T) { - input := map[string]string{ - "all": "", - "and": "", - "at": "", - "available": "", - "best": "", - "building": "", - "components": "", - "coreos": "", - "did": "", - "exist": "", - "looked": "", - "not": "", - "ones": "", - "re-using": "", - "started": "", - "that": "", - "the": "", - "to": "", - "tools": "", - "us": "", - "various": "", - "we": "", - "when": "", - } - - for prefix, want := range map[string]map[string]string{ - "a": map[string]string{"all": "", "and": "", "at": "", "available": ""}, - "al": map[string]string{"all": ""}, - "all": map[string]string{"all": ""}, - "alll": map[string]string{}, - "c": map[string]string{"components": "", "coreos": ""}, - "co": map[string]string{"components": "", "coreos": ""}, - "com": map[string]string{"components": ""}, - } { - have := filterPrefix(input, prefix) - if !reflect.DeepEqual(want, have) { - t.Errorf("%q: want %v, have %v", prefix, flattenKeys(want), flattenKeys(have)) - } - } -} - -func flattenKeys(m map[string]string) []string { - a := make([]string, 0, len(m)) - for k := range m { - a = append(a, k) - } - return a -} diff --git a/vendor/github.com/peterbourgon/diskv/speed_test.go b/vendor/github.com/peterbourgon/diskv/speed_test.go deleted file mode 100644 index 67d05ff27e..0000000000 --- a/vendor/github.com/peterbourgon/diskv/speed_test.go +++ /dev/null @@ -1,153 +0,0 @@ -package diskv - -import ( - "fmt" - "math/rand" - "testing" -) - -func shuffle(keys []string) { - ints := rand.Perm(len(keys)) - for i := range keys { - keys[i], keys[ints[i]] = keys[ints[i]], keys[i] - } -} - -func genValue(size int) []byte { - v := make([]byte, size) - for i := 0; i < size; i++ { - v[i] = uint8((rand.Int() % 26) + 97) // a-z - } - return v -} - -const ( - keyCount = 1000 -) - -func genKeys() []string { - keys := make([]string, keyCount) - for i := 0; i < keyCount; i++ { - keys[i] = fmt.Sprintf("%d", i) - } - return keys -} - -func (d *Diskv) load(keys []string, val []byte) { - for _, key := range keys { - d.Write(key, val) - } -} - -func benchRead(b *testing.B, size, cachesz int) { - b.StopTimer() - d := New(Options{ - BasePath: "speed-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: uint64(cachesz), - }) - defer d.EraseAll() - - keys := genKeys() - value := genValue(size) - d.load(keys, value) - shuffle(keys) - b.SetBytes(int64(size)) - - b.StartTimer() - for i := 0; i < b.N; i++ { - _, _ = d.Read(keys[i%len(keys)]) - } - b.StopTimer() -} - -func benchWrite(b *testing.B, size int, withIndex bool) { - b.StopTimer() - - options := Options{ - BasePath: "speed-test", - Transform: func(string) []string { return []string{} }, - CacheSizeMax: 0, - } - if withIndex { - options.Index = &BTreeIndex{} - options.IndexLess = strLess - } - - d := New(options) - defer d.EraseAll() - keys := genKeys() - value := genValue(size) - shuffle(keys) - b.SetBytes(int64(size)) - - b.StartTimer() - for i := 0; i < b.N; i++ { - d.Write(keys[i%len(keys)], value) - } - b.StopTimer() -} - -func BenchmarkWrite__32B_NoIndex(b *testing.B) { - benchWrite(b, 32, false) -} - -func BenchmarkWrite__1KB_NoIndex(b *testing.B) { - benchWrite(b, 1024, false) -} - -func BenchmarkWrite__4KB_NoIndex(b *testing.B) { - benchWrite(b, 4096, false) -} - -func BenchmarkWrite_10KB_NoIndex(b *testing.B) { - benchWrite(b, 10240, false) -} - -func BenchmarkWrite__32B_WithIndex(b *testing.B) { - benchWrite(b, 32, true) -} - -func BenchmarkWrite__1KB_WithIndex(b *testing.B) { - benchWrite(b, 1024, true) -} - -func BenchmarkWrite__4KB_WithIndex(b *testing.B) { - benchWrite(b, 4096, true) -} - -func BenchmarkWrite_10KB_WithIndex(b *testing.B) { - benchWrite(b, 10240, true) -} - -func BenchmarkRead__32B_NoCache(b *testing.B) { - benchRead(b, 32, 0) -} - -func BenchmarkRead__1KB_NoCache(b *testing.B) { - benchRead(b, 1024, 0) -} - -func BenchmarkRead__4KB_NoCache(b *testing.B) { - benchRead(b, 4096, 0) -} - -func BenchmarkRead_10KB_NoCache(b *testing.B) { - benchRead(b, 10240, 0) -} - -func BenchmarkRead__32B_WithCache(b *testing.B) { - benchRead(b, 32, keyCount*32*2) -} - -func BenchmarkRead__1KB_WithCache(b *testing.B) { - benchRead(b, 1024, keyCount*1024*2) -} - -func BenchmarkRead__4KB_WithCache(b *testing.B) { - benchRead(b, 4096, keyCount*4096*2) -} - -func BenchmarkRead_10KB_WithCache(b *testing.B) { - benchRead(b, 10240, keyCount*4096*2) -} diff --git a/vendor/github.com/peterbourgon/diskv/stream_test.go b/vendor/github.com/peterbourgon/diskv/stream_test.go deleted file mode 100644 index 7991dbff28..0000000000 --- a/vendor/github.com/peterbourgon/diskv/stream_test.go +++ /dev/null @@ -1,117 +0,0 @@ -package diskv - -import ( - "bytes" - "io/ioutil" - "testing" -) - -func TestBasicStreamCaching(t *testing.T) { - d := New(Options{ - BasePath: "test-data", - CacheSizeMax: 1024, - }) - defer d.EraseAll() - - input := "a1b2c3" - key, writeBuf, sync := "a", bytes.NewBufferString(input), true - if err := d.WriteStream(key, writeBuf, sync); err != nil { - t.Fatal(err) - } - - if d.isCached(key) { - t.Fatalf("'%s' cached, but shouldn't be (yet)", key) - } - - rc, err := d.ReadStream(key, false) - if err != nil { - t.Fatal(err) - } - - readBuf, err := ioutil.ReadAll(rc) - if err != nil { - t.Fatal(err) - } - - if !cmpBytes(readBuf, []byte(input)) { - t.Fatalf("'%s' != '%s'", string(readBuf), input) - } - - if !d.isCached(key) { - t.Fatalf("'%s' isn't cached, but should be", key) - } -} - -func TestReadStreamDirect(t *testing.T) { - var ( - basePath = "test-data" - ) - dWrite := New(Options{ - BasePath: basePath, - CacheSizeMax: 0, - }) - defer dWrite.EraseAll() - dRead := New(Options{ - BasePath: basePath, - CacheSizeMax: 1024, - }) - - // Write - key, val1, val2 := "a", []byte(`1234567890`), []byte(`aaaaaaaaaa`) - if err := dWrite.Write(key, val1); err != nil { - t.Fatalf("during first write: %s", err) - } - - // First, caching read. - val, err := dRead.Read(key) - if err != nil { - t.Fatalf("during initial read: %s", err) - } - t.Logf("read 1: %s => %s", key, string(val)) - if !cmpBytes(val1, val) { - t.Errorf("expected %q, got %q", string(val1), string(val)) - } - if !dRead.isCached(key) { - t.Errorf("%q should be cached, but isn't", key) - } - - // Write a different value. - if err := dWrite.Write(key, val2); err != nil { - t.Fatalf("during second write: %s", err) - } - - // Second read, should hit cache and get the old value. - val, err = dRead.Read(key) - if err != nil { - t.Fatalf("during second (cache-hit) read: %s", err) - } - t.Logf("read 2: %s => %s", key, string(val)) - if !cmpBytes(val1, val) { - t.Errorf("expected %q, got %q", string(val1), string(val)) - } - - // Third, direct read, should get the updated value. - rc, err := dRead.ReadStream(key, true) - if err != nil { - t.Fatalf("during third (direct) read, ReadStream: %s", err) - } - defer rc.Close() - val, err = ioutil.ReadAll(rc) - if err != nil { - t.Fatalf("during third (direct) read, ReadAll: %s", err) - } - t.Logf("read 3: %s => %s", key, string(val)) - if !cmpBytes(val2, val) { - t.Errorf("expected %q, got %q", string(val1), string(val)) - } - - // Fourth read, should hit cache and get the new value. - val, err = dRead.Read(key) - if err != nil { - t.Fatalf("during fourth (cache-hit) read: %s", err) - } - t.Logf("read 4: %s => %s", key, string(val)) - if !cmpBytes(val2, val) { - t.Errorf("expected %q, got %q", string(val1), string(val)) - } -} diff --git a/vendor/k8s.io/client-go/.github/PULL_REQUEST_TEMPLATE.md b/vendor/k8s.io/client-go/.github/PULL_REQUEST_TEMPLATE.md index ad11b57a85..e559c074bb 100644 --- a/vendor/k8s.io/client-go/.github/PULL_REQUEST_TEMPLATE.md +++ b/vendor/k8s.io/client-go/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,2 @@ -Sorry, client-go does not accept changes via pull requests at this time. Please -submit your pull request to the main repository: -https://github.com/kubernetes/kubernetes. See the guidance here: -https://github.com/kubernetes/client-go#contributing-code. +Sorry, we do not accept changes directly against this repository. Please see +CONTRIBUTING.md for information on where and how to contribute instead. diff --git a/vendor/k8s.io/client-go/CHANGELOG.md b/vendor/k8s.io/client-go/CHANGELOG.md index 88ffb22018..bfa8a453db 100644 --- a/vendor/k8s.io/client-go/CHANGELOG.md +++ b/vendor/k8s.io/client-go/CHANGELOG.md @@ -2,6 +2,111 @@ TODO: This document was manually maintained so might be incomplete. The automation effort is tracked in https://github.com/kubernetes/client-go/issues/234. +Changes in `k8s.io/api` and `k8s.io/apimachinery` are mentioned here +because `k8s.io/client-go` depends on them. + +# v6.0.0 + +**Breaking Changes:** + +* If you upgrade your client-go libs and use the `AppsV1() or Apps()` interface, please note that the default garbage collection behavior is changed. + + * [https://github.com/kubernetes/kubernetes/pull/55148](https://github.com/kubernetes/kubernetes/pull/55148) + +* Swagger 1.2 retriever `DiscoveryClient.SwaggerSchema` was removed from the discovery client + + * [https://github.com/kubernetes/kubernetes/pull/53441](https://github.com/kubernetes/kubernetes/pull/53441) + +* Informers got a NewFilteredSharedInformerFactory to e.g. filter by namespace + + * [https://github.com/kubernetes/kubernetes/pull/54660](https://github.com/kubernetes/kubernetes/pull/54660) + +* [k8s.io/api] The dynamic admission webhook is split into two kinds, mutating and validating. +The kinds have changed completely and old code must be ported to `admissionregistration.k8s.io/v1beta1` - +`MutatingWebhookConfiguration` and `ValidatingWebhookConfiguration` + + * [https://github.com/kubernetes/kubernetes/pull/55282](https://github.com/kubernetes/kubernetes/pull/55282) + +* [k8s.io/api] Renamed `core/v1.ScaleIOVolumeSource` to `ScaleIOPersistentVolumeSource` + + * [https://github.com/kubernetes/kubernetes/pull/54013](https://github.com/kubernetes/kubernetes/pull/54013) + +* [k8s.io/api] Renamed `core/v1.RBDVolumeSource` to `RBDPersistentVolumeSource` + + * [https://github.com/kubernetes/kubernetes/pull/54302](https://github.com/kubernetes/kubernetes/pull/54302) + +* [k8s.io/api] Removed `core/v1.CreatedByAnnotation` + + * [https://github.com/kubernetes/kubernetes/pull/54445](https://github.com/kubernetes/kubernetes/pull/54445) + +* [k8s.io/api] Renamed `core/v1.StorageMediumHugepages` to `StorageMediumHugePages` + + * [https://github.com/kubernetes/kubernetes/pull/54748](https://github.com/kubernetes/kubernetes/pull/54748) + +* [k8s.io/api] `core/v1.Taint.TimeAdded` became a pointer + + * [https://github.com/kubernetes/kubernetes/pull/43016](https://github.com/kubernetes/kubernetes/pull/43016) + +* [k8s.io/api] `core/v1.DefaultHardPodAffinitySymmetricWeight` type changed from int to int32 + + * [https://github.com/kubernetes/kubernetes/pull/53850](https://github.com/kubernetes/kubernetes/pull/53850) + +* [k8s.io/apimachinery] `ObjectCopier` interface was removed (requires switch to new generators with DeepCopy methods) + + * [https://github.com/kubernetes/kubernetes/pull/53525](https://github.com/kubernetes/kubernetes/pull/53525) + +**New Features:** + +* Certificate manager was moved from kubelet to `k8s.io/client-go/util/certificates` + + * [https://github.com/kubernetes/kubernetes/pull/49654](https://github.com/kubernetes/kubernetes/pull/49654) + +* [k8s.io/api] Workloads api types are promoted to `apps/v1` version + + * [https://github.com/kubernetes/kubernetes/pull/53679](https://github.com/kubernetes/kubernetes/pull/53679) + +* [k8s.io/api] Added `storage.k8s.io/v1alpha1` API group + + * [https://github.com/kubernetes/kubernetes/pull/54463](https://github.com/kubernetes/kubernetes/pull/54463) + +* [k8s.io/api] Added support for conditions in StatefulSet status + + * [https://github.com/kubernetes/kubernetes/pull/55268](https://github.com/kubernetes/kubernetes/pull/55268) + +* [k8s.io/api] Added support for conditions in DaemonSet status + + * [https://github.com/kubernetes/kubernetes/pull/55272](https://github.com/kubernetes/kubernetes/pull/55272) + +* [k8s.io/apimachinery] Added polymorphic scale client in `k8s.io/client-go/scale`, which supports scaling of resources in arbitrary API groups + + * [https://github.com/kubernetes/kubernetes/pull/53743](https://github.com/kubernetes/kubernetes/pull/53743) + +* [k8s.io/apimachinery] `meta.MetadataAccessor` got API chunking support + + * [https://github.com/kubernetes/kubernetes/pull/53768](https://github.com/kubernetes/kubernetes/pull/53768) + +* [k8s.io/apimachinery] `unstructured.Unstructured` got getters and setters + + * [https://github.com/kubernetes/kubernetes/pull/51940](https://github.com/kubernetes/kubernetes/pull/51940) + +**Bug fixes and Improvements:** + +* The body in glog output is not truncated with log level 10 + + * [https://github.com/kubernetes/kubernetes/pull/54801](https://github.com/kubernetes/kubernetes/pull/54801) + +* [k8s.io/api] Unset `creationTimestamp` field is output as null if encoded from an unstructured object + + * [https://github.com/kubernetes/kubernetes/pull/53464](https://github.com/kubernetes/kubernetes/pull/53464) + +* [k8s.io/apimachinery] Redirect behavior is restored for proxy subresources + + * [https://github.com/kubernetes/kubernetes/pull/52933](https://github.com/kubernetes/kubernetes/pull/52933) + +* [k8s.io/apimachinery] Random string generation functions are optimized + + * [https://github.com/kubernetes/kubernetes/pull/53720](https://github.com/kubernetes/kubernetes/pull/53720) + # v5.0.1 Bug fix: picked up a security fix [kubernetes/kubernetes#53443](https://github.com/kubernetes/kubernetes/pull/53443) for `PodSecurityPolicy`. diff --git a/vendor/k8s.io/client-go/Godeps/Godeps.json b/vendor/k8s.io/client-go/Godeps/Godeps.json index a70d2abb00..3598fddc7c 100644 --- a/vendor/k8s.io/client-go/Godeps/Godeps.json +++ b/vendor/k8s.io/client-go/Godeps/Godeps.json @@ -16,59 +16,19 @@ }, { "ImportPath": "github.com/Azure/go-autorest/autorest", - "Rev": "e14a70c556c8e0db173358d1a903dca345a8e75e" + "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" }, { "ImportPath": "github.com/Azure/go-autorest/autorest/adal", - "Rev": "e14a70c556c8e0db173358d1a903dca345a8e75e" + "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" }, { "ImportPath": "github.com/Azure/go-autorest/autorest/azure", - "Rev": "e14a70c556c8e0db173358d1a903dca345a8e75e" + "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" }, { "ImportPath": "github.com/Azure/go-autorest/autorest/date", - "Rev": "e14a70c556c8e0db173358d1a903dca345a8e75e" - }, - { - "ImportPath": "github.com/PuerkitoBio/purell", - "Rev": "8a290539e2e8629dbc4e6bad948158f790ec31f4" - }, - { - "ImportPath": "github.com/PuerkitoBio/urlesc", - "Rev": "5bd2802263f21d8788851d5305584c82a5c75d7e" - }, - { - "ImportPath": "github.com/coreos/go-oidc/http", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/jose", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/key", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/oauth2", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/go-oidc/oidc", - "Rev": "a4973d9a4225417aecf5d450a9522f00c1f7130f" - }, - { - "ImportPath": "github.com/coreos/pkg/health", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" - }, - { - "ImportPath": "github.com/coreos/pkg/httputil", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" - }, - { - "ImportPath": "github.com/coreos/pkg/timeutil", - "Rev": "fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8" + "Rev": "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" }, { "ImportPath": "github.com/davecgh/go-spew/spew", @@ -86,34 +46,10 @@ "ImportPath": "github.com/docker/spdystream/spdy", "Rev": "449fdfce4d962303d702fec724ef0ad181c92528" }, - { - "ImportPath": "github.com/emicklei/go-restful", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, - { - "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, { "ImportPath": "github.com/ghodss/yaml", "Rev": "73d445a93680fa1a78ae23a5839bad48f32ba1ee" }, - { - "ImportPath": "github.com/go-openapi/jsonpointer", - "Rev": "46af16f9f7b149af66e5d1bd010e3574dc06de98" - }, - { - "ImportPath": "github.com/go-openapi/jsonreference", - "Rev": "13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272" - }, - { - "ImportPath": "github.com/go-openapi/spec", - "Rev": "7abd5745472fff5eb3685386d5fb8bf38683154d" - }, - { - "ImportPath": "github.com/go-openapi/swag", - "Rev": "f3f9494671f93fcff853e3c6e9e948b3eb71e590" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" @@ -150,10 +86,6 @@ "ImportPath": "github.com/golang/protobuf/ptypes/timestamp", "Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" }, - { - "ImportPath": "github.com/google/btree", - "Rev": "7d79101e329e5a3adf994758c578dab82b90c017" - }, { "ImportPath": "github.com/google/gofuzz", "Rev": "44d81051d367757e1c7c6a5a86423ece9afcf63c" @@ -172,39 +104,31 @@ }, { "ImportPath": "github.com/gophercloud/gophercloud", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/openstack", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/openstack/utils", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/gophercloud/gophercloud/pagination", - "Rev": "8183543f90d1aef267a5ecc209f2e0715b355acb" - }, - { - "ImportPath": "github.com/gregjones/httpcache", - "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" - }, - { - "ImportPath": "github.com/gregjones/httpcache/diskcache", - "Rev": "787624de3eb7bd915c329cba748687a3b22666a6" + "Rev": "6da026c32e2d622cc242d32984259c77237aefe1" }, { "ImportPath": "github.com/hashicorp/golang-lru", @@ -222,33 +146,9 @@ "ImportPath": "github.com/imdario/mergo", "Rev": "6633656539c1639d9d78127b7d47c622b5d7b6dc" }, - { - "ImportPath": "github.com/jonboulle/clockwork", - "Rev": "72f9bd7c4e0c2a40055ab3d0f09654f730cce982" - }, { "ImportPath": "github.com/json-iterator/go", - "Rev": "36b14963da70d11297d313183d7e6388c8510e1e" - }, - { - "ImportPath": "github.com/juju/ratelimit", - "Rev": "5b9ff866471762aa2ab2dced63c9fb6f53921342" - }, - { - "ImportPath": "github.com/mailru/easyjson/buffer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jlexer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jwriter", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/peterbourgon/diskv", - "Rev": "5f041e8faa004a95c88a202771f4cc3e991971e6" + "Rev": "13f86432b882000a51c6e610c620974462691a97" }, { "ImportPath": "github.com/pmezard/go-difflib/difflib", @@ -256,7 +156,7 @@ }, { "ImportPath": "github.com/spf13/pflag", - "Rev": "9ff6c6923cfffbcd502984b8e0c80539a94968b7" + "Rev": "4c012f6dcd9546820e378d0bdda4d8fc772cdfea" }, { "ImportPath": "github.com/stretchr/testify/assert", @@ -318,34 +218,10 @@ "ImportPath": "golang.org/x/sys/windows", "Rev": "95c6576299259db960f6c5b9b69ea52422860fce" }, - { - "ImportPath": "golang.org/x/text/cases", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal/tag", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/language", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/runes", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, { "ImportPath": "golang.org/x/text/secure/bidirule", "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" }, - { - "ImportPath": "golang.org/x/text/secure/precis", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, { "ImportPath": "golang.org/x/text/transform", "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" @@ -359,8 +235,8 @@ "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" }, { - "ImportPath": "golang.org/x/text/width", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" + "ImportPath": "golang.org/x/time/rate", + "Rev": "f51c12702a4d776e4c1fa9b0fabab841babae631" }, { "ImportPath": "gopkg.in/inf.v0", @@ -368,343 +244,339 @@ }, { "ImportPath": "gopkg.in/yaml.v2", - "Rev": "53feefa2559fb8dfa8d81baad31be332c97d6c77" + "Rev": "670d4cfef0544295bc27a114dbac37980d83185a" }, { "ImportPath": "k8s.io/api/admissionregistration/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/admissionregistration/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/apps/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/apps/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/apps/v1beta2", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authentication/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authentication/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authorization/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/authorization/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/autoscaling/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/autoscaling/v2beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/batch/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/batch/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/batch/v2alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/certificates/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/core/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/events/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/extensions/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/imagepolicy/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/networking/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/policy/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/rbac/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/rbac/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/rbac/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/scheduling/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/settings/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/storage/v1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/storage/v1alpha1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/api/storage/v1beta1", - "Rev": "11147472b7c934c474a2c484af3c0c5210b7a3af" + "Rev": "73d903622b7391f3312dcbac6483fed484e185f8" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/equality", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/errors", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/testing", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { - "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/cache", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/clock", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/version", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "180eddb345a5be3a157cea1c624700ad5bd27b8f" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" + "Rev": "302974c03f7e50f16561ba237db776ab93594ef6" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "39a7bf85c140f972372c2a0d1ee40adbf0c8bfe1" + "Rev": "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" } ] } diff --git a/vendor/k8s.io/client-go/INSTALL.md b/vendor/k8s.io/client-go/INSTALL.md index 3417e0cd72..42656284f8 100644 --- a/vendor/k8s.io/client-go/INSTALL.md +++ b/vendor/k8s.io/client-go/INSTALL.md @@ -63,7 +63,7 @@ To install `client-go` and place its dependencies in your `$GOPATH`: ```sh go get k8s.io/client-go/... cd $GOPATH/src/k8s.io/client-go -git checkout v2.0.0 +git checkout v6.0.0 # cd 1.5 # only necessary with 1.5 and 1.4 clients. godep restore ./... ``` @@ -99,7 +99,7 @@ your project: package: ( your project's import path ) # e.g. github.com/foo/bar import: - package: k8s.io/client-go - version: v2.0.0 + version: v6.0.0 ``` Second, add a Go file that imports `client-go` somewhere in your project, @@ -132,7 +132,7 @@ requests can override the version manually in `glide.yaml`. For example: package: ( your project's import path ) # e.g. github.com/foo/bar import: - package: k8s.io/client-go - version: v2.0.0 + version: v6.0.0 # Use a newer version of go-spew even though client-go wants an old one. - package: github.com/davecgh/go-spew version: v1.1.0 diff --git a/vendor/k8s.io/client-go/README.md b/vendor/k8s.io/client-go/README.md index ed1b887fcf..82f41d7383 100644 --- a/vendor/k8s.io/client-go/README.md +++ b/vendor/k8s.io/client-go/README.md @@ -2,12 +2,22 @@ Go clients for talking to a [kubernetes](http://kubernetes.io/) cluster. -We currently recommend using the v4.0.0 tag. See [INSTALL.md](/INSTALL.md) for +We currently recommend using the v6.0.0 tag. See [INSTALL.md](/INSTALL.md) for detailed installation instructions. `go get k8s.io/client-go/...` works, but will give you head and doesn't handle the dependencies well. -[![Build Status](https://travis-ci.org/kubernetes/client-go.svg?branch=master)](https://travis-ci.org/kubernetes/client-go) -[![GoDoc](https://godoc.org/k8s.io/client-go?status.svg)](https://godoc.org/k8s.io/client-go) +[![BuildStatus Widget]][BuildStatus Result] +[![GoReport Widget]][GoReport Status] +[![GoDocWidget]][GoDocReference] + +[BuildStatus Result]: https://travis-ci.org/kubernetes/client-go +[BuildStatus Widget]: https://travis-ci.org/kubernetes/client-go.svg?branch=master + +[GoReport Status]: https://goreportcard.com/report/github.com/kubernetes/client-go +[GoReport Widget]: https://goreportcard.com/badge/github.com/kubernetes/client-go + +[GoDocWidget]: https://godoc.org/k8s.io/client-go?status.svg +[GoDocReference]:https://godoc.org/k8s.io/client-go ## Table of Contents @@ -17,7 +27,7 @@ will give you head and doesn't handle the dependencies well. - [Compatibility: client-go <-> Kubernetes clusters](#compatibility-client-go---kubernetes-clusters) - [Compatibility matrix](#compatibility-matrix) - [Why do the 1.4 and 1.5 branch contain top-level folder named after the version?](#why-do-the-14-and-15-branch-contain-top-level-folder-named-after-the-version) -- [Kuberentes tags](#kubernetes-tags) +- [Kubernetes tags](#kubernetes-tags) - [How to get it](#how-to-get-it) - [How to use it](#how-to-use-it) - [Dependency management](#dependency-management) @@ -81,15 +91,16 @@ We will backport bugfixes--but not new features--into older versions of #### Compatibility matrix -| | Kubernetes 1.4 | Kubernetes 1.5 | Kubernetes 1.6 | Kubernetes 1.7 | Kubernetes 1.8 | -|---------------------|----------------|----------------|----------------|----------------|----------------| -| client-go 1.4 | ✓ | - | - | - | - | -| client-go 1.5 | + | - | - | - | - | -| client-go 2.0 | +- | ✓ | +- | +- | +- | -| client-go 3.0 | +- | +- | ✓ | - | +- | -| client-go 4.0 | +- | +- | +- | ✓ | +- | -| client-go 5.0 | +- | +- | +- | +- | ✓ | -| client-go HEAD | +- | +- | +- | +- | + | +| | Kubernetes 1.4 | Kubernetes 1.5 | Kubernetes 1.6 | Kubernetes 1.7 | Kubernetes 1.8 | Kubernetes 1.9 | +|---------------------|----------------|----------------|----------------|----------------|----------------|----------------| +| client-go 1.4 | ✓ | - | - | - | - | - | +| client-go 1.5 | + | - | - | - | - | - | +| client-go 2.0 | +- | ✓ | +- | +- | +- | +- | +| client-go 3.0 | +- | +- | ✓ | - | +- | +- | +| client-go 4.0 | +- | +- | +- | ✓ | +- | +- | +| client-go 5.0 | +- | +- | +- | +- | ✓ | +- | +| client-go 6.0 | +- | +- | +- | +- | +- | ✓ | +| client-go HEAD | +- | +- | +- | +- | +- | + | Key: @@ -112,10 +123,11 @@ between client-go versions. |----------------|--------------------------------------|-------------------------------| | client-go 1.4 | Kubernetes main repo, 1.4 branch | = - | | client-go 1.5 | Kubernetes main repo, 1.5 branch | = - | -| client-go 2.0 | Kubernetes main repo, 1.5 branch | ✓ | -| client-go 3.0 | Kubernetes main repo, 1.6 branch | ✓ | +| client-go 2.0 | Kubernetes main repo, 1.5 branch | = - | +| client-go 3.0 | Kubernetes main repo, 1.6 branch | = - | | client-go 4.0 | Kubernetes main repo, 1.7 branch | ✓ | | client-go 5.0 | Kubernetes main repo, 1.8 branch | ✓ | +| client-go 6.0 | Kubernetes main repo, 1.9 branch | ✓ | | client-go HEAD | Kubernetes main repo, master branch | ✓ | Key: diff --git a/vendor/k8s.io/client-go/discovery/BUILD b/vendor/k8s.io/client-go/discovery/BUILD index e47b052769..19523ba53e 100644 --- a/vendor/k8s.io/client-go/discovery/BUILD +++ b/vendor/k8s.io/client-go/discovery/BUILD @@ -39,7 +39,6 @@ go_test( "helper_blackbox_test.go", "restmapper_test.go", ], - importpath = "k8s.io/client-go/discovery_test", deps = [ "//vendor/github.com/gogo/protobuf/proto:go_default_library", "//vendor/github.com/googleapis/gnostic/OpenAPIv2:go_default_library", diff --git a/vendor/k8s.io/client-go/discovery/cached/BUILD b/vendor/k8s.io/client-go/discovery/cached/BUILD index 7f95f83e41..279e0ff9aa 100644 --- a/vendor/k8s.io/client-go/discovery/cached/BUILD +++ b/vendor/k8s.io/client-go/discovery/cached/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["memcache_test.go"], - importpath = "k8s.io/client-go/discovery/cached", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/discovery/fake:go_default_library", diff --git a/vendor/k8s.io/client-go/discovery/discovery_client.go b/vendor/k8s.io/client-go/discovery/discovery_client.go index 26319f4946..3c685a9556 100644 --- a/vendor/k8s.io/client-go/discovery/discovery_client.go +++ b/vendor/k8s.io/client-go/discovery/discovery_client.go @@ -36,8 +36,12 @@ import ( restclient "k8s.io/client-go/rest" ) -// defaultRetries is the number of times a resource discovery is repeated if an api group disappears on the fly (e.g. ThirdPartyResources). -const defaultRetries = 2 +const ( + // defaultRetries is the number of times a resource discovery is repeated if an api group disappears on the fly (e.g. ThirdPartyResources). + defaultRetries = 2 + // protobuf mime type + mimePb = "application/com.github.proto-openapi.spec.v2@v1.0+protobuf" +) // DiscoveryInterface holds the methods that discover server-supported API groups, // versions and resources. @@ -145,9 +149,9 @@ func (d *DiscoveryClient) ServerGroups() (apiGroupList *metav1.APIGroupList, err apiGroupList = &metav1.APIGroupList{} } - // append the group retrieved from /api to the list if not empty + // prepend the group retrieved from /api to the list if not empty if len(v.Versions) != 0 { - apiGroupList.Groups = append(apiGroupList.Groups, apiGroup) + apiGroupList.Groups = append([]metav1.APIGroup{apiGroup}, apiGroupList.Groups...) } return apiGroupList, nil } @@ -329,9 +333,18 @@ func (d *DiscoveryClient) ServerVersion() (*version.Info, error) { // OpenAPISchema fetches the open api schema using a rest client and parses the proto. func (d *DiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { - data, err := d.restClient.Get().AbsPath("/swagger-2.0.0.pb-v1").Do().Raw() + data, err := d.restClient.Get().AbsPath("/openapi/v2").SetHeader("Accept", mimePb).Do().Raw() if err != nil { - return nil, err + if errors.IsForbidden(err) || errors.IsNotFound(err) { + // single endpoint not found/registered in old server, try to fetch old endpoint + // TODO(roycaihw): remove this in 1.11 + data, err = d.restClient.Get().AbsPath("/swagger-2.0.0.pb-v1").Do().Raw() + if err != nil { + return nil, err + } + } else { + return nil, err + } } document := &openapi_v2.Document{} err = proto.Unmarshal(data, document) @@ -395,15 +408,6 @@ func NewDiscoveryClient(c restclient.Interface) *DiscoveryClient { return &DiscoveryClient{restClient: c, LegacyPrefix: "/api"} } -func stringDoesntExistIn(str string, slice []string) bool { - for _, s := range slice { - if s == str { - return false - } - } - return true -} - // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *DiscoveryClient) RESTClient() restclient.Interface { diff --git a/vendor/k8s.io/client-go/discovery/discovery_client_test.go b/vendor/k8s.io/client-go/discovery/discovery_client_test.go index 409add2bf7..ad855139a0 100644 --- a/vendor/k8s.io/client-go/discovery/discovery_client_test.go +++ b/vendor/k8s.io/client-go/discovery/discovery_client_test.go @@ -74,6 +74,17 @@ func TestGetServerGroupsWithV1Server(t *testing.T) { "v1", }, } + case "/apis": + obj = &metav1.APIGroupList{ + Groups: []metav1.APIGroup{ + { + Name: "extensions", + Versions: []metav1.GroupVersionForDiscovery{ + {GroupVersion: "extensions/v1beta1"}, + }, + }, + }, + } default: w.WriteHeader(http.StatusNotFound) return @@ -95,8 +106,8 @@ func TestGetServerGroupsWithV1Server(t *testing.T) { t.Fatalf("unexpected error: %v", err) } groupVersions := metav1.ExtractGroupVersions(apiGroupList) - if !reflect.DeepEqual(groupVersions, []string{"v1"}) { - t.Errorf("expected: %q, got: %q", []string{"v1"}, groupVersions) + if !reflect.DeepEqual(groupVersions, []string{"v1", "extensions/v1beta1"}) { + t.Errorf("expected: %q, got: %q", []string{"v1", "extensions/v1beta1"}, groupVersions) } } @@ -315,9 +326,14 @@ var returnedOpenAPI = openapi_v2.Document{ }, } -func openapiSchemaFakeServer() (*httptest.Server, error) { +func openapiSchemaDeprecatedFakeServer() (*httptest.Server, error) { var sErr error server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + // old server returns 403 on new endpoint request + if req.URL.Path == "/openapi/v2" { + w.WriteHeader(http.StatusForbidden) + return + } if req.URL.Path != "/swagger-2.0.0.pb-v1" { sErr = fmt.Errorf("Unexpected url %v", req.URL) } @@ -338,6 +354,33 @@ func openapiSchemaFakeServer() (*httptest.Server, error) { return server, sErr } +func openapiSchemaFakeServer() (*httptest.Server, error) { + var sErr error + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + if req.URL.Path != "/openapi/v2" { + sErr = fmt.Errorf("Unexpected url %v", req.URL) + } + if req.Method != "GET" { + sErr = fmt.Errorf("Unexpected method %v", req.Method) + } + decipherableFormat := req.Header.Get("Accept") + if decipherableFormat != "application/com.github.proto-openapi.spec.v2@v1.0+protobuf" { + sErr = fmt.Errorf("Unexpected accept mime type %v", decipherableFormat) + } + + mime.AddExtensionType(".pb-v1", "application/com.github.googleapis.gnostic.OpenAPIv2@68f4ded+protobuf") + + output, err := proto.Marshal(&returnedOpenAPI) + if err != nil { + sErr = err + return + } + w.WriteHeader(http.StatusOK) + w.Write(output) + })) + return server, sErr +} + func TestGetOpenAPISchema(t *testing.T) { server, err := openapiSchemaFakeServer() if err != nil { @@ -355,6 +398,23 @@ func TestGetOpenAPISchema(t *testing.T) { } } +func TestGetOpenAPISchemaFallback(t *testing.T) { + server, err := openapiSchemaDeprecatedFakeServer() + if err != nil { + t.Errorf("unexpected error starting fake server: %v", err) + } + defer server.Close() + + client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL}) + got, err := client.OpenAPISchema() + if err != nil { + t.Fatalf("unexpected error getting openapi: %v", err) + } + if e, a := returnedOpenAPI, *got; !reflect.DeepEqual(e, a) { + t.Errorf("expected %v, got %v", e, a) + } +} + func TestServerPreferredResources(t *testing.T) { stable := metav1.APIResourceList{ GroupVersion: "v1", diff --git a/vendor/k8s.io/client-go/discovery/fake/BUILD b/vendor/k8s.io/client-go/discovery/fake/BUILD index 1477088da8..5b50832a80 100644 --- a/vendor/k8s.io/client-go/discovery/fake/BUILD +++ b/vendor/k8s.io/client-go/discovery/fake/BUILD @@ -37,7 +37,6 @@ filegroup( go_test( name = "go_default_xtest", srcs = ["discovery_test.go"], - importpath = "k8s.io/client-go/discovery/fake_test", deps = [ "//vendor/k8s.io/apimachinery/pkg/version:go_default_library", "//vendor/k8s.io/client-go/discovery/fake:go_default_library", diff --git a/vendor/k8s.io/client-go/discovery/restmapper.go b/vendor/k8s.io/client-go/discovery/restmapper.go index 6d1de8c1b1..df5ab0358a 100644 --- a/vendor/k8s.io/client-go/discovery/restmapper.go +++ b/vendor/k8s.io/client-go/discovery/restmapper.go @@ -18,6 +18,7 @@ package discovery import ( "fmt" + "strings" "sync" "k8s.io/apimachinery/pkg/api/meta" @@ -108,6 +109,7 @@ func NewRESTMapper(groupResources []*APIGroupResources, versionInterfaces meta.V plural := gv.WithResource(resource.Name) singular := gv.WithResource(resource.SingularName) versionMapper.AddSpecific(gv.WithKind(resource.Kind), plural, singular, scope) + versionMapper.AddSpecific(gv.WithKind(strings.ToLower(resource.Kind)), plural, singular, scope) // TODO this is producing unsafe guesses that don't actually work, but it matches previous behavior versionMapper.Add(gv.WithKind(resource.Kind+"List"), scope) } diff --git a/vendor/k8s.io/client-go/dynamic/BUILD b/vendor/k8s.io/client-go/dynamic/BUILD index a0271859e3..3642f6a0f7 100644 --- a/vendor/k8s.io/client-go/dynamic/BUILD +++ b/vendor/k8s.io/client-go/dynamic/BUILD @@ -12,8 +12,7 @@ go_test( "client_test.go", "dynamic_util_test.go", ], - importpath = "k8s.io/client-go/dynamic", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library", diff --git a/vendor/k8s.io/client-go/dynamic/client.go b/vendor/k8s.io/client-go/dynamic/client.go index a941189d7f..833e43537b 100644 --- a/vendor/k8s.io/client-go/dynamic/client.go +++ b/vendor/k8s.io/client-go/dynamic/client.go @@ -47,7 +47,7 @@ type Interface interface { GetRateLimiter() flowcontrol.RateLimiter // Resource returns an API interface to the specified resource for this client's // group and version. If resource is not a namespaced resource, then namespace - // is ignored. The ResourceInterface inherits the paramater codec of this client. + // is ignored. The ResourceInterface inherits the parameter codec of this client. Resource(resource *metav1.APIResource, namespace string) ResourceInterface // ParameterCodec returns a client with the provided parameter codec. ParameterCodec(parameterCodec runtime.ParameterCodec) Interface @@ -145,6 +145,19 @@ type ResourceClient struct { parameterCodec runtime.ParameterCodec } +func (rc *ResourceClient) parseResourceSubresourceName() (string, []string) { + var resourceName string + var subresourceName []string + if strings.Contains(rc.resource.Name, "/") { + resourceName = strings.Split(rc.resource.Name, "/")[0] + subresourceName = strings.Split(rc.resource.Name, "/")[1:] + } else { + resourceName = rc.resource.Name + } + + return resourceName, subresourceName +} + // List returns a list of objects for this resource. func (rc *ResourceClient) List(opts metav1.ListOptions) (runtime.Object, error) { parameterEncoder := rc.parameterCodec @@ -166,9 +179,11 @@ func (rc *ResourceClient) Get(name string, opts metav1.GetOptions) (*unstructure parameterEncoder = defaultParameterEncoder } result := new(unstructured.Unstructured) + resourceName, subresourceName := rc.parseResourceSubresourceName() err := rc.cl.Get(). NamespaceIfScoped(rc.ns, rc.resource.Namespaced). - Resource(rc.resource.Name). + Resource(resourceName). + SubResource(subresourceName...). VersionedParams(&opts, parameterEncoder). Name(name). Do(). @@ -205,11 +220,26 @@ func (rc *ResourceClient) DeleteCollection(deleteOptions *metav1.DeleteOptions, // Create creates the provided resource. func (rc *ResourceClient) Create(obj *unstructured.Unstructured) (*unstructured.Unstructured, error) { result := new(unstructured.Unstructured) - err := rc.cl.Post(). + resourceName, subresourceName := rc.parseResourceSubresourceName() + req := rc.cl.Post(). NamespaceIfScoped(rc.ns, rc.resource.Namespaced). - Resource(rc.resource.Name). - Body(obj). - Do(). + Resource(resourceName). + Body(obj) + if len(subresourceName) > 0 { + // If the provided resource is a subresource, the POST request should contain + // object name. Examples of subresources that support Create operation: + // core/v1/pods/{name}/binding + // core/v1/pods/{name}/eviction + // extensions/v1beta1/deployments/{name}/rollback + // apps/v1beta1/deployments/{name}/rollback + // NOTE: Currently our system assumes every subresource object has the same + // name as the parent resource object. E.g. a pods/binding object having + // metadada.name "foo" means pod "foo" is being bound. We may need to + // change this if we break the assumption in the future. + req = req.SubResource(subresourceName...). + Name(obj.GetName()) + } + err := req.Do(). Into(result) return result, err } @@ -220,9 +250,15 @@ func (rc *ResourceClient) Update(obj *unstructured.Unstructured) (*unstructured. if len(obj.GetName()) == 0 { return result, errors.New("object missing name") } + resourceName, subresourceName := rc.parseResourceSubresourceName() err := rc.cl.Put(). NamespaceIfScoped(rc.ns, rc.resource.Namespaced). - Resource(rc.resource.Name). + Resource(resourceName). + SubResource(subresourceName...). + // NOTE: Currently our system assumes every subresource object has the same + // name as the parent resource object. E.g. a pods/binding object having + // metadada.name "foo" means pod "foo" is being bound. We may need to + // change this if we break the assumption in the future. Name(obj.GetName()). Body(obj). Do(). @@ -244,11 +280,14 @@ func (rc *ResourceClient) Watch(opts metav1.ListOptions) (watch.Interface, error Watch() } +// Patch applies the patch and returns the patched resource. func (rc *ResourceClient) Patch(name string, pt types.PatchType, data []byte) (*unstructured.Unstructured, error) { result := new(unstructured.Unstructured) + resourceName, subresourceName := rc.parseResourceSubresourceName() err := rc.cl.Patch(pt). NamespaceIfScoped(rc.ns, rc.resource.Namespaced). - Resource(rc.resource.Name). + Resource(resourceName). + SubResource(subresourceName...). Name(name). Body(data). Do(). diff --git a/vendor/k8s.io/client-go/dynamic/client_test.go b/vendor/k8s.io/client-go/dynamic/client_test.go index 1459429c08..ffa550ed59 100644 --- a/vendor/k8s.io/client-go/dynamic/client_test.go +++ b/vendor/k8s.io/client-go/dynamic/client_test.go @@ -150,6 +150,7 @@ func TestList(t *testing.T) { func TestGet(t *testing.T) { tcs := []struct { + resource string namespace string name string path string @@ -157,22 +158,39 @@ func TestGet(t *testing.T) { want *unstructured.Unstructured }{ { - name: "normal_get", - path: "/api/gtest/vtest/rtest/normal_get", - resp: getJSON("vTest", "rTest", "normal_get"), - want: getObject("vTest", "rTest", "normal_get"), + resource: "rtest", + name: "normal_get", + path: "/api/gtest/vtest/rtest/normal_get", + resp: getJSON("vTest", "rTest", "normal_get"), + want: getObject("vTest", "rTest", "normal_get"), }, { + resource: "rtest", namespace: "nstest", name: "namespaced_get", path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_get", resp: getJSON("vTest", "rTest", "namespaced_get"), want: getObject("vTest", "rTest", "namespaced_get"), }, + { + resource: "rtest/srtest", + name: "normal_subresource_get", + path: "/api/gtest/vtest/rtest/normal_subresource_get/srtest", + resp: getJSON("vTest", "srTest", "normal_subresource_get"), + want: getObject("vTest", "srTest", "normal_subresource_get"), + }, + { + resource: "rtest/srtest", + namespace: "nstest", + name: "namespaced_subresource_get", + path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_subresource_get/srtest", + resp: getJSON("vTest", "srTest", "namespaced_subresource_get"), + want: getObject("vTest", "srTest", "namespaced_subresource_get"), + }, } for _, tc := range tcs { gv := &schema.GroupVersion{Group: "gtest", Version: "vtest"} - resource := &metav1.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0} + resource := &metav1.APIResource{Name: tc.resource, Namespaced: len(tc.namespace) != 0} cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) { if r.Method != "GET" { t.Errorf("Get(%q) got HTTP method %s. wanted GET", tc.name, r.Method) @@ -303,26 +321,42 @@ func TestDeleteCollection(t *testing.T) { func TestCreate(t *testing.T) { tcs := []struct { + resource string name string namespace string obj *unstructured.Unstructured path string }{ { - name: "normal_create", - path: "/api/gtest/vtest/rtest", - obj: getObject("vTest", "rTest", "normal_create"), + resource: "rtest", + name: "normal_create", + path: "/api/gtest/vtest/rtest", + obj: getObject("vTest", "rTest", "normal_create"), }, { + resource: "rtest", name: "namespaced_create", namespace: "nstest", path: "/api/gtest/vtest/namespaces/nstest/rtest", obj: getObject("vTest", "rTest", "namespaced_create"), }, + { + resource: "rtest/srtest", + name: "normal_subresource_create", + path: "/api/gtest/vtest/rtest/normal_subresource_create/srtest", + obj: getObject("vTest", "srTest", "normal_subresource_create"), + }, + { + resource: "rtest/srtest", + name: "namespaced_subresource_create", + namespace: "nstest", + path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_subresource_create/srtest", + obj: getObject("vTest", "srTest", "namespaced_subresource_create"), + }, } for _, tc := range tcs { gv := &schema.GroupVersion{Group: "gtest", Version: "vtest"} - resource := &metav1.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0} + resource := &metav1.APIResource{Name: tc.resource, Namespaced: len(tc.namespace) != 0} cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) { if r.Method != "POST" { t.Errorf("Create(%q) got HTTP method %s. wanted POST", tc.name, r.Method) @@ -362,26 +396,42 @@ func TestCreate(t *testing.T) { func TestUpdate(t *testing.T) { tcs := []struct { + resource string name string namespace string obj *unstructured.Unstructured path string }{ { - name: "normal_update", - path: "/api/gtest/vtest/rtest/normal_update", - obj: getObject("vTest", "rTest", "normal_update"), + resource: "rtest", + name: "normal_update", + path: "/api/gtest/vtest/rtest/normal_update", + obj: getObject("vTest", "rTest", "normal_update"), }, { + resource: "rtest", name: "namespaced_update", namespace: "nstest", path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_update", obj: getObject("vTest", "rTest", "namespaced_update"), }, + { + resource: "rtest/srtest", + name: "normal_subresource_update", + path: "/api/gtest/vtest/rtest/normal_update/srtest", + obj: getObject("vTest", "srTest", "normal_update"), + }, + { + resource: "rtest/srtest", + name: "namespaced_subresource_update", + namespace: "nstest", + path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_update/srtest", + obj: getObject("vTest", "srTest", "namespaced_update"), + }, } for _, tc := range tcs { gv := &schema.GroupVersion{Group: "gtest", Version: "vtest"} - resource := &metav1.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0} + resource := &metav1.APIResource{Name: tc.resource, Namespaced: len(tc.namespace) != 0} cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) { if r.Method != "PUT" { t.Errorf("Update(%q) got HTTP method %s. wanted PUT", tc.name, r.Method) @@ -492,6 +542,7 @@ func TestWatch(t *testing.T) { func TestPatch(t *testing.T) { tcs := []struct { + resource string name string namespace string patch []byte @@ -499,22 +550,39 @@ func TestPatch(t *testing.T) { path string }{ { - name: "normal_patch", - path: "/api/gtest/vtest/rtest/normal_patch", - patch: getJSON("vTest", "rTest", "normal_patch"), - want: getObject("vTest", "rTest", "normal_patch"), + resource: "rtest", + name: "normal_patch", + path: "/api/gtest/vtest/rtest/normal_patch", + patch: getJSON("vTest", "rTest", "normal_patch"), + want: getObject("vTest", "rTest", "normal_patch"), }, { + resource: "rtest", name: "namespaced_patch", namespace: "nstest", path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_patch", patch: getJSON("vTest", "rTest", "namespaced_patch"), want: getObject("vTest", "rTest", "namespaced_patch"), }, + { + resource: "rtest/srtest", + name: "normal_subresource_patch", + path: "/api/gtest/vtest/rtest/normal_subresource_patch/srtest", + patch: getJSON("vTest", "srTest", "normal_subresource_patch"), + want: getObject("vTest", "srTest", "normal_subresource_patch"), + }, + { + resource: "rtest/srtest", + name: "namespaced_subresource_patch", + namespace: "nstest", + path: "/api/gtest/vtest/namespaces/nstest/rtest/namespaced_subresource_patch/srtest", + patch: getJSON("vTest", "srTest", "namespaced_subresource_patch"), + want: getObject("vTest", "srTest", "namespaced_subresource_patch"), + }, } for _, tc := range tcs { gv := &schema.GroupVersion{Group: "gtest", Version: "vtest"} - resource := &metav1.APIResource{Name: "rtest", Namespaced: len(tc.namespace) != 0} + resource := &metav1.APIResource{Name: tc.resource, Namespaced: len(tc.namespace) != 0} cl, srv, err := getClientServer(gv, func(w http.ResponseWriter, r *http.Request) { if r.Method != "PATCH" { t.Errorf("Patch(%q) got HTTP method %s. wanted PATCH", tc.name, r.Method) diff --git a/vendor/k8s.io/client-go/dynamic/fake/client.go b/vendor/k8s.io/client-go/dynamic/fake/client.go index 6c11d4227d..8399076c20 100644 --- a/vendor/k8s.io/client-go/dynamic/fake/client.go +++ b/vendor/k8s.io/client-go/dynamic/fake/client.go @@ -46,7 +46,7 @@ func (c *FakeClient) GetRateLimiter() flowcontrol.RateLimiter { // Resource returns an API interface to the specified resource for this client's // group and version. If resource is not a namespaced resource, then namespace -// is ignored. The ResourceClient inherits the paramater codec of this client +// is ignored. The ResourceClient inherits the parameter codec of this client func (c *FakeClient) Resource(resource *metav1.APIResource, namespace string) dynamic.ResourceInterface { return &FakeResourceClient{ Resource: c.GroupVersion.WithResource(resource.Name), diff --git a/vendor/k8s.io/client-go/examples/create-update-delete-deployment/BUILD b/vendor/k8s.io/client-go/examples/create-update-delete-deployment/BUILD index 741403b314..2da72ec9fc 100644 --- a/vendor/k8s.io/client-go/examples/create-update-delete-deployment/BUILD +++ b/vendor/k8s.io/client-go/examples/create-update-delete-deployment/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "create-update-delete-deployment", - importpath = "k8s.io/client-go/examples/create-update-delete-deployment", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/examples/create-update-delete-deployment/README.md b/vendor/k8s.io/client-go/examples/create-update-delete-deployment/README.md index e9c11a9355..47d8dd1ee5 100644 --- a/vendor/k8s.io/client-go/examples/create-update-delete-deployment/README.md +++ b/vendor/k8s.io/client-go/examples/create-update-delete-deployment/README.md @@ -48,7 +48,7 @@ Running this command will execute the following operations on your cluster: dependent ReplicaSet resource. Verify with `kubectl get deployments`. Each step is separated by an interactive prompt. You must hit the -Return key to proceeed to the next step. You can use these prompts as +Return key to proceed to the next step. You can use these prompts as a break to take time to run `kubectl` and inspect the result of the operations executed. diff --git a/vendor/k8s.io/client-go/examples/in-cluster-client-configuration/BUILD b/vendor/k8s.io/client-go/examples/in-cluster-client-configuration/BUILD index d6c8dacc1d..f4146ae37f 100644 --- a/vendor/k8s.io/client-go/examples/in-cluster-client-configuration/BUILD +++ b/vendor/k8s.io/client-go/examples/in-cluster-client-configuration/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "in-cluster-client-configuration", - importpath = "k8s.io/client-go/examples/in-cluster-client-configuration", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/BUILD b/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/BUILD index cf8f05e2bc..2fda9686f7 100644 --- a/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/BUILD +++ b/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "out-of-cluster-client-configuration", - importpath = "k8s.io/client-go/examples/out-of-cluster-client-configuration", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go b/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go index 252307b182..9d79b97760 100644 --- a/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go +++ b/vendor/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go @@ -62,15 +62,18 @@ func main() { // Examples for error handling: // - Use helper functions like e.g. errors.IsNotFound() // - And/or cast to StatusError and use its properties like e.g. ErrStatus.Message - _, err = clientset.CoreV1().Pods("default").Get("example-xxxxx", metav1.GetOptions{}) + namespace := "default" + pod := "example-xxxxx" + _, err = clientset.CoreV1().Pods(namespace).Get(pod, metav1.GetOptions{}) if errors.IsNotFound(err) { - fmt.Printf("Pod not found\n") + fmt.Printf("Pod %s in namespace %s not found\n", pod, namespace) } else if statusError, isStatus := err.(*errors.StatusError); isStatus { - fmt.Printf("Error getting pod %v\n", statusError.ErrStatus.Message) + fmt.Printf("Error getting pod %s in namespace %s: %v\n", + pod, namespace, statusError.ErrStatus.Message) } else if err != nil { panic(err.Error()) } else { - fmt.Printf("Found pod\n") + fmt.Printf("Found pod %s in namespace %s\n", pod, namespace) } time.Sleep(10 * time.Second) diff --git a/vendor/k8s.io/client-go/examples/workqueue/BUILD b/vendor/k8s.io/client-go/examples/workqueue/BUILD index b0890ae792..8c3c7cb519 100644 --- a/vendor/k8s.io/client-go/examples/workqueue/BUILD +++ b/vendor/k8s.io/client-go/examples/workqueue/BUILD @@ -8,8 +8,7 @@ load( go_binary( name = "workqueue", - importpath = "k8s.io/client-go/examples/workqueue", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/interface.go b/vendor/k8s.io/client-go/informers/admissionregistration/interface.go index 74bfb60198..138dccc266 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/interface.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package admissionregistration diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/initializerconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/initializerconfiguration.go index 0f55c737f5..659a04caf2 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/initializerconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/initializerconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + admissionregistration_v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/admissionregistration/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // InitializerConfigurationInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go index 44da047967..54df1caf3b 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go index 4f08d69a01..5364c1ae19 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 31a2a865cb..6e65a86c38 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + admissionregistration_v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/admissionregistration/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // MutatingWebhookConfigurationInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go index d87ab90028..42d16177cd 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + admissionregistration_v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/admissionregistration/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ValidatingWebhookConfigurationInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/interface.go b/vendor/k8s.io/client-go/informers/apps/interface.go index fdd32de0f3..7013d4d6f1 100644 --- a/vendor/k8s.io/client-go/informers/apps/interface.go +++ b/vendor/k8s.io/client-go/informers/apps/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package apps diff --git a/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go index a69be9c70f..3fe6630ff9 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + apps_v1 "k8s.io/api/apps/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ControllerRevisionInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go b/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go index 1c7abf7d09..4e10d6f6f1 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + apps_v1 "k8s.io/api/apps/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // DaemonSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1/deployment.go index 9f6beed6e0..e08f42ddbb 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + apps_v1 "k8s.io/api/apps/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // DeploymentInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1/interface.go b/vendor/k8s.io/client-go/informers/apps/v1/interface.go index 6145fd6ccd..f3abfa9aa5 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go b/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go index 1ac50607f2..2a17836cb1 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + apps_v1 "k8s.io/api/apps/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ReplicaSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go index 535790df97..e7084af587 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + apps_v1 "k8s.io/api/apps/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/apps/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // StatefulSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go index 1e2de416bc..b4878e7248 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + apps_v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/apps/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ControllerRevisionInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go index 4d2dea575a..589ec39a50 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + apps_v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/apps/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // DeploymentInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go index 3a51a1f5b4..c0a487ca2e 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go index 779ae2c60d..f12364c511 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + apps_v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/apps/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // StatefulSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go index a7d55ab4c6..a2f3ceaac3 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( + time "time" + apps_v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" - time "time" ) // ControllerRevisionInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go index 5d3288026e..700895e61c 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( + time "time" + apps_v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" - time "time" ) // DaemonSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go index 6b6cd60352..ba1a3cf9b5 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( + time "time" + apps_v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" - time "time" ) // DeploymentInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go index 59a6e73d4a..93a1940d9d 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go index 988a3e4fbb..6a46b810bb 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( + time "time" + apps_v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" - time "time" ) // ReplicaSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go index dff9c24083..841cbd8ab7 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta2 import ( + time "time" + apps_v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta2 "k8s.io/client-go/listers/apps/v1beta2" cache "k8s.io/client-go/tools/cache" - time "time" ) // StatefulSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/autoscaling/interface.go b/vendor/k8s.io/client-go/informers/autoscaling/interface.go index 63a5c0ccda..347d6f6283 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/interface.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package autoscaling diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go index 7d875e7356..1215c7f3b9 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + autoscaling_v1 "k8s.io/api/autoscaling/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/autoscaling/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // HorizontalPodAutoscalerInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go b/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go index 5ba9070120..ffa7a168e7 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go index 9865f8e133..208757de3f 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v2beta1 import ( + time "time" + autoscaling_v2beta1 "k8s.io/api/autoscaling/v2beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v2beta1 "k8s.io/client-go/listers/autoscaling/v2beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // HorizontalPodAutoscalerInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/interface.go b/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/interface.go index 4c9ea84999..37ce2bc5f7 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v2beta1 diff --git a/vendor/k8s.io/client-go/informers/batch/interface.go b/vendor/k8s.io/client-go/informers/batch/interface.go index bbaec79648..f08227ba4d 100644 --- a/vendor/k8s.io/client-go/informers/batch/interface.go +++ b/vendor/k8s.io/client-go/informers/batch/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package batch diff --git a/vendor/k8s.io/client-go/informers/batch/v1/interface.go b/vendor/k8s.io/client-go/informers/batch/v1/interface.go index 41c08ea2d9..5a09dc7ce5 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/batch/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/batch/v1/job.go b/vendor/k8s.io/client-go/informers/batch/v1/job.go index 8a2e5f0d8b..36d3cef422 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1/job.go +++ b/vendor/k8s.io/client-go/informers/batch/v1/job.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + batch_v1 "k8s.io/api/batch/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/batch/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // JobInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go b/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go index 4edfd4153d..9dfaed490c 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go +++ b/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + batch_v1beta1 "k8s.io/api/batch/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/batch/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // CronJobInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go index 0ba1935dc6..3ba8401ac6 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go b/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go index 03a6e6f883..82bc9422ff 100644 --- a/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go +++ b/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v2alpha1 import ( + time "time" + batch_v2alpha1 "k8s.io/api/batch/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v2alpha1 "k8s.io/client-go/listers/batch/v2alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // CronJobInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/batch/v2alpha1/interface.go b/vendor/k8s.io/client-go/informers/batch/v2alpha1/interface.go index 39b6f33f05..3c2780fd2f 100644 --- a/vendor/k8s.io/client-go/informers/batch/v2alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/batch/v2alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v2alpha1 diff --git a/vendor/k8s.io/client-go/informers/certificates/interface.go b/vendor/k8s.io/client-go/informers/certificates/interface.go index 1eefe47973..9b31211862 100644 --- a/vendor/k8s.io/client-go/informers/certificates/interface.go +++ b/vendor/k8s.io/client-go/informers/certificates/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package certificates diff --git a/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go b/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go index 44aac5c724..a3d6c2d6a6 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + certificates_v1beta1 "k8s.io/api/certificates/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/certificates/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // CertificateSigningRequestInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go index 8578023c78..718f370ee4 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/core/interface.go b/vendor/k8s.io/client-go/informers/core/interface.go index 7fc2a5cd5f..aba68f349e 100644 --- a/vendor/k8s.io/client-go/informers/core/interface.go +++ b/vendor/k8s.io/client-go/informers/core/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package core diff --git a/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go b/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go index 77b17fd3ee..33fc65a52c 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go +++ b/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ComponentStatusInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/configmap.go b/vendor/k8s.io/client-go/informers/core/v1/configmap.go index ed0f4c2d92..618e749945 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/configmap.go +++ b/vendor/k8s.io/client-go/informers/core/v1/configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ConfigMapInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/endpoints.go b/vendor/k8s.io/client-go/informers/core/v1/endpoints.go index 8a7228bafb..fa56fbc251 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/endpoints.go +++ b/vendor/k8s.io/client-go/informers/core/v1/endpoints.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // EndpointsInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/event.go b/vendor/k8s.io/client-go/informers/core/v1/event.go index 23f5ead665..5157841756 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/event.go +++ b/vendor/k8s.io/client-go/informers/core/v1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // EventInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/interface.go b/vendor/k8s.io/client-go/informers/core/v1/interface.go index e560b12f80..9580dd9e0d 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/core/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/core/v1/limitrange.go b/vendor/k8s.io/client-go/informers/core/v1/limitrange.go index 9588b94021..8edffdfb70 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/limitrange.go +++ b/vendor/k8s.io/client-go/informers/core/v1/limitrange.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // LimitRangeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/namespace.go b/vendor/k8s.io/client-go/informers/core/v1/namespace.go index eb841b157b..e1925fed15 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/namespace.go +++ b/vendor/k8s.io/client-go/informers/core/v1/namespace.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // NamespaceInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/node.go b/vendor/k8s.io/client-go/informers/core/v1/node.go index 3c70e52b03..dc829bcd6b 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/node.go +++ b/vendor/k8s.io/client-go/informers/core/v1/node.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // NodeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go b/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go index e944560f79..b3ed3c0d08 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go +++ b/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PersistentVolumeInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go b/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go index 136884d4c9..9b4fde573f 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PersistentVolumeClaimInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/pod.go b/vendor/k8s.io/client-go/informers/core/v1/pod.go index b972082902..18e61b225e 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/pod.go +++ b/vendor/k8s.io/client-go/informers/core/v1/pod.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PodInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go b/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go index c05753850c..a7de79b183 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go +++ b/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PodTemplateInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go b/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go index e04cd14699..df0a1d6046 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go +++ b/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ReplicationControllerInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go b/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go index 3ef4f4c12c..89a56acb8a 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go +++ b/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ResourceQuotaInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/secret.go b/vendor/k8s.io/client-go/informers/core/v1/secret.go index 7bc6395a44..05939c861a 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/secret.go +++ b/vendor/k8s.io/client-go/informers/core/v1/secret.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // SecretInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/service.go b/vendor/k8s.io/client-go/informers/core/v1/service.go index d1b5ed02f9..0e8aa0f7a3 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/service.go +++ b/vendor/k8s.io/client-go/informers/core/v1/service.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ServiceInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go b/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go index fb9c50aa35..bf3b5a7bb4 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go +++ b/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + core_v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/core/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ServiceAccountInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/events/interface.go b/vendor/k8s.io/client-go/informers/events/interface.go index 81f6646f7b..e8ad97c3c3 100644 --- a/vendor/k8s.io/client-go/informers/events/interface.go +++ b/vendor/k8s.io/client-go/informers/events/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package events diff --git a/vendor/k8s.io/client-go/informers/events/v1beta1/event.go b/vendor/k8s.io/client-go/informers/events/v1beta1/event.go index d604b4cf0d..8f2b27cf58 100644 --- a/vendor/k8s.io/client-go/informers/events/v1beta1/event.go +++ b/vendor/k8s.io/client-go/informers/events/v1beta1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + events_v1beta1 "k8s.io/api/events/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/events/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // EventInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go index d079afed59..0c67badb2d 100644 --- a/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/extensions/interface.go b/vendor/k8s.io/client-go/informers/extensions/interface.go index a6bfc3b44d..93d912ca5e 100644 --- a/vendor/k8s.io/client-go/informers/extensions/interface.go +++ b/vendor/k8s.io/client-go/informers/extensions/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package extensions diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go index c64b14c3da..0f24af5ca3 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + extensions_v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // DaemonSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go index 4bcfc5c252..980eecb0f8 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + extensions_v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // DeploymentInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go index 22dac92b9c..b250d22a30 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + extensions_v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // IngressInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go index ce060e0d90..10aa1b7045 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go index 18ef2735b5..76b83b823c 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + extensions_v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PodSecurityPolicyInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go index 856cb30bab..31c6a1b86c 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + extensions_v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/extensions/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ReplicaSetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/factory.go b/vendor/k8s.io/client-go/informers/factory.go index e922c1276c..455afc2b99 100644 --- a/vendor/k8s.io/client-go/informers/factory.go +++ b/vendor/k8s.io/client-go/informers/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package informers import ( + reflect "reflect" + sync "sync" + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -39,9 +43,6 @@ import ( storage "k8s.io/client-go/informers/storage" kubernetes "k8s.io/client-go/kubernetes" cache "k8s.io/client-go/tools/cache" - reflect "reflect" - sync "sync" - time "time" ) type sharedInformerFactory struct { diff --git a/vendor/k8s.io/client-go/informers/generic.go b/vendor/k8s.io/client-go/informers/generic.go index 70ed43317d..801267edf6 100644 --- a/vendor/k8s.io/client-go/informers/generic.go +++ b/vendor/k8s.io/client-go/informers/generic.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package informers import ( "fmt" + v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/api/apps/v1" @@ -197,6 +198,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=policy, Version=v1beta1 case policy_v1beta1.SchemeGroupVersion.WithResource("poddisruptionbudgets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodDisruptionBudgets().Informer()}, nil + case policy_v1beta1.SchemeGroupVersion.WithResource("podsecuritypolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodSecurityPolicies().Informer()}, nil // Group=rbac.authorization.k8s.io, Version=v1 case rbac_v1.SchemeGroupVersion.WithResource("clusterroles"): @@ -247,6 +250,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=storage.k8s.io, Version=v1beta1 case storage_v1beta1.SchemeGroupVersion.WithResource("storageclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().StorageClasses().Informer()}, nil + case storage_v1beta1.SchemeGroupVersion.WithResource("volumeattachments"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().VolumeAttachments().Informer()}, nil } diff --git a/vendor/k8s.io/client-go/informers/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/client-go/informers/internalinterfaces/factory_interfaces.go index 61155f7404..4e2a28fc7d 100644 --- a/vendor/k8s.io/client-go/informers/internalinterfaces/factory_interfaces.go +++ b/vendor/k8s.io/client-go/informers/internalinterfaces/factory_interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,16 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalinterfaces import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" kubernetes "k8s.io/client-go/kubernetes" cache "k8s.io/client-go/tools/cache" - time "time" ) type NewInformerFunc func(kubernetes.Interface, time.Duration) cache.SharedIndexInformer diff --git a/vendor/k8s.io/client-go/informers/networking/interface.go b/vendor/k8s.io/client-go/informers/networking/interface.go index 79e0d0c151..0f6c456495 100644 --- a/vendor/k8s.io/client-go/informers/networking/interface.go +++ b/vendor/k8s.io/client-go/informers/networking/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package networking diff --git a/vendor/k8s.io/client-go/informers/networking/v1/interface.go b/vendor/k8s.io/client-go/informers/networking/v1/interface.go index 980a7be993..819a86146d 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/networking/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go b/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go index b712ba0305..20ac9909d5 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go +++ b/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + networking_v1 "k8s.io/api/networking/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/networking/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // NetworkPolicyInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/policy/interface.go b/vendor/k8s.io/client-go/informers/policy/interface.go index f893c3d5b9..e77ab2b246 100644 --- a/vendor/k8s.io/client-go/informers/policy/interface.go +++ b/vendor/k8s.io/client-go/informers/policy/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package policy diff --git a/vendor/k8s.io/client-go/informers/policy/v1beta1/BUILD b/vendor/k8s.io/client-go/informers/policy/v1beta1/BUILD index 39a7a9d34d..547a0a397c 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/informers/policy/v1beta1/BUILD @@ -10,6 +10,7 @@ go_library( srcs = [ "interface.go", "poddisruptionbudget.go", + "podsecuritypolicy.go", ], importpath = "k8s.io/client-go/informers/policy/v1beta1", deps = [ diff --git a/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go index f235ee1d0c..b368f068fa 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 @@ -26,6 +26,8 @@ import ( type Interface interface { // PodDisruptionBudgets returns a PodDisruptionBudgetInformer. PodDisruptionBudgets() PodDisruptionBudgetInformer + // PodSecurityPolicies returns a PodSecurityPolicyInformer. + PodSecurityPolicies() PodSecurityPolicyInformer } type version struct { @@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (v *version) PodDisruptionBudgets() PodDisruptionBudgetInformer { return &podDisruptionBudgetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } + +// PodSecurityPolicies returns a PodSecurityPolicyInformer. +func (v *version) PodSecurityPolicies() PodSecurityPolicyInformer { + return &podSecurityPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go b/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go index ba0da35b1e..d5178652a1 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + policy_v1beta1 "k8s.io/api/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/policy/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PodDisruptionBudgetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/interface.go b/vendor/k8s.io/client-go/informers/rbac/interface.go index df7adfcd3c..ac491ee427 100644 --- a/vendor/k8s.io/client-go/informers/rbac/interface.go +++ b/vendor/k8s.io/client-go/informers/rbac/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package rbac diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go index ac75abbc8c..f541957a22 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + rbac_v1 "k8s.io/api/rbac/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go index a3c73e586c..bf1d7bdc1f 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + rbac_v1 "k8s.io/api/rbac/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/interface.go b/vendor/k8s.io/client-go/informers/rbac/v1/interface.go index 1e46b039bd..fca0e807b4 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1/role.go index fb1de46145..f08e1fde30 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + rbac_v1 "k8s.io/api/rbac/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go index 78c78fa1ac..f91c2ef03a 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + rbac_v1 "k8s.io/api/rbac/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/rbac/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go index ec257965b7..9293439f40 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + rbac_v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go index a2d0c39607..d13561274d 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + rbac_v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go index 586283d4a2..1c972ec82f 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go index 4564b33616..5b4148fa99 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + rbac_v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go index 556f966a86..54bae16e78 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + rbac_v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/rbac/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go index 821746b90d..f429eeca1b 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + rbac_v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go index c517ac4561..5900eae9af 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + rbac_v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // ClusterRoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go index 9d375d947c..c36d644e11 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go index 0f13d3aaf6..479044b42c 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + rbac_v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go index c951d97d50..34feed183b 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + rbac_v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/rbac/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // RoleBindingInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/scheduling/interface.go b/vendor/k8s.io/client-go/informers/scheduling/interface.go index 60b63e8e5c..89aaac195a 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/interface.go +++ b/vendor/k8s.io/client-go/informers/scheduling/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package scheduling diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/interface.go index 1cceef7b25..091dd90b6e 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go b/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go index 5c90f43df0..8a27631bec 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + scheduling_v1alpha1 "k8s.io/api/scheduling/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/scheduling/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PriorityClassInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/settings/interface.go b/vendor/k8s.io/client-go/informers/settings/interface.go index 53bc662170..cc134f7060 100644 --- a/vendor/k8s.io/client-go/informers/settings/interface.go +++ b/vendor/k8s.io/client-go/informers/settings/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package settings diff --git a/vendor/k8s.io/client-go/informers/settings/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/settings/v1alpha1/interface.go index 39007ebe25..d2964352ab 100644 --- a/vendor/k8s.io/client-go/informers/settings/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/settings/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go b/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go index 2e630c73d0..7e241b2be5 100644 --- a/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go +++ b/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + settings_v1alpha1 "k8s.io/api/settings/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/settings/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // PodPresetInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/storage/interface.go b/vendor/k8s.io/client-go/informers/storage/interface.go index b91613a921..6581a2a8d7 100644 --- a/vendor/k8s.io/client-go/informers/storage/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package storage diff --git a/vendor/k8s.io/client-go/informers/storage/v1/interface.go b/vendor/k8s.io/client-go/informers/storage/v1/interface.go index fadb1a0739..ebdb1d98aa 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go b/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go index 341549f0fb..5ef571eb41 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1 import ( + time "time" + storage_v1 "k8s.io/api/storage/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1 "k8s.io/client-go/listers/storage/v1" cache "k8s.io/client-go/tools/cache" - time "time" ) // StorageClassInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go index d84eb5fd27..f1b1a9bbdb 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go b/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go index cab9ffc469..506517acd7 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go +++ b/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + storage_v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1alpha1 "k8s.io/client-go/listers/storage/v1alpha1" cache "k8s.io/client-go/tools/cache" - time "time" ) // VolumeAttachmentInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/BUILD b/vendor/k8s.io/client-go/informers/storage/v1beta1/BUILD index 0a7ad316b6..64aae51654 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/BUILD @@ -10,6 +10,7 @@ go_library( srcs = [ "interface.go", "storageclass.go", + "volumeattachment.go", ], importpath = "k8s.io/client-go/informers/storage/v1beta1", deps = [ diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go index 7fa1abf5f6..5a63728f1e 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 @@ -26,6 +26,8 @@ import ( type Interface interface { // StorageClasses returns a StorageClassInformer. StorageClasses() StorageClassInformer + // VolumeAttachments returns a VolumeAttachmentInformer. + VolumeAttachments() VolumeAttachmentInformer } type version struct { @@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (v *version) StorageClasses() StorageClassInformer { return &storageClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// VolumeAttachments returns a VolumeAttachmentInformer. +func (v *version) VolumeAttachments() VolumeAttachmentInformer { + return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go index 3e96b28200..0b4edbf52e 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1beta1 import ( + time "time" + storage_v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,6 @@ import ( kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/storage/v1beta1" cache "k8s.io/client-go/tools/cache" - time "time" ) // StorageClassInformer provides access to a shared informer and lister for diff --git a/vendor/k8s.io/client-go/kubernetes/clientset.go b/vendor/k8s.io/client-go/kubernetes/clientset.go index 7dcf86a702..d867a58b2d 100644 --- a/vendor/k8s.io/client-go/kubernetes/clientset.go +++ b/vendor/k8s.io/client-go/kubernetes/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package kubernetes import ( diff --git a/vendor/k8s.io/client-go/kubernetes/doc.go b/vendor/k8s.io/client-go/kubernetes/doc.go index d8e920a5cd..c5870c01ab 100644 --- a/vendor/k8s.io/client-go/kubernetes/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated clientset. package kubernetes diff --git a/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go b/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go index 12cfac0a8f..0eb5ac9e5a 100644 --- a/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go +++ b/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( @@ -95,7 +97,15 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { fakePtr := testing.Fake{} fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) - fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil)) + fakePtr.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} } diff --git a/vendor/k8s.io/client-go/kubernetes/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/fake/doc.go index 3fd8e1e2cd..0bc260bcaa 100644 --- a/vendor/k8s.io/client-go/kubernetes/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated fake clientset. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/fake/register.go b/vendor/k8s.io/client-go/kubernetes/fake/register.go index 7c78f5670d..45fdf124c7 100644 --- a/vendor/k8s.io/client-go/kubernetes/fake/register.go +++ b/vendor/k8s.io/client-go/kubernetes/fake/register.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( @@ -65,7 +67,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -103,5 +105,4 @@ func AddToScheme(scheme *runtime.Scheme) { storagev1beta1.AddToScheme(scheme) storagev1.AddToScheme(scheme) storagev1alpha1.AddToScheme(scheme) - } diff --git a/vendor/k8s.io/client-go/kubernetes/scheme/doc.go b/vendor/k8s.io/client-go/kubernetes/scheme/doc.go index 3ec2200d09..5c5c8debb6 100644 --- a/vendor/k8s.io/client-go/kubernetes/scheme/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package contains the scheme of the automatically generated clientset. package scheme diff --git a/vendor/k8s.io/client-go/kubernetes/scheme/register.go b/vendor/k8s.io/client-go/kubernetes/scheme/register.go index 7bfd336185..66e2dcd18b 100644 --- a/vendor/k8s.io/client-go/kubernetes/scheme/register.go +++ b/vendor/k8s.io/client-go/kubernetes/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package scheme import ( @@ -65,7 +67,7 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // @@ -103,5 +105,4 @@ func AddToScheme(scheme *runtime.Scheme) { storagev1beta1.AddToScheme(scheme) storagev1.AddToScheme(scheme) storagev1alpha1.AddToScheme(scheme) - } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go index 5150fee3c5..8137129fc2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/doc.go index cdaaf62078..69ca30111b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go index d73267ee68..2917c0ae41 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_initializerconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_initializerconfiguration.go index a06b59f632..699261cd4d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_initializerconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_initializerconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go index ccdfb43f6b..710bc4ea4d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 type InitializerConfigurationExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go index 757a1c1d9e..77c6b8fcc3 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go index 8d3774b4e4..44b20b5779 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/doc.go index 1b50aa1997..11ae7049d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go index 148eaf9f87..3255acb476 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go index a02bf7b7c5..044636eadc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go index 422a0a2412..f06582d4e5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/generated_expansion.go index 012a8da7e7..2936975553 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type MutatingWebhookConfigurationExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 36711a5009..d37f684489 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go index d66849225d..30dcfddbc2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go index 07936304ea..b0af798069 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go index 1d9f831346..26d0207473 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go index fd38c53c5f..73fd1e9bd5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go index 34c06c8de5..1a3e8f7302 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/doc.go index b6a2a46728..d007a2903d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go index d4e34411bd..11accc2350 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go index ae9d4f3ff1..fb43bea4ce 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go index 3f32ed1f31..0ee4cd33d6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go index b0e8f82d7f..852b628ada 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go index ba8539578c..03f7558d46 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go index 39d3c59fbe..af0a907206 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/generated_expansion.go index 500d67dd36..0f603bb8cc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type ControllerRevisionExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go index 5047b0c5f8..f2f9c72565 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go index 2c927ac0cd..78fe23f845 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go index 7d1fd9e6ad..1aebc21762 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go index 348c955a05..312ba3c47c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go index 8a72cefbc6..2ff58aeacb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go index 1b50aa1997..11ae7049d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go index f1280bc3f3..5cc316882c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go index f75db1bad1..2360bb07ae 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go index 2907c2a8c6..5282d8cd96 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_scale.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_scale.go index 8abb429acc..72615c8035 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeScales implements ScaleInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go index 1ae9c6a58f..6e1d7a560e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go index a091b902ad..a44a94b63b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type ControllerRevisionExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/scale.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/scale.go index d3bf9e1032..e8c5073267 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go index 8e5b9f5703..6f89ca73af 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go index 771c7447e0..8d5a78c448 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go index d28240339e..28b30e8beb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go index 4657c1b2c5..c21fc50a85 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go index 7da8d2696d..270be527ee 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/doc.go index e8d65fa241..01d0ed2c2a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta2 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go index 20bd67d246..7223cd24e0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go index 62b89e2092..720972e7dd 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go index dfd1c4abe3..3576b8427c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go index 3b204f2a7e..1f654a3cce 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go index 338f92c114..f8e69a3a35 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_scale.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_scale.go index a6ad9f1e71..fb5eb5c593 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeScales implements ScaleInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go index bdff833006..0413428eb1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/generated_expansion.go index b0fe7ef70a..a88e1721f1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 type ControllerRevisionExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go index dc6ce10521..298ec26a2e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/scale.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/scale.go index 2c2aa185f1..84f27a7977 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go index 516587faa1..64b7c8c8ff 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta2 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go index dcc31d654b..25b86152d2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/doc.go index b6a2a46728..d007a2903d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go index 85eb00ddfd..93a0633e8b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go index b1c527a711..d98aa03d8c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeTokenReviews implements TokenReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go index 42e76d5e43..7c92b91478 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go index 9cfef4e6ac..88f759f2b9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go index 6004b0e301..744c26c9e6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go index 1b50aa1997..11ae7049d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go index 8f66d8c5b1..abc1fedd17 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go index e8c57210b3..c7c3e5631d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeTokenReviews implements TokenReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go index 2b7e8ca0bf..7fd68c803f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go index 7f9f1e9fa0..fa611825e2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go index 385dffcd17..852720f346 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/doc.go index b6a2a46728..d007a2903d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go index 7ee26250b2..5db9b9f348 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go index a49fc9b729..5f1aab8a40 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go index 26d9011b4c..7e466e1ec0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go index dfe947b90a..82c1ac9cf4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSelfSubjectRulesReviews implements SelfSubjectRulesReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go index 778d06e593..cbc440e713 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSubjectAccessReviews implements SubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go index 42e76d5e43..7c92b91478 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go index b2085bceb2..20461f132e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go index cfb019eaaf..202e7c90dc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go index fbd374a137..5fb1cab5c0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go index 08f6d60952..8816414944 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go index 7c05341235..cbe5bdceeb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go index 1b50aa1997..11ae7049d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go index 33d5746a53..7c3fc17461 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go index 11987f1256..c7949a7df2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go index aeba438953..20904d1795 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go index 4e221c282e..2acd5f279e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSelfSubjectRulesReviews implements SelfSubjectRulesReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go index 4413c6d34d..218ed3d8fc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeSubjectAccessReviews implements SubjectAccessReviewInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go index 2b7e8ca0bf..7fd68c803f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go index 9b8e103419..8029837f9b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go index 1ef3e49afe..36feb15300 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go index 7f640d91bf..57079c8d93 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go index cd60e9df6b..d91fa87ece 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go index 5464ab59df..b336bbd39b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go index b6a2a46728..d007a2903d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go index c3e0d37349..540eb5f5cc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go index e7e660bdd7..532e6f51c9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/generated_expansion.go index effefbd50b..a5c694ffbc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type HorizontalPodAutoscalerExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go index 4191c920fa..9245e41a26 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go index 753e5dc770..25446452fd 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/doc.go index de272bd126..1f70aedf8f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v2beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go index e997033c40..6d3437a234 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go index 6b70822ad4..549196c5e3 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/generated_expansion.go index eddac4a780..561fbb0e6a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2beta1 type HorizontalPodAutoscalerExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go index 9ff497c107..1be9b80caf 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go index 5cf75f9c3a..c092a3ca1c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go index b6a2a46728..d007a2903d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go index 4e2d361e80..27d54c4c45 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go index b51c8f5cd6..4d9ba490f0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/generated_expansion.go index 68d7741fa0..04a37a49d2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type JobExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go index d80205ddf7..dc0c79997c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go index 88baefe3b3..5ee39b5be7 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go index 48b68988bd..32ac52facc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/doc.go index 1b50aa1997..11ae7049d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go index fe95cd4c94..9de70f8fe6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go index 5bcb84e8ac..756585d7db 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/generated_expansion.go index 22939f58d0..a093bbad45 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type CronJobExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go index 1dd5b82c7c..ff26a76d51 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go index a8aaa9474b..e5b1353149 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go index 7f1ef91b16..ba60ac54be 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v2alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go index c8f5a40de8..52ad499cc4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go index 9ea0d3459b..f80e94cae7 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go index 078027ef49..ed2c942b04 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v2alpha1 type CronJobExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go index 7226d92d76..7d69ce9f6c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go index 769f71c677..ecca7aedc5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/doc.go index 1b50aa1997..11ae7049d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go index 550c5bba15..455ac56b59 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go index 7b515240f7..f3ea4c464e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go index 2b7e8ca0bf..7fd68c803f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/BUILD index dd86cfecd2..4c9f03aa4d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/BUILD @@ -32,9 +32,11 @@ go_library( "service.go", "service_expansion.go", "serviceaccount.go", + "serviceaccount_expansion.go", ], importpath = "k8s.io/client-go/kubernetes/typed/core/v1", deps = [ + "//vendor/k8s.io/api/authentication/v1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", "//vendor/k8s.io/api/policy/v1beta1:go_default_library", diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go index 89c645a0e5..1717e7c193 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go index 899e492ade..6e7a12e5d8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go index e5b901e5c5..1c86c47d4e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/doc.go index b6a2a46728..d007a2903d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go index 3c463daaa1..03b2a69192 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go index 857c885ad8..b9570e6893 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/BUILD index f62201d87d..7403a4997d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/BUILD @@ -31,9 +31,11 @@ go_library( "fake_service.go", "fake_service_expansion.go", "fake_serviceaccount.go", + "fake_serviceaccount_expansion.go", ], importpath = "k8s.io/client-go/kubernetes/typed/core/v1/fake", deps = [ + "//vendor/k8s.io/api/authentication/v1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", "//vendor/k8s.io/api/policy/v1beta1:go_default_library", diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go index 1f358b7e3d..42039aea98 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go index 262a4c5e80..8de1cde17e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go index 0956b4c63c..b30c02de10 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go index d1fad00ddf..7b54929f63 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go index 60d6b45a58..5ba47f4199 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go index dc58c335c6..bd736980ec 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go index 8c03925a7f..84743469ae 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go index 76d2ac1e5a..c7e042fc8d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go index 65b76e95e5..1be38a89ee 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go index cb55df14bd..ea189bb9c9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go index ed35ed7cbf..6f5faef99d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go index fa6233850d..1dd272e783 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go index 2fe0a6cf33..047831a312 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go index 36a64903d6..afdc8c88a3 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go index 58c6dc9c6d..abf7db0903 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go index c734ff5b56..7ce885ae89 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go index 4c5f67b495..635b2c32bf 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go index 5fe0585b41..430bd6c5a8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type ComponentStatusExpansion interface{} @@ -35,5 +37,3 @@ type ReplicationControllerExpansion interface{} type ResourceQuotaExpansion interface{} type SecretExpansion interface{} - -type ServiceAccountExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go index 63ac612b48..b67997d700 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go index 0effd3e097..a298d7c026 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go index 202a91df35..b16f92f00a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go index 175f388216..f23b95f30a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go index a6159f1255..f168a985a6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go index 267cd7f60c..423d81ad88 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go index c286e2964c..730b543307 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go index 196c8d05a9..a0f36a1fa0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go index 311d0e8cc4..011e72a919 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go index db4a70d95e..931afb5dbc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go index ff95602012..156bcc2356 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go index 9e3b126b6a..0a87feb5b5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/doc.go index 1b50aa1997..11ae7049d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go index 3473e99c42..e8737cf9e4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go index 05cee7fb26..7225d90d8c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go index 4b9ebd6e5e..02fa70fbdd 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go index 54b28b6ee8..c6eb066237 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/generated_expansion.go index 82b2fb4a1f..871411abb1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type EventExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go index 95ca28afbc..20cd58728d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go index 65f3820b9c..91ada9e54d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go index 1b50aa1997..11ae7049d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go index b4f8886ad2..c359a58f2f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go index 3a3220a059..083bed820a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go index d5abace975..1ce8fb34b1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go index 8ec490c502..d8b6741e6c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go index 5a6f93e0e0..60efe17c8f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go index 28bbbbb7f2..c381e62f19 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go index e8d22c6b49..20e8f76f62 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go index 77f8c61a7d..0bbcbd15fe 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeScales implements ScaleInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/generated_expansion.go index e693fe68c1..eef05e7652 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type DaemonSetExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go index 0bef3972aa..26b21baa55 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go index 071f78eac5..19475a5c0c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go index 8daa1cc01d..b307ac70e1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go index 733012adee..e654d95372 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/doc.go index b6a2a46728..d007a2903d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go index d9733a0bff..8bce642502 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go index 6fc226e187..fbab3ca16b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go index cdd70ae353..c6dd5c323d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type NetworkPolicyExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go index 1b9099eeb8..ac8200f824 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go index 96487885c5..b0a85c5c55 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/BUILD index 2abeb549d2..92606b3c45 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/BUILD @@ -13,6 +13,7 @@ go_library( "eviction_expansion.go", "generated_expansion.go", "poddisruptionbudget.go", + "podsecuritypolicy.go", "policy_client.go", ], importpath = "k8s.io/client-go/kubernetes/typed/policy/v1beta1", diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go index 1b50aa1997..11ae7049d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction.go index 9c4133e369..b0abf65632 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/BUILD index 5fc7afdc9f..9b6941ce9a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/BUILD @@ -12,6 +12,7 @@ go_library( "fake_eviction.go", "fake_eviction_expansion.go", "fake_poddisruptionbudget.go", + "fake_podsecuritypolicy.go", "fake_policy_client.go", ], importpath = "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake", diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go index a091d8de39..06aba37b43 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake // FakeEvictions implements EvictionInterface diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go index b00af71881..d85a67e4f5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go index c9039b5196..3b7e5415e8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( @@ -34,6 +36,10 @@ func (c *FakePolicyV1beta1) PodDisruptionBudgets(namespace string) v1beta1.PodDi return &FakePodDisruptionBudgets{c, namespace} } +func (c *FakePolicyV1beta1) PodSecurityPolicies() v1beta1.PodSecurityPolicyInterface { + return &FakePodSecurityPolicies{c} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakePolicyV1beta1) RESTClient() rest.Interface { diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go index 511adc6ef7..d39f527be5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type PodDisruptionBudgetExpansion interface{} + +type PodSecurityPolicyExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go index 47b391d80b..d154dfcf8f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go index 40588ce97b..f45cfdf37f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( @@ -27,6 +29,7 @@ type PolicyV1beta1Interface interface { RESTClient() rest.Interface EvictionsGetter PodDisruptionBudgetsGetter + PodSecurityPoliciesGetter } // PolicyV1beta1Client is used to interact with features provided by the policy group. @@ -42,6 +45,10 @@ func (c *PolicyV1beta1Client) PodDisruptionBudgets(namespace string) PodDisrupti return newPodDisruptionBudgets(c, namespace) } +func (c *PolicyV1beta1Client) PodSecurityPolicies() PodSecurityPolicyInterface { + return newPodSecurityPolicies(c) +} + // NewForConfig creates a new PolicyV1beta1Client for the given config. func NewForConfig(c *rest.Config) (*PolicyV1beta1Client, error) { config := *c diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go index e0ea45148e..e1af3a99bf 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go index 11b2e21653..c49ac6dd20 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/doc.go index b6a2a46728..d007a2903d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go index 645126f2c8..b07323c505 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go index a9c0bb0891..5e960c8ca0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go index cddaf6d506..5311f06184 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go index f64ede6389..733760de24 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go index e499cf95b3..11a75f9396 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/generated_expansion.go index aa3df0df2f..0977cc00c2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type ClusterRoleExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go index dd0a0cb0dc..e5b7b561d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go index d83e722b73..678e284b7b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go index a424365807..7fd9e29fa5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go index e6c65ba99d..901ef7f469 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go index a7156214a9..c5c5360b99 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go index cdaaf62078..69ca30111b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go index 1b6bfc311b..1b3eec0142 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go index 0aadc16b42..d54eb6f254 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go index 11470696d0..12a96c5b65 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go index 42de548747..8c365efcb2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go index 958da4a92a..4346589a85 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/generated_expansion.go index f506fc3468..aebf50655d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 type ClusterRoleExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go index 936008d4a6..06b5f5cab5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go index 8591128af7..8af1d77843 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go index 0616691bb5..43888d0668 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go index 6fdb04379e..fd6effd467 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go index 1aedea6ea4..469307000a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/doc.go index 1b50aa1997..11ae7049d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go index 643988bb82..738ca1ea9a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go index 461b546653..144bf70d3c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go index 929d035293..0856ee084e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go index 7038bcf0dd..2e9d46b515 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go index a04a2f89ac..bb363d8749 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/generated_expansion.go index d7f80c0042..538b09833e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type ClusterRoleExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go index 87932b58d7..eecdd45a8f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go index 95e252937c..363b2c6cd5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go index e8e611a954..8d9f1f6177 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/doc.go index cdaaf62078..69ca30111b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go index 8c82c186a5..9946411e24 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go index cd0d80d433..6e0a9659e1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/generated_expansion.go index 3eb42e0187..682f0f3bf4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 type PriorityClassExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go index 2b77c44eb4..055a0e3f37 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go index 030e9db329..f030b319e8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/doc.go index cdaaf62078..69ca30111b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go index 292458ee4e..512b38f540 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_podpreset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_settings_client.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_settings_client.go index 6feb9b218f..fb07a8248f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_settings_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/fake/fake_settings_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/generated_expansion.go index d599b2935c..f0dbcc6071 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 type PodPresetExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go index ce38680831..25ed8f543e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/settings_client.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/settings_client.go index 595b23f044..77fa640407 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/settings_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/settings_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/doc.go index b6a2a46728..d007a2903d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go index 97972f0f74..9ba1f51044 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go index 7e3378ad73..147ad80281 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go index 39df9fb879..08fedd7ed0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 type StorageClassExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go index 1102653ae0..36a189c46c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go index 4e7c5b71b0..24133cd624 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/doc.go index cdaaf62078..69ca30111b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go index 1d06eba6b8..5a9ed0964b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go index 5213d10bee..c5db885319 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go index afa636a2f0..e3fc3f3995 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 type VolumeAttachmentExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go index 3e8c70bf1e..63834e4622 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go index 08bdfb2596..7bf79a6c1a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1alpha1 import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/BUILD index 08cb7f6d1c..79d13929c7 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/BUILD @@ -12,6 +12,7 @@ go_library( "generated_expansion.go", "storage_client.go", "storageclass.go", + "volumeattachment.go", ], importpath = "k8s.io/client-go/kubernetes/typed/storage/v1beta1", deps = [ diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go index 1b50aa1997..11ae7049d1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/BUILD b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/BUILD index a7457e7d29..7430088843 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/BUILD +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/BUILD @@ -11,6 +11,7 @@ go_library( "doc.go", "fake_storage_client.go", "fake_storageclass.go", + "fake_volumeattachment.go", ], importpath = "k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake", deps = [ diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go index c58fac35e4..87a1873edc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go index a178091d98..a81d90542a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( @@ -30,6 +32,10 @@ func (c *FakeStorageV1beta1) StorageClasses() v1beta1.StorageClassInterface { return &FakeStorageClasses{c} } +func (c *FakeStorageV1beta1) VolumeAttachments() v1beta1.VolumeAttachmentInterface { + return &FakeVolumeAttachments{c} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeStorageV1beta1) RESTClient() rest.Interface { diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go index 9a830881a5..ce1e72d535 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/generated_expansion.go index 6f3f0c55e6..5bb931f050 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 type StorageClassExpansion interface{} + +type VolumeAttachmentExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go index 4db3d137ed..4ca05be6fc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( @@ -26,6 +28,7 @@ import ( type StorageV1beta1Interface interface { RESTClient() rest.Interface StorageClassesGetter + VolumeAttachmentsGetter } // StorageV1beta1Client is used to interact with features provided by the storage.k8s.io group. @@ -37,6 +40,10 @@ func (c *StorageV1beta1Client) StorageClasses() StorageClassInterface { return newStorageClasses(c) } +func (c *StorageV1beta1Client) VolumeAttachments() VolumeAttachmentInterface { + return newVolumeAttachments(c) +} + // NewForConfig creates a new StorageV1beta1Client for the given config. func NewForConfig(c *rest.Config) (*StorageV1beta1Client, error) { config := *c diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go index 7c900b3e3d..63047a7fbb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. + package v1beta1 import ( diff --git a/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/expansion_generated.go index fb3b009874..868ee66cf8 100644 --- a/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/initializerconfiguration.go b/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/initializerconfiguration.go index 60b004ef9f..a2cc796dc9 100644 --- a/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/initializerconfiguration.go +++ b/vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/initializerconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/expansion_generated.go index c9bf0fa5da..93dddb5ffe 100644 --- a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 753dd18565..015587e80f 100644 --- a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 6cb6067a16..243589b2f1 100644 --- a/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/controllerrevision.go b/vendor/k8s.io/client-go/listers/apps/v1/controllerrevision.go index c05d14c254..19f567e82b 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/controllerrevision.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/daemonset.go b/vendor/k8s.io/client-go/listers/apps/v1/daemonset.go index 307f8bc7c6..7fcd1e0631 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/daemonset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/deployment.go b/vendor/k8s.io/client-go/listers/apps/v1/deployment.go index 36af900947..2d2ecf0cf6 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/deployment.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go index 48917c2c05..1e8bf6fec8 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/replicaset.go b/vendor/k8s.io/client-go/listers/apps/v1/replicaset.go index 7e316d6b4d..99fb92ff4a 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/replicaset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1/statefulset.go b/vendor/k8s.io/client-go/listers/apps/v1/statefulset.go index fe584038e2..6ad54b71fa 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/statefulset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta1/controllerrevision.go b/vendor/k8s.io/client-go/listers/apps/v1beta1/controllerrevision.go index f3c85bfa77..95aeb0236f 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta1/controllerrevision.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta1/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta1/deployment.go b/vendor/k8s.io/client-go/listers/apps/v1beta1/deployment.go index f59f3a9624..4f6e883ba7 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/apps/v1beta1/expansion_generated.go index 441ceecdd4..4f3813a94a 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta1/scale.go b/vendor/k8s.io/client-go/listers/apps/v1beta1/scale.go index ec9a419a09..85bf3a6f4c 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta1/scale.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta1/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta1/statefulset.go b/vendor/k8s.io/client-go/listers/apps/v1beta1/statefulset.go index f10ef7318c..a967e8492b 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta1/statefulset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta1/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/controllerrevision.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/controllerrevision.go index f9f1ef06a3..3d5274dc39 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/controllerrevision.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/controllerrevision.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/daemonset.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/daemonset.go index cbdb13ef54..0ea4dc83f0 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/daemonset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/deployment.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/deployment.go index 0778a9fdd4..8855bb20ca 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/deployment.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go index 6db63d4b09..48cbedb8fa 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/replicaset.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/replicaset.go index f76e2eeb54..0fd8dbaa42 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/replicaset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/scale.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/scale.go index 11cb3e1956..f53e42ce8b 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/scale.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/statefulset.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/statefulset.go index 13ef28f853..2e095ace43 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/statefulset.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/statefulset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta2 diff --git a/vendor/k8s.io/client-go/listers/authentication/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/authentication/v1/expansion_generated.go index 3dcc802892..77b284d8d9 100644 --- a/vendor/k8s.io/client-go/listers/authentication/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/authentication/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authentication/v1/tokenreview.go b/vendor/k8s.io/client-go/listers/authentication/v1/tokenreview.go index cfae0476f3..5f2c6c3e6d 100644 --- a/vendor/k8s.io/client-go/listers/authentication/v1/tokenreview.go +++ b/vendor/k8s.io/client-go/listers/authentication/v1/tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authentication/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/authentication/v1beta1/expansion_generated.go index 2ce7f7f92e..3b2b188607 100644 --- a/vendor/k8s.io/client-go/listers/authentication/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/authentication/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authentication/v1beta1/tokenreview.go b/vendor/k8s.io/client-go/listers/authentication/v1beta1/tokenreview.go index 035ad62da3..9db014e9b8 100644 --- a/vendor/k8s.io/client-go/listers/authentication/v1beta1/tokenreview.go +++ b/vendor/k8s.io/client-go/listers/authentication/v1beta1/tokenreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/authorization/v1/expansion_generated.go index 0c91dd0c1c..9a0f2e2128 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1/localsubjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1/localsubjectaccessreview.go index d0729f1120..99055b348c 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1/localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1/localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectaccessreview.go index 64ff1744be..627e4dd747 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectrulesreview.go b/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectrulesreview.go index 63ad0f1ff7..6b2f063521 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1/selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1/subjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1/subjectaccessreview.go index f389e07b1f..ca7b47b46d 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1/subjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1/subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/authorization/v1beta1/expansion_generated.go index 771d774000..d140d6563a 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1beta1/localsubjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1beta1/localsubjectaccessreview.go index b2478381bf..534e39aa90 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1beta1/localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1beta1/localsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectaccessreview.go index 4936b9b6c9..c2e82dbb9a 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectrulesreview.go b/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectrulesreview.go index 8eb7a21b50..5ce83f217b 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1beta1/selfsubjectrulesreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/authorization/v1beta1/subjectaccessreview.go b/vendor/k8s.io/client-go/listers/authorization/v1beta1/subjectaccessreview.go index 4b155de157..b1853fc3cf 100644 --- a/vendor/k8s.io/client-go/listers/authorization/v1beta1/subjectaccessreview.go +++ b/vendor/k8s.io/client-go/listers/authorization/v1beta1/subjectaccessreview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/autoscaling/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/autoscaling/v1/expansion_generated.go index f7b00603f5..a20ab75daf 100644 --- a/vendor/k8s.io/client-go/listers/autoscaling/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/autoscaling/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/autoscaling/v1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/listers/autoscaling/v1/horizontalpodautoscaler.go index 48012203ea..27ade7ddb7 100644 --- a/vendor/k8s.io/client-go/listers/autoscaling/v1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/listers/autoscaling/v1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/expansion_generated.go index 9e84ef13e9..c026b65d5f 100644 --- a/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v2beta1 diff --git a/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/horizontalpodautoscaler.go index c8fbdecd71..4c29df910a 100644 --- a/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/listers/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v2beta1 diff --git a/vendor/k8s.io/client-go/listers/batch/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/batch/v1/expansion_generated.go index 38b7e2720e..63091e84a5 100644 --- a/vendor/k8s.io/client-go/listers/batch/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/batch/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/batch/v1/job.go b/vendor/k8s.io/client-go/listers/batch/v1/job.go index 89280d9fa6..e29e0271c7 100644 --- a/vendor/k8s.io/client-go/listers/batch/v1/job.go +++ b/vendor/k8s.io/client-go/listers/batch/v1/job.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/batch/v1beta1/cronjob.go b/vendor/k8s.io/client-go/listers/batch/v1beta1/cronjob.go index a8fa51ecfb..93f1979868 100644 --- a/vendor/k8s.io/client-go/listers/batch/v1beta1/cronjob.go +++ b/vendor/k8s.io/client-go/listers/batch/v1beta1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/batch/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/batch/v1beta1/expansion_generated.go index 3d84d249a5..1d6cc198a4 100644 --- a/vendor/k8s.io/client-go/listers/batch/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/batch/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/batch/v2alpha1/cronjob.go b/vendor/k8s.io/client-go/listers/batch/v2alpha1/cronjob.go index 51f5eef554..6af5f14576 100644 --- a/vendor/k8s.io/client-go/listers/batch/v2alpha1/cronjob.go +++ b/vendor/k8s.io/client-go/listers/batch/v2alpha1/cronjob.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v2alpha1 diff --git a/vendor/k8s.io/client-go/listers/batch/v2alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/batch/v2alpha1/expansion_generated.go index 38ac70cdfb..11f6c34717 100644 --- a/vendor/k8s.io/client-go/listers/batch/v2alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/batch/v2alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v2alpha1 diff --git a/vendor/k8s.io/client-go/listers/certificates/v1beta1/certificatesigningrequest.go b/vendor/k8s.io/client-go/listers/certificates/v1beta1/certificatesigningrequest.go index 425dc6b4d9..a122c36608 100644 --- a/vendor/k8s.io/client-go/listers/certificates/v1beta1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/listers/certificates/v1beta1/certificatesigningrequest.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go index c240be44ff..6815de7ad6 100644 --- a/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/componentstatus.go b/vendor/k8s.io/client-go/listers/core/v1/componentstatus.go index 6ba67d0bd5..82fbedac2b 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/componentstatus.go +++ b/vendor/k8s.io/client-go/listers/core/v1/componentstatus.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/configmap.go b/vendor/k8s.io/client-go/listers/core/v1/configmap.go index e976928d93..fc927ab2c6 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/configmap.go +++ b/vendor/k8s.io/client-go/listers/core/v1/configmap.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/endpoints.go b/vendor/k8s.io/client-go/listers/core/v1/endpoints.go index 6f5a1133c7..7799562d71 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/endpoints.go +++ b/vendor/k8s.io/client-go/listers/core/v1/endpoints.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/event.go b/vendor/k8s.io/client-go/listers/core/v1/event.go index b087cd8bd9..738e333db5 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/event.go +++ b/vendor/k8s.io/client-go/listers/core/v1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go index a96db8dc96..b8b985ce08 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/limitrange.go b/vendor/k8s.io/client-go/listers/core/v1/limitrange.go index f19943751a..4ee02634d3 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/limitrange.go +++ b/vendor/k8s.io/client-go/listers/core/v1/limitrange.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/namespace.go b/vendor/k8s.io/client-go/listers/core/v1/namespace.go index 21be6878a3..b819d741e8 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/namespace.go +++ b/vendor/k8s.io/client-go/listers/core/v1/namespace.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/node.go b/vendor/k8s.io/client-go/listers/core/v1/node.go index d43a682c90..21a8a0675b 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/node.go +++ b/vendor/k8s.io/client-go/listers/core/v1/node.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/persistentvolume.go b/vendor/k8s.io/client-go/listers/core/v1/persistentvolume.go index 593ba14ed1..a88dbd0c01 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/persistentvolume.go +++ b/vendor/k8s.io/client-go/listers/core/v1/persistentvolume.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/persistentvolumeclaim.go b/vendor/k8s.io/client-go/listers/core/v1/persistentvolumeclaim.go index 72ddac93e6..8c3d5f566f 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/listers/core/v1/persistentvolumeclaim.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/pod.go b/vendor/k8s.io/client-go/listers/core/v1/pod.go index 6cf4a8424a..d3ce8ab32f 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/pod.go +++ b/vendor/k8s.io/client-go/listers/core/v1/pod.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/podtemplate.go b/vendor/k8s.io/client-go/listers/core/v1/podtemplate.go index d825c7475a..91c2a46619 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/podtemplate.go +++ b/vendor/k8s.io/client-go/listers/core/v1/podtemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/replicationcontroller.go b/vendor/k8s.io/client-go/listers/core/v1/replicationcontroller.go index 6670a9d925..ee00a465c1 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/replicationcontroller.go +++ b/vendor/k8s.io/client-go/listers/core/v1/replicationcontroller.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/resourcequota.go b/vendor/k8s.io/client-go/listers/core/v1/resourcequota.go index 713a41511b..fd3119d451 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/resourcequota.go +++ b/vendor/k8s.io/client-go/listers/core/v1/resourcequota.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/secret.go b/vendor/k8s.io/client-go/listers/core/v1/secret.go index 26ef13d9eb..f8c2b11e16 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/secret.go +++ b/vendor/k8s.io/client-go/listers/core/v1/secret.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/service.go b/vendor/k8s.io/client-go/listers/core/v1/service.go index 895a692231..d872540b3e 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/service.go +++ b/vendor/k8s.io/client-go/listers/core/v1/service.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/core/v1/serviceaccount.go b/vendor/k8s.io/client-go/listers/core/v1/serviceaccount.go index 2245d5d43d..9973af66b4 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/serviceaccount.go +++ b/vendor/k8s.io/client-go/listers/core/v1/serviceaccount.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/events/v1beta1/event.go b/vendor/k8s.io/client-go/listers/events/v1beta1/event.go index bca3c452ad..c52afd0917 100644 --- a/vendor/k8s.io/client-go/listers/events/v1beta1/event.go +++ b/vendor/k8s.io/client-go/listers/events/v1beta1/event.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/events/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/events/v1beta1/expansion_generated.go index 7e8fb62b1b..9971dd5dd3 100644 --- a/vendor/k8s.io/client-go/listers/events/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/events/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/BUILD b/vendor/k8s.io/client-go/listers/extensions/v1beta1/BUILD index 9bab4a64f8..49b895c3e6 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/BUILD @@ -35,8 +35,7 @@ go_library( go_test( name = "go_default_test", srcs = ["daemonset_expansion_test.go"], - importpath = "k8s.io/client-go/listers/extensions/v1beta1", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/daemonset.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/daemonset.go index 4672a5cb99..b63c32b97c 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/daemonset.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/daemonset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment.go index 4c17085dd7..ea5168fef8 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go index 060c7a35ae..87c3cbe3b2 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/ingress.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/ingress.go index 5615dfccc3..1f9e34d17c 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/ingress.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/podsecuritypolicy.go index 3189ff7c9d..fadd212f10 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/podsecuritypolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/replicaset.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/replicaset.go index 44de996e4f..930db44806 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/replicaset.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/replicaset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/scale.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/scale.go index a027af8283..67d45e328c 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/scale.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/scale.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/expansion_generated.go index 6f635d7048..1529fcf3f5 100644 --- a/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/imagereview.go b/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/imagereview.go index 8ffd9d05f6..cdb046cf94 100644 --- a/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/imagereview.go +++ b/vendor/k8s.io/client-go/listers/imagepolicy/v1alpha1/imagereview.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go index 91fe5e772f..458a1d249f 100644 --- a/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/networking/v1/networkpolicy.go b/vendor/k8s.io/client-go/listers/networking/v1/networkpolicy.go index 59e17eecbd..b70adedf1c 100644 --- a/vendor/k8s.io/client-go/listers/networking/v1/networkpolicy.go +++ b/vendor/k8s.io/client-go/listers/networking/v1/networkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/policy/v1beta1/BUILD b/vendor/k8s.io/client-go/listers/policy/v1beta1/BUILD index c678177ae4..2c5f33df46 100644 --- a/vendor/k8s.io/client-go/listers/policy/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/listers/policy/v1beta1/BUILD @@ -12,6 +12,7 @@ go_library( "expansion_generated.go", "poddisruptionbudget.go", "poddisruptionbudget_expansion.go", + "podsecuritypolicy.go", ], importpath = "k8s.io/client-go/listers/policy/v1beta1", deps = [ diff --git a/vendor/k8s.io/client-go/listers/policy/v1beta1/eviction.go b/vendor/k8s.io/client-go/listers/policy/v1beta1/eviction.go index 742775f64b..29c454e2ac 100644 --- a/vendor/k8s.io/client-go/listers/policy/v1beta1/eviction.go +++ b/vendor/k8s.io/client-go/listers/policy/v1beta1/eviction.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go index 4785fbc06f..3e63c2c9ce 100644 --- a/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/policy/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 @@ -25,3 +25,7 @@ type EvictionListerExpansion interface{} // EvictionNamespaceListerExpansion allows custom methods to be added to // EvictionNamespaceLister. type EvictionNamespaceListerExpansion interface{} + +// PodSecurityPolicyListerExpansion allows custom methods to be added to +// PodSecurityPolicyLister. +type PodSecurityPolicyListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget.go b/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget.go index 6512f29f12..7304f36b29 100644 --- a/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1/clusterrole.go b/vendor/k8s.io/client-go/listers/rbac/v1/clusterrole.go index 5dc9a225e7..eb1d87006b 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1/clusterrole.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1/clusterrolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1/clusterrolebinding.go index bb3186a067..a22d6025e8 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/rbac/v1/expansion_generated.go index 4d9872d3e2..967ebdd843 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1/role.go b/vendor/k8s.io/client-go/listers/rbac/v1/role.go index 8d7625dbe3..b4649c2c39 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1/role.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1/rolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1/rolebinding.go index b8209d8512..8dc0968bb0 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1/rolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrole.go b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrole.go index 9e20a6d162..302ca29d8a 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrole.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrolebinding.go index 155666aba0..91ba54c23a 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/expansion_generated.go index 0ab4fb991f..737ba66373 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/role.go b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/role.go index 72ab79c944..cf874f56c8 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/role.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/rolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/rolebinding.go index 7f9cfd4583..5e76ab42ff 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1alpha1/rolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1alpha1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrole.go b/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrole.go index 65ec3eb978..be7f2df6a0 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrole.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrole.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrolebinding.go index 146f2d7f29..09d65be764 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1beta1/clusterrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/rbac/v1beta1/expansion_generated.go index b6eeae833a..8da5736618 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1beta1/role.go b/vendor/k8s.io/client-go/listers/rbac/v1beta1/role.go index b795e98b02..e12039dbf9 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1beta1/role.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1beta1/role.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/rbac/v1beta1/rolebinding.go b/vendor/k8s.io/client-go/listers/rbac/v1beta1/rolebinding.go index d27ea2eb59..10cb23cd3e 100644 --- a/vendor/k8s.io/client-go/listers/rbac/v1beta1/rolebinding.go +++ b/vendor/k8s.io/client-go/listers/rbac/v1beta1/rolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/expansion_generated.go index 8a644c804e..00b662888c 100644 --- a/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/priorityclass.go b/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/priorityclass.go index 9ed04fd2ae..fb7f6007c2 100644 --- a/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/priorityclass.go +++ b/vendor/k8s.io/client-go/listers/scheduling/v1alpha1/priorityclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/settings/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/settings/v1alpha1/expansion_generated.go index 7a5ce38e92..72558897bd 100644 --- a/vendor/k8s.io/client-go/listers/settings/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/settings/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/settings/v1alpha1/podpreset.go b/vendor/k8s.io/client-go/listers/settings/v1alpha1/podpreset.go index 18f6224931..d300369625 100644 --- a/vendor/k8s.io/client-go/listers/settings/v1alpha1/podpreset.go +++ b/vendor/k8s.io/client-go/listers/settings/v1alpha1/podpreset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go index 2353b59d3f..49e290f4c2 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/storage/v1/storageclass.go b/vendor/k8s.io/client-go/listers/storage/v1/storageclass.go index 7c37321fd9..5b20f6ab5c 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1/storageclass.go +++ b/vendor/k8s.io/client-go/listers/storage/v1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go index 63abe94ab2..2fc6add1df 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/storage/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattachment.go b/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattachment.go index 02004629a6..f8d1bdb2d7 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattachment.go +++ b/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattachment.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/k8s.io/client-go/listers/storage/v1beta1/BUILD b/vendor/k8s.io/client-go/listers/storage/v1beta1/BUILD index d4b82cbc80..49d992e47b 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1beta1/BUILD +++ b/vendor/k8s.io/client-go/listers/storage/v1beta1/BUILD @@ -10,6 +10,7 @@ go_library( srcs = [ "expansion_generated.go", "storageclass.go", + "volumeattachment.go", ], importpath = "k8s.io/client-go/listers/storage/v1beta1", deps = [ diff --git a/vendor/k8s.io/client-go/listers/storage/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/storage/v1beta1/expansion_generated.go index 84e0f9c440..8c2dc9055c 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/storage/v1beta1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,10 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 // StorageClassListerExpansion allows custom methods to be added to // StorageClassLister. type StorageClassListerExpansion interface{} + +// VolumeAttachmentListerExpansion allows custom methods to be added to +// VolumeAttachmentLister. +type VolumeAttachmentListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/storage/v1beta1/storageclass.go b/vendor/k8s.io/client-go/listers/storage/v1beta1/storageclass.go index 9253319bec..45afe0e775 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1beta1/storageclass.go +++ b/vendor/k8s.io/client-go/listers/storage/v1beta1/storageclass.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1beta1 diff --git a/vendor/k8s.io/client-go/pkg/version/def.bzl b/vendor/k8s.io/client-go/pkg/version/def.bzl index bca85ab4b5..9c018a4ef7 100644 --- a/vendor/k8s.io/client-go/pkg/version/def.bzl +++ b/vendor/k8s.io/client-go/pkg/version/def.bzl @@ -1,3 +1,17 @@ +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Implements hack/lib/version.sh's kube::version::ldflags() for Bazel. def version_x_defs(): # This should match the list of packages in kube::version::ldflag diff --git a/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/BUILD b/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/BUILD deleted file mode 100644 index 4100f394ee..0000000000 --- a/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/BUILD +++ /dev/null @@ -1,30 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["provider.go"], - importpath = "k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing", - deps = [ - "//vendor/github.com/coreos/go-oidc/jose:go_default_library", - "//vendor/github.com/coreos/go-oidc/key:go_default_library", - "//vendor/github.com/coreos/go-oidc/oidc:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/provider.go b/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/provider.go deleted file mode 100644 index ae7353ff27..0000000000 --- a/vendor/k8s.io/client-go/plugin/pkg/auth/authenticator/token/oidc/testing/provider.go +++ /dev/null @@ -1,200 +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 testing - -import ( - "bytes" - "crypto/rand" - "crypto/rsa" - "crypto/tls" - "crypto/x509" - "crypto/x509/pkix" - "encoding/json" - "encoding/pem" - "fmt" - "io/ioutil" - "math/big" - "net" - "net/http" - "net/http/httptest" - "net/url" - "os" - "path" - "path/filepath" - "testing" - "time" - - "github.com/coreos/go-oidc/jose" - "github.com/coreos/go-oidc/key" - "github.com/coreos/go-oidc/oidc" -) - -// NewOIDCProvider provides a bare minimum OIDC IdP Server useful for testing. -func NewOIDCProvider(t *testing.T, issuerPath string) *OIDCProvider { - privKey, err := key.GeneratePrivateKey() - if err != nil { - t.Fatalf("Cannot create OIDC Provider: %v", err) - return nil - } - - op := &OIDCProvider{ - Mux: http.NewServeMux(), - PrivKey: privKey, - issuerPath: issuerPath, - } - - op.Mux.HandleFunc(path.Join(issuerPath, "/.well-known/openid-configuration"), op.handleConfig) - op.Mux.HandleFunc(path.Join(issuerPath, "/keys"), op.handleKeys) - - return op -} - -type OIDCProvider struct { - Mux *http.ServeMux - PCFG oidc.ProviderConfig - PrivKey *key.PrivateKey - issuerPath string -} - -func (op *OIDCProvider) ServeTLSWithKeyPair(cert, key string) (*httptest.Server, error) { - srv := httptest.NewUnstartedServer(op.Mux) - - srv.TLS = &tls.Config{Certificates: make([]tls.Certificate, 1)} - var err error - srv.TLS.Certificates[0], err = tls.LoadX509KeyPair(cert, key) - if err != nil { - return nil, fmt.Errorf("Cannot load cert/key pair: %v", err) - } - srv.StartTLS() - - // The issuer's URL is extended by an optional path. This ensures that the plugin can - // handle issuers that use a non-root path for discovery (see kubernetes/kubernetes#29749). - srv.URL = srv.URL + op.issuerPath - - u, err := url.Parse(srv.URL) - if err != nil { - return nil, err - } - pathFor := func(p string) *url.URL { - u2 := *u // Shallow copy. - u2.Path = path.Join(u2.Path, p) - return &u2 - } - - op.PCFG = oidc.ProviderConfig{ - Issuer: u, - AuthEndpoint: pathFor("/auth"), - TokenEndpoint: pathFor("/token"), - KeysEndpoint: pathFor("/keys"), - ResponseTypesSupported: []string{"code"}, - SubjectTypesSupported: []string{"public"}, - IDTokenSigningAlgValues: []string{"RS256"}, - } - return srv, nil -} - -func (op *OIDCProvider) handleConfig(w http.ResponseWriter, req *http.Request) { - b, err := json.Marshal(&op.PCFG) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/json") - w.Write(b) -} - -func (op *OIDCProvider) handleKeys(w http.ResponseWriter, req *http.Request) { - keys := struct { - Keys []jose.JWK `json:"keys"` - }{ - Keys: []jose.JWK{op.PrivKey.JWK()}, - } - - b, err := json.Marshal(keys) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age=%d", int(time.Hour.Seconds()))) - w.Header().Set("Expires", time.Now().Add(time.Hour).Format(time.RFC1123)) - w.Header().Set("Content-Type", "application/json") - w.Write(b) -} - -// generateSelfSignedCert generates a self-signed cert/key pairs and writes to the certPath/keyPath. -// This method is mostly identical to crypto.GenerateSelfSignedCert except for the 'IsCA' and 'KeyUsage' -// in the certificate template. (Maybe we can merge these two methods). -func GenerateSelfSignedCert(t *testing.T, host, certPath, keyPath string) { - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - t.Fatal(err) - } - - template := x509.Certificate{ - SerialNumber: big.NewInt(1), - Subject: pkix.Name{ - CommonName: fmt.Sprintf("%s@%d", host, time.Now().Unix()), - }, - NotBefore: time.Now(), - NotAfter: time.Now().Add(time.Hour * 24 * 365), - - KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, - ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, - BasicConstraintsValid: true, - IsCA: true, - } - - if ip := net.ParseIP(host); ip != nil { - template.IPAddresses = append(template.IPAddresses, ip) - } else { - template.DNSNames = append(template.DNSNames, host) - } - - derBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv) - if err != nil { - t.Fatal(err) - } - - // Generate cert - certBuffer := bytes.Buffer{} - if err := pem.Encode(&certBuffer, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}); err != nil { - t.Fatal(err) - } - - // Generate key - keyBuffer := bytes.Buffer{} - if err := pem.Encode(&keyBuffer, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)}); err != nil { - t.Fatal(err) - } - - // Write cert - if err := os.MkdirAll(filepath.Dir(certPath), os.FileMode(0755)); err != nil { - t.Fatal(err) - } - if err := ioutil.WriteFile(certPath, certBuffer.Bytes(), os.FileMode(0644)); err != nil { - t.Fatal(err) - } - - // Write key - if err := os.MkdirAll(filepath.Dir(keyPath), os.FileMode(0755)); err != nil { - t.Fatal(err) - } - if err := ioutil.WriteFile(keyPath, keyBuffer.Bytes(), os.FileMode(0600)); err != nil { - t.Fatal(err) - } -} diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/BUILD b/vendor/k8s.io/client-go/plugin/pkg/client/auth/BUILD index 8ab2d74529..367e897fdf 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/BUILD +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/BUILD @@ -29,6 +29,7 @@ filegroup( srcs = [ ":package-srcs", "//staging/src/k8s.io/client-go/plugin/pkg/client/auth/azure:all-srcs", + "//staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec:all-srcs", "//staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp:all-srcs", "//staging/src/k8s.io/client-go/plugin/pkg/client/auth/oidc:all-srcs", "//staging/src/k8s.io/client-go/plugin/pkg/client/auth/openstack:all-srcs", diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/BUILD b/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/BUILD index 135ba355f9..682776db5f 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/BUILD +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["azure_test.go"], - importpath = "k8s.io/client-go/plugin/pkg/client/auth/azure", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/github.com/Azure/go-autorest/autorest/adal:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/BUILD b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/BUILD index d9ef7bded3..e57e896ae9 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/BUILD +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["gcp_test.go"], - importpath = "k8s.io/client-go/plugin/pkg/client/auth/gcp", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/golang.org/x/oauth2:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go index 5ed1203b2a..3a4f86777b 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go @@ -42,8 +42,18 @@ func init() { } } -// Stubbable for testing -var execCommand = exec.Command +var ( + // Stubbable for testing + execCommand = exec.Command + + // defaultScopes: + // - cloud-platform is the base scope to authenticate to GCP. + // - userinfo.email is used to authenticate to GKE APIs with gserviceaccount + // email instead of numeric uniqueID. + defaultScopes = []string{ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"} +) // gcpAuthProvider is an auth provider plugin that uses GCP credentials to provide // tokens for kubectl to authenticate itself to the apiserver. A sample json config @@ -55,6 +65,14 @@ var execCommand = exec.Command // "name": "gcp", // // 'config': { +// # Authentication options +// # These options are used while getting a token. +// +// # comma-separated list of GCP API scopes. default value of this field +// # is "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/userinfo.email". +// # to override the API scopes, specify this field explicitly. +// "scopes": "https://www.googleapis.com/auth/cloud-platform" +// // # Caching options // // # Raw string data representing cached access token. @@ -96,12 +114,32 @@ type gcpAuthProvider struct { } func newGCPAuthProvider(_ string, gcpConfig map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) { - var ts oauth2.TokenSource - var err error - if cmd, useCmd := gcpConfig["cmd-path"]; useCmd { + ts, err := tokenSource(isCmdTokenSource(gcpConfig), gcpConfig) + if err != nil { + return nil, err + } + cts, err := newCachedTokenSource(gcpConfig["access-token"], gcpConfig["expiry"], persister, ts, gcpConfig) + if err != nil { + return nil, err + } + return &gcpAuthProvider{cts, persister}, nil +} + +func isCmdTokenSource(gcpConfig map[string]string) bool { + _, ok := gcpConfig["cmd-path"] + return ok +} + +func tokenSource(isCmd bool, gcpConfig map[string]string) (oauth2.TokenSource, error) { + // Command-based token source + if isCmd { + cmd := gcpConfig["cmd-path"] if len(cmd) == 0 { return nil, fmt.Errorf("missing access token cmd") } + if gcpConfig["scopes"] != "" { + return nil, fmt.Errorf("scopes can only be used when kubectl is using a gcp service account key") + } var args []string if cmdArgs, ok := gcpConfig["cmd-args"]; ok { args = strings.Fields(cmdArgs) @@ -110,18 +148,29 @@ func newGCPAuthProvider(_ string, gcpConfig map[string]string, persister restcli cmd = fields[0] args = fields[1:] } - ts = newCmdTokenSource(cmd, args, gcpConfig["token-key"], gcpConfig["expiry-key"], gcpConfig["time-fmt"]) - } else { - ts, err = google.DefaultTokenSource(context.Background(), "https://www.googleapis.com/auth/cloud-platform") + return newCmdTokenSource(cmd, args, gcpConfig["token-key"], gcpConfig["expiry-key"], gcpConfig["time-fmt"]), nil } + + // Google Application Credentials-based token source + scopes := parseScopes(gcpConfig) + ts, err := google.DefaultTokenSource(context.Background(), scopes...) if err != nil { - return nil, err + return nil, fmt.Errorf("cannot construct google default token source: %v", err) } - cts, err := newCachedTokenSource(gcpConfig["access-token"], gcpConfig["expiry"], persister, ts, gcpConfig) - if err != nil { - return nil, err + return ts, nil +} + +// parseScopes constructs a list of scopes that should be included in token source +// from the config map. +func parseScopes(gcpConfig map[string]string) []string { + scopes, ok := gcpConfig["scopes"] + if !ok { + return defaultScopes } - return &gcpAuthProvider{cts, persister}, nil + if scopes == "" { + return []string{} + } + return strings.Split(gcpConfig["scopes"], ",") } func (g *gcpAuthProvider) WrapTransport(rt http.RoundTripper) http.RoundTripper { diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_test.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_test.go index 662d38b8f1..32271b252b 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_test.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_test.go @@ -18,6 +18,7 @@ package gcp import ( "fmt" + "io/ioutil" "net/http" "os" "os/exec" @@ -116,6 +117,114 @@ func TestHelperProcess(t *testing.T) { os.Exit(0) } +func Test_isCmdTokenSource(t *testing.T) { + c1 := map[string]string{"cmd-path": "foo"} + if v := isCmdTokenSource(c1); !v { + t.Fatalf("cmd-path present in config (%+v), but got %v", c1, v) + } + + c2 := map[string]string{"cmd-args": "foo bar"} + if v := isCmdTokenSource(c2); v { + t.Fatalf("cmd-path not present in config (%+v), but got %v", c2, v) + } +} + +func Test_tokenSource_cmd(t *testing.T) { + if _, err := tokenSource(true, map[string]string{}); err == nil { + t.Fatalf("expected error, cmd-args not present in config") + } + + c := map[string]string{ + "cmd-path": "foo", + "cmd-args": "bar"} + ts, err := tokenSource(true, c) + if err != nil { + t.Fatalf("failed to return cmd token source: %+v", err) + } + if ts == nil { + t.Fatal("returned nil token source") + } + if _, ok := ts.(*commandTokenSource); !ok { + t.Fatalf("returned token source type:(%T) expected:(*commandTokenSource)", ts) + } +} + +func Test_tokenSource_cmdCannotBeUsedWithScopes(t *testing.T) { + c := map[string]string{ + "cmd-path": "foo", + "scopes": "A,B"} + if _, err := tokenSource(true, c); err == nil { + t.Fatal("expected error when scopes is used with cmd-path") + } +} + +func Test_tokenSource_applicationDefaultCredentials_fails(t *testing.T) { + // try to use empty ADC file + fakeTokenFile, err := ioutil.TempFile("", "adctoken") + if err != nil { + t.Fatalf("failed to create fake token file: +%v", err) + } + fakeTokenFile.Close() + defer os.Remove(fakeTokenFile.Name()) + + os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", fakeTokenFile.Name()) + defer os.Unsetenv("GOOGLE_APPLICATION_CREDENTIALS") + if _, err := tokenSource(false, map[string]string{}); err == nil { + t.Fatalf("expected error because specified ADC token file is not a JSON") + } +} + +func Test_tokenSource_applicationDefaultCredentials(t *testing.T) { + fakeTokenFile, err := ioutil.TempFile("", "adctoken") + if err != nil { + t.Fatalf("failed to create fake token file: +%v", err) + } + fakeTokenFile.Close() + defer os.Remove(fakeTokenFile.Name()) + if err := ioutil.WriteFile(fakeTokenFile.Name(), []byte(`{"type":"service_account"}`), 0600); err != nil { + t.Fatalf("failed to write to fake token file: %+v", err) + } + + os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", fakeTokenFile.Name()) + defer os.Unsetenv("GOOGLE_APPLICATION_CREDENTIALS") + ts, err := tokenSource(false, map[string]string{}) + if err != nil { + t.Fatalf("failed to get a token source: %+v", err) + } + if ts == nil { + t.Fatal("returned nil token source") + } +} + +func Test_parseScopes(t *testing.T) { + cases := []struct { + in map[string]string + out []string + }{ + { + map[string]string{}, + []string{ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"}, + }, + { + map[string]string{"scopes": ""}, + []string{}, + }, + { + map[string]string{"scopes": "A,B,C"}, + []string{"A", "B", "C"}, + }, + } + + for _, c := range cases { + got := parseScopes(c.in) + if !reflect.DeepEqual(got, c.out) { + t.Errorf("expected=%v, got=%v", c.out, got) + } + } +} + func errEquiv(got, want error) bool { if got == want { return true diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/BUILD b/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/BUILD index 03ccf499ce..ee76fac0d7 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/BUILD +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["oidc_test.go"], - importpath = "k8s.io/client-go/plugin/pkg/client/auth/oidc", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/BUILD b/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/BUILD index 6ebaf302d2..750ffd6f53 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/BUILD +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["openstack_test.go"], - importpath = "k8s.io/client-go/plugin/pkg/client/auth/openstack", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/rest/BUILD b/vendor/k8s.io/client-go/rest/BUILD index 44958631da..0cb24bcff3 100644 --- a/vendor/k8s.io/client-go/rest/BUILD +++ b/vendor/k8s.io/client-go/rest/BUILD @@ -16,8 +16,7 @@ go_test( "url_utils_test.go", "urlbackoff_test.go", ], - importpath = "k8s.io/client-go/rest", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/google/gofuzz:go_default_library", @@ -55,7 +54,6 @@ go_library( "transport.go", "url_utils.go", "urlbackoff.go", - "versions.go", "zz_generated.deepcopy.go", ], importpath = "k8s.io/client-go/rest", @@ -73,6 +71,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/client-go/pkg/version:go_default_library", + "//vendor/k8s.io/client-go/plugin/pkg/client/auth/exec:go_default_library", "//vendor/k8s.io/client-go/rest/watch:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", "//vendor/k8s.io/client-go/tools/metrics:go_default_library", diff --git a/vendor/k8s.io/client-go/rest/client.go b/vendor/k8s.io/client-go/rest/client.go index 524e0d8eb9..927403cb23 100644 --- a/vendor/k8s.io/client-go/rest/client.go +++ b/vendor/k8s.io/client-go/rest/client.go @@ -222,9 +222,9 @@ func (c *RESTClient) Verb(verb string) *Request { backoff := c.createBackoffMgr() if c.Client == nil { - return NewRequest(nil, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle) + return NewRequest(nil, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle, 0) } - return NewRequest(c.Client, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle) + return NewRequest(c.Client, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle, c.Client.Timeout) } // Post begins a POST request. Short for c.Verb("POST"). diff --git a/vendor/k8s.io/client-go/rest/client_test.go b/vendor/k8s.io/client-go/rest/client_test.go index 3096cc13a2..2eae9be2d6 100644 --- a/vendor/k8s.io/client-go/rest/client_test.go +++ b/vendor/k8s.io/client-go/rest/client_test.go @@ -302,7 +302,7 @@ func TestCreateBackoffManager(t *testing.T) { backoff.UpdateBackoff(theUrl, nil, 500) backoff = readExpBackoffConfig() if backoff.CalculateBackoff(theUrl)/time.Second != 0 { - t.Errorf("Zero backoff duration, but backoff still occuring.") + t.Errorf("Zero backoff duration, but backoff still occurring.") } // No env -> No backoff. diff --git a/vendor/k8s.io/client-go/rest/config.go b/vendor/k8s.io/client-go/rest/config.go index 038fee9453..72a78bc0a0 100644 --- a/vendor/k8s.io/client-go/rest/config.go +++ b/vendor/k8s.io/client-go/rest/config.go @@ -54,9 +54,6 @@ type Config struct { Host string // APIPath is a sub-path that points to an API root. APIPath string - // Prefix is the sub path of the server. If not specified, the client will set - // a default value. Use "/" to indicate the server root should be used - Prefix string // ContentConfig contains settings that affect how objects are transformed when // sent to the server. @@ -71,10 +68,6 @@ type Config struct { // TODO: demonstrate an OAuth2 compatible client. BearerToken string - // CacheDir is the directory where we'll store HTTP cached responses. - // If set to empty string, no caching mechanism will be used. - CacheDir string - // Impersonate is the configuration that RESTClient will use for impersonation. Impersonate ImpersonationConfig @@ -84,6 +77,9 @@ type Config struct { // Callback to persist config for AuthProvider. AuthConfigPersister AuthProviderConfigPersister + // Exec-based authentication provider. + ExecProvider *clientcmdapi.ExecConfig + // TLSClientConfig contains settings to enable transport layer security TLSClientConfig @@ -405,7 +401,6 @@ func AnonymousClientConfig(config *Config) *Config { return &Config{ Host: config.Host, APIPath: config.APIPath, - Prefix: config.Prefix, ContentConfig: config.ContentConfig, TLSClientConfig: TLSClientConfig{ Insecure: config.Insecure, @@ -429,12 +424,10 @@ func CopyConfig(config *Config) *Config { return &Config{ Host: config.Host, APIPath: config.APIPath, - Prefix: config.Prefix, ContentConfig: config.ContentConfig, Username: config.Username, Password: config.Password, BearerToken: config.BearerToken, - CacheDir: config.CacheDir, Impersonate: ImpersonationConfig{ Groups: config.Impersonate.Groups, Extra: config.Impersonate.Extra, @@ -442,6 +435,7 @@ func CopyConfig(config *Config) *Config { }, AuthProvider: config.AuthProvider, AuthConfigPersister: config.AuthConfigPersister, + ExecProvider: config.ExecProvider, TLSClientConfig: TLSClientConfig{ Insecure: config.TLSClientConfig.Insecure, ServerName: config.TLSClientConfig.ServerName, diff --git a/vendor/k8s.io/client-go/rest/config_test.go b/vendor/k8s.io/client-go/rest/config_test.go index 0e86442dbd..a9495d792f 100644 --- a/vendor/k8s.io/client-go/rest/config_test.go +++ b/vendor/k8s.io/client-go/rest/config_test.go @@ -267,9 +267,9 @@ func TestAnonymousConfig(t *testing.T) { expected.BearerToken = "" expected.Username = "" expected.Password = "" - expected.CacheDir = "" expected.AuthProvider = nil expected.AuthConfigPersister = nil + expected.ExecProvider = nil expected.TLSClientConfig.CertData = nil expected.TLSClientConfig.CertFile = "" expected.TLSClientConfig.KeyData = nil diff --git a/vendor/k8s.io/client-go/rest/fake/fake.go b/vendor/k8s.io/client-go/rest/fake/fake.go index db2c01c71f..bc43a90ace 100644 --- a/vendor/k8s.io/client-go/rest/fake/fake.go +++ b/vendor/k8s.io/client-go/rest/fake/fake.go @@ -107,7 +107,7 @@ func (c *RESTClient) request(verb string) *restclient.Request { serializers.StreamingSerializer = info.StreamSerializer.Serializer serializers.Framer = info.StreamSerializer.Framer } - return restclient.NewRequest(c, verb, &url.URL{Host: "localhost"}, c.VersionedAPIPath, config, serializers, nil, nil) + return restclient.NewRequest(c, verb, &url.URL{Host: "localhost"}, c.VersionedAPIPath, config, serializers, nil, nil, 0) } func (c *RESTClient) Do(req *http.Request) (*http.Response, error) { diff --git a/vendor/k8s.io/client-go/rest/request.go b/vendor/k8s.io/client-go/rest/request.go index aac126ccca..6ca9e0197d 100644 --- a/vendor/k8s.io/client-go/rest/request.go +++ b/vendor/k8s.io/client-go/rest/request.go @@ -112,7 +112,7 @@ type Request struct { } // NewRequest creates a new request helper object for accessing runtime.Objects on a server. -func NewRequest(client HTTPClient, verb string, baseURL *url.URL, versionedAPIPath string, content ContentConfig, serializers Serializers, backoff BackoffManager, throttle flowcontrol.RateLimiter) *Request { +func NewRequest(client HTTPClient, verb string, baseURL *url.URL, versionedAPIPath string, content ContentConfig, serializers Serializers, backoff BackoffManager, throttle flowcontrol.RateLimiter, timeout time.Duration) *Request { if backoff == nil { glog.V(2).Infof("Not implementing request backoff strategy.") backoff = &NoBackoff{} @@ -131,6 +131,7 @@ func NewRequest(client HTTPClient, verb string, baseURL *url.URL, versionedAPIPa serializers: serializers, backoffMgr: backoff, throttle: throttle, + timeout: timeout, } switch { case len(content.AcceptContentTypes) > 0: diff --git a/vendor/k8s.io/client-go/rest/request_test.go b/vendor/k8s.io/client-go/rest/request_test.go index f575350e36..fac6902557 100755 --- a/vendor/k8s.io/client-go/rest/request_test.go +++ b/vendor/k8s.io/client-go/rest/request_test.go @@ -57,11 +57,11 @@ import ( ) func TestNewRequestSetsAccept(t *testing.T) { - r := NewRequest(nil, "get", &url.URL{Path: "/path/"}, "", ContentConfig{}, Serializers{}, nil, nil) + r := NewRequest(nil, "get", &url.URL{Path: "/path/"}, "", ContentConfig{}, Serializers{}, nil, nil, 0) if r.headers.Get("Accept") != "" { t.Errorf("unexpected headers: %#v", r.headers) } - r = NewRequest(nil, "get", &url.URL{Path: "/path/"}, "", ContentConfig{ContentType: "application/other"}, Serializers{}, nil, nil) + r = NewRequest(nil, "get", &url.URL{Path: "/path/"}, "", ContentConfig{ContentType: "application/other"}, Serializers{}, nil, nil, 0) if r.headers.Get("Accept") != "application/other, */*" { t.Errorf("unexpected headers: %#v", r.headers) } @@ -86,7 +86,7 @@ func TestRequestSetsHeaders(t *testing.T) { config := defaultContentConfig() config.ContentType = "application/other" serializers := defaultSerializers(t) - r := NewRequest(server, "get", &url.URL{Path: "/path"}, "", config, serializers, nil, nil) + r := NewRequest(server, "get", &url.URL{Path: "/path"}, "", config, serializers, nil, nil, 0) // Check if all "issue" methods are setting headers. _ = r.Do() @@ -341,7 +341,7 @@ func TestResultIntoWithNoBodyReturnsErr(t *testing.T) { func TestURLTemplate(t *testing.T) { uri, _ := url.Parse("http://localhost") - r := NewRequest(nil, "POST", uri, "", ContentConfig{GroupVersion: &schema.GroupVersion{Group: "test"}}, Serializers{}, nil, nil) + r := NewRequest(nil, "POST", uri, "", ContentConfig{GroupVersion: &schema.GroupVersion{Group: "test"}}, Serializers{}, nil, nil, 0) r.Prefix("pre1").Resource("r1").Namespace("ns").Name("nm").Param("p0", "v0") full := r.URL() if full.String() != "http://localhost/pre1/namespaces/ns/r1/nm?p0=v0" { @@ -403,7 +403,7 @@ func TestTransformResponse(t *testing.T) { {Response: &http.Response{StatusCode: 200, Body: ioutil.NopCloser(bytes.NewReader(invalid))}, Data: invalid}, } for i, test := range testCases { - r := NewRequest(nil, "", uri, "", defaultContentConfig(), defaultSerializers(t), nil, nil) + r := NewRequest(nil, "", uri, "", defaultContentConfig(), defaultSerializers(t), nil, nil, 0) if test.Response.Body == nil { test.Response.Body = ioutil.NopCloser(bytes.NewReader([]byte{})) } @@ -554,7 +554,7 @@ func TestTransformResponseNegotiate(t *testing.T) { serializers.RenegotiatedDecoder = negotiator.invoke contentConfig := defaultContentConfig() contentConfig.ContentType = test.ContentType - r := NewRequest(nil, "", uri, "", contentConfig, serializers, nil, nil) + r := NewRequest(nil, "", uri, "", contentConfig, serializers, nil, nil, 0) if test.Response.Body == nil { test.Response.Body = ioutil.NopCloser(bytes.NewReader([]byte{})) } @@ -1480,7 +1480,7 @@ func TestAbsPath(t *testing.T) { {"/p1/api/p2", "/api/r1", "/api/", "/p1/api/p2/api/"}, } { u, _ := url.Parse("http://localhost:123" + tc.configPrefix) - r := NewRequest(nil, "POST", u, "", ContentConfig{GroupVersion: &schema.GroupVersion{Group: "test"}}, Serializers{}, nil, nil).Prefix(tc.resourcePrefix).AbsPath(tc.absPath) + r := NewRequest(nil, "POST", u, "", ContentConfig{GroupVersion: &schema.GroupVersion{Group: "test"}}, Serializers{}, nil, nil, 0).Prefix(tc.resourcePrefix).AbsPath(tc.absPath) if r.pathPrefix != tc.wantsAbsPath { t.Errorf("test case %d failed, unexpected path: %q, expected %q", i, r.pathPrefix, tc.wantsAbsPath) } diff --git a/vendor/k8s.io/client-go/rest/transport.go b/vendor/k8s.io/client-go/rest/transport.go index f59f8dbe27..b6a0676326 100644 --- a/vendor/k8s.io/client-go/rest/transport.go +++ b/vendor/k8s.io/client-go/rest/transport.go @@ -20,6 +20,7 @@ import ( "crypto/tls" "net/http" + "k8s.io/client-go/plugin/pkg/client/auth/exec" "k8s.io/client-go/transport" ) @@ -59,6 +60,20 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip // TransportConfig converts a client config to an appropriate transport config. func (c *Config) TransportConfig() (*transport.Config, error) { wt := c.WrapTransport + if c.ExecProvider != nil { + provider, err := exec.GetAuthenticator(c.ExecProvider) + if err != nil { + return nil, err + } + if wt != nil { + previousWT := wt + wt = func(rt http.RoundTripper) http.RoundTripper { + return provider.WrapTransport(previousWT(rt)) + } + } else { + wt = provider.WrapTransport + } + } if c.AuthProvider != nil { provider, err := GetAuthProvider(c.Host, c.AuthProvider, c.AuthConfigPersister) if err != nil { @@ -89,7 +104,6 @@ func (c *Config) TransportConfig() (*transport.Config, error) { }, Username: c.Username, Password: c.Password, - CacheDir: c.CacheDir, BearerToken: c.BearerToken, Impersonate: transport.ImpersonationConfig{ UserName: c.Impersonate.UserName, diff --git a/vendor/k8s.io/client-go/rest/versions.go b/vendor/k8s.io/client-go/rest/versions.go deleted file mode 100644 index 9d41812f26..0000000000 --- a/vendor/k8s.io/client-go/rest/versions.go +++ /dev/null @@ -1,88 +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 rest - -import ( - "encoding/json" - "fmt" - "net/http" - "path" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - legacyAPIPath = "/api" - defaultAPIPath = "/apis" -) - -// TODO: Is this obsoleted by the discovery client? - -// ServerAPIVersions returns the GroupVersions supported by the API server. -// It creates a RESTClient based on the passed in config, but it doesn't rely -// on the Version and Codec of the config, because it uses AbsPath and -// takes the raw response. -func ServerAPIVersions(c *Config) (groupVersions []string, err error) { - transport, err := TransportFor(c) - if err != nil { - return nil, err - } - client := http.Client{Transport: transport} - - configCopy := *c - configCopy.GroupVersion = nil - configCopy.APIPath = "" - baseURL, _, err := defaultServerUrlFor(&configCopy) - if err != nil { - return nil, err - } - // Get the groupVersions exposed at /api - originalPath := baseURL.Path - baseURL.Path = path.Join(originalPath, legacyAPIPath) - resp, err := client.Get(baseURL.String()) - if err != nil { - return nil, err - } - var v metav1.APIVersions - defer resp.Body.Close() - err = json.NewDecoder(resp.Body).Decode(&v) - if err != nil { - return nil, fmt.Errorf("unexpected error: %v", err) - } - - groupVersions = append(groupVersions, v.Versions...) - // Get the groupVersions exposed at /apis - baseURL.Path = path.Join(originalPath, defaultAPIPath) - resp2, err := client.Get(baseURL.String()) - if err != nil { - return nil, err - } - var apiGroupList metav1.APIGroupList - defer resp2.Body.Close() - err = json.NewDecoder(resp2.Body).Decode(&apiGroupList) - if err != nil { - return nil, fmt.Errorf("unexpected error: %v", err) - } - - for _, g := range apiGroupList.Groups { - for _, gv := range g.Versions { - groupVersions = append(groupVersions, gv.GroupVersion) - } - } - - return groupVersions, nil -} diff --git a/vendor/k8s.io/client-go/rest/watch/BUILD b/vendor/k8s.io/client-go/rest/watch/BUILD index 2718328638..30dfadd1fa 100644 --- a/vendor/k8s.io/client-go/rest/watch/BUILD +++ b/vendor/k8s.io/client-go/rest/watch/BUILD @@ -27,7 +27,6 @@ go_test( "decoder_test.go", "encoder_test.go", ], - importpath = "k8s.io/client-go/rest/watch_test", deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", diff --git a/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go index 59050fc491..67568bf0b4 100644 --- a/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go +++ b/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ 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! +// Code generated by deepcopy-gen. DO NOT EDIT. package rest diff --git a/vendor/k8s.io/client-go/scale/BUILD b/vendor/k8s.io/client-go/scale/BUILD index 4fb0a949e4..b82984243a 100644 --- a/vendor/k8s.io/client-go/scale/BUILD +++ b/vendor/k8s.io/client-go/scale/BUILD @@ -35,8 +35,7 @@ go_test( "client_test.go", "roundtrip_test.go", ], - importpath = "k8s.io/client-go/scale", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/k8s.io/api/apps/v1beta1:go_default_library", diff --git a/vendor/k8s.io/client-go/scale/client.go b/vendor/k8s.io/client-go/scale/client.go index 3f85197a0b..782aca394c 100644 --- a/vendor/k8s.io/client-go/scale/client.go +++ b/vendor/k8s.io/client-go/scale/client.go @@ -21,6 +21,7 @@ import ( autoscaling "k8s.io/api/autoscaling/v1" "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/client-go/dynamic" @@ -129,21 +130,29 @@ func (c *namespacedScaleClient) Get(resource schema.GroupResource, name string) return nil, fmt.Errorf("unable to get client for %s: %v", resource.String(), err) } - rawObj, err := c.client.clientBase.Get(). + result := c.client.clientBase.Get(). AbsPath(path). Namespace(c.namespace). Resource(gvr.Resource). Name(name). SubResource("scale"). - Do(). - Get() + Do() + if err := result.Error(); err != nil { + return nil, fmt.Errorf("could not fetch the scale for %s %s: %v", resource.String(), name, err) + } + scaleBytes, err := result.Raw() + if err != nil { + return nil, err + } + decoder := scaleConverter.codecs.UniversalDecoder(scaleConverter.ScaleVersions()...) + rawScaleObj, err := runtime.Decode(decoder, scaleBytes) if err != nil { return nil, err } // convert whatever this is to autoscaling/v1.Scale - scaleObj, err := scaleConverter.ConvertToVersion(rawObj, autoscaling.SchemeGroupVersion) + scaleObj, err := scaleConverter.ConvertToVersion(rawScaleObj, autoscaling.SchemeGroupVersion) if err != nil { return nil, fmt.Errorf("received an object from a /scale endpoint which was not convertible to autoscaling Scale: %v", err) } @@ -158,8 +167,8 @@ func (c *namespacedScaleClient) Update(resource schema.GroupResource, scale *aut } // Currently, a /scale endpoint can receive and return different scale types. - // Until we hvae support for the alternative API representations proposal, - // we need to deal with sending and accepting differnet API versions. + // Until we have support for the alternative API representations proposal, + // we need to deal with sending and accepting different API versions. // figure out what scale we actually need here desiredGVK, err := c.client.scaleKindResolver.ScaleForResource(gvr) @@ -170,25 +179,38 @@ func (c *namespacedScaleClient) Update(resource schema.GroupResource, scale *aut // convert this to whatever this endpoint wants scaleUpdate, err := scaleConverter.ConvertToVersion(scale, desiredGVK.GroupVersion()) if err != nil { - return nil, fmt.Errorf("could not convert scale update to internal Scale: %v", err) + return nil, fmt.Errorf("could not convert scale update to external Scale: %v", err) + } + encoder := scaleConverter.codecs.LegacyCodec(desiredGVK.GroupVersion()) + scaleUpdateBytes, err := runtime.Encode(encoder, scaleUpdate) + if err != nil { + return nil, fmt.Errorf("could not encode scale update to external Scale: %v", err) } - rawObj, err := c.client.clientBase.Put(). + result := c.client.clientBase.Put(). AbsPath(path). Namespace(c.namespace). Resource(gvr.Resource). Name(scale.Name). SubResource("scale"). - Body(scaleUpdate). - Do(). - Get() + Body(scaleUpdateBytes). + Do() + if err := result.Error(); err != nil { + return nil, fmt.Errorf("could not update the scale for %s %s: %v", resource.String(), scale.Name, err) + } + scaleBytes, err := result.Raw() + if err != nil { + return nil, err + } + decoder := scaleConverter.codecs.UniversalDecoder(scaleConverter.ScaleVersions()...) + rawScaleObj, err := runtime.Decode(decoder, scaleBytes) if err != nil { - return nil, fmt.Errorf("could not fetch the scale for %s %s: %v", resource.String(), scale.Name, err) + return nil, err } // convert whatever this is back to autoscaling/v1.Scale - scaleObj, err := scaleConverter.ConvertToVersion(rawObj, autoscaling.SchemeGroupVersion) + scaleObj, err := scaleConverter.ConvertToVersion(rawScaleObj, autoscaling.SchemeGroupVersion) if err != nil { return nil, fmt.Errorf("received an object from a /scale endpoint which was not convertible to autoscaling Scale: %v", err) } diff --git a/vendor/k8s.io/client-go/scale/client_test.go b/vendor/k8s.io/client-go/scale/client_test.go index f4f2af3d68..6301320f3c 100644 --- a/vendor/k8s.io/client-go/scale/client_test.go +++ b/vendor/k8s.io/client-go/scale/client_test.go @@ -99,7 +99,7 @@ func fakeScaleClient(t *testing.T) (ScalesGetter, []schema.GroupResource) { restMapperRes, err := discovery.GetAPIGroupResources(fakeDiscoveryClient) if err != nil { - t.Fatalf("unexpected error while constructing resource list from fake discovery client: %v") + t.Fatalf("unexpected error while constructing resource list from fake discovery client: %v", err) } restMapper := discovery.NewRESTMapper(restMapperRes, apimeta.InterfacesForUnstructured) diff --git a/vendor/k8s.io/client-go/scale/roundtrip_test.go b/vendor/k8s.io/client-go/scale/roundtrip_test.go index 2ea2887570..2d3b28bf6c 100644 --- a/vendor/k8s.io/client-go/scale/roundtrip_test.go +++ b/vendor/k8s.io/client-go/scale/roundtrip_test.go @@ -23,7 +23,7 @@ import ( ) // NB: this can't be in the scheme package, because importing' -// scheme/autoscalingv1 from scheme causes a depedency loop from +// scheme/autoscalingv1 from scheme causes a dependency loop from // conversions func TestRoundTrip(t *testing.T) { diff --git a/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go b/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go index 5b1d6841c4..16f29e2afe 100644 --- a/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go +++ b/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go @@ -17,6 +17,6 @@ limitations under the License. // Package appsint contains the necessary scaffolding of the // internal version of extensions as required by conversion logic. // It doesn't have any of its own types -- it's just necessary to -// get the expected behavoir out of runtime.Scheme.ConvertToVersion +// get the expected behavior out of runtime.Scheme.ConvertToVersion // and associated methods. package appsint diff --git a/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go index 93e0e61640..bd42e7add8 100644 --- a/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ 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! +// Code generated by conversion-gen. DO NOT EDIT. package appsv1beta1 diff --git a/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go index 410a0d90c5..d6afedb0de 100644 --- a/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ 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! +// Code generated by conversion-gen. DO NOT EDIT. package appsv1beta2 diff --git a/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go index 1eaa0d1802..2a7a45a476 100644 --- a/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ 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! +// Code generated by conversion-gen. DO NOT EDIT. package autoscalingv1 diff --git a/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go b/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go index cc92bf1882..9aaac60861 100644 --- a/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go +++ b/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go @@ -17,6 +17,6 @@ limitations under the License. // Package extensionsint contains the necessary scaffolding of the // internal version of extensions as required by conversion logic. // It doesn't have any of its own types -- it's just necessary to -// get the expected behavoir out of runtime.Scheme.ConvertToVersion +// get the expected behavior out of runtime.Scheme.ConvertToVersion // and associated methods. package extensionsint diff --git a/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go index 848cb8d2aa..6d0ed7a297 100644 --- a/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ 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! +// Code generated by conversion-gen. DO NOT EDIT. package extensionsv1beta1 diff --git a/vendor/k8s.io/client-go/scale/scheme/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/scale/scheme/zz_generated.deepcopy.go index 19b6795835..d34399667f 100644 --- a/vendor/k8s.io/client-go/scale/scheme/zz_generated.deepcopy.go +++ b/vendor/k8s.io/client-go/scale/scheme/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ 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! +// Code generated by deepcopy-gen. DO NOT EDIT. package scheme @@ -49,9 +49,8 @@ func (in *Scale) DeepCopy() *Scale { func (in *Scale) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/k8s.io/client-go/scale/util.go b/vendor/k8s.io/client-go/scale/util.go index 9eb1085360..46b5c4d1e2 100644 --- a/vendor/k8s.io/client-go/scale/util.go +++ b/vendor/k8s.io/client-go/scale/util.go @@ -23,6 +23,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/client-go/discovery" scalescheme "k8s.io/client-go/scale/scheme" scaleappsint "k8s.io/client-go/scale/scheme/appsint" @@ -124,6 +125,7 @@ func NewDiscoveryScaleKindResolver(client discovery.ServerResourcesInterface) Sc // ScaleConverter knows how to convert between external scale versions. type ScaleConverter struct { scheme *runtime.Scheme + codecs serializer.CodecFactory internalVersioner runtime.GroupVersioner } @@ -141,6 +143,7 @@ func NewScaleConverter() *ScaleConverter { return &ScaleConverter{ scheme: scheme, + codecs: serializer.NewCodecFactory(scheme), internalVersioner: runtime.NewMultiGroupVersioner( scalescheme.SchemeGroupVersion, schema.GroupKind{Group: scaleext.GroupName, Kind: "Scale"}, @@ -156,6 +159,22 @@ func (c *ScaleConverter) Scheme() *runtime.Scheme { return c.scheme } +func (c *ScaleConverter) Codecs() serializer.CodecFactory { + return c.codecs +} + +func (c *ScaleConverter) ScaleVersions() []schema.GroupVersion { + return []schema.GroupVersion{ + scaleautoscaling.SchemeGroupVersion, + scalescheme.SchemeGroupVersion, + scaleext.SchemeGroupVersion, + scaleextint.SchemeGroupVersion, + scaleappsint.SchemeGroupVersion, + scaleappsv1beta1.SchemeGroupVersion, + scaleappsv1beta2.SchemeGroupVersion, + } +} + // ConvertToVersion converts the given *external* input object to the given output *external* output group-version. func (c *ScaleConverter) ConvertToVersion(in runtime.Object, outVersion schema.GroupVersion) (runtime.Object, error) { scaleInt, err := c.scheme.ConvertToVersion(in, c.internalVersioner) diff --git a/vendor/k8s.io/client-go/testing/BUILD b/vendor/k8s.io/client-go/testing/BUILD index b26e662876..dd8d133971 100644 --- a/vendor/k8s.io/client-go/testing/BUILD +++ b/vendor/k8s.io/client-go/testing/BUILD @@ -3,6 +3,7 @@ package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", "go_library", + "go_test", ) go_library( @@ -28,6 +29,23 @@ go_library( ], ) +go_test( + name = "go_default_test", + srcs = [ + "fixture_test.go", + ], + embed = [":go_default_library"], + deps = [ + "//vendor/github.com/stretchr/testify/assert:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", + ], +) + filegroup( name = "package-srcs", srcs = glob(["**"]), diff --git a/vendor/k8s.io/client-go/testing/fixture.go b/vendor/k8s.io/client-go/testing/fixture.go index 08379fb089..ba8ee508f4 100644 --- a/vendor/k8s.io/client-go/testing/fixture.go +++ b/vendor/k8s.io/client-go/testing/fixture.go @@ -29,6 +29,11 @@ import ( restclient "k8s.io/client-go/rest" ) +// FakeWatchBufferSize is the max num of watch event can be buffered in the +// watch channel. Note that when watch event overflows or exceed this buffer +// size, manipulations via fake client may be blocked. +const FakeWatchBufferSize = 128 + // ObjectTracker keeps track of objects. It is intended to be used to // fake calls to a server by returning objects based on their kind, // namespace and name. @@ -54,6 +59,10 @@ type ObjectTracker interface { // didn't exist in the tracker prior to deletion, Delete returns // no error. Delete(gvr schema.GroupVersionResource, ns, name string) error + + // Watch watches objects from the tracker. Watch returns a channel + // which will push added / modified / deleted object. + Watch(gvr schema.GroupVersionResource, ns string) (watch.Interface, error) } // ObjectScheme abstracts the implementation of common operations on objects. @@ -132,6 +141,13 @@ type tracker struct { decoder runtime.Decoder lock sync.RWMutex objects map[schema.GroupVersionResource][]runtime.Object + // The value type of watchers is a map of which the key is either a namespace or + // all/non namespace aka "" and its value is list of fake watchers. Each of + // fake watcher holds a buffered channel of size "FakeWatchBufferSize" which + // is default to 128. Manipulations on resources will broadcast the notification + // events into the watchers' channel and note that too many unhandled event may + // potentially block the tracker. + watchers map[schema.GroupVersionResource]map[string][]*watch.FakeWatcher } var _ ObjectTracker = &tracker{} @@ -140,9 +156,10 @@ var _ ObjectTracker = &tracker{} // of objects for the fake clientset. Mostly useful for unit tests. func NewObjectTracker(scheme ObjectScheme, decoder runtime.Decoder) ObjectTracker { return &tracker{ - scheme: scheme, - decoder: decoder, - objects: make(map[schema.GroupVersionResource][]runtime.Object), + scheme: scheme, + decoder: decoder, + objects: make(map[schema.GroupVersionResource][]runtime.Object), + watchers: make(map[schema.GroupVersionResource]map[string][]*watch.FakeWatcher), } } @@ -185,6 +202,19 @@ func (t *tracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionK return list.DeepCopyObject(), nil } +func (t *tracker) Watch(gvr schema.GroupVersionResource, ns string) (watch.Interface, error) { + t.lock.Lock() + defer t.lock.Unlock() + + fakewatcher := watch.NewFakeWithChanSize(FakeWatchBufferSize, true) + + if _, exists := t.watchers[gvr]; !exists { + t.watchers[gvr] = make(map[string][]*watch.FakeWatcher) + } + t.watchers[gvr][ns] = append(t.watchers[gvr][ns], fakewatcher) + return fakewatcher, nil +} + func (t *tracker) Get(gvr schema.GroupVersionResource, ns, name string) (runtime.Object, error) { errNotFound := errors.NewNotFound(gvr.GroupResource(), name) @@ -263,6 +293,19 @@ func (t *tracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns return t.add(gvr, obj, ns, true) } +func (t *tracker) getWatches(gvr schema.GroupVersionResource, ns string) []*watch.FakeWatcher { + watches := []*watch.FakeWatcher{} + if t.watchers[gvr] != nil { + if w := t.watchers[gvr][ns]; w != nil { + watches = append(watches, w...) + } + if w := t.watchers[gvr][""]; w != nil { + watches = append(watches, w...) + } + } + return watches +} + func (t *tracker) add(gvr schema.GroupVersionResource, obj runtime.Object, ns string, replaceExisting bool) error { t.lock.Lock() defer t.lock.Unlock() @@ -296,6 +339,9 @@ func (t *tracker) add(gvr schema.GroupVersionResource, obj runtime.Object, ns st } if oldMeta.GetNamespace() == newMeta.GetNamespace() && oldMeta.GetName() == newMeta.GetName() { if replaceExisting { + for _, w := range t.getWatches(gvr, ns) { + w.Modify(obj) + } t.objects[gvr][i] = obj return nil } @@ -310,6 +356,10 @@ func (t *tracker) add(gvr schema.GroupVersionResource, obj runtime.Object, ns st t.objects[gvr] = append(t.objects[gvr], obj) + for _, w := range t.getWatches(gvr, ns) { + w.Add(obj) + } + return nil } @@ -342,7 +392,11 @@ func (t *tracker) Delete(gvr schema.GroupVersionResource, ns, name string) error return err } if objMeta.GetNamespace() == ns && objMeta.GetName() == name { + obj := t.objects[gvr][i] t.objects[gvr] = append(t.objects[gvr][:i], t.objects[gvr][i+1:]...) + for _, w := range t.getWatches(gvr, ns) { + w.Delete(obj) + } found = true break } diff --git a/vendor/k8s.io/client-go/tools/auth/BUILD b/vendor/k8s.io/client-go/tools/auth/BUILD index b418469efa..5c7718a778 100644 --- a/vendor/k8s.io/client-go/tools/auth/BUILD +++ b/vendor/k8s.io/client-go/tools/auth/BUILD @@ -16,7 +16,6 @@ go_library( go_test( name = "go_default_xtest", srcs = ["clientauth_test.go"], - importpath = "k8s.io/client-go/tools/auth_test", deps = ["//vendor/k8s.io/client-go/tools/auth:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/tools/auth/clientauth.go b/vendor/k8s.io/client-go/tools/auth/clientauth.go index 2213b98781..20339ab9d8 100644 --- a/vendor/k8s.io/client-go/tools/auth/clientauth.go +++ b/vendor/k8s.io/client-go/tools/auth/clientauth.go @@ -23,7 +23,7 @@ location within a Container's file tree for Containers that need access to the Kubernetes API. Having a defined format allows: - - clients to be implmented in multiple languages + - clients to be implemented in multiple languages - applications which link clients to be portable across clusters with different authentication styles (e.g. some may use SSL Client certs, others may not, etc) diff --git a/vendor/k8s.io/client-go/tools/cache/BUILD b/vendor/k8s.io/client-go/tools/cache/BUILD index 79e21e1ea5..524354e87c 100644 --- a/vendor/k8s.io/client-go/tools/cache/BUILD +++ b/vendor/k8s.io/client-go/tools/cache/BUILD @@ -22,9 +22,8 @@ go_test( "store_test.go", "undelta_store_test.go", ], - features = ["-race"], - importpath = "k8s.io/client-go/tools/cache", - library = ":go_default_library", + embed = [":go_default_library"], + race = "off", deps = [ "//vendor/github.com/google/gofuzz:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", @@ -83,6 +82,7 @@ go_library( "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/tools/pager:go_default_library", "//vendor/k8s.io/client-go/util/buffer:go_default_library", + "//vendor/k8s.io/client-go/util/retry:go_default_library", ], ) diff --git a/vendor/k8s.io/client-go/tools/cache/controller.go b/vendor/k8s.io/client-go/tools/cache/controller.go index e7b98befad..028c75e8e1 100644 --- a/vendor/k8s.io/client-go/tools/cache/controller.go +++ b/vendor/k8s.io/client-go/tools/cache/controller.go @@ -288,7 +288,7 @@ func NewInformer( // This will hold incoming changes. Note how we pass clientState in as a // KeyLister, that way resync operations will result in the correct set // of update/delete deltas. - fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, nil, clientState) + fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, clientState) cfg := &Config{ Queue: fifo, @@ -355,7 +355,7 @@ func NewIndexerInformer( // This will hold incoming changes. Note how we pass clientState in as a // KeyLister, that way resync operations will result in the correct set // of update/delete deltas. - fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, nil, clientState) + fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, clientState) cfg := &Config{ Queue: fifo, diff --git a/vendor/k8s.io/client-go/tools/cache/controller_test.go b/vendor/k8s.io/client-go/tools/cache/controller_test.go index a7a70533ff..64aca8d7d0 100644 --- a/vendor/k8s.io/client-go/tools/cache/controller_test.go +++ b/vendor/k8s.io/client-go/tools/cache/controller_test.go @@ -44,7 +44,7 @@ func Example() { // This will hold incoming changes. Note how we pass downstream in as a // KeyLister, that way resync operations will result in the correct set // of update/delete deltas. - fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, nil, downstream) + fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, downstream) // Let's do threadsafe output to get predictable test results. deletionCounter := make(chan string, 1000) diff --git a/vendor/k8s.io/client-go/tools/cache/delta_fifo.go b/vendor/k8s.io/client-go/tools/cache/delta_fifo.go index f06d1c5b1c..45c3b500d4 100644 --- a/vendor/k8s.io/client-go/tools/cache/delta_fifo.go +++ b/vendor/k8s.io/client-go/tools/cache/delta_fifo.go @@ -31,11 +31,6 @@ import ( // keyFunc is used to figure out what key an object should have. (It's // exposed in the returned DeltaFIFO's KeyOf() method, with bonus features.) // -// 'compressor' may compress as many or as few items as it wants -// (including returning an empty slice), but it should do what it -// does quickly since it is called while the queue is locked. -// 'compressor' may be nil if you don't want any delta compression. -// // 'keyLister' is expected to return a list of keys that the consumer of // this queue "knows about". It is used to decide which items are missing // when Replace() is called; 'Deleted' deltas are produced for these items. @@ -43,18 +38,30 @@ import ( // TODO: consider merging keyLister with this object, tracking a list of // "known" keys when Pop() is called. Have to think about how that // affects error retrying. -// TODO(lavalamp): I believe there is a possible race only when using an -// external known object source that the above TODO would -// fix. +// NOTE: It is possible to misuse this and cause a race when using an +// external known object source. +// Whether there is a potential race depends on how the comsumer +// modifies knownObjects. In Pop(), process function is called under +// lock, so it is safe to update data structures in it that need to be +// in sync with the queue (e.g. knownObjects). +// +// Example: +// In case of sharedIndexInformer being a consumer +// (https://github.com/kubernetes/kubernetes/blob/0cdd940f/staging/ +// src/k8s.io/client-go/tools/cache/shared_informer.go#L192), +// there is no race as knownObjects (s.indexer) is modified safely +// under DeltaFIFO's lock. The only exceptions are GetStore() and +// GetIndexer() methods, which expose ways to modify the underlying +// storage. Currently these two methods are used for creating Lister +// and internal tests. // // Also see the comment on DeltaFIFO. -func NewDeltaFIFO(keyFunc KeyFunc, compressor DeltaCompressor, knownObjects KeyListerGetter) *DeltaFIFO { +func NewDeltaFIFO(keyFunc KeyFunc, knownObjects KeyListerGetter) *DeltaFIFO { f := &DeltaFIFO{ - items: map[string]Deltas{}, - queue: []string{}, - keyFunc: keyFunc, - deltaCompressor: compressor, - knownObjects: knownObjects, + items: map[string]Deltas{}, + queue: []string{}, + keyFunc: keyFunc, + knownObjects: knownObjects, } f.cond.L = &f.lock return f @@ -86,9 +93,6 @@ func NewDeltaFIFO(keyFunc KeyFunc, compressor DeltaCompressor, knownObjects KeyL // items have been deleted when Replace() or Delete() are called. The deleted // object will be included in the DeleteFinalStateUnknown markers. These objects // could be stale. -// -// You may provide a function to compress deltas (e.g., represent a -// series of Updates as a single Update). type DeltaFIFO struct { // lock/cond protects access to 'items' and 'queue'. lock sync.RWMutex @@ -110,10 +114,6 @@ type DeltaFIFO struct { // insertion and retrieval, and should be deterministic. keyFunc KeyFunc - // deltaCompressor tells us how to combine two or more - // deltas. It may be nil. - deltaCompressor DeltaCompressor - // knownObjects list keys that are "known", for the // purpose of figuring out which items have been deleted // when Replace() or Delete() is called. @@ -133,7 +133,6 @@ var ( var ( // ErrZeroLengthDeltasObject is returned in a KeyError if a Deltas // object with zero length is encountered (should be impossible, - // even if such an object is accidentally produced by a DeltaCompressor-- // but included for completeness). ErrZeroLengthDeltasObject = errors.New("0 length Deltas object; can't get key") ) @@ -213,8 +212,6 @@ func (f *DeltaFIFO) Delete(obj interface{}) error { if err == nil && !exists && !itemsExist { // Presumably, this was deleted when a relist happened. // Don't provide a second report of the same deletion. - // TODO(lavalamp): This may be racy-- we aren't properly locked - // with knownObjects. return nil } } @@ -305,8 +302,8 @@ func (f *DeltaFIFO) willObjectBeDeletedLocked(id string) bool { return len(deltas) > 0 && deltas[len(deltas)-1].Type == Deleted } -// queueActionLocked appends to the delta list for the object, calling -// f.deltaCompressor if needed. Caller must lock first. +// queueActionLocked appends to the delta list for the object. +// Caller must lock first. func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) error { id, err := f.KeyOf(obj) if err != nil { @@ -322,9 +319,6 @@ func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) err newDeltas := append(f.items[id], Delta{actionType, obj}) newDeltas = dedupDeltas(newDeltas) - if f.deltaCompressor != nil { - newDeltas = f.deltaCompressor.Compress(newDeltas) - } _, exists := f.items[id] if len(newDeltas) > 0 { @@ -334,8 +328,7 @@ func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) err f.items[id] = newDeltas f.cond.Broadcast() } else if exists { - // The compression step removed all deltas, so - // we need to remove this from our map (extra items + // We need to remove this from our map (extra items // in the queue are ignored if they are not in the // map). delete(f.items, id) @@ -355,8 +348,8 @@ func (f *DeltaFIFO) List() []interface{} { func (f *DeltaFIFO) listLocked() []interface{} { list := make([]interface{}, 0, len(f.items)) for _, item := range f.items { - // Copy item's slice so operations on this slice (delta - // compression) won't interfere with the object we return. + // Copy item's slice so operations on this slice + // won't interfere with the object we return. item = copyDeltas(item) list = append(list, item.Newest().Object) } @@ -394,8 +387,8 @@ func (f *DeltaFIFO) GetByKey(key string) (item interface{}, exists bool, err err defer f.lock.RUnlock() d, exists := f.items[key] if exists { - // Copy item's slice so operations on this slice (delta - // compression) won't interfere with the object we return. + // Copy item's slice so operations on this slice + // won't interfere with the object we return. d = copyDeltas(d) } return d, exists, nil @@ -503,8 +496,6 @@ func (f *DeltaFIFO) Replace(list []interface{}, resourceVersion string) error { } // Detect deletions not already in the queue. - // TODO(lavalamp): This may be racy-- we aren't properly locked - // with knownObjects. Unproven. knownKeys := f.knownObjects.ListKeys() queuedDeletions := 0 for _, k := range knownKeys { @@ -603,23 +594,6 @@ type KeyGetter interface { GetByKey(key string) (interface{}, bool, error) } -// DeltaCompressor is an algorithm that removes redundant changes. -type DeltaCompressor interface { - Compress(Deltas) Deltas -} - -// DeltaCompressorFunc should remove redundant changes; but changes that -// are redundant depend on one's desired semantics, so this is an -// injectable function. -// -// DeltaCompressorFunc adapts a raw function to be a DeltaCompressor. -type DeltaCompressorFunc func(Deltas) Deltas - -// Compress just calls dc. -func (dc DeltaCompressorFunc) Compress(d Deltas) Deltas { - return dc(d) -} - // DeltaType is the type of a change (addition, deletion, etc) type DeltaType string @@ -668,7 +642,7 @@ func (d Deltas) Newest() *Delta { // copyDeltas returns a shallow copy of d; that is, it copies the slice but not // the objects in the slice. This allows Get/List to return an object that we -// know won't be clobbered by a subsequent call to a delta compressor. +// know won't be clobbered by a subsequent modifications. func copyDeltas(d Deltas) Deltas { d2 := make(Deltas, len(d)) copy(d2, d) diff --git a/vendor/k8s.io/client-go/tools/cache/delta_fifo_test.go b/vendor/k8s.io/client-go/tools/cache/delta_fifo_test.go index 87bbdaeab8..9f8e575804 100644 --- a/vendor/k8s.io/client-go/tools/cache/delta_fifo_test.go +++ b/vendor/k8s.io/client-go/tools/cache/delta_fifo_test.go @@ -51,7 +51,7 @@ func (kl keyLookupFunc) GetByKey(key string) (interface{}, bool, error) { } func TestDeltaFIFO_basic(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) const amount = 500 go func() { for i := 0; i < amount; i++ { @@ -86,7 +86,7 @@ func TestDeltaFIFO_basic(t *testing.T) { } func TestDeltaFIFO_requeueOnPop(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("foo", 10)) _, err := f.Pop(func(obj interface{}) error { @@ -129,43 +129,8 @@ func TestDeltaFIFO_requeueOnPop(t *testing.T) { } } -func TestDeltaFIFO_compressorWorks(t *testing.T) { - oldestTypes := []DeltaType{} - f := NewDeltaFIFO( - testFifoObjectKeyFunc, - // This function just keeps the most recent delta - // and puts deleted ones in the list. - DeltaCompressorFunc(func(d Deltas) Deltas { - if n := len(d); n > 1 { - oldestTypes = append(oldestTypes, d[0].Type) - d = d[1:] - } - return d - }), - nil, - ) - if f.HasSynced() { - t.Errorf("Expected HasSynced to be false before completion of initial population") - } - f.Add(mkFifoObj("foo", 10)) - f.Update(mkFifoObj("foo", 12)) - f.Replace([]interface{}{mkFifoObj("foo", 20)}, "0") - f.Delete(mkFifoObj("foo", 22)) - f.Add(mkFifoObj("foo", 25)) // flush the last one out - expect := []DeltaType{Added, Updated, Sync, Deleted} - if e, a := expect, oldestTypes; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %#v, got %#v", e, a) - } - if e, a := (Deltas{{Added, mkFifoObj("foo", 25)}}), Pop(f).(Deltas); !reflect.DeepEqual(e, a) { - t.Fatalf("Expected %#v, got %#v", e, a) - } - if !f.HasSynced() { - t.Errorf("Expected HasSynced to be true after completion of initial population") - } -} - func TestDeltaFIFO_addUpdate(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("foo", 10)) f.Update(mkFifoObj("foo", 12)) f.Delete(mkFifoObj("foo", 15)) @@ -203,7 +168,7 @@ func TestDeltaFIFO_addUpdate(t *testing.T) { } func TestDeltaFIFO_enqueueingNoLister(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("foo", 10)) f.Update(mkFifoObj("bar", 15)) f.Add(mkFifoObj("qux", 17)) @@ -226,7 +191,6 @@ func TestDeltaFIFO_enqueueingNoLister(t *testing.T) { func TestDeltaFIFO_enqueueingWithLister(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), @@ -249,7 +213,7 @@ func TestDeltaFIFO_enqueueingWithLister(t *testing.T) { } func TestDeltaFIFO_addReplace(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("foo", 10)) f.Replace([]interface{}{mkFifoObj("foo", 15)}, "0") got := make(chan testFifoObject, 2) @@ -277,7 +241,6 @@ func TestDeltaFIFO_addReplace(t *testing.T) { func TestDeltaFIFO_ResyncNonExisting(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5)} }), @@ -297,7 +260,6 @@ func TestDeltaFIFO_ResyncNonExisting(t *testing.T) { func TestDeltaFIFO_DeleteExistingNonPropagated(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{} }), @@ -317,7 +279,6 @@ func TestDeltaFIFO_DeleteExistingNonPropagated(t *testing.T) { func TestDeltaFIFO_ReplaceMakesDeletions(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), @@ -344,7 +305,6 @@ func TestDeltaFIFO_ReplaceMakesDeletions(t *testing.T) { func TestDeltaFIFO_UpdateResyncRace(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5)} }), @@ -367,7 +327,6 @@ func TestDeltaFIFO_UpdateResyncRace(t *testing.T) { func TestDeltaFIFO_HasSyncedCorrectOnDeletion(t *testing.T) { f := NewDeltaFIFO( testFifoObjectKeyFunc, - nil, keyLookupFunc(func() []testFifoObject { return []testFifoObject{mkFifoObj("foo", 5), mkFifoObj("bar", 6), mkFifoObj("baz", 7)} }), @@ -396,7 +355,7 @@ func TestDeltaFIFO_HasSyncedCorrectOnDeletion(t *testing.T) { } func TestDeltaFIFO_detectLineJumpers(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("foo", 10)) f.Add(mkFifoObj("bar", 1)) @@ -424,7 +383,7 @@ func TestDeltaFIFO_detectLineJumpers(t *testing.T) { } func TestDeltaFIFO_addIfNotPresent(t *testing.T) { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) f.Add(mkFifoObj("b", 3)) b3 := Pop(f) @@ -521,7 +480,7 @@ func TestDeltaFIFO_HasSynced(t *testing.T) { } for i, test := range tests { - f := NewDeltaFIFO(testFifoObjectKeyFunc, nil, nil) + f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) for _, action := range test.actions { action(f) diff --git a/vendor/k8s.io/client-go/tools/cache/fifo.go b/vendor/k8s.io/client-go/tools/cache/fifo.go index ef70b7aca1..e05c01ee29 100644 --- a/vendor/k8s.io/client-go/tools/cache/fifo.go +++ b/vendor/k8s.io/client-go/tools/cache/fifo.go @@ -59,7 +59,7 @@ type Queue interface { // has since been added. AddIfNotPresent(interface{}) error - // Return true if the first batch of items has been popped + // HasSynced returns true if the first batch of items has been popped HasSynced() bool // Close queue diff --git a/vendor/k8s.io/client-go/tools/cache/listwatch.go b/vendor/k8s.io/client-go/tools/cache/listwatch.go index db2329c55a..06657a3b06 100644 --- a/vendor/k8s.io/client-go/tools/cache/listwatch.go +++ b/vendor/k8s.io/client-go/tools/cache/listwatch.go @@ -63,8 +63,18 @@ type Getter interface { // NewListWatchFromClient creates a new ListWatch from the specified client, resource, namespace and field selector. func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSelector fields.Selector) *ListWatch { - listFunc := func(options metav1.ListOptions) (runtime.Object, error) { + optionsModifier := func(options *metav1.ListOptions) { options.FieldSelector = fieldSelector.String() + } + return NewFilteredListWatchFromClient(c, resource, namespace, optionsModifier) +} + +// NewFilteredListWatchFromClient creates a new ListWatch from the specified client, resource, namespace, and option modifier. +// Option modifier is a function takes a ListOptions and modifies the consumed ListOptions. Provide customized modifier function +// to apply modification to ListOptions with a field selector, a label selector, or any other desired options. +func NewFilteredListWatchFromClient(c Getter, resource string, namespace string, optionsModifier func(options *metav1.ListOptions)) *ListWatch { + listFunc := func(options metav1.ListOptions) (runtime.Object, error) { + optionsModifier(&options) return c.Get(). Namespace(namespace). Resource(resource). @@ -74,7 +84,7 @@ func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSe } watchFunc := func(options metav1.ListOptions) (watch.Interface, error) { options.Watch = true - options.FieldSelector = fieldSelector.String() + optionsModifier(&options) return c.Get(). Namespace(namespace). Resource(resource). diff --git a/vendor/k8s.io/client-go/tools/cache/reflector.go b/vendor/k8s.io/client-go/tools/cache/reflector.go index a97b5f98ab..054a7373c9 100644 --- a/vendor/k8s.io/client-go/tools/cache/reflector.go +++ b/vendor/k8s.io/client-go/tools/cache/reflector.go @@ -108,8 +108,8 @@ func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{}, reflectorSuffix := atomic.AddInt64(&reflectorDisambiguator, 1) r := &Reflector{ name: name, - // we need this to be unique per process (some names are still the same)but obvious who it belongs to - metrics: newReflectorMetrics(makeValidPromethusMetricLabel(fmt.Sprintf("reflector_"+name+"_%d", reflectorSuffix))), + // we need this to be unique per process (some names are still the same) but obvious who it belongs to + metrics: newReflectorMetrics(makeValidPrometheusMetricLabel(fmt.Sprintf("reflector_"+name+"_%d", reflectorSuffix))), listerWatcher: lw, store: store, expectedType: reflect.TypeOf(expectedType), @@ -120,7 +120,7 @@ func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{}, return r } -func makeValidPromethusMetricLabel(in string) string { +func makeValidPrometheusMetricLabel(in string) string { // this isn't perfect, but it removes our common characters return strings.NewReplacer("/", "_", ".", "_", "-", "_", ":", "_").Replace(in) } @@ -302,12 +302,12 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { default: } - timemoutseconds := int64(minWatchTimeout.Seconds() * (rand.Float64() + 1.0)) + timeoutSeconds := int64(minWatchTimeout.Seconds() * (rand.Float64() + 1.0)) options = metav1.ListOptions{ ResourceVersion: resourceVersion, // We want to avoid situations of hanging watchers. Stop any wachers that do not // receive any events within the timeout window. - TimeoutSeconds: &timemoutseconds, + TimeoutSeconds: &timeoutSeconds, } r.metrics.numberOfWatches.Inc() diff --git a/vendor/k8s.io/client-go/tools/cache/shared_informer.go b/vendor/k8s.io/client-go/tools/cache/shared_informer.go index b11f0ebdd7..5f8c507f9e 100644 --- a/vendor/k8s.io/client-go/tools/cache/shared_informer.go +++ b/vendor/k8s.io/client-go/tools/cache/shared_informer.go @@ -26,6 +26,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/util/buffer" + "k8s.io/client-go/util/retry" "github.com/golang/glog" ) @@ -188,7 +189,7 @@ type deleteNotification struct { func (s *sharedIndexInformer) Run(stopCh <-chan struct{}) { defer utilruntime.HandleCrash() - fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, nil, s.indexer) + fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, s.indexer) cfg := &Config{ Queue: fifo, @@ -334,7 +335,7 @@ func (s *sharedIndexInformer) AddEventHandlerWithResyncPeriod(handler ResourceEv s.blockDeltas.Lock() defer s.blockDeltas.Unlock() - s.processor.addAndStartListener(listener) + s.processor.addListener(listener) for _, item := range s.indexer.List() { listener.add(addNotification{newObj: item}) } @@ -372,6 +373,7 @@ func (s *sharedIndexInformer) HandleDeltas(obj interface{}) error { } type sharedProcessor struct { + listenersStarted bool listenersLock sync.RWMutex listeners []*processorListener syncingListeners []*processorListener @@ -379,20 +381,15 @@ type sharedProcessor struct { wg wait.Group } -func (p *sharedProcessor) addAndStartListener(listener *processorListener) { - p.listenersLock.Lock() - defer p.listenersLock.Unlock() - - p.addListenerLocked(listener) - p.wg.Start(listener.run) - p.wg.Start(listener.pop) -} - func (p *sharedProcessor) addListener(listener *processorListener) { p.listenersLock.Lock() defer p.listenersLock.Unlock() p.addListenerLocked(listener) + if p.listenersStarted { + p.wg.Start(listener.run) + p.wg.Start(listener.pop) + } } func (p *sharedProcessor) addListenerLocked(listener *processorListener) { @@ -423,6 +420,7 @@ func (p *sharedProcessor) run(stopCh <-chan struct{}) { p.wg.Start(listener.run) p.wg.Start(listener.pop) } + p.listenersStarted = true }() <-stopCh p.listenersLock.RLock() @@ -540,20 +538,35 @@ func (p *processorListener) pop() { } func (p *processorListener) run() { - defer utilruntime.HandleCrash() + // this call blocks until the channel is closed. When a panic happens during the notification + // we will catch it, **the offending item will be skipped!**, and after a short delay (one second) + // the next notification will be attempted. This is usually better than the alternative of never + // delivering again. + stopCh := make(chan struct{}) + wait.Until(func() { + // this gives us a few quick retries before a long pause and then a few more quick retries + err := wait.ExponentialBackoff(retry.DefaultRetry, func() (bool, error) { + for next := range p.nextCh { + switch notification := next.(type) { + case updateNotification: + p.handler.OnUpdate(notification.oldObj, notification.newObj) + case addNotification: + p.handler.OnAdd(notification.newObj) + case deleteNotification: + p.handler.OnDelete(notification.oldObj) + default: + utilruntime.HandleError(fmt.Errorf("unrecognized notification: %#v", next)) + } + } + // the only way to get here is if the p.nextCh is empty and closed + return true, nil + }) - for next := range p.nextCh { - switch notification := next.(type) { - case updateNotification: - p.handler.OnUpdate(notification.oldObj, notification.newObj) - case addNotification: - p.handler.OnAdd(notification.newObj) - case deleteNotification: - p.handler.OnDelete(notification.oldObj) - default: - utilruntime.HandleError(fmt.Errorf("unrecognized notification: %#v", next)) + // the only way to get here is if the p.nextCh is empty and closed + if err == nil { + close(stopCh) } - } + }, 1*time.Minute, stopCh) } // shouldResync deterimines if the listener needs a resync. If the listener's resyncPeriod is 0, diff --git a/vendor/k8s.io/client-go/tools/cache/shared_informer_test.go b/vendor/k8s.io/client-go/tools/cache/shared_informer_test.go index 6f49d167a3..22e4a90ddd 100644 --- a/vendor/k8s.io/client-go/tools/cache/shared_informer_test.go +++ b/vendor/k8s.io/client-go/tools/cache/shared_informer_test.go @@ -251,3 +251,15 @@ func TestResyncCheckPeriod(t *testing.T) { t.Errorf("expected %d, got %d", e, a) } } + +// verify that https://github.com/kubernetes/kubernetes/issues/59822 is fixed +func TestSharedInformerInitializationRace(t *testing.T) { + source := fcache.NewFakeControllerSource() + informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) + listener := newTestListener("raceListener", 0) + + stop := make(chan struct{}) + go informer.AddEventHandlerWithResyncPeriod(listener, listener.resyncPeriod) + go informer.Run(stop) + close(stop) +} diff --git a/vendor/k8s.io/client-go/tools/cache/testing/BUILD b/vendor/k8s.io/client-go/tools/cache/testing/BUILD index f19cb7f3cf..d1658af4d0 100644 --- a/vendor/k8s.io/client-go/tools/cache/testing/BUILD +++ b/vendor/k8s.io/client-go/tools/cache/testing/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["fake_controller_source_test.go"], - importpath = "k8s.io/client-go/tools/cache/testing", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/k8s.io/client-go/tools/clientcmd/BUILD b/vendor/k8s.io/client-go/tools/clientcmd/BUILD index 77a8d2229f..c46c76d5d6 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/BUILD +++ b/vendor/k8s.io/client-go/tools/clientcmd/BUILD @@ -15,8 +15,7 @@ go_test( "overrides_test.go", "validation_test.go", ], - importpath = "k8s.io/client-go/tools/clientcmd", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/imdario/mergo:go_default_library", diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/BUILD b/vendor/k8s.io/client-go/tools/clientcmd/api/BUILD index d46f4e28fb..b2fd138241 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/BUILD +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/BUILD @@ -12,8 +12,7 @@ go_test( "helpers_test.go", "types_test.go", ], - importpath = "k8s.io/client-go/tools/clientcmd/api", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/github.com/ghodss/yaml:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/types.go b/vendor/k8s.io/client-go/tools/clientcmd/api/types.go index 407dec83a4..1391df7021 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/types.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/types.go @@ -119,6 +119,9 @@ type AuthInfo struct { // AuthProvider specifies a custom authentication plugin for the kubernetes cluster. // +optional AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"` + // Exec specifies a custom exec-based authentication plugin for the kubernetes cluster. + // +optional + Exec *ExecConfig `json:"exec,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions map[string]runtime.Object `json:"extensions,omitempty"` @@ -147,6 +150,35 @@ type AuthProviderConfig struct { Config map[string]string `json:"config,omitempty"` } +// ExecConfig specifies a command to provide client credentials. The command is exec'd +// and outputs structured stdout holding credentials. +// +// See the client.authentiction.k8s.io API group for specifications of the exact input +// and output format +type ExecConfig struct { + // Command to execute. + Command string `json:"command"` + // Arguments to pass to the command when executing it. + // +optional + Args []string `json:"args"` + // Env defines additional environment variables to expose to the process. These + // are unioned with the host's environment, as well as variables client-go uses + // to pass argument to the plugin. + // +optional + Env []ExecEnvVar `json:"env"` + + // Preferred input version of the ExecInfo. The returned ExecCredentials MUST use + // the same encoding version as the input. + APIVersion string `json:"apiVersion,omitempty"` +} + +// ExecEnvVar is used for setting environment variables when executing an exec-based +// credential plugin. +type ExecEnvVar struct { + Name string `json:"name"` + Value string `json:"value"` +} + // NewConfig is a convenience function that returns a new Config object with non-nil maps func NewConfig() *Config { return &Config{ diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go index 53568135e8..56afb608a8 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go @@ -113,6 +113,9 @@ type AuthInfo struct { // AuthProvider specifies a custom authentication plugin for the kubernetes cluster. // +optional AuthProvider *AuthProviderConfig `json:"auth-provider,omitempty"` + // Exec specifies a custom exec-based authentication plugin for the kubernetes cluster. + // +optional + Exec *ExecConfig `json:"exec,omitempty"` // Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields // +optional Extensions []NamedExtension `json:"extensions,omitempty"` @@ -169,3 +172,32 @@ type AuthProviderConfig struct { Name string `json:"name"` Config map[string]string `json:"config"` } + +// ExecConfig specifies a command to provide client credentials. The command is exec'd +// and outputs structured stdout holding credentials. +// +// See the client.authentiction.k8s.io API group for specifications of the exact input +// and output format +type ExecConfig struct { + // Command to execute. + Command string `json:"command"` + // Arguments to pass to the command when executing it. + // +optional + Args []string `json:"args"` + // Env defines additional environment variables to expose to the process. These + // are unioned with the host's environment, as well as variables client-go uses + // to pass argument to the plugin. + // +optional + Env []ExecEnvVar `json:"env"` + + // Preferred input version of the ExecInfo. The returned ExecCredentials MUST use + // the same encoding version as the input. + APIVersion string `json:"apiVersion,omitempty"` +} + +// ExecEnvVar is used for setting environment variables when executing an exec-based +// credential plugin. +type ExecEnvVar struct { + Name string `json:"name"` + Value string `json:"value"` +} diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.deepcopy.go index 8d634671b0..83d05b7c6c 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ 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! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 @@ -63,6 +63,15 @@ func (in *AuthInfo) DeepCopyInto(out *AuthInfo) { (*in).DeepCopyInto(*out) } } + if in.Exec != nil { + in, out := &in.Exec, &out.Exec + if *in == nil { + *out = nil + } else { + *out = new(ExecConfig) + (*in).DeepCopyInto(*out) + } + } if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make([]NamedExtension, len(*in)) @@ -183,9 +192,8 @@ func (in *Config) DeepCopy() *Config { func (in *Config) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -211,6 +219,48 @@ func (in *Context) DeepCopy() *Context { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecConfig) DeepCopyInto(out *ExecConfig) { + *out = *in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]ExecEnvVar, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecConfig. +func (in *ExecConfig) DeepCopy() *ExecConfig { + if in == nil { + return nil + } + out := new(ExecConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecEnvVar) DeepCopyInto(out *ExecEnvVar) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecEnvVar. +func (in *ExecEnvVar) DeepCopy() *ExecEnvVar { + if in == nil { + return nil + } + out := new(ExecEnvVar) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamedAuthInfo) DeepCopyInto(out *NamedAuthInfo) { *out = *in diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go index 51668f05bb..085c088ee5 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ 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! +// Code generated by deepcopy-gen. DO NOT EDIT. package api @@ -63,6 +63,15 @@ func (in *AuthInfo) DeepCopyInto(out *AuthInfo) { (*in).DeepCopyInto(*out) } } + if in.Exec != nil { + in, out := &in.Exec, &out.Exec + if *in == nil { + *out = nil + } else { + *out = new(ExecConfig) + (*in).DeepCopyInto(*out) + } + } if in.Extensions != nil { in, out := &in.Extensions, &out.Extensions *out = make(map[string]runtime.Object, len(*in)) @@ -210,9 +219,8 @@ func (in *Config) DeepCopy() *Config { func (in *Config) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c - } else { - return nil } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -242,6 +250,48 @@ func (in *Context) DeepCopy() *Context { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecConfig) DeepCopyInto(out *ExecConfig) { + *out = *in + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]ExecEnvVar, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecConfig. +func (in *ExecConfig) DeepCopy() *ExecConfig { + if in == nil { + return nil + } + out := new(ExecConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecEnvVar) DeepCopyInto(out *ExecEnvVar) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecEnvVar. +func (in *ExecEnvVar) DeepCopy() *ExecEnvVar { + if in == nil { + return nil + } + out := new(ExecEnvVar) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Preferences) DeepCopyInto(out *Preferences) { *out = *in diff --git a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go index a8698af243..c202e6b255 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go @@ -107,7 +107,7 @@ func (config *DirectClientConfig) RawConfig() (clientcmdapi.Config, error) { // ClientConfig implements ClientConfig func (config *DirectClientConfig) ClientConfig() (*restclient.Config, error) { // check that getAuthInfo, getContext, and getCluster do not return an error. - // Do this before checking if the curent config is usable in the event that an + // Do this before checking if the current config is usable in the event that an // AuthInfo, Context, or Cluster config with user-defined names are not found. // This provides a user with the immediate cause for error if one is found configAuthInfo, err := config.getAuthInfo() @@ -202,7 +202,7 @@ func getServerIdentificationPartialConfig(configAuthInfo clientcmdapi.AuthInfo, // clientauth.Info object contain both user identification and server identification. We want different precedence orders for // both, so we have to split the objects and merge them separately -// we want this order of precedence for user identifcation +// we want this order of precedence for user identification // 1. configAuthInfo minus auth-path (the final result of command line flags and merged .kubeconfig files) // 2. configAuthInfo.auth-path (this file can contain information that conflicts with #1, and we want #1 to win the priority) // 3. if there is not enough information to identify the user, load try the ~/.kubernetes_auth file @@ -241,6 +241,9 @@ func (config *DirectClientConfig) getUserIdentificationPartialConfig(configAuthI mergedConfig.AuthProvider = configAuthInfo.AuthProvider mergedConfig.AuthConfigPersister = persistAuthConfig } + if configAuthInfo.Exec != nil { + mergedConfig.ExecProvider = configAuthInfo.Exec + } // if there still isn't enough information to authenticate the user, try prompting if !canIdentifyUser(*mergedConfig) && (fallbackReader != nil) { @@ -291,7 +294,8 @@ func canIdentifyUser(config restclient.Config) bool { return len(config.Username) > 0 || (len(config.CertFile) > 0 || len(config.CertData) > 0) || len(config.BearerToken) > 0 || - config.AuthProvider != nil + config.AuthProvider != nil || + config.ExecProvider != nil } // Namespace implements ClientConfig @@ -474,7 +478,7 @@ func (config *inClusterClientConfig) ClientConfig() (*restclient.Config, error) } // in-cluster configs only takes a host, token, or CA file - // if any of them were individually provided, ovewrite anything else + // if any of them were individually provided, overwrite anything else if config.overrides != nil { if server := config.overrides.ClusterInfo.Server; len(server) > 0 { icc.Host = server diff --git a/vendor/k8s.io/client-go/tools/clientcmd/client_config_test.go b/vendor/k8s.io/client-go/tools/clientcmd/client_config_test.go index 9c08ff89d5..0a9288bcf9 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/client_config_test.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/client_config_test.go @@ -94,7 +94,7 @@ func TestInsecureOverridesCA(t *testing.T) { } func TestMergeContext(t *testing.T) { - const namespace = "overriden-namespace" + const namespace = "overridden-namespace" config := createValidTestConfig() clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{}, nil) diff --git a/vendor/k8s.io/client-go/tools/clientcmd/loader.go b/vendor/k8s.io/client-go/tools/clientcmd/loader.go index 6ac83b5c84..95e7b15400 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/loader.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/loader.go @@ -111,7 +111,7 @@ func (g *ClientConfigGetter) IsDefaultConfig(config *restclient.Config) bool { // ClientConfigLoadingRules is an ExplicitPath and string slice of specific locations that are used for merging together a Config // Callers can put the chain together however they want, but we'd recommend: // EnvVarPathFiles if set (a list of files if set) OR the HomeDirectoryPath -// ExplicitPath is special, because if a user specifically requests a certain file be used and error is reported if thie file is not present +// ExplicitPath is special, because if a user specifically requests a certain file be used and error is reported if this file is not present type ClientConfigLoadingRules struct { ExplicitPath string Precedence []string @@ -420,7 +420,7 @@ func WriteToFile(config clientcmdapi.Config, filename string) error { func lockFile(filename string) error { // TODO: find a way to do this with actual file locks. Will - // probably need seperate solution for windows and linux. + // probably need separate solution for windows and Linux. // Make sure the dir exists before we try to create a lock file. dir := filepath.Dir(filename) @@ -557,7 +557,12 @@ func GetClusterFileReferences(cluster *clientcmdapi.Cluster) []*string { } func GetAuthInfoFileReferences(authInfo *clientcmdapi.AuthInfo) []*string { - return []*string{&authInfo.ClientCertificate, &authInfo.ClientKey, &authInfo.TokenFile} + s := []*string{&authInfo.ClientCertificate, &authInfo.ClientKey, &authInfo.TokenFile} + // Only resolve exec command if it isn't PATH based. + if authInfo.Exec != nil && strings.ContainsRune(authInfo.Exec.Command, filepath.Separator) { + s = append(s, &authInfo.Exec.Command) + } + return s } // ResolvePaths updates the given refs to be absolute paths, relative to the given base directory diff --git a/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go b/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go index 74319788ab..c2dbd019dd 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go @@ -206,6 +206,9 @@ func TestResolveRelativePaths(t *testing.T) { AuthInfos: map[string]*clientcmdapi.AuthInfo{ "relative-user-1": {ClientCertificate: "relative/client/cert", ClientKey: "../relative/client/key"}, "absolute-user-1": {ClientCertificate: "/absolute/client/cert", ClientKey: "/absolute/client/key"}, + "relative-cmd-1": {Exec: &clientcmdapi.ExecConfig{Command: "../relative/client/cmd"}}, + "absolute-cmd-1": {Exec: &clientcmdapi.ExecConfig{Command: "/absolute/client/cmd"}}, + "PATH-cmd-1": {Exec: &clientcmdapi.ExecConfig{Command: "cmd"}}, }, Clusters: map[string]*clientcmdapi.Cluster{ "relative-server-1": {CertificateAuthority: "../relative/ca"}, @@ -291,9 +294,21 @@ func TestResolveRelativePaths(t *testing.T) { matchStringArg(pathResolutionConfig2.AuthInfos["absolute-user-2"].ClientCertificate, authInfo.ClientCertificate, t) matchStringArg(pathResolutionConfig2.AuthInfos["absolute-user-2"].ClientKey, authInfo.ClientKey, t) } + if key == "relative-cmd-1" { + foundAuthInfoCount++ + matchStringArg(path.Join(configDir1, pathResolutionConfig1.AuthInfos[key].Exec.Command), authInfo.Exec.Command, t) + } + if key == "absolute-cmd-1" { + foundAuthInfoCount++ + matchStringArg(pathResolutionConfig1.AuthInfos[key].Exec.Command, authInfo.Exec.Command, t) + } + if key == "PATH-cmd-1" { + foundAuthInfoCount++ + matchStringArg(pathResolutionConfig1.AuthInfos[key].Exec.Command, authInfo.Exec.Command, t) + } } - if foundAuthInfoCount != 4 { - t.Errorf("Expected 4 users, found %v: %v", foundAuthInfoCount, mergedConfig.AuthInfos) + if foundAuthInfoCount != 7 { + t.Errorf("Expected 7 users, found %v: %v", foundAuthInfoCount, mergedConfig.AuthInfos) } } diff --git a/vendor/k8s.io/client-go/tools/clientcmd/validation.go b/vendor/k8s.io/client-go/tools/clientcmd/validation.go index 2bae0c395d..629c0b30a0 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/validation.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/validation.go @@ -237,6 +237,25 @@ func validateAuthInfo(authInfoName string, authInfo clientcmdapi.AuthInfo) []err } } + if authInfo.Exec != nil { + if authInfo.AuthProvider != nil { + validationErrors = append(validationErrors, fmt.Errorf("authProvider cannot be provided in combination with an exec plugin for %s", authInfoName)) + } + if len(authInfo.Exec.Command) == 0 { + validationErrors = append(validationErrors, fmt.Errorf("command must be specified for %v to use exec authentication plugin", authInfoName)) + } + if len(authInfo.Exec.APIVersion) == 0 { + validationErrors = append(validationErrors, fmt.Errorf("apiVersion must be specified for %v to use exec authentication plugin", authInfoName)) + } + for _, v := range authInfo.Exec.Env { + if len(v.Name) == 0 { + validationErrors = append(validationErrors, fmt.Errorf("env variable name must be specified for %v to use exec authentication plugin", authInfoName)) + } else if len(v.Value) == 0 { + validationErrors = append(validationErrors, fmt.Errorf("env variable %s value must be specified for %v to use exec authentication plugin", v.Name, authInfoName)) + } + } + } + // authPath also provides information for the client to identify the server, so allow multiple auth methods in that case if (len(methods) > 1) && (!usingAuthPath) { validationErrors = append(validationErrors, fmt.Errorf("more than one authentication method found for %v; found %v, only one is allowed", authInfoName, methods)) @@ -253,6 +272,10 @@ func validateAuthInfo(authInfoName string, authInfo clientcmdapi.AuthInfo) []err func validateContext(contextName string, context clientcmdapi.Context, config clientcmdapi.Config) []error { validationErrors := make([]error, 0) + if len(contextName) == 0 { + validationErrors = append(validationErrors, fmt.Errorf("empty context name for %#v is not allowed", context)) + } + if len(context.AuthInfo) == 0 { validationErrors = append(validationErrors, fmt.Errorf("user was not specified for context %q", contextName)) } else if _, exists := config.AuthInfos[context.AuthInfo]; !exists { diff --git a/vendor/k8s.io/client-go/tools/clientcmd/validation_test.go b/vendor/k8s.io/client-go/tools/clientcmd/validation_test.go index 6441f14837..4742b1a143 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/validation_test.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/validation_test.go @@ -62,6 +62,7 @@ func TestConfirmUsableBadInfoButOkConfig(t *testing.T) { okTest.testConfirmUsable("clean", t) badValidation.testConfig(t) } + func TestConfirmUsableBadInfoConfig(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["missing ca"] = &clientcmdapi.Cluster{ @@ -83,6 +84,7 @@ func TestConfirmUsableBadInfoConfig(t *testing.T) { test.testConfirmUsable("first", t) } + func TestConfirmUsableEmptyConfig(t *testing.T) { config := clientcmdapi.NewConfig() test := configValidationTest{ @@ -92,6 +94,7 @@ func TestConfirmUsableEmptyConfig(t *testing.T) { test.testConfirmUsable("", t) } + func TestConfirmUsableMissingConfig(t *testing.T) { config := clientcmdapi.NewConfig() test := configValidationTest{ @@ -101,6 +104,7 @@ func TestConfirmUsableMissingConfig(t *testing.T) { test.testConfirmUsable("not-here", t) } + func TestValidateEmptyConfig(t *testing.T) { config := clientcmdapi.NewConfig() test := configValidationTest{ @@ -110,6 +114,7 @@ func TestValidateEmptyConfig(t *testing.T) { test.testConfig(t) } + func TestValidateMissingCurrentContextConfig(t *testing.T) { config := clientcmdapi.NewConfig() config.CurrentContext = "anything" @@ -120,6 +125,7 @@ func TestValidateMissingCurrentContextConfig(t *testing.T) { test.testConfig(t) } + func TestIsContextNotFound(t *testing.T) { config := clientcmdapi.NewConfig() config.CurrentContext = "anything" @@ -172,6 +178,7 @@ func TestValidateMissingReferencesConfig(t *testing.T) { test.testContext("anything", t) test.testConfig(t) } + func TestValidateEmptyContext(t *testing.T) { config := clientcmdapi.NewConfig() config.CurrentContext = "anything" @@ -185,6 +192,19 @@ func TestValidateEmptyContext(t *testing.T) { test.testConfig(t) } +func TestValidateEmptyContextName(t *testing.T) { + config := clientcmdapi.NewConfig() + config.CurrentContext = "anything" + config.Contexts[""] = &clientcmdapi.Context{Cluster: "missing", AuthInfo: "missing"} + test := configValidationTest{ + config: config, + expectedErrorSubstring: []string{"empty context name", "is not allowed"}, + } + + test.testContext("", t) + test.testConfig(t) +} + func TestValidateEmptyClusterInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["empty"] = clientcmdapi.NewCluster() @@ -223,6 +243,7 @@ func TestValidateMissingCAFileClusterInfo(t *testing.T) { test.testCluster("missing ca", t) test.testConfig(t) } + func TestValidateCleanClusterInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ @@ -235,6 +256,7 @@ func TestValidateCleanClusterInfo(t *testing.T) { test.testCluster("clean", t) test.testConfig(t) } + func TestValidateCleanWithCAClusterInfo(t *testing.T) { tempFile, _ := ioutil.TempFile("", "") defer os.Remove(tempFile.Name()) @@ -262,6 +284,7 @@ func TestValidateEmptyAuthInfo(t *testing.T) { test.testAuthInfo("error", t) test.testConfig(t) } + func TestValidateCertFilesNotFoundAuthInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["error"] = &clientcmdapi.AuthInfo{ @@ -276,6 +299,7 @@ func TestValidateCertFilesNotFoundAuthInfo(t *testing.T) { test.testAuthInfo("error", t) test.testConfig(t) } + func TestValidateCertDataOverridesFiles(t *testing.T) { tempFile, _ := ioutil.TempFile("", "") defer os.Remove(tempFile.Name()) @@ -295,6 +319,7 @@ func TestValidateCertDataOverridesFiles(t *testing.T) { test.testAuthInfo("clean", t) test.testConfig(t) } + func TestValidateCleanCertFilesAuthInfo(t *testing.T) { tempFile, _ := ioutil.TempFile("", "") defer os.Remove(tempFile.Name()) @@ -311,6 +336,7 @@ func TestValidateCleanCertFilesAuthInfo(t *testing.T) { test.testAuthInfo("clean", t) test.testConfig(t) } + func TestValidateCleanTokenAuthInfo(t *testing.T) { config := clientcmdapi.NewConfig() config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ @@ -339,6 +365,106 @@ func TestValidateMultipleMethodsAuthInfo(t *testing.T) { test.testConfig(t) } +func TestValidateAuthInfoExec(t *testing.T) { + config := clientcmdapi.NewConfig() + config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ + Exec: &clientcmdapi.ExecConfig{ + Command: "/bin/example", + APIVersion: "clientauthentication.k8s.io/v1alpha1", + Args: []string{"hello", "world"}, + Env: []clientcmdapi.ExecEnvVar{ + {Name: "foo", Value: "bar"}, + }, + }, + } + test := configValidationTest{ + config: config, + } + + test.testAuthInfo("user", t) + test.testConfig(t) +} + +func TestValidateAuthInfoExecNoVersion(t *testing.T) { + config := clientcmdapi.NewConfig() + config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ + Exec: &clientcmdapi.ExecConfig{ + Command: "/bin/example", + }, + } + test := configValidationTest{ + config: config, + expectedErrorSubstring: []string{ + "apiVersion must be specified for user to use exec authentication plugin", + }, + } + + test.testAuthInfo("user", t) + test.testConfig(t) +} + +func TestValidateAuthInfoExecNoCommand(t *testing.T) { + config := clientcmdapi.NewConfig() + config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ + Exec: &clientcmdapi.ExecConfig{ + APIVersion: "clientauthentication.k8s.io/v1alpha1", + }, + } + test := configValidationTest{ + config: config, + expectedErrorSubstring: []string{ + "command must be specified for user to use exec authentication plugin", + }, + } + + test.testAuthInfo("user", t) + test.testConfig(t) +} + +func TestValidateAuthInfoExecWithAuthProvider(t *testing.T) { + config := clientcmdapi.NewConfig() + config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ + AuthProvider: &clientcmdapi.AuthProviderConfig{ + Name: "oidc", + }, + Exec: &clientcmdapi.ExecConfig{ + Command: "/bin/example", + APIVersion: "clientauthentication.k8s.io/v1alpha1", + }, + } + test := configValidationTest{ + config: config, + expectedErrorSubstring: []string{ + "authProvider cannot be provided in combination with an exec plugin for user", + }, + } + + test.testAuthInfo("user", t) + test.testConfig(t) +} + +func TestValidateAuthInfoExecInvalidEnv(t *testing.T) { + config := clientcmdapi.NewConfig() + config.AuthInfos["user"] = &clientcmdapi.AuthInfo{ + Exec: &clientcmdapi.ExecConfig{ + Command: "/bin/example", + APIVersion: "clientauthentication.k8s.io/v1alpha1", + Env: []clientcmdapi.ExecEnvVar{ + {Name: "foo"}, // No value + }, + }, + } + test := configValidationTest{ + config: config, + expectedErrorSubstring: []string{ + "env variable foo value must be specified for user to use exec authentication plugin", + }, + } + + test.testAuthInfo("user", t) + test.testConfig(t) +} + type configValidationTest struct { config *clientcmdapi.Config expectedErrorSubstring []string @@ -363,6 +489,7 @@ func (c configValidationTest) testContext(contextName string, t *testing.T) { } } } + func (c configValidationTest) testConfirmUsable(contextName string, t *testing.T) { err := ConfirmUsable(*c.config, contextName) @@ -382,6 +509,7 @@ func (c configValidationTest) testConfirmUsable(contextName string, t *testing.T } } } + func (c configValidationTest) testConfig(t *testing.T) { err := Validate(*c.config) @@ -404,6 +532,7 @@ func (c configValidationTest) testConfig(t *testing.T) { } } } + func (c configValidationTest) testCluster(clusterName string, t *testing.T) { errs := validateClusterInfo(clusterName, *c.config.Clusters[clusterName]) diff --git a/vendor/k8s.io/client-go/tools/leaderelection/BUILD b/vendor/k8s.io/client-go/tools/leaderelection/BUILD index 5ea32efdeb..22e020d8c7 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/BUILD +++ b/vendor/k8s.io/client-go/tools/leaderelection/BUILD @@ -23,8 +23,7 @@ go_library( go_test( name = "go_default_test", srcs = ["leaderelection_test.go"], - importpath = "k8s.io/client-go/tools/leaderelection", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", diff --git a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go index 2ce546bc42..e41b420c98 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go @@ -171,11 +171,11 @@ func (le *LeaderElector) IsLeader() bool { // acquire loops calling tryAcquireOrRenew and returns immediately when tryAcquireOrRenew succeeds. func (le *LeaderElector) acquire() { stop := make(chan struct{}) - glog.Infof("attempting to acquire leader lease...") + desc := le.config.Lock.Describe() + glog.Infof("attempting to acquire leader lease %v...", desc) wait.JitterUntil(func() { succeeded := le.tryAcquireOrRenew() le.maybeReportTransition() - desc := le.config.Lock.Describe() if !succeeded { glog.V(4).Infof("failed to acquire lease %v", desc) return diff --git a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go index 5e58646316..e99cf57afb 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go @@ -260,7 +260,7 @@ func testTryAcquireOrRenew(t *testing.T, objectType string) { } if test.expectSuccess != le.tryAcquireOrRenew() { - t.Errorf("[%v]unexpected result of tryAcquireOrRenew: [succeded=%v]", i, !test.expectSuccess) + t.Errorf("[%v]unexpected result of tryAcquireOrRenew: [succeeded=%v]", i, !test.expectSuccess) } le.observedRecord.AcquireTime = metav1.Time{} diff --git a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go index 69e8c5a7a0..4ff5956037 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go @@ -32,15 +32,15 @@ import ( // data we will likely move to deprecate the Endpoints lock. type ConfigMapLock struct { - // ConfigMapMeta should contain a Name and a Namespace of an - // ConfigMapMeta object that the Leadercmlector will attempt to lead. + // ConfigMapMeta should contain a Name and a Namespace of a + // ConfigMapMeta object that the LeaderElector will attempt to lead. ConfigMapMeta metav1.ObjectMeta Client corev1client.ConfigMapsGetter LockConfig ResourceLockConfig cm *v1.ConfigMap } -// Get returns the cmlection record from a ConfigMap Annotation +// Get returns the election record from a ConfigMap Annotation func (cml *ConfigMapLock) Get() (*LeaderElectionRecord, error) { var record LeaderElectionRecord var err error @@ -59,7 +59,7 @@ func (cml *ConfigMapLock) Get() (*LeaderElectionRecord, error) { return &record, nil } -// Create attempts to create a LeadercmlectionRecord annotation +// Create attempts to create a LeaderElectionRecord annotation func (cml *ConfigMapLock) Create(ler LeaderElectionRecord) error { recordBytes, err := json.Marshal(ler) if err != nil { @@ -77,7 +77,7 @@ func (cml *ConfigMapLock) Create(ler LeaderElectionRecord) error { return err } -// Update will update and existing annotation on a given resource. +// Update will update an existing annotation on a given resource. func (cml *ConfigMapLock) Update(ler LeaderElectionRecord) error { if cml.cm == nil { return errors.New("endpoint not initialized, call get or create first") @@ -91,7 +91,7 @@ func (cml *ConfigMapLock) Update(ler LeaderElectionRecord) error { return err } -// RecordEvent in leader cmlection while adding meta-data +// RecordEvent in leader election while adding meta-data func (cml *ConfigMapLock) RecordEvent(s string) { events := fmt.Sprintf("%v %v", cml.LockConfig.Identity, s) cml.LockConfig.EventRecorder.Eventf(&v1.ConfigMap{ObjectMeta: cml.cm.ObjectMeta}, v1.EventTypeNormal, "LeaderElection", events) diff --git a/vendor/k8s.io/client-go/tools/pager/BUILD b/vendor/k8s.io/client-go/tools/pager/BUILD index c4a2d4d1ca..4d07429af8 100644 --- a/vendor/k8s.io/client-go/tools/pager/BUILD +++ b/vendor/k8s.io/client-go/tools/pager/BUILD @@ -37,14 +37,13 @@ filegroup( go_test( name = "go_default_test", srcs = ["pager_test.go"], - importpath = "k8s.io/client-go/tools/pager", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1alpha1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", ], ) diff --git a/vendor/k8s.io/client-go/tools/pager/pager_test.go b/vendor/k8s.io/client-go/tools/pager/pager_test.go index 6e3e9444ab..b905fc1fb6 100644 --- a/vendor/k8s.io/client-go/tools/pager/pager_test.go +++ b/vendor/k8s.io/client-go/tools/pager/pager_test.go @@ -25,14 +25,14 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1alpha1 "k8s.io/apimachinery/pkg/apis/meta/v1alpha1" + metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/runtime" ) func list(count int, rv string) *metainternalversion.List { var list metainternalversion.List for i := 0; i < count; i++ { - list.Items = append(list.Items, &metav1alpha1.PartialObjectMetadata{ + list.Items = append(list.Items, &metav1beta1.PartialObjectMetadata{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%d", i), }, @@ -80,7 +80,7 @@ func (p *testPager) PagedList(ctx context.Context, options metav1.ListOptions) ( if p.remaining <= 0 { break } - list.Items = append(list.Items, &metav1alpha1.PartialObjectMetadata{ + list.Items = append(list.Items, &metav1beta1.PartialObjectMetadata{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%d", p.index), }, diff --git a/vendor/k8s.io/client-go/tools/portforward/BUILD b/vendor/k8s.io/client-go/tools/portforward/BUILD index 1232b7ebb3..e2fb01e737 100644 --- a/vendor/k8s.io/client-go/tools/portforward/BUILD +++ b/vendor/k8s.io/client-go/tools/portforward/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["portforward_test.go"], - importpath = "k8s.io/client-go/tools/portforward", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apimachinery/pkg/util/httpstream:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/tools/portforward/portforward.go b/vendor/k8s.io/client-go/tools/portforward/portforward.go index 24737b9a7a..9d7936e7c5 100644 --- a/vendor/k8s.io/client-go/tools/portforward/portforward.go +++ b/vendor/k8s.io/client-go/tools/portforward/portforward.go @@ -185,7 +185,7 @@ func (pf *PortForwarder) forward() error { // If both listener creation fail, an error is raised. func (pf *PortForwarder) listenOnPort(port *ForwardedPort) error { errTcp4 := pf.listenOnPortAndAddress(port, "tcp4", "127.0.0.1") - errTcp6 := pf.listenOnPortAndAddress(port, "tcp6", "[::1]") + errTcp6 := pf.listenOnPortAndAddress(port, "tcp6", "::1") if errTcp4 != nil && errTcp6 != nil { return fmt.Errorf("All listeners failed to create with the following errors: %s, %s", errTcp4, errTcp6) } @@ -220,7 +220,7 @@ func (pf *PortForwarder) getListener(protocol string, hostname string, port *For } port.Local = uint16(localPortUInt) if pf.out != nil { - fmt.Fprintf(pf.out, "Forwarding from %s:%d -> %d\n", hostname, localPortUInt, port.Remote) + fmt.Fprintf(pf.out, "Forwarding from %s -> %d\n", net.JoinHostPort(hostname, strconv.Itoa(int(localPortUInt))), port.Remote) } return listener, nil diff --git a/vendor/k8s.io/client-go/tools/portforward/portforward_test.go b/vendor/k8s.io/client-go/tools/portforward/portforward_test.go index ab705849c8..2abbf16f29 100644 --- a/vendor/k8s.io/client-go/tools/portforward/portforward_test.go +++ b/vendor/k8s.io/client-go/tools/portforward/portforward_test.go @@ -179,7 +179,7 @@ func TestGetListener(t *testing.T) { t.Errorf("Test case #%d failed: Listener does not listen on expected address: asked '%v' got '%v'", i, testCase.ExpectedListenerAddress, host) } if port != expectedListenerPort { - t.Errorf("Test case #%d failed: Listener does not listen on exepected port: asked %v got %v", i, expectedListenerPort, port) + t.Errorf("Test case #%d failed: Listener does not listen on expected port: asked %v got %v", i, expectedListenerPort, port) } listener.Close() diff --git a/vendor/k8s.io/client-go/tools/record/BUILD b/vendor/k8s.io/client-go/tools/record/BUILD index f89aa3e289..0799afe7ea 100644 --- a/vendor/k8s.io/client-go/tools/record/BUILD +++ b/vendor/k8s.io/client-go/tools/record/BUILD @@ -12,8 +12,7 @@ go_test( "event_test.go", "events_cache_test.go", ], - importpath = "k8s.io/client-go/tools/record", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", diff --git a/vendor/k8s.io/client-go/tools/remotecommand/BUILD b/vendor/k8s.io/client-go/tools/remotecommand/BUILD index e665af3f4d..b30c122c34 100644 --- a/vendor/k8s.io/client-go/tools/remotecommand/BUILD +++ b/vendor/k8s.io/client-go/tools/remotecommand/BUILD @@ -12,8 +12,7 @@ go_test( "v2_test.go", "v4_test.go", ], - importpath = "k8s.io/client-go/tools/remotecommand", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/httpstream:go_default_library", diff --git a/vendor/k8s.io/client-go/transport/BUILD b/vendor/k8s.io/client-go/transport/BUILD index 91c3831b23..71494544a6 100644 --- a/vendor/k8s.io/client-go/transport/BUILD +++ b/vendor/k8s.io/client-go/transport/BUILD @@ -13,8 +13,7 @@ go_test( "round_trippers_test.go", "transport_test.go", ], - importpath = "k8s.io/client-go/transport", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( @@ -28,9 +27,6 @@ go_library( importpath = "k8s.io/client-go/transport", deps = [ "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/gregjones/httpcache:go_default_library", - "//vendor/github.com/gregjones/httpcache/diskcache:go_default_library", - "//vendor/github.com/peterbourgon/diskv:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", ], ) diff --git a/vendor/k8s.io/client-go/transport/cache.go b/vendor/k8s.io/client-go/transport/cache.go index da22cdee59..7c40848c79 100644 --- a/vendor/k8s.io/client-go/transport/cache.go +++ b/vendor/k8s.io/client-go/transport/cache.go @@ -31,12 +31,28 @@ import ( // the config has no custom TLS options, http.DefaultTransport is returned. type tlsTransportCache struct { mu sync.Mutex - transports map[string]*http.Transport + transports map[tlsCacheKey]*http.Transport } const idleConnsPerHost = 25 -var tlsCache = &tlsTransportCache{transports: make(map[string]*http.Transport)} +var tlsCache = &tlsTransportCache{transports: make(map[tlsCacheKey]*http.Transport)} + +type tlsCacheKey struct { + insecure bool + caData string + certData string + keyData string + serverName string +} + +func (t tlsCacheKey) String() string { + keyText := "" + if len(t.keyData) > 0 { + keyText = "" + } + return fmt.Sprintf("insecure:%v, caData:%#v, certData:%#v, keyData:%s, serverName:%s", t.insecure, t.caData, t.certData, keyText, t.serverName) +} func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) { key, err := tlsConfigKey(config) @@ -82,11 +98,16 @@ func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) { } // tlsConfigKey returns a unique key for tls.Config objects returned from TLSConfigFor -func tlsConfigKey(c *Config) (string, error) { +func tlsConfigKey(c *Config) (tlsCacheKey, error) { // Make sure ca/key/cert content is loaded if err := loadTLSFiles(c); err != nil { - return "", err + return tlsCacheKey{}, err } - // Only include the things that actually affect the tls.Config - return fmt.Sprintf("%v/%x/%x/%x/%v", c.TLS.Insecure, c.TLS.CAData, c.TLS.CertData, c.TLS.KeyData, c.TLS.ServerName), nil + return tlsCacheKey{ + insecure: c.TLS.Insecure, + caData: string(c.TLS.CAData), + certData: string(c.TLS.CertData), + keyData: string(c.TLS.KeyData), + serverName: c.TLS.ServerName, + }, nil } diff --git a/vendor/k8s.io/client-go/transport/config.go b/vendor/k8s.io/client-go/transport/config.go index 425f8f87a5..af347dafea 100644 --- a/vendor/k8s.io/client-go/transport/config.go +++ b/vendor/k8s.io/client-go/transport/config.go @@ -37,10 +37,6 @@ type Config struct { // Bearer token for authentication BearerToken string - // CacheDir is the directory where we'll store HTTP cached responses. - // If set to empty string, no caching mechanism will be used. - CacheDir string - // Impersonate is the config that this Config will impersonate using Impersonate ImpersonationConfig diff --git a/vendor/k8s.io/client-go/transport/round_trippers.go b/vendor/k8s.io/client-go/transport/round_trippers.go index 2ee605d7be..c728b18775 100644 --- a/vendor/k8s.io/client-go/transport/round_trippers.go +++ b/vendor/k8s.io/client-go/transport/round_trippers.go @@ -19,14 +19,10 @@ package transport import ( "fmt" "net/http" - "path/filepath" "strings" "time" "github.com/golang/glog" - "github.com/gregjones/httpcache" - "github.com/gregjones/httpcache/diskcache" - "github.com/peterbourgon/diskv" utilnet "k8s.io/apimachinery/pkg/util/net" ) @@ -60,9 +56,6 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip len(config.Impersonate.Extra) > 0 { rt = NewImpersonatingRoundTripper(config.Impersonate, rt) } - if len(config.CacheDir) > 0 { - rt = NewCacheRoundTripper(config.CacheDir, rt) - } return rt, nil } @@ -86,30 +79,6 @@ type requestCanceler interface { CancelRequest(*http.Request) } -type cacheRoundTripper struct { - rt *httpcache.Transport -} - -// NewCacheRoundTripper creates a roundtripper that reads the ETag on -// response headers and send the If-None-Match header on subsequent -// corresponding requests. -func NewCacheRoundTripper(cacheDir string, rt http.RoundTripper) http.RoundTripper { - d := diskv.New(diskv.Options{ - BasePath: cacheDir, - TempDir: filepath.Join(cacheDir, ".diskv-temp"), - }) - t := httpcache.NewTransport(diskcache.NewWithDiskv(d)) - t.Transport = rt - - return &cacheRoundTripper{rt: t} -} - -func (rt *cacheRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - return rt.rt.RoundTrip(req) -} - -func (rt *cacheRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt.Transport } - type authProxyRoundTripper struct { username string groups []string diff --git a/vendor/k8s.io/client-go/transport/round_trippers_test.go b/vendor/k8s.io/client-go/transport/round_trippers_test.go index c1e30c3f20..d5ffc6bde3 100644 --- a/vendor/k8s.io/client-go/transport/round_trippers_test.go +++ b/vendor/k8s.io/client-go/transport/round_trippers_test.go @@ -17,11 +17,7 @@ limitations under the License. package transport import ( - "bytes" - "io/ioutil" "net/http" - "net/url" - "os" "reflect" "strings" "testing" @@ -220,60 +216,3 @@ func TestAuthProxyRoundTripper(t *testing.T) { } } } - -func TestCacheRoundTripper(t *testing.T) { - rt := &testRoundTripper{} - cacheDir, err := ioutil.TempDir("", "cache-rt") - defer os.RemoveAll(cacheDir) - if err != nil { - t.Fatal(err) - } - cache := NewCacheRoundTripper(cacheDir, rt) - - // First call, caches the response - req := &http.Request{ - Method: http.MethodGet, - URL: &url.URL{Host: "localhost"}, - } - rt.Response = &http.Response{ - Header: http.Header{"ETag": []string{`"123456"`}}, - Body: ioutil.NopCloser(bytes.NewReader([]byte("Content"))), - StatusCode: http.StatusOK, - } - resp, err := cache.RoundTrip(req) - if err != nil { - t.Fatal(err) - } - content, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - if string(content) != "Content" { - t.Errorf(`Expected Body to be "Content", got %q`, string(content)) - } - - // Second call, returns cached response - req = &http.Request{ - Method: http.MethodGet, - URL: &url.URL{Host: "localhost"}, - } - rt.Response = &http.Response{ - StatusCode: http.StatusNotModified, - Body: ioutil.NopCloser(bytes.NewReader([]byte("Other Content"))), - } - - resp, err = cache.RoundTrip(req) - if err != nil { - t.Fatal(err) - } - - // Read body and make sure we have the initial content - content, err = ioutil.ReadAll(resp.Body) - resp.Body.Close() - if err != nil { - t.Fatal(err) - } - if string(content) != "Content" { - t.Errorf("Invalid content read from cache %q", string(content)) - } -} diff --git a/vendor/k8s.io/client-go/util/buffer/BUILD b/vendor/k8s.io/client-go/util/buffer/BUILD index b5629d5cb9..d3b2652cee 100644 --- a/vendor/k8s.io/client-go/util/buffer/BUILD +++ b/vendor/k8s.io/client-go/util/buffer/BUILD @@ -10,8 +10,7 @@ go_library( go_test( name = "go_default_test", srcs = ["ring_growing_test.go"], - importpath = "k8s.io/client-go/util/buffer", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/github.com/stretchr/testify/assert:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/util/cert/BUILD b/vendor/k8s.io/client-go/util/cert/BUILD index 93ca7c9c6c..799979d46b 100644 --- a/vendor/k8s.io/client-go/util/cert/BUILD +++ b/vendor/k8s.io/client-go/util/cert/BUILD @@ -13,8 +13,7 @@ go_test( "pem_test.go", ], data = glob(["testdata/**"]), - importpath = "k8s.io/client-go/util/cert", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/util/cert/cert.go b/vendor/k8s.io/client-go/util/cert/cert.go index 6854d4152f..fb7f5facc7 100644 --- a/vendor/k8s.io/client-go/util/cert/cert.go +++ b/vendor/k8s.io/client-go/util/cert/cert.go @@ -38,7 +38,7 @@ const ( duration365d = time.Hour * 24 * 365 ) -// Config containes the basic fields required for creating a certificate +// Config contains the basic fields required for creating a certificate type Config struct { CommonName string Organization []string @@ -138,23 +138,50 @@ func MakeEllipticPrivateKeyPEM() ([]byte, error) { // Host may be an IP or a DNS name // You may also specify additional subject alt names (either ip or dns names) for the certificate func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS []string) ([]byte, []byte, error) { + caKey, err := rsa.GenerateKey(cryptorand.Reader, 2048) + if err != nil { + return nil, nil, err + } + + caTemplate := x509.Certificate{ + SerialNumber: big.NewInt(1), + Subject: pkix.Name{ + CommonName: fmt.Sprintf("%s-ca@%d", host, time.Now().Unix()), + }, + NotBefore: time.Now(), + NotAfter: time.Now().Add(time.Hour * 24 * 365), + + KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, + BasicConstraintsValid: true, + IsCA: true, + } + + caDERBytes, err := x509.CreateCertificate(cryptorand.Reader, &caTemplate, &caTemplate, &caKey.PublicKey, caKey) + if err != nil { + return nil, nil, err + } + + caCertificate, err := x509.ParseCertificate(caDERBytes) + if err != nil { + return nil, nil, err + } + priv, err := rsa.GenerateKey(cryptorand.Reader, 2048) if err != nil { return nil, nil, err } template := x509.Certificate{ - SerialNumber: big.NewInt(1), + SerialNumber: big.NewInt(2), Subject: pkix.Name{ CommonName: fmt.Sprintf("%s@%d", host, time.Now().Unix()), }, NotBefore: time.Now(), NotAfter: time.Now().Add(time.Hour * 24 * 365), - KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, + KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, BasicConstraintsValid: true, - IsCA: true, } if ip := net.ParseIP(host); ip != nil { @@ -166,16 +193,19 @@ func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS template.IPAddresses = append(template.IPAddresses, alternateIPs...) template.DNSNames = append(template.DNSNames, alternateDNS...) - derBytes, err := x509.CreateCertificate(cryptorand.Reader, &template, &template, &priv.PublicKey, priv) + derBytes, err := x509.CreateCertificate(cryptorand.Reader, &template, caCertificate, &priv.PublicKey, caKey) if err != nil { return nil, nil, err } - // Generate cert + // Generate cert, followed by ca certBuffer := bytes.Buffer{} if err := pem.Encode(&certBuffer, &pem.Block{Type: CertificateBlockType, Bytes: derBytes}); err != nil { return nil, nil, err } + if err := pem.Encode(&certBuffer, &pem.Block{Type: CertificateBlockType, Bytes: caDERBytes}); err != nil { + return nil, nil, err + } // Generate key keyBuffer := bytes.Buffer{} diff --git a/vendor/k8s.io/client-go/util/certificate/BUILD b/vendor/k8s.io/client-go/util/certificate/BUILD index f10a2d9e21..dfc5c39335 100644 --- a/vendor/k8s.io/client-go/util/certificate/BUILD +++ b/vendor/k8s.io/client-go/util/certificate/BUILD @@ -14,8 +14,7 @@ go_test( "certificate_manager_test.go", "certificate_store_test.go", ], - importpath = "k8s.io/client-go/util/certificate", - library = ":go_default_library", + embed = [":go_default_library"], tags = ["automanaged"], deps = [ "//vendor/k8s.io/api/certificates/v1beta1:go_default_library", diff --git a/vendor/k8s.io/client-go/util/certificate/certificate_manager.go b/vendor/k8s.io/client-go/util/certificate/certificate_manager.go index 7ea05ba794..e189c84799 100644 --- a/vendor/k8s.io/client-go/util/certificate/certificate_manager.go +++ b/vendor/k8s.io/client-go/util/certificate/certificate_manager.go @@ -141,7 +141,6 @@ type manager struct { certStore Store certAccessLock sync.RWMutex cert *tls.Certificate - rotationDeadline time.Time forceRotation bool certificateExpiration Gauge serverHealth bool @@ -208,8 +207,7 @@ func (m *manager) SetCertificateSigningRequestClient(certSigningRequestClient ce func (m *manager) Start() { // Certificate rotation depends on access to the API server certificate // signing API, so don't start the certificate manager if we don't have a - // client. This will happen on the cluster master, where the kubelet is - // responsible for bootstrapping the pods of the master components. + // client. if m.certSigningRequestClient == nil { glog.V(2).Infof("Certificate rotation is not enabled, no connection to the apiserver.") return @@ -217,27 +215,18 @@ func (m *manager) Start() { glog.V(2).Infof("Certificate rotation is enabled.") - m.setRotationDeadline() - - // Synchronously request a certificate before entering the background - // loop to allow bootstrap scenarios, where the certificate manager - // doesn't have a certificate at all yet. - if m.shouldRotate() { - glog.V(1).Infof("shouldRotate() is true, forcing immediate rotation") - if _, err := m.rotateCerts(); err != nil { - utilruntime.HandleError(fmt.Errorf("Could not rotate certificates: %v", err)) - } - } - backoff := wait.Backoff{ - Duration: 2 * time.Second, - Factor: 2, - Jitter: 0.1, - Steps: 5, - } go wait.Forever(func() { - sleepInterval := m.rotationDeadline.Sub(time.Now()) - glog.V(2).Infof("Waiting %v for next certificate rotation", sleepInterval) - time.Sleep(sleepInterval) + deadline := m.nextRotationDeadline() + if sleepInterval := deadline.Sub(time.Now()); sleepInterval > 0 { + glog.V(2).Infof("Waiting %v for next certificate rotation", sleepInterval) + time.Sleep(sleepInterval) + } + backoff := wait.Backoff{ + Duration: 2 * time.Second, + Factor: 2, + Jitter: 0.1, + Steps: 5, + } if err := wait.ExponentialBackoff(backoff, m.rotateCerts); err != nil { utilruntime.HandleError(fmt.Errorf("Reached backoff limit, still unable to rotate certs: %v", err)) wait.PollInfinite(32*time.Second, m.rotateCerts) @@ -252,11 +241,14 @@ func getCurrentCertificateOrBootstrap( currentCert, err := store.Current() if err == nil { - return currentCert, false, nil - } - - if _, ok := err.(*NoCertKeyError); !ok { - return nil, false, err + // if the current cert is expired, fall back to the bootstrap cert + if currentCert.Leaf != nil && time.Now().Before(currentCert.Leaf.NotAfter) { + return currentCert, false, nil + } + } else { + if _, ok := err.(*NoCertKeyError); !ok { + return nil, false, err + } } if bootstrapCertificatePEM == nil || bootstrapKeyPEM == nil { @@ -276,21 +268,14 @@ func getCurrentCertificateOrBootstrap( return nil, false, fmt.Errorf("unable to parse certificate data: %v", err) } bootstrapCert.Leaf = certs[0] - return &bootstrapCert, true, nil -} -// shouldRotate looks at how close the current certificate is to expiring and -// decides if it is time to rotate or not. -func (m *manager) shouldRotate() bool { - m.certAccessLock.RLock() - defer m.certAccessLock.RUnlock() - if m.cert == nil { - return true - } - if m.forceRotation { - return true + if _, err := store.Update(bootstrapCertificatePEM, bootstrapKeyPEM); err != nil { + utilruntime.HandleError(fmt.Errorf("Unable to set the cert/key pair to the bootstrap certificate: %v", err)) + } else { + glog.V(4).Infof("Updated the store to contain the initial bootstrap certificate") } - return time.Now().After(m.rotationDeadline) + + return &bootstrapCert, true, nil } // rotateCerts attempts to request a client cert from the server, wait a reasonable @@ -315,7 +300,7 @@ func (m *manager) rotateCerts() (bool, error) { return false, m.updateServerError(err) } - // Wait for the certificate to be signed. Instead of one long watch, we retry with slighly longer + // Wait for the certificate to be signed. Instead of one long watch, we retry with slightly longer // intervals each time in order to tolerate failures from the server AND to preserve the liveliness // of the cert manager loop. This creates slightly more traffic against the API server in return // for bounding the amount of time we wait when a certificate expires. @@ -349,30 +334,34 @@ func (m *manager) rotateCerts() (bool, error) { } m.updateCached(cert) - m.setRotationDeadline() - m.forceRotation = false return true, nil } -// setRotationDeadline sets a cached value for the threshold at which the +// nextRotationDeadline returns a value for the threshold at which the // current certificate should be rotated, 80%+/-10% of the expiration of the // certificate. -func (m *manager) setRotationDeadline() { +func (m *manager) nextRotationDeadline() time.Time { + // forceRotation is not protected by locks + if m.forceRotation { + m.forceRotation = false + return time.Now() + } + m.certAccessLock.RLock() defer m.certAccessLock.RUnlock() if m.cert == nil { - m.rotationDeadline = time.Now() - return + return time.Now() } notAfter := m.cert.Leaf.NotAfter totalDuration := float64(notAfter.Sub(m.cert.Leaf.NotBefore)) + deadline := m.cert.Leaf.NotBefore.Add(jitteryDuration(totalDuration)) - m.rotationDeadline = m.cert.Leaf.NotBefore.Add(jitteryDuration(totalDuration)) - glog.V(2).Infof("Certificate expiration is %v, rotation deadline is %v", notAfter, m.rotationDeadline) + glog.V(2).Infof("Certificate expiration is %v, rotation deadline is %v", notAfter, deadline) if m.certificateExpiration != nil { m.certificateExpiration.Set(float64(notAfter.Unix())) } + return deadline } // jitteryDuration uses some jitter to set the rotation threshold so each node diff --git a/vendor/k8s.io/client-go/util/certificate/certificate_manager_test.go b/vendor/k8s.io/client-go/util/certificate/certificate_manager_test.go index ab19e37b12..6a23f04260 100644 --- a/vendor/k8s.io/client-go/util/certificate/certificate_manager_test.go +++ b/vendor/k8s.io/client-go/util/certificate/certificate_manager_test.go @@ -146,46 +146,6 @@ func TestNewManagerNoRotation(t *testing.T) { } } -func TestShouldRotate(t *testing.T) { - now := time.Now() - tests := []struct { - name string - notBefore time.Time - notAfter time.Time - shouldRotate bool - }{ - {"just issued, still good", now.Add(-1 * time.Hour), now.Add(99 * time.Hour), false}, - {"half way expired, still good", now.Add(-24 * time.Hour), now.Add(24 * time.Hour), false}, - {"mostly expired, still good", now.Add(-69 * time.Hour), now.Add(31 * time.Hour), false}, - {"just about expired, should rotate", now.Add(-91 * time.Hour), now.Add(9 * time.Hour), true}, - {"nearly expired, should rotate", now.Add(-99 * time.Hour), now.Add(1 * time.Hour), true}, - {"already expired, should rotate", now.Add(-10 * time.Hour), now.Add(-1 * time.Hour), true}, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - m := manager{ - cert: &tls.Certificate{ - Leaf: &x509.Certificate{ - NotBefore: test.notBefore, - NotAfter: test.notAfter, - }, - }, - template: &x509.CertificateRequest{}, - usages: []certificates.KeyUsage{}, - } - m.setRotationDeadline() - if m.shouldRotate() != test.shouldRotate { - t.Errorf("Time %v, a certificate issued for (%v, %v) should rotate should be %t.", - now, - m.cert.Leaf.NotBefore, - m.cert.Leaf.NotAfter, - test.shouldRotate) - } - }) - } -} - type gaugeMock struct { calls int lastValue float64 @@ -233,20 +193,20 @@ func TestSetRotationDeadline(t *testing.T) { jitteryDuration = func(float64) time.Duration { return time.Duration(float64(tc.notAfter.Sub(tc.notBefore)) * 0.7) } lowerBound := tc.notBefore.Add(time.Duration(float64(tc.notAfter.Sub(tc.notBefore)) * 0.7)) - m.setRotationDeadline() + deadline := m.nextRotationDeadline() - if !m.rotationDeadline.Equal(lowerBound) { + if !deadline.Equal(lowerBound) { t.Errorf("For notBefore %v, notAfter %v, the rotationDeadline %v should be %v.", tc.notBefore, tc.notAfter, - m.rotationDeadline, + deadline, lowerBound) } if g.calls != 1 { t.Errorf("%d metrics were recorded, wanted %d", g.calls, 1) } if g.lastValue != float64(tc.notAfter.Unix()) { - t.Errorf("%d value for metric was recorded, wanted %d", g.lastValue, tc.notAfter.Unix()) + t.Errorf("%f value for metric was recorded, wanted %d", g.lastValue, tc.notAfter.Unix()) } }) } @@ -321,7 +281,7 @@ func TestNewManagerBootstrap(t *testing.T) { } if m, ok := cm.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") - } else if !m.shouldRotate() { + } else if !m.forceRotation { t.Errorf("Expected rotation should happen during bootstrap, but it won't.") } } @@ -360,9 +320,8 @@ func TestNewManagerNoBootstrap(t *testing.T) { if m, ok := cm.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") } else { - m.setRotationDeadline() - if m.shouldRotate() { - t.Errorf("Expected rotation should happen during bootstrap, but it won't.") + if m.forceRotation { + t.Errorf("Expected rotation should not happen during bootstrap, but it won't.") } } } @@ -515,8 +474,7 @@ func TestInitializeCertificateSigningRequestClient(t *testing.T) { if m, ok := certificateManager.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") } else { - m.setRotationDeadline() - if m.shouldRotate() { + if m.forceRotation { if success, err := m.rotateCerts(); !success { t.Errorf("Got failure from 'rotateCerts', wanted success.") } else if err != nil { @@ -614,8 +572,7 @@ func TestInitializeOtherRESTClients(t *testing.T) { if m, ok := certificateManager.(*manager); !ok { t.Errorf("Expected a '*manager' from 'NewManager'") } else { - m.setRotationDeadline() - if m.shouldRotate() { + if m.forceRotation { success, err := certificateManager.(*manager).rotateCerts() if err != nil { t.Errorf("Got error %v, expected none.", err) diff --git a/vendor/k8s.io/client-go/util/certificate/csr/BUILD b/vendor/k8s.io/client-go/util/certificate/csr/BUILD index c6def5bbf0..c1bcd9578e 100644 --- a/vendor/k8s.io/client-go/util/certificate/csr/BUILD +++ b/vendor/k8s.io/client-go/util/certificate/csr/BUILD @@ -42,8 +42,7 @@ filegroup( go_test( name = "go_default_test", srcs = ["csr_test.go"], - importpath = "k8s.io/client-go/util/certificate/csr", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/api/certificates/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/k8s.io/client-go/util/flowcontrol/BUILD b/vendor/k8s.io/client-go/util/flowcontrol/BUILD index d74b3f5544..819bb7ef36 100644 --- a/vendor/k8s.io/client-go/util/flowcontrol/BUILD +++ b/vendor/k8s.io/client-go/util/flowcontrol/BUILD @@ -12,8 +12,7 @@ go_test( "backoff_test.go", "throttle_test.go", ], - importpath = "k8s.io/client-go/util/flowcontrol", - library = ":go_default_library", + embed = [":go_default_library"], deps = ["//vendor/k8s.io/apimachinery/pkg/util/clock:go_default_library"], ) @@ -25,7 +24,7 @@ go_library( ], importpath = "k8s.io/client-go/util/flowcontrol", deps = [ - "//vendor/github.com/juju/ratelimit:go_default_library", + "//vendor/golang.org/x/time/rate:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/clock:go_default_library", "//vendor/k8s.io/client-go/util/integer:go_default_library", ], diff --git a/vendor/k8s.io/client-go/util/flowcontrol/throttle.go b/vendor/k8s.io/client-go/util/flowcontrol/throttle.go index c45169c40f..e671c044d0 100644 --- a/vendor/k8s.io/client-go/util/flowcontrol/throttle.go +++ b/vendor/k8s.io/client-go/util/flowcontrol/throttle.go @@ -18,8 +18,9 @@ package flowcontrol import ( "sync" + "time" - "github.com/juju/ratelimit" + "golang.org/x/time/rate" ) type RateLimiter interface { @@ -30,17 +31,13 @@ type RateLimiter interface { Accept() // Stop stops the rate limiter, subsequent calls to CanAccept will return false Stop() - // Saturation returns a percentage number which describes how saturated - // this rate limiter is. - // Usually we use token bucket rate limiter. In that case, - // 1.0 means no tokens are available; 0.0 means we have a full bucket of tokens to use. - Saturation() float64 // QPS returns QPS of this rate limiter QPS() float32 } type tokenBucketRateLimiter struct { - limiter *ratelimit.Bucket + limiter *rate.Limiter + clock Clock qps float32 } @@ -50,42 +47,48 @@ type tokenBucketRateLimiter struct { // The bucket is initially filled with 'burst' tokens, and refills at a rate of 'qps'. // The maximum number of tokens in the bucket is capped at 'burst'. func NewTokenBucketRateLimiter(qps float32, burst int) RateLimiter { - limiter := ratelimit.NewBucketWithRate(float64(qps), int64(burst)) - return newTokenBucketRateLimiter(limiter, qps) + limiter := rate.NewLimiter(rate.Limit(qps), burst) + return newTokenBucketRateLimiter(limiter, realClock{}, qps) } // An injectable, mockable clock interface. type Clock interface { - ratelimit.Clock + Now() time.Time + Sleep(time.Duration) +} + +type realClock struct{} + +func (realClock) Now() time.Time { + return time.Now() +} +func (realClock) Sleep(d time.Duration) { + time.Sleep(d) } // NewTokenBucketRateLimiterWithClock is identical to NewTokenBucketRateLimiter // but allows an injectable clock, for testing. -func NewTokenBucketRateLimiterWithClock(qps float32, burst int, clock Clock) RateLimiter { - limiter := ratelimit.NewBucketWithRateAndClock(float64(qps), int64(burst), clock) - return newTokenBucketRateLimiter(limiter, qps) +func NewTokenBucketRateLimiterWithClock(qps float32, burst int, c Clock) RateLimiter { + limiter := rate.NewLimiter(rate.Limit(qps), burst) + return newTokenBucketRateLimiter(limiter, c, qps) } -func newTokenBucketRateLimiter(limiter *ratelimit.Bucket, qps float32) RateLimiter { +func newTokenBucketRateLimiter(limiter *rate.Limiter, c Clock, qps float32) RateLimiter { return &tokenBucketRateLimiter{ limiter: limiter, + clock: c, qps: qps, } } func (t *tokenBucketRateLimiter) TryAccept() bool { - return t.limiter.TakeAvailable(1) == 1 -} - -func (t *tokenBucketRateLimiter) Saturation() float64 { - capacity := t.limiter.Capacity() - avail := t.limiter.Available() - return float64(capacity-avail) / float64(capacity) + return t.limiter.AllowN(t.clock.Now(), 1) } // Accept will block until a token becomes available func (t *tokenBucketRateLimiter) Accept() { - t.limiter.Wait(1) + now := t.clock.Now() + t.clock.Sleep(t.limiter.ReserveN(now, 1).DelayFrom(now)) } func (t *tokenBucketRateLimiter) Stop() { @@ -105,10 +108,6 @@ func (t *fakeAlwaysRateLimiter) TryAccept() bool { return true } -func (t *fakeAlwaysRateLimiter) Saturation() float64 { - return 0 -} - func (t *fakeAlwaysRateLimiter) Stop() {} func (t *fakeAlwaysRateLimiter) Accept() {} @@ -131,10 +130,6 @@ func (t *fakeNeverRateLimiter) TryAccept() bool { return false } -func (t *fakeNeverRateLimiter) Saturation() float64 { - return 1 -} - func (t *fakeNeverRateLimiter) Stop() { t.wg.Done() } diff --git a/vendor/k8s.io/client-go/util/flowcontrol/throttle_test.go b/vendor/k8s.io/client-go/util/flowcontrol/throttle_test.go index 642020fe4b..99cf64d649 100644 --- a/vendor/k8s.io/client-go/util/flowcontrol/throttle_test.go +++ b/vendor/k8s.io/client-go/util/flowcontrol/throttle_test.go @@ -17,7 +17,6 @@ limitations under the License. package flowcontrol import ( - "math" "sync" "testing" "time" @@ -116,29 +115,6 @@ func TestThrottle(t *testing.T) { } } -func TestRateLimiterSaturation(t *testing.T) { - const e = 0.000001 - tests := []struct { - capacity int - take int - - expectedSaturation float64 - }{ - {1, 1, 1}, - {10, 3, 0.3}, - } - for i, tt := range tests { - rl := NewTokenBucketRateLimiter(1, tt.capacity) - for i := 0; i < tt.take; i++ { - rl.Accept() - } - if math.Abs(rl.Saturation()-tt.expectedSaturation) > e { - t.Fatalf("#%d: Saturation rate difference isn't within tolerable range\n want=%f, get=%f", - i, tt.expectedSaturation, rl.Saturation()) - } - } -} - func TestAlwaysFake(t *testing.T) { rl := NewFakeAlwaysRateLimiter() if !rl.TryAccept() { diff --git a/vendor/k8s.io/client-go/util/integer/BUILD b/vendor/k8s.io/client-go/util/integer/BUILD index 67f050e422..8a2105e468 100644 --- a/vendor/k8s.io/client-go/util/integer/BUILD +++ b/vendor/k8s.io/client-go/util/integer/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["integer_test.go"], - importpath = "k8s.io/client-go/util/integer", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/util/jsonpath/BUILD b/vendor/k8s.io/client-go/util/jsonpath/BUILD index 0856e29caf..ab43accd60 100644 --- a/vendor/k8s.io/client-go/util/jsonpath/BUILD +++ b/vendor/k8s.io/client-go/util/jsonpath/BUILD @@ -12,8 +12,7 @@ go_test( "jsonpath_test.go", "parser_test.go", ], - importpath = "k8s.io/client-go/util/jsonpath", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/util/jsonpath/jsonpath_test.go b/vendor/k8s.io/client-go/util/jsonpath/jsonpath_test.go index c659053226..6c7277d10a 100644 --- a/vendor/k8s.io/client-go/util/jsonpath/jsonpath_test.go +++ b/vendor/k8s.io/client-go/util/jsonpath/jsonpath_test.go @@ -190,7 +190,7 @@ func TestStructInput(t *testing.T) { {"nonexistent field", "{.hello}", storeData, "hello is not found", false}, {"invalid array", "{.Labels[0]}", storeData, "map[string]int is not array or slice", false}, {"invalid filter operator", "{.Book[?(@.Price<>10)]}", storeData, "unrecognized filter operator <>", false}, - {"redundent end", "{range .Labels.*}{@}{end}{end}", storeData, "not in range, nothing to end", false}, + {"redundant end", "{range .Labels.*}{@}{end}{end}", storeData, "not in range, nothing to end", false}, } testFailJSONPath(failStoreTests, t) } diff --git a/vendor/k8s.io/client-go/util/retry/BUILD b/vendor/k8s.io/client-go/util/retry/BUILD index 9f6f4b8488..d745813103 100644 --- a/vendor/k8s.io/client-go/util/retry/BUILD +++ b/vendor/k8s.io/client-go/util/retry/BUILD @@ -19,8 +19,7 @@ go_library( go_test( name = "go_default_test", srcs = ["util_test.go"], - importpath = "k8s.io/client-go/util/retry", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/vendor/k8s.io/client-go/util/testing/BUILD b/vendor/k8s.io/client-go/util/testing/BUILD index 1280a1ed1e..726a30f926 100644 --- a/vendor/k8s.io/client-go/util/testing/BUILD +++ b/vendor/k8s.io/client-go/util/testing/BUILD @@ -9,8 +9,7 @@ load( go_test( name = "go_default_test", srcs = ["fake_handler_test.go"], - importpath = "k8s.io/client-go/util/testing", - library = ":go_default_library", + embed = [":go_default_library"], ) go_library( diff --git a/vendor/k8s.io/client-go/util/workqueue/BUILD b/vendor/k8s.io/client-go/util/workqueue/BUILD index 2abd2f82d8..7fb9fba481 100644 --- a/vendor/k8s.io/client-go/util/workqueue/BUILD +++ b/vendor/k8s.io/client-go/util/workqueue/BUILD @@ -13,8 +13,7 @@ go_test( "delaying_queue_test.go", "rate_limitting_queue_test.go", ], - importpath = "k8s.io/client-go/util/workqueue", - library = ":go_default_library", + embed = [":go_default_library"], deps = [ "//vendor/k8s.io/apimachinery/pkg/util/clock:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", @@ -34,7 +33,7 @@ go_library( ], importpath = "k8s.io/client-go/util/workqueue", deps = [ - "//vendor/github.com/juju/ratelimit:go_default_library", + "//vendor/golang.org/x/time/rate:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/clock:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", ], @@ -43,7 +42,6 @@ go_library( go_test( name = "go_default_xtest", srcs = ["queue_test.go"], - importpath = "k8s.io/client-go/util/workqueue_test", deps = ["//vendor/k8s.io/client-go/util/workqueue:go_default_library"], ) diff --git a/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go b/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go index 35caed4fa4..a5bed29e00 100644 --- a/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go +++ b/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go @@ -21,7 +21,7 @@ import ( "sync" "time" - "github.com/juju/ratelimit" + "golang.org/x/time/rate" ) type RateLimiter interface { @@ -40,19 +40,19 @@ func DefaultControllerRateLimiter() RateLimiter { return NewMaxOfRateLimiter( NewItemExponentialFailureRateLimiter(5*time.Millisecond, 1000*time.Second), // 10 qps, 100 bucket size. This is only for retry speed and its only the overall factor (not per item) - &BucketRateLimiter{Bucket: ratelimit.NewBucketWithRate(float64(10), int64(100))}, + &BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(10), 100)}, ) } // BucketRateLimiter adapts a standard bucket to the workqueue ratelimiter API type BucketRateLimiter struct { - *ratelimit.Bucket + *rate.Limiter } var _ RateLimiter = &BucketRateLimiter{} func (r *BucketRateLimiter) When(item interface{}) time.Duration { - return r.Bucket.Take(1) + return r.Limiter.Reserve().Delay() } func (r *BucketRateLimiter) NumRequeues(item interface{}) int { diff --git a/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go b/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go index 74fefd38b7..c62ed32efa 100644 --- a/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go +++ b/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go @@ -89,7 +89,7 @@ type waitFor struct { // waitForPriorityQueue implements a priority queue for waitFor items. // -// waitForPriorityQueue implements heap.Interface. The item occuring next in +// waitForPriorityQueue implements heap.Interface. The item occurring next in // time (i.e., the item with the smallest readyAt) is at the root (index 0). // Peek returns this minimum item at index 0. Pop returns the minimum item after // it has been removed from the queue and placed at index Len()-1 by