diff --git a/staging/src/k8s.io/client-go/Godeps/Godeps.json b/staging/src/k8s.io/client-go/Godeps/Godeps.json index f23364a1d55..cc1e00b8dd1 100644 --- a/staging/src/k8s.io/client-go/Godeps/Godeps.json +++ b/staging/src/k8s.io/client-go/Godeps/Godeps.json @@ -1,7 +1,7 @@ { "ImportPath": "k8s.io/client-go", - "GoVersion": "go1.6", - "GodepVersion": "v74", + "GoVersion": "go1.7", + "GodepVersion": "v75", "Packages": [ "./..." ], @@ -177,9 +177,18 @@ "ImportPath": "github.com/pborman/uuid", "Rev": "ca53cad383cad2479bbba7f7a1a05797ec1386e4" }, + { + "ImportPath": "github.com/pmezard/go-difflib/difflib", + "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" + }, { "ImportPath": "github.com/spf13/pflag", - "Rev": "c7e63cf4530bcd3ba943729cee0efeff2ebea63f" + "Rev": "5ccb023bc27df288a957c5e994cd44fd19619465" + }, + { + "ImportPath": "github.com/stretchr/testify/assert", + "Comment": "v1.0-88-ge3a8ff8", + "Rev": "e3a8ff8ce36581f87a15341206f205b1da467059" }, { "ImportPath": "github.com/ugorji/go/codec", diff --git a/staging/src/k8s.io/client-go/_vendor/cloud.google.com/go/AUTHORS b/staging/src/k8s.io/client-go/_vendor/cloud.google.com/go/AUTHORS new file mode 100644 index 00000000000..c364af1da09 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/cloud.google.com/go/AUTHORS @@ -0,0 +1,15 @@ +# This is the official list of cloud authors for copyright purposes. +# This file is distinct from the CONTRIBUTORS files. +# See the latter for an explanation. + +# Names should be added to this file as: +# Name or Organization +# The email address is not required for organizations. + +Filippo Valsorda +Google Inc. +Ingo Oeser +Palm Stone Games, Inc. +Paweł Knap +Péter Szilágyi +Tyler Treat diff --git a/staging/src/k8s.io/client-go/_vendor/cloud.google.com/go/CONTRIBUTORS b/staging/src/k8s.io/client-go/_vendor/cloud.google.com/go/CONTRIBUTORS new file mode 100644 index 00000000000..07509ccb7c9 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/cloud.google.com/go/CONTRIBUTORS @@ -0,0 +1,34 @@ +# People who have agreed to one of the CLAs and can contribute patches. +# The AUTHORS file lists the copyright holders; this file +# lists people. For example, Google employees are listed here +# but not in AUTHORS, because Google holds the copyright. +# +# https://developers.google.com/open-source/cla/individual +# https://developers.google.com/open-source/cla/corporate +# +# Names should be added to this file as: +# Name + +# Keep the list alphabetically sorted. + +Andreas Litt +Andrew Gerrand +Brad Fitzpatrick +Burcu Dogan +Dave Day +David Sansome +David Symonds +Filippo Valsorda +Glenn Lewis +Ingo Oeser +Johan Euphrosine +Jonathan Amsterdam +Luna Duclos +Michael McGreevy +Omar Jarjur +Paweł Knap +Péter Szilágyi +Sarah Adams +Toby Burress +Tuo Shan +Tyler Treat diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/docker/distribution/AUTHORS b/staging/src/k8s.io/client-go/_vendor/github.com/docker/distribution/AUTHORS new file mode 100644 index 00000000000..0857b62fc97 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/docker/distribution/AUTHORS @@ -0,0 +1,128 @@ +Aaron Lehmann +Aaron Vinson +Adam Enger +Adrian Mouat +Ahmet Alp Balkan +Alex Chan +Alex Elman +amitshukla +Amy Lindburg +Andrew Meredith +Andrew T Nguyen +Andrey Kostov +Andy Goldstein +Anton Tiurin +Antonio Mercado +Antonio Murdaca +Arnaud Porterie +Arthur Baars +Asuka Suzuki +Avi Miller +Ayose Cazorla +BadZen +Ben Firshman +bin liu +Brian Bland +burnettk +Carson A +Chris Dillon +Daisuke Fujita +Darren Shepherd +Dave Trombley +Dave Tucker +David Lawrence +David Verhasselt +David Xia +davidli +Dejan Golja +Derek McGowan +Diogo Mónica +DJ Enriquez +Donald Huang +Doug Davis +Eric Yang +farmerworking +Felix Yan +Florentin Raud +Frederick F. Kautz IV +gabriell nascimento +harche +Henri Gomez +Hu Keping +Hua Wang +HuKeping +Ian Babrou +igayoso +Jack Griffin +Jason Freidman +Jeff Nickoloff +Jessie Frazelle +Jianqing Wang +John Starks +Jon Poler +Jonathan Boulle +Jordan Liggitt +Josh Hawn +Julien Fernandez +Keerthan Mala +Kelsey Hightower +Kenneth Lim +Kenny Leung +Li Yi +Liu Hua +liuchang0812 +Louis Kottmann +Luke Carpenter +Mary Anthony +Matt Bentley +Matt Duch +Matt Moore +Matt Robenolt +Michael Prokop +Michal Minar +Miquel Sabaté +Morgan Bauer +moxiegirl +Nathan Sullivan +nevermosby +Nghia Tran +Nuutti Kotivuori +Oilbeater +Olivier Gambier +Olivier Jacques +Omer Cohen +Patrick Devine +Philip Misiowiec +Richard Scothern +Rodolfo Carvalho +Rusty Conover +Sean Boran +Sebastiaan van Stijn +Sharif Nassar +Shawn Falkner-Horine +Shreyas Karnik +Simon Thulbourn +Spencer Rinehart +Stefan Weil +Stephen J Day +Sungho Moon +Sven Dowideit +Sylvain Baubeau +Ted Reed +tgic +Thomas Sjögren +Tianon Gravi +Tibor Vass +Tonis Tiigi +Trevor Pounds +Troels Thomsen +Vincent Batts +Vincent Demeester +Vincent Giersch +W. Trevor King +weiyuan.yl +xg.song +xiekeyang +Yann ROBERT +yuzou +姜继忠 diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/gogo/protobuf/CONTRIBUTORS b/staging/src/k8s.io/client-go/_vendor/github.com/gogo/protobuf/CONTRIBUTORS new file mode 100644 index 00000000000..d2c3b418fe4 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/gogo/protobuf/CONTRIBUTORS @@ -0,0 +1,15 @@ +Anton Povarov +Clayton Coleman +Denis Smirnov +DongYun Kang +Dwayne Schultz +Georg Apitz +Gustav Paul +John Tuley +Laurent +Patrick Lee +Stephen J Day +Tamir Duberstein +Todd Eisenberger +Tormod Erevik Lea +Walter Schulze diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/golang/protobuf/AUTHORS b/staging/src/k8s.io/client-go/_vendor/github.com/golang/protobuf/AUTHORS new file mode 100644 index 00000000000..15167cd746c --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/golang/protobuf/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/golang/protobuf/CONTRIBUTORS b/staging/src/k8s.io/client-go/_vendor/github.com/golang/protobuf/CONTRIBUTORS new file mode 100644 index 00000000000..1c4577e9680 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/golang/protobuf/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/LICENSE b/staging/src/k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/LICENSE new file mode 100644 index 00000000000..c67dad612a3 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013, Patrick Mezard +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. + The names of its contributors may not 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/staging/src/k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/difflib/difflib.go b/staging/src/k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/difflib/difflib.go new file mode 100644 index 00000000000..64cc40fe1da --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/difflib/difflib.go @@ -0,0 +1,758 @@ +// Package difflib is a partial port of Python difflib module. +// +// It provides tools to compare sequences of strings and generate textual diffs. +// +// The following class and functions have been ported: +// +// - SequenceMatcher +// +// - unified_diff +// +// - context_diff +// +// Getting unified diffs was the main goal of the port. Keep in mind this code +// is mostly suitable to output text differences in a human friendly way, there +// are no guarantees generated diffs are consumable by patch(1). +package difflib + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strings" +) + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func calculateRatio(matches, length int) float64 { + if length > 0 { + return 2.0 * float64(matches) / float64(length) + } + return 1.0 +} + +type Match struct { + A int + B int + Size int +} + +type OpCode struct { + Tag byte + I1 int + I2 int + J1 int + J2 int +} + +// SequenceMatcher compares sequence of strings. The basic +// algorithm predates, and is a little fancier than, an algorithm +// published in the late 1980's by Ratcliff and Obershelp under the +// hyperbolic name "gestalt pattern matching". The basic idea is to find +// the longest contiguous matching subsequence that contains no "junk" +// elements (R-O doesn't address junk). The same idea is then applied +// recursively to the pieces of the sequences to the left and to the right +// of the matching subsequence. This does not yield minimal edit +// sequences, but does tend to yield matches that "look right" to people. +// +// SequenceMatcher tries to compute a "human-friendly diff" between two +// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the +// longest *contiguous* & junk-free matching subsequence. That's what +// catches peoples' eyes. The Windows(tm) windiff has another interesting +// notion, pairing up elements that appear uniquely in each sequence. +// That, and the method here, appear to yield more intuitive difference +// reports than does diff. This method appears to be the least vulnerable +// to synching up on blocks of "junk lines", though (like blank lines in +// ordinary text files, or maybe "

" lines in HTML files). That may be +// because this is the only method of the 3 that has a *concept* of +// "junk" . +// +// Timing: Basic R-O is cubic time worst case and quadratic time expected +// case. SequenceMatcher is quadratic time for the worst case and has +// expected-case behavior dependent in a complicated way on how many +// elements the sequences have in common; best case time is linear. +type SequenceMatcher struct { + a []string + b []string + b2j map[string][]int + IsJunk func(string) bool + autoJunk bool + bJunk map[string]struct{} + matchingBlocks []Match + fullBCount map[string]int + bPopular map[string]struct{} + opCodes []OpCode +} + +func NewMatcher(a, b []string) *SequenceMatcher { + m := SequenceMatcher{autoJunk: true} + m.SetSeqs(a, b) + return &m +} + +func NewMatcherWithJunk(a, b []string, autoJunk bool, + isJunk func(string) bool) *SequenceMatcher { + + m := SequenceMatcher{IsJunk: isJunk, autoJunk: autoJunk} + m.SetSeqs(a, b) + return &m +} + +// Set two sequences to be compared. +func (m *SequenceMatcher) SetSeqs(a, b []string) { + m.SetSeq1(a) + m.SetSeq2(b) +} + +// Set the first sequence to be compared. The second sequence to be compared is +// not changed. +// +// SequenceMatcher computes and caches detailed information about the second +// sequence, so if you want to compare one sequence S against many sequences, +// use .SetSeq2(s) once and call .SetSeq1(x) repeatedly for each of the other +// sequences. +// +// See also SetSeqs() and SetSeq2(). +func (m *SequenceMatcher) SetSeq1(a []string) { + if &a == &m.a { + return + } + m.a = a + m.matchingBlocks = nil + m.opCodes = nil +} + +// Set the second sequence to be compared. The first sequence to be compared is +// not changed. +func (m *SequenceMatcher) SetSeq2(b []string) { + if &b == &m.b { + return + } + m.b = b + m.matchingBlocks = nil + m.opCodes = nil + m.fullBCount = nil + m.chainB() +} + +func (m *SequenceMatcher) chainB() { + // Populate line -> index mapping + b2j := map[string][]int{} + for i, s := range m.b { + indices := b2j[s] + indices = append(indices, i) + b2j[s] = indices + } + + // Purge junk elements + m.bJunk = map[string]struct{}{} + if m.IsJunk != nil { + junk := m.bJunk + for s, _ := range b2j { + if m.IsJunk(s) { + junk[s] = struct{}{} + } + } + for s, _ := range junk { + delete(b2j, s) + } + } + + // Purge remaining popular elements + popular := map[string]struct{}{} + n := len(m.b) + if m.autoJunk && n >= 200 { + ntest := n/100 + 1 + for s, indices := range b2j { + if len(indices) > ntest { + popular[s] = struct{}{} + } + } + for s, _ := range popular { + delete(b2j, s) + } + } + m.bPopular = popular + m.b2j = b2j +} + +func (m *SequenceMatcher) isBJunk(s string) bool { + _, ok := m.bJunk[s] + return ok +} + +// Find longest matching block in a[alo:ahi] and b[blo:bhi]. +// +// If IsJunk is not defined: +// +// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where +// alo <= i <= i+k <= ahi +// blo <= j <= j+k <= bhi +// and for all (i',j',k') meeting those conditions, +// k >= k' +// i <= i' +// and if i == i', j <= j' +// +// In other words, of all maximal matching blocks, return one that +// starts earliest in a, and of all those maximal matching blocks that +// start earliest in a, return the one that starts earliest in b. +// +// If IsJunk is defined, first the longest matching block is +// determined as above, but with the additional restriction that no +// junk element appears in the block. Then that block is extended as +// far as possible by matching (only) junk elements on both sides. So +// the resulting block never matches on junk except as identical junk +// happens to be adjacent to an "interesting" match. +// +// If no blocks match, return (alo, blo, 0). +func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match { + // CAUTION: stripping common prefix or suffix would be incorrect. + // E.g., + // ab + // acab + // Longest matching block is "ab", but if common prefix is + // stripped, it's "a" (tied with "b"). UNIX(tm) diff does so + // strip, so ends up claiming that ab is changed to acab by + // inserting "ca" in the middle. That's minimal but unintuitive: + // "it's obvious" that someone inserted "ac" at the front. + // Windiff ends up at the same place as diff, but by pairing up + // the unique 'b's and then matching the first two 'a's. + besti, bestj, bestsize := alo, blo, 0 + + // find longest junk-free match + // during an iteration of the loop, j2len[j] = length of longest + // junk-free match ending with a[i-1] and b[j] + j2len := map[int]int{} + for i := alo; i != ahi; i++ { + // look at all instances of a[i] in b; note that because + // b2j has no junk keys, the loop is skipped if a[i] is junk + newj2len := map[int]int{} + for _, j := range m.b2j[m.a[i]] { + // a[i] matches b[j] + if j < blo { + continue + } + if j >= bhi { + break + } + k := j2len[j-1] + 1 + newj2len[j] = k + if k > bestsize { + besti, bestj, bestsize = i-k+1, j-k+1, k + } + } + j2len = newj2len + } + + // Extend the best by non-junk elements on each end. In particular, + // "popular" non-junk elements aren't in b2j, which greatly speeds + // the inner loop above, but also means "the best" match so far + // doesn't contain any junk *or* popular non-junk elements. + for besti > alo && bestj > blo && !m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + !m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize += 1 + } + + // Now that we have a wholly interesting match (albeit possibly + // empty!), we may as well suck up the matching junk on each + // side of it too. Can't think of a good reason not to, and it + // saves post-processing the (possibly considerable) expense of + // figuring out what to do with it. In the case of an empty + // interesting match, this is clearly the right thing to do, + // because no other kind of match is possible in the regions. + for besti > alo && bestj > blo && m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize += 1 + } + + return Match{A: besti, B: bestj, Size: bestsize} +} + +// Return list of triples describing matching subsequences. +// +// Each triple is of the form (i, j, n), and means that +// a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in +// i and in j. It's also guaranteed that if (i, j, n) and (i', j', n') are +// adjacent triples in the list, and the second is not the last triple in the +// list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe +// adjacent equal blocks. +// +// The last triple is a dummy, (len(a), len(b), 0), and is the only +// triple with n==0. +func (m *SequenceMatcher) GetMatchingBlocks() []Match { + if m.matchingBlocks != nil { + return m.matchingBlocks + } + + var matchBlocks func(alo, ahi, blo, bhi int, matched []Match) []Match + matchBlocks = func(alo, ahi, blo, bhi int, matched []Match) []Match { + match := m.findLongestMatch(alo, ahi, blo, bhi) + i, j, k := match.A, match.B, match.Size + if match.Size > 0 { + if alo < i && blo < j { + matched = matchBlocks(alo, i, blo, j, matched) + } + matched = append(matched, match) + if i+k < ahi && j+k < bhi { + matched = matchBlocks(i+k, ahi, j+k, bhi, matched) + } + } + return matched + } + matched := matchBlocks(0, len(m.a), 0, len(m.b), nil) + + // It's possible that we have adjacent equal blocks in the + // matching_blocks list now. + nonAdjacent := []Match{} + i1, j1, k1 := 0, 0, 0 + for _, b := range matched { + // Is this block adjacent to i1, j1, k1? + i2, j2, k2 := b.A, b.B, b.Size + if i1+k1 == i2 && j1+k1 == j2 { + // Yes, so collapse them -- this just increases the length of + // the first block by the length of the second, and the first + // block so lengthened remains the block to compare against. + k1 += k2 + } else { + // Not adjacent. Remember the first block (k1==0 means it's + // the dummy we started with), and make the second block the + // new block to compare against. + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + i1, j1, k1 = i2, j2, k2 + } + } + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + + nonAdjacent = append(nonAdjacent, Match{len(m.a), len(m.b), 0}) + m.matchingBlocks = nonAdjacent + return m.matchingBlocks +} + +// Return list of 5-tuples describing how to turn a into b. +// +// Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple +// has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the +// tuple preceding it, and likewise for j1 == the previous j2. +// +// The tags are characters, with these meanings: +// +// 'r' (replace): a[i1:i2] should be replaced by b[j1:j2] +// +// 'd' (delete): a[i1:i2] should be deleted, j1==j2 in this case. +// +// 'i' (insert): b[j1:j2] should be inserted at a[i1:i1], i1==i2 in this case. +// +// 'e' (equal): a[i1:i2] == b[j1:j2] +func (m *SequenceMatcher) GetOpCodes() []OpCode { + if m.opCodes != nil { + return m.opCodes + } + i, j := 0, 0 + matching := m.GetMatchingBlocks() + opCodes := make([]OpCode, 0, len(matching)) + for _, m := range matching { + // invariant: we've pumped out correct diffs to change + // a[:i] into b[:j], and the next matching block is + // a[ai:ai+size] == b[bj:bj+size]. So we need to pump + // out a diff to change a[i:ai] into b[j:bj], pump out + // the matching block, and move (i,j) beyond the match + ai, bj, size := m.A, m.B, m.Size + tag := byte(0) + if i < ai && j < bj { + tag = 'r' + } else if i < ai { + tag = 'd' + } else if j < bj { + tag = 'i' + } + if tag > 0 { + opCodes = append(opCodes, OpCode{tag, i, ai, j, bj}) + } + i, j = ai+size, bj+size + // the list of matching blocks is terminated by a + // sentinel with size 0 + if size > 0 { + opCodes = append(opCodes, OpCode{'e', ai, i, bj, j}) + } + } + m.opCodes = opCodes + return m.opCodes +} + +// Isolate change clusters by eliminating ranges with no changes. +// +// Return a generator of groups with up to n lines of context. +// Each group is in the same format as returned by GetOpCodes(). +func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { + if n < 0 { + n = 3 + } + codes := m.GetOpCodes() + if len(codes) == 0 { + codes = []OpCode{OpCode{'e', 0, 1, 0, 1}} + } + // Fixup leading and trailing groups if they show no changes. + if codes[0].Tag == 'e' { + c := codes[0] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[0] = OpCode{c.Tag, max(i1, i2-n), i2, max(j1, j2-n), j2} + } + if codes[len(codes)-1].Tag == 'e' { + c := codes[len(codes)-1] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[len(codes)-1] = OpCode{c.Tag, i1, min(i2, i1+n), j1, min(j2, j1+n)} + } + nn := n + n + groups := [][]OpCode{} + group := []OpCode{} + for _, c := range codes { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + // End the current group and start a new one whenever + // there is a large range with no changes. + if c.Tag == 'e' && i2-i1 > nn { + group = append(group, OpCode{c.Tag, i1, min(i2, i1+n), + j1, min(j2, j1+n)}) + groups = append(groups, group) + group = []OpCode{} + i1, j1 = max(i1, i2-n), max(j1, j2-n) + } + group = append(group, OpCode{c.Tag, i1, i2, j1, j2}) + } + if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') { + groups = append(groups, group) + } + return groups +} + +// Return a measure of the sequences' similarity (float in [0,1]). +// +// Where T is the total number of elements in both sequences, and +// M is the number of matches, this is 2.0*M / T. +// Note that this is 1 if the sequences are identical, and 0 if +// they have nothing in common. +// +// .Ratio() is expensive to compute if you haven't already computed +// .GetMatchingBlocks() or .GetOpCodes(), in which case you may +// want to try .QuickRatio() or .RealQuickRation() first to get an +// upper bound. +func (m *SequenceMatcher) Ratio() float64 { + matches := 0 + for _, m := range m.GetMatchingBlocks() { + matches += m.Size + } + return calculateRatio(matches, len(m.a)+len(m.b)) +} + +// Return an upper bound on ratio() relatively quickly. +// +// This isn't defined beyond that it is an upper bound on .Ratio(), and +// is faster to compute. +func (m *SequenceMatcher) QuickRatio() float64 { + // viewing a and b as multisets, set matches to the cardinality + // of their intersection; this counts the number of matches + // without regard to order, so is clearly an upper bound + if m.fullBCount == nil { + m.fullBCount = map[string]int{} + for _, s := range m.b { + m.fullBCount[s] = m.fullBCount[s] + 1 + } + } + + // avail[x] is the number of times x appears in 'b' less the + // number of times we've seen it in 'a' so far ... kinda + avail := map[string]int{} + matches := 0 + for _, s := range m.a { + n, ok := avail[s] + if !ok { + n = m.fullBCount[s] + } + avail[s] = n - 1 + if n > 0 { + matches += 1 + } + } + return calculateRatio(matches, len(m.a)+len(m.b)) +} + +// Return an upper bound on ratio() very quickly. +// +// This isn't defined beyond that it is an upper bound on .Ratio(), and +// is faster to compute than either .Ratio() or .QuickRatio(). +func (m *SequenceMatcher) RealQuickRatio() float64 { + la, lb := len(m.a), len(m.b) + return calculateRatio(min(la, lb), la+lb) +} + +// Convert range to the "ed" format +func formatRangeUnified(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 1 { + return fmt.Sprintf("%d", beginning) + } + if length == 0 { + beginning -= 1 // empty ranges begin at line just before the range + } + return fmt.Sprintf("%d,%d", beginning, length) +} + +// Unified diff parameters +type UnifiedDiff struct { + A []string // First sequence lines + FromFile string // First file name + FromDate string // First file time + B []string // Second sequence lines + ToFile string // Second file name + ToDate string // Second file time + Eol string // Headers end of line, defaults to LF + Context int // Number of context lines +} + +// Compare two sequences of lines; generate the delta as a unified diff. +// +// Unified diffs are a compact way of showing line changes and a few +// lines of context. The number of context lines is set by 'n' which +// defaults to three. +// +// By default, the diff control lines (those with ---, +++, or @@) are +// created with a trailing newline. This is helpful so that inputs +// created from file.readlines() result in diffs that are suitable for +// file.writelines() since both the inputs and outputs have trailing +// newlines. +// +// For inputs that do not have trailing newlines, set the lineterm +// argument to "" so that the output will be uniformly newline free. +// +// The unidiff format normally has a header for filenames and modification +// times. Any or all of these may be specified using strings for +// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. +// The modification times are normally expressed in the ISO 8601 format. +func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { + buf := bufio.NewWriter(writer) + defer buf.Flush() + w := func(format string, args ...interface{}) error { + _, err := buf.WriteString(fmt.Sprintf(format, args...)) + return err + } + + if len(diff.Eol) == 0 { + diff.Eol = "\n" + } + + started := false + m := NewMatcher(diff.A, diff.B) + for _, g := range m.GetGroupedOpCodes(diff.Context) { + if !started { + started = true + fromDate := "" + if len(diff.FromDate) > 0 { + fromDate = "\t" + diff.FromDate + } + toDate := "" + if len(diff.ToDate) > 0 { + toDate = "\t" + diff.ToDate + } + err := w("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) + if err != nil { + return err + } + err = w("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) + if err != nil { + return err + } + } + first, last := g[0], g[len(g)-1] + range1 := formatRangeUnified(first.I1, last.I2) + range2 := formatRangeUnified(first.J1, last.J2) + if err := w("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { + return err + } + for _, c := range g { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + if c.Tag == 'e' { + for _, line := range diff.A[i1:i2] { + if err := w(" " + line); err != nil { + return err + } + } + continue + } + if c.Tag == 'r' || c.Tag == 'd' { + for _, line := range diff.A[i1:i2] { + if err := w("-" + line); err != nil { + return err + } + } + } + if c.Tag == 'r' || c.Tag == 'i' { + for _, line := range diff.B[j1:j2] { + if err := w("+" + line); err != nil { + return err + } + } + } + } + } + return nil +} + +// Like WriteUnifiedDiff but returns the diff a string. +func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { + w := &bytes.Buffer{} + err := WriteUnifiedDiff(w, diff) + return string(w.Bytes()), err +} + +// Convert range to the "ed" format. +func formatRangeContext(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 0 { + beginning -= 1 // empty ranges begin at line just before the range + } + if length <= 1 { + return fmt.Sprintf("%d", beginning) + } + return fmt.Sprintf("%d,%d", beginning, beginning+length-1) +} + +type ContextDiff UnifiedDiff + +// Compare two sequences of lines; generate the delta as a context diff. +// +// Context diffs are a compact way of showing line changes and a few +// lines of context. The number of context lines is set by diff.Context +// which defaults to three. +// +// By default, the diff control lines (those with *** or ---) are +// created with a trailing newline. +// +// For inputs that do not have trailing newlines, set the diff.Eol +// argument to "" so that the output will be uniformly newline free. +// +// The context diff format normally has a header for filenames and +// modification times. Any or all of these may be specified using +// strings for diff.FromFile, diff.ToFile, diff.FromDate, diff.ToDate. +// The modification times are normally expressed in the ISO 8601 format. +// If not specified, the strings default to blanks. +func WriteContextDiff(writer io.Writer, diff ContextDiff) error { + buf := bufio.NewWriter(writer) + defer buf.Flush() + var diffErr error + w := func(format string, args ...interface{}) { + _, err := buf.WriteString(fmt.Sprintf(format, args...)) + if diffErr == nil && err != nil { + diffErr = err + } + } + + if len(diff.Eol) == 0 { + diff.Eol = "\n" + } + + prefix := map[byte]string{ + 'i': "+ ", + 'd': "- ", + 'r': "! ", + 'e': " ", + } + + started := false + m := NewMatcher(diff.A, diff.B) + for _, g := range m.GetGroupedOpCodes(diff.Context) { + if !started { + started = true + fromDate := "" + if len(diff.FromDate) > 0 { + fromDate = "\t" + diff.FromDate + } + toDate := "" + if len(diff.ToDate) > 0 { + toDate = "\t" + diff.ToDate + } + w("*** %s%s%s", diff.FromFile, fromDate, diff.Eol) + w("--- %s%s%s", diff.ToFile, toDate, diff.Eol) + } + + first, last := g[0], g[len(g)-1] + w("***************" + diff.Eol) + + range1 := formatRangeContext(first.I1, last.I2) + w("*** %s ****%s", range1, diff.Eol) + for _, c := range g { + if c.Tag == 'r' || c.Tag == 'd' { + for _, cc := range g { + if cc.Tag == 'i' { + continue + } + for _, line := range diff.A[cc.I1:cc.I2] { + w(prefix[cc.Tag] + line) + } + } + break + } + } + + range2 := formatRangeContext(first.J1, last.J2) + w("--- %s ----%s", range2, diff.Eol) + for _, c := range g { + if c.Tag == 'r' || c.Tag == 'i' { + for _, cc := range g { + if cc.Tag == 'd' { + continue + } + for _, line := range diff.B[cc.J1:cc.J2] { + w(prefix[cc.Tag] + line) + } + } + break + } + } + } + return diffErr +} + +// Like WriteContextDiff but returns the diff a string. +func GetContextDiffString(diff ContextDiff) (string, error) { + w := &bytes.Buffer{} + err := WriteContextDiff(w, diff) + return string(w.Bytes()), err +} + +// Split a string on "\n" while preserving them. The output can be used +// as input for UnifiedDiff and ContextDiff structures. +func SplitLines(s string) []string { + lines := strings.SplitAfter(s, "\n") + lines[len(lines)-1] += "\n" + return lines +} diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/flag.go b/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/flag.go index b0b0d46f7ff..fa815642ed0 100644 --- a/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/flag.go +++ b/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/flag.go @@ -416,7 +416,7 @@ func Set(name, value string) error { // otherwise, the default values of all defined flags in the set. func (f *FlagSet) PrintDefaults() { usages := f.FlagUsages() - fmt.Fprintf(f.out(), "%s", usages) + fmt.Fprint(f.out(), usages) } // defaultIsZeroValue returns true if the default value for this flag represents @@ -514,7 +514,7 @@ func (f *FlagSet) FlagUsages() string { if len(flag.NoOptDefVal) > 0 { switch flag.Value.Type() { case "string": - line += fmt.Sprintf("[=%q]", flag.NoOptDefVal) + line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal) case "bool": if flag.NoOptDefVal != "true" { line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) @@ -534,7 +534,7 @@ func (f *FlagSet) FlagUsages() string { line += usage if !flag.defaultIsZeroValue() { if flag.Value.Type() == "string" { - line += fmt.Sprintf(" (default %q)", flag.DefValue) + line += fmt.Sprintf(" (default \"%s\")", flag.DefValue) } else { line += fmt.Sprintf(" (default %s)", flag.DefValue) } diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/string_array.go b/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/string_array.go index f320f2ece36..93b4e43290a 100644 --- a/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/string_array.go +++ b/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/string_array.go @@ -2,7 +2,6 @@ package pflag import ( "fmt" - "strings" ) var _ = fmt.Fprint @@ -40,7 +39,7 @@ func (s *stringArrayValue) String() string { } func stringArrayConv(sval string) (interface{}, error) { - sval = strings.Trim(sval, "[]") + sval = sval[1 : len(sval)-1] // An empty string would cause a array with one (empty) string if len(sval) == 0 { return []string{}, nil diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/string_slice.go b/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/string_slice.go index 51e3c5d2238..7829cfafb29 100644 --- a/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/string_slice.go +++ b/staging/src/k8s.io/client-go/_vendor/github.com/spf13/pflag/string_slice.go @@ -66,7 +66,7 @@ func (s *stringSliceValue) String() string { } func stringSliceConv(sval string) (interface{}, error) { - sval = strings.Trim(sval, "[]") + sval = sval[1 : len(sval)-1] // An empty string would cause a slice with one (empty) string if len(sval) == 0 { return []string{}, nil diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/LICENCE.txt b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/LICENCE.txt new file mode 100644 index 00000000000..473b670a7c6 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/LICENCE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell + +Please consider promoting this project if you find it useful. + +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/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/LICENSE b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/LICENSE new file mode 100644 index 00000000000..473b670a7c6 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell + +Please consider promoting this project if you find it useful. + +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/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/assertions.go b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/assertions.go new file mode 100644 index 00000000000..e95357d29c8 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/assertions.go @@ -0,0 +1,979 @@ +package assert + +import ( + "bufio" + "bytes" + "encoding/json" + "fmt" + "math" + "reflect" + "regexp" + "runtime" + "strings" + "time" + "unicode" + "unicode/utf8" + + "github.com/davecgh/go-spew/spew" + "github.com/pmezard/go-difflib/difflib" +) + +// TestingT is an interface wrapper around *testing.T +type TestingT interface { + Errorf(format string, args ...interface{}) +} + +// Comparison a custom function that returns true on success and false on failure +type Comparison func() (success bool) + +/* + Helper functions +*/ + +// ObjectsAreEqual determines if two objects are considered equal. +// +// This function does no assertion of any kind. +func ObjectsAreEqual(expected, actual interface{}) bool { + + if expected == nil || actual == nil { + return expected == actual + } + + return reflect.DeepEqual(expected, actual) + +} + +// ObjectsAreEqualValues gets whether two objects are equal, or if their +// values are equal. +func ObjectsAreEqualValues(expected, actual interface{}) bool { + if ObjectsAreEqual(expected, actual) { + return true + } + + actualType := reflect.TypeOf(actual) + if actualType == nil { + return false + } + expectedValue := reflect.ValueOf(expected) + if expectedValue.IsValid() && expectedValue.Type().ConvertibleTo(actualType) { + // Attempt comparison after type conversion + return reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), actual) + } + + return false +} + +/* CallerInfo is necessary because the assert functions use the testing object +internally, causing it to print the file:line of the assert method, rather than where +the problem actually occured in calling code.*/ + +// CallerInfo returns an array of strings containing the file and line number +// of each stack frame leading from the current test to the assert call that +// failed. +func CallerInfo() []string { + + pc := uintptr(0) + file := "" + line := 0 + ok := false + name := "" + + callers := []string{} + for i := 0; ; i++ { + pc, file, line, ok = runtime.Caller(i) + if !ok { + return nil + } + + // This is a huge edge case, but it will panic if this is the case, see #180 + if file == "" { + break + } + + parts := strings.Split(file, "/") + dir := parts[len(parts)-2] + file = parts[len(parts)-1] + if (dir != "assert" && dir != "mock" && dir != "require") || file == "mock_test.go" { + callers = append(callers, fmt.Sprintf("%s:%d", file, line)) + } + + f := runtime.FuncForPC(pc) + if f == nil { + break + } + name = f.Name() + // Drop the package + segments := strings.Split(name, ".") + name = segments[len(segments)-1] + if isTest(name, "Test") || + isTest(name, "Benchmark") || + isTest(name, "Example") { + break + } + } + + return callers +} + +// Stolen from the `go test` tool. +// isTest tells whether name looks like a test (or benchmark, according to prefix). +// It is a Test (say) if there is a character after Test that is not a lower-case letter. +// We don't want TesticularCancer. +func isTest(name, prefix string) bool { + if !strings.HasPrefix(name, prefix) { + return false + } + if len(name) == len(prefix) { // "Test" is ok + return true + } + rune, _ := utf8.DecodeRuneInString(name[len(prefix):]) + return !unicode.IsLower(rune) +} + +// getWhitespaceString returns a string that is long enough to overwrite the default +// output from the go testing framework. +func getWhitespaceString() string { + + _, file, line, ok := runtime.Caller(1) + if !ok { + return "" + } + parts := strings.Split(file, "/") + file = parts[len(parts)-1] + + return strings.Repeat(" ", len(fmt.Sprintf("%s:%d: ", file, line))) + +} + +func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { + if len(msgAndArgs) == 0 || msgAndArgs == nil { + return "" + } + if len(msgAndArgs) == 1 { + return msgAndArgs[0].(string) + } + if len(msgAndArgs) > 1 { + return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...) + } + return "" +} + +// Indents all lines of the message by appending a number of tabs to each line, in an output format compatible with Go's +// test printing (see inner comment for specifics) +func indentMessageLines(message string, tabs int) string { + outBuf := new(bytes.Buffer) + + for i, scanner := 0, bufio.NewScanner(strings.NewReader(message)); scanner.Scan(); i++ { + if i != 0 { + outBuf.WriteRune('\n') + } + for ii := 0; ii < tabs; ii++ { + outBuf.WriteRune('\t') + // Bizarrely, all lines except the first need one fewer tabs prepended, so deliberately advance the counter + // by 1 prematurely. + if ii == 0 && i > 0 { + ii++ + } + } + outBuf.WriteString(scanner.Text()) + } + + return outBuf.String() +} + +// Fail reports a failure through +func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool { + + message := messageFromMsgAndArgs(msgAndArgs...) + + errorTrace := strings.Join(CallerInfo(), "\n\r\t\t\t") + if len(message) > 0 { + t.Errorf("\r%s\r\tError Trace:\t%s\n"+ + "\r\tError:%s\n"+ + "\r\tMessages:\t%s\n\r", + getWhitespaceString(), + errorTrace, + indentMessageLines(failureMessage, 2), + message) + } else { + t.Errorf("\r%s\r\tError Trace:\t%s\n"+ + "\r\tError:%s\n\r", + getWhitespaceString(), + errorTrace, + indentMessageLines(failureMessage, 2)) + } + + return false +} + +// Implements asserts that an object is implemented by the specified interface. +// +// assert.Implements(t, (*MyInterface)(nil), new(MyObject), "MyObject") +func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { + + interfaceType := reflect.TypeOf(interfaceObject).Elem() + + if !reflect.TypeOf(object).Implements(interfaceType) { + return Fail(t, fmt.Sprintf("%T must implement %v", object, interfaceType), msgAndArgs...) + } + + return true + +} + +// IsType asserts that the specified objects are of the same type. +func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { + + if !ObjectsAreEqual(reflect.TypeOf(object), reflect.TypeOf(expectedType)) { + return Fail(t, fmt.Sprintf("Object expected to be of type %v, but was %v", reflect.TypeOf(expectedType), reflect.TypeOf(object)), msgAndArgs...) + } + + return true +} + +// Equal asserts that two objects are equal. +// +// assert.Equal(t, 123, 123, "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func Equal(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { + + if !ObjectsAreEqual(expected, actual) { + diff := diff(expected, actual) + return Fail(t, fmt.Sprintf("Not equal: %#v (expected)\n"+ + " != %#v (actual)%s", expected, actual, diff), msgAndArgs...) + } + + return true + +} + +// EqualValues asserts that two objects are equal or convertable to the same types +// and equal. +// +// assert.EqualValues(t, uint32(123), int32(123), "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func EqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { + + if !ObjectsAreEqualValues(expected, actual) { + return Fail(t, fmt.Sprintf("Not equal: %#v (expected)\n"+ + " != %#v (actual)", expected, actual), msgAndArgs...) + } + + return true + +} + +// Exactly asserts that two objects are equal is value and type. +// +// assert.Exactly(t, int32(123), int64(123), "123 and 123 should NOT be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { + + aType := reflect.TypeOf(expected) + bType := reflect.TypeOf(actual) + + if aType != bType { + return Fail(t, fmt.Sprintf("Types expected to match exactly\n\r\t%v != %v", aType, bType), msgAndArgs...) + } + + return Equal(t, expected, actual, msgAndArgs...) + +} + +// NotNil asserts that the specified object is not nil. +// +// assert.NotNil(t, err, "err should be something") +// +// Returns whether the assertion was successful (true) or not (false). +func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + if !isNil(object) { + return true + } + return Fail(t, "Expected value not to be nil.", msgAndArgs...) +} + +// isNil checks if a specified object is nil or not, without Failing. +func isNil(object interface{}) bool { + if object == nil { + return true + } + + value := reflect.ValueOf(object) + kind := value.Kind() + if kind >= reflect.Chan && kind <= reflect.Slice && value.IsNil() { + return true + } + + return false +} + +// Nil asserts that the specified object is nil. +// +// assert.Nil(t, err, "err should be nothing") +// +// Returns whether the assertion was successful (true) or not (false). +func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + if isNil(object) { + return true + } + return Fail(t, fmt.Sprintf("Expected nil, but got: %#v", object), msgAndArgs...) +} + +var numericZeros = []interface{}{ + int(0), + int8(0), + int16(0), + int32(0), + int64(0), + uint(0), + uint8(0), + uint16(0), + uint32(0), + uint64(0), + float32(0), + float64(0), +} + +// isEmpty gets whether the specified object is considered empty or not. +func isEmpty(object interface{}) bool { + + if object == nil { + return true + } else if object == "" { + return true + } else if object == false { + return true + } + + for _, v := range numericZeros { + if object == v { + return true + } + } + + objValue := reflect.ValueOf(object) + + switch objValue.Kind() { + case reflect.Map: + fallthrough + case reflect.Slice, reflect.Chan: + { + return (objValue.Len() == 0) + } + case reflect.Ptr: + { + if objValue.IsNil() { + return true + } + switch object.(type) { + case *time.Time: + return object.(*time.Time).IsZero() + default: + return false + } + } + } + return false +} + +// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either +// a slice or a channel with len == 0. +// +// assert.Empty(t, obj) +// +// Returns whether the assertion was successful (true) or not (false). +func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + + pass := isEmpty(object) + if !pass { + Fail(t, fmt.Sprintf("Should be empty, but was %v", object), msgAndArgs...) + } + + return pass + +} + +// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either +// a slice or a channel with len == 0. +// +// if assert.NotEmpty(t, obj) { +// assert.Equal(t, "two", obj[1]) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + + pass := !isEmpty(object) + if !pass { + Fail(t, fmt.Sprintf("Should NOT be empty, but was %v", object), msgAndArgs...) + } + + return pass + +} + +// getLen try to get length of object. +// return (false, 0) if impossible. +func getLen(x interface{}) (ok bool, length int) { + v := reflect.ValueOf(x) + defer func() { + if e := recover(); e != nil { + ok = false + } + }() + return true, v.Len() +} + +// Len asserts that the specified object has specific length. +// Len also fails if the object has a type that len() not accept. +// +// assert.Len(t, mySlice, 3, "The size of slice is not 3") +// +// Returns whether the assertion was successful (true) or not (false). +func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) bool { + ok, l := getLen(object) + if !ok { + return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", object), msgAndArgs...) + } + + if l != length { + return Fail(t, fmt.Sprintf("\"%s\" should have %d item(s), but has %d", object, length, l), msgAndArgs...) + } + return true +} + +// True asserts that the specified value is true. +// +// assert.True(t, myBool, "myBool should be true") +// +// Returns whether the assertion was successful (true) or not (false). +func True(t TestingT, value bool, msgAndArgs ...interface{}) bool { + + if value != true { + return Fail(t, "Should be true", msgAndArgs...) + } + + return true + +} + +// False asserts that the specified value is false. +// +// assert.False(t, myBool, "myBool should be false") +// +// Returns whether the assertion was successful (true) or not (false). +func False(t TestingT, value bool, msgAndArgs ...interface{}) bool { + + if value != false { + return Fail(t, "Should be false", msgAndArgs...) + } + + return true + +} + +// NotEqual asserts that the specified values are NOT equal. +// +// assert.NotEqual(t, obj1, obj2, "two objects shouldn't be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { + + if ObjectsAreEqual(expected, actual) { + return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...) + } + + return true + +} + +// containsElement try loop over the list check if the list includes the element. +// return (false, false) if impossible. +// return (true, false) if element was not found. +// return (true, true) if element was found. +func includeElement(list interface{}, element interface{}) (ok, found bool) { + + listValue := reflect.ValueOf(list) + elementValue := reflect.ValueOf(element) + defer func() { + if e := recover(); e != nil { + ok = false + found = false + } + }() + + if reflect.TypeOf(list).Kind() == reflect.String { + return true, strings.Contains(listValue.String(), elementValue.String()) + } + + if reflect.TypeOf(list).Kind() == reflect.Map { + mapKeys := listValue.MapKeys() + for i := 0; i < len(mapKeys); i++ { + if ObjectsAreEqual(mapKeys[i].Interface(), element) { + return true, true + } + } + return true, false + } + + for i := 0; i < listValue.Len(); i++ { + if ObjectsAreEqual(listValue.Index(i).Interface(), element) { + return true, true + } + } + return true, false + +} + +// Contains asserts that the specified string, list(array, slice...) or map contains the +// specified substring or element. +// +// assert.Contains(t, "Hello World", "World", "But 'Hello World' does contain 'World'") +// assert.Contains(t, ["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'") +// assert.Contains(t, {"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'") +// +// Returns whether the assertion was successful (true) or not (false). +func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { + + ok, found := includeElement(s, contains) + if !ok { + return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...) + } + if !found { + return Fail(t, fmt.Sprintf("\"%s\" does not contain \"%s\"", s, contains), msgAndArgs...) + } + + return true + +} + +// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the +// specified substring or element. +// +// assert.NotContains(t, "Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'") +// assert.NotContains(t, ["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'") +// assert.NotContains(t, {"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'") +// +// Returns whether the assertion was successful (true) or not (false). +func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { + + ok, found := includeElement(s, contains) + if !ok { + return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...) + } + if found { + return Fail(t, fmt.Sprintf("\"%s\" should not contain \"%s\"", s, contains), msgAndArgs...) + } + + return true + +} + +// Condition uses a Comparison to assert a complex condition. +func Condition(t TestingT, comp Comparison, msgAndArgs ...interface{}) bool { + result := comp() + if !result { + Fail(t, "Condition failed!", msgAndArgs...) + } + return result +} + +// PanicTestFunc defines a func that should be passed to the assert.Panics and assert.NotPanics +// methods, and represents a simple func that takes no arguments, and returns nothing. +type PanicTestFunc func() + +// didPanic returns true if the function passed to it panics. Otherwise, it returns false. +func didPanic(f PanicTestFunc) (bool, interface{}) { + + didPanic := false + var message interface{} + func() { + + defer func() { + if message = recover(); message != nil { + didPanic = true + } + }() + + // call the target function + f() + + }() + + return didPanic, message + +} + +// Panics asserts that the code inside the specified PanicTestFunc panics. +// +// assert.Panics(t, func(){ +// GoCrazy() +// }, "Calling GoCrazy() should panic") +// +// Returns whether the assertion was successful (true) or not (false). +func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { + + if funcDidPanic, panicValue := didPanic(f); !funcDidPanic { + return Fail(t, fmt.Sprintf("func %#v should panic\n\r\tPanic value:\t%v", f, panicValue), msgAndArgs...) + } + + return true +} + +// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. +// +// assert.NotPanics(t, func(){ +// RemainCalm() +// }, "Calling RemainCalm() should NOT panic") +// +// Returns whether the assertion was successful (true) or not (false). +func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { + + if funcDidPanic, panicValue := didPanic(f); funcDidPanic { + return Fail(t, fmt.Sprintf("func %#v should not panic\n\r\tPanic value:\t%v", f, panicValue), msgAndArgs...) + } + + return true +} + +// WithinDuration asserts that the two times are within duration delta of each other. +// +// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s") +// +// Returns whether the assertion was successful (true) or not (false). +func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool { + + dt := expected.Sub(actual) + if dt < -delta || dt > delta { + return Fail(t, fmt.Sprintf("Max difference between %v and %v allowed is %v, but difference was %v", expected, actual, delta, dt), msgAndArgs...) + } + + return true +} + +func toFloat(x interface{}) (float64, bool) { + var xf float64 + xok := true + + switch xn := x.(type) { + case uint8: + xf = float64(xn) + case uint16: + xf = float64(xn) + case uint32: + xf = float64(xn) + case uint64: + xf = float64(xn) + case int: + xf = float64(xn) + case int8: + xf = float64(xn) + case int16: + xf = float64(xn) + case int32: + xf = float64(xn) + case int64: + xf = float64(xn) + case float32: + xf = float64(xn) + case float64: + xf = float64(xn) + default: + xok = false + } + + return xf, xok +} + +// InDelta asserts that the two numerals are within delta of each other. +// +// assert.InDelta(t, math.Pi, (22 / 7.0), 0.01) +// +// Returns whether the assertion was successful (true) or not (false). +func InDelta(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + + af, aok := toFloat(expected) + bf, bok := toFloat(actual) + + if !aok || !bok { + return Fail(t, fmt.Sprintf("Parameters must be numerical"), msgAndArgs...) + } + + if math.IsNaN(af) { + return Fail(t, fmt.Sprintf("Actual must not be NaN"), msgAndArgs...) + } + + if math.IsNaN(bf) { + return Fail(t, fmt.Sprintf("Expected %v with delta %v, but was NaN", expected, delta), msgAndArgs...) + } + + dt := af - bf + if dt < -delta || dt > delta { + return Fail(t, fmt.Sprintf("Max difference between %v and %v allowed is %v, but difference was %v", expected, actual, delta, dt), msgAndArgs...) + } + + return true +} + +// InDeltaSlice is the same as InDelta, except it compares two slices. +func InDeltaSlice(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + if expected == nil || actual == nil || + reflect.TypeOf(actual).Kind() != reflect.Slice || + reflect.TypeOf(expected).Kind() != reflect.Slice { + return Fail(t, fmt.Sprintf("Parameters must be slice"), msgAndArgs...) + } + + actualSlice := reflect.ValueOf(actual) + expectedSlice := reflect.ValueOf(expected) + + for i := 0; i < actualSlice.Len(); i++ { + result := InDelta(t, actualSlice.Index(i).Interface(), expectedSlice.Index(i).Interface(), delta) + if !result { + return result + } + } + + return true +} + +// min(|expected|, |actual|) * epsilon +func calcEpsilonDelta(expected, actual interface{}, epsilon float64) float64 { + af, aok := toFloat(expected) + bf, bok := toFloat(actual) + + if !aok || !bok { + // invalid input + return 0 + } + + if af < 0 { + af = -af + } + if bf < 0 { + bf = -bf + } + var delta float64 + if af < bf { + delta = af * epsilon + } else { + delta = bf * epsilon + } + return delta +} + +// InEpsilon asserts that expected and actual have a relative error less than epsilon +// +// Returns whether the assertion was successful (true) or not (false). +func InEpsilon(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { + delta := calcEpsilonDelta(expected, actual, epsilon) + + return InDelta(t, expected, actual, delta, msgAndArgs...) +} + +// InEpsilonSlice is the same as InEpsilon, except it compares two slices. +func InEpsilonSlice(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + if expected == nil || actual == nil || + reflect.TypeOf(actual).Kind() != reflect.Slice || + reflect.TypeOf(expected).Kind() != reflect.Slice { + return Fail(t, fmt.Sprintf("Parameters must be slice"), msgAndArgs...) + } + + actualSlice := reflect.ValueOf(actual) + expectedSlice := reflect.ValueOf(expected) + + for i := 0; i < actualSlice.Len(); i++ { + result := InEpsilon(t, actualSlice.Index(i).Interface(), expectedSlice.Index(i).Interface(), delta) + if !result { + return result + } + } + + return true +} + +/* + Errors +*/ + +// NoError asserts that a function returned no error (i.e. `nil`). +// +// actualObj, err := SomeFunction() +// if assert.NoError(t, err) { +// assert.Equal(t, actualObj, expectedObj) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { + if isNil(err) { + return true + } + + return Fail(t, fmt.Sprintf("Received unexpected error %q", err), msgAndArgs...) +} + +// Error asserts that a function returned an error (i.e. not `nil`). +// +// actualObj, err := SomeFunction() +// if assert.Error(t, err, "An error was expected") { +// assert.Equal(t, err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func Error(t TestingT, err error, msgAndArgs ...interface{}) bool { + + message := messageFromMsgAndArgs(msgAndArgs...) + return NotNil(t, err, "An error is expected but got nil. %s", message) + +} + +// EqualError asserts that a function returned an error (i.e. not `nil`) +// and that it is equal to the provided error. +// +// actualObj, err := SomeFunction() +// if assert.Error(t, err, "An error was expected") { +// assert.Equal(t, err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) bool { + + message := messageFromMsgAndArgs(msgAndArgs...) + if !NotNil(t, theError, "An error is expected but got nil. %s", message) { + return false + } + s := "An error with value \"%s\" is expected but got \"%s\". %s" + return Equal(t, errString, theError.Error(), + s, errString, theError.Error(), message) +} + +// matchRegexp return true if a specified regexp matches a string. +func matchRegexp(rx interface{}, str interface{}) bool { + + var r *regexp.Regexp + if rr, ok := rx.(*regexp.Regexp); ok { + r = rr + } else { + r = regexp.MustCompile(fmt.Sprint(rx)) + } + + return (r.FindStringIndex(fmt.Sprint(str)) != nil) + +} + +// Regexp asserts that a specified regexp matches a string. +// +// assert.Regexp(t, regexp.MustCompile("start"), "it's starting") +// assert.Regexp(t, "start...$", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { + + match := matchRegexp(rx, str) + + if !match { + Fail(t, fmt.Sprintf("Expect \"%v\" to match \"%v\"", str, rx), msgAndArgs...) + } + + return match +} + +// NotRegexp asserts that a specified regexp does not match a string. +// +// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") +// assert.NotRegexp(t, "^start", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { + match := matchRegexp(rx, str) + + if match { + Fail(t, fmt.Sprintf("Expect \"%v\" to NOT match \"%v\"", str, rx), msgAndArgs...) + } + + return !match + +} + +// Zero asserts that i is the zero value for its type and returns the truth. +func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { + if i != nil && !reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { + return Fail(t, fmt.Sprintf("Should be zero, but was %v", i), msgAndArgs...) + } + return true +} + +// NotZero asserts that i is not the zero value for its type and returns the truth. +func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { + if i == nil || reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { + return Fail(t, fmt.Sprintf("Should not be zero, but was %v", i), msgAndArgs...) + } + return true +} + +// JSONEq asserts that two JSON strings are equivalent. +// +// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) +// +// Returns whether the assertion was successful (true) or not (false). +func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool { + var expectedJSONAsInterface, actualJSONAsInterface interface{} + + if err := json.Unmarshal([]byte(expected), &expectedJSONAsInterface); err != nil { + return Fail(t, fmt.Sprintf("Expected value ('%s') is not valid json.\nJSON parsing error: '%s'", expected, err.Error()), msgAndArgs...) + } + + if err := json.Unmarshal([]byte(actual), &actualJSONAsInterface); err != nil { + return Fail(t, fmt.Sprintf("Input ('%s') needs to be valid json.\nJSON parsing error: '%s'", actual, err.Error()), msgAndArgs...) + } + + return Equal(t, expectedJSONAsInterface, actualJSONAsInterface, msgAndArgs...) +} + +func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) { + t := reflect.TypeOf(v) + k := t.Kind() + + if k == reflect.Ptr { + t = t.Elem() + k = t.Kind() + } + return t, k +} + +// diff returns a diff of both values as long as both are of the same type and +// are a struct, map, slice or array. Otherwise it returns an empty string. +func diff(expected interface{}, actual interface{}) string { + if expected == nil || actual == nil { + return "" + } + + et, ek := typeAndKind(expected) + at, _ := typeAndKind(actual) + + if et != at { + return "" + } + + if ek != reflect.Struct && ek != reflect.Map && ek != reflect.Slice && ek != reflect.Array { + return "" + } + + spew.Config.SortKeys = true + e := spew.Sdump(expected) + a := spew.Sdump(actual) + + diff, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{ + A: difflib.SplitLines(e), + B: difflib.SplitLines(a), + FromFile: "Expected", + FromDate: "", + ToFile: "Actual", + ToDate: "", + Context: 1, + }) + + return "\n\nDiff:\n" + diff +} diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/doc.go b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/doc.go new file mode 100644 index 00000000000..c9dccc4d6cd --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/doc.go @@ -0,0 +1,45 @@ +// Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. +// +// Example Usage +// +// The following is a complete example using assert in a standard test function: +// import ( +// "testing" +// "github.com/stretchr/testify/assert" +// ) +// +// func TestSomething(t *testing.T) { +// +// var a string = "Hello" +// var b string = "Hello" +// +// assert.Equal(t, a, b, "The two words should be the same.") +// +// } +// +// if you assert many times, use the format below: +// +// import ( +// "testing" +// "github.com/stretchr/testify/assert" +// ) +// +// func TestSomething(t *testing.T) { +// assert := assert.New(t) +// +// var a string = "Hello" +// var b string = "Hello" +// +// assert.Equal(a, b, "The two words should be the same.") +// } +// +// Assertions +// +// Assertions allow you to easily write test code, and are global funcs in the `assert` package. +// All assertion functions take, as the first argument, the `*testing.T` object provided by the +// testing framework. This allows the assertion funcs to write the failings and other details to +// the correct place. +// +// Every assertion function also takes an optional string message as the final argument, +// allowing custom error messages to be appended to the message the assertion method outputs. +package assert diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/errors.go b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/errors.go new file mode 100644 index 00000000000..ac9dc9d1d61 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/errors.go @@ -0,0 +1,10 @@ +package assert + +import ( + "errors" +) + +// AnError is an error instance useful for testing. If the code does not care +// about error specifics, and only needs to return the error for example, this +// error should be used to make the test code more readable. +var AnError = errors.New("assert.AnError general error for testing") diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/forward_assertions.go b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/forward_assertions.go new file mode 100644 index 00000000000..fe6b664e076 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/forward_assertions.go @@ -0,0 +1,284 @@ +package assert + +import "time" + +// Assertions provides assertion methods around the +// TestingT interface. +type Assertions struct { + t TestingT +} + +// New makes a new Assertions object for the specified TestingT. +func New(t TestingT) *Assertions { + return &Assertions{ + t: t, + } +} + +// Fail reports a failure through +func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) bool { + return Fail(a.t, failureMessage, msgAndArgs...) +} + +// Implements asserts that an object is implemented by the specified interface. +// +// assert.Implements((*MyInterface)(nil), new(MyObject), "MyObject") +func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { + return Implements(a.t, interfaceObject, object, msgAndArgs...) +} + +// IsType asserts that the specified objects are of the same type. +func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { + return IsType(a.t, expectedType, object, msgAndArgs...) +} + +// Equal asserts that two objects are equal. +// +// assert.Equal(123, 123, "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Equal(expected, actual interface{}, msgAndArgs ...interface{}) bool { + return Equal(a.t, expected, actual, msgAndArgs...) +} + +// EqualValues asserts that two objects are equal or convertable to the same types +// and equal. +// +// assert.EqualValues(uint32(123), int32(123), "123 and 123 should be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) EqualValues(expected, actual interface{}, msgAndArgs ...interface{}) bool { + return EqualValues(a.t, expected, actual, msgAndArgs...) +} + +// Exactly asserts that two objects are equal is value and type. +// +// assert.Exactly(int32(123), int64(123), "123 and 123 should NOT be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Exactly(expected, actual interface{}, msgAndArgs ...interface{}) bool { + return Exactly(a.t, expected, actual, msgAndArgs...) +} + +// NotNil asserts that the specified object is not nil. +// +// assert.NotNil(err, "err should be something") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool { + return NotNil(a.t, object, msgAndArgs...) +} + +// Nil asserts that the specified object is nil. +// +// assert.Nil(err, "err should be nothing") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool { + return Nil(a.t, object, msgAndArgs...) +} + +// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or a +// slice with len == 0. +// +// assert.Empty(obj) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) bool { + return Empty(a.t, object, msgAndArgs...) +} + +// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or a +// slice with len == 0. +// +// if assert.NotEmpty(obj) { +// assert.Equal("two", obj[1]) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) bool { + return NotEmpty(a.t, object, msgAndArgs...) +} + +// Len asserts that the specified object has specific length. +// Len also fails if the object has a type that len() not accept. +// +// assert.Len(mySlice, 3, "The size of slice is not 3") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) bool { + return Len(a.t, object, length, msgAndArgs...) +} + +// True asserts that the specified value is true. +// +// assert.True(myBool, "myBool should be true") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) True(value bool, msgAndArgs ...interface{}) bool { + return True(a.t, value, msgAndArgs...) +} + +// False asserts that the specified value is false. +// +// assert.False(myBool, "myBool should be false") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) False(value bool, msgAndArgs ...interface{}) bool { + return False(a.t, value, msgAndArgs...) +} + +// NotEqual asserts that the specified values are NOT equal. +// +// assert.NotEqual(obj1, obj2, "two objects shouldn't be equal") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotEqual(expected, actual interface{}, msgAndArgs ...interface{}) bool { + return NotEqual(a.t, expected, actual, msgAndArgs...) +} + +// Contains asserts that the specified string contains the specified substring. +// +// assert.Contains("Hello World", "World", "But 'Hello World' does contain 'World'") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Contains(s, contains interface{}, msgAndArgs ...interface{}) bool { + return Contains(a.t, s, contains, msgAndArgs...) +} + +// NotContains asserts that the specified string does NOT contain the specified substring. +// +// assert.NotContains("Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotContains(s, contains interface{}, msgAndArgs ...interface{}) bool { + return NotContains(a.t, s, contains, msgAndArgs...) +} + +// Condition uses a Comparison to assert a complex condition. +func (a *Assertions) Condition(comp Comparison, msgAndArgs ...interface{}) bool { + return Condition(a.t, comp, msgAndArgs...) +} + +// Panics asserts that the code inside the specified PanicTestFunc panics. +// +// assert.Panics(func(){ +// GoCrazy() +// }, "Calling GoCrazy() should panic") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Panics(f PanicTestFunc, msgAndArgs ...interface{}) bool { + return Panics(a.t, f, msgAndArgs...) +} + +// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. +// +// assert.NotPanics(func(){ +// RemainCalm() +// }, "Calling RemainCalm() should NOT panic") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotPanics(f PanicTestFunc, msgAndArgs ...interface{}) bool { + return NotPanics(a.t, f, msgAndArgs...) +} + +// WithinDuration asserts that the two times are within duration delta of each other. +// +// assert.WithinDuration(time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) WithinDuration(expected, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool { + return WithinDuration(a.t, expected, actual, delta, msgAndArgs...) +} + +// InDelta asserts that the two numerals are within delta of each other. +// +// assert.InDelta(t, math.Pi, (22 / 7.0), 0.01) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) InDelta(expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + return InDelta(a.t, expected, actual, delta, msgAndArgs...) +} + +// InEpsilon asserts that expected and actual have a relative error less than epsilon +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) InEpsilon(expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { + return InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...) +} + +// NoError asserts that a function returned no error (i.e. `nil`). +// +// actualObj, err := SomeFunction() +// if assert.NoError(err) { +// assert.Equal(actualObj, expectedObj) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NoError(theError error, msgAndArgs ...interface{}) bool { + return NoError(a.t, theError, msgAndArgs...) +} + +// Error asserts that a function returned an error (i.e. not `nil`). +// +// actualObj, err := SomeFunction() +// if assert.Error(err, "An error was expected") { +// assert.Equal(err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Error(theError error, msgAndArgs ...interface{}) bool { + return Error(a.t, theError, msgAndArgs...) +} + +// EqualError asserts that a function returned an error (i.e. not `nil`) +// and that it is equal to the provided error. +// +// actualObj, err := SomeFunction() +// if assert.Error(err, "An error was expected") { +// assert.Equal(err, expectedError) +// } +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) bool { + return EqualError(a.t, theError, errString, msgAndArgs...) +} + +// Regexp asserts that a specified regexp matches a string. +// +// assert.Regexp(t, regexp.MustCompile("start"), "it's starting") +// assert.Regexp(t, "start...$", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { + return Regexp(a.t, rx, str, msgAndArgs...) +} + +// NotRegexp asserts that a specified regexp does not match a string. +// +// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") +// assert.NotRegexp(t, "^start", "it's not starting") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { + return NotRegexp(a.t, rx, str, msgAndArgs...) +} + +// Zero asserts that i is the zero value for its type and returns the truth. +func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) bool { + return Zero(a.t, i, msgAndArgs...) +} + +// NotZero asserts that i is not the zero value for its type and returns the truth. +func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) bool { + return NotZero(a.t, i, msgAndArgs...) +} + +// JSONEq asserts that two JSON strings are equivalent. +// +// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) bool { + return JSONEq(a.t, expected, actual, msgAndArgs...) +} diff --git a/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/http_assertions.go b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/http_assertions.go new file mode 100644 index 00000000000..437a86ce476 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/http_assertions.go @@ -0,0 +1,157 @@ +package assert + +import ( + "fmt" + "net/http" + "net/http/httptest" + "net/url" + "strings" +) + +// httpCode is a helper that returns HTTP code of the response. It returns -1 +// if building a new request fails. +func httpCode(handler http.HandlerFunc, method, url string, values url.Values) int { + w := httptest.NewRecorder() + req, err := http.NewRequest(method, url+"?"+values.Encode(), nil) + if err != nil { + return -1 + } + handler(w, req) + return w.Code +} + +// HTTPSuccess asserts that a specified handler returns a success status code. +// +// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool { + code := httpCode(handler, method, url, values) + if code == -1 { + return false + } + return code >= http.StatusOK && code <= http.StatusPartialContent +} + +// HTTPRedirect asserts that a specified handler returns a redirect status code. +// +// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool { + code := httpCode(handler, method, url, values) + if code == -1 { + return false + } + return code >= http.StatusMultipleChoices && code <= http.StatusTemporaryRedirect +} + +// HTTPError asserts that a specified handler returns an error status code. +// +// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool { + code := httpCode(handler, method, url, values) + if code == -1 { + return false + } + return code >= http.StatusBadRequest +} + +// HTTPBody is a helper that returns HTTP body of the response. It returns +// empty string if building a new request fails. +func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values) string { + w := httptest.NewRecorder() + req, err := http.NewRequest(method, url+"?"+values.Encode(), nil) + if err != nil { + return "" + } + handler(w, req) + return w.Body.String() +} + +// HTTPBodyContains asserts that a specified handler returns a +// body that contains a string. +// +// assert.HTTPBodyContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}) bool { + body := HTTPBody(handler, method, url, values) + + contains := strings.Contains(body, fmt.Sprint(str)) + if !contains { + Fail(t, fmt.Sprintf("Expected response body for \"%s\" to contain \"%s\" but found \"%s\"", url+"?"+values.Encode(), str, body)) + } + + return contains +} + +// HTTPBodyNotContains asserts that a specified handler returns a +// body that does not contain a string. +// +// assert.HTTPBodyNotContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}) bool { + body := HTTPBody(handler, method, url, values) + + contains := strings.Contains(body, fmt.Sprint(str)) + if contains { + Fail(t, "Expected response body for %s to NOT contain \"%s\" but found \"%s\"", url+"?"+values.Encode(), str, body) + } + + return !contains +} + +// +// Assertions Wrappers +// + +// HTTPSuccess asserts that a specified handler returns a success status code. +// +// assert.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method, url string, values url.Values) bool { + return HTTPSuccess(a.t, handler, method, url, values) +} + +// HTTPRedirect asserts that a specified handler returns a redirect status code. +// +// assert.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method, url string, values url.Values) bool { + return HTTPRedirect(a.t, handler, method, url, values) +} + +// HTTPError asserts that a specified handler returns an error status code. +// +// assert.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPError(handler http.HandlerFunc, method, url string, values url.Values) bool { + return HTTPError(a.t, handler, method, url, values) +} + +// HTTPBodyContains asserts that a specified handler returns a +// body that contains a string. +// +// assert.HTTPBodyContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method, url string, values url.Values, str interface{}) bool { + return HTTPBodyContains(a.t, handler, method, url, values, str) +} + +// HTTPBodyNotContains asserts that a specified handler returns a +// body that does not contain a string. +// +// assert.HTTPBodyNotContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// +// Returns whether the assertion was successful (true) or not (false). +func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method, url string, values url.Values, str interface{}) bool { + return HTTPBodyNotContains(a.t, handler, method, url, values, str) +} diff --git a/staging/src/k8s.io/client-go/_vendor/golang.org/x/crypto/AUTHORS b/staging/src/k8s.io/client-go/_vendor/golang.org/x/crypto/AUTHORS new file mode 100644 index 00000000000..15167cd746c --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/golang.org/x/crypto/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/staging/src/k8s.io/client-go/_vendor/golang.org/x/crypto/CONTRIBUTORS b/staging/src/k8s.io/client-go/_vendor/golang.org/x/crypto/CONTRIBUTORS new file mode 100644 index 00000000000..1c4577e9680 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/golang.org/x/crypto/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/staging/src/k8s.io/client-go/_vendor/golang.org/x/net/AUTHORS b/staging/src/k8s.io/client-go/_vendor/golang.org/x/net/AUTHORS new file mode 100644 index 00000000000..15167cd746c --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/golang.org/x/net/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/staging/src/k8s.io/client-go/_vendor/golang.org/x/net/CONTRIBUTORS b/staging/src/k8s.io/client-go/_vendor/golang.org/x/net/CONTRIBUTORS new file mode 100644 index 00000000000..1c4577e9680 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/golang.org/x/net/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/staging/src/k8s.io/client-go/_vendor/golang.org/x/sys/AUTHORS b/staging/src/k8s.io/client-go/_vendor/golang.org/x/sys/AUTHORS new file mode 100644 index 00000000000..15167cd746c --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/golang.org/x/sys/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/staging/src/k8s.io/client-go/_vendor/golang.org/x/sys/CONTRIBUTORS b/staging/src/k8s.io/client-go/_vendor/golang.org/x/sys/CONTRIBUTORS new file mode 100644 index 00000000000..1c4577e9680 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/golang.org/x/sys/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/staging/src/k8s.io/client-go/_vendor/golang.org/x/text/AUTHORS b/staging/src/k8s.io/client-go/_vendor/golang.org/x/text/AUTHORS new file mode 100644 index 00000000000..15167cd746c --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/golang.org/x/text/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/staging/src/k8s.io/client-go/_vendor/golang.org/x/text/CONTRIBUTORS b/staging/src/k8s.io/client-go/_vendor/golang.org/x/text/CONTRIBUTORS new file mode 100644 index 00000000000..1c4577e9680 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/golang.org/x/text/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/staging/src/k8s.io/client-go/discovery/discovery_client.go b/staging/src/k8s.io/client-go/discovery/discovery_client.go index 51c32312571..f9a3686962c 100644 --- a/staging/src/k8s.io/client-go/discovery/discovery_client.go +++ b/staging/src/k8s.io/client-go/discovery/discovery_client.go @@ -45,6 +45,15 @@ type DiscoveryInterface interface { SwaggerSchemaInterface } +// CachedDiscoveryInterface is a DiscoveryInterface with cache invalidation and freshness. +type CachedDiscoveryInterface interface { + DiscoveryInterface + // Fresh returns true if no cached data was used that had been retrieved before the instantiation. + Fresh() bool + // Invalidate enforces that no cached data is used in the future that is older than the current time. + Invalidate() +} + // ServerGroupsInterface has methods for obtaining supported groups on the API server type ServerGroupsInterface interface { // ServerGroups returns the supported groups, with information like supported versions and the diff --git a/staging/src/k8s.io/client-go/discovery/helper.go b/staging/src/k8s.io/client-go/discovery/helper.go index 0e830d8590a..9494735ddf6 100644 --- a/staging/src/k8s.io/client-go/discovery/helper.go +++ b/staging/src/k8s.io/client-go/discovery/helper.go @@ -22,7 +22,6 @@ import ( "k8s.io/client-go/pkg/api/unversioned" "k8s.io/client-go/pkg/util/sets" "k8s.io/client-go/pkg/version" - "k8s.io/client-go/rest" // Import solely to initialize client auth plugins. _ "k8s.io/client-go/plugin/pkg/client/auth" ) @@ -30,14 +29,7 @@ import ( // MatchesServerVersion queries the server to compares the build version // (git hash) of the client with the server's build version. It returns an error // if it failed to contact the server or if the versions are not an exact match. -func MatchesServerVersion(client DiscoveryInterface, c *rest.Config) error { - var err error - if client == nil { - client, err = NewDiscoveryClientForConfig(c) - if err != nil { - return err - } - } +func MatchesServerVersion(client DiscoveryInterface) error { cVer := version.Get() sVer, err := client.ServerVersion() if err != nil { @@ -55,19 +47,9 @@ func MatchesServerVersion(client DiscoveryInterface, c *rest.Config) error { // a version that both client and server support. // - If no version is provided, try registered client versions in order of // preference. -// - If version is provided, but not default config (explicitly requested via -// commandline flag), and is unsupported by the server, print a warning to -// stderr and try client's registered versions in order of preference. -// - If version is config default, and the server does not support it, +// - If version is provided and the server does not support it, // return an error. -func NegotiateVersion(client DiscoveryInterface, c *rest.Config, requestedGV *unversioned.GroupVersion, clientRegisteredGVs []unversioned.GroupVersion) (*unversioned.GroupVersion, error) { - var err error - if client == nil { - client, err = NewDiscoveryClientForConfig(c) - if err != nil { - return nil, err - } - } +func NegotiateVersion(client DiscoveryInterface, requiredGV *unversioned.GroupVersion, clientRegisteredGVs []unversioned.GroupVersion) (*unversioned.GroupVersion, error) { clientVersions := sets.String{} for _, gv := range clientRegisteredGVs { clientVersions.Insert(gv.String()) @@ -84,37 +66,23 @@ func NegotiateVersion(client DiscoveryInterface, c *rest.Config, requestedGV *un serverVersions.Insert(v) } - // If no version requested, use config version (may also be empty). - // make a copy of the original so we don't risk mutating input here or in the returned value - var preferredGV *unversioned.GroupVersion - switch { - case requestedGV != nil: - t := *requestedGV - preferredGV = &t - case c.GroupVersion != nil: - t := *c.GroupVersion - preferredGV = &t - } - // If version explicitly requested verify that both client and server support it. // If server does not support warn, but try to negotiate a lower version. - if preferredGV != nil { - if !clientVersions.Has(preferredGV.String()) { - return nil, fmt.Errorf("client does not support API version %q; client supported API versions: %v", preferredGV, clientVersions) + if requiredGV != nil { + if !clientVersions.Has(requiredGV.String()) { + return nil, fmt.Errorf("client does not support API version %q; client supported API versions: %v", requiredGV, clientVersions) } // If the server supports no versions, then we should just use the preferredGV // This can happen because discovery fails due to 403 Forbidden errors if len(serverVersions) == 0 { - return preferredGV, nil + return requiredGV, nil } - if serverVersions.Has(preferredGV.String()) { - return preferredGV, nil + if serverVersions.Has(requiredGV.String()) { + return requiredGV, nil } // If we are using an explicit config version the server does not support, fail. - if (c.GroupVersion != nil) && (*preferredGV == *c.GroupVersion) { - return nil, fmt.Errorf("server does not support API version %q", preferredGV) - } + return nil, fmt.Errorf("server does not support API version %q", requiredGV) } for _, clientGV := range clientRegisteredGVs { @@ -130,6 +98,12 @@ func NegotiateVersion(client DiscoveryInterface, c *rest.Config, requestedGV *un return &t, nil } } + + // if we have no server versions and we have no required version, choose the first clientRegisteredVersion + if len(serverVersions) == 0 && len(clientRegisteredGVs) > 0 { + return &clientRegisteredGVs[0], nil + } + return nil, fmt.Errorf("failed to negotiate an api version; server supports: %v, client supports: %v", serverVersions, clientVersions) } diff --git a/staging/src/k8s.io/client-go/discovery/helper_blackbox_test.go b/staging/src/k8s.io/client-go/discovery/helper_blackbox_test.go index d227797cff2..dd6433b0e80 100644 --- a/staging/src/k8s.io/client-go/discovery/helper_blackbox_test.go +++ b/staging/src/k8s.io/client-go/discovery/helper_blackbox_test.go @@ -47,19 +47,16 @@ func objBody(object interface{}) io.ReadCloser { func TestNegotiateVersion(t *testing.T) { tests := []struct { name string - version *uapi.GroupVersion + requiredVersion *uapi.GroupVersion expectedVersion *uapi.GroupVersion serverVersions []string clientVersions []uapi.GroupVersion - config *rest.Config expectErr func(err error) bool sendErr error statusCode int }{ { name: "server supports client default", - version: &uapi.GroupVersion{Version: "version1"}, - config: &rest.Config{}, serverVersions: []string{"version1", registered.GroupOrDie(api.GroupName).GroupVersion.String()}, clientVersions: []uapi.GroupVersion{{Version: "version1"}, registered.GroupOrDie(api.GroupName).GroupVersion}, expectedVersion: &uapi.GroupVersion{Version: "version1"}, @@ -67,8 +64,6 @@ func TestNegotiateVersion(t *testing.T) { }, { name: "server falls back to client supported", - version: ®istered.GroupOrDie(api.GroupName).GroupVersion, - config: &rest.Config{}, serverVersions: []string{"version1"}, clientVersions: []uapi.GroupVersion{{Version: "version1"}, registered.GroupOrDie(api.GroupName).GroupVersion}, expectedVersion: &uapi.GroupVersion{Version: "version1"}, @@ -76,23 +71,30 @@ func TestNegotiateVersion(t *testing.T) { }, { name: "explicit version supported", - config: &rest.Config{ContentConfig: rest.ContentConfig{GroupVersion: ®istered.GroupOrDie(api.GroupName).GroupVersion}}, + requiredVersion: &uapi.GroupVersion{Version: "v1"}, serverVersions: []string{"/version1", registered.GroupOrDie(api.GroupName).GroupVersion.String()}, clientVersions: []uapi.GroupVersion{{Version: "version1"}, registered.GroupOrDie(api.GroupName).GroupVersion}, - expectedVersion: ®istered.GroupOrDie(api.GroupName).GroupVersion, + expectedVersion: &uapi.GroupVersion{Version: "v1"}, statusCode: http.StatusOK, }, { - name: "explicit version not supported", - config: &rest.Config{ContentConfig: rest.ContentConfig{GroupVersion: ®istered.GroupOrDie(api.GroupName).GroupVersion}}, - serverVersions: []string{"version1"}, - clientVersions: []uapi.GroupVersion{{Version: "version1"}, registered.GroupOrDie(api.GroupName).GroupVersion}, - expectErr: func(err error) bool { return strings.Contains(err.Error(), `server does not support API version "v1"`) }, - statusCode: http.StatusOK, + name: "explicit version not supported on server", + requiredVersion: &uapi.GroupVersion{Version: "v1"}, + serverVersions: []string{"version1"}, + clientVersions: []uapi.GroupVersion{{Version: "version1"}, registered.GroupOrDie(api.GroupName).GroupVersion}, + expectErr: func(err error) bool { return strings.Contains(err.Error(), `server does not support API version "v1"`) }, + statusCode: http.StatusOK, + }, + { + name: "explicit version not supported on client", + requiredVersion: &uapi.GroupVersion{Version: "v1"}, + serverVersions: []string{"v1"}, + clientVersions: []uapi.GroupVersion{{Version: "version1"}}, + expectErr: func(err error) bool { return strings.Contains(err.Error(), `client does not support API version "v1"`) }, + statusCode: http.StatusOK, }, { name: "connection refused error", - config: &rest.Config{ContentConfig: rest.ContentConfig{GroupVersion: ®istered.GroupOrDie(api.GroupName).GroupVersion}}, serverVersions: []string{"version1"}, clientVersions: []uapi.GroupVersion{{Version: "version1"}, registered.GroupOrDie(api.GroupName).GroupVersion}, sendErr: errors.New("connection refused"), @@ -101,25 +103,21 @@ func TestNegotiateVersion(t *testing.T) { }, { name: "discovery fails due to 403 Forbidden errors and thus serverVersions is empty, use default GroupVersion", - config: &rest.Config{ContentConfig: rest.ContentConfig{GroupVersion: ®istered.GroupOrDie(api.GroupName).GroupVersion}}, clientVersions: []uapi.GroupVersion{{Version: "version1"}, registered.GroupOrDie(api.GroupName).GroupVersion}, - expectedVersion: ®istered.GroupOrDie(api.GroupName).GroupVersion, + expectedVersion: &uapi.GroupVersion{Version: "version1"}, statusCode: http.StatusForbidden, }, { name: "discovery fails due to 404 Not Found errors and thus serverVersions is empty, use requested GroupVersion", - version: &uapi.GroupVersion{Version: "version1"}, - config: &rest.Config{ContentConfig: rest.ContentConfig{GroupVersion: ®istered.GroupOrDie(api.GroupName).GroupVersion}}, + requiredVersion: &uapi.GroupVersion{Version: "version1"}, clientVersions: []uapi.GroupVersion{{Version: "version1"}, registered.GroupOrDie(api.GroupName).GroupVersion}, expectedVersion: &uapi.GroupVersion{Version: "version1"}, statusCode: http.StatusNotFound, }, { - name: "discovery fails due to 403 Forbidden errors and thus serverVersions is empty, no fallback GroupVersion", - config: &rest.Config{}, - clientVersions: []uapi.GroupVersion{{Version: "version1"}, registered.GroupOrDie(api.GroupName).GroupVersion}, - expectErr: func(err error) bool { return strings.Contains(err.Error(), "failed to negotiate an api version;") }, - statusCode: http.StatusForbidden, + name: "discovery fails due to 403 Forbidden errors and thus serverVersions is empty, no fallback GroupVersion", + expectErr: func(err error) bool { return strings.Contains(err.Error(), "failed to negotiate an api version;") }, + statusCode: http.StatusForbidden, }, } @@ -139,9 +137,9 @@ func TestNegotiateVersion(t *testing.T) { return &http.Response{StatusCode: test.statusCode, Header: header, Body: objBody(&uapi.APIVersions{Versions: test.serverVersions})}, nil }), } - c := discovery.NewDiscoveryClientForConfigOrDie(test.config) + c := discovery.NewDiscoveryClientForConfigOrDie(&rest.Config{}) c.RESTClient().(*rest.RESTClient).Client = fakeClient.Client - response, err := discovery.NegotiateVersion(c, test.config, test.version, test.clientVersions) + response, err := discovery.NegotiateVersion(c, test.requiredVersion, test.clientVersions) if err == nil && test.expectErr != nil { t.Errorf("expected error, got nil for [%s].", test.name) } diff --git a/staging/src/k8s.io/client-go/discovery/restmapper.go b/staging/src/k8s.io/client-go/discovery/restmapper.go index c3fcc09106d..7f846d2fb16 100644 --- a/staging/src/k8s.io/client-go/discovery/restmapper.go +++ b/staging/src/k8s.io/client-go/discovery/restmapper.go @@ -23,6 +23,8 @@ import ( "k8s.io/client-go/pkg/api/errors" "k8s.io/client-go/pkg/api/meta" "k8s.io/client-go/pkg/api/unversioned" + + "github.com/golang/glog" ) // APIGroupResources is an API group with a mapping of versions to @@ -35,7 +37,7 @@ type APIGroupResources struct { } // NewRESTMapper returns a PriorityRESTMapper based on the discovered -// groups and resourced passed in. +// groups and resources passed in. func NewRESTMapper(groupResources []*APIGroupResources, versionInterfaces meta.VersionInterfacesFunc) meta.RESTMapper { unionMapper := meta.MultiRESTMapper{} @@ -47,8 +49,8 @@ func NewRESTMapper(groupResources []*APIGroupResources, versionInterfaces meta.V groupPriority = append(groupPriority, group.Group.Name) if len(group.Group.PreferredVersion.Version) != 0 { - preffered := group.Group.PreferredVersion.Version - if _, ok := group.VersionedResources[preffered]; ok { + preferred := group.Group.PreferredVersion.Version + if _, ok := group.VersionedResources[preferred]; ok { resourcePriority = append(resourcePriority, unversioned.GroupVersionResource{ Group: group.Group.Name, Version: group.Group.PreferredVersion.Version, @@ -141,14 +143,14 @@ func GetAPIGroupResources(cl DiscoveryInterface) ([]*APIGroupResources, error) { type DeferredDiscoveryRESTMapper struct { initMu sync.Mutex delegate meta.RESTMapper - cl DiscoveryInterface + cl CachedDiscoveryInterface versionInterface meta.VersionInterfacesFunc } // NewDeferredDiscoveryRESTMapper returns a // DeferredDiscoveryRESTMapper that will lazily query the provided // client for discovery information to do REST mappings. -func NewDeferredDiscoveryRESTMapper(cl DiscoveryInterface, versionInterface meta.VersionInterfacesFunc) *DeferredDiscoveryRESTMapper { +func NewDeferredDiscoveryRESTMapper(cl CachedDiscoveryInterface, versionInterface meta.VersionInterfacesFunc) *DeferredDiscoveryRESTMapper { return &DeferredDiscoveryRESTMapper{ cl: cl, versionInterface: versionInterface, @@ -175,79 +177,118 @@ func (d *DeferredDiscoveryRESTMapper) getDelegate() (meta.RESTMapper, error) { // Reset resets the internally cached Discovery information and will // cause the next mapping request to re-discover. func (d *DeferredDiscoveryRESTMapper) Reset() { + glog.V(5).Info("Invalidating discovery information") + d.initMu.Lock() + defer d.initMu.Unlock() + + d.cl.Invalidate() d.delegate = nil - d.initMu.Unlock() } // KindFor takes a partial resource and returns back the single match. // It returns an error if there are multiple matches. -func (d *DeferredDiscoveryRESTMapper) KindFor(resource unversioned.GroupVersionResource) (unversioned.GroupVersionKind, error) { +func (d *DeferredDiscoveryRESTMapper) KindFor(resource unversioned.GroupVersionResource) (gvk unversioned.GroupVersionKind, err error) { del, err := d.getDelegate() if err != nil { return unversioned.GroupVersionKind{}, err } - return del.KindFor(resource) + gvk, err = del.KindFor(resource) + if err != nil && !d.cl.Fresh() { + d.Reset() + gvk, err = d.KindFor(resource) + } + return } // KindsFor takes a partial resource and returns back the list of // potential kinds in priority order. -func (d *DeferredDiscoveryRESTMapper) KindsFor(resource unversioned.GroupVersionResource) ([]unversioned.GroupVersionKind, error) { +func (d *DeferredDiscoveryRESTMapper) KindsFor(resource unversioned.GroupVersionResource) (gvks []unversioned.GroupVersionKind, err error) { del, err := d.getDelegate() if err != nil { return nil, err } - return del.KindsFor(resource) + gvks, err = del.KindsFor(resource) + if len(gvks) == 0 && !d.cl.Fresh() { + d.Reset() + gvks, err = d.KindsFor(resource) + } + return } // ResourceFor takes a partial resource and returns back the single // match. It returns an error if there are multiple matches. -func (d *DeferredDiscoveryRESTMapper) ResourceFor(input unversioned.GroupVersionResource) (unversioned.GroupVersionResource, error) { +func (d *DeferredDiscoveryRESTMapper) ResourceFor(input unversioned.GroupVersionResource) (gvr unversioned.GroupVersionResource, err error) { del, err := d.getDelegate() if err != nil { return unversioned.GroupVersionResource{}, err } - return del.ResourceFor(input) + gvr, err = del.ResourceFor(input) + if err != nil && !d.cl.Fresh() { + d.Reset() + gvr, err = d.ResourceFor(input) + } + return } // ResourcesFor takes a partial resource and returns back the list of // potential resource in priority order. -func (d *DeferredDiscoveryRESTMapper) ResourcesFor(input unversioned.GroupVersionResource) ([]unversioned.GroupVersionResource, error) { +func (d *DeferredDiscoveryRESTMapper) ResourcesFor(input unversioned.GroupVersionResource) (gvrs []unversioned.GroupVersionResource, err error) { del, err := d.getDelegate() if err != nil { return nil, err } - return del.ResourcesFor(input) + gvrs, err = del.ResourcesFor(input) + if len(gvrs) == 0 && !d.cl.Fresh() { + d.Reset() + gvrs, err = d.ResourcesFor(input) + } + return } // RESTMapping identifies a preferred resource mapping for the // provided group kind. -func (d *DeferredDiscoveryRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...string) (*meta.RESTMapping, error) { +func (d *DeferredDiscoveryRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...string) (m *meta.RESTMapping, err error) { del, err := d.getDelegate() if err != nil { return nil, err } - return del.RESTMapping(gk, versions...) + m, err = del.RESTMapping(gk, versions...) + if err != nil && !d.cl.Fresh() { + d.Reset() + m, err = d.RESTMapping(gk, versions...) + } + return } // RESTMappings returns the RESTMappings for the provided group kind // in a rough internal preferred order. If no kind is found, it will // return a NoResourceMatchError. -func (d *DeferredDiscoveryRESTMapper) RESTMappings(gk unversioned.GroupKind) ([]*meta.RESTMapping, error) { +func (d *DeferredDiscoveryRESTMapper) RESTMappings(gk unversioned.GroupKind) (ms []*meta.RESTMapping, err error) { del, err := d.getDelegate() if err != nil { return nil, err } - return del.RESTMappings(gk) + ms, err = del.RESTMappings(gk) + if len(ms) == 0 && !d.cl.Fresh() { + d.Reset() + ms, err = d.RESTMappings(gk) + } + return } // AliasesForResource returns whether a resource has an alias or not. -func (d *DeferredDiscoveryRESTMapper) AliasesForResource(resource string) ([]string, bool) { +func (d *DeferredDiscoveryRESTMapper) AliasesForResource(resource string) (as []string, ok bool) { del, err := d.getDelegate() if err != nil { return nil, false } - return del.AliasesForResource(resource) + as, ok = del.AliasesForResource(resource) + if len(as) == 0 && !d.cl.Fresh() { + d.Reset() + as, ok = d.AliasesForResource(resource) + } + return } // ResourceSingularizer converts a resource name from plural to @@ -257,7 +298,12 @@ func (d *DeferredDiscoveryRESTMapper) ResourceSingularizer(resource string) (sin if err != nil { return resource, err } - return del.ResourceSingularizer(resource) + singular, err = del.ResourceSingularizer(resource) + if err != nil && !d.cl.Fresh() { + d.Reset() + singular, err = d.ResourceSingularizer(resource) + } + return } func (d *DeferredDiscoveryRESTMapper) String() string { diff --git a/staging/src/k8s.io/client-go/discovery/restmapper_test.go b/staging/src/k8s.io/client-go/discovery/restmapper_test.go index ac6fa09d5f6..9baf273b5f0 100644 --- a/staging/src/k8s.io/client-go/discovery/restmapper_test.go +++ b/staging/src/k8s.io/client-go/discovery/restmapper_test.go @@ -20,7 +20,15 @@ import ( "reflect" "testing" + "k8s.io/client-go/pkg/api/errors" "k8s.io/client-go/pkg/api/unversioned" + "k8s.io/client-go/pkg/apimachinery/registered" + "k8s.io/client-go/pkg/version" + "k8s.io/client-go/rest" + "k8s.io/client-go/rest/fake" + + "github.com/emicklei/go-restful/swagger" + "github.com/stretchr/testify/assert" ) func TestRESTMapper(t *testing.T) { @@ -174,3 +182,144 @@ func TestRESTMapper(t *testing.T) { } } } + +func TestDeferredDiscoveryRESTMapper_CacheMiss(t *testing.T) { + assert := assert.New(t) + + cdc := fakeCachedDiscoveryInterface{fresh: false} + m := NewDeferredDiscoveryRESTMapper(&cdc, registered.InterfacesFor) + assert.False(cdc.fresh, "should NOT be fresh after instantiation") + assert.Zero(cdc.invalidateCalls, "should not have called Invalidate()") + + gvk, err := m.KindFor(unversioned.GroupVersionResource{ + Group: "a", + Version: "v1", + Resource: "foo", + }) + assert.NoError(err) + assert.True(cdc.fresh, "should be fresh after a cache-miss") + assert.Equal(cdc.invalidateCalls, 1, "should have called Invalidate() once") + assert.Equal(gvk.Kind, "Foo") + + gvk, err = m.KindFor(unversioned.GroupVersionResource{ + Group: "a", + Version: "v1", + Resource: "foo", + }) + assert.NoError(err) + assert.Equal(cdc.invalidateCalls, 1, "should NOT have called Invalidate() again") + + gvk, err = m.KindFor(unversioned.GroupVersionResource{ + Group: "a", + Version: "v1", + Resource: "bar", + }) + assert.Error(err) + assert.Equal(cdc.invalidateCalls, 1, "should NOT have called Invalidate() again after another cache-miss, but with fresh==true") + + cdc.fresh = false + gvk, err = m.KindFor(unversioned.GroupVersionResource{ + Group: "a", + Version: "v1", + Resource: "bar", + }) + assert.Error(err) + assert.Equal(cdc.invalidateCalls, 2, "should HAVE called Invalidate() again after another cache-miss, but with fresh==false") +} + +type fakeCachedDiscoveryInterface struct { + invalidateCalls int + fresh bool + enabledA bool +} + +var _ CachedDiscoveryInterface = &fakeCachedDiscoveryInterface{} + +func (c *fakeCachedDiscoveryInterface) Fresh() bool { + return c.fresh +} + +func (c *fakeCachedDiscoveryInterface) Invalidate() { + c.invalidateCalls = c.invalidateCalls + 1 + c.fresh = true + c.enabledA = true +} + +func (c *fakeCachedDiscoveryInterface) RESTClient() rest.Interface { + return &fake.RESTClient{} +} + +func (c *fakeCachedDiscoveryInterface) ServerGroups() (*unversioned.APIGroupList, error) { + if c.enabledA { + return &unversioned.APIGroupList{ + Groups: []unversioned.APIGroup{ + { + Name: "a", + Versions: []unversioned.GroupVersionForDiscovery{ + { + GroupVersion: "a/v1", + Version: "v1", + }, + }, + PreferredVersion: unversioned.GroupVersionForDiscovery{ + GroupVersion: "a/v1", + Version: "v1", + }, + }, + }, + }, nil + } + return &unversioned.APIGroupList{}, nil +} + +func (c *fakeCachedDiscoveryInterface) ServerResourcesForGroupVersion(groupVersion string) (*unversioned.APIResourceList, error) { + if c.enabledA && groupVersion == "a/v1" { + return &unversioned.APIResourceList{ + GroupVersion: "a/v1", + APIResources: []unversioned.APIResource{ + { + Name: "foo", + Kind: "Foo", + Namespaced: false, + }, + }, + }, nil + } + + return nil, errors.NewNotFound(unversioned.GroupResource{}, "") +} + +func (c *fakeCachedDiscoveryInterface) ServerResources() (map[string]*unversioned.APIResourceList, error) { + if c.enabledA { + av1, _ := c.ServerResourcesForGroupVersion("a/v1") + return map[string]*unversioned.APIResourceList{ + "a/v1": av1, + }, nil + } + return map[string]*unversioned.APIResourceList{}, nil +} + +func (c *fakeCachedDiscoveryInterface) ServerPreferredResources() ([]unversioned.GroupVersionResource, error) { + if c.enabledA { + return []unversioned.GroupVersionResource{ + { + Group: "a", + Version: "v1", + Resource: "foo", + }, + }, nil + } + return []unversioned.GroupVersionResource{}, nil +} + +func (c *fakeCachedDiscoveryInterface) ServerPreferredNamespacedResources() ([]unversioned.GroupVersionResource, error) { + return []unversioned.GroupVersionResource{}, nil +} + +func (c *fakeCachedDiscoveryInterface) ServerVersion() (*version.Info, error) { + return &version.Info{}, nil +} + +func (c *fakeCachedDiscoveryInterface) SwaggerSchema(version unversioned.GroupVersion) (*swagger.ApiDeclaration, error) { + return &swagger.ApiDeclaration{}, nil +} diff --git a/staging/src/k8s.io/client-go/kubernetes/clientset.go b/staging/src/k8s.io/client-go/kubernetes/clientset.go index 6f6bce57ce1..432162a87a6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/clientset.go +++ b/staging/src/k8s.io/client-go/kubernetes/clientset.go @@ -19,15 +19,16 @@ package kubernetes import ( "github.com/golang/glog" discovery "k8s.io/client-go/discovery" - v1alpha1apps "k8s.io/client-go/kubernetes/typed/apps/v1alpha1" + v1beta1apps "k8s.io/client-go/kubernetes/typed/apps/v1beta1" v1beta1authentication "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" v1beta1authorization "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" v1autoscaling "k8s.io/client-go/kubernetes/typed/autoscaling/v1" v1batch "k8s.io/client-go/kubernetes/typed/batch/v1" + v2alpha1batch "k8s.io/client-go/kubernetes/typed/batch/v2alpha1" v1alpha1certificates "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1" v1core "k8s.io/client-go/kubernetes/typed/core/v1" v1beta1extensions "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" - v1alpha1policy "k8s.io/client-go/kubernetes/typed/policy/v1alpha1" + v1beta1policy "k8s.io/client-go/kubernetes/typed/policy/v1beta1" v1alpha1rbac "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" v1beta1storage "k8s.io/client-go/kubernetes/typed/storage/v1beta1" "k8s.io/client-go/pkg/util/flowcontrol" @@ -37,122 +38,254 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - Core() v1core.CoreInterface - Apps() v1alpha1apps.AppsInterface - Authentication() v1beta1authentication.AuthenticationInterface - Authorization() v1beta1authorization.AuthorizationInterface - Autoscaling() v1autoscaling.AutoscalingInterface - Batch() v1batch.BatchInterface - Certificates() v1alpha1certificates.CertificatesInterface - Extensions() v1beta1extensions.ExtensionsInterface - Policy() v1alpha1policy.PolicyInterface - Rbac() v1alpha1rbac.RbacInterface - Storage() v1beta1storage.StorageInterface + CoreV1() v1core.CoreV1Interface + // Deprecated: please explicitly pick a version if possible. + Core() v1core.CoreV1Interface + AppsV1beta1() v1beta1apps.AppsV1beta1Interface + // Deprecated: please explicitly pick a version if possible. + Apps() v1beta1apps.AppsV1beta1Interface + AuthenticationV1beta1() v1beta1authentication.AuthenticationV1beta1Interface + // Deprecated: please explicitly pick a version if possible. + Authentication() v1beta1authentication.AuthenticationV1beta1Interface + AuthorizationV1beta1() v1beta1authorization.AuthorizationV1beta1Interface + // Deprecated: please explicitly pick a version if possible. + Authorization() v1beta1authorization.AuthorizationV1beta1Interface + AutoscalingV1() v1autoscaling.AutoscalingV1Interface + // Deprecated: please explicitly pick a version if possible. + Autoscaling() v1autoscaling.AutoscalingV1Interface + BatchV1() v1batch.BatchV1Interface + // Deprecated: please explicitly pick a version if possible. + Batch() v1batch.BatchV1Interface + BatchV2alpha1() v2alpha1batch.BatchV2alpha1Interface + + CertificatesV1alpha1() v1alpha1certificates.CertificatesV1alpha1Interface + // Deprecated: please explicitly pick a version if possible. + Certificates() v1alpha1certificates.CertificatesV1alpha1Interface + ExtensionsV1beta1() v1beta1extensions.ExtensionsV1beta1Interface + // Deprecated: please explicitly pick a version if possible. + Extensions() v1beta1extensions.ExtensionsV1beta1Interface + PolicyV1beta1() v1beta1policy.PolicyV1beta1Interface + // Deprecated: please explicitly pick a version if possible. + Policy() v1beta1policy.PolicyV1beta1Interface + RbacV1alpha1() v1alpha1rbac.RbacV1alpha1Interface + // Deprecated: please explicitly pick a version if possible. + Rbac() v1alpha1rbac.RbacV1alpha1Interface + StorageV1beta1() v1beta1storage.StorageV1beta1Interface + // Deprecated: please explicitly pick a version if possible. + Storage() v1beta1storage.StorageV1beta1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - *v1core.CoreClient - *v1alpha1apps.AppsClient - *v1beta1authentication.AuthenticationClient - *v1beta1authorization.AuthorizationClient - *v1autoscaling.AutoscalingClient - *v1batch.BatchClient - *v1alpha1certificates.CertificatesClient - *v1beta1extensions.ExtensionsClient - *v1alpha1policy.PolicyClient - *v1alpha1rbac.RbacClient - *v1beta1storage.StorageClient + *v1core.CoreV1Client + *v1beta1apps.AppsV1beta1Client + *v1beta1authentication.AuthenticationV1beta1Client + *v1beta1authorization.AuthorizationV1beta1Client + *v1autoscaling.AutoscalingV1Client + *v1batch.BatchV1Client + *v2alpha1batch.BatchV2alpha1Client + *v1alpha1certificates.CertificatesV1alpha1Client + *v1beta1extensions.ExtensionsV1beta1Client + *v1beta1policy.PolicyV1beta1Client + *v1alpha1rbac.RbacV1alpha1Client + *v1beta1storage.StorageV1beta1Client } -// Core retrieves the CoreClient -func (c *Clientset) Core() v1core.CoreInterface { +// CoreV1 retrieves the CoreV1Client +func (c *Clientset) CoreV1() v1core.CoreV1Interface { if c == nil { return nil } - return c.CoreClient + return c.CoreV1Client } -// Apps retrieves the AppsClient -func (c *Clientset) Apps() v1alpha1apps.AppsInterface { +// Deprecated: Core retrieves the default version of CoreClient. +// Please explicitly pick a version. +func (c *Clientset) Core() v1core.CoreV1Interface { if c == nil { return nil } - return c.AppsClient + return c.CoreV1Client } -// Authentication retrieves the AuthenticationClient -func (c *Clientset) Authentication() v1beta1authentication.AuthenticationInterface { +// AppsV1beta1 retrieves the AppsV1beta1Client +func (c *Clientset) AppsV1beta1() v1beta1apps.AppsV1beta1Interface { if c == nil { return nil } - return c.AuthenticationClient + return c.AppsV1beta1Client } -// Authorization retrieves the AuthorizationClient -func (c *Clientset) Authorization() v1beta1authorization.AuthorizationInterface { +// Deprecated: Apps retrieves the default version of AppsClient. +// Please explicitly pick a version. +func (c *Clientset) Apps() v1beta1apps.AppsV1beta1Interface { if c == nil { return nil } - return c.AuthorizationClient + return c.AppsV1beta1Client } -// Autoscaling retrieves the AutoscalingClient -func (c *Clientset) Autoscaling() v1autoscaling.AutoscalingInterface { +// AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client +func (c *Clientset) AuthenticationV1beta1() v1beta1authentication.AuthenticationV1beta1Interface { if c == nil { return nil } - return c.AutoscalingClient + return c.AuthenticationV1beta1Client } -// Batch retrieves the BatchClient -func (c *Clientset) Batch() v1batch.BatchInterface { +// Deprecated: Authentication retrieves the default version of AuthenticationClient. +// Please explicitly pick a version. +func (c *Clientset) Authentication() v1beta1authentication.AuthenticationV1beta1Interface { if c == nil { return nil } - return c.BatchClient + return c.AuthenticationV1beta1Client } -// Certificates retrieves the CertificatesClient -func (c *Clientset) Certificates() v1alpha1certificates.CertificatesInterface { +// AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client +func (c *Clientset) AuthorizationV1beta1() v1beta1authorization.AuthorizationV1beta1Interface { if c == nil { return nil } - return c.CertificatesClient + return c.AuthorizationV1beta1Client } -// Extensions retrieves the ExtensionsClient -func (c *Clientset) Extensions() v1beta1extensions.ExtensionsInterface { +// Deprecated: Authorization retrieves the default version of AuthorizationClient. +// Please explicitly pick a version. +func (c *Clientset) Authorization() v1beta1authorization.AuthorizationV1beta1Interface { if c == nil { return nil } - return c.ExtensionsClient + return c.AuthorizationV1beta1Client } -// Policy retrieves the PolicyClient -func (c *Clientset) Policy() v1alpha1policy.PolicyInterface { +// AutoscalingV1 retrieves the AutoscalingV1Client +func (c *Clientset) AutoscalingV1() v1autoscaling.AutoscalingV1Interface { if c == nil { return nil } - return c.PolicyClient + return c.AutoscalingV1Client } -// Rbac retrieves the RbacClient -func (c *Clientset) Rbac() v1alpha1rbac.RbacInterface { +// Deprecated: Autoscaling retrieves the default version of AutoscalingClient. +// Please explicitly pick a version. +func (c *Clientset) Autoscaling() v1autoscaling.AutoscalingV1Interface { if c == nil { return nil } - return c.RbacClient + return c.AutoscalingV1Client } -// Storage retrieves the StorageClient -func (c *Clientset) Storage() v1beta1storage.StorageInterface { +// BatchV1 retrieves the BatchV1Client +func (c *Clientset) BatchV1() v1batch.BatchV1Interface { if c == nil { return nil } - return c.StorageClient + return c.BatchV1Client +} + +// Deprecated: Batch retrieves the default version of BatchClient. +// Please explicitly pick a version. +func (c *Clientset) Batch() v1batch.BatchV1Interface { + if c == nil { + return nil + } + return c.BatchV1Client +} + +// BatchV2alpha1 retrieves the BatchV2alpha1Client +func (c *Clientset) BatchV2alpha1() v2alpha1batch.BatchV2alpha1Interface { + if c == nil { + return nil + } + return c.BatchV2alpha1Client +} + +// CertificatesV1alpha1 retrieves the CertificatesV1alpha1Client +func (c *Clientset) CertificatesV1alpha1() v1alpha1certificates.CertificatesV1alpha1Interface { + if c == nil { + return nil + } + return c.CertificatesV1alpha1Client +} + +// Deprecated: Certificates retrieves the default version of CertificatesClient. +// Please explicitly pick a version. +func (c *Clientset) Certificates() v1alpha1certificates.CertificatesV1alpha1Interface { + if c == nil { + return nil + } + return c.CertificatesV1alpha1Client +} + +// ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client +func (c *Clientset) ExtensionsV1beta1() v1beta1extensions.ExtensionsV1beta1Interface { + if c == nil { + return nil + } + return c.ExtensionsV1beta1Client +} + +// Deprecated: Extensions retrieves the default version of ExtensionsClient. +// Please explicitly pick a version. +func (c *Clientset) Extensions() v1beta1extensions.ExtensionsV1beta1Interface { + if c == nil { + return nil + } + return c.ExtensionsV1beta1Client +} + +// PolicyV1beta1 retrieves the PolicyV1beta1Client +func (c *Clientset) PolicyV1beta1() v1beta1policy.PolicyV1beta1Interface { + if c == nil { + return nil + } + return c.PolicyV1beta1Client +} + +// Deprecated: Policy retrieves the default version of PolicyClient. +// Please explicitly pick a version. +func (c *Clientset) Policy() v1beta1policy.PolicyV1beta1Interface { + if c == nil { + return nil + } + return c.PolicyV1beta1Client +} + +// RbacV1alpha1 retrieves the RbacV1alpha1Client +func (c *Clientset) RbacV1alpha1() v1alpha1rbac.RbacV1alpha1Interface { + if c == nil { + return nil + } + return c.RbacV1alpha1Client +} + +// Deprecated: Rbac retrieves the default version of RbacClient. +// Please explicitly pick a version. +func (c *Clientset) Rbac() v1alpha1rbac.RbacV1alpha1Interface { + if c == nil { + return nil + } + return c.RbacV1alpha1Client +} + +// StorageV1beta1 retrieves the StorageV1beta1Client +func (c *Clientset) StorageV1beta1() v1beta1storage.StorageV1beta1Interface { + if c == nil { + return nil + } + return c.StorageV1beta1Client +} + +// Deprecated: Storage retrieves the default version of StorageClient. +// Please explicitly pick a version. +func (c *Clientset) Storage() v1beta1storage.StorageV1beta1Interface { + if c == nil { + return nil + } + return c.StorageV1beta1Client } // Discovery retrieves the DiscoveryClient @@ -168,47 +301,51 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var clientset Clientset var err error - clientset.CoreClient, err = v1core.NewForConfig(&configShallowCopy) + clientset.CoreV1Client, err = v1core.NewForConfig(&configShallowCopy) if err != nil { return nil, err } - clientset.AppsClient, err = v1alpha1apps.NewForConfig(&configShallowCopy) + clientset.AppsV1beta1Client, err = v1beta1apps.NewForConfig(&configShallowCopy) if err != nil { return nil, err } - clientset.AuthenticationClient, err = v1beta1authentication.NewForConfig(&configShallowCopy) + clientset.AuthenticationV1beta1Client, err = v1beta1authentication.NewForConfig(&configShallowCopy) if err != nil { return nil, err } - clientset.AuthorizationClient, err = v1beta1authorization.NewForConfig(&configShallowCopy) + clientset.AuthorizationV1beta1Client, err = v1beta1authorization.NewForConfig(&configShallowCopy) if err != nil { return nil, err } - clientset.AutoscalingClient, err = v1autoscaling.NewForConfig(&configShallowCopy) + clientset.AutoscalingV1Client, err = v1autoscaling.NewForConfig(&configShallowCopy) if err != nil { return nil, err } - clientset.BatchClient, err = v1batch.NewForConfig(&configShallowCopy) + clientset.BatchV1Client, err = v1batch.NewForConfig(&configShallowCopy) if err != nil { return nil, err } - clientset.CertificatesClient, err = v1alpha1certificates.NewForConfig(&configShallowCopy) + clientset.BatchV2alpha1Client, err = v2alpha1batch.NewForConfig(&configShallowCopy) if err != nil { return nil, err } - clientset.ExtensionsClient, err = v1beta1extensions.NewForConfig(&configShallowCopy) + clientset.CertificatesV1alpha1Client, err = v1alpha1certificates.NewForConfig(&configShallowCopy) if err != nil { return nil, err } - clientset.PolicyClient, err = v1alpha1policy.NewForConfig(&configShallowCopy) + clientset.ExtensionsV1beta1Client, err = v1beta1extensions.NewForConfig(&configShallowCopy) if err != nil { return nil, err } - clientset.RbacClient, err = v1alpha1rbac.NewForConfig(&configShallowCopy) + clientset.PolicyV1beta1Client, err = v1beta1policy.NewForConfig(&configShallowCopy) if err != nil { return nil, err } - clientset.StorageClient, err = v1beta1storage.NewForConfig(&configShallowCopy) + clientset.RbacV1alpha1Client, err = v1alpha1rbac.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + clientset.StorageV1beta1Client, err = v1beta1storage.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -225,17 +362,18 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var clientset Clientset - clientset.CoreClient = v1core.NewForConfigOrDie(c) - clientset.AppsClient = v1alpha1apps.NewForConfigOrDie(c) - clientset.AuthenticationClient = v1beta1authentication.NewForConfigOrDie(c) - clientset.AuthorizationClient = v1beta1authorization.NewForConfigOrDie(c) - clientset.AutoscalingClient = v1autoscaling.NewForConfigOrDie(c) - clientset.BatchClient = v1batch.NewForConfigOrDie(c) - clientset.CertificatesClient = v1alpha1certificates.NewForConfigOrDie(c) - clientset.ExtensionsClient = v1beta1extensions.NewForConfigOrDie(c) - clientset.PolicyClient = v1alpha1policy.NewForConfigOrDie(c) - clientset.RbacClient = v1alpha1rbac.NewForConfigOrDie(c) - clientset.StorageClient = v1beta1storage.NewForConfigOrDie(c) + clientset.CoreV1Client = v1core.NewForConfigOrDie(c) + clientset.AppsV1beta1Client = v1beta1apps.NewForConfigOrDie(c) + clientset.AuthenticationV1beta1Client = v1beta1authentication.NewForConfigOrDie(c) + clientset.AuthorizationV1beta1Client = v1beta1authorization.NewForConfigOrDie(c) + clientset.AutoscalingV1Client = v1autoscaling.NewForConfigOrDie(c) + clientset.BatchV1Client = v1batch.NewForConfigOrDie(c) + clientset.BatchV2alpha1Client = v2alpha1batch.NewForConfigOrDie(c) + clientset.CertificatesV1alpha1Client = v1alpha1certificates.NewForConfigOrDie(c) + clientset.ExtensionsV1beta1Client = v1beta1extensions.NewForConfigOrDie(c) + clientset.PolicyV1beta1Client = v1beta1policy.NewForConfigOrDie(c) + clientset.RbacV1alpha1Client = v1alpha1rbac.NewForConfigOrDie(c) + clientset.StorageV1beta1Client = v1beta1storage.NewForConfigOrDie(c) clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &clientset @@ -244,17 +382,18 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var clientset Clientset - clientset.CoreClient = v1core.New(c) - clientset.AppsClient = v1alpha1apps.New(c) - clientset.AuthenticationClient = v1beta1authentication.New(c) - clientset.AuthorizationClient = v1beta1authorization.New(c) - clientset.AutoscalingClient = v1autoscaling.New(c) - clientset.BatchClient = v1batch.New(c) - clientset.CertificatesClient = v1alpha1certificates.New(c) - clientset.ExtensionsClient = v1beta1extensions.New(c) - clientset.PolicyClient = v1alpha1policy.New(c) - clientset.RbacClient = v1alpha1rbac.New(c) - clientset.StorageClient = v1beta1storage.New(c) + clientset.CoreV1Client = v1core.New(c) + clientset.AppsV1beta1Client = v1beta1apps.New(c) + clientset.AuthenticationV1beta1Client = v1beta1authentication.New(c) + clientset.AuthorizationV1beta1Client = v1beta1authorization.New(c) + clientset.AutoscalingV1Client = v1autoscaling.New(c) + clientset.BatchV1Client = v1batch.New(c) + clientset.BatchV2alpha1Client = v2alpha1batch.New(c) + clientset.CertificatesV1alpha1Client = v1alpha1certificates.New(c) + clientset.ExtensionsV1beta1Client = v1beta1extensions.New(c) + clientset.PolicyV1beta1Client = v1beta1policy.New(c) + clientset.RbacV1alpha1Client = v1alpha1rbac.New(c) + clientset.StorageV1beta1Client = v1beta1storage.New(c) clientset.DiscoveryClient = discovery.NewDiscoveryClient(c) return &clientset diff --git a/staging/src/k8s.io/client-go/kubernetes/doc.go b/staging/src/k8s.io/client-go/kubernetes/doc.go index bd09a356311..2f2e8e111ef 100644 --- a/staging/src/k8s.io/client-go/kubernetes/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated clientset. package kubernetes diff --git a/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go b/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go index e04a9dd3e9a..1cd49d00384 100644 --- a/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go +++ b/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go @@ -20,8 +20,8 @@ import ( "k8s.io/client-go/discovery" fakediscovery "k8s.io/client-go/discovery/fake" clientset "k8s.io/client-go/kubernetes" - v1alpha1apps "k8s.io/client-go/kubernetes/typed/apps/v1alpha1" - fakev1alpha1apps "k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake" + v1beta1apps "k8s.io/client-go/kubernetes/typed/apps/v1beta1" + fakev1beta1apps "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake" v1beta1authentication "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" fakev1beta1authentication "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake" v1beta1authorization "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" @@ -30,14 +30,16 @@ import ( fakev1autoscaling "k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake" v1batch "k8s.io/client-go/kubernetes/typed/batch/v1" fakev1batch "k8s.io/client-go/kubernetes/typed/batch/v1/fake" + v2alpha1batch "k8s.io/client-go/kubernetes/typed/batch/v2alpha1" + fakev2alpha1batch "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake" v1alpha1certificates "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1" fakev1alpha1certificates "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake" v1core "k8s.io/client-go/kubernetes/typed/core/v1" fakev1core "k8s.io/client-go/kubernetes/typed/core/v1/fake" v1beta1extensions "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" fakev1beta1extensions "k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake" - v1alpha1policy "k8s.io/client-go/kubernetes/typed/policy/v1alpha1" - fakev1alpha1policy "k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake" + v1beta1policy "k8s.io/client-go/kubernetes/typed/policy/v1beta1" + fakev1beta1policy "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake" v1alpha1rbac "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" fakev1alpha1rbac "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake" v1beta1storage "k8s.io/client-go/kubernetes/typed/storage/v1beta1" @@ -82,57 +84,117 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { var _ clientset.Interface = &Clientset{} -// Core retrieves the CoreClient -func (c *Clientset) Core() v1core.CoreInterface { - return &fakev1core.FakeCore{Fake: &c.Fake} +// CoreV1 retrieves the CoreV1Client +func (c *Clientset) CoreV1() v1core.CoreV1Interface { + return &fakev1core.FakeCoreV1{Fake: &c.Fake} } -// Apps retrieves the AppsClient -func (c *Clientset) Apps() v1alpha1apps.AppsInterface { - return &fakev1alpha1apps.FakeApps{Fake: &c.Fake} +// Core retrieves the CoreV1Client +func (c *Clientset) Core() v1core.CoreV1Interface { + return &fakev1core.FakeCoreV1{Fake: &c.Fake} } -// Authentication retrieves the AuthenticationClient -func (c *Clientset) Authentication() v1beta1authentication.AuthenticationInterface { - return &fakev1beta1authentication.FakeAuthentication{Fake: &c.Fake} +// AppsV1beta1 retrieves the AppsV1beta1Client +func (c *Clientset) AppsV1beta1() v1beta1apps.AppsV1beta1Interface { + return &fakev1beta1apps.FakeAppsV1beta1{Fake: &c.Fake} } -// Authorization retrieves the AuthorizationClient -func (c *Clientset) Authorization() v1beta1authorization.AuthorizationInterface { - return &fakev1beta1authorization.FakeAuthorization{Fake: &c.Fake} +// Apps retrieves the AppsV1beta1Client +func (c *Clientset) Apps() v1beta1apps.AppsV1beta1Interface { + return &fakev1beta1apps.FakeAppsV1beta1{Fake: &c.Fake} } -// Autoscaling retrieves the AutoscalingClient -func (c *Clientset) Autoscaling() v1autoscaling.AutoscalingInterface { - return &fakev1autoscaling.FakeAutoscaling{Fake: &c.Fake} +// AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client +func (c *Clientset) AuthenticationV1beta1() v1beta1authentication.AuthenticationV1beta1Interface { + return &fakev1beta1authentication.FakeAuthenticationV1beta1{Fake: &c.Fake} } -// Batch retrieves the BatchClient -func (c *Clientset) Batch() v1batch.BatchInterface { - return &fakev1batch.FakeBatch{Fake: &c.Fake} +// Authentication retrieves the AuthenticationV1beta1Client +func (c *Clientset) Authentication() v1beta1authentication.AuthenticationV1beta1Interface { + return &fakev1beta1authentication.FakeAuthenticationV1beta1{Fake: &c.Fake} } -// Certificates retrieves the CertificatesClient -func (c *Clientset) Certificates() v1alpha1certificates.CertificatesInterface { - return &fakev1alpha1certificates.FakeCertificates{Fake: &c.Fake} +// AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client +func (c *Clientset) AuthorizationV1beta1() v1beta1authorization.AuthorizationV1beta1Interface { + return &fakev1beta1authorization.FakeAuthorizationV1beta1{Fake: &c.Fake} } -// Extensions retrieves the ExtensionsClient -func (c *Clientset) Extensions() v1beta1extensions.ExtensionsInterface { - return &fakev1beta1extensions.FakeExtensions{Fake: &c.Fake} +// Authorization retrieves the AuthorizationV1beta1Client +func (c *Clientset) Authorization() v1beta1authorization.AuthorizationV1beta1Interface { + return &fakev1beta1authorization.FakeAuthorizationV1beta1{Fake: &c.Fake} } -// Policy retrieves the PolicyClient -func (c *Clientset) Policy() v1alpha1policy.PolicyInterface { - return &fakev1alpha1policy.FakePolicy{Fake: &c.Fake} +// AutoscalingV1 retrieves the AutoscalingV1Client +func (c *Clientset) AutoscalingV1() v1autoscaling.AutoscalingV1Interface { + return &fakev1autoscaling.FakeAutoscalingV1{Fake: &c.Fake} } -// Rbac retrieves the RbacClient -func (c *Clientset) Rbac() v1alpha1rbac.RbacInterface { - return &fakev1alpha1rbac.FakeRbac{Fake: &c.Fake} +// Autoscaling retrieves the AutoscalingV1Client +func (c *Clientset) Autoscaling() v1autoscaling.AutoscalingV1Interface { + return &fakev1autoscaling.FakeAutoscalingV1{Fake: &c.Fake} } -// Storage retrieves the StorageClient -func (c *Clientset) Storage() v1beta1storage.StorageInterface { - return &fakev1beta1storage.FakeStorage{Fake: &c.Fake} +// BatchV1 retrieves the BatchV1Client +func (c *Clientset) BatchV1() v1batch.BatchV1Interface { + return &fakev1batch.FakeBatchV1{Fake: &c.Fake} +} + +// Batch retrieves the BatchV1Client +func (c *Clientset) Batch() v1batch.BatchV1Interface { + return &fakev1batch.FakeBatchV1{Fake: &c.Fake} +} + +// BatchV2alpha1 retrieves the BatchV2alpha1Client +func (c *Clientset) BatchV2alpha1() v2alpha1batch.BatchV2alpha1Interface { + return &fakev2alpha1batch.FakeBatchV2alpha1{Fake: &c.Fake} +} + +// CertificatesV1alpha1 retrieves the CertificatesV1alpha1Client +func (c *Clientset) CertificatesV1alpha1() v1alpha1certificates.CertificatesV1alpha1Interface { + return &fakev1alpha1certificates.FakeCertificatesV1alpha1{Fake: &c.Fake} +} + +// Certificates retrieves the CertificatesV1alpha1Client +func (c *Clientset) Certificates() v1alpha1certificates.CertificatesV1alpha1Interface { + return &fakev1alpha1certificates.FakeCertificatesV1alpha1{Fake: &c.Fake} +} + +// ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client +func (c *Clientset) ExtensionsV1beta1() v1beta1extensions.ExtensionsV1beta1Interface { + return &fakev1beta1extensions.FakeExtensionsV1beta1{Fake: &c.Fake} +} + +// Extensions retrieves the ExtensionsV1beta1Client +func (c *Clientset) Extensions() v1beta1extensions.ExtensionsV1beta1Interface { + return &fakev1beta1extensions.FakeExtensionsV1beta1{Fake: &c.Fake} +} + +// PolicyV1beta1 retrieves the PolicyV1beta1Client +func (c *Clientset) PolicyV1beta1() v1beta1policy.PolicyV1beta1Interface { + return &fakev1beta1policy.FakePolicyV1beta1{Fake: &c.Fake} +} + +// Policy retrieves the PolicyV1beta1Client +func (c *Clientset) Policy() v1beta1policy.PolicyV1beta1Interface { + return &fakev1beta1policy.FakePolicyV1beta1{Fake: &c.Fake} +} + +// RbacV1alpha1 retrieves the RbacV1alpha1Client +func (c *Clientset) RbacV1alpha1() v1alpha1rbac.RbacV1alpha1Interface { + return &fakev1alpha1rbac.FakeRbacV1alpha1{Fake: &c.Fake} +} + +// Rbac retrieves the RbacV1alpha1Client +func (c *Clientset) Rbac() v1alpha1rbac.RbacV1alpha1Interface { + return &fakev1alpha1rbac.FakeRbacV1alpha1{Fake: &c.Fake} +} + +// StorageV1beta1 retrieves the StorageV1beta1Client +func (c *Clientset) StorageV1beta1() v1beta1storage.StorageV1beta1Interface { + return &fakev1beta1storage.FakeStorageV1beta1{Fake: &c.Fake} +} + +// Storage retrieves the StorageV1beta1Client +func (c *Clientset) Storage() v1beta1storage.StorageV1beta1Interface { + return &fakev1beta1storage.FakeStorageV1beta1{Fake: &c.Fake} } diff --git a/staging/src/k8s.io/client-go/kubernetes/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/fake/doc.go index f849c0cdaac..3e97a8d69f0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated fake clientset. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/apps_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go similarity index 60% rename from staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/apps_client.go rename to staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go index 8a5158112d5..0155927e433 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/apps_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go @@ -14,31 +14,33 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( + fmt "fmt" api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" registered "k8s.io/client-go/pkg/apimachinery/registered" serializer "k8s.io/client-go/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type AppsInterface interface { +type AppsV1beta1Interface interface { RESTClient() rest.Interface StatefulSetsGetter } -// AppsClient is used to interact with features provided by the Apps group. -type AppsClient struct { +// AppsV1beta1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type AppsV1beta1Client struct { restClient rest.Interface } -func (c *AppsClient) StatefulSets(namespace string) StatefulSetInterface { +func (c *AppsV1beta1Client) StatefulSets(namespace string) StatefulSetInterface { return newStatefulSets(c, namespace) } -// NewForConfig creates a new AppsClient for the given config. -func NewForConfig(c *rest.Config) (*AppsClient, error) { +// NewForConfig creates a new AppsV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*AppsV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -47,12 +49,12 @@ func NewForConfig(c *rest.Config) (*AppsClient, error) { if err != nil { return nil, err } - return &AppsClient{client}, nil + return &AppsV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new AppsClient for the given config and +// NewForConfigOrDie creates a new AppsV1beta1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *AppsClient { +func NewForConfigOrDie(c *rest.Config) *AppsV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -60,26 +62,26 @@ func NewForConfigOrDie(c *rest.Config) *AppsClient { return client } -// New creates a new AppsClient for the given RESTClient. -func New(c rest.Interface) *AppsClient { - return &AppsClient{c} +// New creates a new AppsV1beta1Client for the given RESTClient. +func New(c rest.Interface) *AppsV1beta1Client { + return &AppsV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { - // if apps group is not registered, return an error - g, err := registered.Group("apps") + gv, err := unversioned.ParseGroupVersion("apps/v1beta1") if err != nil { return err } + // if apps/v1beta1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("apps/v1beta1 is not enabled") + } config.APIPath = "/apis" if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // TODO: Unconditionally set the config.Version, until we fix the config. - //if config.Version == "" { - copyGroupVersion := g.GroupVersion + copyGroupVersion := gv config.GroupVersion = ©GroupVersion - //} config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} @@ -88,7 +90,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *AppsClient) RESTClient() rest.Interface { +func (c *AppsV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go similarity index 74% rename from staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/doc.go rename to staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go index 0c1ca41facc..c15d0baccf8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated typed clients. -package v1alpha1 +package v1beta1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go similarity index 75% rename from staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/doc.go rename to staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go index 6499875c0b5..87e4dda424d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // Package fake has the automatically generated clients. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/fake_apps_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go similarity index 79% rename from staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/fake_apps_client.go rename to staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go index 0b82c9fbb08..d4971bcd615 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/fake_apps_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go @@ -17,22 +17,22 @@ limitations under the License. package fake import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/apps/v1alpha1" + v1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeApps struct { +type FakeAppsV1beta1 struct { *testing.Fake } -func (c *FakeApps) StatefulSets(namespace string) v1alpha1.StatefulSetInterface { +func (c *FakeAppsV1beta1) StatefulSets(namespace string) v1beta1.StatefulSetInterface { return &FakeStatefulSets{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeApps) RESTClient() rest.Interface { +func (c *FakeAppsV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/fake_statefulset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go similarity index 68% rename from staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/fake_statefulset.go rename to staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go index 1697b39f58e..155d89ff8e1 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/fake_statefulset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go @@ -20,7 +20,7 @@ import ( api "k8s.io/client-go/pkg/api" unversioned "k8s.io/client-go/pkg/api/unversioned" v1 "k8s.io/client-go/pkg/api/v1" - v1alpha1 "k8s.io/client-go/pkg/apis/apps/v1alpha1" + v1beta1 "k8s.io/client-go/pkg/apis/apps/v1beta1" labels "k8s.io/client-go/pkg/labels" watch "k8s.io/client-go/pkg/watch" testing "k8s.io/client-go/testing" @@ -28,45 +28,45 @@ import ( // FakeStatefulSets implements StatefulSetInterface type FakeStatefulSets struct { - Fake *FakeApps + Fake *FakeAppsV1beta1 ns string } -var statefulsetsResource = unversioned.GroupVersionResource{Group: "apps", Version: "v1alpha1", Resource: "statefulsets"} +var statefulsetsResource = unversioned.GroupVersionResource{Group: "apps", Version: "v1beta1", Resource: "statefulsets"} -func (c *FakeStatefulSets) Create(statefulSet *v1alpha1.StatefulSet) (result *v1alpha1.StatefulSet, err error) { +func (c *FakeStatefulSets) Create(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1alpha1.StatefulSet{}) + Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.StatefulSet), err + return obj.(*v1beta1.StatefulSet), err } -func (c *FakeStatefulSets) Update(statefulSet *v1alpha1.StatefulSet) (result *v1alpha1.StatefulSet, err error) { +func (c *FakeStatefulSets) Update(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1alpha1.StatefulSet{}) + Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.StatefulSet), err + return obj.(*v1beta1.StatefulSet), err } -func (c *FakeStatefulSets) UpdateStatus(statefulSet *v1alpha1.StatefulSet) (*v1alpha1.StatefulSet, error) { +func (c *FakeStatefulSets) UpdateStatus(statefulSet *v1beta1.StatefulSet) (*v1beta1.StatefulSet, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1alpha1.StatefulSet{}) + Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1beta1.StatefulSet{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.StatefulSet), err + return obj.(*v1beta1.StatefulSet), err } func (c *FakeStatefulSets) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(statefulsetsResource, c.ns, name), &v1alpha1.StatefulSet{}) + Invokes(testing.NewDeleteAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{}) return err } @@ -74,23 +74,23 @@ func (c *FakeStatefulSets) Delete(name string, options *v1.DeleteOptions) error func (c *FakeStatefulSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha1.StatefulSetList{}) + _, err := c.Fake.Invokes(action, &v1beta1.StatefulSetList{}) return err } -func (c *FakeStatefulSets) Get(name string) (result *v1alpha1.StatefulSet, err error) { +func (c *FakeStatefulSets) Get(name string) (result *v1beta1.StatefulSet, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &v1alpha1.StatefulSet{}) + Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.StatefulSet), err + return obj.(*v1beta1.StatefulSet), err } -func (c *FakeStatefulSets) List(opts v1.ListOptions) (result *v1alpha1.StatefulSetList, err error) { +func (c *FakeStatefulSets) List(opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(statefulsetsResource, c.ns, opts), &v1alpha1.StatefulSetList{}) + Invokes(testing.NewListAction(statefulsetsResource, c.ns, opts), &v1beta1.StatefulSetList{}) if obj == nil { return nil, err @@ -100,8 +100,8 @@ func (c *FakeStatefulSets) List(opts v1.ListOptions) (result *v1alpha1.StatefulS if label == nil { label = labels.Everything() } - list := &v1alpha1.StatefulSetList{} - for _, item := range obj.(*v1alpha1.StatefulSetList).Items { + list := &v1beta1.StatefulSetList{} + for _, item := range obj.(*v1beta1.StatefulSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -117,12 +117,12 @@ func (c *FakeStatefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched statefulSet. -func (c *FakeStatefulSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.StatefulSet, err error) { +func (c *FakeStatefulSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, data, subresources...), &v1alpha1.StatefulSet{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, data, subresources...), &v1beta1.StatefulSet{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.StatefulSet), err + return obj.(*v1beta1.StatefulSet), err } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go similarity index 97% rename from staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/generated_expansion.go rename to staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go index bbf6c914a0e..b09a7bae5e6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/generated_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 type StatefulSetExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/statefulset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go similarity index 75% rename from staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/statefulset.go rename to staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go index d5e3f9f8eea..88920c30101 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1alpha1/statefulset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go @@ -14,12 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" - v1alpha1 "k8s.io/client-go/pkg/apis/apps/v1alpha1" + v1beta1 "k8s.io/client-go/pkg/apis/apps/v1beta1" watch "k8s.io/client-go/pkg/watch" rest "k8s.io/client-go/rest" ) @@ -32,15 +32,15 @@ type StatefulSetsGetter interface { // StatefulSetInterface has methods to work with StatefulSet resources. type StatefulSetInterface interface { - Create(*v1alpha1.StatefulSet) (*v1alpha1.StatefulSet, error) - Update(*v1alpha1.StatefulSet) (*v1alpha1.StatefulSet, error) - UpdateStatus(*v1alpha1.StatefulSet) (*v1alpha1.StatefulSet, error) + Create(*v1beta1.StatefulSet) (*v1beta1.StatefulSet, error) + Update(*v1beta1.StatefulSet) (*v1beta1.StatefulSet, error) + UpdateStatus(*v1beta1.StatefulSet) (*v1beta1.StatefulSet, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string) (*v1alpha1.StatefulSet, error) - List(opts v1.ListOptions) (*v1alpha1.StatefulSetList, error) + Get(name string) (*v1beta1.StatefulSet, error) + List(opts v1.ListOptions) (*v1beta1.StatefulSetList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.StatefulSet, err error) + Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) StatefulSetExpansion } @@ -51,7 +51,7 @@ type statefulSets struct { } // newStatefulSets returns a StatefulSets -func newStatefulSets(c *AppsClient, namespace string) *statefulSets { +func newStatefulSets(c *AppsV1beta1Client, namespace string) *statefulSets { return &statefulSets{ client: c.RESTClient(), ns: namespace, @@ -59,8 +59,8 @@ func newStatefulSets(c *AppsClient, namespace string) *statefulSets { } // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Create(statefulSet *v1alpha1.StatefulSet) (result *v1alpha1.StatefulSet, err error) { - result = &v1alpha1.StatefulSet{} +func (c *statefulSets) Create(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) { + result = &v1beta1.StatefulSet{} err = c.client.Post(). Namespace(c.ns). Resource("statefulsets"). @@ -71,8 +71,8 @@ func (c *statefulSets) Create(statefulSet *v1alpha1.StatefulSet) (result *v1alph } // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Update(statefulSet *v1alpha1.StatefulSet) (result *v1alpha1.StatefulSet, err error) { - result = &v1alpha1.StatefulSet{} +func (c *statefulSets) Update(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) { + result = &v1beta1.StatefulSet{} err = c.client.Put(). Namespace(c.ns). Resource("statefulsets"). @@ -83,8 +83,8 @@ func (c *statefulSets) Update(statefulSet *v1alpha1.StatefulSet) (result *v1alph return } -func (c *statefulSets) UpdateStatus(statefulSet *v1alpha1.StatefulSet) (result *v1alpha1.StatefulSet, err error) { - result = &v1alpha1.StatefulSet{} +func (c *statefulSets) UpdateStatus(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) { + result = &v1beta1.StatefulSet{} err = c.client.Put(). Namespace(c.ns). Resource("statefulsets"). @@ -119,8 +119,8 @@ func (c *statefulSets) DeleteCollection(options *v1.DeleteOptions, listOptions v } // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. -func (c *statefulSets) Get(name string) (result *v1alpha1.StatefulSet, err error) { - result = &v1alpha1.StatefulSet{} +func (c *statefulSets) Get(name string) (result *v1beta1.StatefulSet, err error) { + result = &v1beta1.StatefulSet{} err = c.client.Get(). Namespace(c.ns). Resource("statefulsets"). @@ -131,8 +131,8 @@ func (c *statefulSets) Get(name string) (result *v1alpha1.StatefulSet, err error } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) List(opts v1.ListOptions) (result *v1alpha1.StatefulSetList, err error) { - result = &v1alpha1.StatefulSetList{} +func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { + result = &v1beta1.StatefulSetList{} err = c.client.Get(). Namespace(c.ns). Resource("statefulsets"). @@ -153,8 +153,8 @@ func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched statefulSet. -func (c *statefulSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.StatefulSet, err error) { - result = &v1alpha1.StatefulSet{} +func (c *statefulSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) { + result = &v1beta1.StatefulSet{} err = c.client.Patch(pt). Namespace(c.ns). Resource("statefulsets"). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go index 950096bb64e..7f976b06240 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go @@ -17,28 +17,30 @@ limitations under the License. package v1beta1 import ( + fmt "fmt" api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" registered "k8s.io/client-go/pkg/apimachinery/registered" serializer "k8s.io/client-go/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type AuthenticationInterface interface { +type AuthenticationV1beta1Interface interface { RESTClient() rest.Interface TokenReviewsGetter } -// AuthenticationClient is used to interact with features provided by the Authentication group. -type AuthenticationClient struct { +// AuthenticationV1beta1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type AuthenticationV1beta1Client struct { restClient rest.Interface } -func (c *AuthenticationClient) TokenReviews() TokenReviewInterface { +func (c *AuthenticationV1beta1Client) TokenReviews() TokenReviewInterface { return newTokenReviews(c) } -// NewForConfig creates a new AuthenticationClient for the given config. -func NewForConfig(c *rest.Config) (*AuthenticationClient, error) { +// NewForConfig creates a new AuthenticationV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*AuthenticationV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -47,12 +49,12 @@ func NewForConfig(c *rest.Config) (*AuthenticationClient, error) { if err != nil { return nil, err } - return &AuthenticationClient{client}, nil + return &AuthenticationV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new AuthenticationClient for the given config and +// NewForConfigOrDie creates a new AuthenticationV1beta1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *AuthenticationClient { +func NewForConfigOrDie(c *rest.Config) *AuthenticationV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -60,26 +62,26 @@ func NewForConfigOrDie(c *rest.Config) *AuthenticationClient { return client } -// New creates a new AuthenticationClient for the given RESTClient. -func New(c rest.Interface) *AuthenticationClient { - return &AuthenticationClient{c} +// New creates a new AuthenticationV1beta1Client for the given RESTClient. +func New(c rest.Interface) *AuthenticationV1beta1Client { + return &AuthenticationV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { - // if authentication group is not registered, return an error - g, err := registered.Group("authentication.k8s.io") + gv, err := unversioned.ParseGroupVersion("authentication.k8s.io/v1beta1") if err != nil { return err } + // if authentication.k8s.io/v1beta1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("authentication.k8s.io/v1beta1 is not enabled") + } config.APIPath = "/apis" if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // TODO: Unconditionally set the config.Version, until we fix the config. - //if config.Version == "" { - copyGroupVersion := g.GroupVersion + copyGroupVersion := gv config.GroupVersion = ©GroupVersion - //} config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} @@ -88,7 +90,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *AuthenticationClient) RESTClient() rest.Interface { +func (c *AuthenticationV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go index 5616c95d325..c15d0baccf8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated typed clients. package v1beta1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go index 6499875c0b5..87e4dda424d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // Package fake has the automatically generated clients. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go index 8ff2dcd3617..33702bcf6d7 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go @@ -22,17 +22,17 @@ import ( testing "k8s.io/client-go/testing" ) -type FakeAuthentication struct { +type FakeAuthenticationV1beta1 struct { *testing.Fake } -func (c *FakeAuthentication) TokenReviews() v1beta1.TokenReviewInterface { +func (c *FakeAuthenticationV1beta1) TokenReviews() v1beta1.TokenReviewInterface { return &FakeTokenReviews{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeAuthentication) RESTClient() rest.Interface { +func (c *FakeAuthenticationV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go index 6508f5a94aa..92408580b45 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go @@ -18,5 +18,5 @@ package fake // FakeTokenReviews implements TokenReviewInterface type FakeTokenReviews struct { - Fake *FakeAuthentication + Fake *FakeAuthenticationV1beta1 } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview_expansion.go new file mode 100644 index 00000000000..06173128744 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview_expansion.go @@ -0,0 +1,27 @@ +/* +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 fake + +import ( + authenticationapi "k8s.io/client-go/pkg/apis/authentication/v1beta1" + "k8s.io/client-go/testing" +) + +func (c *FakeTokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { + obj, err := c.Fake.Invokes(testing.NewRootCreateAction(authenticationapi.SchemeGroupVersion.WithResource("tokenreviews"), tokenReview), &authenticationapi.TokenReview{}) + return obj.(*authenticationapi.TokenReview), err +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go index f307100297e..a397b30e92d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go @@ -15,5 +15,3 @@ limitations under the License. */ package v1beta1 - -type TokenReviewExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go index 8442ec61050..04c2ab09b07 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go @@ -37,7 +37,7 @@ type tokenReviews struct { } // newTokenReviews returns a TokenReviews -func newTokenReviews(c *AuthenticationClient) *tokenReviews { +func newTokenReviews(c *AuthenticationV1beta1Client) *tokenReviews { return &tokenReviews{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go new file mode 100644 index 00000000000..375b6f637c7 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go @@ -0,0 +1,35 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + authenticationapi "k8s.io/client-go/pkg/apis/authentication/v1beta1" +) + +type TokenReviewExpansion interface { + Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) +} + +func (c *tokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { + result = &authenticationapi.TokenReview{} + err = c.client.Post(). + Resource("tokenreviews"). + Body(tokenReview). + Do(). + Into(result) + return +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go index a57434d6927..5993283735e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go @@ -17,38 +17,40 @@ limitations under the License. package v1beta1 import ( + fmt "fmt" api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" registered "k8s.io/client-go/pkg/apimachinery/registered" serializer "k8s.io/client-go/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type AuthorizationInterface interface { +type AuthorizationV1beta1Interface interface { RESTClient() rest.Interface LocalSubjectAccessReviewsGetter SelfSubjectAccessReviewsGetter SubjectAccessReviewsGetter } -// AuthorizationClient is used to interact with features provided by the Authorization group. -type AuthorizationClient struct { +// AuthorizationV1beta1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type AuthorizationV1beta1Client struct { restClient rest.Interface } -func (c *AuthorizationClient) LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface { +func (c *AuthorizationV1beta1Client) LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface { return newLocalSubjectAccessReviews(c, namespace) } -func (c *AuthorizationClient) SelfSubjectAccessReviews() SelfSubjectAccessReviewInterface { +func (c *AuthorizationV1beta1Client) SelfSubjectAccessReviews() SelfSubjectAccessReviewInterface { return newSelfSubjectAccessReviews(c) } -func (c *AuthorizationClient) SubjectAccessReviews() SubjectAccessReviewInterface { +func (c *AuthorizationV1beta1Client) SubjectAccessReviews() SubjectAccessReviewInterface { return newSubjectAccessReviews(c) } -// NewForConfig creates a new AuthorizationClient for the given config. -func NewForConfig(c *rest.Config) (*AuthorizationClient, error) { +// NewForConfig creates a new AuthorizationV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*AuthorizationV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -57,12 +59,12 @@ func NewForConfig(c *rest.Config) (*AuthorizationClient, error) { if err != nil { return nil, err } - return &AuthorizationClient{client}, nil + return &AuthorizationV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new AuthorizationClient for the given config and +// NewForConfigOrDie creates a new AuthorizationV1beta1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *AuthorizationClient { +func NewForConfigOrDie(c *rest.Config) *AuthorizationV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -70,26 +72,26 @@ func NewForConfigOrDie(c *rest.Config) *AuthorizationClient { return client } -// New creates a new AuthorizationClient for the given RESTClient. -func New(c rest.Interface) *AuthorizationClient { - return &AuthorizationClient{c} +// New creates a new AuthorizationV1beta1Client for the given RESTClient. +func New(c rest.Interface) *AuthorizationV1beta1Client { + return &AuthorizationV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { - // if authorization group is not registered, return an error - g, err := registered.Group("authorization.k8s.io") + gv, err := unversioned.ParseGroupVersion("authorization.k8s.io/v1beta1") if err != nil { return err } + // if authorization.k8s.io/v1beta1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("authorization.k8s.io/v1beta1 is not enabled") + } config.APIPath = "/apis" if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // TODO: Unconditionally set the config.Version, until we fix the config. - //if config.Version == "" { - copyGroupVersion := g.GroupVersion + copyGroupVersion := gv config.GroupVersion = ©GroupVersion - //} config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} @@ -98,7 +100,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *AuthorizationClient) RESTClient() rest.Interface { +func (c *AuthorizationV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go index 5616c95d325..c15d0baccf8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated typed clients. package v1beta1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go index 6499875c0b5..87e4dda424d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // Package fake has the automatically generated clients. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go index bb240c080c6..53229ab4bb0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go @@ -22,25 +22,25 @@ import ( testing "k8s.io/client-go/testing" ) -type FakeAuthorization struct { +type FakeAuthorizationV1beta1 struct { *testing.Fake } -func (c *FakeAuthorization) LocalSubjectAccessReviews(namespace string) v1beta1.LocalSubjectAccessReviewInterface { +func (c *FakeAuthorizationV1beta1) LocalSubjectAccessReviews(namespace string) v1beta1.LocalSubjectAccessReviewInterface { return &FakeLocalSubjectAccessReviews{c, namespace} } -func (c *FakeAuthorization) SelfSubjectAccessReviews() v1beta1.SelfSubjectAccessReviewInterface { +func (c *FakeAuthorizationV1beta1) SelfSubjectAccessReviews() v1beta1.SelfSubjectAccessReviewInterface { return &FakeSelfSubjectAccessReviews{c} } -func (c *FakeAuthorization) SubjectAccessReviews() v1beta1.SubjectAccessReviewInterface { +func (c *FakeAuthorizationV1beta1) SubjectAccessReviews() v1beta1.SubjectAccessReviewInterface { return &FakeSubjectAccessReviews{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeAuthorization) RESTClient() rest.Interface { +func (c *FakeAuthorizationV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_generated_expansion.go new file mode 100644 index 00000000000..8754e39d87c --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_generated_expansion.go @@ -0,0 +1,17 @@ +/* +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 fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go index 50a1e3a8997..d78ea8232b7 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go @@ -18,6 +18,6 @@ package fake // FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface type FakeLocalSubjectAccessReviews struct { - Fake *FakeAuthorization + Fake *FakeAuthorizationV1beta1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview_expansion.go new file mode 100644 index 00000000000..983eebe4d5e --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview_expansion.go @@ -0,0 +1,27 @@ +/* +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 fake + +import ( + authorizationapi "k8s.io/client-go/pkg/apis/authorization/v1beta1" + "k8s.io/client-go/testing" +) + +func (c *FakeLocalSubjectAccessReviews) Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { + obj, err := c.Fake.Invokes(testing.NewCreateAction(authorizationapi.SchemeGroupVersion.WithResource("localsubjectaccessreviews"), c.ns, sar), &authorizationapi.SubjectAccessReview{}) + return obj.(*authorizationapi.LocalSubjectAccessReview), err +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go index b107c1b2c45..8ec42827ca2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go @@ -18,5 +18,5 @@ package fake // FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface type FakeSelfSubjectAccessReviews struct { - Fake *FakeAuthorization + Fake *FakeAuthorizationV1beta1 } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview_expansion.go new file mode 100644 index 00000000000..4b1baf28392 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview_expansion.go @@ -0,0 +1,27 @@ +/* +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 fake + +import ( + authorizationapi "k8s.io/client-go/pkg/apis/authorization/v1beta1" + "k8s.io/client-go/testing" +) + +func (c *FakeSelfSubjectAccessReviews) Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { + obj, err := c.Fake.Invokes(testing.NewRootCreateAction(authorizationapi.SchemeGroupVersion.WithResource("selfsubjectaccessreviews"), sar), &authorizationapi.SelfSubjectAccessReview{}) + return obj.(*authorizationapi.SelfSubjectAccessReview), err +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go index 0a01cd81a45..d38afc0b8a7 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go @@ -18,5 +18,5 @@ package fake // FakeSubjectAccessReviews implements SubjectAccessReviewInterface type FakeSubjectAccessReviews struct { - Fake *FakeAuthorization + Fake *FakeAuthorizationV1beta1 } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview_expansion.go index 4e2e0b2490d..b4fe5e8cfdb 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview_expansion.go @@ -18,7 +18,6 @@ package fake import ( authorizationapi "k8s.io/client-go/pkg/apis/authorization/v1beta1" - "k8s.io/client-go/testing" ) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go index 0e5d86e3a29..a397b30e92d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go @@ -15,7 +15,3 @@ limitations under the License. */ package v1beta1 - -type LocalSubjectAccessReviewExpansion interface{} - -type SelfSubjectAccessReviewExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go index 62cc83a2794..e522706c62e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go @@ -38,7 +38,7 @@ type localSubjectAccessReviews struct { } // newLocalSubjectAccessReviews returns a LocalSubjectAccessReviews -func newLocalSubjectAccessReviews(c *AuthorizationClient, namespace string) *localSubjectAccessReviews { +func newLocalSubjectAccessReviews(c *AuthorizationV1beta1Client, namespace string) *localSubjectAccessReviews { return &localSubjectAccessReviews{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go new file mode 100644 index 00000000000..d2ce4f0d7fe --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go @@ -0,0 +1,36 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + authorizationapi "k8s.io/client-go/pkg/apis/authorization/v1beta1" +) + +type LocalSubjectAccessReviewExpansion interface { + Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) +} + +func (c *localSubjectAccessReviews) Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { + result = &authorizationapi.LocalSubjectAccessReview{} + err = c.client.Post(). + Namespace(c.ns). + Resource("localsubjectaccessreviews"). + Body(sar). + Do(). + Into(result) + return +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go index 4a3273dcc91..24a92eded9e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go @@ -37,7 +37,7 @@ type selfSubjectAccessReviews struct { } // newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews -func newSelfSubjectAccessReviews(c *AuthorizationClient) *selfSubjectAccessReviews { +func newSelfSubjectAccessReviews(c *AuthorizationV1beta1Client) *selfSubjectAccessReviews { return &selfSubjectAccessReviews{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go new file mode 100644 index 00000000000..d341eb14a50 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go @@ -0,0 +1,35 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + authorizationapi "k8s.io/client-go/pkg/apis/authorization/v1beta1" +) + +type SelfSubjectAccessReviewExpansion interface { + Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) +} + +func (c *selfSubjectAccessReviews) Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { + result = &authorizationapi.SelfSubjectAccessReview{} + err = c.client.Post(). + Resource("selfsubjectaccessreviews"). + Body(sar). + Do(). + Into(result) + return +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go index 9e1fe96d290..af9b07697ad 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go @@ -37,7 +37,7 @@ type subjectAccessReviews struct { } // newSubjectAccessReviews returns a SubjectAccessReviews -func newSubjectAccessReviews(c *AuthorizationClient) *subjectAccessReviews { +func newSubjectAccessReviews(c *AuthorizationV1beta1Client) *subjectAccessReviews { return &subjectAccessReviews{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go index 406916de2b2..d3edda79b04 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go @@ -17,28 +17,30 @@ limitations under the License. package v1 import ( + fmt "fmt" api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" registered "k8s.io/client-go/pkg/apimachinery/registered" serializer "k8s.io/client-go/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type AutoscalingInterface interface { +type AutoscalingV1Interface interface { RESTClient() rest.Interface HorizontalPodAutoscalersGetter } -// AutoscalingClient is used to interact with features provided by the Autoscaling group. -type AutoscalingClient struct { +// AutoscalingV1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type AutoscalingV1Client struct { restClient rest.Interface } -func (c *AutoscalingClient) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { +func (c *AutoscalingV1Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { return newHorizontalPodAutoscalers(c, namespace) } -// NewForConfig creates a new AutoscalingClient for the given config. -func NewForConfig(c *rest.Config) (*AutoscalingClient, error) { +// NewForConfig creates a new AutoscalingV1Client for the given config. +func NewForConfig(c *rest.Config) (*AutoscalingV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -47,12 +49,12 @@ func NewForConfig(c *rest.Config) (*AutoscalingClient, error) { if err != nil { return nil, err } - return &AutoscalingClient{client}, nil + return &AutoscalingV1Client{client}, nil } -// NewForConfigOrDie creates a new AutoscalingClient for the given config and +// NewForConfigOrDie creates a new AutoscalingV1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *AutoscalingClient { +func NewForConfigOrDie(c *rest.Config) *AutoscalingV1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -60,26 +62,26 @@ func NewForConfigOrDie(c *rest.Config) *AutoscalingClient { return client } -// New creates a new AutoscalingClient for the given RESTClient. -func New(c rest.Interface) *AutoscalingClient { - return &AutoscalingClient{c} +// New creates a new AutoscalingV1Client for the given RESTClient. +func New(c rest.Interface) *AutoscalingV1Client { + return &AutoscalingV1Client{c} } func setConfigDefaults(config *rest.Config) error { - // if autoscaling group is not registered, return an error - g, err := registered.Group("autoscaling") + gv, err := unversioned.ParseGroupVersion("autoscaling/v1") if err != nil { return err } + // if autoscaling/v1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("autoscaling/v1 is not enabled") + } config.APIPath = "/apis" if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // TODO: Unconditionally set the config.Version, until we fix the config. - //if config.Version == "" { - copyGroupVersion := g.GroupVersion + copyGroupVersion := gv config.GroupVersion = ©GroupVersion - //} config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} @@ -88,7 +90,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *AutoscalingClient) RESTClient() rest.Interface { +func (c *AutoscalingV1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go index fe27cf5c194..ce67c0e5d52 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated typed clients. package v1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go index 6499875c0b5..87e4dda424d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // Package fake has the automatically generated clients. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go index 4538431b628..c4f36977220 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go @@ -22,17 +22,17 @@ import ( testing "k8s.io/client-go/testing" ) -type FakeAutoscaling struct { +type FakeAutoscalingV1 struct { *testing.Fake } -func (c *FakeAutoscaling) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface { +func (c *FakeAutoscalingV1) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface { return &FakeHorizontalPodAutoscalers{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeAutoscaling) RESTClient() rest.Interface { +func (c *FakeAutoscalingV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go index 5eab6258777..d6a588146a0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go @@ -28,7 +28,7 @@ import ( // FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type FakeHorizontalPodAutoscalers struct { - Fake *FakeAutoscaling + Fake *FakeAutoscalingV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go index ed44db769e8..933df326156 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -51,7 +51,7 @@ type horizontalPodAutoscalers struct { } // newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers -func newHorizontalPodAutoscalers(c *AutoscalingClient, namespace string) *horizontalPodAutoscalers { +func newHorizontalPodAutoscalers(c *AutoscalingV1Client, namespace string) *horizontalPodAutoscalers { return &horizontalPodAutoscalers{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go index fb7ab36c0ef..5b4012b72c7 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go @@ -17,28 +17,30 @@ limitations under the License. package v1 import ( + fmt "fmt" api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" registered "k8s.io/client-go/pkg/apimachinery/registered" serializer "k8s.io/client-go/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type BatchInterface interface { +type BatchV1Interface interface { RESTClient() rest.Interface JobsGetter } -// BatchClient is used to interact with features provided by the Batch group. -type BatchClient struct { +// BatchV1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type BatchV1Client struct { restClient rest.Interface } -func (c *BatchClient) Jobs(namespace string) JobInterface { +func (c *BatchV1Client) Jobs(namespace string) JobInterface { return newJobs(c, namespace) } -// NewForConfig creates a new BatchClient for the given config. -func NewForConfig(c *rest.Config) (*BatchClient, error) { +// NewForConfig creates a new BatchV1Client for the given config. +func NewForConfig(c *rest.Config) (*BatchV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -47,12 +49,12 @@ func NewForConfig(c *rest.Config) (*BatchClient, error) { if err != nil { return nil, err } - return &BatchClient{client}, nil + return &BatchV1Client{client}, nil } -// NewForConfigOrDie creates a new BatchClient for the given config and +// NewForConfigOrDie creates a new BatchV1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *BatchClient { +func NewForConfigOrDie(c *rest.Config) *BatchV1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -60,26 +62,26 @@ func NewForConfigOrDie(c *rest.Config) *BatchClient { return client } -// New creates a new BatchClient for the given RESTClient. -func New(c rest.Interface) *BatchClient { - return &BatchClient{c} +// New creates a new BatchV1Client for the given RESTClient. +func New(c rest.Interface) *BatchV1Client { + return &BatchV1Client{c} } func setConfigDefaults(config *rest.Config) error { - // if batch group is not registered, return an error - g, err := registered.Group("batch") + gv, err := unversioned.ParseGroupVersion("batch/v1") if err != nil { return err } + // if batch/v1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("batch/v1 is not enabled") + } config.APIPath = "/apis" if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // TODO: Unconditionally set the config.Version, until we fix the config. - //if config.Version == "" { - copyGroupVersion := g.GroupVersion + copyGroupVersion := gv config.GroupVersion = ©GroupVersion - //} config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} @@ -88,7 +90,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *BatchClient) RESTClient() rest.Interface { +func (c *BatchV1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go index fe27cf5c194..ce67c0e5d52 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated typed clients. package v1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go index 6499875c0b5..87e4dda424d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // Package fake has the automatically generated clients. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go index 47e4dbf7b93..1af38ed1e39 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go @@ -22,17 +22,17 @@ import ( testing "k8s.io/client-go/testing" ) -type FakeBatch struct { +type FakeBatchV1 struct { *testing.Fake } -func (c *FakeBatch) Jobs(namespace string) v1.JobInterface { +func (c *FakeBatchV1) Jobs(namespace string) v1.JobInterface { return &FakeJobs{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeBatch) RESTClient() rest.Interface { +func (c *FakeBatchV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go index 98408f670c7..eb14eb91d4c 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go @@ -28,7 +28,7 @@ import ( // FakeJobs implements JobInterface type FakeJobs struct { - Fake *FakeBatch + Fake *FakeBatchV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go index 5d7d9a2522f..dc2e738ed3d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go @@ -51,7 +51,7 @@ type jobs struct { } // newJobs returns a Jobs -func newJobs(c *BatchClient, namespace string) *jobs { +func newJobs(c *BatchV1Client, namespace string) *jobs { return &jobs{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go new file mode 100644 index 00000000000..c9440702ac5 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go @@ -0,0 +1,103 @@ +/* +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 v2alpha1 + +import ( + fmt "fmt" + api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" + registered "k8s.io/client-go/pkg/apimachinery/registered" + serializer "k8s.io/client-go/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" +) + +type BatchV2alpha1Interface interface { + RESTClient() rest.Interface + CronJobsGetter + JobsGetter +} + +// BatchV2alpha1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type BatchV2alpha1Client struct { + restClient rest.Interface +} + +func (c *BatchV2alpha1Client) CronJobs(namespace string) CronJobInterface { + return newCronJobs(c, namespace) +} + +func (c *BatchV2alpha1Client) Jobs(namespace string) JobInterface { + return newJobs(c, namespace) +} + +// NewForConfig creates a new BatchV2alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*BatchV2alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &BatchV2alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new BatchV2alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *BatchV2alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new BatchV2alpha1Client for the given RESTClient. +func New(c rest.Interface) *BatchV2alpha1Client { + return &BatchV2alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv, err := unversioned.ParseGroupVersion("batch/v2alpha1") + if err != nil { + return err + } + // if batch/v2alpha1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("batch/v2alpha1 is not enabled") + } + config.APIPath = "/apis" + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + copyGroupVersion := gv + config.GroupVersion = ©GroupVersion + + config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *BatchV2alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go new file mode 100644 index 00000000000..5f728afa1d7 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go @@ -0,0 +1,167 @@ +/* +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 v2alpha1 + +import ( + api "k8s.io/client-go/pkg/api" + v1 "k8s.io/client-go/pkg/api/v1" + v2alpha1 "k8s.io/client-go/pkg/apis/batch/v2alpha1" + watch "k8s.io/client-go/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// CronJobsGetter has a method to return a CronJobInterface. +// A group's client should implement this interface. +type CronJobsGetter interface { + CronJobs(namespace string) CronJobInterface +} + +// CronJobInterface has methods to work with CronJob resources. +type CronJobInterface interface { + Create(*v2alpha1.CronJob) (*v2alpha1.CronJob, error) + Update(*v2alpha1.CronJob) (*v2alpha1.CronJob, error) + UpdateStatus(*v2alpha1.CronJob) (*v2alpha1.CronJob, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string) (*v2alpha1.CronJob, error) + List(opts v1.ListOptions) (*v2alpha1.CronJobList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) + CronJobExpansion +} + +// cronJobs implements CronJobInterface +type cronJobs struct { + client rest.Interface + ns string +} + +// newCronJobs returns a CronJobs +func newCronJobs(c *BatchV2alpha1Client, namespace string) *cronJobs { + return &cronJobs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. +func (c *cronJobs) Create(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) { + result = &v2alpha1.CronJob{} + err = c.client.Post(). + Namespace(c.ns). + Resource("cronjobs"). + Body(cronJob). + Do(). + Into(result) + return +} + +// Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. +func (c *cronJobs) Update(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) { + result = &v2alpha1.CronJob{} + err = c.client.Put(). + Namespace(c.ns). + Resource("cronjobs"). + Name(cronJob.Name). + Body(cronJob). + Do(). + Into(result) + return +} + +func (c *cronJobs) UpdateStatus(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) { + result = &v2alpha1.CronJob{} + err = c.client.Put(). + Namespace(c.ns). + Resource("cronjobs"). + Name(cronJob.Name). + SubResource("status"). + Body(cronJob). + Do(). + Into(result) + return +} + +// Delete takes name of the cronJob and deletes it. Returns an error if one occurs. +func (c *cronJobs) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("cronjobs"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *cronJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("cronjobs"). + VersionedParams(&listOptions, api.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. +func (c *cronJobs) Get(name string) (result *v2alpha1.CronJob, err error) { + result = &v2alpha1.CronJob{} + err = c.client.Get(). + Namespace(c.ns). + Resource("cronjobs"). + Name(name). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CronJobs that match those selectors. +func (c *cronJobs) List(opts v1.ListOptions) (result *v2alpha1.CronJobList, err error) { + result = &v2alpha1.CronJobList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("cronjobs"). + VersionedParams(&opts, api.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested cronJobs. +func (c *cronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.client.Get(). + Prefix("watch"). + Namespace(c.ns). + Resource("cronjobs"). + VersionedParams(&opts, api.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched cronJob. +func (c *cronJobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) { + result = &v2alpha1.CronJob{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("cronjobs"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go new file mode 100644 index 00000000000..05887a553d9 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] + +// This package has the automatically generated typed clients. +package v2alpha1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go new file mode 100644 index 00000000000..87e4dda424d --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] + +// Package fake has the automatically generated clients. +package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go new file mode 100644 index 00000000000..93f67e0bb2e --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go @@ -0,0 +1,42 @@ +/* +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 fake + +import ( + v2alpha1 "k8s.io/client-go/kubernetes/typed/batch/v2alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeBatchV2alpha1 struct { + *testing.Fake +} + +func (c *FakeBatchV2alpha1) CronJobs(namespace string) v2alpha1.CronJobInterface { + return &FakeCronJobs{c, namespace} +} + +func (c *FakeBatchV2alpha1) Jobs(namespace string) v2alpha1.JobInterface { + return &FakeJobs{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeBatchV2alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go new file mode 100644 index 00000000000..7d5ffb34e47 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go @@ -0,0 +1,128 @@ +/* +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 fake + +import ( + api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" + v1 "k8s.io/client-go/pkg/api/v1" + v2alpha1 "k8s.io/client-go/pkg/apis/batch/v2alpha1" + labels "k8s.io/client-go/pkg/labels" + watch "k8s.io/client-go/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeCronJobs implements CronJobInterface +type FakeCronJobs struct { + Fake *FakeBatchV2alpha1 + ns string +} + +var cronjobsResource = unversioned.GroupVersionResource{Group: "batch", Version: "v2alpha1", Resource: "cronjobs"} + +func (c *FakeCronJobs) Create(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), &v2alpha1.CronJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v2alpha1.CronJob), err +} + +func (c *FakeCronJobs) Update(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), &v2alpha1.CronJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v2alpha1.CronJob), err +} + +func (c *FakeCronJobs) UpdateStatus(cronJob *v2alpha1.CronJob) (*v2alpha1.CronJob, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), &v2alpha1.CronJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v2alpha1.CronJob), err +} + +func (c *FakeCronJobs) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(cronjobsResource, c.ns, name), &v2alpha1.CronJob{}) + + return err +} + +func (c *FakeCronJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v2alpha1.CronJobList{}) + return err +} + +func (c *FakeCronJobs) Get(name string) (result *v2alpha1.CronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), &v2alpha1.CronJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v2alpha1.CronJob), err +} + +func (c *FakeCronJobs) List(opts v1.ListOptions) (result *v2alpha1.CronJobList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(cronjobsResource, c.ns, opts), &v2alpha1.CronJobList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v2alpha1.CronJobList{} + for _, item := range obj.(*v2alpha1.CronJobList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested cronJobs. +func (c *FakeCronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(cronjobsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched cronJob. +func (c *FakeCronJobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, data, subresources...), &v2alpha1.CronJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v2alpha1.CronJob), err +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_job.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_job.go new file mode 100644 index 00000000000..2240eb9f886 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_job.go @@ -0,0 +1,128 @@ +/* +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 fake + +import ( + api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" + v1 "k8s.io/client-go/pkg/api/v1" + v2alpha1 "k8s.io/client-go/pkg/apis/batch/v2alpha1" + labels "k8s.io/client-go/pkg/labels" + watch "k8s.io/client-go/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeJobs implements JobInterface +type FakeJobs struct { + Fake *FakeBatchV2alpha1 + ns string +} + +var jobsResource = unversioned.GroupVersionResource{Group: "batch", Version: "v2alpha1", Resource: "jobs"} + +func (c *FakeJobs) Create(job *v2alpha1.Job) (result *v2alpha1.Job, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &v2alpha1.Job{}) + + if obj == nil { + return nil, err + } + return obj.(*v2alpha1.Job), err +} + +func (c *FakeJobs) Update(job *v2alpha1.Job) (result *v2alpha1.Job, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &v2alpha1.Job{}) + + if obj == nil { + return nil, err + } + return obj.(*v2alpha1.Job), err +} + +func (c *FakeJobs) UpdateStatus(job *v2alpha1.Job) (*v2alpha1.Job, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &v2alpha1.Job{}) + + if obj == nil { + return nil, err + } + return obj.(*v2alpha1.Job), err +} + +func (c *FakeJobs) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(jobsResource, c.ns, name), &v2alpha1.Job{}) + + return err +} + +func (c *FakeJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v2alpha1.JobList{}) + return err +} + +func (c *FakeJobs) Get(name string) (result *v2alpha1.Job, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(jobsResource, c.ns, name), &v2alpha1.Job{}) + + if obj == nil { + return nil, err + } + return obj.(*v2alpha1.Job), err +} + +func (c *FakeJobs) List(opts v1.ListOptions) (result *v2alpha1.JobList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(jobsResource, c.ns, opts), &v2alpha1.JobList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v2alpha1.JobList{} + for _, item := range obj.(*v2alpha1.JobList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested jobs. +func (c *FakeJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched job. +func (c *FakeJobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.Job, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, data, subresources...), &v2alpha1.Job{}) + + if obj == nil { + return nil, err + } + return obj.(*v2alpha1.Job), err +} diff --git a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/defaults.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go similarity index 72% rename from staging/src/k8s.io/client-go/pkg/apis/kubeadm/defaults.go rename to staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go index 7077ec48e0b..2a4b63a2a7d 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/defaults.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go @@ -14,12 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -package kubeadm +package v2alpha1 -const ( - DefaultServiceDNSDomain = "cluster.local" - DefaultServicesSubnet = "10.96.0.0/12" - DefaultKubernetesVersion = "v1.4.4" - DefaultAPIBindPort = 6443 - DefaultDiscoveryBindPort = 9898 -) +type CronJobExpansion interface{} + +type JobExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/job.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/job.go new file mode 100644 index 00000000000..f7a1fdb6166 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/job.go @@ -0,0 +1,167 @@ +/* +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 v2alpha1 + +import ( + api "k8s.io/client-go/pkg/api" + v1 "k8s.io/client-go/pkg/api/v1" + v2alpha1 "k8s.io/client-go/pkg/apis/batch/v2alpha1" + watch "k8s.io/client-go/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// JobsGetter has a method to return a JobInterface. +// A group's client should implement this interface. +type JobsGetter interface { + Jobs(namespace string) JobInterface +} + +// JobInterface has methods to work with Job resources. +type JobInterface interface { + Create(*v2alpha1.Job) (*v2alpha1.Job, error) + Update(*v2alpha1.Job) (*v2alpha1.Job, error) + UpdateStatus(*v2alpha1.Job) (*v2alpha1.Job, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string) (*v2alpha1.Job, error) + List(opts v1.ListOptions) (*v2alpha1.JobList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.Job, err error) + JobExpansion +} + +// jobs implements JobInterface +type jobs struct { + client rest.Interface + ns string +} + +// newJobs returns a Jobs +func newJobs(c *BatchV2alpha1Client, namespace string) *jobs { + return &jobs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. +func (c *jobs) Create(job *v2alpha1.Job) (result *v2alpha1.Job, err error) { + result = &v2alpha1.Job{} + err = c.client.Post(). + Namespace(c.ns). + Resource("jobs"). + Body(job). + Do(). + Into(result) + return +} + +// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. +func (c *jobs) Update(job *v2alpha1.Job) (result *v2alpha1.Job, err error) { + result = &v2alpha1.Job{} + err = c.client.Put(). + Namespace(c.ns). + Resource("jobs"). + Name(job.Name). + Body(job). + Do(). + Into(result) + return +} + +func (c *jobs) UpdateStatus(job *v2alpha1.Job) (result *v2alpha1.Job, err error) { + result = &v2alpha1.Job{} + err = c.client.Put(). + Namespace(c.ns). + Resource("jobs"). + Name(job.Name). + SubResource("status"). + Body(job). + Do(). + Into(result) + return +} + +// Delete takes name of the job and deletes it. Returns an error if one occurs. +func (c *jobs) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("jobs"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *jobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("jobs"). + VersionedParams(&listOptions, api.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the job, and returns the corresponding job object, and an error if there is any. +func (c *jobs) Get(name string) (result *v2alpha1.Job, err error) { + result = &v2alpha1.Job{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobs"). + Name(name). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Jobs that match those selectors. +func (c *jobs) List(opts v1.ListOptions) (result *v2alpha1.JobList, err error) { + result = &v2alpha1.JobList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobs"). + VersionedParams(&opts, api.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested jobs. +func (c *jobs) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.client.Get(). + Prefix("watch"). + Namespace(c.ns). + Resource("jobs"). + VersionedParams(&opts, api.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched job. +func (c *jobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.Job, err error) { + result = &v2alpha1.Job{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("jobs"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificates_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificates_client.go index 872367ea530..b7fcc70078b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificates_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificates_client.go @@ -17,28 +17,30 @@ limitations under the License. package v1alpha1 import ( + fmt "fmt" api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" registered "k8s.io/client-go/pkg/apimachinery/registered" serializer "k8s.io/client-go/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type CertificatesInterface interface { +type CertificatesV1alpha1Interface interface { RESTClient() rest.Interface CertificateSigningRequestsGetter } -// CertificatesClient is used to interact with features provided by the Certificates group. -type CertificatesClient struct { +// CertificatesV1alpha1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type CertificatesV1alpha1Client struct { restClient rest.Interface } -func (c *CertificatesClient) CertificateSigningRequests() CertificateSigningRequestInterface { +func (c *CertificatesV1alpha1Client) CertificateSigningRequests() CertificateSigningRequestInterface { return newCertificateSigningRequests(c) } -// NewForConfig creates a new CertificatesClient for the given config. -func NewForConfig(c *rest.Config) (*CertificatesClient, error) { +// NewForConfig creates a new CertificatesV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*CertificatesV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -47,12 +49,12 @@ func NewForConfig(c *rest.Config) (*CertificatesClient, error) { if err != nil { return nil, err } - return &CertificatesClient{client}, nil + return &CertificatesV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new CertificatesClient for the given config and +// NewForConfigOrDie creates a new CertificatesV1alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *CertificatesClient { +func NewForConfigOrDie(c *rest.Config) *CertificatesV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -60,26 +62,26 @@ func NewForConfigOrDie(c *rest.Config) *CertificatesClient { return client } -// New creates a new CertificatesClient for the given RESTClient. -func New(c rest.Interface) *CertificatesClient { - return &CertificatesClient{c} +// New creates a new CertificatesV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *CertificatesV1alpha1Client { + return &CertificatesV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { - // if certificates group is not registered, return an error - g, err := registered.Group("certificates.k8s.io") + gv, err := unversioned.ParseGroupVersion("certificates.k8s.io/v1alpha1") if err != nil { return err } + // if certificates.k8s.io/v1alpha1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("certificates.k8s.io/v1alpha1 is not enabled") + } config.APIPath = "/apis" if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // TODO: Unconditionally set the config.Version, until we fix the config. - //if config.Version == "" { - copyGroupVersion := g.GroupVersion + copyGroupVersion := gv config.GroupVersion = ©GroupVersion - //} config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} @@ -88,7 +90,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *CertificatesClient) RESTClient() rest.Interface { +func (c *CertificatesV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest.go index 172687424a8..f0cfd274eba 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest.go @@ -50,7 +50,7 @@ type certificateSigningRequests struct { } // newCertificateSigningRequests returns a CertificateSigningRequests -func newCertificateSigningRequests(c *CertificatesClient) *certificateSigningRequests { +func newCertificateSigningRequests(c *CertificatesV1alpha1Client) *certificateSigningRequests { return &certificateSigningRequests{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest_expansion.go new file mode 100644 index 00000000000..580f92c2028 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest_expansion.go @@ -0,0 +1,37 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + certificates "k8s.io/client-go/pkg/apis/certificates/v1alpha1" +) + +type CertificateSigningRequestExpansion interface { + UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) +} + +func (c *certificateSigningRequests) UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) { + result = &certificates.CertificateSigningRequest{} + err = c.client.Put(). + Resource("certificatesigningrequests"). + Name(certificateSigningRequest.Name). + Body(certificateSigningRequest). + SubResource("approval"). + Do(). + Into(result) + return +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/doc.go index 0c1ca41facc..4ca4e887ae2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated typed clients. package v1alpha1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/doc.go index 6499875c0b5..87e4dda424d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // Package fake has the automatically generated clients. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificates_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificates_client.go index f3ab654552c..82d86e101e6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificates_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificates_client.go @@ -22,17 +22,17 @@ import ( testing "k8s.io/client-go/testing" ) -type FakeCertificates struct { +type FakeCertificatesV1alpha1 struct { *testing.Fake } -func (c *FakeCertificates) CertificateSigningRequests() v1alpha1.CertificateSigningRequestInterface { +func (c *FakeCertificatesV1alpha1) CertificateSigningRequests() v1alpha1.CertificateSigningRequestInterface { return &FakeCertificateSigningRequests{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeCertificates) RESTClient() rest.Interface { +func (c *FakeCertificatesV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest.go index c20eb9c71a0..cea61ffa7b0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest.go @@ -28,7 +28,7 @@ import ( // FakeCertificateSigningRequests implements CertificateSigningRequestInterface type FakeCertificateSigningRequests struct { - Fake *FakeCertificates + Fake *FakeCertificatesV1alpha1 } var certificatesigningrequestsResource = unversioned.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1alpha1", Resource: "certificatesigningrequests"} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest_expansion.go new file mode 100644 index 00000000000..7f5277906c4 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest_expansion.go @@ -0,0 +1,31 @@ +/* +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 fake + +import ( + certificates "k8s.io/client-go/pkg/apis/certificates/v1alpha1" + "k8s.io/client-go/testing" +) + +func (c *FakeCertificateSigningRequests) UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "approval", certificateSigningRequest), &certificates.CertificateSigningRequest{}) + if obj == nil { + return nil, err + } + return obj.(*certificates.CertificateSigningRequest), err +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/generated_expansion.go index 1f67dc9d800..66e772d65cb 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/generated_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/generated_expansion.go @@ -15,5 +15,3 @@ limitations under the License. */ package v1alpha1 - -type CertificateSigningRequestExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go index cf9896eba94..0a594b41e5e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go @@ -48,7 +48,7 @@ type componentStatuses struct { } // newComponentStatuses returns a ComponentStatuses -func newComponentStatuses(c *CoreClient) *componentStatuses { +func newComponentStatuses(c *CoreV1Client) *componentStatuses { return &componentStatuses{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go index 88573f15d6c..db0298035ab 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go @@ -49,7 +49,7 @@ type configMaps struct { } // newConfigMaps returns a ConfigMaps -func newConfigMaps(c *CoreClient, namespace string) *configMaps { +func newConfigMaps(c *CoreV1Client, namespace string) *configMaps { return &configMaps{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go index c01c7c2123c..0c9139ade49 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go @@ -17,13 +17,15 @@ limitations under the License. package v1 import ( + fmt "fmt" api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" registered "k8s.io/client-go/pkg/apimachinery/registered" serializer "k8s.io/client-go/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type CoreInterface interface { +type CoreV1Interface interface { RESTClient() rest.Interface ComponentStatusesGetter ConfigMapsGetter @@ -43,77 +45,77 @@ type CoreInterface interface { ServiceAccountsGetter } -// CoreClient is used to interact with features provided by the Core group. -type CoreClient struct { +// CoreV1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type CoreV1Client struct { restClient rest.Interface } -func (c *CoreClient) ComponentStatuses() ComponentStatusInterface { +func (c *CoreV1Client) ComponentStatuses() ComponentStatusInterface { return newComponentStatuses(c) } -func (c *CoreClient) ConfigMaps(namespace string) ConfigMapInterface { +func (c *CoreV1Client) ConfigMaps(namespace string) ConfigMapInterface { return newConfigMaps(c, namespace) } -func (c *CoreClient) Endpoints(namespace string) EndpointsInterface { +func (c *CoreV1Client) Endpoints(namespace string) EndpointsInterface { return newEndpoints(c, namespace) } -func (c *CoreClient) Events(namespace string) EventInterface { +func (c *CoreV1Client) Events(namespace string) EventInterface { return newEvents(c, namespace) } -func (c *CoreClient) LimitRanges(namespace string) LimitRangeInterface { +func (c *CoreV1Client) LimitRanges(namespace string) LimitRangeInterface { return newLimitRanges(c, namespace) } -func (c *CoreClient) Namespaces() NamespaceInterface { +func (c *CoreV1Client) Namespaces() NamespaceInterface { return newNamespaces(c) } -func (c *CoreClient) Nodes() NodeInterface { +func (c *CoreV1Client) Nodes() NodeInterface { return newNodes(c) } -func (c *CoreClient) PersistentVolumes() PersistentVolumeInterface { +func (c *CoreV1Client) PersistentVolumes() PersistentVolumeInterface { return newPersistentVolumes(c) } -func (c *CoreClient) PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface { +func (c *CoreV1Client) PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface { return newPersistentVolumeClaims(c, namespace) } -func (c *CoreClient) Pods(namespace string) PodInterface { +func (c *CoreV1Client) Pods(namespace string) PodInterface { return newPods(c, namespace) } -func (c *CoreClient) PodTemplates(namespace string) PodTemplateInterface { +func (c *CoreV1Client) PodTemplates(namespace string) PodTemplateInterface { return newPodTemplates(c, namespace) } -func (c *CoreClient) ReplicationControllers(namespace string) ReplicationControllerInterface { +func (c *CoreV1Client) ReplicationControllers(namespace string) ReplicationControllerInterface { return newReplicationControllers(c, namespace) } -func (c *CoreClient) ResourceQuotas(namespace string) ResourceQuotaInterface { +func (c *CoreV1Client) ResourceQuotas(namespace string) ResourceQuotaInterface { return newResourceQuotas(c, namespace) } -func (c *CoreClient) Secrets(namespace string) SecretInterface { +func (c *CoreV1Client) Secrets(namespace string) SecretInterface { return newSecrets(c, namespace) } -func (c *CoreClient) Services(namespace string) ServiceInterface { +func (c *CoreV1Client) Services(namespace string) ServiceInterface { return newServices(c, namespace) } -func (c *CoreClient) ServiceAccounts(namespace string) ServiceAccountInterface { +func (c *CoreV1Client) ServiceAccounts(namespace string) ServiceAccountInterface { return newServiceAccounts(c, namespace) } -// NewForConfig creates a new CoreClient for the given config. -func NewForConfig(c *rest.Config) (*CoreClient, error) { +// NewForConfig creates a new CoreV1Client for the given config. +func NewForConfig(c *rest.Config) (*CoreV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -122,12 +124,12 @@ func NewForConfig(c *rest.Config) (*CoreClient, error) { if err != nil { return nil, err } - return &CoreClient{client}, nil + return &CoreV1Client{client}, nil } -// NewForConfigOrDie creates a new CoreClient for the given config and +// NewForConfigOrDie creates a new CoreV1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *CoreClient { +func NewForConfigOrDie(c *rest.Config) *CoreV1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -135,26 +137,26 @@ func NewForConfigOrDie(c *rest.Config) *CoreClient { return client } -// New creates a new CoreClient for the given RESTClient. -func New(c rest.Interface) *CoreClient { - return &CoreClient{c} +// New creates a new CoreV1Client for the given RESTClient. +func New(c rest.Interface) *CoreV1Client { + return &CoreV1Client{c} } func setConfigDefaults(config *rest.Config) error { - // if core group is not registered, return an error - g, err := registered.Group("") + gv, err := unversioned.ParseGroupVersion("/v1") if err != nil { return err } + // if /v1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("/v1 is not enabled") + } config.APIPath = "/api" if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // TODO: Unconditionally set the config.Version, until we fix the config. - //if config.Version == "" { - copyGroupVersion := g.GroupVersion + copyGroupVersion := gv config.GroupVersion = ©GroupVersion - //} config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} @@ -163,7 +165,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *CoreClient) RESTClient() rest.Interface { +func (c *CoreV1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/doc.go index fe27cf5c194..ce67c0e5d52 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated typed clients. package v1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go index 92d03b77ff4..5462e64d654 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go @@ -49,7 +49,7 @@ type endpoints struct { } // newEndpoints returns a Endpoints -func newEndpoints(c *CoreClient, namespace string) *endpoints { +func newEndpoints(c *CoreV1Client, namespace string) *endpoints { return &endpoints{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go index fcd37e20c14..94710ebfa10 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go @@ -49,7 +49,7 @@ type events struct { } // newEvents returns a Events -func newEvents(c *CoreClient, namespace string) *events { +func newEvents(c *CoreV1Client, namespace string) *events { return &events{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go index 6499875c0b5..87e4dda424d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // Package fake has the automatically generated clients. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go index 5846499bc2d..1e3d2f8f043 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go @@ -27,7 +27,7 @@ import ( // FakeComponentStatuses implements ComponentStatusInterface type FakeComponentStatuses struct { - Fake *FakeCore + Fake *FakeCoreV1 } var componentstatusesResource = unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "componentstatuses"} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go index 9480eaf3580..1a5aa3e3a69 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go @@ -27,7 +27,7 @@ import ( // FakeConfigMaps implements ConfigMapInterface type FakeConfigMaps struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go index 149c989f261..dc2855ac9d2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go @@ -22,77 +22,77 @@ import ( testing "k8s.io/client-go/testing" ) -type FakeCore struct { +type FakeCoreV1 struct { *testing.Fake } -func (c *FakeCore) ComponentStatuses() v1.ComponentStatusInterface { +func (c *FakeCoreV1) ComponentStatuses() v1.ComponentStatusInterface { return &FakeComponentStatuses{c} } -func (c *FakeCore) ConfigMaps(namespace string) v1.ConfigMapInterface { +func (c *FakeCoreV1) ConfigMaps(namespace string) v1.ConfigMapInterface { return &FakeConfigMaps{c, namespace} } -func (c *FakeCore) Endpoints(namespace string) v1.EndpointsInterface { +func (c *FakeCoreV1) Endpoints(namespace string) v1.EndpointsInterface { return &FakeEndpoints{c, namespace} } -func (c *FakeCore) Events(namespace string) v1.EventInterface { +func (c *FakeCoreV1) Events(namespace string) v1.EventInterface { return &FakeEvents{c, namespace} } -func (c *FakeCore) LimitRanges(namespace string) v1.LimitRangeInterface { +func (c *FakeCoreV1) LimitRanges(namespace string) v1.LimitRangeInterface { return &FakeLimitRanges{c, namespace} } -func (c *FakeCore) Namespaces() v1.NamespaceInterface { +func (c *FakeCoreV1) Namespaces() v1.NamespaceInterface { return &FakeNamespaces{c} } -func (c *FakeCore) Nodes() v1.NodeInterface { +func (c *FakeCoreV1) Nodes() v1.NodeInterface { return &FakeNodes{c} } -func (c *FakeCore) PersistentVolumes() v1.PersistentVolumeInterface { +func (c *FakeCoreV1) PersistentVolumes() v1.PersistentVolumeInterface { return &FakePersistentVolumes{c} } -func (c *FakeCore) PersistentVolumeClaims(namespace string) v1.PersistentVolumeClaimInterface { +func (c *FakeCoreV1) PersistentVolumeClaims(namespace string) v1.PersistentVolumeClaimInterface { return &FakePersistentVolumeClaims{c, namespace} } -func (c *FakeCore) Pods(namespace string) v1.PodInterface { +func (c *FakeCoreV1) Pods(namespace string) v1.PodInterface { return &FakePods{c, namespace} } -func (c *FakeCore) PodTemplates(namespace string) v1.PodTemplateInterface { +func (c *FakeCoreV1) PodTemplates(namespace string) v1.PodTemplateInterface { return &FakePodTemplates{c, namespace} } -func (c *FakeCore) ReplicationControllers(namespace string) v1.ReplicationControllerInterface { +func (c *FakeCoreV1) ReplicationControllers(namespace string) v1.ReplicationControllerInterface { return &FakeReplicationControllers{c, namespace} } -func (c *FakeCore) ResourceQuotas(namespace string) v1.ResourceQuotaInterface { +func (c *FakeCoreV1) ResourceQuotas(namespace string) v1.ResourceQuotaInterface { return &FakeResourceQuotas{c, namespace} } -func (c *FakeCore) Secrets(namespace string) v1.SecretInterface { +func (c *FakeCoreV1) Secrets(namespace string) v1.SecretInterface { return &FakeSecrets{c, namespace} } -func (c *FakeCore) Services(namespace string) v1.ServiceInterface { +func (c *FakeCoreV1) Services(namespace string) v1.ServiceInterface { return &FakeServices{c, namespace} } -func (c *FakeCore) ServiceAccounts(namespace string) v1.ServiceAccountInterface { +func (c *FakeCoreV1) ServiceAccounts(namespace string) v1.ServiceAccountInterface { return &FakeServiceAccounts{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeCore) RESTClient() rest.Interface { +func (c *FakeCoreV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go index 103276e803a..651af78bd50 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go @@ -27,7 +27,7 @@ import ( // FakeEndpoints implements EndpointsInterface type FakeEndpoints struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go index b3ed1991d5e..c3f4aef35d8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go @@ -27,7 +27,7 @@ import ( // FakeEvents implements EventInterface type FakeEvents struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go index ccd71d29afe..48c8c74d3f1 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go @@ -27,7 +27,7 @@ import ( // FakeLimitRanges implements LimitRangeInterface type FakeLimitRanges struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go index 64adf37111d..1b725fd7271 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go @@ -27,7 +27,7 @@ import ( // FakeNamespaces implements NamespaceInterface type FakeNamespaces struct { - Fake *FakeCore + Fake *FakeCoreV1 } var namespacesResource = unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "namespaces"} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go index b4cc4f82dcf..4bf8f37e26c 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go @@ -27,7 +27,7 @@ import ( // FakeNodes implements NodeInterface type FakeNodes struct { - Fake *FakeCore + Fake *FakeCoreV1 } var nodesResource = unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "nodes"} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node_expansion.go new file mode 100644 index 00000000000..07740dc7e59 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node_expansion.go @@ -0,0 +1,32 @@ +/* +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 fake + +import ( + "k8s.io/client-go/pkg/api/v1" + "k8s.io/client-go/testing" +) + +func (c *FakeNodes) PatchStatus(nodeName string, data []byte) (*v1.Node, error) { + obj, err := c.Fake.Invokes( + testing.NewRootPatchSubresourceAction(nodesResource, nodeName, data, "status"), &v1.Node{}) + if obj == nil { + return nil, err + } + + return obj.(*v1.Node), err +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go index 05c3ee99bfd..c285a98645e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go @@ -27,7 +27,7 @@ import ( // FakePersistentVolumes implements PersistentVolumeInterface type FakePersistentVolumes struct { - Fake *FakeCore + Fake *FakeCoreV1 } var persistentvolumesResource = unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "persistentvolumes"} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go index 4560e6b8e45..5c5a871ea47 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go @@ -27,7 +27,7 @@ import ( // FakePersistentVolumeClaims implements PersistentVolumeClaimInterface type FakePersistentVolumeClaims struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go index a8fe0f1e761..660abe95296 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go @@ -27,7 +27,7 @@ import ( // FakePods implements PodInterface type FakePods struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go index c735e5161b4..fed33ba7d89 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go @@ -27,7 +27,7 @@ import ( // FakePodTemplates implements PodTemplateInterface type FakePodTemplates struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go index 4f89e2a6951..8aace518a04 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go @@ -27,7 +27,7 @@ import ( // FakeReplicationControllers implements ReplicationControllerInterface type FakeReplicationControllers struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go index 666d6a46325..c842cb7840e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go @@ -27,7 +27,7 @@ import ( // FakeResourceQuotas implements ResourceQuotaInterface type FakeResourceQuotas struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go index be374ec00e5..78e3d96f6b2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go @@ -27,7 +27,7 @@ import ( // FakeSecrets implements SecretInterface type FakeSecrets struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go index 2d75241d79a..d8d99854565 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go @@ -27,7 +27,7 @@ import ( // FakeServices implements ServiceInterface type FakeServices struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go index 8fd0617c455..9d4c5aedb7d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go @@ -27,7 +27,7 @@ import ( // FakeServiceAccounts implements ServiceAccountInterface type FakeServiceAccounts struct { - Fake *FakeCore + Fake *FakeCoreV1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go index 0039ffd036f..616adfa18ec 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go @@ -24,8 +24,6 @@ type EndpointsExpansion interface{} type LimitRangeExpansion interface{} -type NodeExpansion interface{} - type PersistentVolumeExpansion interface{} type PersistentVolumeClaimExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go index 4b1672b6ed6..d61496b4983 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go @@ -49,7 +49,7 @@ type limitRanges struct { } // newLimitRanges returns a LimitRanges -func newLimitRanges(c *CoreClient, namespace string) *limitRanges { +func newLimitRanges(c *CoreV1Client, namespace string) *limitRanges { return &limitRanges{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go index d00aded8e50..3f1bd4f3fea 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go @@ -49,7 +49,7 @@ type namespaces struct { } // newNamespaces returns a Namespaces -func newNamespaces(c *CoreClient) *namespaces { +func newNamespaces(c *CoreV1Client) *namespaces { return &namespaces{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go index 60bc523b060..0f459a4a29a 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go @@ -49,7 +49,7 @@ type nodes struct { } // newNodes returns a Nodes -func newNodes(c *CoreClient) *nodes { +func newNodes(c *CoreV1Client) *nodes { return &nodes{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go new file mode 100644 index 00000000000..748b8c6afb1 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go @@ -0,0 +1,43 @@ +/* +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 v1 + +import ( + "k8s.io/client-go/pkg/api" + "k8s.io/client-go/pkg/api/v1" +) + +// The NodeExpansion interface allows manually adding extra methods to the NodeInterface. +type NodeExpansion interface { + // PatchStatus modifies the status of an existing node. It returns the copy + // of the node that the server returns, or an error. + PatchStatus(nodeName string, data []byte) (*v1.Node, error) +} + +// PatchStatus modifies the status of an existing node. It returns the copy of +// the node that the server returns, or an error. +func (c *nodes) PatchStatus(nodeName string, data []byte) (*v1.Node, error) { + result := &v1.Node{} + err := c.client.Patch(api.StrategicMergePatchType). + Resource("nodes"). + Name(nodeName). + SubResource("status"). + Body(data). + Do(). + Into(result) + return result, err +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go index 01e302353d1..bfcafcba59b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go @@ -49,7 +49,7 @@ type persistentVolumes struct { } // newPersistentVolumes returns a PersistentVolumes -func newPersistentVolumes(c *CoreClient) *persistentVolumes { +func newPersistentVolumes(c *CoreV1Client) *persistentVolumes { return &persistentVolumes{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go index 37267fef0f1..ece0efc6296 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -50,7 +50,7 @@ type persistentVolumeClaims struct { } // newPersistentVolumeClaims returns a PersistentVolumeClaims -func newPersistentVolumeClaims(c *CoreClient, namespace string) *persistentVolumeClaims { +func newPersistentVolumeClaims(c *CoreV1Client, namespace string) *persistentVolumeClaims { return &persistentVolumeClaims{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go index 4ac13006741..f5a171944d3 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go @@ -50,7 +50,7 @@ type pods struct { } // newPods returns a Pods -func newPods(c *CoreClient, namespace string) *pods { +func newPods(c *CoreV1Client, namespace string) *pods { return &pods{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go index ce2a83fbd78..419726b5655 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go @@ -49,7 +49,7 @@ type podTemplates struct { } // newPodTemplates returns a PodTemplates -func newPodTemplates(c *CoreClient, namespace string) *podTemplates { +func newPodTemplates(c *CoreV1Client, namespace string) *podTemplates { return &podTemplates{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go index a01a907f9fc..e9d7cc0cdbd 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go @@ -50,7 +50,7 @@ type replicationControllers struct { } // newReplicationControllers returns a ReplicationControllers -func newReplicationControllers(c *CoreClient, namespace string) *replicationControllers { +func newReplicationControllers(c *CoreV1Client, namespace string) *replicationControllers { return &replicationControllers{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go index 1c8bae26e4a..629a58d1465 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go @@ -50,7 +50,7 @@ type resourceQuotas struct { } // newResourceQuotas returns a ResourceQuotas -func newResourceQuotas(c *CoreClient, namespace string) *resourceQuotas { +func newResourceQuotas(c *CoreV1Client, namespace string) *resourceQuotas { return &resourceQuotas{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go index 31f442ce1ac..96a0420ddff 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go @@ -49,7 +49,7 @@ type secrets struct { } // newSecrets returns a Secrets -func newSecrets(c *CoreClient, namespace string) *secrets { +func newSecrets(c *CoreV1Client, namespace string) *secrets { return &secrets{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go index 9ae2e774a5f..7f40b791539 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go @@ -50,7 +50,7 @@ type services struct { } // newServices returns a Services -func newServices(c *CoreClient, namespace string) *services { +func newServices(c *CoreV1Client, namespace string) *services { return &services{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go index 0d907710d42..0af0c714b8b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go @@ -49,7 +49,7 @@ type serviceAccounts struct { } // newServiceAccounts returns a ServiceAccounts -func newServiceAccounts(c *CoreClient, namespace string) *serviceAccounts { +func newServiceAccounts(c *CoreV1Client, namespace string) *serviceAccounts { return &serviceAccounts{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go index bdd0aaff1e5..a562d1a9fdf 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go @@ -51,7 +51,7 @@ type daemonSets struct { } // newDaemonSets returns a DaemonSets -func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets { +func newDaemonSets(c *ExtensionsV1beta1Client, namespace string) *daemonSets { return &daemonSets{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go index 9e60781bf5d..b31d43668d8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go @@ -51,7 +51,7 @@ type deployments struct { } // newDeployments returns a Deployments -func newDeployments(c *ExtensionsClient, namespace string) *deployments { +func newDeployments(c *ExtensionsV1beta1Client, namespace string) *deployments { return &deployments{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go index 5616c95d325..c15d0baccf8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated typed clients. package v1beta1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go index cab9ab58e99..6b90d4b76a7 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go @@ -17,13 +17,15 @@ limitations under the License. package v1beta1 import ( + fmt "fmt" api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" registered "k8s.io/client-go/pkg/apimachinery/registered" serializer "k8s.io/client-go/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type ExtensionsInterface interface { +type ExtensionsV1beta1Interface interface { RESTClient() rest.Interface DaemonSetsGetter DeploymentsGetter @@ -35,45 +37,45 @@ type ExtensionsInterface interface { ThirdPartyResourcesGetter } -// ExtensionsClient is used to interact with features provided by the Extensions group. -type ExtensionsClient struct { +// ExtensionsV1beta1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type ExtensionsV1beta1Client struct { restClient rest.Interface } -func (c *ExtensionsClient) DaemonSets(namespace string) DaemonSetInterface { +func (c *ExtensionsV1beta1Client) DaemonSets(namespace string) DaemonSetInterface { return newDaemonSets(c, namespace) } -func (c *ExtensionsClient) Deployments(namespace string) DeploymentInterface { +func (c *ExtensionsV1beta1Client) Deployments(namespace string) DeploymentInterface { return newDeployments(c, namespace) } -func (c *ExtensionsClient) Ingresses(namespace string) IngressInterface { +func (c *ExtensionsV1beta1Client) Ingresses(namespace string) IngressInterface { return newIngresses(c, namespace) } -func (c *ExtensionsClient) Jobs(namespace string) JobInterface { +func (c *ExtensionsV1beta1Client) Jobs(namespace string) JobInterface { return newJobs(c, namespace) } -func (c *ExtensionsClient) PodSecurityPolicies() PodSecurityPolicyInterface { +func (c *ExtensionsV1beta1Client) PodSecurityPolicies() PodSecurityPolicyInterface { return newPodSecurityPolicies(c) } -func (c *ExtensionsClient) ReplicaSets(namespace string) ReplicaSetInterface { +func (c *ExtensionsV1beta1Client) ReplicaSets(namespace string) ReplicaSetInterface { return newReplicaSets(c, namespace) } -func (c *ExtensionsClient) Scales(namespace string) ScaleInterface { +func (c *ExtensionsV1beta1Client) Scales(namespace string) ScaleInterface { return newScales(c, namespace) } -func (c *ExtensionsClient) ThirdPartyResources() ThirdPartyResourceInterface { +func (c *ExtensionsV1beta1Client) ThirdPartyResources() ThirdPartyResourceInterface { return newThirdPartyResources(c) } -// NewForConfig creates a new ExtensionsClient for the given config. -func NewForConfig(c *rest.Config) (*ExtensionsClient, error) { +// NewForConfig creates a new ExtensionsV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*ExtensionsV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -82,12 +84,12 @@ func NewForConfig(c *rest.Config) (*ExtensionsClient, error) { if err != nil { return nil, err } - return &ExtensionsClient{client}, nil + return &ExtensionsV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new ExtensionsClient for the given config and +// NewForConfigOrDie creates a new ExtensionsV1beta1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ExtensionsClient { +func NewForConfigOrDie(c *rest.Config) *ExtensionsV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -95,26 +97,26 @@ func NewForConfigOrDie(c *rest.Config) *ExtensionsClient { return client } -// New creates a new ExtensionsClient for the given RESTClient. -func New(c rest.Interface) *ExtensionsClient { - return &ExtensionsClient{c} +// New creates a new ExtensionsV1beta1Client for the given RESTClient. +func New(c rest.Interface) *ExtensionsV1beta1Client { + return &ExtensionsV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { - // if extensions group is not registered, return an error - g, err := registered.Group("extensions") + gv, err := unversioned.ParseGroupVersion("extensions/v1beta1") if err != nil { return err } + // if extensions/v1beta1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("extensions/v1beta1 is not enabled") + } config.APIPath = "/apis" if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // TODO: Unconditionally set the config.Version, until we fix the config. - //if config.Version == "" { - copyGroupVersion := g.GroupVersion + copyGroupVersion := gv config.GroupVersion = ©GroupVersion - //} config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} @@ -123,7 +125,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *ExtensionsClient) RESTClient() rest.Interface { +func (c *ExtensionsV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go index 6499875c0b5..87e4dda424d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // Package fake has the automatically generated clients. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go index 279ef6cf33a..575f95409e9 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go @@ -28,7 +28,7 @@ import ( // FakeDaemonSets implements DaemonSetInterface type FakeDaemonSets struct { - Fake *FakeExtensions + Fake *FakeExtensionsV1beta1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go index 9c1e06e3837..9dcdcae3a50 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go @@ -28,7 +28,7 @@ import ( // FakeDeployments implements DeploymentInterface type FakeDeployments struct { - Fake *FakeExtensions + Fake *FakeExtensionsV1beta1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go index dfb44c82648..d40f5788ccd 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go @@ -22,45 +22,45 @@ import ( testing "k8s.io/client-go/testing" ) -type FakeExtensions struct { +type FakeExtensionsV1beta1 struct { *testing.Fake } -func (c *FakeExtensions) DaemonSets(namespace string) v1beta1.DaemonSetInterface { +func (c *FakeExtensionsV1beta1) DaemonSets(namespace string) v1beta1.DaemonSetInterface { return &FakeDaemonSets{c, namespace} } -func (c *FakeExtensions) Deployments(namespace string) v1beta1.DeploymentInterface { +func (c *FakeExtensionsV1beta1) Deployments(namespace string) v1beta1.DeploymentInterface { return &FakeDeployments{c, namespace} } -func (c *FakeExtensions) Ingresses(namespace string) v1beta1.IngressInterface { +func (c *FakeExtensionsV1beta1) Ingresses(namespace string) v1beta1.IngressInterface { return &FakeIngresses{c, namespace} } -func (c *FakeExtensions) Jobs(namespace string) v1beta1.JobInterface { +func (c *FakeExtensionsV1beta1) Jobs(namespace string) v1beta1.JobInterface { return &FakeJobs{c, namespace} } -func (c *FakeExtensions) PodSecurityPolicies() v1beta1.PodSecurityPolicyInterface { +func (c *FakeExtensionsV1beta1) PodSecurityPolicies() v1beta1.PodSecurityPolicyInterface { return &FakePodSecurityPolicies{c} } -func (c *FakeExtensions) ReplicaSets(namespace string) v1beta1.ReplicaSetInterface { +func (c *FakeExtensionsV1beta1) ReplicaSets(namespace string) v1beta1.ReplicaSetInterface { return &FakeReplicaSets{c, namespace} } -func (c *FakeExtensions) Scales(namespace string) v1beta1.ScaleInterface { +func (c *FakeExtensionsV1beta1) Scales(namespace string) v1beta1.ScaleInterface { return &FakeScales{c, namespace} } -func (c *FakeExtensions) ThirdPartyResources() v1beta1.ThirdPartyResourceInterface { +func (c *FakeExtensionsV1beta1) ThirdPartyResources() v1beta1.ThirdPartyResourceInterface { return &FakeThirdPartyResources{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeExtensions) RESTClient() rest.Interface { +func (c *FakeExtensionsV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go index 8ac7061158f..81762511a5f 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go @@ -28,7 +28,7 @@ import ( // FakeIngresses implements IngressInterface type FakeIngresses struct { - Fake *FakeExtensions + Fake *FakeExtensionsV1beta1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_job.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_job.go index 2845bb99395..c790c2dbf70 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_job.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_job.go @@ -28,7 +28,7 @@ import ( // FakeJobs implements JobInterface type FakeJobs struct { - Fake *FakeExtensions + Fake *FakeExtensionsV1beta1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go index e71b293d295..cc6285a769d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go @@ -28,7 +28,7 @@ import ( // FakePodSecurityPolicies implements PodSecurityPolicyInterface type FakePodSecurityPolicies struct { - Fake *FakeExtensions + Fake *FakeExtensionsV1beta1 } var podsecuritypoliciesResource = unversioned.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "podsecuritypolicies"} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go index b12c6b7c102..c10b1a6a5a5 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go @@ -28,7 +28,7 @@ import ( // FakeReplicaSets implements ReplicaSetInterface type FakeReplicaSets struct { - Fake *FakeExtensions + Fake *FakeExtensionsV1beta1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go index 0179e4edce4..7e77279c3c2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_scale.go @@ -18,6 +18,6 @@ package fake // FakeScales implements ScaleInterface type FakeScales struct { - Fake *FakeExtensions + Fake *FakeExtensionsV1beta1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_thirdpartyresource.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_thirdpartyresource.go index 56a244955e6..8df10a17f53 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_thirdpartyresource.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_thirdpartyresource.go @@ -28,7 +28,7 @@ import ( // FakeThirdPartyResources implements ThirdPartyResourceInterface type FakeThirdPartyResources struct { - Fake *FakeExtensions + Fake *FakeExtensionsV1beta1 } var thirdpartyresourcesResource = unversioned.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "thirdpartyresources"} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go index d6a831fc6f4..5864b1a07a2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go @@ -51,7 +51,7 @@ type ingresses struct { } // newIngresses returns a Ingresses -func newIngresses(c *ExtensionsClient, namespace string) *ingresses { +func newIngresses(c *ExtensionsV1beta1Client, namespace string) *ingresses { return &ingresses{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/job.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/job.go index 8984a301814..c27449bbfb0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/job.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/job.go @@ -51,7 +51,7 @@ type jobs struct { } // newJobs returns a Jobs -func newJobs(c *ExtensionsClient, namespace string) *jobs { +func newJobs(c *ExtensionsV1beta1Client, namespace string) *jobs { return &jobs{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go index f2841375e8a..c691415d3f5 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go @@ -49,7 +49,7 @@ type podSecurityPolicies struct { } // newPodSecurityPolicies returns a PodSecurityPolicies -func newPodSecurityPolicies(c *ExtensionsClient) *podSecurityPolicies { +func newPodSecurityPolicies(c *ExtensionsV1beta1Client) *podSecurityPolicies { return &podSecurityPolicies{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go index f0f8bc77dc1..d51b990f1f3 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -51,7 +51,7 @@ type replicaSets struct { } // newReplicaSets returns a ReplicaSets -func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets { +func newReplicaSets(c *ExtensionsV1beta1Client, namespace string) *replicaSets { return &replicaSets{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go index 90c7ed5be0b..87c7837760e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/scale.go @@ -38,7 +38,7 @@ type scales struct { } // newScales returns a Scales -func newScales(c *ExtensionsClient, namespace string) *scales { +func newScales(c *ExtensionsV1beta1Client, namespace string) *scales { return &scales{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/thirdpartyresource.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/thirdpartyresource.go index 18b30c0fb96..935f2abd9fa 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/thirdpartyresource.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/thirdpartyresource.go @@ -49,7 +49,7 @@ type thirdPartyResources struct { } // newThirdPartyResources returns a ThirdPartyResources -func newThirdPartyResources(c *ExtensionsClient) *thirdPartyResources { +func newThirdPartyResources(c *ExtensionsV1beta1Client) *thirdPartyResources { return &thirdPartyResources{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/doc.go index 0c1ca41facc..bc5df818d9e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated typed clients. package v1alpha1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/doc.go index 6499875c0b5..b320cb63658 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] // Package fake has the automatically generated clients. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_poddisruptionbudget.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_poddisruptionbudget.go index 67c8908e89c..8f1efecb6d5 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_poddisruptionbudget.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_poddisruptionbudget.go @@ -28,7 +28,7 @@ import ( // FakePodDisruptionBudgets implements PodDisruptionBudgetInterface type FakePodDisruptionBudgets struct { - Fake *FakePolicy + Fake *FakePolicyV1alpha1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_policy_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_policy_client.go index b62f8dfa5b8..8b233265925 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_policy_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_policy_client.go @@ -22,17 +22,17 @@ import ( testing "k8s.io/client-go/testing" ) -type FakePolicy struct { +type FakePolicyV1alpha1 struct { *testing.Fake } -func (c *FakePolicy) PodDisruptionBudgets(namespace string) v1alpha1.PodDisruptionBudgetInterface { +func (c *FakePolicyV1alpha1) PodDisruptionBudgets(namespace string) v1alpha1.PodDisruptionBudgetInterface { return &FakePodDisruptionBudgets{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakePolicy) RESTClient() rest.Interface { +func (c *FakePolicyV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/poddisruptionbudget.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/poddisruptionbudget.go index 3618bbabb4b..2d02a101132 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/poddisruptionbudget.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/poddisruptionbudget.go @@ -51,7 +51,7 @@ type podDisruptionBudgets struct { } // newPodDisruptionBudgets returns a PodDisruptionBudgets -func newPodDisruptionBudgets(c *PolicyClient, namespace string) *podDisruptionBudgets { +func newPodDisruptionBudgets(c *PolicyV1alpha1Client, namespace string) *podDisruptionBudgets { return &podDisruptionBudgets{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/policy_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/policy_client.go index 6d48a074496..4f1b535dcc2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/policy_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/policy_client.go @@ -17,28 +17,30 @@ limitations under the License. package v1alpha1 import ( + fmt "fmt" api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" registered "k8s.io/client-go/pkg/apimachinery/registered" serializer "k8s.io/client-go/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type PolicyInterface interface { +type PolicyV1alpha1Interface interface { RESTClient() rest.Interface PodDisruptionBudgetsGetter } -// PolicyClient is used to interact with features provided by the Policy group. -type PolicyClient struct { +// PolicyV1alpha1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type PolicyV1alpha1Client struct { restClient rest.Interface } -func (c *PolicyClient) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface { +func (c *PolicyV1alpha1Client) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface { return newPodDisruptionBudgets(c, namespace) } -// NewForConfig creates a new PolicyClient for the given config. -func NewForConfig(c *rest.Config) (*PolicyClient, error) { +// NewForConfig creates a new PolicyV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*PolicyV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -47,12 +49,12 @@ func NewForConfig(c *rest.Config) (*PolicyClient, error) { if err != nil { return nil, err } - return &PolicyClient{client}, nil + return &PolicyV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new PolicyClient for the given config and +// NewForConfigOrDie creates a new PolicyV1alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *PolicyClient { +func NewForConfigOrDie(c *rest.Config) *PolicyV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -60,26 +62,26 @@ func NewForConfigOrDie(c *rest.Config) *PolicyClient { return client } -// New creates a new PolicyClient for the given RESTClient. -func New(c rest.Interface) *PolicyClient { - return &PolicyClient{c} +// New creates a new PolicyV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *PolicyV1alpha1Client { + return &PolicyV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { - // if policy group is not registered, return an error - g, err := registered.Group("policy") + gv, err := unversioned.ParseGroupVersion("policy/v1alpha1") if err != nil { return err } + // if policy/v1alpha1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("policy/v1alpha1 is not enabled") + } config.APIPath = "/apis" if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // TODO: Unconditionally set the config.Version, until we fix the config. - //if config.Version == "" { - copyGroupVersion := g.GroupVersion + copyGroupVersion := gv config.GroupVersion = ©GroupVersion - //} config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} @@ -88,7 +90,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *PolicyClient) RESTClient() rest.Interface { +func (c *PolicyV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go new file mode 100644 index 00000000000..c15d0baccf8 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go new file mode 100644 index 00000000000..87e4dda424d --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] + +// Package fake has the automatically generated clients. +package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go new file mode 100644 index 00000000000..5a62e5a9f95 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go @@ -0,0 +1,128 @@ +/* +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 fake + +import ( + api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" + v1 "k8s.io/client-go/pkg/api/v1" + v1beta1 "k8s.io/client-go/pkg/apis/policy/v1beta1" + labels "k8s.io/client-go/pkg/labels" + watch "k8s.io/client-go/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePodDisruptionBudgets implements PodDisruptionBudgetInterface +type FakePodDisruptionBudgets struct { + Fake *FakePolicyV1beta1 + ns string +} + +var poddisruptionbudgetsResource = unversioned.GroupVersionResource{Group: "policy", Version: "v1beta1", Resource: "poddisruptionbudgets"} + +func (c *FakePodDisruptionBudgets) Create(podDisruptionBudget *v1beta1.PodDisruptionBudget) (result *v1beta1.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), &v1beta1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodDisruptionBudget), err +} + +func (c *FakePodDisruptionBudgets) Update(podDisruptionBudget *v1beta1.PodDisruptionBudget) (result *v1beta1.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), &v1beta1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodDisruptionBudget), err +} + +func (c *FakePodDisruptionBudgets) UpdateStatus(podDisruptionBudget *v1beta1.PodDisruptionBudget) (*v1beta1.PodDisruptionBudget, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget), &v1beta1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodDisruptionBudget), err +} + +func (c *FakePodDisruptionBudgets) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(poddisruptionbudgetsResource, c.ns, name), &v1beta1.PodDisruptionBudget{}) + + return err +} + +func (c *FakePodDisruptionBudgets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(poddisruptionbudgetsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1beta1.PodDisruptionBudgetList{}) + return err +} + +func (c *FakePodDisruptionBudgets) Get(name string) (result *v1beta1.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(poddisruptionbudgetsResource, c.ns, name), &v1beta1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodDisruptionBudget), err +} + +func (c *FakePodDisruptionBudgets) List(opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(poddisruptionbudgetsResource, c.ns, opts), &v1beta1.PodDisruptionBudgetList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.PodDisruptionBudgetList{} + for _, item := range obj.(*v1beta1.PodDisruptionBudgetList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested podDisruptionBudgets. +func (c *FakePodDisruptionBudgets) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(poddisruptionbudgetsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched podDisruptionBudget. +func (c *FakePodDisruptionBudgets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, name, data, subresources...), &v1beta1.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PodDisruptionBudget), err +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go new file mode 100644 index 00000000000..428194e0c46 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go @@ -0,0 +1,38 @@ +/* +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 fake + +import ( + v1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakePolicyV1beta1 struct { + *testing.Fake +} + +func (c *FakePolicyV1beta1) PodDisruptionBudgets(namespace string) v1beta1.PodDisruptionBudgetInterface { + return &FakePodDisruptionBudgets{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakePolicyV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go new file mode 100644 index 00000000000..33896c65b9a --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go @@ -0,0 +1,19 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +type PodDisruptionBudgetExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go new file mode 100644 index 00000000000..7c8d69785be --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go @@ -0,0 +1,167 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + api "k8s.io/client-go/pkg/api" + v1 "k8s.io/client-go/pkg/api/v1" + v1beta1 "k8s.io/client-go/pkg/apis/policy/v1beta1" + watch "k8s.io/client-go/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. +// A group's client should implement this interface. +type PodDisruptionBudgetsGetter interface { + PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface +} + +// PodDisruptionBudgetInterface has methods to work with PodDisruptionBudget resources. +type PodDisruptionBudgetInterface interface { + Create(*v1beta1.PodDisruptionBudget) (*v1beta1.PodDisruptionBudget, error) + Update(*v1beta1.PodDisruptionBudget) (*v1beta1.PodDisruptionBudget, error) + UpdateStatus(*v1beta1.PodDisruptionBudget) (*v1beta1.PodDisruptionBudget, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string) (*v1beta1.PodDisruptionBudget, error) + List(opts v1.ListOptions) (*v1beta1.PodDisruptionBudgetList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) + PodDisruptionBudgetExpansion +} + +// podDisruptionBudgets implements PodDisruptionBudgetInterface +type podDisruptionBudgets struct { + client rest.Interface + ns string +} + +// newPodDisruptionBudgets returns a PodDisruptionBudgets +func newPodDisruptionBudgets(c *PolicyV1beta1Client, namespace string) *podDisruptionBudgets { + return &podDisruptionBudgets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. +func (c *podDisruptionBudgets) Create(podDisruptionBudget *v1beta1.PodDisruptionBudget) (result *v1beta1.PodDisruptionBudget, err error) { + result = &v1beta1.PodDisruptionBudget{} + err = c.client.Post(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Body(podDisruptionBudget). + Do(). + Into(result) + return +} + +// Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. +func (c *podDisruptionBudgets) Update(podDisruptionBudget *v1beta1.PodDisruptionBudget) (result *v1beta1.PodDisruptionBudget, err error) { + result = &v1beta1.PodDisruptionBudget{} + err = c.client.Put(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(podDisruptionBudget.Name). + Body(podDisruptionBudget). + Do(). + Into(result) + return +} + +func (c *podDisruptionBudgets) UpdateStatus(podDisruptionBudget *v1beta1.PodDisruptionBudget) (result *v1beta1.PodDisruptionBudget, err error) { + result = &v1beta1.PodDisruptionBudget{} + err = c.client.Put(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(podDisruptionBudget.Name). + SubResource("status"). + Body(podDisruptionBudget). + Do(). + Into(result) + return +} + +// Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. +func (c *podDisruptionBudgets) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *podDisruptionBudgets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&listOptions, api.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. +func (c *podDisruptionBudgets) Get(name string) (result *v1beta1.PodDisruptionBudget, err error) { + result = &v1beta1.PodDisruptionBudget{} + err = c.client.Get(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(name). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. +func (c *podDisruptionBudgets) List(opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { + result = &v1beta1.PodDisruptionBudgetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&opts, api.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested podDisruptionBudgets. +func (c *podDisruptionBudgets) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.client.Get(). + Prefix("watch"). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&opts, api.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched podDisruptionBudget. +func (c *podDisruptionBudgets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { + result = &v1beta1.PodDisruptionBudget{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go new file mode 100644 index 00000000000..a2605d472d5 --- /dev/null +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go @@ -0,0 +1,98 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + fmt "fmt" + api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" + registered "k8s.io/client-go/pkg/apimachinery/registered" + serializer "k8s.io/client-go/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" +) + +type PolicyV1beta1Interface interface { + RESTClient() rest.Interface + PodDisruptionBudgetsGetter +} + +// PolicyV1beta1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type PolicyV1beta1Client struct { + restClient rest.Interface +} + +func (c *PolicyV1beta1Client) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface { + return newPodDisruptionBudgets(c, namespace) +} + +// NewForConfig creates a new PolicyV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*PolicyV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &PolicyV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new PolicyV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *PolicyV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new PolicyV1beta1Client for the given RESTClient. +func New(c rest.Interface) *PolicyV1beta1Client { + return &PolicyV1beta1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv, err := unversioned.ParseGroupVersion("policy/v1beta1") + if err != nil { + return err + } + // if policy/v1beta1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("policy/v1beta1 is not enabled") + } + config.APIPath = "/apis" + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + copyGroupVersion := gv + config.GroupVersion = ©GroupVersion + + config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *PolicyV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go index d62f5ed76bd..09d96c91f07 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go @@ -49,7 +49,7 @@ type clusterRoles struct { } // newClusterRoles returns a ClusterRoles -func newClusterRoles(c *RbacClient) *clusterRoles { +func newClusterRoles(c *RbacV1alpha1Client) *clusterRoles { return &clusterRoles{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go index d068327a15c..a1ce7c0bdc1 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go @@ -49,7 +49,7 @@ type clusterRoleBindings struct { } // newClusterRoleBindings returns a ClusterRoleBindings -func newClusterRoleBindings(c *RbacClient) *clusterRoleBindings { +func newClusterRoleBindings(c *RbacV1alpha1Client) *clusterRoleBindings { return &clusterRoleBindings{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go index 0c1ca41facc..4ca4e887ae2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated typed clients. package v1alpha1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go index 6499875c0b5..87e4dda424d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // Package fake has the automatically generated clients. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go index 8813b5e32b8..4c6cb70572a 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go @@ -28,7 +28,7 @@ import ( // FakeClusterRoles implements ClusterRoleInterface type FakeClusterRoles struct { - Fake *FakeRbac + Fake *FakeRbacV1alpha1 } var clusterrolesResource = unversioned.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Resource: "clusterroles"} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go index b281bdd72cd..58f695bf59b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go @@ -28,7 +28,7 @@ import ( // FakeClusterRoleBindings implements ClusterRoleBindingInterface type FakeClusterRoleBindings struct { - Fake *FakeRbac + Fake *FakeRbacV1alpha1 } var clusterrolebindingsResource = unversioned.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Resource: "clusterrolebindings"} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go index a451b023271..b11dd64b983 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go @@ -22,29 +22,29 @@ import ( testing "k8s.io/client-go/testing" ) -type FakeRbac struct { +type FakeRbacV1alpha1 struct { *testing.Fake } -func (c *FakeRbac) ClusterRoles() v1alpha1.ClusterRoleInterface { +func (c *FakeRbacV1alpha1) ClusterRoles() v1alpha1.ClusterRoleInterface { return &FakeClusterRoles{c} } -func (c *FakeRbac) ClusterRoleBindings() v1alpha1.ClusterRoleBindingInterface { +func (c *FakeRbacV1alpha1) ClusterRoleBindings() v1alpha1.ClusterRoleBindingInterface { return &FakeClusterRoleBindings{c} } -func (c *FakeRbac) Roles(namespace string) v1alpha1.RoleInterface { +func (c *FakeRbacV1alpha1) Roles(namespace string) v1alpha1.RoleInterface { return &FakeRoles{c, namespace} } -func (c *FakeRbac) RoleBindings(namespace string) v1alpha1.RoleBindingInterface { +func (c *FakeRbacV1alpha1) RoleBindings(namespace string) v1alpha1.RoleBindingInterface { return &FakeRoleBindings{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeRbac) RESTClient() rest.Interface { +func (c *FakeRbacV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go index 8280835bb2f..70ffadc45fc 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go @@ -28,7 +28,7 @@ import ( // FakeRoles implements RoleInterface type FakeRoles struct { - Fake *FakeRbac + Fake *FakeRbacV1alpha1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go index 4f5d1e11374..b2d4e7b2182 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go @@ -28,7 +28,7 @@ import ( // FakeRoleBindings implements RoleBindingInterface type FakeRoleBindings struct { - Fake *FakeRbac + Fake *FakeRbacV1alpha1 ns string } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go index 47814d0cf03..7dbb9f2dbed 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go @@ -17,13 +17,15 @@ limitations under the License. package v1alpha1 import ( + fmt "fmt" api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" registered "k8s.io/client-go/pkg/apimachinery/registered" serializer "k8s.io/client-go/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type RbacInterface interface { +type RbacV1alpha1Interface interface { RESTClient() rest.Interface ClusterRolesGetter ClusterRoleBindingsGetter @@ -31,29 +33,29 @@ type RbacInterface interface { RoleBindingsGetter } -// RbacClient is used to interact with features provided by the Rbac group. -type RbacClient struct { +// RbacV1alpha1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type RbacV1alpha1Client struct { restClient rest.Interface } -func (c *RbacClient) ClusterRoles() ClusterRoleInterface { +func (c *RbacV1alpha1Client) ClusterRoles() ClusterRoleInterface { return newClusterRoles(c) } -func (c *RbacClient) ClusterRoleBindings() ClusterRoleBindingInterface { +func (c *RbacV1alpha1Client) ClusterRoleBindings() ClusterRoleBindingInterface { return newClusterRoleBindings(c) } -func (c *RbacClient) Roles(namespace string) RoleInterface { +func (c *RbacV1alpha1Client) Roles(namespace string) RoleInterface { return newRoles(c, namespace) } -func (c *RbacClient) RoleBindings(namespace string) RoleBindingInterface { +func (c *RbacV1alpha1Client) RoleBindings(namespace string) RoleBindingInterface { return newRoleBindings(c, namespace) } -// NewForConfig creates a new RbacClient for the given config. -func NewForConfig(c *rest.Config) (*RbacClient, error) { +// NewForConfig creates a new RbacV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*RbacV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -62,12 +64,12 @@ func NewForConfig(c *rest.Config) (*RbacClient, error) { if err != nil { return nil, err } - return &RbacClient{client}, nil + return &RbacV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new RbacClient for the given config and +// NewForConfigOrDie creates a new RbacV1alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *RbacClient { +func NewForConfigOrDie(c *rest.Config) *RbacV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -75,26 +77,26 @@ func NewForConfigOrDie(c *rest.Config) *RbacClient { return client } -// New creates a new RbacClient for the given RESTClient. -func New(c rest.Interface) *RbacClient { - return &RbacClient{c} +// New creates a new RbacV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *RbacV1alpha1Client { + return &RbacV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { - // if rbac group is not registered, return an error - g, err := registered.Group("rbac.authorization.k8s.io") + gv, err := unversioned.ParseGroupVersion("rbac.authorization.k8s.io/v1alpha1") if err != nil { return err } + // if rbac.authorization.k8s.io/v1alpha1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("rbac.authorization.k8s.io/v1alpha1 is not enabled") + } config.APIPath = "/apis" if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // TODO: Unconditionally set the config.Version, until we fix the config. - //if config.Version == "" { - copyGroupVersion := g.GroupVersion + copyGroupVersion := gv config.GroupVersion = ©GroupVersion - //} config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} @@ -103,7 +105,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *RbacClient) RESTClient() rest.Interface { +func (c *RbacV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go index 49e8d8ab90a..b5939664e41 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go @@ -50,7 +50,7 @@ type roles struct { } // newRoles returns a Roles -func newRoles(c *RbacClient, namespace string) *roles { +func newRoles(c *RbacV1alpha1Client, namespace string) *roles { return &roles{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go index c1792d4ecbd..a032717ec54 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go @@ -50,7 +50,7 @@ type roleBindings struct { } // newRoleBindings returns a RoleBindings -func newRoleBindings(c *RbacClient, namespace string) *roleBindings { +func newRoleBindings(c *RbacV1alpha1Client, namespace string) *roleBindings { return &roleBindings{ client: c.RESTClient(), ns: namespace, diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go index 5616c95d325..c15d0baccf8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package has the automatically generated typed clients. package v1beta1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go index 6499875c0b5..87e4dda424d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1] +// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // Package fake has the automatically generated clients. package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go index 11820452994..0feec0b4a4b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go @@ -22,17 +22,17 @@ import ( testing "k8s.io/client-go/testing" ) -type FakeStorage struct { +type FakeStorageV1beta1 struct { *testing.Fake } -func (c *FakeStorage) StorageClasses() v1beta1.StorageClassInterface { +func (c *FakeStorageV1beta1) StorageClasses() v1beta1.StorageClassInterface { return &FakeStorageClasses{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeStorage) RESTClient() rest.Interface { +func (c *FakeStorageV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go index 2d2e21686c1..e233a1d1ad6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go @@ -28,7 +28,7 @@ import ( // FakeStorageClasses implements StorageClassInterface type FakeStorageClasses struct { - Fake *FakeStorage + Fake *FakeStorageV1beta1 } var storageclassesResource = unversioned.GroupVersionResource{Group: "storage.k8s.io", Version: "v1beta1", Resource: "storageclasses"} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go index bb6394462eb..b7eb26fd67a 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go @@ -17,28 +17,30 @@ limitations under the License. package v1beta1 import ( + fmt "fmt" api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" registered "k8s.io/client-go/pkg/apimachinery/registered" serializer "k8s.io/client-go/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type StorageInterface interface { +type StorageV1beta1Interface interface { RESTClient() rest.Interface StorageClassesGetter } -// StorageClient is used to interact with features provided by the Storage group. -type StorageClient struct { +// StorageV1beta1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group. +type StorageV1beta1Client struct { restClient rest.Interface } -func (c *StorageClient) StorageClasses() StorageClassInterface { +func (c *StorageV1beta1Client) StorageClasses() StorageClassInterface { return newStorageClasses(c) } -// NewForConfig creates a new StorageClient for the given config. -func NewForConfig(c *rest.Config) (*StorageClient, error) { +// NewForConfig creates a new StorageV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*StorageV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -47,12 +49,12 @@ func NewForConfig(c *rest.Config) (*StorageClient, error) { if err != nil { return nil, err } - return &StorageClient{client}, nil + return &StorageV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new StorageClient for the given config and +// NewForConfigOrDie creates a new StorageV1beta1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *StorageClient { +func NewForConfigOrDie(c *rest.Config) *StorageV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -60,26 +62,26 @@ func NewForConfigOrDie(c *rest.Config) *StorageClient { return client } -// New creates a new StorageClient for the given RESTClient. -func New(c rest.Interface) *StorageClient { - return &StorageClient{c} +// New creates a new StorageV1beta1Client for the given RESTClient. +func New(c rest.Interface) *StorageV1beta1Client { + return &StorageV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { - // if storage group is not registered, return an error - g, err := registered.Group("storage.k8s.io") + gv, err := unversioned.ParseGroupVersion("storage.k8s.io/v1beta1") if err != nil { return err } + // if storage.k8s.io/v1beta1 is not enabled, return an error + if !registered.IsEnabledVersion(gv) { + return fmt.Errorf("storage.k8s.io/v1beta1 is not enabled") + } config.APIPath = "/apis" if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - // TODO: Unconditionally set the config.Version, until we fix the config. - //if config.Version == "" { - copyGroupVersion := g.GroupVersion + copyGroupVersion := gv config.GroupVersion = ©GroupVersion - //} config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} @@ -88,7 +90,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *StorageClient) RESTClient() rest.Interface { +func (c *StorageV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go index 3c37b9e962e..b6f2e74cd11 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go @@ -49,7 +49,7 @@ type storageClasses struct { } // newStorageClasses returns a StorageClasses -func newStorageClasses(c *StorageClient) *storageClasses { +func newStorageClasses(c *StorageV1beta1Client) *storageClasses { return &storageClasses{ client: c.RESTClient(), } diff --git a/staging/src/k8s.io/client-go/pkg/api/errors/errors.go b/staging/src/k8s.io/client-go/pkg/api/errors/errors.go index accd8f48eee..93dd52a2431 100644 --- a/staging/src/k8s.io/client-go/pkg/api/errors/errors.go +++ b/staging/src/k8s.io/client-go/pkg/api/errors/errors.go @@ -413,6 +413,17 @@ func IsInternalError(err error) bool { return reasonForError(err) == unversioned.StatusReasonInternalError } +// IsTooManyRequests determines if err is an error which indicates that there are too many requests +// that the server cannot handle. +// TODO: update IsTooManyRequests() when the TooManyRequests(429) error returned from the API server has a non-empty Reason field +func IsTooManyRequests(err error) bool { + switch t := err.(type) { + case APIStatus: + return t.Status().Code == StatusTooManyRequests + } + return false +} + // IsUnexpectedServerError returns true if the server response was not in the expected API format, // and may be the result of another HTTP actor. func IsUnexpectedServerError(err error) bool { diff --git a/staging/src/k8s.io/client-go/pkg/api/meta/help.go b/staging/src/k8s.io/client-go/pkg/api/meta/help.go index 4a45c8c24f0..607f3fa3fb7 100644 --- a/staging/src/k8s.io/client-go/pkg/api/meta/help.go +++ b/staging/src/k8s.io/client-go/pkg/api/meta/help.go @@ -26,6 +26,14 @@ import ( // IsListType returns true if the provided Object has a slice called Items func IsListType(obj runtime.Object) bool { + // if we're a runtime.Unstructured, check to see if we have an `items` key + // This is a list type for recognition, but other Items type methods will fail on it + // and give you errors. + if unstructured, ok := obj.(*runtime.Unstructured); ok { + _, ok := unstructured.Object["items"] + return ok + } + _, err := GetItemsPtr(obj) return err == nil } @@ -39,6 +47,7 @@ func GetItemsPtr(list runtime.Object) (interface{}, error) { if err != nil { return nil, err } + items := v.FieldByName("Items") if !items.IsValid() { return nil, fmt.Errorf("no Items field in %#v", list) @@ -57,6 +66,57 @@ func GetItemsPtr(list runtime.Object) (interface{}, error) { } } +// EachListItem invokes fn on each runtime.Object in the list. Any error immediately terminates +// the loop. +func EachListItem(obj runtime.Object, fn func(runtime.Object) error) error { + // TODO: Change to an interface call? + itemsPtr, err := GetItemsPtr(obj) + if err != nil { + return err + } + items, err := conversion.EnforcePtr(itemsPtr) + if err != nil { + return err + } + len := items.Len() + if len == 0 { + return nil + } + takeAddr := false + if elemType := items.Type().Elem(); elemType.Kind() != reflect.Ptr && elemType.Kind() != reflect.Interface { + if !items.Index(0).CanAddr() { + return fmt.Errorf("unable to take address of items in %T for EachListItem", obj) + } + takeAddr = true + } + + for i := 0; i < len; i++ { + raw := items.Index(i) + if takeAddr { + raw = raw.Addr() + } + switch item := raw.Interface().(type) { + case *runtime.RawExtension: + if err := fn(item.Object); err != nil { + return err + } + case runtime.Object: + if err := fn(item); err != nil { + return err + } + default: + obj, ok := item.(runtime.Object) + if !ok { + return fmt.Errorf("%v: item[%v]: Expected object, got %#v(%s)", obj, i, raw.Interface(), raw.Kind()) + } + if err := fn(obj); err != nil { + return err + } + } + } + return nil +} + // ExtractList returns obj's Items element as an array of runtime.Objects. // Returns an error if obj is not a List type (does not have an Items member). func ExtractList(obj runtime.Object) ([]runtime.Object, error) { @@ -117,6 +177,13 @@ func SetList(list runtime.Object, objects []runtime.Object) error { slice := reflect.MakeSlice(items.Type(), len(objects), len(objects)) for i := range objects { dest := slice.Index(i) + + // check to see if you're directly assignable + if reflect.TypeOf(objects[i]).AssignableTo(dest.Type()) { + dest.Set(reflect.ValueOf(objects[i])) + continue + } + src, err := conversion.EnforcePtr(objects[i]) if err != nil { return err diff --git a/staging/src/k8s.io/client-go/pkg/api/testapi/testapi.go b/staging/src/k8s.io/client-go/pkg/api/testapi/testapi.go index 274be581463..b461ae3d936 100644 --- a/staging/src/k8s.io/client-go/pkg/api/testapi/testapi.go +++ b/staging/src/k8s.io/client-go/pkg/api/testapi/testapi.go @@ -35,6 +35,7 @@ import ( "k8s.io/client-go/pkg/api/unversioned" "k8s.io/client-go/pkg/apimachinery/registered" "k8s.io/client-go/pkg/apis/apps" + "k8s.io/client-go/pkg/apis/authorization" "k8s.io/client-go/pkg/apis/autoscaling" "k8s.io/client-go/pkg/apis/batch" "k8s.io/client-go/pkg/apis/certificates" @@ -66,18 +67,19 @@ import ( ) var ( - Groups = make(map[string]TestGroup) - Default TestGroup - Autoscaling TestGroup - Batch TestGroup - Extensions TestGroup - Apps TestGroup - Policy TestGroup - Federation TestGroup - Rbac TestGroup - Certificates TestGroup - Storage TestGroup - ImagePolicy TestGroup + Groups = make(map[string]TestGroup) + Default TestGroup + Authorization TestGroup + Autoscaling TestGroup + Batch TestGroup + Extensions TestGroup + Apps TestGroup + Policy TestGroup + Federation TestGroup + Rbac TestGroup + Certificates TestGroup + Storage TestGroup + ImagePolicy TestGroup serializer runtime.SerializerInfo storageSerializer runtime.SerializerInfo @@ -258,6 +260,15 @@ func init() { externalTypes: api.Scheme.KnownTypes(externalGroupVersion), } } + if _, ok := Groups[authorization.GroupName]; !ok { + externalGroupVersion := unversioned.GroupVersion{Group: authorization.GroupName, Version: registered.GroupOrDie(authorization.GroupName).GroupVersion.Version} + Groups[authorization.GroupName] = TestGroup{ + externalGroupVersion: externalGroupVersion, + internalGroupVersion: authorization.SchemeGroupVersion, + internalTypes: api.Scheme.KnownTypes(authorization.SchemeGroupVersion), + externalTypes: api.Scheme.KnownTypes(externalGroupVersion), + } + } if _, ok := Groups[kubeadm.GroupName]; !ok { externalGroupVersion := unversioned.GroupVersion{Group: kubeadm.GroupName, Version: registered.GroupOrDie(kubeadm.GroupName).GroupVersion.Version} Groups[kubeadm.GroupName] = TestGroup{ @@ -279,6 +290,7 @@ func init() { Rbac = Groups[rbac.GroupName] Storage = Groups[storage.GroupName] ImagePolicy = Groups[imagepolicy.GroupName] + Authorization = Groups[authorization.GroupName] } func (g TestGroup) ContentConfig() (string, *unversioned.GroupVersion, runtime.Codec) { diff --git a/staging/src/k8s.io/client-go/pkg/api/types.go b/staging/src/k8s.io/client-go/pkg/api/types.go index dba9c0fa29a..e0f1f3b2a76 100644 --- a/staging/src/k8s.io/client-go/pkg/api/types.go +++ b/staging/src/k8s.io/client-go/pkg/api/types.go @@ -114,15 +114,23 @@ type ObjectMeta struct { // +optional CreationTimestamp unversioned.Time `json:"creationTimestamp,omitempty"` - // DeletionTimestamp is the time after which this resource will be deleted. This + // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This // field is set by the server when a graceful deletion is requested by the user, and is not - // directly settable by a client. The resource will be deleted (no longer visible from - // resource lists, and not reachable by name) after the time in this field. Once set, this - // value may not be unset or be set further into the future, although it may be shortened + // directly settable by a client. The resource is expected to be deleted (no longer visible + // from resource lists, and not reachable by name) after the time in this field. Once set, + // this value may not be unset or be set further into the future, although it may be shortened // or the resource may be deleted prior to this time. For example, a user may request that // a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination - // signal to the containers in the pod. Once the resource is deleted in the API, the Kubelet - // will send a hard termination signal to the container. + // signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard + // termination signal (SIGKILL) to the container and after cleanup, remove the pod from the + // API. In the presence of network partitions, this object may still exist after this + // timestamp, until an administrator or automated process can determine the resource is + // fully terminated. + // If not set, graceful deletion of the object has not been requested. + // + // Populated by the system when a graceful deletion is requested. + // Read-only. + // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional DeletionTimestamp *unversioned.Time `json:"deletionTimestamp,omitempty"` @@ -2570,8 +2578,6 @@ const ( NodeDiskPressure NodeConditionType = "DiskPressure" // NodeNetworkUnavailable means that network for the node is not correctly configured. NodeNetworkUnavailable NodeConditionType = "NetworkUnavailable" - // NodeInodePressure means the kublet is under pressure due to insufficient available inodes. - NodeInodePressure NodeConditionType = "InodePressure" ) type NodeCondition struct { @@ -2592,6 +2598,7 @@ type NodeAddressType string // These are valid address types of node. NodeLegacyHostIP is used to transit // from out-dated HostIP field to NodeAddress. const ( + // Deprecated: NodeLegacyHostIP will be removed in 1.7. NodeLegacyHostIP NodeAddressType = "LegacyHostIP" NodeHostName NodeAddressType = "Hostname" NodeExternalIP NodeAddressType = "ExternalIP" diff --git a/staging/src/k8s.io/client-go/pkg/api/unversioned/well_known_labels.go b/staging/src/k8s.io/client-go/pkg/api/unversioned/well_known_labels.go index 318c6eebf1f..7556181e88b 100644 --- a/staging/src/k8s.io/client-go/pkg/api/unversioned/well_known_labels.go +++ b/staging/src/k8s.io/client-go/pkg/api/unversioned/well_known_labels.go @@ -28,3 +28,40 @@ const ( LabelOS = "beta.kubernetes.io/os" LabelArch = "beta.kubernetes.io/arch" ) + +// Role labels are applied to Nodes to mark their purpose. In particular, we +// usually want to distinguish the master, so that we can isolate privileged +// pods and operations. +// +// Originally we relied on not registering the master, on the fact that the +// master was Unschedulable, and on static manifests for master components. +// But we now do register masters in many environments, are generally moving +// away from static manifests (for better manageability), and working towards +// deprecating the unschedulable field (replacing it with taints & tolerations +// instead). +// +// Even with tainting, a label remains the easiest way of making a positive +// selection, so that pods can schedule only to master nodes for example, and +// thus installations will likely define a label for their master nodes. +// +// So that we can recognize master nodes in consequent places though (such as +// kubectl get nodes), we encourage installations to use the well-known labels. +// We define NodeLabelRole, which is the preferred form, but we will also recognize +// other forms that are known to be in widespread use (NodeLabelKubeadmAlphaRole). + +const ( + // NodeLabelRole is the preferred label applied to a Node as a hint that it has a particular purpose (defined by the value). + NodeLabelRole = "kubernetes.io/role" + + // NodeLabelKubeadmAlphaRole is a label that kubeadm applies to a Node as a hint that it has a particular purpose. + // Use of NodeLabelRole is preferred. + NodeLabelKubeadmAlphaRole = "kubeadm.alpha.kubernetes.io/role" + + // NodeLabelRoleMaster is the value of a NodeLabelRole or NodeLabelKubeadmAlphaRole label, indicating a master node. + // A master node typically runs kubernetes system components and will not typically run user workloads. + NodeLabelRoleMaster = "master" + + // NodeLabelRoleNode is the value of a NodeLabelRole or NodeLabelKubeadmAlphaRole label, indicating a "normal" node, + // as opposed to a RoleMaster node. + NodeLabelRoleNode = "node" +) diff --git a/staging/src/k8s.io/client-go/pkg/api/v1/generated.proto b/staging/src/k8s.io/client-go/pkg/api/v1/generated.proto index 03499c972bb..8a046f5397e 100644 --- a/staging/src/k8s.io/client-go/pkg/api/v1/generated.proto +++ b/staging/src/k8s.io/client-go/pkg/api/v1/generated.proto @@ -1705,13 +1705,16 @@ message ObjectMeta { // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This // field is set by the server when a graceful deletion is requested by the user, and is not - // directly settable by a client. The resource will be deleted (no longer visible from - // resource lists, and not reachable by name) after the time in this field. Once set, this - // value may not be unset or be set further into the future, although it may be shortened + // directly settable by a client. The resource is expected to be deleted (no longer visible + // from resource lists, and not reachable by name) after the time in this field. Once set, + // this value may not be unset or be set further into the future, although it may be shortened // or the resource may be deleted prior to this time. For example, a user may request that // a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination - // signal to the containers in the pod. Once the resource is deleted in the API, the Kubelet - // will send a hard termination signal to the container. + // signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard + // termination signal (SIGKILL) to the container and after cleanup, remove the pod from the + // API. In the presence of network partitions, this object may still exist after this + // timestamp, until an administrator or automated process can determine the resource is + // fully terminated. // If not set, graceful deletion of the object has not been requested. // // Populated by the system when a graceful deletion is requested. diff --git a/staging/src/k8s.io/client-go/pkg/api/v1/types.go b/staging/src/k8s.io/client-go/pkg/api/v1/types.go index 377a77000c0..3b4e55b2433 100644 --- a/staging/src/k8s.io/client-go/pkg/api/v1/types.go +++ b/staging/src/k8s.io/client-go/pkg/api/v1/types.go @@ -151,13 +151,16 @@ type ObjectMeta struct { // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This // field is set by the server when a graceful deletion is requested by the user, and is not - // directly settable by a client. The resource will be deleted (no longer visible from - // resource lists, and not reachable by name) after the time in this field. Once set, this - // value may not be unset or be set further into the future, although it may be shortened + // directly settable by a client. The resource is expected to be deleted (no longer visible + // from resource lists, and not reachable by name) after the time in this field. Once set, + // this value may not be unset or be set further into the future, although it may be shortened // or the resource may be deleted prior to this time. For example, a user may request that // a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination - // signal to the containers in the pod. Once the resource is deleted in the API, the Kubelet - // will send a hard termination signal to the container. + // signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard + // termination signal (SIGKILL) to the container and after cleanup, remove the pod from the + // API. In the presence of network partitions, this object may still exist after this + // timestamp, until an administrator or automated process can determine the resource is + // fully terminated. // If not set, graceful deletion of the object has not been requested. // // Populated by the system when a graceful deletion is requested. @@ -1630,6 +1633,8 @@ const ( // PodReady means the pod is able to service requests and should be added to the // load balancing pools of all matching services. PodReady PodConditionType = "Ready" + // PodInitialized means that all init containers in the pod have started successfully. + PodInitialized PodConditionType = "Initialized" // PodReasonUnschedulable reason in PodScheduled PodCondition means that the scheduler // can't schedule the pod right now, for example due to insufficient resources in the cluster. PodReasonUnschedulable = "Unschedulable" @@ -2334,7 +2339,7 @@ type ReplicationControllerStatus struct { // Represents the latest available observations of a replication controller's current state. // +optional - Conditions []ReplicationControllerCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + Conditions []ReplicationControllerCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,6,rep,name=conditions"` } type ReplicationControllerConditionType string @@ -2350,18 +2355,18 @@ const ( // ReplicationControllerCondition describes the state of a replication controller at a certain point. type ReplicationControllerCondition struct { // Type of replication controller condition. - Type ReplicationControllerConditionType `json:"type"` + Type ReplicationControllerConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ReplicationControllerConditionType"` // Status of the condition, one of True, False, Unknown. - Status ConditionStatus `json:"status"` + Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` // The last time the condition transitioned from one status to another. // +optional - LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"` + LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // The reason for the condition's last transition. // +optional - Reason string `json:"reason,omitempty"` + Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // A human readable message indicating details about the transition. // +optional - Message string `json:"message,omitempty"` + Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } // +genclient=true @@ -3001,9 +3006,11 @@ type NodeAddressType string // These are valid address type of node. const ( - NodeHostName NodeAddressType = "Hostname" - NodeExternalIP NodeAddressType = "ExternalIP" - NodeInternalIP NodeAddressType = "InternalIP" + // Deprecated: NodeLegacyHostIP will be removed in 1.7. + NodeLegacyHostIP NodeAddressType = "LegacyHostIP" + NodeHostName NodeAddressType = "Hostname" + NodeExternalIP NodeAddressType = "ExternalIP" + NodeInternalIP NodeAddressType = "InternalIP" ) // NodeAddress contains information for the node's address. diff --git a/staging/src/k8s.io/client-go/pkg/api/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/client-go/pkg/api/v1/types_swagger_doc_generated.go index 6dc17675b62..f55397cfc88 100644 --- a/staging/src/k8s.io/client-go/pkg/api/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/client-go/pkg/api/v1/types_swagger_doc_generated.go @@ -964,7 +964,7 @@ var map_ObjectMeta = map[string]string{ "resourceVersion": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency", "generation": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", "creationTimestamp": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", - "deletionTimestamp": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource will be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. Once the resource is deleted in the API, the Kubelet will send a hard termination signal to the container. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", + "deletionTimestamp": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", "deletionGracePeriodSeconds": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", "labels": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels", "annotations": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations", diff --git a/staging/src/k8s.io/client-go/pkg/api/v1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/api/v1/zz_generated.conversion.go index 921ebe664b3..56fe778c894 100644 --- a/staging/src/k8s.io/client-go/pkg/api/v1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/api/v1/zz_generated.conversion.go @@ -22,10 +22,11 @@ package v1 import ( api "k8s.io/client-go/pkg/api" - resource "k8s.io/client-go/pkg/api/resource" + unversioned "k8s.io/client-go/pkg/api/unversioned" conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" types "k8s.io/client-go/pkg/types" + unsafe "unsafe" ) func init() { @@ -374,33 +375,9 @@ func Convert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolu } func autoConvert_v1_Affinity_To_api_Affinity(in *Affinity, out *api.Affinity, s conversion.Scope) error { - if in.NodeAffinity != nil { - in, out := &in.NodeAffinity, &out.NodeAffinity - *out = new(api.NodeAffinity) - if err := Convert_v1_NodeAffinity_To_api_NodeAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.NodeAffinity = nil - } - if in.PodAffinity != nil { - in, out := &in.PodAffinity, &out.PodAffinity - *out = new(api.PodAffinity) - if err := Convert_v1_PodAffinity_To_api_PodAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.PodAffinity = nil - } - if in.PodAntiAffinity != nil { - in, out := &in.PodAntiAffinity, &out.PodAntiAffinity - *out = new(api.PodAntiAffinity) - if err := Convert_v1_PodAntiAffinity_To_api_PodAntiAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.PodAntiAffinity = nil - } + out.NodeAffinity = (*api.NodeAffinity)(unsafe.Pointer(in.NodeAffinity)) + out.PodAffinity = (*api.PodAffinity)(unsafe.Pointer(in.PodAffinity)) + out.PodAntiAffinity = (*api.PodAntiAffinity)(unsafe.Pointer(in.PodAntiAffinity)) return nil } @@ -409,33 +386,9 @@ func Convert_v1_Affinity_To_api_Affinity(in *Affinity, out *api.Affinity, s conv } func autoConvert_api_Affinity_To_v1_Affinity(in *api.Affinity, out *Affinity, s conversion.Scope) error { - if in.NodeAffinity != nil { - in, out := &in.NodeAffinity, &out.NodeAffinity - *out = new(NodeAffinity) - if err := Convert_api_NodeAffinity_To_v1_NodeAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.NodeAffinity = nil - } - if in.PodAffinity != nil { - in, out := &in.PodAffinity, &out.PodAffinity - *out = new(PodAffinity) - if err := Convert_api_PodAffinity_To_v1_PodAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.PodAffinity = nil - } - if in.PodAntiAffinity != nil { - in, out := &in.PodAntiAffinity, &out.PodAntiAffinity - *out = new(PodAntiAffinity) - if err := Convert_api_PodAntiAffinity_To_v1_PodAntiAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.PodAntiAffinity = nil - } + out.NodeAffinity = (*NodeAffinity)(unsafe.Pointer(in.NodeAffinity)) + out.PodAffinity = (*PodAffinity)(unsafe.Pointer(in.PodAffinity)) + out.PodAntiAffinity = (*PodAntiAffinity)(unsafe.Pointer(in.PodAntiAffinity)) return nil } @@ -464,17 +417,7 @@ func Convert_api_AttachedVolume_To_v1_AttachedVolume(in *api.AttachedVolume, out } func autoConvert_v1_AvoidPods_To_api_AvoidPods(in *AvoidPods, out *api.AvoidPods, s conversion.Scope) error { - if in.PreferAvoidPods != nil { - in, out := &in.PreferAvoidPods, &out.PreferAvoidPods - *out = make([]api.PreferAvoidPodsEntry, len(*in)) - for i := range *in { - if err := Convert_v1_PreferAvoidPodsEntry_To_api_PreferAvoidPodsEntry(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferAvoidPods = nil - } + out.PreferAvoidPods = *(*[]api.PreferAvoidPodsEntry)(unsafe.Pointer(&in.PreferAvoidPods)) return nil } @@ -483,17 +426,7 @@ func Convert_v1_AvoidPods_To_api_AvoidPods(in *AvoidPods, out *api.AvoidPods, s } func autoConvert_api_AvoidPods_To_v1_AvoidPods(in *api.AvoidPods, out *AvoidPods, s conversion.Scope) error { - if in.PreferAvoidPods != nil { - in, out := &in.PreferAvoidPods, &out.PreferAvoidPods - *out = make([]PreferAvoidPodsEntry, len(*in)) - for i := range *in { - if err := Convert_api_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferAvoidPods = nil - } + out.PreferAvoidPods = *(*[]PreferAvoidPodsEntry)(unsafe.Pointer(&in.PreferAvoidPods)) return nil } @@ -504,15 +437,9 @@ func Convert_api_AvoidPods_To_v1_AvoidPods(in *api.AvoidPods, out *AvoidPods, s func autoConvert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource(in *AzureDiskVolumeSource, out *api.AzureDiskVolumeSource, s conversion.Scope) error { out.DiskName = in.DiskName out.DataDiskURI = in.DataDiskURI - if in.CachingMode != nil { - in, out := &in.CachingMode, &out.CachingMode - *out = new(api.AzureDataDiskCachingMode) - **out = api.AzureDataDiskCachingMode(**in) - } else { - out.CachingMode = nil - } - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly + out.CachingMode = (*api.AzureDataDiskCachingMode)(unsafe.Pointer(in.CachingMode)) + out.FSType = (*string)(unsafe.Pointer(in.FSType)) + out.ReadOnly = (*bool)(unsafe.Pointer(in.ReadOnly)) return nil } @@ -523,15 +450,9 @@ func Convert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource(in *AzureDisk func autoConvert_api_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(in *api.AzureDiskVolumeSource, out *AzureDiskVolumeSource, s conversion.Scope) error { out.DiskName = in.DiskName out.DataDiskURI = in.DataDiskURI - if in.CachingMode != nil { - in, out := &in.CachingMode, &out.CachingMode - *out = new(AzureDataDiskCachingMode) - **out = AzureDataDiskCachingMode(**in) - } else { - out.CachingMode = nil - } - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly + out.CachingMode = (*AzureDataDiskCachingMode)(unsafe.Pointer(in.CachingMode)) + out.FSType = (*string)(unsafe.Pointer(in.FSType)) + out.ReadOnly = (*bool)(unsafe.Pointer(in.ReadOnly)) return nil } @@ -590,24 +511,8 @@ func Convert_api_Binding_To_v1_Binding(in *api.Binding, out *Binding, s conversi } func autoConvert_v1_Capabilities_To_api_Capabilities(in *Capabilities, out *api.Capabilities, s conversion.Scope) error { - if in.Add != nil { - in, out := &in.Add, &out.Add - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = api.Capability((*in)[i]) - } - } else { - out.Add = nil - } - if in.Drop != nil { - in, out := &in.Drop, &out.Drop - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = api.Capability((*in)[i]) - } - } else { - out.Drop = nil - } + out.Add = *(*[]api.Capability)(unsafe.Pointer(&in.Add)) + out.Drop = *(*[]api.Capability)(unsafe.Pointer(&in.Drop)) return nil } @@ -616,24 +521,8 @@ func Convert_v1_Capabilities_To_api_Capabilities(in *Capabilities, out *api.Capa } func autoConvert_api_Capabilities_To_v1_Capabilities(in *api.Capabilities, out *Capabilities, s conversion.Scope) error { - if in.Add != nil { - in, out := &in.Add, &out.Add - *out = make([]Capability, len(*in)) - for i := range *in { - (*out)[i] = Capability((*in)[i]) - } - } else { - out.Add = nil - } - if in.Drop != nil { - in, out := &in.Drop, &out.Drop - *out = make([]Capability, len(*in)) - for i := range *in { - (*out)[i] = Capability((*in)[i]) - } - } else { - out.Drop = nil - } + out.Add = *(*[]Capability)(unsafe.Pointer(&in.Add)) + out.Drop = *(*[]Capability)(unsafe.Pointer(&in.Drop)) return nil } @@ -642,19 +531,11 @@ func Convert_api_Capabilities_To_v1_Capabilities(in *api.Capabilities, out *Capa } func autoConvert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource(in *CephFSVolumeSource, out *api.CephFSVolumeSource, s conversion.Scope) error { - out.Monitors = in.Monitors + out.Monitors = *(*[]string)(unsafe.Pointer(&in.Monitors)) out.Path = in.Path out.User = in.User out.SecretFile = in.SecretFile - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(api.LocalObjectReference) - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } + out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) out.ReadOnly = in.ReadOnly return nil } @@ -664,19 +545,11 @@ func Convert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource(in *CephFSVolumeSou } func autoConvert_api_CephFSVolumeSource_To_v1_CephFSVolumeSource(in *api.CephFSVolumeSource, out *CephFSVolumeSource, s conversion.Scope) error { - out.Monitors = in.Monitors + out.Monitors = *(*[]string)(unsafe.Pointer(&in.Monitors)) out.Path = in.Path out.User = in.User out.SecretFile = in.SecretFile - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } + out.SecretRef = (*LocalObjectReference)(unsafe.Pointer(in.SecretRef)) out.ReadOnly = in.ReadOnly return nil } @@ -735,17 +608,7 @@ func autoConvert_v1_ComponentStatus_To_api_ComponentStatus(in *ComponentStatus, if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]api.ComponentCondition, len(*in)) - for i := range *in { - if err := Convert_v1_ComponentCondition_To_api_ComponentCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } + out.Conditions = *(*[]api.ComponentCondition)(unsafe.Pointer(&in.Conditions)) return nil } @@ -757,17 +620,7 @@ func autoConvert_api_ComponentStatus_To_v1_ComponentStatus(in *api.ComponentStat if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ComponentCondition, len(*in)) - for i := range *in { - if err := Convert_api_ComponentCondition_To_v1_ComponentCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } + out.Conditions = *(*[]ComponentCondition)(unsafe.Pointer(&in.Conditions)) return nil } @@ -777,17 +630,7 @@ func Convert_api_ComponentStatus_To_v1_ComponentStatus(in *api.ComponentStatus, func autoConvert_v1_ComponentStatusList_To_api_ComponentStatusList(in *ComponentStatusList, out *api.ComponentStatusList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.ComponentStatus, len(*in)) - for i := range *in { - if err := Convert_v1_ComponentStatus_To_api_ComponentStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]api.ComponentStatus)(unsafe.Pointer(&in.Items)) return nil } @@ -797,17 +640,7 @@ func Convert_v1_ComponentStatusList_To_api_ComponentStatusList(in *ComponentStat func autoConvert_api_ComponentStatusList_To_v1_ComponentStatusList(in *api.ComponentStatusList, out *ComponentStatusList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ComponentStatus, len(*in)) - for i := range *in { - if err := Convert_api_ComponentStatus_To_v1_ComponentStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]ComponentStatus)(unsafe.Pointer(&in.Items)) return nil } @@ -819,7 +652,7 @@ func autoConvert_v1_ConfigMap_To_api_ConfigMap(in *ConfigMap, out *api.ConfigMap if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - out.Data = in.Data + out.Data = *(*map[string]string)(unsafe.Pointer(&in.Data)) return nil } @@ -831,7 +664,7 @@ func autoConvert_api_ConfigMap_To_v1_ConfigMap(in *api.ConfigMap, out *ConfigMap if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - out.Data = in.Data + out.Data = *(*map[string]string)(unsafe.Pointer(&in.Data)) return nil } @@ -865,17 +698,7 @@ func Convert_api_ConfigMapKeySelector_To_v1_ConfigMapKeySelector(in *api.ConfigM func autoConvert_v1_ConfigMapList_To_api_ConfigMapList(in *ConfigMapList, out *api.ConfigMapList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.ConfigMap, len(*in)) - for i := range *in { - if err := Convert_v1_ConfigMap_To_api_ConfigMap(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]api.ConfigMap)(unsafe.Pointer(&in.Items)) return nil } @@ -885,17 +708,7 @@ func Convert_v1_ConfigMapList_To_api_ConfigMapList(in *ConfigMapList, out *api.C func autoConvert_api_ConfigMapList_To_v1_ConfigMapList(in *api.ConfigMapList, out *ConfigMapList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ConfigMap, len(*in)) - for i := range *in { - if err := Convert_api_ConfigMap_To_v1_ConfigMap(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]ConfigMap)(unsafe.Pointer(&in.Items)) return nil } @@ -907,18 +720,8 @@ func autoConvert_v1_ConfigMapVolumeSource_To_api_ConfigMapVolumeSource(in *Confi if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { return err } - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.KeyToPath, len(*in)) - for i := range *in { - if err := Convert_v1_KeyToPath_To_api_KeyToPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - out.DefaultMode = in.DefaultMode + out.Items = *(*[]api.KeyToPath)(unsafe.Pointer(&in.Items)) + out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) return nil } @@ -930,18 +733,8 @@ func autoConvert_api_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(in *api.C if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { return err } - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KeyToPath, len(*in)) - for i := range *in { - if err := Convert_api_KeyToPath_To_v1_KeyToPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - out.DefaultMode = in.DefaultMode + out.Items = *(*[]KeyToPath)(unsafe.Pointer(&in.Items)) + out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) return nil } @@ -952,83 +745,21 @@ func Convert_api_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(in *api.Confi func autoConvert_v1_Container_To_api_Container(in *Container, out *api.Container, s conversion.Scope) error { out.Name = in.Name out.Image = in.Image - out.Command = in.Command - out.Args = in.Args + out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) + out.Args = *(*[]string)(unsafe.Pointer(&in.Args)) out.WorkingDir = in.WorkingDir - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]api.ContainerPort, len(*in)) - for i := range *in { - if err := Convert_v1_ContainerPort_To_api_ContainerPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make([]api.EnvVar, len(*in)) - for i := range *in { - if err := Convert_v1_EnvVar_To_api_EnvVar(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Env = nil - } + out.Ports = *(*[]api.ContainerPort)(unsafe.Pointer(&in.Ports)) + out.Env = *(*[]api.EnvVar)(unsafe.Pointer(&in.Env)) if err := Convert_v1_ResourceRequirements_To_api_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { return err } - if in.VolumeMounts != nil { - in, out := &in.VolumeMounts, &out.VolumeMounts - *out = make([]api.VolumeMount, len(*in)) - for i := range *in { - if err := Convert_v1_VolumeMount_To_api_VolumeMount(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.VolumeMounts = nil - } - if in.LivenessProbe != nil { - in, out := &in.LivenessProbe, &out.LivenessProbe - *out = new(api.Probe) - if err := Convert_v1_Probe_To_api_Probe(*in, *out, s); err != nil { - return err - } - } else { - out.LivenessProbe = nil - } - if in.ReadinessProbe != nil { - in, out := &in.ReadinessProbe, &out.ReadinessProbe - *out = new(api.Probe) - if err := Convert_v1_Probe_To_api_Probe(*in, *out, s); err != nil { - return err - } - } else { - out.ReadinessProbe = nil - } - if in.Lifecycle != nil { - in, out := &in.Lifecycle, &out.Lifecycle - *out = new(api.Lifecycle) - if err := Convert_v1_Lifecycle_To_api_Lifecycle(*in, *out, s); err != nil { - return err - } - } else { - out.Lifecycle = nil - } + out.VolumeMounts = *(*[]api.VolumeMount)(unsafe.Pointer(&in.VolumeMounts)) + out.LivenessProbe = (*api.Probe)(unsafe.Pointer(in.LivenessProbe)) + out.ReadinessProbe = (*api.Probe)(unsafe.Pointer(in.ReadinessProbe)) + out.Lifecycle = (*api.Lifecycle)(unsafe.Pointer(in.Lifecycle)) out.TerminationMessagePath = in.TerminationMessagePath out.ImagePullPolicy = api.PullPolicy(in.ImagePullPolicy) - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(api.SecurityContext) - if err := Convert_v1_SecurityContext_To_api_SecurityContext(*in, *out, s); err != nil { - return err - } - } else { - out.SecurityContext = nil - } + out.SecurityContext = (*api.SecurityContext)(unsafe.Pointer(in.SecurityContext)) out.Stdin = in.Stdin out.StdinOnce = in.StdinOnce out.TTY = in.TTY @@ -1042,83 +773,21 @@ func Convert_v1_Container_To_api_Container(in *Container, out *api.Container, s func autoConvert_api_Container_To_v1_Container(in *api.Container, out *Container, s conversion.Scope) error { out.Name = in.Name out.Image = in.Image - out.Command = in.Command - out.Args = in.Args + out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) + out.Args = *(*[]string)(unsafe.Pointer(&in.Args)) out.WorkingDir = in.WorkingDir - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]ContainerPort, len(*in)) - for i := range *in { - if err := Convert_api_ContainerPort_To_v1_ContainerPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make([]EnvVar, len(*in)) - for i := range *in { - if err := Convert_api_EnvVar_To_v1_EnvVar(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Env = nil - } + out.Ports = *(*[]ContainerPort)(unsafe.Pointer(&in.Ports)) + out.Env = *(*[]EnvVar)(unsafe.Pointer(&in.Env)) if err := Convert_api_ResourceRequirements_To_v1_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { return err } - if in.VolumeMounts != nil { - in, out := &in.VolumeMounts, &out.VolumeMounts - *out = make([]VolumeMount, len(*in)) - for i := range *in { - if err := Convert_api_VolumeMount_To_v1_VolumeMount(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.VolumeMounts = nil - } - if in.LivenessProbe != nil { - in, out := &in.LivenessProbe, &out.LivenessProbe - *out = new(Probe) - if err := Convert_api_Probe_To_v1_Probe(*in, *out, s); err != nil { - return err - } - } else { - out.LivenessProbe = nil - } - if in.ReadinessProbe != nil { - in, out := &in.ReadinessProbe, &out.ReadinessProbe - *out = new(Probe) - if err := Convert_api_Probe_To_v1_Probe(*in, *out, s); err != nil { - return err - } - } else { - out.ReadinessProbe = nil - } - if in.Lifecycle != nil { - in, out := &in.Lifecycle, &out.Lifecycle - *out = new(Lifecycle) - if err := Convert_api_Lifecycle_To_v1_Lifecycle(*in, *out, s); err != nil { - return err - } - } else { - out.Lifecycle = nil - } + out.VolumeMounts = *(*[]VolumeMount)(unsafe.Pointer(&in.VolumeMounts)) + out.LivenessProbe = (*Probe)(unsafe.Pointer(in.LivenessProbe)) + out.ReadinessProbe = (*Probe)(unsafe.Pointer(in.ReadinessProbe)) + out.Lifecycle = (*Lifecycle)(unsafe.Pointer(in.Lifecycle)) out.TerminationMessagePath = in.TerminationMessagePath out.ImagePullPolicy = PullPolicy(in.ImagePullPolicy) - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(SecurityContext) - if err := Convert_api_SecurityContext_To_v1_SecurityContext(*in, *out, s); err != nil { - return err - } - } else { - out.SecurityContext = nil - } + out.SecurityContext = (*SecurityContext)(unsafe.Pointer(in.SecurityContext)) out.Stdin = in.Stdin out.StdinOnce = in.StdinOnce out.TTY = in.TTY @@ -1130,7 +799,7 @@ func Convert_api_Container_To_v1_Container(in *api.Container, out *Container, s } func autoConvert_v1_ContainerImage_To_api_ContainerImage(in *ContainerImage, out *api.ContainerImage, s conversion.Scope) error { - out.Names = in.Names + out.Names = *(*[]string)(unsafe.Pointer(&in.Names)) out.SizeBytes = in.SizeBytes return nil } @@ -1140,7 +809,7 @@ func Convert_v1_ContainerImage_To_api_ContainerImage(in *ContainerImage, out *ap } func autoConvert_api_ContainerImage_To_v1_ContainerImage(in *api.ContainerImage, out *ContainerImage, s conversion.Scope) error { - out.Names = in.Names + out.Names = *(*[]string)(unsafe.Pointer(&in.Names)) out.SizeBytes = in.SizeBytes return nil } @@ -1176,33 +845,9 @@ func Convert_api_ContainerPort_To_v1_ContainerPort(in *api.ContainerPort, out *C } func autoConvert_v1_ContainerState_To_api_ContainerState(in *ContainerState, out *api.ContainerState, s conversion.Scope) error { - if in.Waiting != nil { - in, out := &in.Waiting, &out.Waiting - *out = new(api.ContainerStateWaiting) - if err := Convert_v1_ContainerStateWaiting_To_api_ContainerStateWaiting(*in, *out, s); err != nil { - return err - } - } else { - out.Waiting = nil - } - if in.Running != nil { - in, out := &in.Running, &out.Running - *out = new(api.ContainerStateRunning) - if err := Convert_v1_ContainerStateRunning_To_api_ContainerStateRunning(*in, *out, s); err != nil { - return err - } - } else { - out.Running = nil - } - if in.Terminated != nil { - in, out := &in.Terminated, &out.Terminated - *out = new(api.ContainerStateTerminated) - if err := Convert_v1_ContainerStateTerminated_To_api_ContainerStateTerminated(*in, *out, s); err != nil { - return err - } - } else { - out.Terminated = nil - } + out.Waiting = (*api.ContainerStateWaiting)(unsafe.Pointer(in.Waiting)) + out.Running = (*api.ContainerStateRunning)(unsafe.Pointer(in.Running)) + out.Terminated = (*api.ContainerStateTerminated)(unsafe.Pointer(in.Terminated)) return nil } @@ -1211,33 +856,9 @@ func Convert_v1_ContainerState_To_api_ContainerState(in *ContainerState, out *ap } func autoConvert_api_ContainerState_To_v1_ContainerState(in *api.ContainerState, out *ContainerState, s conversion.Scope) error { - if in.Waiting != nil { - in, out := &in.Waiting, &out.Waiting - *out = new(ContainerStateWaiting) - if err := Convert_api_ContainerStateWaiting_To_v1_ContainerStateWaiting(*in, *out, s); err != nil { - return err - } - } else { - out.Waiting = nil - } - if in.Running != nil { - in, out := &in.Running, &out.Running - *out = new(ContainerStateRunning) - if err := Convert_api_ContainerStateRunning_To_v1_ContainerStateRunning(*in, *out, s); err != nil { - return err - } - } else { - out.Running = nil - } - if in.Terminated != nil { - in, out := &in.Terminated, &out.Terminated - *out = new(ContainerStateTerminated) - if err := Convert_api_ContainerStateTerminated_To_v1_ContainerStateTerminated(*in, *out, s); err != nil { - return err - } - } else { - out.Terminated = nil - } + out.Waiting = (*ContainerStateWaiting)(unsafe.Pointer(in.Waiting)) + out.Running = (*ContainerStateRunning)(unsafe.Pointer(in.Running)) + out.Terminated = (*ContainerStateTerminated)(unsafe.Pointer(in.Terminated)) return nil } @@ -1372,17 +993,9 @@ func Convert_api_DaemonEndpoint_To_v1_DaemonEndpoint(in *api.DaemonEndpoint, out } func autoConvert_v1_DeleteOptions_To_api_DeleteOptions(in *DeleteOptions, out *api.DeleteOptions, s conversion.Scope) error { - out.GracePeriodSeconds = in.GracePeriodSeconds - if in.Preconditions != nil { - in, out := &in.Preconditions, &out.Preconditions - *out = new(api.Preconditions) - if err := Convert_v1_Preconditions_To_api_Preconditions(*in, *out, s); err != nil { - return err - } - } else { - out.Preconditions = nil - } - out.OrphanDependents = in.OrphanDependents + out.GracePeriodSeconds = (*int64)(unsafe.Pointer(in.GracePeriodSeconds)) + out.Preconditions = (*api.Preconditions)(unsafe.Pointer(in.Preconditions)) + out.OrphanDependents = (*bool)(unsafe.Pointer(in.OrphanDependents)) return nil } @@ -1391,17 +1004,9 @@ func Convert_v1_DeleteOptions_To_api_DeleteOptions(in *DeleteOptions, out *api.D } func autoConvert_api_DeleteOptions_To_v1_DeleteOptions(in *api.DeleteOptions, out *DeleteOptions, s conversion.Scope) error { - out.GracePeriodSeconds = in.GracePeriodSeconds - if in.Preconditions != nil { - in, out := &in.Preconditions, &out.Preconditions - *out = new(Preconditions) - if err := Convert_api_Preconditions_To_v1_Preconditions(*in, *out, s); err != nil { - return err - } - } else { - out.Preconditions = nil - } - out.OrphanDependents = in.OrphanDependents + out.GracePeriodSeconds = (*int64)(unsafe.Pointer(in.GracePeriodSeconds)) + out.Preconditions = (*Preconditions)(unsafe.Pointer(in.Preconditions)) + out.OrphanDependents = (*bool)(unsafe.Pointer(in.OrphanDependents)) return nil } @@ -1411,25 +1016,9 @@ func Convert_api_DeleteOptions_To_v1_DeleteOptions(in *api.DeleteOptions, out *D func autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error { out.Path = in.Path - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(api.ObjectFieldSelector) - if err := Convert_v1_ObjectFieldSelector_To_api_ObjectFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(api.ResourceFieldSelector) - if err := Convert_v1_ResourceFieldSelector_To_api_ResourceFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - out.Mode = in.Mode + out.FieldRef = (*api.ObjectFieldSelector)(unsafe.Pointer(in.FieldRef)) + out.ResourceFieldRef = (*api.ResourceFieldSelector)(unsafe.Pointer(in.ResourceFieldRef)) + out.Mode = (*int32)(unsafe.Pointer(in.Mode)) return nil } @@ -1439,25 +1028,9 @@ func Convert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *DownwardA func autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *DownwardAPIVolumeFile, s conversion.Scope) error { out.Path = in.Path - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(ObjectFieldSelector) - if err := Convert_api_ObjectFieldSelector_To_v1_ObjectFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(ResourceFieldSelector) - if err := Convert_api_ResourceFieldSelector_To_v1_ResourceFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - out.Mode = in.Mode + out.FieldRef = (*ObjectFieldSelector)(unsafe.Pointer(in.FieldRef)) + out.ResourceFieldRef = (*ResourceFieldSelector)(unsafe.Pointer(in.ResourceFieldRef)) + out.Mode = (*int32)(unsafe.Pointer(in.Mode)) return nil } @@ -1466,18 +1039,8 @@ func Convert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.Downw } func autoConvert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(in *DownwardAPIVolumeSource, out *api.DownwardAPIVolumeSource, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.DownwardAPIVolumeFile, len(*in)) - for i := range *in { - if err := Convert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - out.DefaultMode = in.DefaultMode + out.Items = *(*[]api.DownwardAPIVolumeFile)(unsafe.Pointer(&in.Items)) + out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) return nil } @@ -1486,18 +1049,8 @@ func Convert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(in *Downw } func autoConvert_api_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(in *api.DownwardAPIVolumeSource, out *DownwardAPIVolumeSource, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DownwardAPIVolumeFile, len(*in)) - for i := range *in { - if err := Convert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - out.DefaultMode = in.DefaultMode + out.Items = *(*[]DownwardAPIVolumeFile)(unsafe.Pointer(&in.Items)) + out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) return nil } @@ -1526,16 +1079,8 @@ func Convert_api_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(in *api.EmptyDi func autoConvert_v1_EndpointAddress_To_api_EndpointAddress(in *EndpointAddress, out *api.EndpointAddress, s conversion.Scope) error { out.IP = in.IP out.Hostname = in.Hostname - out.NodeName = in.NodeName - if in.TargetRef != nil { - in, out := &in.TargetRef, &out.TargetRef - *out = new(api.ObjectReference) - if err := Convert_v1_ObjectReference_To_api_ObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.TargetRef = nil - } + out.NodeName = (*string)(unsafe.Pointer(in.NodeName)) + out.TargetRef = (*api.ObjectReference)(unsafe.Pointer(in.TargetRef)) return nil } @@ -1546,16 +1091,8 @@ func Convert_v1_EndpointAddress_To_api_EndpointAddress(in *EndpointAddress, out func autoConvert_api_EndpointAddress_To_v1_EndpointAddress(in *api.EndpointAddress, out *EndpointAddress, s conversion.Scope) error { out.IP = in.IP out.Hostname = in.Hostname - out.NodeName = in.NodeName - if in.TargetRef != nil { - in, out := &in.TargetRef, &out.TargetRef - *out = new(ObjectReference) - if err := Convert_api_ObjectReference_To_v1_ObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.TargetRef = nil - } + out.NodeName = (*string)(unsafe.Pointer(in.NodeName)) + out.TargetRef = (*ObjectReference)(unsafe.Pointer(in.TargetRef)) return nil } @@ -1586,39 +1123,9 @@ func Convert_api_EndpointPort_To_v1_EndpointPort(in *api.EndpointPort, out *Endp } func autoConvert_v1_EndpointSubset_To_api_EndpointSubset(in *EndpointSubset, out *api.EndpointSubset, s conversion.Scope) error { - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]api.EndpointAddress, len(*in)) - for i := range *in { - if err := Convert_v1_EndpointAddress_To_api_EndpointAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - if in.NotReadyAddresses != nil { - in, out := &in.NotReadyAddresses, &out.NotReadyAddresses - *out = make([]api.EndpointAddress, len(*in)) - for i := range *in { - if err := Convert_v1_EndpointAddress_To_api_EndpointAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.NotReadyAddresses = nil - } - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]api.EndpointPort, len(*in)) - for i := range *in { - if err := Convert_v1_EndpointPort_To_api_EndpointPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } + out.Addresses = *(*[]api.EndpointAddress)(unsafe.Pointer(&in.Addresses)) + out.NotReadyAddresses = *(*[]api.EndpointAddress)(unsafe.Pointer(&in.NotReadyAddresses)) + out.Ports = *(*[]api.EndpointPort)(unsafe.Pointer(&in.Ports)) return nil } @@ -1627,39 +1134,9 @@ func Convert_v1_EndpointSubset_To_api_EndpointSubset(in *EndpointSubset, out *ap } func autoConvert_api_EndpointSubset_To_v1_EndpointSubset(in *api.EndpointSubset, out *EndpointSubset, s conversion.Scope) error { - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]EndpointAddress, len(*in)) - for i := range *in { - if err := Convert_api_EndpointAddress_To_v1_EndpointAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - if in.NotReadyAddresses != nil { - in, out := &in.NotReadyAddresses, &out.NotReadyAddresses - *out = make([]EndpointAddress, len(*in)) - for i := range *in { - if err := Convert_api_EndpointAddress_To_v1_EndpointAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.NotReadyAddresses = nil - } - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]EndpointPort, len(*in)) - for i := range *in { - if err := Convert_api_EndpointPort_To_v1_EndpointPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } + out.Addresses = *(*[]EndpointAddress)(unsafe.Pointer(&in.Addresses)) + out.NotReadyAddresses = *(*[]EndpointAddress)(unsafe.Pointer(&in.NotReadyAddresses)) + out.Ports = *(*[]EndpointPort)(unsafe.Pointer(&in.Ports)) return nil } @@ -1671,17 +1148,7 @@ func autoConvert_v1_Endpoints_To_api_Endpoints(in *Endpoints, out *api.Endpoints if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - if in.Subsets != nil { - in, out := &in.Subsets, &out.Subsets - *out = make([]api.EndpointSubset, len(*in)) - for i := range *in { - if err := Convert_v1_EndpointSubset_To_api_EndpointSubset(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subsets = nil - } + out.Subsets = *(*[]api.EndpointSubset)(unsafe.Pointer(&in.Subsets)) return nil } @@ -1693,17 +1160,7 @@ func autoConvert_api_Endpoints_To_v1_Endpoints(in *api.Endpoints, out *Endpoints if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - if in.Subsets != nil { - in, out := &in.Subsets, &out.Subsets - *out = make([]EndpointSubset, len(*in)) - for i := range *in { - if err := Convert_api_EndpointSubset_To_v1_EndpointSubset(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subsets = nil - } + out.Subsets = *(*[]EndpointSubset)(unsafe.Pointer(&in.Subsets)) return nil } @@ -1713,17 +1170,7 @@ func Convert_api_Endpoints_To_v1_Endpoints(in *api.Endpoints, out *Endpoints, s func autoConvert_v1_EndpointsList_To_api_EndpointsList(in *EndpointsList, out *api.EndpointsList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.Endpoints, len(*in)) - for i := range *in { - if err := Convert_v1_Endpoints_To_api_Endpoints(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]api.Endpoints)(unsafe.Pointer(&in.Items)) return nil } @@ -1733,17 +1180,7 @@ func Convert_v1_EndpointsList_To_api_EndpointsList(in *EndpointsList, out *api.E func autoConvert_api_EndpointsList_To_v1_EndpointsList(in *api.EndpointsList, out *EndpointsList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Endpoints, len(*in)) - for i := range *in { - if err := Convert_api_Endpoints_To_v1_Endpoints(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]Endpoints)(unsafe.Pointer(&in.Items)) return nil } @@ -1754,15 +1191,7 @@ func Convert_api_EndpointsList_To_v1_EndpointsList(in *api.EndpointsList, out *E func autoConvert_v1_EnvVar_To_api_EnvVar(in *EnvVar, out *api.EnvVar, s conversion.Scope) error { out.Name = in.Name out.Value = in.Value - if in.ValueFrom != nil { - in, out := &in.ValueFrom, &out.ValueFrom - *out = new(api.EnvVarSource) - if err := Convert_v1_EnvVarSource_To_api_EnvVarSource(*in, *out, s); err != nil { - return err - } - } else { - out.ValueFrom = nil - } + out.ValueFrom = (*api.EnvVarSource)(unsafe.Pointer(in.ValueFrom)) return nil } @@ -1773,15 +1202,7 @@ func Convert_v1_EnvVar_To_api_EnvVar(in *EnvVar, out *api.EnvVar, s conversion.S func autoConvert_api_EnvVar_To_v1_EnvVar(in *api.EnvVar, out *EnvVar, s conversion.Scope) error { out.Name = in.Name out.Value = in.Value - if in.ValueFrom != nil { - in, out := &in.ValueFrom, &out.ValueFrom - *out = new(EnvVarSource) - if err := Convert_api_EnvVarSource_To_v1_EnvVarSource(*in, *out, s); err != nil { - return err - } - } else { - out.ValueFrom = nil - } + out.ValueFrom = (*EnvVarSource)(unsafe.Pointer(in.ValueFrom)) return nil } @@ -1790,42 +1211,10 @@ func Convert_api_EnvVar_To_v1_EnvVar(in *api.EnvVar, out *EnvVar, s conversion.S } func autoConvert_v1_EnvVarSource_To_api_EnvVarSource(in *EnvVarSource, out *api.EnvVarSource, s conversion.Scope) error { - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(api.ObjectFieldSelector) - if err := Convert_v1_ObjectFieldSelector_To_api_ObjectFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(api.ResourceFieldSelector) - if err := Convert_v1_ResourceFieldSelector_To_api_ResourceFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - if in.ConfigMapKeyRef != nil { - in, out := &in.ConfigMapKeyRef, &out.ConfigMapKeyRef - *out = new(api.ConfigMapKeySelector) - if err := Convert_v1_ConfigMapKeySelector_To_api_ConfigMapKeySelector(*in, *out, s); err != nil { - return err - } - } else { - out.ConfigMapKeyRef = nil - } - if in.SecretKeyRef != nil { - in, out := &in.SecretKeyRef, &out.SecretKeyRef - *out = new(api.SecretKeySelector) - if err := Convert_v1_SecretKeySelector_To_api_SecretKeySelector(*in, *out, s); err != nil { - return err - } - } else { - out.SecretKeyRef = nil - } + out.FieldRef = (*api.ObjectFieldSelector)(unsafe.Pointer(in.FieldRef)) + out.ResourceFieldRef = (*api.ResourceFieldSelector)(unsafe.Pointer(in.ResourceFieldRef)) + out.ConfigMapKeyRef = (*api.ConfigMapKeySelector)(unsafe.Pointer(in.ConfigMapKeyRef)) + out.SecretKeyRef = (*api.SecretKeySelector)(unsafe.Pointer(in.SecretKeyRef)) return nil } @@ -1834,42 +1223,10 @@ func Convert_v1_EnvVarSource_To_api_EnvVarSource(in *EnvVarSource, out *api.EnvV } func autoConvert_api_EnvVarSource_To_v1_EnvVarSource(in *api.EnvVarSource, out *EnvVarSource, s conversion.Scope) error { - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(ObjectFieldSelector) - if err := Convert_api_ObjectFieldSelector_To_v1_ObjectFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(ResourceFieldSelector) - if err := Convert_api_ResourceFieldSelector_To_v1_ResourceFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - if in.ConfigMapKeyRef != nil { - in, out := &in.ConfigMapKeyRef, &out.ConfigMapKeyRef - *out = new(ConfigMapKeySelector) - if err := Convert_api_ConfigMapKeySelector_To_v1_ConfigMapKeySelector(*in, *out, s); err != nil { - return err - } - } else { - out.ConfigMapKeyRef = nil - } - if in.SecretKeyRef != nil { - in, out := &in.SecretKeyRef, &out.SecretKeyRef - *out = new(SecretKeySelector) - if err := Convert_api_SecretKeySelector_To_v1_SecretKeySelector(*in, *out, s); err != nil { - return err - } - } else { - out.SecretKeyRef = nil - } + out.FieldRef = (*ObjectFieldSelector)(unsafe.Pointer(in.FieldRef)) + out.ResourceFieldRef = (*ResourceFieldSelector)(unsafe.Pointer(in.ResourceFieldRef)) + out.ConfigMapKeyRef = (*ConfigMapKeySelector)(unsafe.Pointer(in.ConfigMapKeyRef)) + out.SecretKeyRef = (*SecretKeySelector)(unsafe.Pointer(in.SecretKeyRef)) return nil } @@ -1925,17 +1282,7 @@ func Convert_api_Event_To_v1_Event(in *api.Event, out *Event, s conversion.Scope func autoConvert_v1_EventList_To_api_EventList(in *EventList, out *api.EventList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.Event, len(*in)) - for i := range *in { - if err := Convert_v1_Event_To_api_Event(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]api.Event)(unsafe.Pointer(&in.Items)) return nil } @@ -1945,17 +1292,7 @@ func Convert_v1_EventList_To_api_EventList(in *EventList, out *api.EventList, s func autoConvert_api_EventList_To_v1_EventList(in *api.EventList, out *EventList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Event, len(*in)) - for i := range *in { - if err := Convert_api_Event_To_v1_Event(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]Event)(unsafe.Pointer(&in.Items)) return nil } @@ -1984,7 +1321,7 @@ func Convert_api_EventSource_To_v1_EventSource(in *api.EventSource, out *EventSo } func autoConvert_v1_ExecAction_To_api_ExecAction(in *ExecAction, out *api.ExecAction, s conversion.Scope) error { - out.Command = in.Command + out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) return nil } @@ -1993,7 +1330,7 @@ func Convert_v1_ExecAction_To_api_ExecAction(in *ExecAction, out *api.ExecAction } func autoConvert_api_ExecAction_To_v1_ExecAction(in *api.ExecAction, out *ExecAction, s conversion.Scope) error { - out.Command = in.Command + out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) return nil } @@ -2022,8 +1359,8 @@ func Convert_api_ExportOptions_To_v1_ExportOptions(in *api.ExportOptions, out *E } func autoConvert_v1_FCVolumeSource_To_api_FCVolumeSource(in *FCVolumeSource, out *api.FCVolumeSource, s conversion.Scope) error { - out.TargetWWNs = in.TargetWWNs - out.Lun = in.Lun + out.TargetWWNs = *(*[]string)(unsafe.Pointer(&in.TargetWWNs)) + out.Lun = (*int32)(unsafe.Pointer(in.Lun)) out.FSType = in.FSType out.ReadOnly = in.ReadOnly return nil @@ -2034,8 +1371,8 @@ func Convert_v1_FCVolumeSource_To_api_FCVolumeSource(in *FCVolumeSource, out *ap } func autoConvert_api_FCVolumeSource_To_v1_FCVolumeSource(in *api.FCVolumeSource, out *FCVolumeSource, s conversion.Scope) error { - out.TargetWWNs = in.TargetWWNs - out.Lun = in.Lun + out.TargetWWNs = *(*[]string)(unsafe.Pointer(&in.TargetWWNs)) + out.Lun = (*int32)(unsafe.Pointer(in.Lun)) out.FSType = in.FSType out.ReadOnly = in.ReadOnly return nil @@ -2048,17 +1385,9 @@ func Convert_api_FCVolumeSource_To_v1_FCVolumeSource(in *api.FCVolumeSource, out func autoConvert_v1_FlexVolumeSource_To_api_FlexVolumeSource(in *FlexVolumeSource, out *api.FlexVolumeSource, s conversion.Scope) error { out.Driver = in.Driver out.FSType = in.FSType - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(api.LocalObjectReference) - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } + out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) out.ReadOnly = in.ReadOnly - out.Options = in.Options + out.Options = *(*map[string]string)(unsafe.Pointer(&in.Options)) return nil } @@ -2069,17 +1398,9 @@ func Convert_v1_FlexVolumeSource_To_api_FlexVolumeSource(in *FlexVolumeSource, o func autoConvert_api_FlexVolumeSource_To_v1_FlexVolumeSource(in *api.FlexVolumeSource, out *FlexVolumeSource, s conversion.Scope) error { out.Driver = in.Driver out.FSType = in.FSType - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } + out.SecretRef = (*LocalObjectReference)(unsafe.Pointer(in.SecretRef)) out.ReadOnly = in.ReadOnly - out.Options = in.Options + out.Options = *(*map[string]string)(unsafe.Pointer(&in.Options)) return nil } @@ -2180,17 +1501,7 @@ func autoConvert_v1_HTTPGetAction_To_api_HTTPGetAction(in *HTTPGetAction, out *a out.Port = in.Port out.Host = in.Host out.Scheme = api.URIScheme(in.Scheme) - if in.HTTPHeaders != nil { - in, out := &in.HTTPHeaders, &out.HTTPHeaders - *out = make([]api.HTTPHeader, len(*in)) - for i := range *in { - if err := Convert_v1_HTTPHeader_To_api_HTTPHeader(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.HTTPHeaders = nil - } + out.HTTPHeaders = *(*[]api.HTTPHeader)(unsafe.Pointer(&in.HTTPHeaders)) return nil } @@ -2203,17 +1514,7 @@ func autoConvert_api_HTTPGetAction_To_v1_HTTPGetAction(in *api.HTTPGetAction, ou out.Port = in.Port out.Host = in.Host out.Scheme = URIScheme(in.Scheme) - if in.HTTPHeaders != nil { - in, out := &in.HTTPHeaders, &out.HTTPHeaders - *out = make([]HTTPHeader, len(*in)) - for i := range *in { - if err := Convert_api_HTTPHeader_To_v1_HTTPHeader(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.HTTPHeaders = nil - } + out.HTTPHeaders = *(*[]HTTPHeader)(unsafe.Pointer(&in.HTTPHeaders)) return nil } @@ -2242,33 +1543,9 @@ func Convert_api_HTTPHeader_To_v1_HTTPHeader(in *api.HTTPHeader, out *HTTPHeader } func autoConvert_v1_Handler_To_api_Handler(in *Handler, out *api.Handler, s conversion.Scope) error { - if in.Exec != nil { - in, out := &in.Exec, &out.Exec - *out = new(api.ExecAction) - if err := Convert_v1_ExecAction_To_api_ExecAction(*in, *out, s); err != nil { - return err - } - } else { - out.Exec = nil - } - if in.HTTPGet != nil { - in, out := &in.HTTPGet, &out.HTTPGet - *out = new(api.HTTPGetAction) - if err := Convert_v1_HTTPGetAction_To_api_HTTPGetAction(*in, *out, s); err != nil { - return err - } - } else { - out.HTTPGet = nil - } - if in.TCPSocket != nil { - in, out := &in.TCPSocket, &out.TCPSocket - *out = new(api.TCPSocketAction) - if err := Convert_v1_TCPSocketAction_To_api_TCPSocketAction(*in, *out, s); err != nil { - return err - } - } else { - out.TCPSocket = nil - } + out.Exec = (*api.ExecAction)(unsafe.Pointer(in.Exec)) + out.HTTPGet = (*api.HTTPGetAction)(unsafe.Pointer(in.HTTPGet)) + out.TCPSocket = (*api.TCPSocketAction)(unsafe.Pointer(in.TCPSocket)) return nil } @@ -2277,33 +1554,9 @@ func Convert_v1_Handler_To_api_Handler(in *Handler, out *api.Handler, s conversi } func autoConvert_api_Handler_To_v1_Handler(in *api.Handler, out *Handler, s conversion.Scope) error { - if in.Exec != nil { - in, out := &in.Exec, &out.Exec - *out = new(ExecAction) - if err := Convert_api_ExecAction_To_v1_ExecAction(*in, *out, s); err != nil { - return err - } - } else { - out.Exec = nil - } - if in.HTTPGet != nil { - in, out := &in.HTTPGet, &out.HTTPGet - *out = new(HTTPGetAction) - if err := Convert_api_HTTPGetAction_To_v1_HTTPGetAction(*in, *out, s); err != nil { - return err - } - } else { - out.HTTPGet = nil - } - if in.TCPSocket != nil { - in, out := &in.TCPSocket, &out.TCPSocket - *out = new(TCPSocketAction) - if err := Convert_api_TCPSocketAction_To_v1_TCPSocketAction(*in, *out, s); err != nil { - return err - } - } else { - out.TCPSocket = nil - } + out.Exec = (*ExecAction)(unsafe.Pointer(in.Exec)) + out.HTTPGet = (*HTTPGetAction)(unsafe.Pointer(in.HTTPGet)) + out.TCPSocket = (*TCPSocketAction)(unsafe.Pointer(in.TCPSocket)) return nil } @@ -2360,7 +1613,7 @@ func Convert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(in *api.ISCSIVolumeSo func autoConvert_v1_KeyToPath_To_api_KeyToPath(in *KeyToPath, out *api.KeyToPath, s conversion.Scope) error { out.Key = in.Key out.Path = in.Path - out.Mode = in.Mode + out.Mode = (*int32)(unsafe.Pointer(in.Mode)) return nil } @@ -2371,7 +1624,7 @@ func Convert_v1_KeyToPath_To_api_KeyToPath(in *KeyToPath, out *api.KeyToPath, s func autoConvert_api_KeyToPath_To_v1_KeyToPath(in *api.KeyToPath, out *KeyToPath, s conversion.Scope) error { out.Key = in.Key out.Path = in.Path - out.Mode = in.Mode + out.Mode = (*int32)(unsafe.Pointer(in.Mode)) return nil } @@ -2380,24 +1633,8 @@ func Convert_api_KeyToPath_To_v1_KeyToPath(in *api.KeyToPath, out *KeyToPath, s } func autoConvert_v1_Lifecycle_To_api_Lifecycle(in *Lifecycle, out *api.Lifecycle, s conversion.Scope) error { - if in.PostStart != nil { - in, out := &in.PostStart, &out.PostStart - *out = new(api.Handler) - if err := Convert_v1_Handler_To_api_Handler(*in, *out, s); err != nil { - return err - } - } else { - out.PostStart = nil - } - if in.PreStop != nil { - in, out := &in.PreStop, &out.PreStop - *out = new(api.Handler) - if err := Convert_v1_Handler_To_api_Handler(*in, *out, s); err != nil { - return err - } - } else { - out.PreStop = nil - } + out.PostStart = (*api.Handler)(unsafe.Pointer(in.PostStart)) + out.PreStop = (*api.Handler)(unsafe.Pointer(in.PreStop)) return nil } @@ -2406,24 +1643,8 @@ func Convert_v1_Lifecycle_To_api_Lifecycle(in *Lifecycle, out *api.Lifecycle, s } func autoConvert_api_Lifecycle_To_v1_Lifecycle(in *api.Lifecycle, out *Lifecycle, s conversion.Scope) error { - if in.PostStart != nil { - in, out := &in.PostStart, &out.PostStart - *out = new(Handler) - if err := Convert_api_Handler_To_v1_Handler(*in, *out, s); err != nil { - return err - } - } else { - out.PostStart = nil - } - if in.PreStop != nil { - in, out := &in.PreStop, &out.PreStop - *out = new(Handler) - if err := Convert_api_Handler_To_v1_Handler(*in, *out, s); err != nil { - return err - } - } else { - out.PreStop = nil - } + out.PostStart = (*Handler)(unsafe.Pointer(in.PostStart)) + out.PreStop = (*Handler)(unsafe.Pointer(in.PreStop)) return nil } @@ -2461,21 +1682,11 @@ func Convert_api_LimitRange_To_v1_LimitRange(in *api.LimitRange, out *LimitRange func autoConvert_v1_LimitRangeItem_To_api_LimitRangeItem(in *LimitRangeItem, out *api.LimitRangeItem, s conversion.Scope) error { out.Type = api.LimitType(in.Type) - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Max, &out.Max, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Min, &out.Min, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Default, &out.Default, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.DefaultRequest, &out.DefaultRequest, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.MaxLimitRequestRatio, &out.MaxLimitRequestRatio, s); err != nil { - return err - } + out.Max = *(*api.ResourceList)(unsafe.Pointer(&in.Max)) + out.Min = *(*api.ResourceList)(unsafe.Pointer(&in.Min)) + out.Default = *(*api.ResourceList)(unsafe.Pointer(&in.Default)) + out.DefaultRequest = *(*api.ResourceList)(unsafe.Pointer(&in.DefaultRequest)) + out.MaxLimitRequestRatio = *(*api.ResourceList)(unsafe.Pointer(&in.MaxLimitRequestRatio)) return nil } @@ -2485,71 +1696,11 @@ func Convert_v1_LimitRangeItem_To_api_LimitRangeItem(in *LimitRangeItem, out *ap func autoConvert_api_LimitRangeItem_To_v1_LimitRangeItem(in *api.LimitRangeItem, out *LimitRangeItem, s conversion.Scope) error { out.Type = LimitType(in.Type) - if in.Max != nil { - in, out := &in.Max, &out.Max - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Max = nil - } - if in.Min != nil { - in, out := &in.Min, &out.Min - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Min = nil - } - if in.Default != nil { - in, out := &in.Default, &out.Default - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Default = nil - } - if in.DefaultRequest != nil { - in, out := &in.DefaultRequest, &out.DefaultRequest - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.DefaultRequest = nil - } - if in.MaxLimitRequestRatio != nil { - in, out := &in.MaxLimitRequestRatio, &out.MaxLimitRequestRatio - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.MaxLimitRequestRatio = nil - } + out.Max = *(*ResourceList)(unsafe.Pointer(&in.Max)) + out.Min = *(*ResourceList)(unsafe.Pointer(&in.Min)) + out.Default = *(*ResourceList)(unsafe.Pointer(&in.Default)) + out.DefaultRequest = *(*ResourceList)(unsafe.Pointer(&in.DefaultRequest)) + out.MaxLimitRequestRatio = *(*ResourceList)(unsafe.Pointer(&in.MaxLimitRequestRatio)) return nil } @@ -2559,17 +1710,7 @@ func Convert_api_LimitRangeItem_To_v1_LimitRangeItem(in *api.LimitRangeItem, out func autoConvert_v1_LimitRangeList_To_api_LimitRangeList(in *LimitRangeList, out *api.LimitRangeList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.LimitRange, len(*in)) - for i := range *in { - if err := Convert_v1_LimitRange_To_api_LimitRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]api.LimitRange)(unsafe.Pointer(&in.Items)) return nil } @@ -2579,17 +1720,7 @@ func Convert_v1_LimitRangeList_To_api_LimitRangeList(in *LimitRangeList, out *ap func autoConvert_api_LimitRangeList_To_v1_LimitRangeList(in *api.LimitRangeList, out *LimitRangeList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]LimitRange, len(*in)) - for i := range *in { - if err := Convert_api_LimitRange_To_v1_LimitRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]LimitRange)(unsafe.Pointer(&in.Items)) return nil } @@ -2598,17 +1729,7 @@ func Convert_api_LimitRangeList_To_v1_LimitRangeList(in *api.LimitRangeList, out } func autoConvert_v1_LimitRangeSpec_To_api_LimitRangeSpec(in *LimitRangeSpec, out *api.LimitRangeSpec, s conversion.Scope) error { - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make([]api.LimitRangeItem, len(*in)) - for i := range *in { - if err := Convert_v1_LimitRangeItem_To_api_LimitRangeItem(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Limits = nil - } + out.Limits = *(*[]api.LimitRangeItem)(unsafe.Pointer(&in.Limits)) return nil } @@ -2617,17 +1738,7 @@ func Convert_v1_LimitRangeSpec_To_api_LimitRangeSpec(in *LimitRangeSpec, out *ap } func autoConvert_api_LimitRangeSpec_To_v1_LimitRangeSpec(in *api.LimitRangeSpec, out *LimitRangeSpec, s conversion.Scope) error { - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make([]LimitRangeItem, len(*in)) - for i := range *in { - if err := Convert_api_LimitRangeItem_To_v1_LimitRangeItem(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Limits = nil - } + out.Limits = *(*[]LimitRangeItem)(unsafe.Pointer(&in.Limits)) return nil } @@ -2684,7 +1795,7 @@ func autoConvert_v1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.Lis } out.Watch = in.Watch out.ResourceVersion = in.ResourceVersion - out.TimeoutSeconds = in.TimeoutSeconds + out.TimeoutSeconds = (*int64)(unsafe.Pointer(in.TimeoutSeconds)) return nil } @@ -2701,7 +1812,7 @@ func autoConvert_api_ListOptions_To_v1_ListOptions(in *api.ListOptions, out *Lis } out.Watch = in.Watch out.ResourceVersion = in.ResourceVersion - out.TimeoutSeconds = in.TimeoutSeconds + out.TimeoutSeconds = (*int64)(unsafe.Pointer(in.TimeoutSeconds)) return nil } @@ -2730,17 +1841,7 @@ func Convert_api_LoadBalancerIngress_To_v1_LoadBalancerIngress(in *api.LoadBalan } func autoConvert_v1_LoadBalancerStatus_To_api_LoadBalancerStatus(in *LoadBalancerStatus, out *api.LoadBalancerStatus, s conversion.Scope) error { - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]api.LoadBalancerIngress, len(*in)) - for i := range *in { - if err := Convert_v1_LoadBalancerIngress_To_api_LoadBalancerIngress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ingress = nil - } + out.Ingress = *(*[]api.LoadBalancerIngress)(unsafe.Pointer(&in.Ingress)) return nil } @@ -2749,17 +1850,7 @@ func Convert_v1_LoadBalancerStatus_To_api_LoadBalancerStatus(in *LoadBalancerSta } func autoConvert_api_LoadBalancerStatus_To_v1_LoadBalancerStatus(in *api.LoadBalancerStatus, out *LoadBalancerStatus, s conversion.Scope) error { - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]LoadBalancerIngress, len(*in)) - for i := range *in { - if err := Convert_api_LoadBalancerIngress_To_v1_LoadBalancerIngress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ingress = nil - } + out.Ingress = *(*[]LoadBalancerIngress)(unsafe.Pointer(&in.Ingress)) return nil } @@ -2843,17 +1934,7 @@ func Convert_api_Namespace_To_v1_Namespace(in *api.Namespace, out *Namespace, s func autoConvert_v1_NamespaceList_To_api_NamespaceList(in *NamespaceList, out *api.NamespaceList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.Namespace, len(*in)) - for i := range *in { - if err := Convert_v1_Namespace_To_api_Namespace(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]api.Namespace)(unsafe.Pointer(&in.Items)) return nil } @@ -2863,17 +1944,7 @@ func Convert_v1_NamespaceList_To_api_NamespaceList(in *NamespaceList, out *api.N func autoConvert_api_NamespaceList_To_v1_NamespaceList(in *api.NamespaceList, out *NamespaceList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Namespace, len(*in)) - for i := range *in { - if err := Convert_api_Namespace_To_v1_Namespace(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]Namespace)(unsafe.Pointer(&in.Items)) return nil } @@ -2882,15 +1953,7 @@ func Convert_api_NamespaceList_To_v1_NamespaceList(in *api.NamespaceList, out *N } func autoConvert_v1_NamespaceSpec_To_api_NamespaceSpec(in *NamespaceSpec, out *api.NamespaceSpec, s conversion.Scope) error { - if in.Finalizers != nil { - in, out := &in.Finalizers, &out.Finalizers - *out = make([]api.FinalizerName, len(*in)) - for i := range *in { - (*out)[i] = api.FinalizerName((*in)[i]) - } - } else { - out.Finalizers = nil - } + out.Finalizers = *(*[]api.FinalizerName)(unsafe.Pointer(&in.Finalizers)) return nil } @@ -2899,15 +1962,7 @@ func Convert_v1_NamespaceSpec_To_api_NamespaceSpec(in *NamespaceSpec, out *api.N } func autoConvert_api_NamespaceSpec_To_v1_NamespaceSpec(in *api.NamespaceSpec, out *NamespaceSpec, s conversion.Scope) error { - if in.Finalizers != nil { - in, out := &in.Finalizers, &out.Finalizers - *out = make([]FinalizerName, len(*in)) - for i := range *in { - (*out)[i] = FinalizerName((*in)[i]) - } - } else { - out.Finalizers = nil - } + out.Finalizers = *(*[]FinalizerName)(unsafe.Pointer(&in.Finalizers)) return nil } @@ -2988,26 +2043,8 @@ func Convert_api_NodeAddress_To_v1_NodeAddress(in *api.NodeAddress, out *NodeAdd } func autoConvert_v1_NodeAffinity_To_api_NodeAffinity(in *NodeAffinity, out *api.NodeAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = new(api.NodeSelector) - if err := Convert_v1_NodeSelector_To_api_NodeSelector(*in, *out, s); err != nil { - return err - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]api.PreferredSchedulingTerm, len(*in)) - for i := range *in { - if err := Convert_v1_PreferredSchedulingTerm_To_api_PreferredSchedulingTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } + out.RequiredDuringSchedulingIgnoredDuringExecution = (*api.NodeSelector)(unsafe.Pointer(in.RequiredDuringSchedulingIgnoredDuringExecution)) + out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]api.PreferredSchedulingTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) return nil } @@ -3016,26 +2053,8 @@ func Convert_v1_NodeAffinity_To_api_NodeAffinity(in *NodeAffinity, out *api.Node } func autoConvert_api_NodeAffinity_To_v1_NodeAffinity(in *api.NodeAffinity, out *NodeAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = new(NodeSelector) - if err := Convert_api_NodeSelector_To_v1_NodeSelector(*in, *out, s); err != nil { - return err - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]PreferredSchedulingTerm, len(*in)) - for i := range *in { - if err := Convert_api_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } + out.RequiredDuringSchedulingIgnoredDuringExecution = (*NodeSelector)(unsafe.Pointer(in.RequiredDuringSchedulingIgnoredDuringExecution)) + out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]PreferredSchedulingTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) return nil } @@ -3095,17 +2114,7 @@ func Convert_api_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(in *api.NodeDaemo func autoConvert_v1_NodeList_To_api_NodeList(in *NodeList, out *api.NodeList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.Node, len(*in)) - for i := range *in { - if err := Convert_v1_Node_To_api_Node(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]api.Node)(unsafe.Pointer(&in.Items)) return nil } @@ -3115,17 +2124,7 @@ func Convert_v1_NodeList_To_api_NodeList(in *NodeList, out *api.NodeList, s conv func autoConvert_api_NodeList_To_v1_NodeList(in *api.NodeList, out *NodeList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Node, len(*in)) - for i := range *in { - if err := Convert_api_Node_To_v1_Node(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]Node)(unsafe.Pointer(&in.Items)) return nil } @@ -3152,17 +2151,7 @@ func Convert_api_NodeProxyOptions_To_v1_NodeProxyOptions(in *api.NodeProxyOption } func autoConvert_v1_NodeSelector_To_api_NodeSelector(in *NodeSelector, out *api.NodeSelector, s conversion.Scope) error { - if in.NodeSelectorTerms != nil { - in, out := &in.NodeSelectorTerms, &out.NodeSelectorTerms - *out = make([]api.NodeSelectorTerm, len(*in)) - for i := range *in { - if err := Convert_v1_NodeSelectorTerm_To_api_NodeSelectorTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.NodeSelectorTerms = nil - } + out.NodeSelectorTerms = *(*[]api.NodeSelectorTerm)(unsafe.Pointer(&in.NodeSelectorTerms)) return nil } @@ -3171,17 +2160,7 @@ func Convert_v1_NodeSelector_To_api_NodeSelector(in *NodeSelector, out *api.Node } func autoConvert_api_NodeSelector_To_v1_NodeSelector(in *api.NodeSelector, out *NodeSelector, s conversion.Scope) error { - if in.NodeSelectorTerms != nil { - in, out := &in.NodeSelectorTerms, &out.NodeSelectorTerms - *out = make([]NodeSelectorTerm, len(*in)) - for i := range *in { - if err := Convert_api_NodeSelectorTerm_To_v1_NodeSelectorTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.NodeSelectorTerms = nil - } + out.NodeSelectorTerms = *(*[]NodeSelectorTerm)(unsafe.Pointer(&in.NodeSelectorTerms)) return nil } @@ -3192,7 +2171,7 @@ func Convert_api_NodeSelector_To_v1_NodeSelector(in *api.NodeSelector, out *Node func autoConvert_v1_NodeSelectorRequirement_To_api_NodeSelectorRequirement(in *NodeSelectorRequirement, out *api.NodeSelectorRequirement, s conversion.Scope) error { out.Key = in.Key out.Operator = api.NodeSelectorOperator(in.Operator) - out.Values = in.Values + out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) return nil } @@ -3203,7 +2182,7 @@ func Convert_v1_NodeSelectorRequirement_To_api_NodeSelectorRequirement(in *NodeS func autoConvert_api_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(in *api.NodeSelectorRequirement, out *NodeSelectorRequirement, s conversion.Scope) error { out.Key = in.Key out.Operator = NodeSelectorOperator(in.Operator) - out.Values = in.Values + out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) return nil } @@ -3212,17 +2191,7 @@ func Convert_api_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(in *api.N } func autoConvert_v1_NodeSelectorTerm_To_api_NodeSelectorTerm(in *NodeSelectorTerm, out *api.NodeSelectorTerm, s conversion.Scope) error { - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]api.NodeSelectorRequirement, len(*in)) - for i := range *in { - if err := Convert_v1_NodeSelectorRequirement_To_api_NodeSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } + out.MatchExpressions = *(*[]api.NodeSelectorRequirement)(unsafe.Pointer(&in.MatchExpressions)) return nil } @@ -3231,17 +2200,7 @@ func Convert_v1_NodeSelectorTerm_To_api_NodeSelectorTerm(in *NodeSelectorTerm, o } func autoConvert_api_NodeSelectorTerm_To_v1_NodeSelectorTerm(in *api.NodeSelectorTerm, out *NodeSelectorTerm, s conversion.Scope) error { - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]NodeSelectorRequirement, len(*in)) - for i := range *in { - if err := Convert_api_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } + out.MatchExpressions = *(*[]NodeSelectorRequirement)(unsafe.Pointer(&in.MatchExpressions)) return nil } @@ -3274,72 +2233,20 @@ func Convert_api_NodeSpec_To_v1_NodeSpec(in *api.NodeSpec, out *NodeSpec, s conv } func autoConvert_v1_NodeStatus_To_api_NodeStatus(in *NodeStatus, out *api.NodeStatus, s conversion.Scope) error { - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Capacity, &out.Capacity, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Allocatable, &out.Allocatable, s); err != nil { - return err - } + out.Capacity = *(*api.ResourceList)(unsafe.Pointer(&in.Capacity)) + out.Allocatable = *(*api.ResourceList)(unsafe.Pointer(&in.Allocatable)) out.Phase = api.NodePhase(in.Phase) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]api.NodeCondition, len(*in)) - for i := range *in { - if err := Convert_v1_NodeCondition_To_api_NodeCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]api.NodeAddress, len(*in)) - for i := range *in { - if err := Convert_v1_NodeAddress_To_api_NodeAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } + out.Conditions = *(*[]api.NodeCondition)(unsafe.Pointer(&in.Conditions)) + out.Addresses = *(*[]api.NodeAddress)(unsafe.Pointer(&in.Addresses)) if err := Convert_v1_NodeDaemonEndpoints_To_api_NodeDaemonEndpoints(&in.DaemonEndpoints, &out.DaemonEndpoints, s); err != nil { return err } if err := Convert_v1_NodeSystemInfo_To_api_NodeSystemInfo(&in.NodeInfo, &out.NodeInfo, s); err != nil { return err } - if in.Images != nil { - in, out := &in.Images, &out.Images - *out = make([]api.ContainerImage, len(*in)) - for i := range *in { - if err := Convert_v1_ContainerImage_To_api_ContainerImage(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Images = nil - } - if in.VolumesInUse != nil { - in, out := &in.VolumesInUse, &out.VolumesInUse - *out = make([]api.UniqueVolumeName, len(*in)) - for i := range *in { - (*out)[i] = api.UniqueVolumeName((*in)[i]) - } - } else { - out.VolumesInUse = nil - } - if in.VolumesAttached != nil { - in, out := &in.VolumesAttached, &out.VolumesAttached - *out = make([]api.AttachedVolume, len(*in)) - for i := range *in { - if err := Convert_v1_AttachedVolume_To_api_AttachedVolume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.VolumesAttached = nil - } + out.Images = *(*[]api.ContainerImage)(unsafe.Pointer(&in.Images)) + out.VolumesInUse = *(*[]api.UniqueVolumeName)(unsafe.Pointer(&in.VolumesInUse)) + out.VolumesAttached = *(*[]api.AttachedVolume)(unsafe.Pointer(&in.VolumesAttached)) return nil } @@ -3348,92 +2255,20 @@ func Convert_v1_NodeStatus_To_api_NodeStatus(in *NodeStatus, out *api.NodeStatus } func autoConvert_api_NodeStatus_To_v1_NodeStatus(in *api.NodeStatus, out *NodeStatus, s conversion.Scope) error { - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Capacity = nil - } - if in.Allocatable != nil { - in, out := &in.Allocatable, &out.Allocatable - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Allocatable = nil - } + out.Capacity = *(*ResourceList)(unsafe.Pointer(&in.Capacity)) + out.Allocatable = *(*ResourceList)(unsafe.Pointer(&in.Allocatable)) out.Phase = NodePhase(in.Phase) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]NodeCondition, len(*in)) - for i := range *in { - if err := Convert_api_NodeCondition_To_v1_NodeCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]NodeAddress, len(*in)) - for i := range *in { - if err := Convert_api_NodeAddress_To_v1_NodeAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } + out.Conditions = *(*[]NodeCondition)(unsafe.Pointer(&in.Conditions)) + out.Addresses = *(*[]NodeAddress)(unsafe.Pointer(&in.Addresses)) if err := Convert_api_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(&in.DaemonEndpoints, &out.DaemonEndpoints, s); err != nil { return err } if err := Convert_api_NodeSystemInfo_To_v1_NodeSystemInfo(&in.NodeInfo, &out.NodeInfo, s); err != nil { return err } - if in.Images != nil { - in, out := &in.Images, &out.Images - *out = make([]ContainerImage, len(*in)) - for i := range *in { - if err := Convert_api_ContainerImage_To_v1_ContainerImage(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Images = nil - } - if in.VolumesInUse != nil { - in, out := &in.VolumesInUse, &out.VolumesInUse - *out = make([]UniqueVolumeName, len(*in)) - for i := range *in { - (*out)[i] = UniqueVolumeName((*in)[i]) - } - } else { - out.VolumesInUse = nil - } - if in.VolumesAttached != nil { - in, out := &in.VolumesAttached, &out.VolumesAttached - *out = make([]AttachedVolume, len(*in)) - for i := range *in { - if err := Convert_api_AttachedVolume_To_v1_AttachedVolume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.VolumesAttached = nil - } + out.Images = *(*[]ContainerImage)(unsafe.Pointer(&in.Images)) + out.VolumesInUse = *(*[]UniqueVolumeName)(unsafe.Pointer(&in.VolumesInUse)) + out.VolumesAttached = *(*[]AttachedVolume)(unsafe.Pointer(&in.VolumesAttached)) return nil } @@ -3506,22 +2341,12 @@ func autoConvert_v1_ObjectMeta_To_api_ObjectMeta(in *ObjectMeta, out *api.Object out.ResourceVersion = in.ResourceVersion out.Generation = in.Generation out.CreationTimestamp = in.CreationTimestamp - out.DeletionTimestamp = in.DeletionTimestamp - out.DeletionGracePeriodSeconds = in.DeletionGracePeriodSeconds - out.Labels = in.Labels - out.Annotations = in.Annotations - if in.OwnerReferences != nil { - in, out := &in.OwnerReferences, &out.OwnerReferences - *out = make([]api.OwnerReference, len(*in)) - for i := range *in { - if err := Convert_v1_OwnerReference_To_api_OwnerReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.OwnerReferences = nil - } - out.Finalizers = in.Finalizers + out.DeletionTimestamp = (*unversioned.Time)(unsafe.Pointer(in.DeletionTimestamp)) + out.DeletionGracePeriodSeconds = (*int64)(unsafe.Pointer(in.DeletionGracePeriodSeconds)) + out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) + out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) + out.OwnerReferences = *(*[]api.OwnerReference)(unsafe.Pointer(&in.OwnerReferences)) + out.Finalizers = *(*[]string)(unsafe.Pointer(&in.Finalizers)) out.ClusterName = in.ClusterName return nil } @@ -3539,22 +2364,12 @@ func autoConvert_api_ObjectMeta_To_v1_ObjectMeta(in *api.ObjectMeta, out *Object out.ResourceVersion = in.ResourceVersion out.Generation = in.Generation out.CreationTimestamp = in.CreationTimestamp - out.DeletionTimestamp = in.DeletionTimestamp - out.DeletionGracePeriodSeconds = in.DeletionGracePeriodSeconds - out.Labels = in.Labels - out.Annotations = in.Annotations - if in.OwnerReferences != nil { - in, out := &in.OwnerReferences, &out.OwnerReferences - *out = make([]OwnerReference, len(*in)) - for i := range *in { - if err := Convert_api_OwnerReference_To_v1_OwnerReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.OwnerReferences = nil - } - out.Finalizers = in.Finalizers + out.DeletionTimestamp = (*unversioned.Time)(unsafe.Pointer(in.DeletionTimestamp)) + out.DeletionGracePeriodSeconds = (*int64)(unsafe.Pointer(in.DeletionGracePeriodSeconds)) + out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) + out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) + out.OwnerReferences = *(*[]OwnerReference)(unsafe.Pointer(&in.OwnerReferences)) + out.Finalizers = *(*[]string)(unsafe.Pointer(&in.Finalizers)) out.ClusterName = in.ClusterName return nil } @@ -3598,7 +2413,7 @@ func autoConvert_v1_OwnerReference_To_api_OwnerReference(in *OwnerReference, out out.Kind = in.Kind out.Name = in.Name out.UID = types.UID(in.UID) - out.Controller = in.Controller + out.Controller = (*bool)(unsafe.Pointer(in.Controller)) return nil } @@ -3611,7 +2426,7 @@ func autoConvert_api_OwnerReference_To_v1_OwnerReference(in *api.OwnerReference, out.Kind = in.Kind out.Name = in.Name out.UID = types.UID(in.UID) - out.Controller = in.Controller + out.Controller = (*bool)(unsafe.Pointer(in.Controller)) return nil } @@ -3689,17 +2504,7 @@ func Convert_api_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(in *api.Persi func autoConvert_v1_PersistentVolumeClaimList_To_api_PersistentVolumeClaimList(in *PersistentVolumeClaimList, out *api.PersistentVolumeClaimList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.PersistentVolumeClaim, len(*in)) - for i := range *in { - if err := Convert_v1_PersistentVolumeClaim_To_api_PersistentVolumeClaim(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]api.PersistentVolumeClaim)(unsafe.Pointer(&in.Items)) return nil } @@ -3709,17 +2514,7 @@ func Convert_v1_PersistentVolumeClaimList_To_api_PersistentVolumeClaimList(in *P func autoConvert_api_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList(in *api.PersistentVolumeClaimList, out *PersistentVolumeClaimList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PersistentVolumeClaim, len(*in)) - for i := range *in { - if err := Convert_api_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]PersistentVolumeClaim)(unsafe.Pointer(&in.Items)) return nil } @@ -3728,16 +2523,8 @@ func Convert_api_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList(in *a } func autoConvert_v1_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec(in *PersistentVolumeClaimSpec, out *api.PersistentVolumeClaimSpec, s conversion.Scope) error { - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]api.PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = api.PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - out.Selector = in.Selector + out.AccessModes = *(*[]api.PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) if err := Convert_v1_ResourceRequirements_To_api_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { return err } @@ -3750,16 +2537,8 @@ func Convert_v1_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec(in *P } func autoConvert_api_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(in *api.PersistentVolumeClaimSpec, out *PersistentVolumeClaimSpec, s conversion.Scope) error { - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - out.Selector = in.Selector + out.AccessModes = *(*[]PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) if err := Convert_api_ResourceRequirements_To_v1_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { return err } @@ -3773,18 +2552,8 @@ func Convert_api_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(in *a func autoConvert_v1_PersistentVolumeClaimStatus_To_api_PersistentVolumeClaimStatus(in *PersistentVolumeClaimStatus, out *api.PersistentVolumeClaimStatus, s conversion.Scope) error { out.Phase = api.PersistentVolumeClaimPhase(in.Phase) - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]api.PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = api.PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Capacity, &out.Capacity, s); err != nil { - return err - } + out.AccessModes = *(*[]api.PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) + out.Capacity = *(*api.ResourceList)(unsafe.Pointer(&in.Capacity)) return nil } @@ -3794,28 +2563,8 @@ func Convert_v1_PersistentVolumeClaimStatus_To_api_PersistentVolumeClaimStatus(i func autoConvert_api_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus(in *api.PersistentVolumeClaimStatus, out *PersistentVolumeClaimStatus, s conversion.Scope) error { out.Phase = PersistentVolumeClaimPhase(in.Phase) - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Capacity = nil - } + out.AccessModes = *(*[]PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) + out.Capacity = *(*ResourceList)(unsafe.Pointer(&in.Capacity)) return nil } @@ -3884,150 +2633,22 @@ func Convert_api_PersistentVolumeList_To_v1_PersistentVolumeList(in *api.Persist } func autoConvert_v1_PersistentVolumeSource_To_api_PersistentVolumeSource(in *PersistentVolumeSource, out *api.PersistentVolumeSource, s conversion.Scope) error { - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(api.GCEPersistentDiskVolumeSource) - if err := Convert_v1_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(api.AWSElasticBlockStoreVolumeSource) - if err := Convert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AWSElasticBlockStore = nil - } - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(api.HostPathVolumeSource) - if err := Convert_v1_HostPathVolumeSource_To_api_HostPathVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.HostPath = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(api.GlusterfsVolumeSource) - if err := Convert_v1_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Glusterfs = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(api.NFSVolumeSource) - if err := Convert_v1_NFSVolumeSource_To_api_NFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.NFS = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(api.RBDVolumeSource) - if err := Convert_v1_RBDVolumeSource_To_api_RBDVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(api.ISCSIVolumeSource) - if err := Convert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ISCSI = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(api.CinderVolumeSource) - if err := Convert_v1_CinderVolumeSource_To_api_CinderVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(api.CephFSVolumeSource) - if err := Convert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(api.FCVolumeSource) - if err := Convert_v1_FCVolumeSource_To_api_FCVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FC = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(api.FlockerVolumeSource) - if err := Convert_v1_FlockerVolumeSource_To_api_FlockerVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Flocker = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(api.FlexVolumeSource) - if err := Convert_v1_FlexVolumeSource_To_api_FlexVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(api.AzureFileVolumeSource) - if err := Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureFile = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(api.VsphereVirtualDiskVolumeSource) - if err := Convert_v1_VsphereVirtualDiskVolumeSource_To_api_VsphereVirtualDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.VsphereVolume = nil - } - if in.Quobyte != nil { - in, out := &in.Quobyte, &out.Quobyte - *out = new(api.QuobyteVolumeSource) - if err := Convert_v1_QuobyteVolumeSource_To_api_QuobyteVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Quobyte = nil - } - if in.AzureDisk != nil { - in, out := &in.AzureDisk, &out.AzureDisk - *out = new(api.AzureDiskVolumeSource) - if err := Convert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureDisk = nil - } + out.GCEPersistentDisk = (*api.GCEPersistentDiskVolumeSource)(unsafe.Pointer(in.GCEPersistentDisk)) + out.AWSElasticBlockStore = (*api.AWSElasticBlockStoreVolumeSource)(unsafe.Pointer(in.AWSElasticBlockStore)) + out.HostPath = (*api.HostPathVolumeSource)(unsafe.Pointer(in.HostPath)) + out.Glusterfs = (*api.GlusterfsVolumeSource)(unsafe.Pointer(in.Glusterfs)) + out.NFS = (*api.NFSVolumeSource)(unsafe.Pointer(in.NFS)) + out.RBD = (*api.RBDVolumeSource)(unsafe.Pointer(in.RBD)) + out.ISCSI = (*api.ISCSIVolumeSource)(unsafe.Pointer(in.ISCSI)) + out.Cinder = (*api.CinderVolumeSource)(unsafe.Pointer(in.Cinder)) + out.CephFS = (*api.CephFSVolumeSource)(unsafe.Pointer(in.CephFS)) + out.FC = (*api.FCVolumeSource)(unsafe.Pointer(in.FC)) + out.Flocker = (*api.FlockerVolumeSource)(unsafe.Pointer(in.Flocker)) + out.FlexVolume = (*api.FlexVolumeSource)(unsafe.Pointer(in.FlexVolume)) + out.AzureFile = (*api.AzureFileVolumeSource)(unsafe.Pointer(in.AzureFile)) + out.VsphereVolume = (*api.VsphereVirtualDiskVolumeSource)(unsafe.Pointer(in.VsphereVolume)) + out.Quobyte = (*api.QuobyteVolumeSource)(unsafe.Pointer(in.Quobyte)) + out.AzureDisk = (*api.AzureDiskVolumeSource)(unsafe.Pointer(in.AzureDisk)) return nil } @@ -4036,150 +2657,22 @@ func Convert_v1_PersistentVolumeSource_To_api_PersistentVolumeSource(in *Persist } func autoConvert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource(in *api.PersistentVolumeSource, out *PersistentVolumeSource, s conversion.Scope) error { - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(GCEPersistentDiskVolumeSource) - if err := Convert_api_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(AWSElasticBlockStoreVolumeSource) - if err := Convert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AWSElasticBlockStore = nil - } - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(HostPathVolumeSource) - if err := Convert_api_HostPathVolumeSource_To_v1_HostPathVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.HostPath = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(GlusterfsVolumeSource) - if err := Convert_api_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Glusterfs = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(NFSVolumeSource) - if err := Convert_api_NFSVolumeSource_To_v1_NFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.NFS = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(RBDVolumeSource) - if err := Convert_api_RBDVolumeSource_To_v1_RBDVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.Quobyte != nil { - in, out := &in.Quobyte, &out.Quobyte - *out = new(QuobyteVolumeSource) - if err := Convert_api_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Quobyte = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(ISCSIVolumeSource) - if err := Convert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ISCSI = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(FlexVolumeSource) - if err := Convert_api_FlexVolumeSource_To_v1_FlexVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(CinderVolumeSource) - if err := Convert_api_CinderVolumeSource_To_v1_CinderVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(CephFSVolumeSource) - if err := Convert_api_CephFSVolumeSource_To_v1_CephFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(FCVolumeSource) - if err := Convert_api_FCVolumeSource_To_v1_FCVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FC = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(FlockerVolumeSource) - if err := Convert_api_FlockerVolumeSource_To_v1_FlockerVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Flocker = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(AzureFileVolumeSource) - if err := Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureFile = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(VsphereVirtualDiskVolumeSource) - if err := Convert_api_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.VsphereVolume = nil - } - if in.AzureDisk != nil { - in, out := &in.AzureDisk, &out.AzureDisk - *out = new(AzureDiskVolumeSource) - if err := Convert_api_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureDisk = nil - } + out.GCEPersistentDisk = (*GCEPersistentDiskVolumeSource)(unsafe.Pointer(in.GCEPersistentDisk)) + out.AWSElasticBlockStore = (*AWSElasticBlockStoreVolumeSource)(unsafe.Pointer(in.AWSElasticBlockStore)) + out.HostPath = (*HostPathVolumeSource)(unsafe.Pointer(in.HostPath)) + out.Glusterfs = (*GlusterfsVolumeSource)(unsafe.Pointer(in.Glusterfs)) + out.NFS = (*NFSVolumeSource)(unsafe.Pointer(in.NFS)) + out.RBD = (*RBDVolumeSource)(unsafe.Pointer(in.RBD)) + out.Quobyte = (*QuobyteVolumeSource)(unsafe.Pointer(in.Quobyte)) + out.ISCSI = (*ISCSIVolumeSource)(unsafe.Pointer(in.ISCSI)) + out.FlexVolume = (*FlexVolumeSource)(unsafe.Pointer(in.FlexVolume)) + out.Cinder = (*CinderVolumeSource)(unsafe.Pointer(in.Cinder)) + out.CephFS = (*CephFSVolumeSource)(unsafe.Pointer(in.CephFS)) + out.FC = (*FCVolumeSource)(unsafe.Pointer(in.FC)) + out.Flocker = (*FlockerVolumeSource)(unsafe.Pointer(in.Flocker)) + out.AzureFile = (*AzureFileVolumeSource)(unsafe.Pointer(in.AzureFile)) + out.VsphereVolume = (*VsphereVirtualDiskVolumeSource)(unsafe.Pointer(in.VsphereVolume)) + out.AzureDisk = (*AzureDiskVolumeSource)(unsafe.Pointer(in.AzureDisk)) return nil } @@ -4188,30 +2681,12 @@ func Convert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource(in *api.Per } func autoConvert_v1_PersistentVolumeSpec_To_api_PersistentVolumeSpec(in *PersistentVolumeSpec, out *api.PersistentVolumeSpec, s conversion.Scope) error { - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Capacity, &out.Capacity, s); err != nil { - return err - } + out.Capacity = *(*api.ResourceList)(unsafe.Pointer(&in.Capacity)) if err := Convert_v1_PersistentVolumeSource_To_api_PersistentVolumeSource(&in.PersistentVolumeSource, &out.PersistentVolumeSource, s); err != nil { return err } - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]api.PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = api.PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - if in.ClaimRef != nil { - in, out := &in.ClaimRef, &out.ClaimRef - *out = new(api.ObjectReference) - if err := Convert_v1_ObjectReference_To_api_ObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.ClaimRef = nil - } + out.AccessModes = *(*[]api.PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) + out.ClaimRef = (*api.ObjectReference)(unsafe.Pointer(in.ClaimRef)) out.PersistentVolumeReclaimPolicy = api.PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy) return nil } @@ -4221,40 +2696,12 @@ func Convert_v1_PersistentVolumeSpec_To_api_PersistentVolumeSpec(in *PersistentV } func autoConvert_api_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(in *api.PersistentVolumeSpec, out *PersistentVolumeSpec, s conversion.Scope) error { - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Capacity = nil - } + out.Capacity = *(*ResourceList)(unsafe.Pointer(&in.Capacity)) if err := Convert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource(&in.PersistentVolumeSource, &out.PersistentVolumeSource, s); err != nil { return err } - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - if in.ClaimRef != nil { - in, out := &in.ClaimRef, &out.ClaimRef - *out = new(ObjectReference) - if err := Convert_api_ObjectReference_To_v1_ObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.ClaimRef = nil - } + out.AccessModes = *(*[]PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) + out.ClaimRef = (*ObjectReference)(unsafe.Pointer(in.ClaimRef)) out.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy) return nil } @@ -4312,28 +2759,8 @@ func autoConvert_api_Pod_To_v1_Pod(in *api.Pod, out *Pod, s conversion.Scope) er } func autoConvert_v1_PodAffinity_To_api_PodAffinity(in *PodAffinity, out *api.PodAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]api.PodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_v1_PodAffinityTerm_To_api_PodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]api.WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_v1_WeightedPodAffinityTerm_To_api_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } + out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]api.PodAffinityTerm)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution)) + out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]api.WeightedPodAffinityTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) return nil } @@ -4342,28 +2769,8 @@ func Convert_v1_PodAffinity_To_api_PodAffinity(in *PodAffinity, out *api.PodAffi } func autoConvert_api_PodAffinity_To_v1_PodAffinity(in *api.PodAffinity, out *PodAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]PodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_api_PodAffinityTerm_To_v1_PodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_api_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } + out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]PodAffinityTerm)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution)) + out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]WeightedPodAffinityTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) return nil } @@ -4372,8 +2779,8 @@ func Convert_api_PodAffinity_To_v1_PodAffinity(in *api.PodAffinity, out *PodAffi } func autoConvert_v1_PodAffinityTerm_To_api_PodAffinityTerm(in *PodAffinityTerm, out *api.PodAffinityTerm, s conversion.Scope) error { - out.LabelSelector = in.LabelSelector - out.Namespaces = in.Namespaces + out.LabelSelector = (*unversioned.LabelSelector)(unsafe.Pointer(in.LabelSelector)) + out.Namespaces = *(*[]string)(unsafe.Pointer(&in.Namespaces)) out.TopologyKey = in.TopologyKey return nil } @@ -4383,8 +2790,8 @@ func Convert_v1_PodAffinityTerm_To_api_PodAffinityTerm(in *PodAffinityTerm, out } func autoConvert_api_PodAffinityTerm_To_v1_PodAffinityTerm(in *api.PodAffinityTerm, out *PodAffinityTerm, s conversion.Scope) error { - out.LabelSelector = in.LabelSelector - out.Namespaces = in.Namespaces + out.LabelSelector = (*unversioned.LabelSelector)(unsafe.Pointer(in.LabelSelector)) + out.Namespaces = *(*[]string)(unsafe.Pointer(&in.Namespaces)) out.TopologyKey = in.TopologyKey return nil } @@ -4394,28 +2801,8 @@ func Convert_api_PodAffinityTerm_To_v1_PodAffinityTerm(in *api.PodAffinityTerm, } func autoConvert_v1_PodAntiAffinity_To_api_PodAntiAffinity(in *PodAntiAffinity, out *api.PodAntiAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]api.PodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_v1_PodAffinityTerm_To_api_PodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]api.WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_v1_WeightedPodAffinityTerm_To_api_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } + out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]api.PodAffinityTerm)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution)) + out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]api.WeightedPodAffinityTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) return nil } @@ -4424,28 +2811,8 @@ func Convert_v1_PodAntiAffinity_To_api_PodAntiAffinity(in *PodAntiAffinity, out } func autoConvert_api_PodAntiAffinity_To_v1_PodAntiAffinity(in *api.PodAntiAffinity, out *PodAntiAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]PodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_api_PodAffinityTerm_To_v1_PodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_api_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } + out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]PodAffinityTerm)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution)) + out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]WeightedPodAffinityTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) return nil } @@ -4513,7 +2880,7 @@ func autoConvert_v1_PodExecOptions_To_api_PodExecOptions(in *PodExecOptions, out out.Stderr = in.Stderr out.TTY = in.TTY out.Container = in.Container - out.Command = in.Command + out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) return nil } @@ -4527,7 +2894,7 @@ func autoConvert_api_PodExecOptions_To_v1_PodExecOptions(in *api.PodExecOptions, out.Stderr = in.Stderr out.TTY = in.TTY out.Container = in.Container - out.Command = in.Command + out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) return nil } @@ -4579,11 +2946,11 @@ func autoConvert_v1_PodLogOptions_To_api_PodLogOptions(in *PodLogOptions, out *a out.Container = in.Container out.Follow = in.Follow out.Previous = in.Previous - out.SinceSeconds = in.SinceSeconds - out.SinceTime = in.SinceTime + out.SinceSeconds = (*int64)(unsafe.Pointer(in.SinceSeconds)) + out.SinceTime = (*unversioned.Time)(unsafe.Pointer(in.SinceTime)) out.Timestamps = in.Timestamps - out.TailLines = in.TailLines - out.LimitBytes = in.LimitBytes + out.TailLines = (*int64)(unsafe.Pointer(in.TailLines)) + out.LimitBytes = (*int64)(unsafe.Pointer(in.LimitBytes)) return nil } @@ -4595,11 +2962,11 @@ func autoConvert_api_PodLogOptions_To_v1_PodLogOptions(in *api.PodLogOptions, ou out.Container = in.Container out.Follow = in.Follow out.Previous = in.Previous - out.SinceSeconds = in.SinceSeconds - out.SinceTime = in.SinceTime + out.SinceSeconds = (*int64)(unsafe.Pointer(in.SinceSeconds)) + out.SinceTime = (*unversioned.Time)(unsafe.Pointer(in.SinceTime)) out.Timestamps = in.Timestamps - out.TailLines = in.TailLines - out.LimitBytes = in.LimitBytes + out.TailLines = (*int64)(unsafe.Pointer(in.TailLines)) + out.LimitBytes = (*int64)(unsafe.Pointer(in.LimitBytes)) return nil } @@ -4626,19 +2993,11 @@ func Convert_api_PodProxyOptions_To_v1_PodProxyOptions(in *api.PodProxyOptions, } func autoConvert_v1_PodSecurityContext_To_api_PodSecurityContext(in *PodSecurityContext, out *api.PodSecurityContext, s conversion.Scope) error { - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(api.SELinuxOptions) - if err := Convert_v1_SELinuxOptions_To_api_SELinuxOptions(*in, *out, s); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - out.RunAsUser = in.RunAsUser - out.RunAsNonRoot = in.RunAsNonRoot - out.SupplementalGroups = in.SupplementalGroups - out.FSGroup = in.FSGroup + out.SELinuxOptions = (*api.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions)) + out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser)) + out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot)) + out.SupplementalGroups = *(*[]int64)(unsafe.Pointer(&in.SupplementalGroups)) + out.FSGroup = (*int64)(unsafe.Pointer(in.FSGroup)) return nil } @@ -4646,32 +3005,16 @@ func autoConvert_api_PodSecurityContext_To_v1_PodSecurityContext(in *api.PodSecu // INFO: in.HostNetwork opted out of conversion generation // INFO: in.HostPID opted out of conversion generation // INFO: in.HostIPC opted out of conversion generation - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(SELinuxOptions) - if err := Convert_api_SELinuxOptions_To_v1_SELinuxOptions(*in, *out, s); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - out.RunAsUser = in.RunAsUser - out.RunAsNonRoot = in.RunAsNonRoot - out.SupplementalGroups = in.SupplementalGroups - out.FSGroup = in.FSGroup + out.SELinuxOptions = (*SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions)) + out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser)) + out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot)) + out.SupplementalGroups = *(*[]int64)(unsafe.Pointer(&in.SupplementalGroups)) + out.FSGroup = (*int64)(unsafe.Pointer(in.FSGroup)) return nil } func autoConvert_v1_PodSignature_To_api_PodSignature(in *PodSignature, out *api.PodSignature, s conversion.Scope) error { - if in.PodController != nil { - in, out := &in.PodController, &out.PodController - *out = new(api.OwnerReference) - if err := Convert_v1_OwnerReference_To_api_OwnerReference(*in, *out, s); err != nil { - return err - } - } else { - out.PodController = nil - } + out.PodController = (*api.OwnerReference)(unsafe.Pointer(in.PodController)) return nil } @@ -4680,15 +3023,7 @@ func Convert_v1_PodSignature_To_api_PodSignature(in *PodSignature, out *api.PodS } func autoConvert_api_PodSignature_To_v1_PodSignature(in *api.PodSignature, out *PodSignature, s conversion.Scope) error { - if in.PodController != nil { - in, out := &in.PodController, &out.PodController - *out = new(OwnerReference) - if err := Convert_api_OwnerReference_To_v1_OwnerReference(*in, *out, s); err != nil { - return err - } - } else { - out.PodController = nil - } + out.PodController = (*OwnerReference)(unsafe.Pointer(in.PodController)) return nil } @@ -4708,33 +3043,13 @@ func autoConvert_v1_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conv } else { out.Volumes = nil } - if in.InitContainers != nil { - in, out := &in.InitContainers, &out.InitContainers - *out = make([]api.Container, len(*in)) - for i := range *in { - if err := Convert_v1_Container_To_api_Container(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.InitContainers = nil - } - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]api.Container, len(*in)) - for i := range *in { - if err := Convert_v1_Container_To_api_Container(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Containers = nil - } + out.InitContainers = *(*[]api.Container)(unsafe.Pointer(&in.InitContainers)) + out.Containers = *(*[]api.Container)(unsafe.Pointer(&in.Containers)) out.RestartPolicy = api.RestartPolicy(in.RestartPolicy) - out.TerminationGracePeriodSeconds = in.TerminationGracePeriodSeconds - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds + out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds)) + out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) out.DNSPolicy = api.DNSPolicy(in.DNSPolicy) - out.NodeSelector = in.NodeSelector + out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) out.ServiceAccountName = in.ServiceAccountName // INFO: in.DeprecatedServiceAccount opted out of conversion generation out.NodeName = in.NodeName @@ -4750,17 +3065,7 @@ func autoConvert_v1_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conv } else { out.SecurityContext = nil } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]api.LocalObjectReference, len(*in)) - for i := range *in { - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ImagePullSecrets = nil - } + out.ImagePullSecrets = *(*[]api.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets)) out.Hostname = in.Hostname out.Subdomain = in.Subdomain return nil @@ -4778,33 +3083,13 @@ func autoConvert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *PodSpec, s conv } else { out.Volumes = nil } - if in.InitContainers != nil { - in, out := &in.InitContainers, &out.InitContainers - *out = make([]Container, len(*in)) - for i := range *in { - if err := Convert_api_Container_To_v1_Container(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.InitContainers = nil - } - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]Container, len(*in)) - for i := range *in { - if err := Convert_api_Container_To_v1_Container(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Containers = nil - } + out.InitContainers = *(*[]Container)(unsafe.Pointer(&in.InitContainers)) + out.Containers = *(*[]Container)(unsafe.Pointer(&in.Containers)) out.RestartPolicy = RestartPolicy(in.RestartPolicy) - out.TerminationGracePeriodSeconds = in.TerminationGracePeriodSeconds - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds + out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds)) + out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) out.DNSPolicy = DNSPolicy(in.DNSPolicy) - out.NodeSelector = in.NodeSelector + out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) out.ServiceAccountName = in.ServiceAccountName out.NodeName = in.NodeName if in.SecurityContext != nil { @@ -4816,17 +3101,7 @@ func autoConvert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *PodSpec, s conv } else { out.SecurityContext = nil } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]LocalObjectReference, len(*in)) - for i := range *in { - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ImagePullSecrets = nil - } + out.ImagePullSecrets = *(*[]LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets)) out.Hostname = in.Hostname out.Subdomain = in.Subdomain return nil @@ -4834,44 +3109,14 @@ func autoConvert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *PodSpec, s conv func autoConvert_v1_PodStatus_To_api_PodStatus(in *PodStatus, out *api.PodStatus, s conversion.Scope) error { out.Phase = api.PodPhase(in.Phase) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]api.PodCondition, len(*in)) - for i := range *in { - if err := Convert_v1_PodCondition_To_api_PodCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } + out.Conditions = *(*[]api.PodCondition)(unsafe.Pointer(&in.Conditions)) out.Message = in.Message out.Reason = in.Reason out.HostIP = in.HostIP out.PodIP = in.PodIP - out.StartTime = in.StartTime - if in.InitContainerStatuses != nil { - in, out := &in.InitContainerStatuses, &out.InitContainerStatuses - *out = make([]api.ContainerStatus, len(*in)) - for i := range *in { - if err := Convert_v1_ContainerStatus_To_api_ContainerStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.InitContainerStatuses = nil - } - if in.ContainerStatuses != nil { - in, out := &in.ContainerStatuses, &out.ContainerStatuses - *out = make([]api.ContainerStatus, len(*in)) - for i := range *in { - if err := Convert_v1_ContainerStatus_To_api_ContainerStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ContainerStatuses = nil - } + out.StartTime = (*unversioned.Time)(unsafe.Pointer(in.StartTime)) + out.InitContainerStatuses = *(*[]api.ContainerStatus)(unsafe.Pointer(&in.InitContainerStatuses)) + out.ContainerStatuses = *(*[]api.ContainerStatus)(unsafe.Pointer(&in.ContainerStatuses)) return nil } @@ -4881,44 +3126,14 @@ func Convert_v1_PodStatus_To_api_PodStatus(in *PodStatus, out *api.PodStatus, s func autoConvert_api_PodStatus_To_v1_PodStatus(in *api.PodStatus, out *PodStatus, s conversion.Scope) error { out.Phase = PodPhase(in.Phase) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]PodCondition, len(*in)) - for i := range *in { - if err := Convert_api_PodCondition_To_v1_PodCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } + out.Conditions = *(*[]PodCondition)(unsafe.Pointer(&in.Conditions)) out.Message = in.Message out.Reason = in.Reason out.HostIP = in.HostIP out.PodIP = in.PodIP - out.StartTime = in.StartTime - if in.InitContainerStatuses != nil { - in, out := &in.InitContainerStatuses, &out.InitContainerStatuses - *out = make([]ContainerStatus, len(*in)) - for i := range *in { - if err := Convert_api_ContainerStatus_To_v1_ContainerStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.InitContainerStatuses = nil - } - if in.ContainerStatuses != nil { - in, out := &in.ContainerStatuses, &out.ContainerStatuses - *out = make([]ContainerStatus, len(*in)) - for i := range *in { - if err := Convert_api_ContainerStatus_To_v1_ContainerStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ContainerStatuses = nil - } + out.StartTime = (*unversioned.Time)(unsafe.Pointer(in.StartTime)) + out.InitContainerStatuses = *(*[]ContainerStatus)(unsafe.Pointer(&in.InitContainerStatuses)) + out.ContainerStatuses = *(*[]ContainerStatus)(unsafe.Pointer(&in.ContainerStatuses)) return nil } @@ -5035,7 +3250,7 @@ func autoConvert_api_PodTemplateSpec_To_v1_PodTemplateSpec(in *api.PodTemplateSp } func autoConvert_v1_Preconditions_To_api_Preconditions(in *Preconditions, out *api.Preconditions, s conversion.Scope) error { - out.UID = in.UID + out.UID = (*types.UID)(unsafe.Pointer(in.UID)) return nil } @@ -5044,7 +3259,7 @@ func Convert_v1_Preconditions_To_api_Preconditions(in *Preconditions, out *api.P } func autoConvert_api_Preconditions_To_v1_Preconditions(in *api.Preconditions, out *Preconditions, s conversion.Scope) error { - out.UID = in.UID + out.UID = (*types.UID)(unsafe.Pointer(in.UID)) return nil } @@ -5163,21 +3378,13 @@ func Convert_api_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(in *api.QuobyteVo } func autoConvert_v1_RBDVolumeSource_To_api_RBDVolumeSource(in *RBDVolumeSource, out *api.RBDVolumeSource, s conversion.Scope) error { - out.CephMonitors = in.CephMonitors + out.CephMonitors = *(*[]string)(unsafe.Pointer(&in.CephMonitors)) out.RBDImage = in.RBDImage out.FSType = in.FSType out.RBDPool = in.RBDPool out.RadosUser = in.RadosUser out.Keyring = in.Keyring - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(api.LocalObjectReference) - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } + out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) out.ReadOnly = in.ReadOnly return nil } @@ -5187,21 +3394,13 @@ func Convert_v1_RBDVolumeSource_To_api_RBDVolumeSource(in *RBDVolumeSource, out } func autoConvert_api_RBDVolumeSource_To_v1_RBDVolumeSource(in *api.RBDVolumeSource, out *RBDVolumeSource, s conversion.Scope) error { - out.CephMonitors = in.CephMonitors + out.CephMonitors = *(*[]string)(unsafe.Pointer(&in.CephMonitors)) out.RBDImage = in.RBDImage out.FSType = in.FSType out.RBDPool = in.RBDPool out.RadosUser = in.RadosUser out.Keyring = in.Keyring - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } + out.SecretRef = (*LocalObjectReference)(unsafe.Pointer(in.SecretRef)) out.ReadOnly = in.ReadOnly return nil } @@ -5215,9 +3414,7 @@ func autoConvert_v1_RangeAllocation_To_api_RangeAllocation(in *RangeAllocation, return err } out.Range = in.Range - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Data, &out.Data, s); err != nil { - return err - } + out.Data = *(*[]byte)(unsafe.Pointer(&in.Data)) return nil } @@ -5230,9 +3427,7 @@ func autoConvert_api_RangeAllocation_To_v1_RangeAllocation(in *api.RangeAllocati return err } out.Range = in.Range - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Data, &out.Data, s); err != nil { - return err - } + out.Data = *(*[]byte)(unsafe.Pointer(&in.Data)) return nil } @@ -5345,7 +3540,7 @@ func autoConvert_v1_ReplicationControllerSpec_To_api_ReplicationControllerSpec(i return err } out.MinReadySeconds = in.MinReadySeconds - out.Selector = in.Selector + out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) if in.Template != nil { in, out := &in.Template, &out.Template *out = new(api.PodTemplateSpec) @@ -5363,7 +3558,7 @@ func autoConvert_api_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(i return err } out.MinReadySeconds = in.MinReadySeconds - out.Selector = in.Selector + out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) if in.Template != nil { in, out := &in.Template, &out.Template *out = new(PodTemplateSpec) @@ -5382,17 +3577,7 @@ func autoConvert_v1_ReplicationControllerStatus_To_api_ReplicationControllerStat out.ReadyReplicas = in.ReadyReplicas out.AvailableReplicas = in.AvailableReplicas out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]api.ReplicationControllerCondition, len(*in)) - for i := range *in { - if err := Convert_v1_ReplicationControllerCondition_To_api_ReplicationControllerCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } + out.Conditions = *(*[]api.ReplicationControllerCondition)(unsafe.Pointer(&in.Conditions)) return nil } @@ -5406,17 +3591,7 @@ func autoConvert_api_ReplicationControllerStatus_To_v1_ReplicationControllerStat out.ReadyReplicas = in.ReadyReplicas out.AvailableReplicas = in.AvailableReplicas out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ReplicationControllerCondition, len(*in)) - for i := range *in { - if err := Convert_api_ReplicationControllerCondition_To_v1_ReplicationControllerCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } + out.Conditions = *(*[]ReplicationControllerCondition)(unsafe.Pointer(&in.Conditions)) return nil } @@ -5482,17 +3657,7 @@ func Convert_api_ResourceQuota_To_v1_ResourceQuota(in *api.ResourceQuota, out *R func autoConvert_v1_ResourceQuotaList_To_api_ResourceQuotaList(in *ResourceQuotaList, out *api.ResourceQuotaList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.ResourceQuota, len(*in)) - for i := range *in { - if err := Convert_v1_ResourceQuota_To_api_ResourceQuota(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]api.ResourceQuota)(unsafe.Pointer(&in.Items)) return nil } @@ -5502,17 +3667,7 @@ func Convert_v1_ResourceQuotaList_To_api_ResourceQuotaList(in *ResourceQuotaList func autoConvert_api_ResourceQuotaList_To_v1_ResourceQuotaList(in *api.ResourceQuotaList, out *ResourceQuotaList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ResourceQuota, len(*in)) - for i := range *in { - if err := Convert_api_ResourceQuota_To_v1_ResourceQuota(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]ResourceQuota)(unsafe.Pointer(&in.Items)) return nil } @@ -5521,18 +3676,8 @@ func Convert_api_ResourceQuotaList_To_v1_ResourceQuotaList(in *api.ResourceQuota } func autoConvert_v1_ResourceQuotaSpec_To_api_ResourceQuotaSpec(in *ResourceQuotaSpec, out *api.ResourceQuotaSpec, s conversion.Scope) error { - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Hard, &out.Hard, s); err != nil { - return err - } - if in.Scopes != nil { - in, out := &in.Scopes, &out.Scopes - *out = make([]api.ResourceQuotaScope, len(*in)) - for i := range *in { - (*out)[i] = api.ResourceQuotaScope((*in)[i]) - } - } else { - out.Scopes = nil - } + out.Hard = *(*api.ResourceList)(unsafe.Pointer(&in.Hard)) + out.Scopes = *(*[]api.ResourceQuotaScope)(unsafe.Pointer(&in.Scopes)) return nil } @@ -5541,28 +3686,8 @@ func Convert_v1_ResourceQuotaSpec_To_api_ResourceQuotaSpec(in *ResourceQuotaSpec } func autoConvert_api_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(in *api.ResourceQuotaSpec, out *ResourceQuotaSpec, s conversion.Scope) error { - if in.Hard != nil { - in, out := &in.Hard, &out.Hard - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Hard = nil - } - if in.Scopes != nil { - in, out := &in.Scopes, &out.Scopes - *out = make([]ResourceQuotaScope, len(*in)) - for i := range *in { - (*out)[i] = ResourceQuotaScope((*in)[i]) - } - } else { - out.Scopes = nil - } + out.Hard = *(*ResourceList)(unsafe.Pointer(&in.Hard)) + out.Scopes = *(*[]ResourceQuotaScope)(unsafe.Pointer(&in.Scopes)) return nil } @@ -5571,12 +3696,8 @@ func Convert_api_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(in *api.ResourceQuota } func autoConvert_v1_ResourceQuotaStatus_To_api_ResourceQuotaStatus(in *ResourceQuotaStatus, out *api.ResourceQuotaStatus, s conversion.Scope) error { - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Hard, &out.Hard, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Used, &out.Used, s); err != nil { - return err - } + out.Hard = *(*api.ResourceList)(unsafe.Pointer(&in.Hard)) + out.Used = *(*api.ResourceList)(unsafe.Pointer(&in.Used)) return nil } @@ -5585,32 +3706,8 @@ func Convert_v1_ResourceQuotaStatus_To_api_ResourceQuotaStatus(in *ResourceQuota } func autoConvert_api_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(in *api.ResourceQuotaStatus, out *ResourceQuotaStatus, s conversion.Scope) error { - if in.Hard != nil { - in, out := &in.Hard, &out.Hard - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Hard = nil - } - if in.Used != nil { - in, out := &in.Used, &out.Used - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Used = nil - } + out.Hard = *(*ResourceList)(unsafe.Pointer(&in.Hard)) + out.Used = *(*ResourceList)(unsafe.Pointer(&in.Used)) return nil } @@ -5619,12 +3716,8 @@ func Convert_api_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(in *api.ResourceQ } func autoConvert_v1_ResourceRequirements_To_api_ResourceRequirements(in *ResourceRequirements, out *api.ResourceRequirements, s conversion.Scope) error { - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Limits, &out.Limits, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Requests, &out.Requests, s); err != nil { - return err - } + out.Limits = *(*api.ResourceList)(unsafe.Pointer(&in.Limits)) + out.Requests = *(*api.ResourceList)(unsafe.Pointer(&in.Requests)) return nil } @@ -5633,32 +3726,8 @@ func Convert_v1_ResourceRequirements_To_api_ResourceRequirements(in *ResourceReq } func autoConvert_api_ResourceRequirements_To_v1_ResourceRequirements(in *api.ResourceRequirements, out *ResourceRequirements, s conversion.Scope) error { - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Limits = nil - } - if in.Requests != nil { - in, out := &in.Requests, &out.Requests - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Requests = nil - } + out.Limits = *(*ResourceList)(unsafe.Pointer(&in.Limits)) + out.Requests = *(*ResourceList)(unsafe.Pointer(&in.Requests)) return nil } @@ -5694,7 +3763,7 @@ func autoConvert_v1_Secret_To_api_Secret(in *Secret, out *api.Secret, s conversi if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - out.Data = in.Data + out.Data = *(*map[string][]byte)(unsafe.Pointer(&in.Data)) // INFO: in.StringData opted out of conversion generation out.Type = api.SecretType(in.Type) return nil @@ -5704,7 +3773,7 @@ func autoConvert_api_Secret_To_v1_Secret(in *api.Secret, out *Secret, s conversi if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - out.Data = in.Data + out.Data = *(*map[string][]byte)(unsafe.Pointer(&in.Data)) out.Type = SecretType(in.Type) return nil } @@ -5779,18 +3848,8 @@ func Convert_api_SecretList_To_v1_SecretList(in *api.SecretList, out *SecretList func autoConvert_v1_SecretVolumeSource_To_api_SecretVolumeSource(in *SecretVolumeSource, out *api.SecretVolumeSource, s conversion.Scope) error { out.SecretName = in.SecretName - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.KeyToPath, len(*in)) - for i := range *in { - if err := Convert_v1_KeyToPath_To_api_KeyToPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - out.DefaultMode = in.DefaultMode + out.Items = *(*[]api.KeyToPath)(unsafe.Pointer(&in.Items)) + out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) return nil } @@ -5800,18 +3859,8 @@ func Convert_v1_SecretVolumeSource_To_api_SecretVolumeSource(in *SecretVolumeSou func autoConvert_api_SecretVolumeSource_To_v1_SecretVolumeSource(in *api.SecretVolumeSource, out *SecretVolumeSource, s conversion.Scope) error { out.SecretName = in.SecretName - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KeyToPath, len(*in)) - for i := range *in { - if err := Convert_api_KeyToPath_To_v1_KeyToPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - out.DefaultMode = in.DefaultMode + out.Items = *(*[]KeyToPath)(unsafe.Pointer(&in.Items)) + out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) return nil } @@ -5820,28 +3869,12 @@ func Convert_api_SecretVolumeSource_To_v1_SecretVolumeSource(in *api.SecretVolum } func autoConvert_v1_SecurityContext_To_api_SecurityContext(in *SecurityContext, out *api.SecurityContext, s conversion.Scope) error { - if in.Capabilities != nil { - in, out := &in.Capabilities, &out.Capabilities - *out = new(api.Capabilities) - if err := Convert_v1_Capabilities_To_api_Capabilities(*in, *out, s); err != nil { - return err - } - } else { - out.Capabilities = nil - } - out.Privileged = in.Privileged - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(api.SELinuxOptions) - if err := Convert_v1_SELinuxOptions_To_api_SELinuxOptions(*in, *out, s); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - out.RunAsUser = in.RunAsUser - out.RunAsNonRoot = in.RunAsNonRoot - out.ReadOnlyRootFilesystem = in.ReadOnlyRootFilesystem + out.Capabilities = (*api.Capabilities)(unsafe.Pointer(in.Capabilities)) + out.Privileged = (*bool)(unsafe.Pointer(in.Privileged)) + out.SELinuxOptions = (*api.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions)) + out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser)) + out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot)) + out.ReadOnlyRootFilesystem = (*bool)(unsafe.Pointer(in.ReadOnlyRootFilesystem)) return nil } @@ -5850,28 +3883,12 @@ func Convert_v1_SecurityContext_To_api_SecurityContext(in *SecurityContext, out } func autoConvert_api_SecurityContext_To_v1_SecurityContext(in *api.SecurityContext, out *SecurityContext, s conversion.Scope) error { - if in.Capabilities != nil { - in, out := &in.Capabilities, &out.Capabilities - *out = new(Capabilities) - if err := Convert_api_Capabilities_To_v1_Capabilities(*in, *out, s); err != nil { - return err - } - } else { - out.Capabilities = nil - } - out.Privileged = in.Privileged - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(SELinuxOptions) - if err := Convert_api_SELinuxOptions_To_v1_SELinuxOptions(*in, *out, s); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - out.RunAsUser = in.RunAsUser - out.RunAsNonRoot = in.RunAsNonRoot - out.ReadOnlyRootFilesystem = in.ReadOnlyRootFilesystem + out.Capabilities = (*Capabilities)(unsafe.Pointer(in.Capabilities)) + out.Privileged = (*bool)(unsafe.Pointer(in.Privileged)) + out.SELinuxOptions = (*SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions)) + out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser)) + out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot)) + out.ReadOnlyRootFilesystem = (*bool)(unsafe.Pointer(in.ReadOnlyRootFilesystem)) return nil } @@ -5939,28 +3956,8 @@ func autoConvert_v1_ServiceAccount_To_api_ServiceAccount(in *ServiceAccount, out if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = make([]api.ObjectReference, len(*in)) - for i := range *in { - if err := Convert_v1_ObjectReference_To_api_ObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Secrets = nil - } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]api.LocalObjectReference, len(*in)) - for i := range *in { - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ImagePullSecrets = nil - } + out.Secrets = *(*[]api.ObjectReference)(unsafe.Pointer(&in.Secrets)) + out.ImagePullSecrets = *(*[]api.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets)) return nil } @@ -5972,28 +3969,8 @@ func autoConvert_api_ServiceAccount_To_v1_ServiceAccount(in *api.ServiceAccount, if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = make([]ObjectReference, len(*in)) - for i := range *in { - if err := Convert_api_ObjectReference_To_v1_ObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Secrets = nil - } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]LocalObjectReference, len(*in)) - for i := range *in { - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ImagePullSecrets = nil - } + out.Secrets = *(*[]ObjectReference)(unsafe.Pointer(&in.Secrets)) + out.ImagePullSecrets = *(*[]LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets)) return nil } @@ -6003,17 +3980,7 @@ func Convert_api_ServiceAccount_To_v1_ServiceAccount(in *api.ServiceAccount, out func autoConvert_v1_ServiceAccountList_To_api_ServiceAccountList(in *ServiceAccountList, out *api.ServiceAccountList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.ServiceAccount, len(*in)) - for i := range *in { - if err := Convert_v1_ServiceAccount_To_api_ServiceAccount(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]api.ServiceAccount)(unsafe.Pointer(&in.Items)) return nil } @@ -6023,17 +3990,7 @@ func Convert_v1_ServiceAccountList_To_api_ServiceAccountList(in *ServiceAccountL func autoConvert_api_ServiceAccountList_To_v1_ServiceAccountList(in *api.ServiceAccountList, out *ServiceAccountList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ServiceAccount, len(*in)) - for i := range *in { - if err := Convert_api_ServiceAccount_To_v1_ServiceAccount(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]ServiceAccount)(unsafe.Pointer(&in.Items)) return nil } @@ -6126,49 +4083,29 @@ func Convert_api_ServiceProxyOptions_To_v1_ServiceProxyOptions(in *api.ServicePr } func autoConvert_v1_ServiceSpec_To_api_ServiceSpec(in *ServiceSpec, out *api.ServiceSpec, s conversion.Scope) error { - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]api.ServicePort, len(*in)) - for i := range *in { - if err := Convert_v1_ServicePort_To_api_ServicePort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - out.Selector = in.Selector + out.Ports = *(*[]api.ServicePort)(unsafe.Pointer(&in.Ports)) + out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) out.ClusterIP = in.ClusterIP out.Type = api.ServiceType(in.Type) - out.ExternalIPs = in.ExternalIPs + out.ExternalIPs = *(*[]string)(unsafe.Pointer(&in.ExternalIPs)) // INFO: in.DeprecatedPublicIPs opted out of conversion generation out.SessionAffinity = api.ServiceAffinity(in.SessionAffinity) out.LoadBalancerIP = in.LoadBalancerIP - out.LoadBalancerSourceRanges = in.LoadBalancerSourceRanges + out.LoadBalancerSourceRanges = *(*[]string)(unsafe.Pointer(&in.LoadBalancerSourceRanges)) out.ExternalName = in.ExternalName return nil } func autoConvert_api_ServiceSpec_To_v1_ServiceSpec(in *api.ServiceSpec, out *ServiceSpec, s conversion.Scope) error { out.Type = ServiceType(in.Type) - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]ServicePort, len(*in)) - for i := range *in { - if err := Convert_api_ServicePort_To_v1_ServicePort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - out.Selector = in.Selector + out.Ports = *(*[]ServicePort)(unsafe.Pointer(&in.Ports)) + out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) out.ClusterIP = in.ClusterIP out.ExternalName = in.ExternalName - out.ExternalIPs = in.ExternalIPs + out.ExternalIPs = *(*[]string)(unsafe.Pointer(&in.ExternalIPs)) out.LoadBalancerIP = in.LoadBalancerIP out.SessionAffinity = ServiceAffinity(in.SessionAffinity) - out.LoadBalancerSourceRanges = in.LoadBalancerSourceRanges + out.LoadBalancerSourceRanges = *(*[]string)(unsafe.Pointer(&in.LoadBalancerSourceRanges)) return nil } @@ -6307,204 +4244,28 @@ func Convert_api_VolumeMount_To_v1_VolumeMount(in *api.VolumeMount, out *VolumeM } func autoConvert_v1_VolumeSource_To_api_VolumeSource(in *VolumeSource, out *api.VolumeSource, s conversion.Scope) error { - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(api.HostPathVolumeSource) - if err := Convert_v1_HostPathVolumeSource_To_api_HostPathVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.HostPath = nil - } - if in.EmptyDir != nil { - in, out := &in.EmptyDir, &out.EmptyDir - *out = new(api.EmptyDirVolumeSource) - if err := Convert_v1_EmptyDirVolumeSource_To_api_EmptyDirVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.EmptyDir = nil - } - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(api.GCEPersistentDiskVolumeSource) - if err := Convert_v1_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(api.AWSElasticBlockStoreVolumeSource) - if err := Convert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AWSElasticBlockStore = nil - } - if in.GitRepo != nil { - in, out := &in.GitRepo, &out.GitRepo - *out = new(api.GitRepoVolumeSource) - if err := Convert_v1_GitRepoVolumeSource_To_api_GitRepoVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GitRepo = nil - } - if in.Secret != nil { - in, out := &in.Secret, &out.Secret - *out = new(api.SecretVolumeSource) - if err := Convert_v1_SecretVolumeSource_To_api_SecretVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Secret = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(api.NFSVolumeSource) - if err := Convert_v1_NFSVolumeSource_To_api_NFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.NFS = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(api.ISCSIVolumeSource) - if err := Convert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ISCSI = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(api.GlusterfsVolumeSource) - if err := Convert_v1_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Glusterfs = nil - } - if in.PersistentVolumeClaim != nil { - in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim - *out = new(api.PersistentVolumeClaimVolumeSource) - if err := Convert_v1_PersistentVolumeClaimVolumeSource_To_api_PersistentVolumeClaimVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.PersistentVolumeClaim = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(api.RBDVolumeSource) - if err := Convert_v1_RBDVolumeSource_To_api_RBDVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(api.FlexVolumeSource) - if err := Convert_v1_FlexVolumeSource_To_api_FlexVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(api.CinderVolumeSource) - if err := Convert_v1_CinderVolumeSource_To_api_CinderVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(api.CephFSVolumeSource) - if err := Convert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(api.FlockerVolumeSource) - if err := Convert_v1_FlockerVolumeSource_To_api_FlockerVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Flocker = nil - } - if in.DownwardAPI != nil { - in, out := &in.DownwardAPI, &out.DownwardAPI - *out = new(api.DownwardAPIVolumeSource) - if err := Convert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.DownwardAPI = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(api.FCVolumeSource) - if err := Convert_v1_FCVolumeSource_To_api_FCVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FC = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(api.AzureFileVolumeSource) - if err := Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureFile = nil - } - if in.ConfigMap != nil { - in, out := &in.ConfigMap, &out.ConfigMap - *out = new(api.ConfigMapVolumeSource) - if err := Convert_v1_ConfigMapVolumeSource_To_api_ConfigMapVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ConfigMap = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(api.VsphereVirtualDiskVolumeSource) - if err := Convert_v1_VsphereVirtualDiskVolumeSource_To_api_VsphereVirtualDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.VsphereVolume = nil - } - if in.Quobyte != nil { - in, out := &in.Quobyte, &out.Quobyte - *out = new(api.QuobyteVolumeSource) - if err := Convert_v1_QuobyteVolumeSource_To_api_QuobyteVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Quobyte = nil - } - if in.AzureDisk != nil { - in, out := &in.AzureDisk, &out.AzureDisk - *out = new(api.AzureDiskVolumeSource) - if err := Convert_v1_AzureDiskVolumeSource_To_api_AzureDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureDisk = nil - } + out.HostPath = (*api.HostPathVolumeSource)(unsafe.Pointer(in.HostPath)) + out.EmptyDir = (*api.EmptyDirVolumeSource)(unsafe.Pointer(in.EmptyDir)) + out.GCEPersistentDisk = (*api.GCEPersistentDiskVolumeSource)(unsafe.Pointer(in.GCEPersistentDisk)) + out.AWSElasticBlockStore = (*api.AWSElasticBlockStoreVolumeSource)(unsafe.Pointer(in.AWSElasticBlockStore)) + out.GitRepo = (*api.GitRepoVolumeSource)(unsafe.Pointer(in.GitRepo)) + out.Secret = (*api.SecretVolumeSource)(unsafe.Pointer(in.Secret)) + out.NFS = (*api.NFSVolumeSource)(unsafe.Pointer(in.NFS)) + out.ISCSI = (*api.ISCSIVolumeSource)(unsafe.Pointer(in.ISCSI)) + out.Glusterfs = (*api.GlusterfsVolumeSource)(unsafe.Pointer(in.Glusterfs)) + out.PersistentVolumeClaim = (*api.PersistentVolumeClaimVolumeSource)(unsafe.Pointer(in.PersistentVolumeClaim)) + out.RBD = (*api.RBDVolumeSource)(unsafe.Pointer(in.RBD)) + out.FlexVolume = (*api.FlexVolumeSource)(unsafe.Pointer(in.FlexVolume)) + out.Cinder = (*api.CinderVolumeSource)(unsafe.Pointer(in.Cinder)) + out.CephFS = (*api.CephFSVolumeSource)(unsafe.Pointer(in.CephFS)) + out.Flocker = (*api.FlockerVolumeSource)(unsafe.Pointer(in.Flocker)) + out.DownwardAPI = (*api.DownwardAPIVolumeSource)(unsafe.Pointer(in.DownwardAPI)) + out.FC = (*api.FCVolumeSource)(unsafe.Pointer(in.FC)) + out.AzureFile = (*api.AzureFileVolumeSource)(unsafe.Pointer(in.AzureFile)) + out.ConfigMap = (*api.ConfigMapVolumeSource)(unsafe.Pointer(in.ConfigMap)) + out.VsphereVolume = (*api.VsphereVirtualDiskVolumeSource)(unsafe.Pointer(in.VsphereVolume)) + out.Quobyte = (*api.QuobyteVolumeSource)(unsafe.Pointer(in.Quobyte)) + out.AzureDisk = (*api.AzureDiskVolumeSource)(unsafe.Pointer(in.AzureDisk)) return nil } @@ -6513,204 +4274,28 @@ func Convert_v1_VolumeSource_To_api_VolumeSource(in *VolumeSource, out *api.Volu } func autoConvert_api_VolumeSource_To_v1_VolumeSource(in *api.VolumeSource, out *VolumeSource, s conversion.Scope) error { - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(HostPathVolumeSource) - if err := Convert_api_HostPathVolumeSource_To_v1_HostPathVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.HostPath = nil - } - if in.EmptyDir != nil { - in, out := &in.EmptyDir, &out.EmptyDir - *out = new(EmptyDirVolumeSource) - if err := Convert_api_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.EmptyDir = nil - } - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(GCEPersistentDiskVolumeSource) - if err := Convert_api_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(AWSElasticBlockStoreVolumeSource) - if err := Convert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AWSElasticBlockStore = nil - } - if in.GitRepo != nil { - in, out := &in.GitRepo, &out.GitRepo - *out = new(GitRepoVolumeSource) - if err := Convert_api_GitRepoVolumeSource_To_v1_GitRepoVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GitRepo = nil - } - if in.Secret != nil { - in, out := &in.Secret, &out.Secret - *out = new(SecretVolumeSource) - if err := Convert_api_SecretVolumeSource_To_v1_SecretVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Secret = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(NFSVolumeSource) - if err := Convert_api_NFSVolumeSource_To_v1_NFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.NFS = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(ISCSIVolumeSource) - if err := Convert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ISCSI = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(GlusterfsVolumeSource) - if err := Convert_api_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Glusterfs = nil - } - if in.PersistentVolumeClaim != nil { - in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim - *out = new(PersistentVolumeClaimVolumeSource) - if err := Convert_api_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.PersistentVolumeClaim = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(RBDVolumeSource) - if err := Convert_api_RBDVolumeSource_To_v1_RBDVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.Quobyte != nil { - in, out := &in.Quobyte, &out.Quobyte - *out = new(QuobyteVolumeSource) - if err := Convert_api_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Quobyte = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(FlexVolumeSource) - if err := Convert_api_FlexVolumeSource_To_v1_FlexVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(CinderVolumeSource) - if err := Convert_api_CinderVolumeSource_To_v1_CinderVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(CephFSVolumeSource) - if err := Convert_api_CephFSVolumeSource_To_v1_CephFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(FlockerVolumeSource) - if err := Convert_api_FlockerVolumeSource_To_v1_FlockerVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Flocker = nil - } - if in.DownwardAPI != nil { - in, out := &in.DownwardAPI, &out.DownwardAPI - *out = new(DownwardAPIVolumeSource) - if err := Convert_api_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.DownwardAPI = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(FCVolumeSource) - if err := Convert_api_FCVolumeSource_To_v1_FCVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FC = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(AzureFileVolumeSource) - if err := Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureFile = nil - } - if in.ConfigMap != nil { - in, out := &in.ConfigMap, &out.ConfigMap - *out = new(ConfigMapVolumeSource) - if err := Convert_api_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ConfigMap = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(VsphereVirtualDiskVolumeSource) - if err := Convert_api_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.VsphereVolume = nil - } - if in.AzureDisk != nil { - in, out := &in.AzureDisk, &out.AzureDisk - *out = new(AzureDiskVolumeSource) - if err := Convert_api_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureDisk = nil - } + out.HostPath = (*HostPathVolumeSource)(unsafe.Pointer(in.HostPath)) + out.EmptyDir = (*EmptyDirVolumeSource)(unsafe.Pointer(in.EmptyDir)) + out.GCEPersistentDisk = (*GCEPersistentDiskVolumeSource)(unsafe.Pointer(in.GCEPersistentDisk)) + out.AWSElasticBlockStore = (*AWSElasticBlockStoreVolumeSource)(unsafe.Pointer(in.AWSElasticBlockStore)) + out.GitRepo = (*GitRepoVolumeSource)(unsafe.Pointer(in.GitRepo)) + out.Secret = (*SecretVolumeSource)(unsafe.Pointer(in.Secret)) + out.NFS = (*NFSVolumeSource)(unsafe.Pointer(in.NFS)) + out.ISCSI = (*ISCSIVolumeSource)(unsafe.Pointer(in.ISCSI)) + out.Glusterfs = (*GlusterfsVolumeSource)(unsafe.Pointer(in.Glusterfs)) + out.PersistentVolumeClaim = (*PersistentVolumeClaimVolumeSource)(unsafe.Pointer(in.PersistentVolumeClaim)) + out.RBD = (*RBDVolumeSource)(unsafe.Pointer(in.RBD)) + out.Quobyte = (*QuobyteVolumeSource)(unsafe.Pointer(in.Quobyte)) + out.FlexVolume = (*FlexVolumeSource)(unsafe.Pointer(in.FlexVolume)) + out.Cinder = (*CinderVolumeSource)(unsafe.Pointer(in.Cinder)) + out.CephFS = (*CephFSVolumeSource)(unsafe.Pointer(in.CephFS)) + out.Flocker = (*FlockerVolumeSource)(unsafe.Pointer(in.Flocker)) + out.DownwardAPI = (*DownwardAPIVolumeSource)(unsafe.Pointer(in.DownwardAPI)) + out.FC = (*FCVolumeSource)(unsafe.Pointer(in.FC)) + out.AzureFile = (*AzureFileVolumeSource)(unsafe.Pointer(in.AzureFile)) + out.ConfigMap = (*ConfigMapVolumeSource)(unsafe.Pointer(in.ConfigMap)) + out.VsphereVolume = (*VsphereVirtualDiskVolumeSource)(unsafe.Pointer(in.VsphereVolume)) + out.AzureDisk = (*AzureDiskVolumeSource)(unsafe.Pointer(in.AzureDisk)) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/doc.go b/staging/src/k8s.io/client-go/pkg/apis/apps/doc.go index 23aa5a09b29..2f123702e3d 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/doc.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/doc.go @@ -16,5 +16,6 @@ limitations under the License. // +k8s:deepcopy-gen=package,register // +k8s:openapi-gen=true +// +groupName=apps.k8s.io package apps diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/install/install.go b/staging/src/k8s.io/client-go/pkg/apis/apps/install/install.go index 8e9c1db6813..3a9263d607a 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/install/install.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/install/install.go @@ -21,19 +21,19 @@ package install import ( "k8s.io/client-go/pkg/apimachinery/announced" "k8s.io/client-go/pkg/apis/apps" - "k8s.io/client-go/pkg/apis/apps/v1alpha1" + "k8s.io/client-go/pkg/apis/apps/v1beta1" ) func init() { if err := announced.NewGroupMetaFactory( &announced.GroupMetaFactoryArgs{ GroupName: apps.GroupName, - VersionPreferenceOrder: []string{v1alpha1.SchemeGroupVersion.Version}, + VersionPreferenceOrder: []string{v1beta1.SchemeGroupVersion.Version}, ImportPrefix: "k8s.io/client-go/pkg/apis/apps", AddInternalObjectsToScheme: apps.AddToScheme, }, announced.VersionToSchemeFunc{ - v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme, + v1beta1.SchemeGroupVersion.Version: v1beta1.AddToScheme, }, ).Announce().RegisterAndEnable(); err != nil { panic(err) diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/types.go b/staging/src/k8s.io/client-go/pkg/apis/apps/types.go index 8e3736b9055..14b129fe4f1 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/types.go @@ -28,8 +28,7 @@ import ( // - Network: A single stable DNS and hostname. // - Storage: As many VolumeClaims as requested. // The StatefulSet guarantees that a given network identity will always -// map to the same storage identity. StatefulSet is currently in alpha and -// and subject to change without notice. +// map to the same storage identity. type StatefulSet struct { unversioned.TypeMeta `json:",inline"` // +optional diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index 983a08399ff..00000000000 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,192 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by conversion-gen. Do not edit it manually! - -package v1alpha1 - -import ( - api "k8s.io/client-go/pkg/api" - v1 "k8s.io/client-go/pkg/api/v1" - apps "k8s.io/client-go/pkg/apis/apps" - conversion "k8s.io/client-go/pkg/conversion" - runtime "k8s.io/client-go/pkg/runtime" -) - -func init() { - SchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(scheme *runtime.Scheme) error { - return scheme.AddGeneratedConversionFuncs( - Convert_v1alpha1_StatefulSet_To_apps_StatefulSet, - Convert_apps_StatefulSet_To_v1alpha1_StatefulSet, - Convert_v1alpha1_StatefulSetList_To_apps_StatefulSetList, - Convert_apps_StatefulSetList_To_v1alpha1_StatefulSetList, - Convert_v1alpha1_StatefulSetSpec_To_apps_StatefulSetSpec, - Convert_apps_StatefulSetSpec_To_v1alpha1_StatefulSetSpec, - Convert_v1alpha1_StatefulSetStatus_To_apps_StatefulSetStatus, - Convert_apps_StatefulSetStatus_To_v1alpha1_StatefulSetStatus, - ) -} - -func autoConvert_v1alpha1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.StatefulSet, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_v1alpha1_StatefulSetSpec_To_apps_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_StatefulSetStatus_To_apps_StatefulSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.StatefulSet, s conversion.Scope) error { - return autoConvert_v1alpha1_StatefulSet_To_apps_StatefulSet(in, out, s) -} - -func autoConvert_apps_StatefulSet_To_v1alpha1_StatefulSet(in *apps.StatefulSet, out *StatefulSet, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_apps_StatefulSetSpec_To_v1alpha1_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_apps_StatefulSetStatus_To_v1alpha1_StatefulSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_apps_StatefulSet_To_v1alpha1_StatefulSet(in *apps.StatefulSet, out *StatefulSet, s conversion.Scope) error { - return autoConvert_apps_StatefulSet_To_v1alpha1_StatefulSet(in, out, s) -} - -func autoConvert_v1alpha1_StatefulSetList_To_apps_StatefulSetList(in *StatefulSetList, out *apps.StatefulSetList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]apps.StatefulSet, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_StatefulSet_To_apps_StatefulSet(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1alpha1_StatefulSetList_To_apps_StatefulSetList(in *StatefulSetList, out *apps.StatefulSetList, s conversion.Scope) error { - return autoConvert_v1alpha1_StatefulSetList_To_apps_StatefulSetList(in, out, s) -} - -func autoConvert_apps_StatefulSetList_To_v1alpha1_StatefulSetList(in *apps.StatefulSetList, out *StatefulSetList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]StatefulSet, len(*in)) - for i := range *in { - if err := Convert_apps_StatefulSet_To_v1alpha1_StatefulSet(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_apps_StatefulSetList_To_v1alpha1_StatefulSetList(in *apps.StatefulSetList, out *StatefulSetList, s conversion.Scope) error { - return autoConvert_apps_StatefulSetList_To_v1alpha1_StatefulSetList(in, out, s) -} - -func autoConvert_v1alpha1_StatefulSetSpec_To_apps_StatefulSetSpec(in *StatefulSetSpec, out *apps.StatefulSetSpec, s conversion.Scope) error { - if err := api.Convert_Pointer_int32_To_int32(&in.Replicas, &out.Replicas, s); err != nil { - return err - } - out.Selector = in.Selector - if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - if in.VolumeClaimTemplates != nil { - in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates - *out = make([]api.PersistentVolumeClaim, len(*in)) - for i := range *in { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil { - return err - } - } - } else { - out.VolumeClaimTemplates = nil - } - out.ServiceName = in.ServiceName - return nil -} - -func autoConvert_apps_StatefulSetSpec_To_v1alpha1_StatefulSetSpec(in *apps.StatefulSetSpec, out *StatefulSetSpec, s conversion.Scope) error { - if err := api.Convert_int32_To_Pointer_int32(&in.Replicas, &out.Replicas, s); err != nil { - return err - } - out.Selector = in.Selector - if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - if in.VolumeClaimTemplates != nil { - in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates - *out = make([]v1.PersistentVolumeClaim, len(*in)) - for i := range *in { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil { - return err - } - } - } else { - out.VolumeClaimTemplates = nil - } - out.ServiceName = in.ServiceName - return nil -} - -func autoConvert_v1alpha1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSetStatus, out *apps.StatefulSetStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.Replicas = in.Replicas - return nil -} - -func Convert_v1alpha1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSetStatus, out *apps.StatefulSetStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_StatefulSetStatus_To_apps_StatefulSetStatus(in, out, s) -} - -func autoConvert_apps_StatefulSetStatus_To_v1alpha1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.Replicas = in.Replicas - return nil -} - -func Convert_apps_StatefulSetStatus_To_v1alpha1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error { - return autoConvert_apps_StatefulSetStatus_To_v1alpha1_StatefulSetStatus(in, out, s) -} diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/conversion.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/conversion.go similarity index 85% rename from staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/conversion.go rename to staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/conversion.go index 269bddef7b4..caef334f17d 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( "fmt" @@ -33,14 +33,14 @@ func addConversionFuncs(scheme *runtime.Scheme) error { // it, but a plain int32 is more convenient in the internal type. These // functions are the same as the autogenerated ones in every other way. err := scheme.AddConversionFuncs( - Convert_v1alpha1_StatefulSetSpec_To_apps_StatefulSetSpec, - Convert_apps_StatefulSetSpec_To_v1alpha1_StatefulSetSpec, + Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec, + Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec, ) if err != nil { return err } - return api.Scheme.AddFieldLabelConversionFunc("apps/v1alpha1", "StatefulSet", + return api.Scheme.AddFieldLabelConversionFunc("apps/v1beta1", "StatefulSet", func(label, value string) (string, string, error) { switch label { case "metadata.name", "metadata.namespace", "status.successful": @@ -52,7 +52,7 @@ func addConversionFuncs(scheme *runtime.Scheme) error { ) } -func Convert_v1alpha1_StatefulSetSpec_To_apps_StatefulSetSpec(in *StatefulSetSpec, out *apps.StatefulSetSpec, s conversion.Scope) error { +func Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(in *StatefulSetSpec, out *apps.StatefulSetSpec, s conversion.Scope) error { if in.Replicas != nil { out.Replicas = *in.Replicas } @@ -83,7 +83,7 @@ func Convert_v1alpha1_StatefulSetSpec_To_apps_StatefulSetSpec(in *StatefulSetSpe return nil } -func Convert_apps_StatefulSetSpec_To_v1alpha1_StatefulSetSpec(in *apps.StatefulSetSpec, out *StatefulSetSpec, s conversion.Scope) error { +func Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec(in *apps.StatefulSetSpec, out *StatefulSetSpec, s conversion.Scope) error { out.Replicas = new(int32) *out.Replicas = in.Replicas if in.Selector != nil { diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/defaults.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/defaults.go similarity index 98% rename from staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/defaults.go rename to staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/defaults.go index 6c7d1c32f1f..cfe7fed0dc7 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/defaults.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/defaults.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( "k8s.io/client-go/pkg/api/unversioned" diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/doc.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/doc.go similarity index 94% rename from staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/doc.go rename to staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/doc.go index 66a7b01f233..6e3d4176151 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/doc.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/doc.go @@ -18,5 +18,6 @@ limitations under the License. // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps // +k8s:openapi-gen=true // +k8s:defaulter-gen=TypeMeta +// +groupName=apps.k8s.io -package v1alpha1 +package v1beta1 diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/generated.pb.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/generated.pb.go similarity index 85% rename from staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/generated.pb.go rename to staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/generated.pb.go index 1b00aa7325c..a495ee63433 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/generated.pb.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/generated.pb.go @@ -15,14 +15,14 @@ limitations under the License. */ // Code generated by protoc-gen-gogo. -// source: k8s.io/kubernetes/pkg/apis/apps/v1alpha1/generated.proto +// source: k8s.io/kubernetes/pkg/apis/apps/v1beta1/generated.proto // DO NOT EDIT! /* - Package v1alpha1 is a generated protocol buffer package. + Package v1beta1 is a generated protocol buffer package. It is generated from these files: - k8s.io/kubernetes/pkg/apis/apps/v1alpha1/generated.proto + k8s.io/kubernetes/pkg/apis/apps/v1beta1/generated.proto It has these top-level messages: StatefulSet @@ -30,7 +30,7 @@ limitations under the License. StatefulSetSpec StatefulSetStatus */ -package v1alpha1 +package v1beta1 import proto "github.com/gogo/protobuf/proto" import fmt "fmt" @@ -70,10 +70,10 @@ func (*StatefulSetStatus) ProtoMessage() {} func (*StatefulSetStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } func init() { - proto.RegisterType((*StatefulSet)(nil), "k8s.io.client-go.pkg.apis.apps.v1alpha1.StatefulSet") - proto.RegisterType((*StatefulSetList)(nil), "k8s.io.client-go.pkg.apis.apps.v1alpha1.StatefulSetList") - proto.RegisterType((*StatefulSetSpec)(nil), "k8s.io.client-go.pkg.apis.apps.v1alpha1.StatefulSetSpec") - proto.RegisterType((*StatefulSetStatus)(nil), "k8s.io.client-go.pkg.apis.apps.v1alpha1.StatefulSetStatus") + proto.RegisterType((*StatefulSet)(nil), "k8s.io.client-go.pkg.apis.apps.v1beta1.StatefulSet") + proto.RegisterType((*StatefulSetList)(nil), "k8s.io.client-go.pkg.apis.apps.v1beta1.StatefulSetList") + proto.RegisterType((*StatefulSetSpec)(nil), "k8s.io.client-go.pkg.apis.apps.v1beta1.StatefulSetSpec") + proto.RegisterType((*StatefulSetStatus)(nil), "k8s.io.client-go.pkg.apis.apps.v1beta1.StatefulSetStatus") } func (m *StatefulSet) Marshal() (data []byte, err error) { size := m.Size() @@ -1032,45 +1032,45 @@ var ( ) var fileDescriptorGenerated = []byte{ - // 628 bytes of a gzipped FileDescriptorProto + // 627 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x93, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xc7, 0xe3, 0xa4, 0xa9, 0xc2, 0xa6, 0x7c, 0x2d, 0x15, 0x8a, 0x22, 0xe4, 0x56, 0x39, 0x45, - 0xa8, 0x5d, 0x2b, 0x85, 0x4a, 0x45, 0xdc, 0x8c, 0x04, 0x42, 0x02, 0x8a, 0x1c, 0x54, 0xa1, 0x56, - 0x20, 0x6d, 0x9c, 0x69, 0xba, 0xc4, 0xf6, 0x5a, 0xde, 0x71, 0xce, 0x5c, 0x38, 0x70, 0xe3, 0x35, - 0x78, 0x02, 0x5e, 0xa1, 0x07, 0x0e, 0x3d, 0x72, 0xaa, 0x48, 0x78, 0x11, 0xe4, 0xcd, 0xe6, 0x83, - 0x3a, 0x29, 0x55, 0x6f, 0x9e, 0xdd, 0xf9, 0xff, 0x66, 0xe6, 0xbf, 0x63, 0xb2, 0xd7, 0xdf, 0x53, - 0x4c, 0x48, 0xa7, 0x9f, 0x76, 0x20, 0x89, 0x00, 0x41, 0x39, 0x71, 0xbf, 0xe7, 0xf0, 0x58, 0x28, - 0x87, 0xc7, 0xb1, 0x72, 0x06, 0x2d, 0x1e, 0xc4, 0x27, 0xbc, 0xe5, 0xf4, 0x20, 0x82, 0x84, 0x23, - 0x74, 0x59, 0x9c, 0x48, 0x94, 0xb4, 0x39, 0x56, 0xb2, 0x99, 0x92, 0xc5, 0xfd, 0x1e, 0xcb, 0x94, - 0x2c, 0x53, 0xb2, 0x89, 0xb2, 0xbe, 0xdd, 0x13, 0x78, 0x92, 0x76, 0x98, 0x2f, 0x43, 0xa7, 0x27, - 0x7b, 0xd2, 0xd1, 0x80, 0x4e, 0x7a, 0xac, 0x23, 0x1d, 0xe8, 0xaf, 0x31, 0xb8, 0xbe, 0xb3, 0xb4, - 0x25, 0x27, 0x01, 0x25, 0xd3, 0xc4, 0x87, 0x8b, 0xcd, 0xd4, 0x77, 0x97, 0x6b, 0xd2, 0x68, 0x00, - 0x89, 0x12, 0x32, 0x82, 0x6e, 0x4e, 0xb6, 0xb5, 0x5c, 0x36, 0xc8, 0x4d, 0x5c, 0xdf, 0x5e, 0x9c, - 0x9d, 0xa4, 0x11, 0x8a, 0x30, 0xdf, 0x53, 0x6b, 0x71, 0x7a, 0x8a, 0x22, 0x70, 0x44, 0x84, 0x0a, - 0x93, 0x8b, 0x92, 0xc6, 0xf7, 0x22, 0xa9, 0xb6, 0x91, 0x23, 0x1c, 0xa7, 0x41, 0x1b, 0x90, 0xbe, - 0x27, 0x95, 0x10, 0x90, 0x77, 0x39, 0xf2, 0x9a, 0xb5, 0x69, 0x35, 0xab, 0x3b, 0x4d, 0xb6, 0xd4, - 0x76, 0x36, 0x68, 0xb1, 0xfd, 0xce, 0x27, 0xf0, 0xf1, 0x35, 0x20, 0x77, 0xe9, 0xe9, 0xf9, 0x46, - 0x61, 0x74, 0xbe, 0x41, 0x66, 0x67, 0xde, 0x94, 0x46, 0x8f, 0xc8, 0x8a, 0x8a, 0xc1, 0xaf, 0x15, - 0x35, 0xf5, 0x09, 0xbb, 0xea, 0x63, 0xb2, 0xb9, 0xf6, 0xda, 0x31, 0xf8, 0xee, 0x9a, 0x29, 0xb3, - 0x92, 0x45, 0x9e, 0x86, 0x52, 0x9f, 0xac, 0x2a, 0xe4, 0x98, 0xaa, 0x5a, 0x49, 0xe3, 0x9f, 0x5e, - 0x0f, 0xaf, 0x11, 0xee, 0x2d, 0x53, 0x60, 0x75, 0x1c, 0x7b, 0x06, 0xdd, 0xf8, 0x69, 0x91, 0xdb, - 0x73, 0xd9, 0xaf, 0x84, 0x42, 0xfa, 0x21, 0xe7, 0x97, 0x73, 0x89, 0x5f, 0x73, 0x9b, 0xc1, 0x32, - 0xb9, 0xb6, 0xed, 0x8e, 0x29, 0x57, 0x99, 0x9c, 0xcc, 0x99, 0x76, 0x48, 0xca, 0x02, 0x21, 0x54, - 0xb5, 0xe2, 0x66, 0xa9, 0x59, 0xdd, 0xd9, 0xbd, 0xd6, 0x58, 0xee, 0x4d, 0x53, 0xa1, 0xfc, 0x32, - 0x63, 0x79, 0x63, 0x64, 0xe3, 0x47, 0xe9, 0x9f, 0x71, 0x32, 0x37, 0x69, 0x93, 0x54, 0x12, 0x88, - 0x03, 0xe1, 0x73, 0xa5, 0xc7, 0x29, 0xbb, 0x6b, 0x59, 0x67, 0x9e, 0x39, 0xf3, 0xa6, 0xb7, 0xf4, - 0x23, 0xa9, 0x28, 0x08, 0xc0, 0x47, 0x99, 0x98, 0x27, 0x7d, 0x7c, 0xd5, 0xc1, 0x79, 0x07, 0x82, - 0xb6, 0xd1, 0x8e, 0xf9, 0x93, 0xc8, 0x9b, 0x32, 0xe9, 0x11, 0xa9, 0x20, 0x84, 0x71, 0xc0, 0x11, - 0xcc, 0x9b, 0x6e, 0x5f, 0xbe, 0x88, 0x6f, 0x65, 0xf7, 0x9d, 0x11, 0xe8, 0x35, 0x99, 0xda, 0x3a, - 0x39, 0xf5, 0xa6, 0x40, 0xfa, 0xc5, 0x22, 0xeb, 0x03, 0x19, 0xa4, 0x21, 0x3c, 0x0b, 0xb8, 0x08, - 0x27, 0x19, 0xaa, 0xb6, 0xa2, 0x6d, 0x7e, 0xf4, 0x9f, 0x4a, 0xd9, 0x28, 0x0a, 0x21, 0xc2, 0x83, - 0x19, 0xc3, 0x7d, 0x60, 0xea, 0xad, 0x1f, 0x2c, 0x00, 0x7b, 0x0b, 0xcb, 0xd1, 0x5d, 0x52, 0x55, - 0x90, 0x0c, 0x84, 0x0f, 0x6f, 0x78, 0x08, 0xb5, 0xf2, 0xa6, 0xd5, 0xbc, 0xe1, 0xde, 0x33, 0xa0, - 0x6a, 0x7b, 0x76, 0xe5, 0xcd, 0xe7, 0x35, 0xbe, 0x5a, 0xe4, 0x6e, 0x6e, 0x6d, 0xe9, 0x73, 0x42, - 0x65, 0x27, 0x4b, 0x83, 0xee, 0x8b, 0xf1, 0x5f, 0x2e, 0x64, 0xa4, 0x5f, 0xb1, 0xe4, 0xde, 0x1f, - 0x9d, 0x6f, 0xd0, 0xfd, 0xdc, 0xad, 0xb7, 0x40, 0x41, 0xb7, 0xe6, 0x76, 0xa0, 0xa8, 0x77, 0x60, - 0x6a, 0x65, 0x7e, 0x0f, 0xdc, 0x87, 0xa7, 0x43, 0xbb, 0x70, 0x36, 0xb4, 0x0b, 0xbf, 0x86, 0x76, - 0xe1, 0xf3, 0xc8, 0xb6, 0x4e, 0x47, 0xb6, 0x75, 0x36, 0xb2, 0xad, 0xdf, 0x23, 0xdb, 0xfa, 0xf6, - 0xc7, 0x2e, 0x1c, 0x56, 0x26, 0x3b, 0xf9, 0x37, 0x00, 0x00, 0xff, 0xff, 0x02, 0xea, 0x1a, 0x59, - 0xfb, 0x05, 0x00, 0x00, + 0x10, 0xc7, 0xe3, 0xa4, 0x29, 0x61, 0x53, 0xbe, 0x96, 0x0a, 0x45, 0x11, 0x72, 0xab, 0x5c, 0x08, + 0x52, 0xbb, 0x56, 0x4a, 0x2b, 0x2a, 0x8e, 0x46, 0x02, 0x21, 0x01, 0x45, 0x0e, 0xaa, 0xa0, 0x08, + 0xa4, 0xb5, 0x33, 0x0d, 0x4b, 0x6c, 0xaf, 0xe5, 0x1d, 0xe7, 0xcc, 0x85, 0x03, 0x37, 0xde, 0x82, + 0x47, 0xe0, 0x15, 0x2a, 0x71, 0xe9, 0x91, 0x53, 0x45, 0xc3, 0x8b, 0x20, 0x6f, 0x36, 0x1f, 0x34, + 0x49, 0xa9, 0x7a, 0xf3, 0xec, 0xce, 0xff, 0x37, 0x33, 0xff, 0x1d, 0x93, 0x87, 0xbd, 0x5d, 0xc5, + 0x84, 0x74, 0x7a, 0x99, 0x0f, 0x69, 0x0c, 0x08, 0xca, 0x49, 0x7a, 0x5d, 0x87, 0x27, 0x42, 0x39, + 0x3c, 0x49, 0x94, 0xd3, 0x6f, 0xf9, 0x80, 0xbc, 0xe5, 0x74, 0x21, 0x86, 0x94, 0x23, 0x74, 0x58, + 0x92, 0x4a, 0x94, 0xf4, 0xde, 0x50, 0xc8, 0x26, 0x42, 0x96, 0xf4, 0xba, 0x2c, 0x17, 0xb2, 0x5c, + 0xc8, 0x8c, 0xb0, 0xbe, 0xd9, 0x15, 0xf8, 0x31, 0xf3, 0x59, 0x20, 0x23, 0xa7, 0x2b, 0xbb, 0xd2, + 0xd1, 0x7a, 0x3f, 0x3b, 0xd4, 0x91, 0x0e, 0xf4, 0xd7, 0x90, 0x5b, 0xdf, 0x5a, 0xd8, 0x90, 0x93, + 0x82, 0x92, 0x59, 0x1a, 0xc0, 0xd9, 0x5e, 0xea, 0x3b, 0x8b, 0x35, 0x59, 0xdc, 0x87, 0x54, 0x09, + 0x19, 0x43, 0x67, 0x46, 0xb6, 0xb1, 0x58, 0xd6, 0x9f, 0x19, 0xb8, 0xbe, 0x39, 0x3f, 0x3b, 0xcd, + 0x62, 0x14, 0xd1, 0x6c, 0x4f, 0xad, 0xf9, 0xe9, 0x19, 0x8a, 0xd0, 0x11, 0x31, 0x2a, 0x4c, 0xcf, + 0x4a, 0x1a, 0xdf, 0x8b, 0xa4, 0xda, 0x46, 0x8e, 0x70, 0x98, 0x85, 0x6d, 0x40, 0xfa, 0x86, 0x54, + 0x22, 0x40, 0xde, 0xe1, 0xc8, 0x6b, 0xd6, 0xba, 0xd5, 0xac, 0x6e, 0x35, 0xd9, 0x42, 0xd7, 0x59, + 0xbf, 0xc5, 0xf6, 0xfc, 0x4f, 0x10, 0xe0, 0x0b, 0x40, 0xee, 0xd2, 0xa3, 0x93, 0xb5, 0xc2, 0xe0, + 0x64, 0x8d, 0x4c, 0xce, 0xbc, 0x31, 0x8d, 0x1e, 0x90, 0x25, 0x95, 0x40, 0x50, 0x2b, 0x6a, 0xea, + 0x2e, 0xbb, 0xe0, 0x5b, 0xb2, 0xa9, 0xee, 0xda, 0x09, 0x04, 0xee, 0x8a, 0xa9, 0xb2, 0x94, 0x47, + 0x9e, 0x66, 0x52, 0x9f, 0x2c, 0x2b, 0xe4, 0x98, 0xa9, 0x5a, 0x49, 0xd3, 0x1f, 0x5d, 0x8a, 0xae, + 0x09, 0xee, 0x75, 0xc3, 0x5f, 0x1e, 0xc6, 0x9e, 0x21, 0x37, 0x7e, 0x5a, 0xe4, 0xc6, 0x54, 0xf6, + 0x73, 0xa1, 0x90, 0xbe, 0x9f, 0x71, 0xcb, 0x39, 0xc7, 0xad, 0xa9, 0xbd, 0x60, 0xb9, 0x5c, 0x9b, + 0x76, 0xd3, 0x94, 0xab, 0x8c, 0x4e, 0xa6, 0x2c, 0x7b, 0x4b, 0xca, 0x02, 0x21, 0x52, 0xb5, 0xe2, + 0x7a, 0xa9, 0x59, 0xdd, 0xda, 0xbe, 0xcc, 0x54, 0xee, 0x35, 0x53, 0xa0, 0xfc, 0x2c, 0x47, 0x79, + 0x43, 0x62, 0xe3, 0x47, 0xe9, 0x9f, 0x69, 0x72, 0x2f, 0x69, 0x93, 0x54, 0x52, 0x48, 0x42, 0x11, + 0x70, 0xa5, 0xa7, 0x29, 0xbb, 0x2b, 0x79, 0x63, 0x9e, 0x39, 0xf3, 0xc6, 0xb7, 0xf4, 0x03, 0xa9, + 0x28, 0x08, 0x21, 0x40, 0x99, 0x9a, 0xf7, 0xdc, 0xbe, 0xe8, 0xdc, 0xdc, 0x87, 0xb0, 0x6d, 0xb4, + 0x43, 0xfe, 0x28, 0xf2, 0xc6, 0x4c, 0xfa, 0x8e, 0x54, 0x10, 0xa2, 0x24, 0xe4, 0x08, 0xe6, 0x45, + 0x37, 0xcf, 0xdf, 0xc2, 0x57, 0xb2, 0xf3, 0xda, 0x08, 0xf4, 0x92, 0x8c, 0x5d, 0x1d, 0x9d, 0x7a, + 0x63, 0x20, 0xfd, 0x62, 0x91, 0xd5, 0xbe, 0x0c, 0xb3, 0x08, 0x1e, 0x87, 0x5c, 0x44, 0xa3, 0x0c, + 0x55, 0x5b, 0xd2, 0x2e, 0x3f, 0xf8, 0x4f, 0xa5, 0x7c, 0x14, 0x85, 0x10, 0xe3, 0xfe, 0x84, 0xe1, + 0xde, 0x35, 0xf5, 0x56, 0xf7, 0xe7, 0x80, 0xbd, 0xb9, 0xe5, 0xe8, 0x0e, 0xa9, 0x2a, 0x48, 0xfb, + 0x22, 0x80, 0x97, 0x3c, 0x82, 0x5a, 0x79, 0xdd, 0x6a, 0x5e, 0x75, 0x6f, 0x1b, 0x50, 0xb5, 0x3d, + 0xb9, 0xf2, 0xa6, 0xf3, 0x1a, 0x5f, 0x2d, 0x72, 0x6b, 0x66, 0x6b, 0xe9, 0x13, 0x42, 0xa5, 0x9f, + 0xa7, 0x41, 0xe7, 0xe9, 0xf0, 0x17, 0x17, 0x32, 0xd6, 0xaf, 0x58, 0x72, 0xef, 0x0c, 0x4e, 0xd6, + 0xe8, 0xde, 0xcc, 0xad, 0x37, 0x47, 0x41, 0x37, 0xa6, 0x76, 0xa0, 0xa8, 0x77, 0x60, 0x6c, 0xe5, + 0xec, 0x1e, 0xb8, 0xf7, 0x8f, 0x4e, 0xed, 0xc2, 0xf1, 0xa9, 0x5d, 0xf8, 0x75, 0x6a, 0x17, 0x3e, + 0x0f, 0x6c, 0xeb, 0x68, 0x60, 0x5b, 0xc7, 0x03, 0xdb, 0xfa, 0x3d, 0xb0, 0xad, 0x6f, 0x7f, 0xec, + 0xc2, 0xc1, 0x15, 0xb3, 0x92, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x28, 0x58, 0x61, 0xec, 0xf5, + 0x05, 0x00, 0x00, } diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/generated.proto b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/generated.proto similarity index 95% rename from staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/generated.proto rename to staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/generated.proto index 52e153fe2e7..4d4b054b333 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/generated.proto +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/generated.proto @@ -19,7 +19,7 @@ limitations under the License. syntax = 'proto2'; -package k8s.io.kubernetes.pkg.apis.apps.v1alpha1; +package k8s.io.kubernetes.pkg.apis.apps.v1beta1; import "k8s.io/kubernetes/pkg/api/resource/generated.proto"; import "k8s.io/kubernetes/pkg/api/unversioned/generated.proto"; @@ -28,15 +28,14 @@ import "k8s.io/kubernetes/pkg/runtime/generated.proto"; import "k8s.io/kubernetes/pkg/util/intstr/generated.proto"; // Package-wide variables from generator "generated". -option go_package = "v1alpha1"; +option go_package = "v1beta1"; // StatefulSet represents a set of pods with consistent identities. // Identities are defined as: // - Network: A single stable DNS and hostname. // - Storage: As many VolumeClaims as requested. // The StatefulSet guarantees that a given network identity will always -// map to the same storage identity. StatefulSet is currently in alpha -// and subject to change without notice. +// map to the same storage identity. message StatefulSet { // +optional optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/register.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/register.go similarity index 96% rename from staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/register.go rename to staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/register.go index ab771dec0ff..3ab76cf6ae7 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/register.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/register.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( "k8s.io/client-go/pkg/api/unversioned" @@ -27,7 +27,7 @@ import ( const GroupName = "apps" // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1alpha1"} +var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta1"} var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs, addConversionFuncs) @@ -41,6 +41,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &StatefulSetList{}, &v1.ListOptions{}, &v1.DeleteOptions{}, + &v1.ExportOptions{}, ) versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/types.generated.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/types.generated.go similarity index 99% rename from staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/types.generated.go rename to staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/types.generated.go index 156fcfe3eeb..6436d90a8d8 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/types.generated.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/types.generated.go @@ -19,7 +19,7 @@ limitations under the License. // THIS FILE IS AUTO-GENERATED BY codecgen. // ************************************************************ -package v1alpha1 +package v1beta1 import ( "errors" diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/types.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/types.go similarity index 97% rename from staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/types.go rename to staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/types.go index cc27518563f..0db244eccfe 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( "k8s.io/client-go/pkg/api/unversioned" @@ -28,8 +28,7 @@ import ( // - Network: A single stable DNS and hostname. // - Storage: As many VolumeClaims as requested. // The StatefulSet guarantees that a given network identity will always -// map to the same storage identity. StatefulSet is currently in alpha -// and subject to change without notice. +// map to the same storage identity. type StatefulSet struct { unversioned.TypeMeta `json:",inline"` // +optional diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/types_swagger_doc_generated.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/types_swagger_doc_generated.go similarity index 96% rename from staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/types_swagger_doc_generated.go rename to staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/types_swagger_doc_generated.go index 2be2e6bfafa..837181c1c0c 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/types_swagger_doc_generated.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 // This file contains a collection of methods that can be used from go-restful to // generate Swagger API documentation for its models. Please read this PR for more @@ -28,7 +28,7 @@ package v1alpha1 // AUTO-GENERATED FUNCTIONS START HERE var map_StatefulSet = map[string]string{ - "": "StatefulSet represents a set of pods with consistent identities. Identities are defined as:\n - Network: A single stable DNS and hostname.\n - Storage: As many VolumeClaims as requested.\nThe StatefulSet guarantees that a given network identity will always map to the same storage identity. StatefulSet is currently in alpha and subject to change without notice.", + "": "StatefulSet represents a set of pods with consistent identities. Identities are defined as:\n - Network: A single stable DNS and hostname.\n - Storage: As many VolumeClaims as requested.\nThe StatefulSet guarantees that a given network identity will always map to the same storage identity.", "spec": "Spec defines the desired identities of pods in this set.", "status": "Status is the current status of Pods in this StatefulSet. This data may be out of date by some window of time.", } diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.conversion.go new file mode 100644 index 00000000000..0f2f0519276 --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.conversion.go @@ -0,0 +1,172 @@ +// +build !ignore_autogenerated + +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was autogenerated by conversion-gen. Do not edit it manually! + +package v1beta1 + +import ( + api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" + v1 "k8s.io/client-go/pkg/api/v1" + apps "k8s.io/client-go/pkg/apis/apps" + conversion "k8s.io/client-go/pkg/conversion" + runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" +) + +func init() { + SchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(scheme *runtime.Scheme) error { + return scheme.AddGeneratedConversionFuncs( + Convert_v1beta1_StatefulSet_To_apps_StatefulSet, + Convert_apps_StatefulSet_To_v1beta1_StatefulSet, + Convert_v1beta1_StatefulSetList_To_apps_StatefulSetList, + Convert_apps_StatefulSetList_To_v1beta1_StatefulSetList, + Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec, + Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec, + Convert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus, + Convert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus, + ) +} + +func autoConvert_v1beta1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.StatefulSet, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + if err := Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +func Convert_v1beta1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.StatefulSet, s conversion.Scope) error { + return autoConvert_v1beta1_StatefulSet_To_apps_StatefulSet(in, out, s) +} + +func autoConvert_apps_StatefulSet_To_v1beta1_StatefulSet(in *apps.StatefulSet, out *StatefulSet, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + if err := Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +func Convert_apps_StatefulSet_To_v1beta1_StatefulSet(in *apps.StatefulSet, out *StatefulSet, s conversion.Scope) error { + return autoConvert_apps_StatefulSet_To_v1beta1_StatefulSet(in, out, s) +} + +func autoConvert_v1beta1_StatefulSetList_To_apps_StatefulSetList(in *StatefulSetList, out *apps.StatefulSetList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]apps.StatefulSet, len(*in)) + for i := range *in { + if err := Convert_v1beta1_StatefulSet_To_apps_StatefulSet(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func Convert_v1beta1_StatefulSetList_To_apps_StatefulSetList(in *StatefulSetList, out *apps.StatefulSetList, s conversion.Scope) error { + return autoConvert_v1beta1_StatefulSetList_To_apps_StatefulSetList(in, out, s) +} + +func autoConvert_apps_StatefulSetList_To_v1beta1_StatefulSetList(in *apps.StatefulSetList, out *StatefulSetList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]StatefulSet, len(*in)) + for i := range *in { + if err := Convert_apps_StatefulSet_To_v1beta1_StatefulSet(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func Convert_apps_StatefulSetList_To_v1beta1_StatefulSetList(in *apps.StatefulSetList, out *StatefulSetList, s conversion.Scope) error { + return autoConvert_apps_StatefulSetList_To_v1beta1_StatefulSetList(in, out, s) +} + +func autoConvert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(in *StatefulSetSpec, out *apps.StatefulSetSpec, s conversion.Scope) error { + if err := api.Convert_Pointer_int32_To_int32(&in.Replicas, &out.Replicas, s); err != nil { + return err + } + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) + if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + out.VolumeClaimTemplates = *(*[]api.PersistentVolumeClaim)(unsafe.Pointer(&in.VolumeClaimTemplates)) + out.ServiceName = in.ServiceName + return nil +} + +func autoConvert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec(in *apps.StatefulSetSpec, out *StatefulSetSpec, s conversion.Scope) error { + if err := api.Convert_int32_To_Pointer_int32(&in.Replicas, &out.Replicas, s); err != nil { + return err + } + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) + if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + out.VolumeClaimTemplates = *(*[]v1.PersistentVolumeClaim)(unsafe.Pointer(&in.VolumeClaimTemplates)) + out.ServiceName = in.ServiceName + return nil +} + +func autoConvert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSetStatus, out *apps.StatefulSetStatus, s conversion.Scope) error { + out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration)) + out.Replicas = in.Replicas + return nil +} + +func Convert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSetStatus, out *apps.StatefulSetStatus, s conversion.Scope) error { + return autoConvert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(in, out, s) +} + +func autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error { + out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration)) + out.Replicas = in.Replicas + return nil +} + +func Convert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error { + return autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in, out, s) +} diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.deepcopy.go similarity index 72% rename from staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go rename to staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.deepcopy.go index c8dbb43a2b1..83191c0f710 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.deepcopy.go @@ -18,7 +18,7 @@ limitations under the License. // This file was autogenerated by deepcopy-gen. Do not edit it manually! -package v1alpha1 +package v1beta1 import ( unversioned "k8s.io/client-go/pkg/api/unversioned" @@ -36,14 +36,14 @@ func init() { // to allow building arbitrary schemes. func RegisterDeepCopies(scheme *runtime.Scheme) error { return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_StatefulSet, InType: reflect.TypeOf(&StatefulSet{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_StatefulSetList, InType: reflect.TypeOf(&StatefulSetList{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_StatefulSetSpec, InType: reflect.TypeOf(&StatefulSetSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_StatefulSetStatus, InType: reflect.TypeOf(&StatefulSetStatus{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSet, InType: reflect.TypeOf(&StatefulSet{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetList, InType: reflect.TypeOf(&StatefulSetList{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetSpec, InType: reflect.TypeOf(&StatefulSetSpec{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetStatus, InType: reflect.TypeOf(&StatefulSetStatus{})}, ) } -func DeepCopy_v1alpha1_StatefulSet(in interface{}, out interface{}, c *conversion.Cloner) error { +func DeepCopy_v1beta1_StatefulSet(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*StatefulSet) out := out.(*StatefulSet) @@ -51,17 +51,17 @@ func DeepCopy_v1alpha1_StatefulSet(in interface{}, out interface{}, c *conversio if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_v1alpha1_StatefulSetSpec(&in.Spec, &out.Spec, c); err != nil { + if err := DeepCopy_v1beta1_StatefulSetSpec(&in.Spec, &out.Spec, c); err != nil { return err } - if err := DeepCopy_v1alpha1_StatefulSetStatus(&in.Status, &out.Status, c); err != nil { + if err := DeepCopy_v1beta1_StatefulSetStatus(&in.Status, &out.Status, c); err != nil { return err } return nil } } -func DeepCopy_v1alpha1_StatefulSetList(in interface{}, out interface{}, c *conversion.Cloner) error { +func DeepCopy_v1beta1_StatefulSetList(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*StatefulSetList) out := out.(*StatefulSetList) @@ -71,7 +71,7 @@ func DeepCopy_v1alpha1_StatefulSetList(in interface{}, out interface{}, c *conve in, out := &in.Items, &out.Items *out = make([]StatefulSet, len(*in)) for i := range *in { - if err := DeepCopy_v1alpha1_StatefulSet(&(*in)[i], &(*out)[i], c); err != nil { + if err := DeepCopy_v1beta1_StatefulSet(&(*in)[i], &(*out)[i], c); err != nil { return err } } @@ -82,7 +82,7 @@ func DeepCopy_v1alpha1_StatefulSetList(in interface{}, out interface{}, c *conve } } -func DeepCopy_v1alpha1_StatefulSetSpec(in interface{}, out interface{}, c *conversion.Cloner) error { +func DeepCopy_v1beta1_StatefulSetSpec(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*StatefulSetSpec) out := out.(*StatefulSetSpec) @@ -121,7 +121,7 @@ func DeepCopy_v1alpha1_StatefulSetSpec(in interface{}, out interface{}, c *conve } } -func DeepCopy_v1alpha1_StatefulSetStatus(in interface{}, out interface{}, c *conversion.Cloner) error { +func DeepCopy_v1beta1_StatefulSetStatus(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*StatefulSetStatus) out := out.(*StatefulSetStatus) diff --git a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.defaults.go b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.defaults.go similarity index 99% rename from staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.defaults.go rename to staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.defaults.go index 3a93522685c..7f9a19c1e20 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.defaults.go +++ b/staging/src/k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.defaults.go @@ -18,7 +18,7 @@ limitations under the License. // This file was autogenerated by defaulter-gen. Do not edit it manually! -package v1alpha1 +package v1beta1 import ( v1 "k8s.io/client-go/pkg/api/v1" diff --git a/staging/src/k8s.io/client-go/pkg/apis/authentication/v1beta1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/authentication/v1beta1/zz_generated.conversion.go index 73d11ea7a15..8e5a1d2011f 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/authentication/v1beta1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/authentication/v1beta1/zz_generated.conversion.go @@ -24,6 +24,7 @@ import ( authentication "k8s.io/client-go/pkg/apis/authentication" conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" ) func init() { @@ -128,21 +129,8 @@ func Convert_authentication_TokenReviewStatus_To_v1beta1_TokenReviewStatus(in *a func autoConvert_v1beta1_UserInfo_To_authentication_UserInfo(in *UserInfo, out *authentication.UserInfo, s conversion.Scope) error { out.Username = in.Username out.UID = in.UID - out.Groups = in.Groups - if in.Extra != nil { - in, out := &in.Extra, &out.Extra - *out = make(map[string]authentication.ExtraValue, len(*in)) - for key, val := range *in { - newVal := new(authentication.ExtraValue) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&val, newVal, 0); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Extra = nil - } + out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) + out.Extra = *(*map[string]authentication.ExtraValue)(unsafe.Pointer(&in.Extra)) return nil } @@ -153,21 +141,8 @@ func Convert_v1beta1_UserInfo_To_authentication_UserInfo(in *UserInfo, out *auth func autoConvert_authentication_UserInfo_To_v1beta1_UserInfo(in *authentication.UserInfo, out *UserInfo, s conversion.Scope) error { out.Username = in.Username out.UID = in.UID - out.Groups = in.Groups - if in.Extra != nil { - in, out := &in.Extra, &out.Extra - *out = make(map[string]ExtraValue, len(*in)) - for key, val := range *in { - newVal := new(ExtraValue) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&val, newVal, 0); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Extra = nil - } + out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) + out.Extra = *(*map[string]ExtraValue)(unsafe.Pointer(&in.Extra)) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/authorization/v1beta1/register.go b/staging/src/k8s.io/client-go/pkg/apis/authorization/v1beta1/register.go index dec64433c85..6ae38ec85c9 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/authorization/v1beta1/register.go +++ b/staging/src/k8s.io/client-go/pkg/apis/authorization/v1beta1/register.go @@ -39,6 +39,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &v1.ListOptions{}, &v1.DeleteOptions{}, + &v1.ExportOptions{}, &SelfSubjectAccessReview{}, &SubjectAccessReview{}, diff --git a/staging/src/k8s.io/client-go/pkg/apis/authorization/v1beta1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/authorization/v1beta1/zz_generated.conversion.go index 7d9dfcc6f29..28fed4a7b59 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/authorization/v1beta1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/authorization/v1beta1/zz_generated.conversion.go @@ -24,6 +24,7 @@ import ( authorization "k8s.io/client-go/pkg/apis/authorization" conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" ) func init() { @@ -176,24 +177,8 @@ func Convert_authorization_SelfSubjectAccessReview_To_v1beta1_SelfSubjectAccessR } func autoConvert_v1beta1_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAccessReviewSpec(in *SelfSubjectAccessReviewSpec, out *authorization.SelfSubjectAccessReviewSpec, s conversion.Scope) error { - if in.ResourceAttributes != nil { - in, out := &in.ResourceAttributes, &out.ResourceAttributes - *out = new(authorization.ResourceAttributes) - if err := Convert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceAttributes = nil - } - if in.NonResourceAttributes != nil { - in, out := &in.NonResourceAttributes, &out.NonResourceAttributes - *out = new(authorization.NonResourceAttributes) - if err := Convert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.NonResourceAttributes = nil - } + out.ResourceAttributes = (*authorization.ResourceAttributes)(unsafe.Pointer(in.ResourceAttributes)) + out.NonResourceAttributes = (*authorization.NonResourceAttributes)(unsafe.Pointer(in.NonResourceAttributes)) return nil } @@ -202,24 +187,8 @@ func Convert_v1beta1_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAcc } func autoConvert_authorization_SelfSubjectAccessReviewSpec_To_v1beta1_SelfSubjectAccessReviewSpec(in *authorization.SelfSubjectAccessReviewSpec, out *SelfSubjectAccessReviewSpec, s conversion.Scope) error { - if in.ResourceAttributes != nil { - in, out := &in.ResourceAttributes, &out.ResourceAttributes - *out = new(ResourceAttributes) - if err := Convert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceAttributes = nil - } - if in.NonResourceAttributes != nil { - in, out := &in.NonResourceAttributes, &out.NonResourceAttributes - *out = new(NonResourceAttributes) - if err := Convert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.NonResourceAttributes = nil - } + out.ResourceAttributes = (*ResourceAttributes)(unsafe.Pointer(in.ResourceAttributes)) + out.NonResourceAttributes = (*NonResourceAttributes)(unsafe.Pointer(in.NonResourceAttributes)) return nil } @@ -264,40 +233,11 @@ func Convert_authorization_SubjectAccessReview_To_v1beta1_SubjectAccessReview(in } func autoConvert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(in *SubjectAccessReviewSpec, out *authorization.SubjectAccessReviewSpec, s conversion.Scope) error { - if in.ResourceAttributes != nil { - in, out := &in.ResourceAttributes, &out.ResourceAttributes - *out = new(authorization.ResourceAttributes) - if err := Convert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceAttributes = nil - } - if in.NonResourceAttributes != nil { - in, out := &in.NonResourceAttributes, &out.NonResourceAttributes - *out = new(authorization.NonResourceAttributes) - if err := Convert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.NonResourceAttributes = nil - } + out.ResourceAttributes = (*authorization.ResourceAttributes)(unsafe.Pointer(in.ResourceAttributes)) + out.NonResourceAttributes = (*authorization.NonResourceAttributes)(unsafe.Pointer(in.NonResourceAttributes)) out.User = in.User - out.Groups = in.Groups - if in.Extra != nil { - in, out := &in.Extra, &out.Extra - *out = make(map[string]authorization.ExtraValue, len(*in)) - for key, val := range *in { - newVal := new(authorization.ExtraValue) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&val, newVal, 0); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Extra = nil - } + out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) + out.Extra = *(*map[string]authorization.ExtraValue)(unsafe.Pointer(&in.Extra)) return nil } @@ -306,40 +246,11 @@ func Convert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessRevie } func autoConvert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec(in *authorization.SubjectAccessReviewSpec, out *SubjectAccessReviewSpec, s conversion.Scope) error { - if in.ResourceAttributes != nil { - in, out := &in.ResourceAttributes, &out.ResourceAttributes - *out = new(ResourceAttributes) - if err := Convert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceAttributes = nil - } - if in.NonResourceAttributes != nil { - in, out := &in.NonResourceAttributes, &out.NonResourceAttributes - *out = new(NonResourceAttributes) - if err := Convert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.NonResourceAttributes = nil - } + out.ResourceAttributes = (*ResourceAttributes)(unsafe.Pointer(in.ResourceAttributes)) + out.NonResourceAttributes = (*NonResourceAttributes)(unsafe.Pointer(in.NonResourceAttributes)) out.User = in.User - out.Groups = in.Groups - if in.Extra != nil { - in, out := &in.Extra, &out.Extra - *out = make(map[string]ExtraValue, len(*in)) - for key, val := range *in { - newVal := new(ExtraValue) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&val, newVal, 0); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.Extra = nil - } + out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) + out.Extra = *(*map[string]ExtraValue)(unsafe.Pointer(&in.Extra)) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/autoscaling/v1/register.go b/staging/src/k8s.io/client-go/pkg/apis/autoscaling/v1/register.go index 8072e81682e..c0f83dedda6 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/autoscaling/v1/register.go +++ b/staging/src/k8s.io/client-go/pkg/apis/autoscaling/v1/register.go @@ -42,6 +42,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &Scale{}, &v1.ListOptions{}, &v1.DeleteOptions{}, + &v1.ExportOptions{}, ) versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/staging/src/k8s.io/client-go/pkg/apis/autoscaling/v1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/autoscaling/v1/zz_generated.conversion.go index 760cd31f8ac..070a291252a 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/autoscaling/v1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/autoscaling/v1/zz_generated.conversion.go @@ -21,9 +21,11 @@ limitations under the License. package v1 import ( + unversioned "k8s.io/client-go/pkg/api/unversioned" autoscaling "k8s.io/client-go/pkg/apis/autoscaling" conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" ) func init() { @@ -113,17 +115,7 @@ func Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(i func autoConvert_v1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList(in *HorizontalPodAutoscalerList, out *autoscaling.HorizontalPodAutoscalerList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]autoscaling.HorizontalPodAutoscaler, len(*in)) - for i := range *in { - if err := Convert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]autoscaling.HorizontalPodAutoscaler)(unsafe.Pointer(&in.Items)) return nil } @@ -133,17 +125,7 @@ func Convert_v1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscal func autoConvert_autoscaling_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList(in *autoscaling.HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]HorizontalPodAutoscaler, len(*in)) - for i := range *in { - if err := Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]HorizontalPodAutoscaler)(unsafe.Pointer(&in.Items)) return nil } @@ -155,9 +137,9 @@ func autoConvert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAuto if err := Convert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(&in.ScaleTargetRef, &out.ScaleTargetRef, s); err != nil { return err } - out.MinReplicas = in.MinReplicas + out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas)) out.MaxReplicas = in.MaxReplicas - out.TargetCPUUtilizationPercentage = in.TargetCPUUtilizationPercentage + out.TargetCPUUtilizationPercentage = (*int32)(unsafe.Pointer(in.TargetCPUUtilizationPercentage)) return nil } @@ -169,9 +151,9 @@ func autoConvert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAuto if err := Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference(&in.ScaleTargetRef, &out.ScaleTargetRef, s); err != nil { return err } - out.MinReplicas = in.MinReplicas + out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas)) out.MaxReplicas = in.MaxReplicas - out.TargetCPUUtilizationPercentage = in.TargetCPUUtilizationPercentage + out.TargetCPUUtilizationPercentage = (*int32)(unsafe.Pointer(in.TargetCPUUtilizationPercentage)) return nil } @@ -180,11 +162,11 @@ func Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscal } func autoConvert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *autoscaling.HorizontalPodAutoscalerStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.LastScaleTime = in.LastScaleTime + out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration)) + out.LastScaleTime = (*unversioned.Time)(unsafe.Pointer(in.LastScaleTime)) out.CurrentReplicas = in.CurrentReplicas out.DesiredReplicas = in.DesiredReplicas - out.CurrentCPUUtilizationPercentage = in.CurrentCPUUtilizationPercentage + out.CurrentCPUUtilizationPercentage = (*int32)(unsafe.Pointer(in.CurrentCPUUtilizationPercentage)) return nil } @@ -193,11 +175,11 @@ func Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutosc } func autoConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(in *autoscaling.HorizontalPodAutoscalerStatus, out *HorizontalPodAutoscalerStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.LastScaleTime = in.LastScaleTime + out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration)) + out.LastScaleTime = (*unversioned.Time)(unsafe.Pointer(in.LastScaleTime)) out.CurrentReplicas = in.CurrentReplicas out.DesiredReplicas = in.DesiredReplicas - out.CurrentCPUUtilizationPercentage = in.CurrentCPUUtilizationPercentage + out.CurrentCPUUtilizationPercentage = (*int32)(unsafe.Pointer(in.CurrentCPUUtilizationPercentage)) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/register.go b/staging/src/k8s.io/client-go/pkg/apis/batch/register.go index 9ef7587f777..792f057c3f2 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/register.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/register.go @@ -49,9 +49,11 @@ func addKnownTypes(scheme *runtime.Scheme) error { &Job{}, &JobList{}, &JobTemplate{}, - &ScheduledJob{}, - &ScheduledJobList{}, + &CronJob{}, + &CronJobList{}, &api.ListOptions{}, ) + scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJob"), &CronJob{}) + scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJobList"), &CronJobList{}) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/types.generated.go b/staging/src/k8s.io/client-go/pkg/apis/batch/types.generated.go index 2610e231230..35a82920f5d 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/types.generated.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/types.generated.go @@ -2822,7 +2822,7 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ScheduledJob) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *CronJob) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -2967,7 +2967,7 @@ func (x *ScheduledJob) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *ScheduledJob) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *CronJob) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -2997,7 +2997,7 @@ func (x *ScheduledJob) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ScheduledJob) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *CronJob) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3040,14 +3040,14 @@ func (x *ScheduledJob) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } case "spec": if r.TryDecodeAsNil() { - x.Spec = ScheduledJobSpec{} + x.Spec = CronJobSpec{} } else { yyv269 := &x.Spec yyv269.CodecDecodeSelf(d) } case "status": if r.TryDecodeAsNil() { - x.Status = ScheduledJobStatus{} + x.Status = CronJobStatus{} } else { yyv270 := &x.Status yyv270.CodecDecodeSelf(d) @@ -3059,7 +3059,7 @@ func (x *ScheduledJob) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *ScheduledJob) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *CronJob) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3127,7 +3127,7 @@ func (x *ScheduledJob) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Spec = ScheduledJobSpec{} + x.Spec = CronJobSpec{} } else { yyv275 := &x.Spec yyv275.CodecDecodeSelf(d) @@ -3144,7 +3144,7 @@ func (x *ScheduledJob) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Status = ScheduledJobStatus{} + x.Status = CronJobStatus{} } else { yyv276 := &x.Status yyv276.CodecDecodeSelf(d) @@ -3165,7 +3165,7 @@ func (x *ScheduledJob) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ScheduledJobList) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *CronJobList) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -3286,7 +3286,7 @@ func (x *ScheduledJobList) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym291 if false { } else { - h.encSliceScheduledJob(([]ScheduledJob)(x.Items), e) + h.encSliceCronJob(([]CronJob)(x.Items), e) } } } else { @@ -3300,7 +3300,7 @@ func (x *ScheduledJobList) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym292 if false { } else { - h.encSliceScheduledJob(([]ScheduledJob)(x.Items), e) + h.encSliceCronJob(([]CronJob)(x.Items), e) } } } @@ -3313,7 +3313,7 @@ func (x *ScheduledJobList) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *ScheduledJobList) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *CronJobList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3343,7 +3343,7 @@ func (x *ScheduledJobList) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ScheduledJobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *CronJobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3399,7 +3399,7 @@ func (x *ScheduledJobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { _ = yym301 if false { } else { - h.decSliceScheduledJob((*[]ScheduledJob)(yyv300), d) + h.decSliceCronJob((*[]CronJob)(yyv300), d) } } default: @@ -3409,7 +3409,7 @@ func (x *ScheduledJobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *ScheduledJobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *CronJobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3490,7 +3490,7 @@ func (x *ScheduledJobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) _ = yym308 if false { } else { - h.decSliceScheduledJob((*[]ScheduledJob)(yyv307), d) + h.decSliceCronJob((*[]CronJob)(yyv307), d) } } for { @@ -3509,7 +3509,7 @@ func (x *ScheduledJobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ScheduledJobSpec) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *CronJobSpec) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -3666,7 +3666,7 @@ func (x *ScheduledJobSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *ScheduledJobSpec) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *CronJobSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3696,7 +3696,7 @@ func (x *ScheduledJobSpec) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ScheduledJobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *CronJobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3776,7 +3776,7 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3926,7 +3926,7 @@ func (x *ConcurrencyPolicy) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ScheduledJobStatus) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *CronJobStatus) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -4043,7 +4043,7 @@ func (x *ScheduledJobStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *ScheduledJobStatus) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *CronJobStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -4073,7 +4073,7 @@ func (x *ScheduledJobStatus) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ScheduledJobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *CronJobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -4135,7 +4135,7 @@ func (x *ScheduledJobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *ScheduledJobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *CronJobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -4443,7 +4443,7 @@ func (x codecSelfer1234) decSliceJobCondition(v *[]JobCondition, d *codec1978.De } } -func (x codecSelfer1234) encSliceScheduledJob(v []ScheduledJob, e *codec1978.Encoder) { +func (x codecSelfer1234) encSliceCronJob(v []CronJob, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -4456,7 +4456,7 @@ func (x codecSelfer1234) encSliceScheduledJob(v []ScheduledJob, e *codec1978.Enc z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.Decoder) { +func (x codecSelfer1234) decSliceCronJob(v *[]CronJob, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -4466,7 +4466,7 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De var yyc382 bool if yyl382 == 0 { if yyv382 == nil { - yyv382 = []ScheduledJob{} + yyv382 = []CronJob{} yyc382 = true } else if len(yyv382) != 0 { yyv382 = yyv382[:0] @@ -4484,10 +4484,10 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De if yyrl382 <= cap(yyv382) { yyv382 = yyv382[:yyrl382] } else { - yyv382 = make([]ScheduledJob, yyrl382) + yyv382 = make([]CronJob, yyrl382) } } else { - yyv382 = make([]ScheduledJob, yyrl382) + yyv382 = make([]CronJob, yyrl382) } yyc382 = true yyrr382 = len(yyv382) @@ -4502,7 +4502,7 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De for ; yyj382 < yyrr382; yyj382++ { yyh382.ElemContainerState(yyj382) if r.TryDecodeAsNil() { - yyv382[yyj382] = ScheduledJob{} + yyv382[yyj382] = CronJob{} } else { yyv383 := &yyv382[yyj382] yyv383.CodecDecodeSelf(d) @@ -4511,10 +4511,10 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De } if yyrt382 { for ; yyj382 < yyl382; yyj382++ { - yyv382 = append(yyv382, ScheduledJob{}) + yyv382 = append(yyv382, CronJob{}) yyh382.ElemContainerState(yyj382) if r.TryDecodeAsNil() { - yyv382[yyj382] = ScheduledJob{} + yyv382[yyj382] = CronJob{} } else { yyv384 := &yyv382[yyj382] yyv384.CodecDecodeSelf(d) @@ -4528,13 +4528,13 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De for ; !r.CheckBreak(); yyj382++ { if yyj382 >= len(yyv382) { - yyv382 = append(yyv382, ScheduledJob{}) // var yyz382 ScheduledJob + yyv382 = append(yyv382, CronJob{}) // var yyz382 CronJob yyc382 = true } yyh382.ElemContainerState(yyj382) if yyj382 < len(yyv382) { if r.TryDecodeAsNil() { - yyv382[yyj382] = ScheduledJob{} + yyv382[yyj382] = CronJob{} } else { yyv385 := &yyv382[yyj382] yyv385.CodecDecodeSelf(d) @@ -4549,7 +4549,7 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De yyv382 = yyv382[:yyj382] yyc382 = true } else if yyj382 == 0 && yyv382 == nil { - yyv382 = []ScheduledJob{} + yyv382 = []CronJob{} yyc382 = true } } diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/types.go b/staging/src/k8s.io/client-go/pkg/apis/batch/types.go index 3d3c82784ed..6015361a571 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/types.go @@ -190,8 +190,8 @@ type JobCondition struct { // +genclient=true -// ScheduledJob represents the configuration of a single scheduled job. -type ScheduledJob struct { +// CronJob represents the configuration of a single cron job. +type CronJob struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata @@ -201,28 +201,28 @@ type ScheduledJob struct { // Spec is a structure defining the expected behavior of a job, including the schedule. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // +optional - Spec ScheduledJobSpec `json:"spec,omitempty"` + Spec CronJobSpec `json:"spec,omitempty"` // Status is a structure describing current status of a job. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // +optional - Status ScheduledJobStatus `json:"status,omitempty"` + Status CronJobStatus `json:"status,omitempty"` } -// ScheduledJobList is a collection of scheduled jobs. -type ScheduledJobList struct { +// CronJobList is a collection of cron jobs. +type CronJobList struct { unversioned.TypeMeta `json:",inline"` // Standard list metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional unversioned.ListMeta `json:"metadata,omitempty"` - // Items is the list of ScheduledJob. - Items []ScheduledJob `json:"items"` + // Items is the list of CronJob. + Items []CronJob `json:"items"` } -// ScheduledJobSpec describes how the job execution will look like and when it will actually run. -type ScheduledJobSpec struct { +// CronJobSpec describes how the job execution will look like and when it will actually run. +type CronJobSpec struct { // Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. Schedule string `json:"schedule"` @@ -242,7 +242,7 @@ type ScheduledJobSpec struct { Suspend *bool `json:"suspend,omitempty"` // JobTemplate is the object that describes the job that will be created when - // executing a ScheduledJob. + // executing a CronJob. JobTemplate JobTemplateSpec `json:"jobTemplate"` } @@ -253,7 +253,7 @@ type ScheduledJobSpec struct { type ConcurrencyPolicy string const ( - // AllowConcurrent allows ScheduledJobs to run concurrently. + // AllowConcurrent allows CronJobs to run concurrently. AllowConcurrent ConcurrencyPolicy = "Allow" // ForbidConcurrent forbids concurrent runs, skipping next run if previous @@ -264,8 +264,8 @@ const ( ReplaceConcurrent ConcurrencyPolicy = "Replace" ) -// ScheduledJobStatus represents the current state of a Job. -type ScheduledJobStatus struct { +// CronJobStatus represents the current state of a cron job. +type CronJobStatus struct { // Active holds pointers to currently running jobs. // +optional Active []api.ObjectReference `json:"active,omitempty"` diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v1/register.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v1/register.go index b1e4a388492..543bce11ab3 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v1/register.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v1/register.go @@ -41,6 +41,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &JobList{}, &v1.ListOptions{}, &v1.DeleteOptions{}, + &v1.ExportOptions{}, ) versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v1/zz_generated.conversion.go index 06970269a82..4c3756ee1d0 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v1/zz_generated.conversion.go @@ -22,10 +22,12 @@ package v1 import ( api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" api_v1 "k8s.io/client-go/pkg/api/v1" batch "k8s.io/client-go/pkg/apis/batch" conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" ) func init() { @@ -154,11 +156,11 @@ func Convert_batch_JobList_To_v1_JobList(in *batch.JobList, out *JobList, s conv } func autoConvert_v1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s conversion.Scope) error { - out.Parallelism = in.Parallelism - out.Completions = in.Completions - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - out.Selector = in.Selector - out.ManualSelector = in.ManualSelector + out.Parallelism = (*int32)(unsafe.Pointer(in.Parallelism)) + out.Completions = (*int32)(unsafe.Pointer(in.Completions)) + out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) + out.ManualSelector = (*bool)(unsafe.Pointer(in.ManualSelector)) if err := api_v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } @@ -166,11 +168,11 @@ func autoConvert_v1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s } func autoConvert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *JobSpec, s conversion.Scope) error { - out.Parallelism = in.Parallelism - out.Completions = in.Completions - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - out.Selector = in.Selector - out.ManualSelector = in.ManualSelector + out.Parallelism = (*int32)(unsafe.Pointer(in.Parallelism)) + out.Completions = (*int32)(unsafe.Pointer(in.Completions)) + out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) + out.ManualSelector = (*bool)(unsafe.Pointer(in.ManualSelector)) if err := api_v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } @@ -178,19 +180,9 @@ func autoConvert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *JobSpec, s } func autoConvert_v1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]batch.JobCondition, len(*in)) - for i := range *in { - if err := Convert_v1_JobCondition_To_batch_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime + out.Conditions = *(*[]batch.JobCondition)(unsafe.Pointer(&in.Conditions)) + out.StartTime = (*unversioned.Time)(unsafe.Pointer(in.StartTime)) + out.CompletionTime = (*unversioned.Time)(unsafe.Pointer(in.CompletionTime)) out.Active = in.Active out.Succeeded = in.Succeeded out.Failed = in.Failed @@ -202,19 +194,9 @@ func Convert_v1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus } func autoConvert_batch_JobStatus_To_v1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]JobCondition, len(*in)) - for i := range *in { - if err := Convert_batch_JobCondition_To_v1_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime + out.Conditions = *(*[]JobCondition)(unsafe.Pointer(&in.Conditions)) + out.StartTime = (*unversioned.Time)(unsafe.Pointer(in.StartTime)) + out.CompletionTime = (*unversioned.Time)(unsafe.Pointer(in.CompletionTime)) out.Active = in.Active out.Succeeded = in.Succeeded out.Failed = in.Failed diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/conversion.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/conversion.go index 8878c8411ec..e9a88b1173e 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/conversion.go @@ -37,7 +37,7 @@ func addConversionFuncs(scheme *runtime.Scheme) error { } // Add field label conversions for kinds having selectable nothing but ObjectMeta fields. - for _, kind := range []string{"Job", "JobTemplate", "ScheduledJob"} { + for _, kind := range []string{"Job", "JobTemplate", "CronJob"} { err = api.Scheme.AddFieldLabelConversionFunc("batch/v2alpha1", kind, func(label, value string) (string, string, error) { switch label { diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/defaults.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/defaults.go index 787505ba933..d0c1d634c11 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/defaults.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/defaults.go @@ -24,7 +24,7 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error { RegisterDefaults(scheme) return scheme.AddDefaultingFuncs( SetDefaults_Job, - SetDefaults_ScheduledJob, + SetDefaults_CronJob, ) } @@ -47,7 +47,7 @@ func SetDefaults_Job(obj *Job) { } } -func SetDefaults_ScheduledJob(obj *ScheduledJob) { +func SetDefaults_CronJob(obj *CronJob) { if obj.Spec.ConcurrencyPolicy == "" { obj.Spec.ConcurrencyPolicy = AllowConcurrent } diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/generated.pb.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/generated.pb.go index 7ff22564e7c..29bd9214358 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/generated.pb.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/generated.pb.go @@ -25,6 +25,10 @@ limitations under the License. k8s.io/kubernetes/pkg/apis/batch/v2alpha1/generated.proto It has these top-level messages: + CronJob + CronJobList + CronJobSpec + CronJobStatus Job JobCondition JobList @@ -32,10 +36,6 @@ limitations under the License. JobStatus JobTemplate JobTemplateSpec - ScheduledJob - ScheduledJobList - ScheduledJobSpec - ScheduledJobStatus */ package v2alpha1 @@ -60,51 +60,55 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. const _ = proto.GoGoProtoPackageIsVersion1 +func (m *CronJob) Reset() { *m = CronJob{} } +func (*CronJob) ProtoMessage() {} +func (*CronJob) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } + +func (m *CronJobList) Reset() { *m = CronJobList{} } +func (*CronJobList) ProtoMessage() {} +func (*CronJobList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } + +func (m *CronJobSpec) Reset() { *m = CronJobSpec{} } +func (*CronJobSpec) ProtoMessage() {} +func (*CronJobSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } + +func (m *CronJobStatus) Reset() { *m = CronJobStatus{} } +func (*CronJobStatus) ProtoMessage() {} +func (*CronJobStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } + func (m *Job) Reset() { *m = Job{} } func (*Job) ProtoMessage() {} -func (*Job) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } +func (*Job) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} } func (m *JobCondition) Reset() { *m = JobCondition{} } func (*JobCondition) ProtoMessage() {} -func (*JobCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } +func (*JobCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} } func (m *JobList) Reset() { *m = JobList{} } func (*JobList) ProtoMessage() {} -func (*JobList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } +func (*JobList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} } func (m *JobSpec) Reset() { *m = JobSpec{} } func (*JobSpec) ProtoMessage() {} -func (*JobSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } +func (*JobSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} } func (m *JobStatus) Reset() { *m = JobStatus{} } func (*JobStatus) ProtoMessage() {} -func (*JobStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} } +func (*JobStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} } func (m *JobTemplate) Reset() { *m = JobTemplate{} } func (*JobTemplate) ProtoMessage() {} -func (*JobTemplate) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} } +func (*JobTemplate) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{9} } func (m *JobTemplateSpec) Reset() { *m = JobTemplateSpec{} } func (*JobTemplateSpec) ProtoMessage() {} -func (*JobTemplateSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} } - -func (m *ScheduledJob) Reset() { *m = ScheduledJob{} } -func (*ScheduledJob) ProtoMessage() {} -func (*ScheduledJob) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} } - -func (m *ScheduledJobList) Reset() { *m = ScheduledJobList{} } -func (*ScheduledJobList) ProtoMessage() {} -func (*ScheduledJobList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{8} } - -func (m *ScheduledJobSpec) Reset() { *m = ScheduledJobSpec{} } -func (*ScheduledJobSpec) ProtoMessage() {} -func (*ScheduledJobSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{9} } - -func (m *ScheduledJobStatus) Reset() { *m = ScheduledJobStatus{} } -func (*ScheduledJobStatus) ProtoMessage() {} -func (*ScheduledJobStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{10} } +func (*JobTemplateSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{10} } func init() { + proto.RegisterType((*CronJob)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.CronJob") + proto.RegisterType((*CronJobList)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.CronJobList") + proto.RegisterType((*CronJobSpec)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.CronJobSpec") + proto.RegisterType((*CronJobStatus)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.CronJobStatus") proto.RegisterType((*Job)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.Job") proto.RegisterType((*JobCondition)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.JobCondition") proto.RegisterType((*JobList)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.JobList") @@ -112,12 +116,8 @@ func init() { proto.RegisterType((*JobStatus)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.JobStatus") proto.RegisterType((*JobTemplate)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.JobTemplate") proto.RegisterType((*JobTemplateSpec)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.JobTemplateSpec") - proto.RegisterType((*ScheduledJob)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.ScheduledJob") - proto.RegisterType((*ScheduledJobList)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.ScheduledJobList") - proto.RegisterType((*ScheduledJobSpec)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.ScheduledJobSpec") - proto.RegisterType((*ScheduledJobStatus)(nil), "k8s.io.client-go.pkg.apis.batch.v2alpha1.ScheduledJobStatus") } -func (m *Job) Marshal() (data []byte, err error) { +func (m *CronJob) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -127,7 +127,7 @@ func (m *Job) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Job) MarshalTo(data []byte) (int, error) { +func (m *CronJob) MarshalTo(data []byte) (int, error) { var i int _ = i var l int @@ -159,6 +159,175 @@ func (m *Job) MarshalTo(data []byte) (int, error) { return i, nil } +func (m *CronJobList) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *CronJobList) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + data[i] = 0xa + i++ + i = encodeVarintGenerated(data, i, uint64(m.ListMeta.Size())) + n4, err := m.ListMeta.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n4 + if len(m.Items) > 0 { + for _, msg := range m.Items { + data[i] = 0x12 + i++ + i = encodeVarintGenerated(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *CronJobSpec) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *CronJobSpec) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + data[i] = 0xa + i++ + i = encodeVarintGenerated(data, i, uint64(len(m.Schedule))) + i += copy(data[i:], m.Schedule) + if m.StartingDeadlineSeconds != nil { + data[i] = 0x10 + i++ + i = encodeVarintGenerated(data, i, uint64(*m.StartingDeadlineSeconds)) + } + data[i] = 0x1a + i++ + i = encodeVarintGenerated(data, i, uint64(len(m.ConcurrencyPolicy))) + i += copy(data[i:], m.ConcurrencyPolicy) + if m.Suspend != nil { + data[i] = 0x20 + i++ + if *m.Suspend { + data[i] = 1 + } else { + data[i] = 0 + } + i++ + } + data[i] = 0x2a + i++ + i = encodeVarintGenerated(data, i, uint64(m.JobTemplate.Size())) + n5, err := m.JobTemplate.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n5 + return i, nil +} + +func (m *CronJobStatus) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *CronJobStatus) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Active) > 0 { + for _, msg := range m.Active { + data[i] = 0xa + i++ + i = encodeVarintGenerated(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.LastScheduleTime != nil { + data[i] = 0x22 + i++ + i = encodeVarintGenerated(data, i, uint64(m.LastScheduleTime.Size())) + n6, err := m.LastScheduleTime.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n6 + } + return i, nil +} + +func (m *Job) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err + } + return data[:n], nil +} + +func (m *Job) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + data[i] = 0xa + i++ + i = encodeVarintGenerated(data, i, uint64(m.ObjectMeta.Size())) + n7, err := m.ObjectMeta.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n7 + data[i] = 0x12 + i++ + i = encodeVarintGenerated(data, i, uint64(m.Spec.Size())) + n8, err := m.Spec.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n8 + data[i] = 0x1a + i++ + i = encodeVarintGenerated(data, i, uint64(m.Status.Size())) + n9, err := m.Status.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n9 + return i, nil +} + func (m *JobCondition) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) @@ -185,19 +354,19 @@ func (m *JobCondition) MarshalTo(data []byte) (int, error) { data[i] = 0x1a i++ i = encodeVarintGenerated(data, i, uint64(m.LastProbeTime.Size())) - n4, err := m.LastProbeTime.MarshalTo(data[i:]) + n10, err := m.LastProbeTime.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n4 + i += n10 data[i] = 0x22 i++ i = encodeVarintGenerated(data, i, uint64(m.LastTransitionTime.Size())) - n5, err := m.LastTransitionTime.MarshalTo(data[i:]) + n11, err := m.LastTransitionTime.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n5 + i += n11 data[i] = 0x2a i++ i = encodeVarintGenerated(data, i, uint64(len(m.Reason))) @@ -227,11 +396,11 @@ func (m *JobList) MarshalTo(data []byte) (int, error) { data[i] = 0xa i++ i = encodeVarintGenerated(data, i, uint64(m.ListMeta.Size())) - n6, err := m.ListMeta.MarshalTo(data[i:]) + n12, err := m.ListMeta.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n6 + i += n12 if len(m.Items) > 0 { for _, msg := range m.Items { data[i] = 0x12 @@ -281,11 +450,11 @@ func (m *JobSpec) MarshalTo(data []byte) (int, error) { data[i] = 0x22 i++ i = encodeVarintGenerated(data, i, uint64(m.Selector.Size())) - n7, err := m.Selector.MarshalTo(data[i:]) + n13, err := m.Selector.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n7 + i += n13 } if m.ManualSelector != nil { data[i] = 0x28 @@ -300,11 +469,11 @@ func (m *JobSpec) MarshalTo(data []byte) (int, error) { data[i] = 0x32 i++ i = encodeVarintGenerated(data, i, uint64(m.Template.Size())) - n8, err := m.Template.MarshalTo(data[i:]) + n14, err := m.Template.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n8 + i += n14 return i, nil } @@ -339,21 +508,21 @@ func (m *JobStatus) MarshalTo(data []byte) (int, error) { data[i] = 0x12 i++ i = encodeVarintGenerated(data, i, uint64(m.StartTime.Size())) - n9, err := m.StartTime.MarshalTo(data[i:]) + n15, err := m.StartTime.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n9 + i += n15 } if m.CompletionTime != nil { data[i] = 0x1a i++ i = encodeVarintGenerated(data, i, uint64(m.CompletionTime.Size())) - n10, err := m.CompletionTime.MarshalTo(data[i:]) + n16, err := m.CompletionTime.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n10 + i += n16 } data[i] = 0x20 i++ @@ -385,19 +554,19 @@ func (m *JobTemplate) MarshalTo(data []byte) (int, error) { data[i] = 0xa i++ i = encodeVarintGenerated(data, i, uint64(m.ObjectMeta.Size())) - n11, err := m.ObjectMeta.MarshalTo(data[i:]) + n17, err := m.ObjectMeta.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n11 + i += n17 data[i] = 0x12 i++ i = encodeVarintGenerated(data, i, uint64(m.Template.Size())) - n12, err := m.Template.MarshalTo(data[i:]) + n18, err := m.Template.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n12 + i += n18 return i, nil } @@ -419,188 +588,19 @@ func (m *JobTemplateSpec) MarshalTo(data []byte) (int, error) { data[i] = 0xa i++ i = encodeVarintGenerated(data, i, uint64(m.ObjectMeta.Size())) - n13, err := m.ObjectMeta.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n13 - data[i] = 0x12 - i++ - i = encodeVarintGenerated(data, i, uint64(m.Spec.Size())) - n14, err := m.Spec.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n14 - return i, nil -} - -func (m *ScheduledJob) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ScheduledJob) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - data[i] = 0xa - i++ - i = encodeVarintGenerated(data, i, uint64(m.ObjectMeta.Size())) - n15, err := m.ObjectMeta.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n15 - data[i] = 0x12 - i++ - i = encodeVarintGenerated(data, i, uint64(m.Spec.Size())) - n16, err := m.Spec.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n16 - data[i] = 0x1a - i++ - i = encodeVarintGenerated(data, i, uint64(m.Status.Size())) - n17, err := m.Status.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n17 - return i, nil -} - -func (m *ScheduledJobList) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ScheduledJobList) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - data[i] = 0xa - i++ - i = encodeVarintGenerated(data, i, uint64(m.ListMeta.Size())) - n18, err := m.ListMeta.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n18 - if len(m.Items) > 0 { - for _, msg := range m.Items { - data[i] = 0x12 - i++ - i = encodeVarintGenerated(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *ScheduledJobSpec) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ScheduledJobSpec) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - data[i] = 0xa - i++ - i = encodeVarintGenerated(data, i, uint64(len(m.Schedule))) - i += copy(data[i:], m.Schedule) - if m.StartingDeadlineSeconds != nil { - data[i] = 0x10 - i++ - i = encodeVarintGenerated(data, i, uint64(*m.StartingDeadlineSeconds)) - } - data[i] = 0x1a - i++ - i = encodeVarintGenerated(data, i, uint64(len(m.ConcurrencyPolicy))) - i += copy(data[i:], m.ConcurrencyPolicy) - if m.Suspend != nil { - data[i] = 0x20 - i++ - if *m.Suspend { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - data[i] = 0x2a - i++ - i = encodeVarintGenerated(data, i, uint64(m.JobTemplate.Size())) - n19, err := m.JobTemplate.MarshalTo(data[i:]) + n19, err := m.ObjectMeta.MarshalTo(data[i:]) if err != nil { return 0, err } i += n19 - return i, nil -} - -func (m *ScheduledJobStatus) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) + data[i] = 0x12 + i++ + i = encodeVarintGenerated(data, i, uint64(m.Spec.Size())) + n20, err := m.Spec.MarshalTo(data[i:]) if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ScheduledJobStatus) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Active) > 0 { - for _, msg := range m.Active { - data[i] = 0xa - i++ - i = encodeVarintGenerated(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.LastScheduleTime != nil { - data[i] = 0x22 - i++ - i = encodeVarintGenerated(data, i, uint64(m.LastScheduleTime.Size())) - n20, err := m.LastScheduleTime.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n20 + return 0, err } + i += n20 return i, nil } @@ -631,6 +631,66 @@ func encodeVarintGenerated(data []byte, offset int, v uint64) int { data[offset] = uint8(v) return offset + 1 } +func (m *CronJob) Size() (n int) { + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *CronJobList) Size() (n int) { + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *CronJobSpec) Size() (n int) { + var l int + _ = l + l = len(m.Schedule) + n += 1 + l + sovGenerated(uint64(l)) + if m.StartingDeadlineSeconds != nil { + n += 1 + sovGenerated(uint64(*m.StartingDeadlineSeconds)) + } + l = len(m.ConcurrencyPolicy) + n += 1 + l + sovGenerated(uint64(l)) + if m.Suspend != nil { + n += 2 + } + l = m.JobTemplate.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *CronJobStatus) Size() (n int) { + var l int + _ = l + if len(m.Active) > 0 { + for _, e := range m.Active { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.LastScheduleTime != nil { + l = m.LastScheduleTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *Job) Size() (n int) { var l int _ = l @@ -742,66 +802,6 @@ func (m *JobTemplateSpec) Size() (n int) { return n } -func (m *ScheduledJob) Size() (n int) { - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ScheduledJobList) Size() (n int) { - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *ScheduledJobSpec) Size() (n int) { - var l int - _ = l - l = len(m.Schedule) - n += 1 + l + sovGenerated(uint64(l)) - if m.StartingDeadlineSeconds != nil { - n += 1 + sovGenerated(uint64(*m.StartingDeadlineSeconds)) - } - l = len(m.ConcurrencyPolicy) - n += 1 + l + sovGenerated(uint64(l)) - if m.Suspend != nil { - n += 2 - } - l = m.JobTemplate.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ScheduledJobStatus) Size() (n int) { - var l int - _ = l - if len(m.Active) > 0 { - for _, e := range m.Active { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if m.LastScheduleTime != nil { - l = m.LastScheduleTime.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - func sovGenerated(x uint64) (n int) { for { n++ @@ -815,6 +815,54 @@ func sovGenerated(x uint64) (n int) { func sozGenerated(x uint64) (n int) { return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (this *CronJob) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CronJob{`, + `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_kubernetes_pkg_api_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "CronJobSpec", "CronJobSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "CronJobStatus", "CronJobStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *CronJobList) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CronJobList{`, + `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_kubernetes_pkg_api_unversioned.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "CronJob", "CronJob", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *CronJobSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CronJobSpec{`, + `Schedule:` + fmt.Sprintf("%v", this.Schedule) + `,`, + `StartingDeadlineSeconds:` + valueToStringGenerated(this.StartingDeadlineSeconds) + `,`, + `ConcurrencyPolicy:` + fmt.Sprintf("%v", this.ConcurrencyPolicy) + `,`, + `Suspend:` + valueToStringGenerated(this.Suspend) + `,`, + `JobTemplate:` + strings.Replace(strings.Replace(this.JobTemplate.String(), "JobTemplateSpec", "JobTemplateSpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *CronJobStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CronJobStatus{`, + `Active:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Active), "ObjectReference", "k8s_io_kubernetes_pkg_api_v1.ObjectReference", 1), `&`, ``, 1) + `,`, + `LastScheduleTime:` + strings.Replace(fmt.Sprintf("%v", this.LastScheduleTime), "Time", "k8s_io_kubernetes_pkg_api_unversioned.Time", 1) + `,`, + `}`, + }, "") + return s +} func (this *Job) String() string { if this == nil { return "nil" @@ -905,54 +953,6 @@ func (this *JobTemplateSpec) String() string { }, "") return s } -func (this *ScheduledJob) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ScheduledJob{`, - `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_kubernetes_pkg_api_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ScheduledJobSpec", "ScheduledJobSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ScheduledJobStatus", "ScheduledJobStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ScheduledJobList) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ScheduledJobList{`, - `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_kubernetes_pkg_api_unversioned.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "ScheduledJob", "ScheduledJob", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ScheduledJobSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ScheduledJobSpec{`, - `Schedule:` + fmt.Sprintf("%v", this.Schedule) + `,`, - `StartingDeadlineSeconds:` + valueToStringGenerated(this.StartingDeadlineSeconds) + `,`, - `ConcurrencyPolicy:` + fmt.Sprintf("%v", this.ConcurrencyPolicy) + `,`, - `Suspend:` + valueToStringGenerated(this.Suspend) + `,`, - `JobTemplate:` + strings.Replace(strings.Replace(this.JobTemplate.String(), "JobTemplateSpec", "JobTemplateSpec", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ScheduledJobStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ScheduledJobStatus{`, - `Active:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Active), "ObjectReference", "k8s_io_kubernetes_pkg_api_v1.ObjectReference", 1), `&`, ``, 1) + `,`, - `LastScheduleTime:` + strings.Replace(fmt.Sprintf("%v", this.LastScheduleTime), "Time", "k8s_io_kubernetes_pkg_api_unversioned.Time", 1) + `,`, - `}`, - }, "") - return s -} func valueToStringGenerated(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -961,6 +961,550 @@ func valueToStringGenerated(v interface{}) string { pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } +func (m *CronJob) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CronJob: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CronJob: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CronJobList) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CronJobList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CronJobList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, CronJob{}) + if err := m.Items[len(m.Items)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CronJobSpec) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CronJobSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CronJobSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schedule", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Schedule = string(data[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartingDeadlineSeconds", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.StartingDeadlineSeconds = &v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConcurrencyPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConcurrencyPolicy = ConcurrencyPolicy(data[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Suspend", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Suspend = &b + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field JobTemplate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.JobTemplate.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CronJobStatus) Unmarshal(data []byte) error { + l := len(data) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CronJobStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CronJobStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Active", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Active = append(m.Active, k8s_io_kubernetes_pkg_api_v1.ObjectReference{}) + if err := m.Active[len(m.Active)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastScheduleTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastScheduleTime == nil { + m.LastScheduleTime = &k8s_io_kubernetes_pkg_api_unversioned.Time{} + } + if err := m.LastScheduleTime.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Job) Unmarshal(data []byte) error { l := len(data) iNdEx := 0 @@ -2056,550 +2600,6 @@ func (m *JobTemplateSpec) Unmarshal(data []byte) error { } return nil } -func (m *ScheduledJob) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ScheduledJob: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ScheduledJob: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Status.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ScheduledJobList) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ScheduledJobList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ScheduledJobList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ListMeta.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, ScheduledJob{}) - if err := m.Items[len(m.Items)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ScheduledJobSpec) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ScheduledJobSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ScheduledJobSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Schedule", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Schedule = string(data[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartingDeadlineSeconds", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.StartingDeadlineSeconds = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConcurrencyPolicy", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConcurrencyPolicy = ConcurrencyPolicy(data[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Suspend", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Suspend = &b - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JobTemplate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.JobTemplate.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ScheduledJobStatus) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ScheduledJobStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ScheduledJobStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Active", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Active = append(m.Active, k8s_io_kubernetes_pkg_api_v1.ObjectReference{}) - if err := m.Active[len(m.Active)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastScheduleTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LastScheduleTime == nil { - m.LastScheduleTime = &k8s_io_kubernetes_pkg_api_unversioned.Time{} - } - if err := m.LastScheduleTime.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipGenerated(data []byte) (n int, err error) { l := len(data) iNdEx := 0 @@ -2706,77 +2706,77 @@ var ( ) var fileDescriptorGenerated = []byte{ - // 1139 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xd4, 0x56, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0xae, 0x93, 0xa6, 0x4d, 0x26, 0x6d, 0xb7, 0x1d, 0xa8, 0x36, 0x14, 0x29, 0x59, 0x45, 0x02, - 0x75, 0x61, 0x6b, 0xab, 0x51, 0xd1, 0xc2, 0x22, 0x90, 0x70, 0x11, 0x12, 0x55, 0xab, 0xad, 0x26, - 0x5d, 0xb4, 0x82, 0x2e, 0xd2, 0xd8, 0x7e, 0x4d, 0xbc, 0x75, 0x3c, 0xc6, 0x33, 0x2e, 0xea, 0x8d, - 0xff, 0x00, 0x24, 0xfe, 0x0f, 0xee, 0x48, 0x70, 0xe0, 0xd6, 0x1b, 0x0b, 0x27, 0xc4, 0x21, 0xa2, - 0xe6, 0xbf, 0xe8, 0x09, 0x79, 0xfc, 0x23, 0xce, 0xaf, 0xaa, 0x29, 0x5a, 0x24, 0x6e, 0xf6, 0x9b, - 0xef, 0xfb, 0xe6, 0xcd, 0xbc, 0x6f, 0xde, 0x0c, 0x7a, 0xef, 0xf4, 0x5d, 0xae, 0xda, 0x4c, 0x3b, - 0x0d, 0x0c, 0xf0, 0x5d, 0x10, 0xc0, 0x35, 0xef, 0xb4, 0xa3, 0x51, 0xcf, 0xe6, 0x9a, 0x41, 0x85, - 0xd9, 0xd5, 0xce, 0x5a, 0xd4, 0xf1, 0xba, 0x74, 0x5b, 0xeb, 0x80, 0x0b, 0x3e, 0x15, 0x60, 0xa9, - 0x9e, 0xcf, 0x04, 0xc3, 0xf7, 0x63, 0xaa, 0x3a, 0xa0, 0xaa, 0xde, 0x69, 0x47, 0x8d, 0xa8, 0xaa, - 0xa4, 0xaa, 0x29, 0x75, 0x63, 0xab, 0x63, 0x8b, 0x6e, 0x60, 0xa8, 0x26, 0xeb, 0x69, 0x1d, 0xd6, - 0x61, 0x9a, 0x54, 0x30, 0x82, 0x13, 0xf9, 0x27, 0x7f, 0xe4, 0x57, 0xac, 0xbc, 0xd1, 0x9a, 0x9a, - 0x94, 0xe6, 0x03, 0x67, 0x81, 0x6f, 0xc2, 0x68, 0x36, 0x1b, 0xef, 0x4c, 0xe7, 0x04, 0xee, 0x19, - 0xf8, 0xdc, 0x66, 0x2e, 0x58, 0x63, 0xb4, 0x07, 0xd3, 0x69, 0x67, 0x63, 0x4b, 0xde, 0xd8, 0x9a, - 0x8c, 0xf6, 0x03, 0x57, 0xd8, 0xbd, 0xf1, 0x9c, 0xb6, 0x27, 0xc3, 0x03, 0x61, 0x3b, 0x9a, 0xed, - 0x0a, 0x2e, 0xfc, 0x51, 0x4a, 0xf3, 0xfb, 0x02, 0x2a, 0xee, 0x31, 0x03, 0x3f, 0x45, 0xe5, 0x1e, - 0x08, 0x6a, 0x51, 0x41, 0x6b, 0xca, 0x3d, 0x65, 0xb3, 0xda, 0xda, 0x54, 0xa7, 0xee, 0xb7, 0x7a, - 0xb6, 0xad, 0x3e, 0x36, 0x9e, 0x83, 0x29, 0x0e, 0x40, 0x50, 0x1d, 0x5f, 0xf4, 0x1b, 0x73, 0x61, - 0xbf, 0x81, 0x06, 0x31, 0x92, 0xa9, 0xe1, 0x23, 0x34, 0xcf, 0x3d, 0x30, 0x6b, 0x05, 0xa9, 0xda, - 0x52, 0x6f, 0x5c, 0x45, 0x75, 0x8f, 0x19, 0x6d, 0x0f, 0x4c, 0x7d, 0x29, 0xd1, 0x9f, 0x8f, 0xfe, - 0x88, 0x54, 0xc3, 0xc7, 0x68, 0x81, 0x0b, 0x2a, 0x02, 0x5e, 0x2b, 0x4a, 0xdd, 0x9d, 0x19, 0x75, - 0x25, 0x57, 0x5f, 0x49, 0x94, 0x17, 0xe2, 0x7f, 0x92, 0x68, 0x36, 0x7f, 0x2f, 0xa2, 0xa5, 0x3d, - 0x66, 0xec, 0x32, 0xd7, 0xb2, 0x85, 0xcd, 0x5c, 0xbc, 0x83, 0xe6, 0xc5, 0xb9, 0x07, 0x72, 0x6b, - 0x2a, 0xfa, 0xbd, 0x34, 0xa1, 0xa3, 0x73, 0x0f, 0xae, 0xfa, 0x8d, 0xd5, 0x3c, 0x36, 0x8a, 0x11, - 0x89, 0xc6, 0x9f, 0x65, 0x49, 0x16, 0x24, 0xef, 0xc3, 0xe1, 0xe9, 0xae, 0xfa, 0x8d, 0x6b, 0xed, - 0xa0, 0x66, 0x9a, 0xc3, 0xe9, 0xe1, 0x2e, 0x5a, 0x76, 0x28, 0x17, 0x87, 0x3e, 0x33, 0xe0, 0xc8, - 0xee, 0x41, 0xb2, 0x07, 0x6f, 0x5f, 0x53, 0xb1, 0x9c, 0x27, 0xd5, 0x88, 0xa2, 0xaf, 0x27, 0xb9, - 0x2c, 0xef, 0xe7, 0x95, 0xc8, 0xb0, 0x30, 0xfe, 0x1a, 0xe1, 0x28, 0x70, 0xe4, 0x53, 0x97, 0xc7, - 0xab, 0x8b, 0xa6, 0x9b, 0x9f, 0x7d, 0xba, 0x8d, 0x64, 0x3a, 0xbc, 0x3f, 0x26, 0x47, 0x26, 0x4c, - 0x81, 0xdf, 0x44, 0x0b, 0x3e, 0x50, 0xce, 0xdc, 0x5a, 0x49, 0x6e, 0x5d, 0x56, 0x29, 0x22, 0xa3, - 0x24, 0x19, 0xc5, 0xf7, 0xd1, 0x62, 0x0f, 0x38, 0xa7, 0x1d, 0xa8, 0x2d, 0x48, 0xe0, 0x9d, 0x04, - 0xb8, 0x78, 0x10, 0x87, 0x49, 0x3a, 0xde, 0xfc, 0x59, 0x41, 0x8b, 0x7b, 0xcc, 0xd8, 0xb7, 0xb9, - 0xc0, 0xcf, 0xc6, 0xec, 0xae, 0xdd, 0x70, 0x35, 0x11, 0x5d, 0xba, 0x7e, 0x35, 0x99, 0xa8, 0x9c, - 0x46, 0x72, 0x9e, 0x6f, 0xa3, 0x92, 0x2d, 0xa0, 0x17, 0xd5, 0xbd, 0xb8, 0x59, 0x6d, 0xa9, 0xb3, - 0x99, 0x53, 0x5f, 0x4e, 0xa4, 0x4b, 0x9f, 0x46, 0x22, 0x24, 0xd6, 0x6a, 0xfe, 0x58, 0x94, 0xf9, - 0x47, 0x87, 0x00, 0x6f, 0xa3, 0xaa, 0x47, 0x7d, 0xea, 0x38, 0xe0, 0xd8, 0xbc, 0x27, 0x97, 0x50, - 0xd2, 0xef, 0x84, 0xfd, 0x46, 0xf5, 0x70, 0x10, 0x26, 0x79, 0x4c, 0x44, 0x31, 0x59, 0xcf, 0x73, - 0x20, 0xda, 0xe3, 0xd8, 0x91, 0x09, 0x65, 0x77, 0x10, 0x26, 0x79, 0x0c, 0x7e, 0x8c, 0xd6, 0xa9, - 0x29, 0xec, 0x33, 0xf8, 0x18, 0xa8, 0xe5, 0xd8, 0x2e, 0xb4, 0xc1, 0x64, 0xae, 0x15, 0x9f, 0xb9, - 0xa2, 0xfe, 0x5a, 0xd8, 0x6f, 0xac, 0x7f, 0x34, 0x09, 0x40, 0x26, 0xf3, 0xf0, 0x97, 0xa8, 0xcc, - 0xc1, 0x01, 0x53, 0x30, 0x3f, 0x31, 0xd1, 0xce, 0x4d, 0xb7, 0x9d, 0x1a, 0xe0, 0xb4, 0x13, 0xae, - 0xbe, 0x14, 0xed, 0x7b, 0xfa, 0x47, 0x32, 0x4d, 0xfc, 0x08, 0xad, 0xf4, 0xa8, 0x1b, 0xd0, 0x0c, - 0x29, 0xdd, 0x53, 0xd6, 0x71, 0xd8, 0x6f, 0xac, 0x1c, 0x0c, 0x8d, 0x90, 0x11, 0x24, 0xfe, 0x02, - 0x95, 0x05, 0xf4, 0x3c, 0x87, 0x8a, 0xd8, 0x4a, 0xd5, 0xd6, 0xd6, 0xf5, 0x1d, 0xf0, 0x90, 0x59, - 0x47, 0x09, 0x41, 0xb6, 0xa9, 0xcc, 0x10, 0x69, 0x94, 0x64, 0x82, 0xcd, 0x9f, 0x8a, 0xa8, 0x92, - 0xb5, 0x1d, 0x7c, 0x8a, 0x90, 0x99, 0x1e, 0x6d, 0x5e, 0x53, 0xa4, 0x47, 0x1e, 0xce, 0xe6, 0x91, - 0xac, 0x35, 0x0c, 0xba, 0x6f, 0x16, 0xe2, 0x24, 0x27, 0x8f, 0x9f, 0xa2, 0x0a, 0x17, 0xd4, 0x17, - 0xf2, 0xe4, 0x16, 0x66, 0x3f, 0xb9, 0xcb, 0x61, 0xbf, 0x51, 0x69, 0xa7, 0x0a, 0x64, 0x20, 0x86, - 0x3b, 0x68, 0x65, 0xe0, 0x96, 0xdb, 0xf6, 0x21, 0x59, 0x9a, 0xdd, 0x21, 0x19, 0x32, 0x22, 0x1b, - 0x35, 0x83, 0xd8, 0x4f, 0xd2, 0x34, 0xa5, 0x41, 0x33, 0x88, 0xcd, 0x47, 0x92, 0x51, 0xac, 0xa1, - 0x0a, 0x0f, 0x4c, 0x13, 0xc0, 0x02, 0x4b, 0x56, 0xbe, 0xa4, 0xaf, 0x25, 0xd0, 0x4a, 0x3b, 0x1d, - 0x20, 0x03, 0x4c, 0x24, 0x7c, 0x42, 0x6d, 0x07, 0x2c, 0x59, 0xf1, 0x9c, 0xf0, 0x27, 0x32, 0x4a, - 0x92, 0xd1, 0xe6, 0x6f, 0x0a, 0xaa, 0xee, 0x31, 0x23, 0x2d, 0xec, 0x4b, 0xbc, 0x2d, 0xbb, 0x39, - 0x17, 0xc6, 0xc5, 0x7a, 0x34, 0x9b, 0x31, 0x6e, 0x6c, 0xc9, 0x5f, 0x14, 0x74, 0x67, 0x04, 0xff, - 0x7f, 0x7b, 0x05, 0x34, 0x7f, 0x28, 0xa0, 0xa5, 0xb6, 0xd9, 0x05, 0x2b, 0x70, 0xc0, 0x7a, 0xb9, - 0xcf, 0x98, 0x67, 0x43, 0x0b, 0x78, 0x7f, 0x86, 0x05, 0xe4, 0x13, 0x9c, 0xfa, 0x9e, 0x81, 0x91, - 0xf7, 0xcc, 0x07, 0xb7, 0x9d, 0xe0, 0xfa, 0x87, 0xcd, 0xaf, 0x0a, 0x5a, 0xcd, 0xc3, 0xff, 0x8b, - 0xcb, 0xf0, 0x78, 0xf8, 0x32, 0x7c, 0x78, 0xcb, 0x95, 0x4d, 0xb9, 0x15, 0xbf, 0x2d, 0x0e, 0xaf, - 0x48, 0xfa, 0xf8, 0x01, 0x2a, 0xf3, 0x24, 0x96, 0x3c, 0xd9, 0xb2, 0x04, 0x53, 0x2c, 0xc9, 0x10, - 0xf8, 0x09, 0xba, 0x2b, 0x9b, 0x9a, 0xed, 0x76, 0x46, 0x2f, 0xba, 0x82, 0xbc, 0xe8, 0x5e, 0x0f, - 0xfb, 0x8d, 0xbb, 0xed, 0xc9, 0x10, 0x32, 0x8d, 0x8b, 0x8f, 0xd1, 0x9a, 0xc9, 0x5c, 0x33, 0xf0, - 0x7d, 0x70, 0xcd, 0xf3, 0x43, 0xe6, 0xd8, 0xe6, 0xb9, 0xac, 0x6e, 0x45, 0x57, 0x93, 0x6c, 0xd6, - 0x76, 0x47, 0x01, 0x57, 0x93, 0x82, 0x64, 0x5c, 0x08, 0xbf, 0x81, 0x16, 0x79, 0xc0, 0x3d, 0x70, - 0x2d, 0xd9, 0x14, 0xcb, 0x7a, 0x35, 0x7a, 0xf4, 0xb4, 0xe3, 0x10, 0x49, 0xc7, 0xf0, 0x57, 0xa8, - 0xfa, 0x7c, 0x70, 0xc8, 0x65, 0x53, 0xfc, 0x77, 0x2d, 0xe5, 0x95, 0x24, 0xf5, 0x7c, 0x3f, 0x24, - 0xf9, 0x39, 0x9a, 0x7f, 0x2a, 0x08, 0x8f, 0x5b, 0x12, 0x3f, 0xc9, 0x9a, 0x78, 0x7c, 0xe1, 0x6d, - 0xdd, 0xe4, 0x60, 0x12, 0x38, 0x81, 0x68, 0xd5, 0x30, 0xb5, 0xe7, 0xf7, 0xd0, 0x6a, 0xf4, 0x7c, - 0x4c, 0x27, 0xbc, 0xed, 0xfb, 0xf4, 0xd5, 0xb0, 0xdf, 0x58, 0xdd, 0x1f, 0x11, 0x22, 0x63, 0xd2, - 0xfa, 0x5b, 0x17, 0x97, 0xf5, 0xb9, 0x17, 0x97, 0xf5, 0xb9, 0x3f, 0x2e, 0xeb, 0x73, 0xdf, 0x84, - 0x75, 0xe5, 0x22, 0xac, 0x2b, 0x2f, 0xc2, 0xba, 0xf2, 0x57, 0x58, 0x57, 0xbe, 0xfb, 0xbb, 0x3e, - 0xf7, 0x79, 0x39, 0xdd, 0xba, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x80, 0x6a, 0xa7, 0x35, 0xec, - 0x0e, 0x00, 0x00, + // 1141 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xd4, 0x56, 0x4b, 0x6f, 0xe4, 0x44, + 0x10, 0x8e, 0x67, 0x92, 0x79, 0xf4, 0x6c, 0x5e, 0x0d, 0xd1, 0x0e, 0x41, 0x9a, 0x89, 0x46, 0x02, + 0x65, 0x61, 0x63, 0x2b, 0xa3, 0x00, 0xcb, 0x1e, 0x90, 0xd6, 0x41, 0x48, 0x44, 0x89, 0x36, 0xea, + 0xc9, 0x42, 0x04, 0x0b, 0xa2, 0xc7, 0xee, 0xcc, 0x78, 0x63, 0xbb, 0x8d, 0xbb, 0x1d, 0x94, 0x1b, + 0x67, 0x4e, 0x48, 0xfc, 0x00, 0x7e, 0x07, 0x12, 0x1c, 0x38, 0x20, 0xe5, 0xb8, 0x20, 0x21, 0x71, + 0x1a, 0x11, 0xf3, 0x2f, 0x72, 0x42, 0x6e, 0xb7, 0x1f, 0xf3, 0x0a, 0x99, 0xa0, 0x45, 0xe2, 0xe6, + 0xae, 0xae, 0xef, 0xeb, 0xea, 0xaa, 0xaf, 0xab, 0x0c, 0xde, 0x3d, 0x7d, 0xc0, 0x54, 0x8b, 0x6a, + 0xa7, 0x41, 0x97, 0xf8, 0x2e, 0xe1, 0x84, 0x69, 0xde, 0x69, 0x4f, 0xc3, 0x9e, 0xc5, 0xb4, 0x2e, + 0xe6, 0x46, 0x5f, 0x3b, 0x6b, 0x63, 0xdb, 0xeb, 0xe3, 0x6d, 0xad, 0x47, 0x5c, 0xe2, 0x63, 0x4e, + 0x4c, 0xd5, 0xf3, 0x29, 0xa7, 0xf0, 0x5e, 0x0c, 0x55, 0x33, 0xa8, 0xea, 0x9d, 0xf6, 0xd4, 0x08, + 0xaa, 0x0a, 0xa8, 0x9a, 0x40, 0xd7, 0xb7, 0x7a, 0x16, 0xef, 0x07, 0x5d, 0xd5, 0xa0, 0x8e, 0xd6, + 0xa3, 0x3d, 0xaa, 0x09, 0x86, 0x6e, 0x70, 0x22, 0x56, 0x62, 0x21, 0xbe, 0x62, 0xe6, 0xf5, 0xf6, + 0xd4, 0xa0, 0x34, 0x9f, 0x30, 0x1a, 0xf8, 0x06, 0x19, 0x8d, 0x66, 0xfd, 0xad, 0xe9, 0x98, 0xc0, + 0x3d, 0x23, 0x3e, 0xb3, 0xa8, 0x4b, 0xcc, 0x31, 0xd8, 0xfd, 0xe9, 0xb0, 0xb3, 0xb1, 0x2b, 0xaf, + 0x6f, 0x4d, 0xf6, 0xf6, 0x03, 0x97, 0x5b, 0xce, 0x78, 0x4c, 0xdb, 0x93, 0xdd, 0x03, 0x6e, 0xd9, + 0x9a, 0xe5, 0x72, 0xc6, 0xfd, 0x51, 0x48, 0xeb, 0xfb, 0x02, 0x28, 0xef, 0xfa, 0xd4, 0xdd, 0xa3, + 0x5d, 0x78, 0x0c, 0x2a, 0x0e, 0xe1, 0xd8, 0xc4, 0x1c, 0xd7, 0x95, 0x0d, 0x65, 0xb3, 0xd6, 0xde, + 0x54, 0xa7, 0xe6, 0x5c, 0x3d, 0xdb, 0x56, 0x1f, 0x77, 0x9f, 0x11, 0x83, 0x1f, 0x10, 0x8e, 0x75, + 0x78, 0x31, 0x68, 0xce, 0x85, 0x83, 0x26, 0xc8, 0x6c, 0x28, 0x65, 0x83, 0xc7, 0x60, 0x9e, 0x79, + 0xc4, 0xa8, 0x17, 0x04, 0xeb, 0xdb, 0xea, 0x8d, 0x2b, 0xa9, 0xca, 0xd8, 0x3a, 0x1e, 0x31, 0xf4, + 0x3b, 0xf2, 0x8c, 0xf9, 0x68, 0x85, 0x04, 0x23, 0xfc, 0x02, 0x94, 0x18, 0xc7, 0x3c, 0x60, 0xf5, + 0xa2, 0xe0, 0x7e, 0x70, 0x0b, 0x6e, 0x81, 0xd7, 0x97, 0x24, 0x7b, 0x29, 0x5e, 0x23, 0xc9, 0xdb, + 0xfa, 0x45, 0x01, 0x35, 0xe9, 0xb9, 0x6f, 0x31, 0x0e, 0x3f, 0x1b, 0xcb, 0x92, 0x76, 0x4d, 0x96, + 0x72, 0x5a, 0x50, 0x23, 0xb8, 0x48, 0xd6, 0x8a, 0x3c, 0xaa, 0x92, 0x58, 0x72, 0xa9, 0xfa, 0x18, + 0x2c, 0x58, 0x9c, 0x38, 0xac, 0x5e, 0xd8, 0x28, 0x6e, 0xd6, 0xda, 0xed, 0xd9, 0xef, 0xa3, 0x2f, + 0x4a, 0xfa, 0x85, 0x0f, 0x23, 0x22, 0x14, 0xf3, 0xb5, 0xbe, 0x29, 0xa6, 0xf7, 0x88, 0xf2, 0x07, + 0xef, 0x83, 0x0a, 0x33, 0xfa, 0xc4, 0x0c, 0x6c, 0x22, 0xee, 0x51, 0xcd, 0xc2, 0xea, 0x48, 0x3b, + 0x4a, 0x3d, 0xe0, 0x13, 0x70, 0x97, 0x71, 0xec, 0x73, 0xcb, 0xed, 0xbd, 0x4f, 0xb0, 0x69, 0x5b, + 0x2e, 0xe9, 0x10, 0x83, 0xba, 0x26, 0x13, 0x45, 0x2d, 0xea, 0xaf, 0x86, 0x83, 0xe6, 0xdd, 0xce, + 0x64, 0x17, 0x34, 0x0d, 0x0b, 0x9f, 0x82, 0x55, 0x83, 0xba, 0x46, 0xe0, 0xfb, 0xc4, 0x35, 0xce, + 0x0f, 0xa9, 0x6d, 0x19, 0xe7, 0xa2, 0x92, 0x55, 0x5d, 0x95, 0xd1, 0xac, 0xee, 0x8e, 0x3a, 0x5c, + 0x4d, 0x32, 0xa2, 0x71, 0x22, 0xf8, 0x1a, 0x28, 0xb3, 0x80, 0x79, 0xc4, 0x35, 0xeb, 0xf3, 0x1b, + 0xca, 0x66, 0x45, 0xaf, 0x85, 0x83, 0x66, 0xb9, 0x13, 0x9b, 0x50, 0xb2, 0x07, 0xbf, 0x04, 0xb5, + 0x67, 0xb4, 0x7b, 0x44, 0x1c, 0xcf, 0xc6, 0x9c, 0xd4, 0x17, 0x44, 0x51, 0x1f, 0xce, 0x90, 0xf8, + 0xbd, 0x0c, 0x2d, 0x84, 0xfa, 0x92, 0x0c, 0xbd, 0x96, 0xdb, 0x40, 0xf9, 0x33, 0x5a, 0xbf, 0x2b, + 0x60, 0x71, 0x48, 0x7e, 0xf0, 0x09, 0x28, 0x61, 0x83, 0x5b, 0x67, 0x51, 0x31, 0xa2, 0xc2, 0x6f, + 0xdd, 0xe4, 0xe9, 0x21, 0x72, 0x42, 0xa2, 0x0b, 0x93, 0x4c, 0xbd, 0x8f, 0x04, 0x09, 0x92, 0x64, + 0xd0, 0x01, 0x2b, 0x36, 0x66, 0x3c, 0xa9, 0xe8, 0x91, 0xe5, 0x10, 0x91, 0x8b, 0x5a, 0xfb, 0xcd, + 0x1b, 0xaa, 0x36, 0x82, 0xe8, 0x2f, 0x87, 0x83, 0xe6, 0xca, 0xfe, 0x08, 0x11, 0x1a, 0xa3, 0x6e, + 0x7d, 0x57, 0x00, 0xc5, 0x17, 0xdb, 0x4a, 0x8e, 0x86, 0x5a, 0x49, 0x7b, 0xb6, 0x2a, 0x4d, 0x6d, + 0x23, 0x4f, 0x47, 0xda, 0xc8, 0xce, 0x8c, 0xbc, 0xd7, 0xb7, 0x90, 0xdf, 0x8a, 0xe0, 0xce, 0x1e, + 0xed, 0xee, 0x52, 0xd7, 0xb4, 0xb8, 0x45, 0x5d, 0xb8, 0x03, 0xe6, 0xf9, 0xb9, 0x97, 0xbc, 0xbb, + 0x8d, 0x24, 0xa0, 0xa3, 0x73, 0x8f, 0x5c, 0x0d, 0x9a, 0x2b, 0x79, 0xdf, 0xc8, 0x86, 0x84, 0x37, + 0xfc, 0x28, 0x0d, 0xb2, 0x20, 0x70, 0xef, 0x0d, 0x1f, 0x77, 0x35, 0x68, 0x5e, 0x3b, 0x5d, 0xd4, + 0x94, 0x73, 0x38, 0x3c, 0xd8, 0x07, 0x8b, 0x51, 0x21, 0x0f, 0x7d, 0xda, 0x8d, 0x05, 0x52, 0x9c, + 0x5d, 0x20, 0x6b, 0x32, 0x96, 0xc5, 0xfd, 0x3c, 0x13, 0x1a, 0x26, 0x86, 0x5f, 0x01, 0x18, 0x19, + 0x8e, 0x7c, 0xec, 0xb2, 0xf8, 0x76, 0xb7, 0xd4, 0xe3, 0xba, 0x3c, 0x0e, 0xee, 0x8f, 0xd1, 0xa1, + 0x09, 0x47, 0xc0, 0xd7, 0x41, 0xc9, 0x27, 0x98, 0x51, 0x57, 0xbc, 0xee, 0x6a, 0x56, 0x29, 0x24, + 0xac, 0x48, 0xee, 0xc2, 0x7b, 0xa0, 0xec, 0x10, 0xc6, 0x70, 0x8f, 0xd4, 0x4b, 0xc2, 0x71, 0x59, + 0x3a, 0x96, 0x0f, 0x62, 0x33, 0x4a, 0xf6, 0x5b, 0x3f, 0x29, 0xa0, 0xfc, 0x1f, 0xcd, 0x84, 0xce, + 0xf0, 0x4c, 0x50, 0x67, 0x13, 0xe7, 0x94, 0x79, 0xf0, 0x43, 0x51, 0xc4, 0x2f, 0x66, 0xc1, 0x36, + 0xa8, 0x79, 0xd8, 0xc7, 0xb6, 0x4d, 0x6c, 0x8b, 0x39, 0xe2, 0x0a, 0x0b, 0xfa, 0x72, 0xd4, 0xc1, + 0x0e, 0x33, 0x33, 0xca, 0xfb, 0x44, 0x10, 0x83, 0x3a, 0x9e, 0x4d, 0xa2, 0x1c, 0xc7, 0x8a, 0x94, + 0x90, 0xdd, 0xcc, 0x8c, 0xf2, 0x3e, 0xf0, 0x31, 0x58, 0x8b, 0xbb, 0xd2, 0xe8, 0x04, 0x29, 0x8a, + 0x09, 0xf2, 0x4a, 0x38, 0x68, 0xae, 0x3d, 0x9a, 0xe4, 0x80, 0x26, 0xe3, 0xe0, 0xe7, 0xa0, 0xc2, + 0x88, 0x4d, 0x0c, 0x4e, 0x7d, 0x29, 0xa2, 0x9d, 0x9b, 0xa6, 0x1d, 0x77, 0x89, 0xdd, 0x91, 0x58, + 0xfd, 0x8e, 0x18, 0x7a, 0x72, 0x85, 0x52, 0x4e, 0xf8, 0x10, 0x2c, 0x39, 0xd8, 0x0d, 0x70, 0xea, + 0x29, 0xd4, 0x53, 0xd1, 0x61, 0x38, 0x68, 0x2e, 0x1d, 0x0c, 0xed, 0xa0, 0x11, 0x4f, 0xf8, 0x29, + 0xa8, 0xf0, 0x64, 0xa2, 0x94, 0x44, 0x6c, 0xff, 0xd0, 0xd1, 0x0f, 0xa9, 0x39, 0x34, 0x44, 0x52, + 0x41, 0xa4, 0x13, 0x24, 0x25, 0x6c, 0xfd, 0x58, 0x04, 0xd5, 0x6c, 0x74, 0x9c, 0x02, 0x60, 0x24, + 0x4f, 0x9b, 0xc9, 0xf1, 0xf1, 0xce, 0x6c, 0x1a, 0x49, 0x5b, 0x43, 0xd6, 0x7d, 0x53, 0x13, 0x43, + 0x39, 0x7a, 0x78, 0x0c, 0xaa, 0x62, 0x98, 0x8b, 0x97, 0x5b, 0x98, 0xfd, 0xe5, 0x2e, 0x86, 0x83, + 0x66, 0xb5, 0x93, 0x30, 0xa0, 0x8c, 0x0c, 0xf6, 0xc0, 0x52, 0xa6, 0x96, 0xdb, 0xf6, 0x21, 0x51, + 0x9a, 0xdd, 0x21, 0x1a, 0x34, 0x42, 0x1b, 0x35, 0x03, 0x39, 0x6a, 0xe7, 0x85, 0x6a, 0xa7, 0xcd, + 0x4e, 0x0d, 0x54, 0x59, 0x60, 0x18, 0x84, 0x98, 0xc4, 0x14, 0x95, 0x5f, 0xd0, 0x57, 0xa5, 0x6b, + 0xb5, 0x93, 0x6c, 0xa0, 0xcc, 0x27, 0x22, 0x3e, 0xc1, 0x96, 0x4d, 0x4c, 0x51, 0xf1, 0x1c, 0xf1, + 0x07, 0xc2, 0x8a, 0xe4, 0x6e, 0xeb, 0x57, 0x05, 0xe4, 0x7f, 0x0d, 0x5e, 0xe0, 0xb4, 0xec, 0xe7, + 0x54, 0x58, 0xf8, 0xd7, 0xff, 0x35, 0xd7, 0x49, 0xf2, 0x67, 0x05, 0x2c, 0x8f, 0xf8, 0xff, 0xdf, + 0xfe, 0x02, 0xf4, 0x37, 0x2e, 0x2e, 0x1b, 0x73, 0xcf, 0x2f, 0x1b, 0x73, 0x7f, 0x5c, 0x36, 0xe6, + 0xbe, 0x0e, 0x1b, 0xca, 0x45, 0xd8, 0x50, 0x9e, 0x87, 0x0d, 0xe5, 0xcf, 0xb0, 0xa1, 0x7c, 0xfb, + 0x57, 0x63, 0xee, 0x93, 0x4a, 0xc2, 0xf3, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0x4c, 0xf3, + 0xee, 0xc9, 0x0e, 0x00, 0x00, } diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/generated.proto b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/generated.proto index ebc58b082eb..8f4995a5c70 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/generated.proto +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/generated.proto @@ -30,6 +30,70 @@ import "k8s.io/kubernetes/pkg/util/intstr/generated.proto"; // Package-wide variables from generator "generated". option go_package = "v2alpha1"; +// CronJob represents the configuration of a single cron job. +message CronJob { + // Standard object's metadata. + // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional + optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; + + // Spec is a structure defining the expected behavior of a job, including the schedule. + // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional + optional CronJobSpec spec = 2; + + // Status is a structure describing current status of a job. + // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status + // +optional + optional CronJobStatus status = 3; +} + +// CronJobList is a collection of cron jobs. +message CronJobList { + // Standard list metadata + // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata + // +optional + optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1; + + // Items is the list of CronJob. + repeated CronJob items = 2; +} + +// CronJobSpec describes how the job execution will look like and when it will actually run. +message CronJobSpec { + // Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. + optional string schedule = 1; + + // Optional deadline in seconds for starting the job if it misses scheduled + // time for any reason. Missed jobs executions will be counted as failed ones. + // +optional + optional int64 startingDeadlineSeconds = 2; + + // ConcurrencyPolicy specifies how to treat concurrent executions of a Job. + // +optional + optional string concurrencyPolicy = 3; + + // Suspend flag tells the controller to suspend subsequent executions, it does + // not apply to already started executions. Defaults to false. + // +optional + optional bool suspend = 4; + + // JobTemplate is the object that describes the job that will be created when + // executing a CronJob. + optional JobTemplateSpec jobTemplate = 5; +} + +// CronJobStatus represents the current state of a cron job. +message CronJobStatus { + // Active holds pointers to currently running jobs. + // +optional + repeated k8s.io.kubernetes.pkg.api.v1.ObjectReference active = 1; + + // LastScheduleTime keeps information of when was the last time the job was successfully scheduled. + // +optional + optional k8s.io.kubernetes.pkg.api.unversioned.Time lastScheduleTime = 4; +} + // Job represents the configuration of a single job. message Job { // Standard object's metadata. @@ -191,67 +255,3 @@ message JobTemplateSpec { optional JobSpec spec = 2; } -// ScheduledJob represents the configuration of a single scheduled job. -message ScheduledJob { - // Standard object's metadata. - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata - // +optional - optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; - - // Spec is a structure defining the expected behavior of a job, including the schedule. - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status - // +optional - optional ScheduledJobSpec spec = 2; - - // Status is a structure describing current status of a job. - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status - // +optional - optional ScheduledJobStatus status = 3; -} - -// ScheduledJobList is a collection of scheduled jobs. -message ScheduledJobList { - // Standard list metadata - // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata - // +optional - optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1; - - // Items is the list of ScheduledJob. - repeated ScheduledJob items = 2; -} - -// ScheduledJobSpec describes how the job execution will look like and when it will actually run. -message ScheduledJobSpec { - // Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. - optional string schedule = 1; - - // Optional deadline in seconds for starting the job if it misses scheduled - // time for any reason. Missed jobs executions will be counted as failed ones. - // +optional - optional int64 startingDeadlineSeconds = 2; - - // ConcurrencyPolicy specifies how to treat concurrent executions of a Job. - // +optional - optional string concurrencyPolicy = 3; - - // Suspend flag tells the controller to suspend subsequent executions, it does - // not apply to already started executions. Defaults to false. - // +optional - optional bool suspend = 4; - - // JobTemplate is the object that describes the job that will be created when - // executing a ScheduledJob. - optional JobTemplateSpec jobTemplate = 5; -} - -// ScheduledJobStatus represents the current state of a Job. -message ScheduledJobStatus { - // Active holds pointers to currently running jobs. - // +optional - repeated k8s.io.kubernetes.pkg.api.v1.ObjectReference active = 1; - - // LastScheduleTime keeps information of when was the last time the job was successfully scheduled. - // +optional - optional k8s.io.kubernetes.pkg.api.unversioned.Time lastScheduleTime = 4; -} - diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/register.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/register.go index 8a0675197b0..5bb82b5bbc2 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/register.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/register.go @@ -40,11 +40,13 @@ func addKnownTypes(scheme *runtime.Scheme) error { &Job{}, &JobList{}, &JobTemplate{}, - &ScheduledJob{}, - &ScheduledJobList{}, + &CronJob{}, + &CronJobList{}, &v1.ListOptions{}, &v1.DeleteOptions{}, ) + scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJob"), &CronJob{}) + scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("ScheduledJobList"), &CronJobList{}) versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types.generated.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types.generated.go index fbdf99e8829..f2fa2a6b51e 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types.generated.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types.generated.go @@ -2822,7 +2822,7 @@ func (x *JobCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ScheduledJob) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *CronJob) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -2967,7 +2967,7 @@ func (x *ScheduledJob) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *ScheduledJob) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *CronJob) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -2997,7 +2997,7 @@ func (x *ScheduledJob) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ScheduledJob) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *CronJob) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3040,14 +3040,14 @@ func (x *ScheduledJob) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } case "spec": if r.TryDecodeAsNil() { - x.Spec = ScheduledJobSpec{} + x.Spec = CronJobSpec{} } else { yyv269 := &x.Spec yyv269.CodecDecodeSelf(d) } case "status": if r.TryDecodeAsNil() { - x.Status = ScheduledJobStatus{} + x.Status = CronJobStatus{} } else { yyv270 := &x.Status yyv270.CodecDecodeSelf(d) @@ -3059,7 +3059,7 @@ func (x *ScheduledJob) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *ScheduledJob) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *CronJob) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3127,7 +3127,7 @@ func (x *ScheduledJob) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Spec = ScheduledJobSpec{} + x.Spec = CronJobSpec{} } else { yyv275 := &x.Spec yyv275.CodecDecodeSelf(d) @@ -3144,7 +3144,7 @@ func (x *ScheduledJob) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.Status = ScheduledJobStatus{} + x.Status = CronJobStatus{} } else { yyv276 := &x.Status yyv276.CodecDecodeSelf(d) @@ -3165,7 +3165,7 @@ func (x *ScheduledJob) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ScheduledJobList) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *CronJobList) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -3286,7 +3286,7 @@ func (x *ScheduledJobList) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym291 if false { } else { - h.encSliceScheduledJob(([]ScheduledJob)(x.Items), e) + h.encSliceCronJob(([]CronJob)(x.Items), e) } } } else { @@ -3300,7 +3300,7 @@ func (x *ScheduledJobList) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym292 if false { } else { - h.encSliceScheduledJob(([]ScheduledJob)(x.Items), e) + h.encSliceCronJob(([]CronJob)(x.Items), e) } } } @@ -3313,7 +3313,7 @@ func (x *ScheduledJobList) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *ScheduledJobList) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *CronJobList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3343,7 +3343,7 @@ func (x *ScheduledJobList) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ScheduledJobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *CronJobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3399,7 +3399,7 @@ func (x *ScheduledJobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { _ = yym301 if false { } else { - h.decSliceScheduledJob((*[]ScheduledJob)(yyv300), d) + h.decSliceCronJob((*[]CronJob)(yyv300), d) } } default: @@ -3409,7 +3409,7 @@ func (x *ScheduledJobList) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *ScheduledJobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *CronJobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3490,7 +3490,7 @@ func (x *ScheduledJobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) _ = yym308 if false { } else { - h.decSliceScheduledJob((*[]ScheduledJob)(yyv307), d) + h.decSliceCronJob((*[]CronJob)(yyv307), d) } } for { @@ -3509,7 +3509,7 @@ func (x *ScheduledJobList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x *ScheduledJobSpec) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *CronJobSpec) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -3666,7 +3666,7 @@ func (x *ScheduledJobSpec) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *ScheduledJobSpec) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *CronJobSpec) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3696,7 +3696,7 @@ func (x *ScheduledJobSpec) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ScheduledJobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *CronJobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3776,7 +3776,7 @@ func (x *ScheduledJobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *ScheduledJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -3926,7 +3926,7 @@ func (x *ConcurrencyPolicy) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ScheduledJobStatus) CodecEncodeSelf(e *codec1978.Encoder) { +func (x *CronJobStatus) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -4043,7 +4043,7 @@ func (x *ScheduledJobStatus) CodecEncodeSelf(e *codec1978.Encoder) { } } -func (x *ScheduledJobStatus) CodecDecodeSelf(d *codec1978.Decoder) { +func (x *CronJobStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -4073,7 +4073,7 @@ func (x *ScheduledJobStatus) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x *ScheduledJobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { +func (x *CronJobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -4135,7 +4135,7 @@ func (x *ScheduledJobStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) z.DecSendContainerState(codecSelfer_containerMapEnd1234) } -func (x *ScheduledJobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { +func (x *CronJobStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -4443,7 +4443,7 @@ func (x codecSelfer1234) decSliceJobCondition(v *[]JobCondition, d *codec1978.De } } -func (x codecSelfer1234) encSliceScheduledJob(v []ScheduledJob, e *codec1978.Encoder) { +func (x codecSelfer1234) encSliceCronJob(v []CronJob, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r @@ -4456,7 +4456,7 @@ func (x codecSelfer1234) encSliceScheduledJob(v []ScheduledJob, e *codec1978.Enc z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } -func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.Decoder) { +func (x codecSelfer1234) decSliceCronJob(v *[]CronJob, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r @@ -4466,7 +4466,7 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De var yyc382 bool if yyl382 == 0 { if yyv382 == nil { - yyv382 = []ScheduledJob{} + yyv382 = []CronJob{} yyc382 = true } else if len(yyv382) != 0 { yyv382 = yyv382[:0] @@ -4484,10 +4484,10 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De if yyrl382 <= cap(yyv382) { yyv382 = yyv382[:yyrl382] } else { - yyv382 = make([]ScheduledJob, yyrl382) + yyv382 = make([]CronJob, yyrl382) } } else { - yyv382 = make([]ScheduledJob, yyrl382) + yyv382 = make([]CronJob, yyrl382) } yyc382 = true yyrr382 = len(yyv382) @@ -4502,7 +4502,7 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De for ; yyj382 < yyrr382; yyj382++ { yyh382.ElemContainerState(yyj382) if r.TryDecodeAsNil() { - yyv382[yyj382] = ScheduledJob{} + yyv382[yyj382] = CronJob{} } else { yyv383 := &yyv382[yyj382] yyv383.CodecDecodeSelf(d) @@ -4511,10 +4511,10 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De } if yyrt382 { for ; yyj382 < yyl382; yyj382++ { - yyv382 = append(yyv382, ScheduledJob{}) + yyv382 = append(yyv382, CronJob{}) yyh382.ElemContainerState(yyj382) if r.TryDecodeAsNil() { - yyv382[yyj382] = ScheduledJob{} + yyv382[yyj382] = CronJob{} } else { yyv384 := &yyv382[yyj382] yyv384.CodecDecodeSelf(d) @@ -4528,13 +4528,13 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De for ; !r.CheckBreak(); yyj382++ { if yyj382 >= len(yyv382) { - yyv382 = append(yyv382, ScheduledJob{}) // var yyz382 ScheduledJob + yyv382 = append(yyv382, CronJob{}) // var yyz382 CronJob yyc382 = true } yyh382.ElemContainerState(yyj382) if yyj382 < len(yyv382) { if r.TryDecodeAsNil() { - yyv382[yyj382] = ScheduledJob{} + yyv382[yyj382] = CronJob{} } else { yyv385 := &yyv382[yyj382] yyv385.CodecDecodeSelf(d) @@ -4549,7 +4549,7 @@ func (x codecSelfer1234) decSliceScheduledJob(v *[]ScheduledJob, d *codec1978.De yyv382 = yyv382[:yyj382] yyc382 = true } else if yyj382 == 0 && yyv382 == nil { - yyv382 = []ScheduledJob{} + yyv382 = []CronJob{} yyc382 = true } } diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types.go index 9a988673009..a610272e35c 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types.go @@ -21,6 +21,8 @@ import ( "k8s.io/client-go/pkg/api/v1" ) +// +genclient=true + // Job represents the configuration of a single job. type Job struct { unversioned.TypeMeta `json:",inline"` @@ -192,8 +194,10 @@ type JobCondition struct { Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` } -// ScheduledJob represents the configuration of a single scheduled job. -type ScheduledJob struct { +// +genclient=true + +// CronJob represents the configuration of a single cron job. +type CronJob struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata @@ -203,28 +207,28 @@ type ScheduledJob struct { // Spec is a structure defining the expected behavior of a job, including the schedule. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // +optional - Spec ScheduledJobSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + Spec CronJobSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Status is a structure describing current status of a job. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // +optional - Status ScheduledJobStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` + Status CronJobStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } -// ScheduledJobList is a collection of scheduled jobs. -type ScheduledJobList struct { +// CronJobList is a collection of cron jobs. +type CronJobList struct { unversioned.TypeMeta `json:",inline"` // Standard list metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // +optional unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Items is the list of ScheduledJob. - Items []ScheduledJob `json:"items" protobuf:"bytes,2,rep,name=items"` + // Items is the list of CronJob. + Items []CronJob `json:"items" protobuf:"bytes,2,rep,name=items"` } -// ScheduledJobSpec describes how the job execution will look like and when it will actually run. -type ScheduledJobSpec struct { +// CronJobSpec describes how the job execution will look like and when it will actually run. +type CronJobSpec struct { // Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. Schedule string `json:"schedule" protobuf:"bytes,1,opt,name=schedule"` @@ -244,7 +248,7 @@ type ScheduledJobSpec struct { Suspend *bool `json:"suspend,omitempty" protobuf:"varint,4,opt,name=suspend"` // JobTemplate is the object that describes the job that will be created when - // executing a ScheduledJob. + // executing a CronJob. JobTemplate JobTemplateSpec `json:"jobTemplate" protobuf:"bytes,5,opt,name=jobTemplate"` } @@ -255,7 +259,7 @@ type ScheduledJobSpec struct { type ConcurrencyPolicy string const ( - // AllowConcurrent allows ScheduledJobs to run concurrently. + // AllowConcurrent allows CronJobs to run concurrently. AllowConcurrent ConcurrencyPolicy = "Allow" // ForbidConcurrent forbids concurrent runs, skipping next run if previous @@ -266,8 +270,8 @@ const ( ReplaceConcurrent ConcurrencyPolicy = "Replace" ) -// ScheduledJobStatus represents the current state of a Job. -type ScheduledJobStatus struct { +// CronJobStatus represents the current state of a cron job. +type CronJobStatus struct { // Active holds pointers to currently running jobs. // +optional Active []v1.ObjectReference `json:"active,omitempty" protobuf:"bytes,1,rep,name=active"` diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types_swagger_doc_generated.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types_swagger_doc_generated.go index 4eb60928d85..6e8c40a0feb 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/types_swagger_doc_generated.go @@ -27,6 +27,50 @@ package v2alpha1 // Those methods can be generated by using hack/update-generated-swagger-docs.sh // AUTO-GENERATED FUNCTIONS START HERE +var map_CronJob = map[string]string{ + "": "CronJob represents the configuration of a single cron job.", + "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", + "spec": "Spec is a structure defining the expected behavior of a job, including the schedule. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status", + "status": "Status is a structure describing current status of a job. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status", +} + +func (CronJob) SwaggerDoc() map[string]string { + return map_CronJob +} + +var map_CronJobList = map[string]string{ + "": "CronJobList is a collection of cron jobs.", + "metadata": "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", + "items": "Items is the list of CronJob.", +} + +func (CronJobList) SwaggerDoc() map[string]string { + return map_CronJobList +} + +var map_CronJobSpec = map[string]string{ + "": "CronJobSpec describes how the job execution will look like and when it will actually run.", + "schedule": "Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.", + "startingDeadlineSeconds": "Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.", + "concurrencyPolicy": "ConcurrencyPolicy specifies how to treat concurrent executions of a Job.", + "suspend": "Suspend flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.", + "jobTemplate": "JobTemplate is the object that describes the job that will be created when executing a CronJob.", +} + +func (CronJobSpec) SwaggerDoc() map[string]string { + return map_CronJobSpec +} + +var map_CronJobStatus = map[string]string{ + "": "CronJobStatus represents the current state of a cron job.", + "active": "Active holds pointers to currently running jobs.", + "lastScheduleTime": "LastScheduleTime keeps information of when was the last time the job was successfully scheduled.", +} + +func (CronJobStatus) SwaggerDoc() map[string]string { + return map_CronJobStatus +} + var map_Job = map[string]string{ "": "Job represents the configuration of a single job.", "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", @@ -110,48 +154,4 @@ func (JobTemplateSpec) SwaggerDoc() map[string]string { return map_JobTemplateSpec } -var map_ScheduledJob = map[string]string{ - "": "ScheduledJob represents the configuration of a single scheduled job.", - "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", - "spec": "Spec is a structure defining the expected behavior of a job, including the schedule. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status", - "status": "Status is a structure describing current status of a job. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status", -} - -func (ScheduledJob) SwaggerDoc() map[string]string { - return map_ScheduledJob -} - -var map_ScheduledJobList = map[string]string{ - "": "ScheduledJobList is a collection of scheduled jobs.", - "metadata": "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", - "items": "Items is the list of ScheduledJob.", -} - -func (ScheduledJobList) SwaggerDoc() map[string]string { - return map_ScheduledJobList -} - -var map_ScheduledJobSpec = map[string]string{ - "": "ScheduledJobSpec describes how the job execution will look like and when it will actually run.", - "schedule": "Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.", - "startingDeadlineSeconds": "Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.", - "concurrencyPolicy": "ConcurrencyPolicy specifies how to treat concurrent executions of a Job.", - "suspend": "Suspend flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.", - "jobTemplate": "JobTemplate is the object that describes the job that will be created when executing a ScheduledJob.", -} - -func (ScheduledJobSpec) SwaggerDoc() map[string]string { - return map_ScheduledJobSpec -} - -var map_ScheduledJobStatus = map[string]string{ - "": "ScheduledJobStatus represents the current state of a Job.", - "active": "Active holds pointers to currently running jobs.", - "lastScheduleTime": "LastScheduleTime keeps information of when was the last time the job was successfully scheduled.", -} - -func (ScheduledJobStatus) SwaggerDoc() map[string]string { - return map_ScheduledJobStatus -} - // AUTO-GENERATED FUNCTIONS END HERE diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.conversion.go index a81391d3bd7..431e0b46755 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.conversion.go @@ -22,10 +22,12 @@ package v2alpha1 import ( api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" v1 "k8s.io/client-go/pkg/api/v1" batch "k8s.io/client-go/pkg/apis/batch" conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" ) func init() { @@ -36,6 +38,14 @@ func init() { // Public to allow building arbitrary schemes. func RegisterConversions(scheme *runtime.Scheme) error { return scheme.AddGeneratedConversionFuncs( + Convert_v2alpha1_CronJob_To_batch_CronJob, + Convert_batch_CronJob_To_v2alpha1_CronJob, + Convert_v2alpha1_CronJobList_To_batch_CronJobList, + Convert_batch_CronJobList_To_v2alpha1_CronJobList, + Convert_v2alpha1_CronJobSpec_To_batch_CronJobSpec, + Convert_batch_CronJobSpec_To_v2alpha1_CronJobSpec, + Convert_v2alpha1_CronJobStatus_To_batch_CronJobStatus, + Convert_batch_CronJobStatus_To_v2alpha1_CronJobStatus, Convert_v2alpha1_Job_To_batch_Job, Convert_batch_Job_To_v2alpha1_Job, Convert_v2alpha1_JobCondition_To_batch_JobCondition, @@ -50,17 +60,135 @@ func RegisterConversions(scheme *runtime.Scheme) error { Convert_batch_JobTemplate_To_v2alpha1_JobTemplate, Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec, Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec, - Convert_v2alpha1_ScheduledJob_To_batch_ScheduledJob, - Convert_batch_ScheduledJob_To_v2alpha1_ScheduledJob, - Convert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList, - Convert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList, - Convert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec, - Convert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec, - Convert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus, - Convert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus, ) } +func autoConvert_v2alpha1_CronJob_To_batch_CronJob(in *CronJob, out *batch.CronJob, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + if err := Convert_v2alpha1_CronJobSpec_To_batch_CronJobSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v2alpha1_CronJobStatus_To_batch_CronJobStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +func Convert_v2alpha1_CronJob_To_batch_CronJob(in *CronJob, out *batch.CronJob, s conversion.Scope) error { + return autoConvert_v2alpha1_CronJob_To_batch_CronJob(in, out, s) +} + +func autoConvert_batch_CronJob_To_v2alpha1_CronJob(in *batch.CronJob, out *CronJob, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + if err := Convert_batch_CronJobSpec_To_v2alpha1_CronJobSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_batch_CronJobStatus_To_v2alpha1_CronJobStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +func Convert_batch_CronJob_To_v2alpha1_CronJob(in *batch.CronJob, out *CronJob, s conversion.Scope) error { + return autoConvert_batch_CronJob_To_v2alpha1_CronJob(in, out, s) +} + +func autoConvert_v2alpha1_CronJobList_To_batch_CronJobList(in *CronJobList, out *batch.CronJobList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]batch.CronJob, len(*in)) + for i := range *in { + if err := Convert_v2alpha1_CronJob_To_batch_CronJob(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func Convert_v2alpha1_CronJobList_To_batch_CronJobList(in *CronJobList, out *batch.CronJobList, s conversion.Scope) error { + return autoConvert_v2alpha1_CronJobList_To_batch_CronJobList(in, out, s) +} + +func autoConvert_batch_CronJobList_To_v2alpha1_CronJobList(in *batch.CronJobList, out *CronJobList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CronJob, len(*in)) + for i := range *in { + if err := Convert_batch_CronJob_To_v2alpha1_CronJob(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +func Convert_batch_CronJobList_To_v2alpha1_CronJobList(in *batch.CronJobList, out *CronJobList, s conversion.Scope) error { + return autoConvert_batch_CronJobList_To_v2alpha1_CronJobList(in, out, s) +} + +func autoConvert_v2alpha1_CronJobSpec_To_batch_CronJobSpec(in *CronJobSpec, out *batch.CronJobSpec, s conversion.Scope) error { + out.Schedule = in.Schedule + out.StartingDeadlineSeconds = (*int64)(unsafe.Pointer(in.StartingDeadlineSeconds)) + out.ConcurrencyPolicy = batch.ConcurrencyPolicy(in.ConcurrencyPolicy) + out.Suspend = (*bool)(unsafe.Pointer(in.Suspend)) + if err := Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil { + return err + } + return nil +} + +func Convert_v2alpha1_CronJobSpec_To_batch_CronJobSpec(in *CronJobSpec, out *batch.CronJobSpec, s conversion.Scope) error { + return autoConvert_v2alpha1_CronJobSpec_To_batch_CronJobSpec(in, out, s) +} + +func autoConvert_batch_CronJobSpec_To_v2alpha1_CronJobSpec(in *batch.CronJobSpec, out *CronJobSpec, s conversion.Scope) error { + out.Schedule = in.Schedule + out.StartingDeadlineSeconds = (*int64)(unsafe.Pointer(in.StartingDeadlineSeconds)) + out.ConcurrencyPolicy = ConcurrencyPolicy(in.ConcurrencyPolicy) + out.Suspend = (*bool)(unsafe.Pointer(in.Suspend)) + if err := Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil { + return err + } + return nil +} + +func Convert_batch_CronJobSpec_To_v2alpha1_CronJobSpec(in *batch.CronJobSpec, out *CronJobSpec, s conversion.Scope) error { + return autoConvert_batch_CronJobSpec_To_v2alpha1_CronJobSpec(in, out, s) +} + +func autoConvert_v2alpha1_CronJobStatus_To_batch_CronJobStatus(in *CronJobStatus, out *batch.CronJobStatus, s conversion.Scope) error { + out.Active = *(*[]api.ObjectReference)(unsafe.Pointer(&in.Active)) + out.LastScheduleTime = (*unversioned.Time)(unsafe.Pointer(in.LastScheduleTime)) + return nil +} + +func Convert_v2alpha1_CronJobStatus_To_batch_CronJobStatus(in *CronJobStatus, out *batch.CronJobStatus, s conversion.Scope) error { + return autoConvert_v2alpha1_CronJobStatus_To_batch_CronJobStatus(in, out, s) +} + +func autoConvert_batch_CronJobStatus_To_v2alpha1_CronJobStatus(in *batch.CronJobStatus, out *CronJobStatus, s conversion.Scope) error { + out.Active = *(*[]v1.ObjectReference)(unsafe.Pointer(&in.Active)) + out.LastScheduleTime = (*unversioned.Time)(unsafe.Pointer(in.LastScheduleTime)) + return nil +} + +func Convert_batch_CronJobStatus_To_v2alpha1_CronJobStatus(in *batch.CronJobStatus, out *CronJobStatus, s conversion.Scope) error { + return autoConvert_batch_CronJobStatus_To_v2alpha1_CronJobStatus(in, out, s) +} + func autoConvert_v2alpha1_Job_To_batch_Job(in *Job, out *batch.Job, s conversion.Scope) error { // TODO: Inefficient conversion - can we improve it? if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { @@ -166,11 +294,11 @@ func Convert_batch_JobList_To_v2alpha1_JobList(in *batch.JobList, out *JobList, } func autoConvert_v2alpha1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s conversion.Scope) error { - out.Parallelism = in.Parallelism - out.Completions = in.Completions - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - out.Selector = in.Selector - out.ManualSelector = in.ManualSelector + out.Parallelism = (*int32)(unsafe.Pointer(in.Parallelism)) + out.Completions = (*int32)(unsafe.Pointer(in.Completions)) + out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) + out.ManualSelector = (*bool)(unsafe.Pointer(in.ManualSelector)) if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } @@ -178,11 +306,11 @@ func autoConvert_v2alpha1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSp } func autoConvert_batch_JobSpec_To_v2alpha1_JobSpec(in *batch.JobSpec, out *JobSpec, s conversion.Scope) error { - out.Parallelism = in.Parallelism - out.Completions = in.Completions - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - out.Selector = in.Selector - out.ManualSelector = in.ManualSelector + out.Parallelism = (*int32)(unsafe.Pointer(in.Parallelism)) + out.Completions = (*int32)(unsafe.Pointer(in.Completions)) + out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) + out.ManualSelector = (*bool)(unsafe.Pointer(in.ManualSelector)) if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } @@ -190,19 +318,9 @@ func autoConvert_batch_JobSpec_To_v2alpha1_JobSpec(in *batch.JobSpec, out *JobSp } func autoConvert_v2alpha1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]batch.JobCondition, len(*in)) - for i := range *in { - if err := Convert_v2alpha1_JobCondition_To_batch_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime + out.Conditions = *(*[]batch.JobCondition)(unsafe.Pointer(&in.Conditions)) + out.StartTime = (*unversioned.Time)(unsafe.Pointer(in.StartTime)) + out.CompletionTime = (*unversioned.Time)(unsafe.Pointer(in.CompletionTime)) out.Active = in.Active out.Succeeded = in.Succeeded out.Failed = in.Failed @@ -214,19 +332,9 @@ func Convert_v2alpha1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.Job } func autoConvert_batch_JobStatus_To_v2alpha1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]JobCondition, len(*in)) - for i := range *in { - if err := Convert_batch_JobCondition_To_v2alpha1_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime + out.Conditions = *(*[]JobCondition)(unsafe.Pointer(&in.Conditions)) + out.StartTime = (*unversioned.Time)(unsafe.Pointer(in.StartTime)) + out.CompletionTime = (*unversioned.Time)(unsafe.Pointer(in.CompletionTime)) out.Active = in.Active out.Succeeded = in.Succeeded out.Failed = in.Failed @@ -296,151 +404,3 @@ func autoConvert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in *batch.Job func Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in *batch.JobTemplateSpec, out *JobTemplateSpec, s conversion.Scope) error { return autoConvert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in, out, s) } - -func autoConvert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(in *ScheduledJob, out *batch.ScheduledJob, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(in *ScheduledJob, out *batch.ScheduledJob, s conversion.Scope) error { - return autoConvert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(in, out, s) -} - -func autoConvert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(in *batch.ScheduledJob, out *ScheduledJob, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(in *batch.ScheduledJob, out *ScheduledJob, s conversion.Scope) error { - return autoConvert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(in, out, s) -} - -func autoConvert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList(in *ScheduledJobList, out *batch.ScheduledJobList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]batch.ScheduledJob, len(*in)) - for i := range *in { - if err := Convert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList(in *ScheduledJobList, out *batch.ScheduledJobList, s conversion.Scope) error { - return autoConvert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList(in, out, s) -} - -func autoConvert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList(in *batch.ScheduledJobList, out *ScheduledJobList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ScheduledJob, len(*in)) - for i := range *in { - if err := Convert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList(in *batch.ScheduledJobList, out *ScheduledJobList, s conversion.Scope) error { - return autoConvert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList(in, out, s) -} - -func autoConvert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(in *ScheduledJobSpec, out *batch.ScheduledJobSpec, s conversion.Scope) error { - out.Schedule = in.Schedule - out.StartingDeadlineSeconds = in.StartingDeadlineSeconds - out.ConcurrencyPolicy = batch.ConcurrencyPolicy(in.ConcurrencyPolicy) - out.Suspend = in.Suspend - if err := Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil { - return err - } - return nil -} - -func Convert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(in *ScheduledJobSpec, out *batch.ScheduledJobSpec, s conversion.Scope) error { - return autoConvert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(in, out, s) -} - -func autoConvert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(in *batch.ScheduledJobSpec, out *ScheduledJobSpec, s conversion.Scope) error { - out.Schedule = in.Schedule - out.StartingDeadlineSeconds = in.StartingDeadlineSeconds - out.ConcurrencyPolicy = ConcurrencyPolicy(in.ConcurrencyPolicy) - out.Suspend = in.Suspend - if err := Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil { - return err - } - return nil -} - -func Convert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(in *batch.ScheduledJobSpec, out *ScheduledJobSpec, s conversion.Scope) error { - return autoConvert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(in, out, s) -} - -func autoConvert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(in *ScheduledJobStatus, out *batch.ScheduledJobStatus, s conversion.Scope) error { - if in.Active != nil { - in, out := &in.Active, &out.Active - *out = make([]api.ObjectReference, len(*in)) - for i := range *in { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil { - return err - } - } - } else { - out.Active = nil - } - out.LastScheduleTime = in.LastScheduleTime - return nil -} - -func Convert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(in *ScheduledJobStatus, out *batch.ScheduledJobStatus, s conversion.Scope) error { - return autoConvert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(in, out, s) -} - -func autoConvert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(in *batch.ScheduledJobStatus, out *ScheduledJobStatus, s conversion.Scope) error { - if in.Active != nil { - in, out := &in.Active, &out.Active - *out = make([]v1.ObjectReference, len(*in)) - for i := range *in { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil { - return err - } - } - } else { - out.Active = nil - } - out.LastScheduleTime = in.LastScheduleTime - return nil -} - -func Convert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(in *batch.ScheduledJobStatus, out *ScheduledJobStatus, s conversion.Scope) error { - return autoConvert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(in, out, s) -} diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.deepcopy.go index a6cee3549f9..572c2cd2600 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.deepcopy.go @@ -36,6 +36,10 @@ func init() { // to allow building arbitrary schemes. func RegisterDeepCopies(scheme *runtime.Scheme) error { return scheme.AddGeneratedDeepCopyFuncs( + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_CronJob, InType: reflect.TypeOf(&CronJob{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_CronJobList, InType: reflect.TypeOf(&CronJobList{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_CronJobSpec, InType: reflect.TypeOf(&CronJobSpec{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_CronJobStatus, InType: reflect.TypeOf(&CronJobStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_Job, InType: reflect.TypeOf(&Job{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobCondition, InType: reflect.TypeOf(&JobCondition{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobList, InType: reflect.TypeOf(&JobList{})}, @@ -43,13 +47,99 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobStatus, InType: reflect.TypeOf(&JobStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobTemplate, InType: reflect.TypeOf(&JobTemplate{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobTemplateSpec, InType: reflect.TypeOf(&JobTemplateSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJob, InType: reflect.TypeOf(&ScheduledJob{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJobList, InType: reflect.TypeOf(&ScheduledJobList{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJobSpec, InType: reflect.TypeOf(&ScheduledJobSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJobStatus, InType: reflect.TypeOf(&ScheduledJobStatus{})}, ) } +func DeepCopy_v2alpha1_CronJob(in interface{}, out interface{}, c *conversion.Cloner) error { + { + in := in.(*CronJob) + out := out.(*CronJob) + out.TypeMeta = in.TypeMeta + if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { + return err + } + if err := DeepCopy_v2alpha1_CronJobSpec(&in.Spec, &out.Spec, c); err != nil { + return err + } + if err := DeepCopy_v2alpha1_CronJobStatus(&in.Status, &out.Status, c); err != nil { + return err + } + return nil + } +} + +func DeepCopy_v2alpha1_CronJobList(in interface{}, out interface{}, c *conversion.Cloner) error { + { + in := in.(*CronJobList) + out := out.(*CronJobList) + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CronJob, len(*in)) + for i := range *in { + if err := DeepCopy_v2alpha1_CronJob(&(*in)[i], &(*out)[i], c); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil + } +} + +func DeepCopy_v2alpha1_CronJobSpec(in interface{}, out interface{}, c *conversion.Cloner) error { + { + in := in.(*CronJobSpec) + out := out.(*CronJobSpec) + out.Schedule = in.Schedule + if in.StartingDeadlineSeconds != nil { + in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds + *out = new(int64) + **out = **in + } else { + out.StartingDeadlineSeconds = nil + } + out.ConcurrencyPolicy = in.ConcurrencyPolicy + if in.Suspend != nil { + in, out := &in.Suspend, &out.Suspend + *out = new(bool) + **out = **in + } else { + out.Suspend = nil + } + if err := DeepCopy_v2alpha1_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, c); err != nil { + return err + } + return nil + } +} + +func DeepCopy_v2alpha1_CronJobStatus(in interface{}, out interface{}, c *conversion.Cloner) error { + { + in := in.(*CronJobStatus) + out := out.(*CronJobStatus) + if in.Active != nil { + in, out := &in.Active, &out.Active + *out = make([]v1.ObjectReference, len(*in)) + for i := range *in { + (*out)[i] = (*in)[i] + } + } else { + out.Active = nil + } + if in.LastScheduleTime != nil { + in, out := &in.LastScheduleTime, &out.LastScheduleTime + *out = new(unversioned.Time) + **out = (*in).DeepCopy() + } else { + out.LastScheduleTime = nil + } + return nil + } +} + func DeepCopy_v2alpha1_Job(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*Job) @@ -215,93 +305,3 @@ func DeepCopy_v2alpha1_JobTemplateSpec(in interface{}, out interface{}, c *conve return nil } } - -func DeepCopy_v2alpha1_ScheduledJob(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScheduledJob) - out := out.(*ScheduledJob) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v2alpha1_ScheduledJobSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v2alpha1_ScheduledJobStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v2alpha1_ScheduledJobList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScheduledJobList) - out := out.(*ScheduledJobList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ScheduledJob, len(*in)) - for i := range *in { - if err := DeepCopy_v2alpha1_ScheduledJob(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v2alpha1_ScheduledJobSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScheduledJobSpec) - out := out.(*ScheduledJobSpec) - out.Schedule = in.Schedule - if in.StartingDeadlineSeconds != nil { - in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds - *out = new(int64) - **out = **in - } else { - out.StartingDeadlineSeconds = nil - } - out.ConcurrencyPolicy = in.ConcurrencyPolicy - if in.Suspend != nil { - in, out := &in.Suspend, &out.Suspend - *out = new(bool) - **out = **in - } else { - out.Suspend = nil - } - if err := DeepCopy_v2alpha1_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v2alpha1_ScheduledJobStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScheduledJobStatus) - out := out.(*ScheduledJobStatus) - if in.Active != nil { - in, out := &in.Active, &out.Active - *out = make([]v1.ObjectReference, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Active = nil - } - if in.LastScheduleTime != nil { - in, out := &in.LastScheduleTime, &out.LastScheduleTime - *out = new(unversioned.Time) - **out = (*in).DeepCopy() - } else { - out.LastScheduleTime = nil - } - return nil - } -} diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.defaults.go b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.defaults.go index b024dd9758d..27f6d93886c 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.defaults.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/v2alpha1/zz_generated.defaults.go @@ -29,14 +29,138 @@ import ( // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&CronJob{}, func(obj interface{}) { SetObjectDefaults_CronJob(obj.(*CronJob)) }) + scheme.AddTypeDefaultingFunc(&CronJobList{}, func(obj interface{}) { SetObjectDefaults_CronJobList(obj.(*CronJobList)) }) scheme.AddTypeDefaultingFunc(&Job{}, func(obj interface{}) { SetObjectDefaults_Job(obj.(*Job)) }) scheme.AddTypeDefaultingFunc(&JobList{}, func(obj interface{}) { SetObjectDefaults_JobList(obj.(*JobList)) }) scheme.AddTypeDefaultingFunc(&JobTemplate{}, func(obj interface{}) { SetObjectDefaults_JobTemplate(obj.(*JobTemplate)) }) - scheme.AddTypeDefaultingFunc(&ScheduledJob{}, func(obj interface{}) { SetObjectDefaults_ScheduledJob(obj.(*ScheduledJob)) }) - scheme.AddTypeDefaultingFunc(&ScheduledJobList{}, func(obj interface{}) { SetObjectDefaults_ScheduledJobList(obj.(*ScheduledJobList)) }) return nil } +func SetObjectDefaults_CronJob(in *CronJob) { + SetDefaults_CronJob(in) + v1.SetDefaults_PodSpec(&in.Spec.JobTemplate.Spec.Template.Spec) + for i := range in.Spec.JobTemplate.Spec.Template.Spec.Volumes { + a := &in.Spec.JobTemplate.Spec.Template.Spec.Volumes[i] + v1.SetDefaults_Volume(a) + if a.VolumeSource.Secret != nil { + v1.SetDefaults_SecretVolumeSource(a.VolumeSource.Secret) + } + if a.VolumeSource.ISCSI != nil { + v1.SetDefaults_ISCSIVolumeSource(a.VolumeSource.ISCSI) + } + if a.VolumeSource.RBD != nil { + v1.SetDefaults_RBDVolumeSource(a.VolumeSource.RBD) + } + if a.VolumeSource.DownwardAPI != nil { + v1.SetDefaults_DownwardAPIVolumeSource(a.VolumeSource.DownwardAPI) + for j := range a.VolumeSource.DownwardAPI.Items { + b := &a.VolumeSource.DownwardAPI.Items[j] + if b.FieldRef != nil { + v1.SetDefaults_ObjectFieldSelector(b.FieldRef) + } + } + } + if a.VolumeSource.ConfigMap != nil { + v1.SetDefaults_ConfigMapVolumeSource(a.VolumeSource.ConfigMap) + } + if a.VolumeSource.AzureDisk != nil { + v1.SetDefaults_AzureDiskVolumeSource(a.VolumeSource.AzureDisk) + } + } + for i := range in.Spec.JobTemplate.Spec.Template.Spec.InitContainers { + a := &in.Spec.JobTemplate.Spec.Template.Spec.InitContainers[i] + v1.SetDefaults_Container(a) + for j := range a.Ports { + b := &a.Ports[j] + v1.SetDefaults_ContainerPort(b) + } + for j := range a.Env { + b := &a.Env[j] + if b.ValueFrom != nil { + if b.ValueFrom.FieldRef != nil { + v1.SetDefaults_ObjectFieldSelector(b.ValueFrom.FieldRef) + } + } + } + v1.SetDefaults_ResourceList(&a.Resources.Limits) + v1.SetDefaults_ResourceList(&a.Resources.Requests) + if a.LivenessProbe != nil { + v1.SetDefaults_Probe(a.LivenessProbe) + if a.LivenessProbe.Handler.HTTPGet != nil { + v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet) + } + } + if a.ReadinessProbe != nil { + v1.SetDefaults_Probe(a.ReadinessProbe) + if a.ReadinessProbe.Handler.HTTPGet != nil { + v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet) + } + } + if a.Lifecycle != nil { + if a.Lifecycle.PostStart != nil { + if a.Lifecycle.PostStart.HTTPGet != nil { + v1.SetDefaults_HTTPGetAction(a.Lifecycle.PostStart.HTTPGet) + } + } + if a.Lifecycle.PreStop != nil { + if a.Lifecycle.PreStop.HTTPGet != nil { + v1.SetDefaults_HTTPGetAction(a.Lifecycle.PreStop.HTTPGet) + } + } + } + } + for i := range in.Spec.JobTemplate.Spec.Template.Spec.Containers { + a := &in.Spec.JobTemplate.Spec.Template.Spec.Containers[i] + v1.SetDefaults_Container(a) + for j := range a.Ports { + b := &a.Ports[j] + v1.SetDefaults_ContainerPort(b) + } + for j := range a.Env { + b := &a.Env[j] + if b.ValueFrom != nil { + if b.ValueFrom.FieldRef != nil { + v1.SetDefaults_ObjectFieldSelector(b.ValueFrom.FieldRef) + } + } + } + v1.SetDefaults_ResourceList(&a.Resources.Limits) + v1.SetDefaults_ResourceList(&a.Resources.Requests) + if a.LivenessProbe != nil { + v1.SetDefaults_Probe(a.LivenessProbe) + if a.LivenessProbe.Handler.HTTPGet != nil { + v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet) + } + } + if a.ReadinessProbe != nil { + v1.SetDefaults_Probe(a.ReadinessProbe) + if a.ReadinessProbe.Handler.HTTPGet != nil { + v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet) + } + } + if a.Lifecycle != nil { + if a.Lifecycle.PostStart != nil { + if a.Lifecycle.PostStart.HTTPGet != nil { + v1.SetDefaults_HTTPGetAction(a.Lifecycle.PostStart.HTTPGet) + } + } + if a.Lifecycle.PreStop != nil { + if a.Lifecycle.PreStop.HTTPGet != nil { + v1.SetDefaults_HTTPGetAction(a.Lifecycle.PreStop.HTTPGet) + } + } + } + } +} + +func SetObjectDefaults_CronJobList(in *CronJobList) { + for i := range in.Items { + a := &in.Items[i] + SetObjectDefaults_CronJob(a) + } +} + func SetObjectDefaults_Job(in *Job) { SetDefaults_Job(in) v1.SetDefaults_PodSpec(&in.Spec.Template.Spec) @@ -276,127 +400,3 @@ func SetObjectDefaults_JobTemplate(in *JobTemplate) { } } } - -func SetObjectDefaults_ScheduledJob(in *ScheduledJob) { - SetDefaults_ScheduledJob(in) - v1.SetDefaults_PodSpec(&in.Spec.JobTemplate.Spec.Template.Spec) - for i := range in.Spec.JobTemplate.Spec.Template.Spec.Volumes { - a := &in.Spec.JobTemplate.Spec.Template.Spec.Volumes[i] - v1.SetDefaults_Volume(a) - if a.VolumeSource.Secret != nil { - v1.SetDefaults_SecretVolumeSource(a.VolumeSource.Secret) - } - if a.VolumeSource.ISCSI != nil { - v1.SetDefaults_ISCSIVolumeSource(a.VolumeSource.ISCSI) - } - if a.VolumeSource.RBD != nil { - v1.SetDefaults_RBDVolumeSource(a.VolumeSource.RBD) - } - if a.VolumeSource.DownwardAPI != nil { - v1.SetDefaults_DownwardAPIVolumeSource(a.VolumeSource.DownwardAPI) - for j := range a.VolumeSource.DownwardAPI.Items { - b := &a.VolumeSource.DownwardAPI.Items[j] - if b.FieldRef != nil { - v1.SetDefaults_ObjectFieldSelector(b.FieldRef) - } - } - } - if a.VolumeSource.ConfigMap != nil { - v1.SetDefaults_ConfigMapVolumeSource(a.VolumeSource.ConfigMap) - } - if a.VolumeSource.AzureDisk != nil { - v1.SetDefaults_AzureDiskVolumeSource(a.VolumeSource.AzureDisk) - } - } - for i := range in.Spec.JobTemplate.Spec.Template.Spec.InitContainers { - a := &in.Spec.JobTemplate.Spec.Template.Spec.InitContainers[i] - v1.SetDefaults_Container(a) - for j := range a.Ports { - b := &a.Ports[j] - v1.SetDefaults_ContainerPort(b) - } - for j := range a.Env { - b := &a.Env[j] - if b.ValueFrom != nil { - if b.ValueFrom.FieldRef != nil { - v1.SetDefaults_ObjectFieldSelector(b.ValueFrom.FieldRef) - } - } - } - v1.SetDefaults_ResourceList(&a.Resources.Limits) - v1.SetDefaults_ResourceList(&a.Resources.Requests) - if a.LivenessProbe != nil { - v1.SetDefaults_Probe(a.LivenessProbe) - if a.LivenessProbe.Handler.HTTPGet != nil { - v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet) - } - } - if a.ReadinessProbe != nil { - v1.SetDefaults_Probe(a.ReadinessProbe) - if a.ReadinessProbe.Handler.HTTPGet != nil { - v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet) - } - } - if a.Lifecycle != nil { - if a.Lifecycle.PostStart != nil { - if a.Lifecycle.PostStart.HTTPGet != nil { - v1.SetDefaults_HTTPGetAction(a.Lifecycle.PostStart.HTTPGet) - } - } - if a.Lifecycle.PreStop != nil { - if a.Lifecycle.PreStop.HTTPGet != nil { - v1.SetDefaults_HTTPGetAction(a.Lifecycle.PreStop.HTTPGet) - } - } - } - } - for i := range in.Spec.JobTemplate.Spec.Template.Spec.Containers { - a := &in.Spec.JobTemplate.Spec.Template.Spec.Containers[i] - v1.SetDefaults_Container(a) - for j := range a.Ports { - b := &a.Ports[j] - v1.SetDefaults_ContainerPort(b) - } - for j := range a.Env { - b := &a.Env[j] - if b.ValueFrom != nil { - if b.ValueFrom.FieldRef != nil { - v1.SetDefaults_ObjectFieldSelector(b.ValueFrom.FieldRef) - } - } - } - v1.SetDefaults_ResourceList(&a.Resources.Limits) - v1.SetDefaults_ResourceList(&a.Resources.Requests) - if a.LivenessProbe != nil { - v1.SetDefaults_Probe(a.LivenessProbe) - if a.LivenessProbe.Handler.HTTPGet != nil { - v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet) - } - } - if a.ReadinessProbe != nil { - v1.SetDefaults_Probe(a.ReadinessProbe) - if a.ReadinessProbe.Handler.HTTPGet != nil { - v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet) - } - } - if a.Lifecycle != nil { - if a.Lifecycle.PostStart != nil { - if a.Lifecycle.PostStart.HTTPGet != nil { - v1.SetDefaults_HTTPGetAction(a.Lifecycle.PostStart.HTTPGet) - } - } - if a.Lifecycle.PreStop != nil { - if a.Lifecycle.PreStop.HTTPGet != nil { - v1.SetDefaults_HTTPGetAction(a.Lifecycle.PreStop.HTTPGet) - } - } - } - } -} - -func SetObjectDefaults_ScheduledJobList(in *ScheduledJobList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_ScheduledJob(a) - } -} diff --git a/staging/src/k8s.io/client-go/pkg/apis/batch/zz_generated.deepcopy.go b/staging/src/k8s.io/client-go/pkg/apis/batch/zz_generated.deepcopy.go index 2014b885ecc..73c89eb565c 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/batch/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/client-go/pkg/apis/batch/zz_generated.deepcopy.go @@ -36,6 +36,10 @@ func init() { // to allow building arbitrary schemes. func RegisterDeepCopies(scheme *runtime.Scheme) error { return scheme.AddGeneratedDeepCopyFuncs( + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_CronJob, InType: reflect.TypeOf(&CronJob{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_CronJobList, InType: reflect.TypeOf(&CronJobList{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_CronJobSpec, InType: reflect.TypeOf(&CronJobSpec{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_CronJobStatus, InType: reflect.TypeOf(&CronJobStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_Job, InType: reflect.TypeOf(&Job{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobCondition, InType: reflect.TypeOf(&JobCondition{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobList, InType: reflect.TypeOf(&JobList{})}, @@ -43,13 +47,99 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobStatus, InType: reflect.TypeOf(&JobStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobTemplate, InType: reflect.TypeOf(&JobTemplate{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobTemplateSpec, InType: reflect.TypeOf(&JobTemplateSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_ScheduledJob, InType: reflect.TypeOf(&ScheduledJob{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_ScheduledJobList, InType: reflect.TypeOf(&ScheduledJobList{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_ScheduledJobSpec, InType: reflect.TypeOf(&ScheduledJobSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_ScheduledJobStatus, InType: reflect.TypeOf(&ScheduledJobStatus{})}, ) } +func DeepCopy_batch_CronJob(in interface{}, out interface{}, c *conversion.Cloner) error { + { + in := in.(*CronJob) + out := out.(*CronJob) + out.TypeMeta = in.TypeMeta + if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { + return err + } + if err := DeepCopy_batch_CronJobSpec(&in.Spec, &out.Spec, c); err != nil { + return err + } + if err := DeepCopy_batch_CronJobStatus(&in.Status, &out.Status, c); err != nil { + return err + } + return nil + } +} + +func DeepCopy_batch_CronJobList(in interface{}, out interface{}, c *conversion.Cloner) error { + { + in := in.(*CronJobList) + out := out.(*CronJobList) + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CronJob, len(*in)) + for i := range *in { + if err := DeepCopy_batch_CronJob(&(*in)[i], &(*out)[i], c); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil + } +} + +func DeepCopy_batch_CronJobSpec(in interface{}, out interface{}, c *conversion.Cloner) error { + { + in := in.(*CronJobSpec) + out := out.(*CronJobSpec) + out.Schedule = in.Schedule + if in.StartingDeadlineSeconds != nil { + in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds + *out = new(int64) + **out = **in + } else { + out.StartingDeadlineSeconds = nil + } + out.ConcurrencyPolicy = in.ConcurrencyPolicy + if in.Suspend != nil { + in, out := &in.Suspend, &out.Suspend + *out = new(bool) + **out = **in + } else { + out.Suspend = nil + } + if err := DeepCopy_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, c); err != nil { + return err + } + return nil + } +} + +func DeepCopy_batch_CronJobStatus(in interface{}, out interface{}, c *conversion.Cloner) error { + { + in := in.(*CronJobStatus) + out := out.(*CronJobStatus) + if in.Active != nil { + in, out := &in.Active, &out.Active + *out = make([]api.ObjectReference, len(*in)) + for i := range *in { + (*out)[i] = (*in)[i] + } + } else { + out.Active = nil + } + if in.LastScheduleTime != nil { + in, out := &in.LastScheduleTime, &out.LastScheduleTime + *out = new(unversioned.Time) + **out = (*in).DeepCopy() + } else { + out.LastScheduleTime = nil + } + return nil + } +} + func DeepCopy_batch_Job(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*Job) @@ -215,93 +305,3 @@ func DeepCopy_batch_JobTemplateSpec(in interface{}, out interface{}, c *conversi return nil } } - -func DeepCopy_batch_ScheduledJob(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScheduledJob) - out := out.(*ScheduledJob) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_batch_ScheduledJobSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_batch_ScheduledJobStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_batch_ScheduledJobList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScheduledJobList) - out := out.(*ScheduledJobList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ScheduledJob, len(*in)) - for i := range *in { - if err := DeepCopy_batch_ScheduledJob(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_batch_ScheduledJobSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScheduledJobSpec) - out := out.(*ScheduledJobSpec) - out.Schedule = in.Schedule - if in.StartingDeadlineSeconds != nil { - in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds - *out = new(int64) - **out = **in - } else { - out.StartingDeadlineSeconds = nil - } - out.ConcurrencyPolicy = in.ConcurrencyPolicy - if in.Suspend != nil { - in, out := &in.Suspend, &out.Suspend - *out = new(bool) - **out = **in - } else { - out.Suspend = nil - } - if err := DeepCopy_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_batch_ScheduledJobStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScheduledJobStatus) - out := out.(*ScheduledJobStatus) - if in.Active != nil { - in, out := &in.Active, &out.Active - *out = make([]api.ObjectReference, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Active = nil - } - if in.LastScheduleTime != nil { - in, out := &in.LastScheduleTime, &out.LastScheduleTime - *out = new(unversioned.Time) - **out = (*in).DeepCopy() - } else { - out.LastScheduleTime = nil - } - return nil - } -} diff --git a/staging/src/k8s.io/client-go/pkg/apis/certificates/v1alpha1/register.go b/staging/src/k8s.io/client-go/pkg/apis/certificates/v1alpha1/register.go index d5047c736fc..5cf65b96546 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/certificates/v1alpha1/register.go +++ b/staging/src/k8s.io/client-go/pkg/apis/certificates/v1alpha1/register.go @@ -51,6 +51,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &CertificateSigningRequestList{}, &v1.ListOptions{}, &v1.DeleteOptions{}, + &v1.ExportOptions{}, ) // Add the watch version that applies diff --git a/staging/src/k8s.io/client-go/pkg/apis/certificates/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/certificates/v1alpha1/zz_generated.conversion.go index 5d6574d6f73..8e45ea13012 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/certificates/v1alpha1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/certificates/v1alpha1/zz_generated.conversion.go @@ -24,6 +24,7 @@ import ( certificates "k8s.io/client-go/pkg/apis/certificates" conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" ) func init() { @@ -109,17 +110,7 @@ func Convert_certificates_CertificateSigningRequestCondition_To_v1alpha1_Certifi func autoConvert_v1alpha1_CertificateSigningRequestList_To_certificates_CertificateSigningRequestList(in *CertificateSigningRequestList, out *certificates.CertificateSigningRequestList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]certificates.CertificateSigningRequest, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_CertificateSigningRequest_To_certificates_CertificateSigningRequest(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]certificates.CertificateSigningRequest)(unsafe.Pointer(&in.Items)) return nil } @@ -129,17 +120,7 @@ func Convert_v1alpha1_CertificateSigningRequestList_To_certificates_CertificateS func autoConvert_certificates_CertificateSigningRequestList_To_v1alpha1_CertificateSigningRequestList(in *certificates.CertificateSigningRequestList, out *CertificateSigningRequestList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CertificateSigningRequest, len(*in)) - for i := range *in { - if err := Convert_certificates_CertificateSigningRequest_To_v1alpha1_CertificateSigningRequest(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]CertificateSigningRequest)(unsafe.Pointer(&in.Items)) return nil } @@ -148,12 +129,10 @@ func Convert_certificates_CertificateSigningRequestList_To_v1alpha1_CertificateS } func autoConvert_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateSigningRequestSpec(in *CertificateSigningRequestSpec, out *certificates.CertificateSigningRequestSpec, s conversion.Scope) error { - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Request, &out.Request, s); err != nil { - return err - } + out.Request = *(*[]byte)(unsafe.Pointer(&in.Request)) out.Username = in.Username out.UID = in.UID - out.Groups = in.Groups + out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) return nil } @@ -162,12 +141,10 @@ func Convert_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateS } func autoConvert_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateSigningRequestSpec(in *certificates.CertificateSigningRequestSpec, out *CertificateSigningRequestSpec, s conversion.Scope) error { - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Request, &out.Request, s); err != nil { - return err - } + out.Request = *(*[]byte)(unsafe.Pointer(&in.Request)) out.Username = in.Username out.UID = in.UID - out.Groups = in.Groups + out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) return nil } @@ -176,20 +153,8 @@ func Convert_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateS } func autoConvert_v1alpha1_CertificateSigningRequestStatus_To_certificates_CertificateSigningRequestStatus(in *CertificateSigningRequestStatus, out *certificates.CertificateSigningRequestStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]certificates.CertificateSigningRequestCondition, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_CertificateSigningRequestCondition_To_certificates_CertificateSigningRequestCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Certificate, &out.Certificate, s); err != nil { - return err - } + out.Conditions = *(*[]certificates.CertificateSigningRequestCondition)(unsafe.Pointer(&in.Conditions)) + out.Certificate = *(*[]byte)(unsafe.Pointer(&in.Certificate)) return nil } @@ -198,20 +163,8 @@ func Convert_v1alpha1_CertificateSigningRequestStatus_To_certificates_Certificat } func autoConvert_certificates_CertificateSigningRequestStatus_To_v1alpha1_CertificateSigningRequestStatus(in *certificates.CertificateSigningRequestStatus, out *CertificateSigningRequestStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]CertificateSigningRequestCondition, len(*in)) - for i := range *in { - if err := Convert_certificates_CertificateSigningRequestCondition_To_v1alpha1_CertificateSigningRequestCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Certificate, &out.Certificate, s); err != nil { - return err - } + out.Conditions = *(*[]CertificateSigningRequestCondition)(unsafe.Pointer(&in.Conditions)) + out.Certificate = *(*[]byte)(unsafe.Pointer(&in.Certificate)) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/types.go b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/types.go index c5eeb5f1385..e8de5f8d943 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/types.go @@ -78,8 +78,12 @@ type KubeProxyConfiguration struct { // regardless of conntrackMaxPerCore (set conntrackMaxPerCore=0 to leave the limit as-is). ConntrackMin int32 `json:"conntrackMin"` // conntrackTCPEstablishedTimeout is how long an idle TCP connection will be kept open - // (e.g. '250ms', '2s'). Must be greater than 0. + // (e.g. '2s'). Must be greater than 0. ConntrackTCPEstablishedTimeout unversioned.Duration `json:"conntrackTCPEstablishedTimeout"` + // conntrackTCPCloseWaitTimeout is how long an idle conntrack entry + // in CLOSE_WAIT state will remain in the conntrack + // table. (e.g. '60s'). Must be greater than 0 to set. + ConntrackTCPCloseWaitTimeout unversioned.Duration `json:"conntrackTCPCloseWaitTimeout"` } // Currently two modes of proxying are available: 'userspace' (older, stable) or 'iptables' @@ -455,10 +459,15 @@ type KubeletConfiguration struct { // Whitelist of unsafe sysctls or sysctl patterns (ending in *). // +optional AllowedUnsafeSysctls []string `json:"experimentalAllowedUnsafeSysctls,omitempty"` - // How to integrate with runtime. If set to cri, kubelet will switch to - // using the new Container Runtine Interface. + // featureGates is a string of comma-separated key=value pairs that describe feature + // gates for alpha/experimental features. + FeatureGates string `json:"featureGates"` + // Enable Container Runtime Interface (CRI) integration. // +optional - ExperimentalRuntimeIntegrationType string `json:"experimentalRuntimeIntegrationType,omitempty"` + EnableCRI bool `json:"enableCRI,omitempty"` + // TODO(#34726:1.8.0): Remove the opt-in for failing when swap is enabled. + // Tells the Kubelet to fail to start if swap is enabled on the node. + ExperimentalFailSwapOn bool `json:"experimentalFailSwapOn,omitempty"` } type KubeletAuthorizationMode string @@ -582,6 +591,9 @@ type KubeControllerManagerConfiguration struct { Port int32 `json:"port"` // address is the IP address to serve on (set to 0.0.0.0 for all interfaces). Address string `json:"address"` + // useServiceAccountCredentials indicates whether controllers should be run with + // individual service account credentials. + UseServiceAccountCredentials bool `json:"useServiceAccountCredentials"` // cloudProvider is the provider for cloud services. CloudProvider string `json:"cloudProvider"` // cloudConfigFile is the path to the cloud provider configuration file. diff --git a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/defaults.go b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/defaults.go index 70b395e1688..cab475efcef 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/defaults.go +++ b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/defaults.go @@ -101,6 +101,29 @@ func SetDefaults_KubeProxyConfiguration(obj *KubeProxyConfiguration) { if obj.ConntrackTCPEstablishedTimeout == zero { obj.ConntrackTCPEstablishedTimeout = unversioned.Duration{Duration: 24 * time.Hour} // 1 day (1/5 default) } + if obj.ConntrackTCPCloseWaitTimeout == zero { + // See https://github.com/kubernetes/kubernetes/issues/32551. + // + // CLOSE_WAIT conntrack state occurs when the the Linux kernel + // sees a FIN from the remote server. Note: this is a half-close + // condition that persists as long as the local side keeps the + // socket open. The condition is rare as it is typical in most + // protocols for both sides to issue a close; this typically + // occurs when the local socket is lazily garbage collected. + // + // If the CLOSE_WAIT conntrack entry expires, then FINs from the + // local socket will not be properly SNAT'd and will not reach the + // remote server (if the connection was subject to SNAT). If the + // remote timeouts for FIN_WAIT* states exceed the CLOSE_WAIT + // timeout, then there will be an inconsistency in the state of + // the connection and a new connection reusing the SNAT (src, + // port) pair may be rejected by the remote side with RST. This + // can cause new calls to connect(2) to return with ECONNREFUSED. + // + // We set CLOSE_WAIT to one hour by default to better match + // typical server timeouts. + obj.ConntrackTCPCloseWaitTimeout = unversioned.Duration{Duration: 1 * time.Hour} + } } func SetDefaults_KubeSchedulerConfiguration(obj *KubeSchedulerConfiguration) { @@ -196,7 +219,7 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) { if obj.DockerExecHandlerName == "" { obj.DockerExecHandlerName = "native" } - if obj.DockerEndpoint == "" { + if obj.DockerEndpoint == "" && runtime.GOOS != "windows" { obj.DockerEndpoint = "unix:///var/run/docker.sock" } if obj.EventBurst == 0 { @@ -368,13 +391,23 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) { temp := int32(defaultIPTablesDropBit) obj.IPTablesDropBit = &temp } - if obj.CgroupDriver == "" { - obj.CgroupDriver = "cgroupfs" - } if obj.CgroupsPerQOS == nil { temp := false obj.CgroupsPerQOS = &temp } + if obj.CgroupDriver == "" { + obj.CgroupDriver = "cgroupfs" + } + // NOTE: this is for backwards compatibility with earlier releases where cgroup-root was optional. + // if cgroups per qos is not enabled, and cgroup-root is not specified, we need to default to the + // container runtime default and not default to the root cgroup. + if obj.CgroupsPerQOS != nil { + if *obj.CgroupsPerQOS { + if obj.CgroupRoot == "" { + obj.CgroupRoot = "/" + } + } + } } func boolVar(b bool) *bool { diff --git a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/types.go b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/types.go index f23b1239423..c405939d02e 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/types.go @@ -74,9 +74,13 @@ type KubeProxyConfiguration struct { // conntrackMin is the minimum value of connect-tracking records to allocate, // regardless of conntrackMaxPerCore (set conntrackMaxPerCore=0 to leave the limit as-is). ConntrackMin int32 `json:"conntrackMin"` - // conntrackTCPEstablishedTimeout is how long an idle TCP connection will be kept open - // (e.g. '250ms', '2s'). Must be greater than 0. + // conntrackTCPEstablishedTimeout is how long an idle TCP connection + // will be kept open (e.g. '2s'). Must be greater than 0. ConntrackTCPEstablishedTimeout unversioned.Duration `json:"conntrackTCPEstablishedTimeout"` + // conntrackTCPCloseWaitTimeout is how long an idle conntrack entry + // in CLOSE_WAIT state will remain in the conntrack + // table. (e.g. '60s'). Must be greater than 0 to set. + ConntrackTCPCloseWaitTimeout unversioned.Duration `json:"conntrackTCPCloseWaitTimeout"` } // Currently two modes of proxying are available: 'userspace' (older, stable) or 'iptables' @@ -494,10 +498,15 @@ type KubeletConfiguration struct { // Resource isolation might be lacking and pod might influence each other on the same node. // +optional AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty"` - // How to integrate with runtime. If set to CRI, kubelet will switch to - // using the new Container Runtine Interface. + // featureGates is a string of comma-separated key=value pairs that describe feature + // gates for alpha/experimental features. + FeatureGates string `json:"featureGates,omitempty"` + // Enable Container Runtime Interface (CRI) integration. // +optional - ExperimentalRuntimeIntegrationType string `json:"experimentalRuntimeIntegrationType,omitempty"` + EnableCRI bool `json:"enableCRI,omitempty"` + // TODO(#34726:1.8.0): Remove the opt-in for failing when swap is enabled. + // Tells the Kubelet to fail to start if swap is enabled on the node. + ExperimentalFailSwapOn bool `json:"experimentalFailSwapOn,omitempty"` } type KubeletAuthorizationMode string diff --git a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go index 6df51a1cde6..9301d923b7f 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go @@ -26,6 +26,7 @@ import ( conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" config "k8s.io/client-go/pkg/util/config" + unsafe "unsafe" ) func init() { @@ -65,12 +66,13 @@ func autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyCon out.HealthzBindAddress = in.HealthzBindAddress out.HealthzPort = in.HealthzPort out.HostnameOverride = in.HostnameOverride - out.IPTablesMasqueradeBit = in.IPTablesMasqueradeBit + out.IPTablesMasqueradeBit = (*int32)(unsafe.Pointer(in.IPTablesMasqueradeBit)) out.IPTablesSyncPeriod = in.IPTablesSyncPeriod + out.IPTablesMinSyncPeriod = in.IPTablesMinSyncPeriod out.KubeconfigPath = in.KubeconfigPath out.MasqueradeAll = in.MasqueradeAll out.Master = in.Master - out.OOMScoreAdj = in.OOMScoreAdj + out.OOMScoreAdj = (*int32)(unsafe.Pointer(in.OOMScoreAdj)) out.Mode = componentconfig.ProxyMode(in.Mode) out.PortRange = in.PortRange out.ResourceContainer = in.ResourceContainer @@ -79,6 +81,7 @@ func autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyCon out.ConntrackMaxPerCore = in.ConntrackMaxPerCore out.ConntrackMin = in.ConntrackMin out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout + out.ConntrackTCPCloseWaitTimeout = in.ConntrackTCPCloseWaitTimeout return nil } @@ -92,12 +95,13 @@ func autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyCon out.HealthzBindAddress = in.HealthzBindAddress out.HealthzPort = in.HealthzPort out.HostnameOverride = in.HostnameOverride - out.IPTablesMasqueradeBit = in.IPTablesMasqueradeBit + out.IPTablesMasqueradeBit = (*int32)(unsafe.Pointer(in.IPTablesMasqueradeBit)) out.IPTablesSyncPeriod = in.IPTablesSyncPeriod + out.IPTablesMinSyncPeriod = in.IPTablesMinSyncPeriod out.KubeconfigPath = in.KubeconfigPath out.MasqueradeAll = in.MasqueradeAll out.Master = in.Master - out.OOMScoreAdj = in.OOMScoreAdj + out.OOMScoreAdj = (*int32)(unsafe.Pointer(in.OOMScoreAdj)) out.Mode = ProxyMode(in.Mode) out.PortRange = in.PortRange out.ResourceContainer = in.ResourceContainer @@ -106,6 +110,7 @@ func autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyCon out.ConntrackMaxPerCore = in.ConntrackMaxPerCore out.ConntrackMin = in.ConntrackMin out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout + out.ConntrackTCPCloseWaitTimeout = in.ConntrackTCPCloseWaitTimeout return nil } @@ -271,9 +276,9 @@ func autoConvert_v1alpha1_KubeletConfiguration_To_componentconfig_KubeletConfigu if err := api.Convert_Pointer_bool_To_bool(&in.AllowPrivileged, &out.AllowPrivileged, s); err != nil { return err } - out.HostNetworkSources = in.HostNetworkSources - out.HostPIDSources = in.HostPIDSources - out.HostIPCSources = in.HostIPCSources + out.HostNetworkSources = *(*[]string)(unsafe.Pointer(&in.HostNetworkSources)) + out.HostPIDSources = *(*[]string)(unsafe.Pointer(&in.HostPIDSources)) + out.HostIPCSources = *(*[]string)(unsafe.Pointer(&in.HostIPCSources)) if err := api.Convert_Pointer_int32_To_int32(&in.RegistryPullQPS, &out.RegistryPullQPS, s); err != nil { return err } @@ -372,7 +377,7 @@ func autoConvert_v1alpha1_KubeletConfiguration_To_componentconfig_KubeletConfigu } out.OutOfDiskTransitionFrequency = in.OutOfDiskTransitionFrequency out.NodeIP = in.NodeIP - out.NodeLabels = in.NodeLabels + out.NodeLabels = *(*map[string]string)(unsafe.Pointer(&in.NodeLabels)) out.NonMasqueradeCIDR = in.NonMasqueradeCIDR out.EnableCustomMetrics = in.EnableCustomMetrics if err := api.Convert_Pointer_string_To_string(&in.EvictionHard, &out.EvictionHard, s); err != nil { @@ -387,24 +392,8 @@ func autoConvert_v1alpha1_KubeletConfiguration_To_componentconfig_KubeletConfigu if err := api.Convert_Pointer_bool_To_bool(&in.EnableControllerAttachDetach, &out.EnableControllerAttachDetach, s); err != nil { return err } - if in.SystemReserved != nil { - in, out := &in.SystemReserved, &out.SystemReserved - *out = make(config.ConfigurationMap, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.SystemReserved = nil - } - if in.KubeReserved != nil { - in, out := &in.KubeReserved, &out.KubeReserved - *out = make(config.ConfigurationMap, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.KubeReserved = nil - } + out.SystemReserved = *(*config.ConfigurationMap)(unsafe.Pointer(&in.SystemReserved)) + out.KubeReserved = *(*config.ConfigurationMap)(unsafe.Pointer(&in.KubeReserved)) out.ProtectKernelDefaults = in.ProtectKernelDefaults if err := api.Convert_Pointer_bool_To_bool(&in.MakeIPTablesUtilChains, &out.MakeIPTablesUtilChains, s); err != nil { return err @@ -415,8 +404,10 @@ func autoConvert_v1alpha1_KubeletConfiguration_To_componentconfig_KubeletConfigu if err := api.Convert_Pointer_int32_To_int32(&in.IPTablesDropBit, &out.IPTablesDropBit, s); err != nil { return err } - out.AllowedUnsafeSysctls = in.AllowedUnsafeSysctls - out.ExperimentalRuntimeIntegrationType = in.ExperimentalRuntimeIntegrationType + out.AllowedUnsafeSysctls = *(*[]string)(unsafe.Pointer(&in.AllowedUnsafeSysctls)) + out.FeatureGates = in.FeatureGates + out.EnableCRI = in.EnableCRI + out.ExperimentalFailSwapOn = in.ExperimentalFailSwapOn return nil } @@ -454,9 +445,9 @@ func autoConvert_componentconfig_KubeletConfiguration_To_v1alpha1_KubeletConfigu if err := api.Convert_bool_To_Pointer_bool(&in.AllowPrivileged, &out.AllowPrivileged, s); err != nil { return err } - out.HostNetworkSources = in.HostNetworkSources - out.HostPIDSources = in.HostPIDSources - out.HostIPCSources = in.HostIPCSources + out.HostNetworkSources = *(*[]string)(unsafe.Pointer(&in.HostNetworkSources)) + out.HostPIDSources = *(*[]string)(unsafe.Pointer(&in.HostPIDSources)) + out.HostIPCSources = *(*[]string)(unsafe.Pointer(&in.HostIPCSources)) if err := api.Convert_int32_To_Pointer_int32(&in.RegistryPullQPS, &out.RegistryPullQPS, s); err != nil { return err } @@ -555,7 +546,7 @@ func autoConvert_componentconfig_KubeletConfiguration_To_v1alpha1_KubeletConfigu } out.OutOfDiskTransitionFrequency = in.OutOfDiskTransitionFrequency out.NodeIP = in.NodeIP - out.NodeLabels = in.NodeLabels + out.NodeLabels = *(*map[string]string)(unsafe.Pointer(&in.NodeLabels)) out.NonMasqueradeCIDR = in.NonMasqueradeCIDR out.EnableCustomMetrics = in.EnableCustomMetrics if err := api.Convert_string_To_Pointer_string(&in.EvictionHard, &out.EvictionHard, s); err != nil { @@ -570,24 +561,8 @@ func autoConvert_componentconfig_KubeletConfiguration_To_v1alpha1_KubeletConfigu if err := api.Convert_bool_To_Pointer_bool(&in.EnableControllerAttachDetach, &out.EnableControllerAttachDetach, s); err != nil { return err } - if in.SystemReserved != nil { - in, out := &in.SystemReserved, &out.SystemReserved - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.SystemReserved = nil - } - if in.KubeReserved != nil { - in, out := &in.KubeReserved, &out.KubeReserved - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.KubeReserved = nil - } + out.SystemReserved = *(*map[string]string)(unsafe.Pointer(&in.SystemReserved)) + out.KubeReserved = *(*map[string]string)(unsafe.Pointer(&in.KubeReserved)) out.ProtectKernelDefaults = in.ProtectKernelDefaults if err := api.Convert_bool_To_Pointer_bool(&in.MakeIPTablesUtilChains, &out.MakeIPTablesUtilChains, s); err != nil { return err @@ -598,8 +573,10 @@ func autoConvert_componentconfig_KubeletConfiguration_To_v1alpha1_KubeletConfigu if err := api.Convert_int32_To_Pointer_int32(&in.IPTablesDropBit, &out.IPTablesDropBit, s); err != nil { return err } - out.AllowedUnsafeSysctls = in.AllowedUnsafeSysctls - out.ExperimentalRuntimeIntegrationType = in.ExperimentalRuntimeIntegrationType + out.AllowedUnsafeSysctls = *(*[]string)(unsafe.Pointer(&in.AllowedUnsafeSysctls)) + out.FeatureGates = in.FeatureGates + out.EnableCRI = in.EnableCRI + out.ExperimentalFailSwapOn = in.ExperimentalFailSwapOn return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.deepcopy.go index f8746600bdf..b2b07e74ae3 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/v1alpha1/zz_generated.deepcopy.go @@ -65,6 +65,7 @@ func DeepCopy_v1alpha1_KubeProxyConfiguration(in interface{}, out interface{}, c out.IPTablesMasqueradeBit = nil } out.IPTablesSyncPeriod = in.IPTablesSyncPeriod + out.IPTablesMinSyncPeriod = in.IPTablesMinSyncPeriod out.KubeconfigPath = in.KubeconfigPath out.MasqueradeAll = in.MasqueradeAll out.Master = in.Master @@ -83,6 +84,7 @@ func DeepCopy_v1alpha1_KubeProxyConfiguration(in interface{}, out interface{}, c out.ConntrackMaxPerCore = in.ConntrackMaxPerCore out.ConntrackMin = in.ConntrackMin out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout + out.ConntrackTCPCloseWaitTimeout = in.ConntrackTCPCloseWaitTimeout return nil } } @@ -457,7 +459,9 @@ func DeepCopy_v1alpha1_KubeletConfiguration(in interface{}, out interface{}, c * } else { out.AllowedUnsafeSysctls = nil } - out.ExperimentalRuntimeIntegrationType = in.ExperimentalRuntimeIntegrationType + out.FeatureGates = in.FeatureGates + out.EnableCRI = in.EnableCRI + out.ExperimentalFailSwapOn = in.ExperimentalFailSwapOn return nil } } diff --git a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/zz_generated.deepcopy.go b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/zz_generated.deepcopy.go index 0a9d221d307..ffb27e13902 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/componentconfig/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/client-go/pkg/apis/componentconfig/zz_generated.deepcopy.go @@ -75,6 +75,7 @@ func DeepCopy_componentconfig_KubeControllerManagerConfiguration(in interface{}, out.TypeMeta = in.TypeMeta out.Port = in.Port out.Address = in.Address + out.UseServiceAccountCredentials = in.UseServiceAccountCredentials out.CloudProvider = in.CloudProvider out.CloudConfigFile = in.CloudConfigFile out.ConcurrentEndpointSyncs = in.ConcurrentEndpointSyncs @@ -153,6 +154,7 @@ func DeepCopy_componentconfig_KubeProxyConfiguration(in interface{}, out interfa out.IPTablesMasqueradeBit = nil } out.IPTablesSyncPeriod = in.IPTablesSyncPeriod + out.IPTablesMinSyncPeriod = in.IPTablesMinSyncPeriod out.KubeconfigPath = in.KubeconfigPath out.MasqueradeAll = in.MasqueradeAll out.Master = in.Master @@ -171,6 +173,7 @@ func DeepCopy_componentconfig_KubeProxyConfiguration(in interface{}, out interfa out.ConntrackMaxPerCore = in.ConntrackMaxPerCore out.ConntrackMin = in.ConntrackMin out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout + out.ConntrackTCPCloseWaitTimeout = in.ConntrackTCPCloseWaitTimeout return nil } } @@ -387,7 +390,9 @@ func DeepCopy_componentconfig_KubeletConfiguration(in interface{}, out interface } else { out.AllowedUnsafeSysctls = nil } - out.ExperimentalRuntimeIntegrationType = in.ExperimentalRuntimeIntegrationType + out.FeatureGates = in.FeatureGates + out.EnableCRI = in.EnableCRI + out.ExperimentalFailSwapOn = in.ExperimentalFailSwapOn return nil } } diff --git a/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/generated.proto b/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/generated.proto index e77401a6cfe..da5d6d3bd7d 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/generated.proto +++ b/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/generated.proto @@ -550,6 +550,7 @@ message IngressTLS { } // Job represents the configuration of a single job. +// DEPRECATED: extensions/v1beta1.Job is deprecated, use batch/v1.Job instead. message Job { // Standard object's metadata. // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata @@ -593,6 +594,7 @@ message JobCondition { } // JobList is a collection of jobs. +// DEPRECATED: extensions/v1beta1.JobList is deprecated, use batch/v1.JobList instead. message JobList { // Standard list metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata diff --git a/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/register.go b/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/register.go index 1f97e9cc53d..f8e81972bc5 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/register.go +++ b/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/register.go @@ -56,6 +56,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &IngressList{}, &v1.ListOptions{}, &v1.DeleteOptions{}, + &v1.ExportOptions{}, &ReplicaSet{}, &ReplicaSetList{}, &PodSecurityPolicy{}, diff --git a/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/types.go b/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/types.go index 5bf73da9f28..0f7b44ef7a4 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/types.go @@ -300,7 +300,7 @@ type DeploymentSpec struct { // implemented, the deployment controller will automatically rollback failed // deployments. Note that progress will not be estimated during the time a // deployment is paused. This is not set by default. - ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` + ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty" protobuf:"varint,9,opt,name=progressDeadlineSeconds"` } // DeploymentRollback stores the information required to rollback a deployment. @@ -406,7 +406,7 @@ type DeploymentStatus struct { UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"` // Represents the latest available observations of a deployment's current state. - Conditions []DeploymentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + Conditions []DeploymentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,6,rep,name=conditions"` } type DeploymentConditionType string @@ -433,9 +433,9 @@ type DeploymentCondition struct { // Status of the condition, one of True, False, Unknown. Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` // The last time this condition was updated. - LastUpdateTime unversioned.Time `json:"lastUpdateTime,omitempty"` + LastUpdateTime unversioned.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,6,opt,name=lastUpdateTime"` // Last time the condition transitioned from one status to another. - LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"` + LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,7,opt,name=lastTransitionTime"` // The reason for the condition's last transition. Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // A human readable message indicating details about the transition. @@ -617,6 +617,7 @@ type ThirdPartyResourceDataList struct { // +genclient=true // Job represents the configuration of a single job. +// DEPRECATED: extensions/v1beta1.Job is deprecated, use batch/v1.Job instead. type Job struct { unversioned.TypeMeta `json:",inline"` // Standard object's metadata. @@ -636,6 +637,7 @@ type Job struct { } // JobList is a collection of jobs. +// DEPRECATED: extensions/v1beta1.JobList is deprecated, use batch/v1.JobList instead. type JobList struct { unversioned.TypeMeta `json:",inline"` // Standard list metadata @@ -1022,7 +1024,7 @@ type ReplicaSetStatus struct { // Represents the latest available observations of a replica set's current state. // +optional - Conditions []ReplicaSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` + Conditions []ReplicaSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,6,rep,name=conditions"` } type ReplicaSetConditionType string @@ -1038,18 +1040,18 @@ const ( // ReplicaSetCondition describes the state of a replica set at a certain point. type ReplicaSetCondition struct { // Type of replica set condition. - Type ReplicaSetConditionType `json:"type"` + Type ReplicaSetConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ReplicaSetConditionType"` // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` + Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` // The last time the condition transitioned from one status to another. // +optional - LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"` + LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // The reason for the condition's last transition. // +optional - Reason string `json:"reason,omitempty"` + Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // A human readable message indicating details about the transition. // +optional - Message string `json:"message,omitempty"` + Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } // +genclient=true diff --git a/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go index 67b16cc0029..1fd1fd5bebe 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/types_swagger_doc_generated.go @@ -377,7 +377,7 @@ func (IngressTLS) SwaggerDoc() map[string]string { } var map_Job = map[string]string{ - "": "Job represents the configuration of a single job.", + "": "Job represents the configuration of a single job. DEPRECATED: extensions/v1beta1.Job is deprecated, use batch/v1.Job instead.", "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", "spec": "Spec is a structure defining the expected behavior of a job. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status", "status": "Status is a structure describing current status of a job. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status", @@ -402,7 +402,7 @@ func (JobCondition) SwaggerDoc() map[string]string { } var map_JobList = map[string]string{ - "": "JobList is a collection of jobs.", + "": "JobList is a collection of jobs. DEPRECATED: extensions/v1beta1.JobList is deprecated, use batch/v1.JobList instead.", "metadata": "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", "items": "Items is the list of Job.", } diff --git a/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/zz_generated.conversion.go index aab73f08f6b..ea0292d94bc 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/extensions/v1beta1/zz_generated.conversion.go @@ -22,12 +22,15 @@ package v1beta1 import ( api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" v1 "k8s.io/client-go/pkg/api/v1" autoscaling "k8s.io/client-go/pkg/apis/autoscaling" batch "k8s.io/client-go/pkg/apis/batch" extensions "k8s.io/client-go/pkg/apis/extensions" conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" + intstr "k8s.io/client-go/pkg/util/intstr" + unsafe "unsafe" ) func init() { @@ -212,17 +215,7 @@ func Convert_extensions_CustomMetricCurrentStatus_To_v1beta1_CustomMetricCurrent } func autoConvert_v1beta1_CustomMetricCurrentStatusList_To_extensions_CustomMetricCurrentStatusList(in *CustomMetricCurrentStatusList, out *extensions.CustomMetricCurrentStatusList, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]extensions.CustomMetricCurrentStatus, len(*in)) - for i := range *in { - if err := Convert_v1beta1_CustomMetricCurrentStatus_To_extensions_CustomMetricCurrentStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]extensions.CustomMetricCurrentStatus)(unsafe.Pointer(&in.Items)) return nil } @@ -231,17 +224,7 @@ func Convert_v1beta1_CustomMetricCurrentStatusList_To_extensions_CustomMetricCur } func autoConvert_extensions_CustomMetricCurrentStatusList_To_v1beta1_CustomMetricCurrentStatusList(in *extensions.CustomMetricCurrentStatusList, out *CustomMetricCurrentStatusList, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CustomMetricCurrentStatus, len(*in)) - for i := range *in { - if err := Convert_extensions_CustomMetricCurrentStatus_To_v1beta1_CustomMetricCurrentStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]CustomMetricCurrentStatus)(unsafe.Pointer(&in.Items)) return nil } @@ -270,17 +253,7 @@ func Convert_extensions_CustomMetricTarget_To_v1beta1_CustomMetricTarget(in *ext } func autoConvert_v1beta1_CustomMetricTargetList_To_extensions_CustomMetricTargetList(in *CustomMetricTargetList, out *extensions.CustomMetricTargetList, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]extensions.CustomMetricTarget, len(*in)) - for i := range *in { - if err := Convert_v1beta1_CustomMetricTarget_To_extensions_CustomMetricTarget(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]extensions.CustomMetricTarget)(unsafe.Pointer(&in.Items)) return nil } @@ -289,17 +262,7 @@ func Convert_v1beta1_CustomMetricTargetList_To_extensions_CustomMetricTargetList } func autoConvert_extensions_CustomMetricTargetList_To_v1beta1_CustomMetricTargetList(in *extensions.CustomMetricTargetList, out *CustomMetricTargetList, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CustomMetricTarget, len(*in)) - for i := range *in { - if err := Convert_extensions_CustomMetricTarget_To_v1beta1_CustomMetricTarget(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]CustomMetricTarget)(unsafe.Pointer(&in.Items)) return nil } @@ -384,7 +347,7 @@ func Convert_extensions_DaemonSetList_To_v1beta1_DaemonSetList(in *extensions.Da } func autoConvert_v1beta1_DaemonSetSpec_To_extensions_DaemonSetSpec(in *DaemonSetSpec, out *extensions.DaemonSetSpec, s conversion.Scope) error { - out.Selector = in.Selector + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } @@ -396,7 +359,7 @@ func Convert_v1beta1_DaemonSetSpec_To_extensions_DaemonSetSpec(in *DaemonSetSpec } func autoConvert_extensions_DaemonSetSpec_To_v1beta1_DaemonSetSpec(in *extensions.DaemonSetSpec, out *DaemonSetSpec, s conversion.Scope) error { - out.Selector = in.Selector + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } @@ -537,7 +500,7 @@ func Convert_extensions_DeploymentList_To_v1beta1_DeploymentList(in *extensions. func autoConvert_v1beta1_DeploymentRollback_To_extensions_DeploymentRollback(in *DeploymentRollback, out *extensions.DeploymentRollback, s conversion.Scope) error { out.Name = in.Name - out.UpdatedAnnotations = in.UpdatedAnnotations + out.UpdatedAnnotations = *(*map[string]string)(unsafe.Pointer(&in.UpdatedAnnotations)) if err := Convert_v1beta1_RollbackConfig_To_extensions_RollbackConfig(&in.RollbackTo, &out.RollbackTo, s); err != nil { return err } @@ -550,7 +513,7 @@ func Convert_v1beta1_DeploymentRollback_To_extensions_DeploymentRollback(in *Dep func autoConvert_extensions_DeploymentRollback_To_v1beta1_DeploymentRollback(in *extensions.DeploymentRollback, out *DeploymentRollback, s conversion.Scope) error { out.Name = in.Name - out.UpdatedAnnotations = in.UpdatedAnnotations + out.UpdatedAnnotations = *(*map[string]string)(unsafe.Pointer(&in.UpdatedAnnotations)) if err := Convert_extensions_RollbackConfig_To_v1beta1_RollbackConfig(&in.RollbackTo, &out.RollbackTo, s); err != nil { return err } @@ -565,7 +528,7 @@ func autoConvert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *Deploym if err := api.Convert_Pointer_int32_To_int32(&in.Replicas, &out.Replicas, s); err != nil { return err } - out.Selector = in.Selector + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } @@ -573,18 +536,10 @@ func autoConvert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *Deploym return err } out.MinReadySeconds = in.MinReadySeconds - out.RevisionHistoryLimit = in.RevisionHistoryLimit + out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit)) out.Paused = in.Paused - if in.RollbackTo != nil { - in, out := &in.RollbackTo, &out.RollbackTo - *out = new(extensions.RollbackConfig) - if err := Convert_v1beta1_RollbackConfig_To_extensions_RollbackConfig(*in, *out, s); err != nil { - return err - } - } else { - out.RollbackTo = nil - } - out.ProgressDeadlineSeconds = in.ProgressDeadlineSeconds + out.RollbackTo = (*extensions.RollbackConfig)(unsafe.Pointer(in.RollbackTo)) + out.ProgressDeadlineSeconds = (*int32)(unsafe.Pointer(in.ProgressDeadlineSeconds)) return nil } @@ -592,7 +547,7 @@ func autoConvert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensi if err := api.Convert_int32_To_Pointer_int32(&in.Replicas, &out.Replicas, s); err != nil { return err } - out.Selector = in.Selector + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } @@ -600,18 +555,10 @@ func autoConvert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensi return err } out.MinReadySeconds = in.MinReadySeconds - out.RevisionHistoryLimit = in.RevisionHistoryLimit + out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit)) out.Paused = in.Paused - if in.RollbackTo != nil { - in, out := &in.RollbackTo, &out.RollbackTo - *out = new(RollbackConfig) - if err := Convert_extensions_RollbackConfig_To_v1beta1_RollbackConfig(*in, *out, s); err != nil { - return err - } - } else { - out.RollbackTo = nil - } - out.ProgressDeadlineSeconds = in.ProgressDeadlineSeconds + out.RollbackTo = (*RollbackConfig)(unsafe.Pointer(in.RollbackTo)) + out.ProgressDeadlineSeconds = (*int32)(unsafe.Pointer(in.ProgressDeadlineSeconds)) return nil } @@ -621,17 +568,7 @@ func autoConvert_v1beta1_DeploymentStatus_To_extensions_DeploymentStatus(in *Dep out.UpdatedReplicas = in.UpdatedReplicas out.AvailableReplicas = in.AvailableReplicas out.UnavailableReplicas = in.UnavailableReplicas - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]extensions.DeploymentCondition, len(*in)) - for i := range *in { - if err := Convert_v1beta1_DeploymentCondition_To_extensions_DeploymentCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } + out.Conditions = *(*[]extensions.DeploymentCondition)(unsafe.Pointer(&in.Conditions)) return nil } @@ -645,17 +582,7 @@ func autoConvert_extensions_DeploymentStatus_To_v1beta1_DeploymentStatus(in *ext out.UpdatedReplicas = in.UpdatedReplicas out.AvailableReplicas = in.AvailableReplicas out.UnavailableReplicas = in.UnavailableReplicas - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]DeploymentCondition, len(*in)) - for i := range *in { - if err := Convert_extensions_DeploymentCondition_To_v1beta1_DeploymentCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } + out.Conditions = *(*[]DeploymentCondition)(unsafe.Pointer(&in.Conditions)) return nil } @@ -713,17 +640,7 @@ func Convert_api_ExportOptions_To_v1beta1_ExportOptions(in *api.ExportOptions, o func autoConvert_v1beta1_FSGroupStrategyOptions_To_extensions_FSGroupStrategyOptions(in *FSGroupStrategyOptions, out *extensions.FSGroupStrategyOptions, s conversion.Scope) error { out.Rule = extensions.FSGroupStrategyType(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]extensions.IDRange, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IDRange_To_extensions_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } + out.Ranges = *(*[]extensions.IDRange)(unsafe.Pointer(&in.Ranges)) return nil } @@ -733,17 +650,7 @@ func Convert_v1beta1_FSGroupStrategyOptions_To_extensions_FSGroupStrategyOptions func autoConvert_extensions_FSGroupStrategyOptions_To_v1beta1_FSGroupStrategyOptions(in *extensions.FSGroupStrategyOptions, out *FSGroupStrategyOptions, s conversion.Scope) error { out.Rule = FSGroupStrategyType(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - if err := Convert_extensions_IDRange_To_v1beta1_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } + out.Ranges = *(*[]IDRange)(unsafe.Pointer(&in.Ranges)) return nil } @@ -776,17 +683,7 @@ func Convert_extensions_HTTPIngressPath_To_v1beta1_HTTPIngressPath(in *extension } func autoConvert_v1beta1_HTTPIngressRuleValue_To_extensions_HTTPIngressRuleValue(in *HTTPIngressRuleValue, out *extensions.HTTPIngressRuleValue, s conversion.Scope) error { - if in.Paths != nil { - in, out := &in.Paths, &out.Paths - *out = make([]extensions.HTTPIngressPath, len(*in)) - for i := range *in { - if err := Convert_v1beta1_HTTPIngressPath_To_extensions_HTTPIngressPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Paths = nil - } + out.Paths = *(*[]extensions.HTTPIngressPath)(unsafe.Pointer(&in.Paths)) return nil } @@ -795,17 +692,7 @@ func Convert_v1beta1_HTTPIngressRuleValue_To_extensions_HTTPIngressRuleValue(in } func autoConvert_extensions_HTTPIngressRuleValue_To_v1beta1_HTTPIngressRuleValue(in *extensions.HTTPIngressRuleValue, out *HTTPIngressRuleValue, s conversion.Scope) error { - if in.Paths != nil { - in, out := &in.Paths, &out.Paths - *out = make([]HTTPIngressPath, len(*in)) - for i := range *in { - if err := Convert_extensions_HTTPIngressPath_To_v1beta1_HTTPIngressPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Paths = nil - } + out.Paths = *(*[]HTTPIngressPath)(unsafe.Pointer(&in.Paths)) return nil } @@ -891,7 +778,7 @@ func Convert_autoscaling_HorizontalPodAutoscalerList_To_v1beta1_HorizontalPodAut func autoConvert_v1beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(in *HorizontalPodAutoscalerSpec, out *autoscaling.HorizontalPodAutoscalerSpec, s conversion.Scope) error { // WARNING: in.ScaleRef requires manual conversion: does not exist in peer-type - out.MinReplicas = in.MinReplicas + out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas)) out.MaxReplicas = in.MaxReplicas // WARNING: in.CPUUtilization requires manual conversion: does not exist in peer-type return nil @@ -899,18 +786,18 @@ func autoConvert_v1beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPo func autoConvert_autoscaling_HorizontalPodAutoscalerSpec_To_v1beta1_HorizontalPodAutoscalerSpec(in *autoscaling.HorizontalPodAutoscalerSpec, out *HorizontalPodAutoscalerSpec, s conversion.Scope) error { // WARNING: in.ScaleTargetRef requires manual conversion: does not exist in peer-type - out.MinReplicas = in.MinReplicas + out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas)) out.MaxReplicas = in.MaxReplicas // WARNING: in.TargetCPUUtilizationPercentage requires manual conversion: does not exist in peer-type return nil } func autoConvert_v1beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *autoscaling.HorizontalPodAutoscalerStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.LastScaleTime = in.LastScaleTime + out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration)) + out.LastScaleTime = (*unversioned.Time)(unsafe.Pointer(in.LastScaleTime)) out.CurrentReplicas = in.CurrentReplicas out.DesiredReplicas = in.DesiredReplicas - out.CurrentCPUUtilizationPercentage = in.CurrentCPUUtilizationPercentage + out.CurrentCPUUtilizationPercentage = (*int32)(unsafe.Pointer(in.CurrentCPUUtilizationPercentage)) return nil } @@ -919,11 +806,11 @@ func Convert_v1beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodA } func autoConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v1beta1_HorizontalPodAutoscalerStatus(in *autoscaling.HorizontalPodAutoscalerStatus, out *HorizontalPodAutoscalerStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.LastScaleTime = in.LastScaleTime + out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration)) + out.LastScaleTime = (*unversioned.Time)(unsafe.Pointer(in.LastScaleTime)) out.CurrentReplicas = in.CurrentReplicas out.DesiredReplicas = in.DesiredReplicas - out.CurrentCPUUtilizationPercentage = in.CurrentCPUUtilizationPercentage + out.CurrentCPUUtilizationPercentage = (*int32)(unsafe.Pointer(in.CurrentCPUUtilizationPercentage)) return nil } @@ -1029,17 +916,7 @@ func Convert_extensions_IngressBackend_To_v1beta1_IngressBackend(in *extensions. func autoConvert_v1beta1_IngressList_To_extensions_IngressList(in *IngressList, out *extensions.IngressList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]extensions.Ingress, len(*in)) - for i := range *in { - if err := Convert_v1beta1_Ingress_To_extensions_Ingress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]extensions.Ingress)(unsafe.Pointer(&in.Items)) return nil } @@ -1049,17 +926,7 @@ func Convert_v1beta1_IngressList_To_extensions_IngressList(in *IngressList, out func autoConvert_extensions_IngressList_To_v1beta1_IngressList(in *extensions.IngressList, out *IngressList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Ingress, len(*in)) - for i := range *in { - if err := Convert_extensions_Ingress_To_v1beta1_Ingress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]Ingress)(unsafe.Pointer(&in.Items)) return nil } @@ -1092,15 +959,7 @@ func Convert_extensions_IngressRule_To_v1beta1_IngressRule(in *extensions.Ingres } func autoConvert_v1beta1_IngressRuleValue_To_extensions_IngressRuleValue(in *IngressRuleValue, out *extensions.IngressRuleValue, s conversion.Scope) error { - if in.HTTP != nil { - in, out := &in.HTTP, &out.HTTP - *out = new(extensions.HTTPIngressRuleValue) - if err := Convert_v1beta1_HTTPIngressRuleValue_To_extensions_HTTPIngressRuleValue(*in, *out, s); err != nil { - return err - } - } else { - out.HTTP = nil - } + out.HTTP = (*extensions.HTTPIngressRuleValue)(unsafe.Pointer(in.HTTP)) return nil } @@ -1109,15 +968,7 @@ func Convert_v1beta1_IngressRuleValue_To_extensions_IngressRuleValue(in *Ingress } func autoConvert_extensions_IngressRuleValue_To_v1beta1_IngressRuleValue(in *extensions.IngressRuleValue, out *IngressRuleValue, s conversion.Scope) error { - if in.HTTP != nil { - in, out := &in.HTTP, &out.HTTP - *out = new(HTTPIngressRuleValue) - if err := Convert_extensions_HTTPIngressRuleValue_To_v1beta1_HTTPIngressRuleValue(*in, *out, s); err != nil { - return err - } - } else { - out.HTTP = nil - } + out.HTTP = (*HTTPIngressRuleValue)(unsafe.Pointer(in.HTTP)) return nil } @@ -1126,37 +977,9 @@ func Convert_extensions_IngressRuleValue_To_v1beta1_IngressRuleValue(in *extensi } func autoConvert_v1beta1_IngressSpec_To_extensions_IngressSpec(in *IngressSpec, out *extensions.IngressSpec, s conversion.Scope) error { - if in.Backend != nil { - in, out := &in.Backend, &out.Backend - *out = new(extensions.IngressBackend) - if err := Convert_v1beta1_IngressBackend_To_extensions_IngressBackend(*in, *out, s); err != nil { - return err - } - } else { - out.Backend = nil - } - if in.TLS != nil { - in, out := &in.TLS, &out.TLS - *out = make([]extensions.IngressTLS, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IngressTLS_To_extensions_IngressTLS(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.TLS = nil - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]extensions.IngressRule, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IngressRule_To_extensions_IngressRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Rules = nil - } + out.Backend = (*extensions.IngressBackend)(unsafe.Pointer(in.Backend)) + out.TLS = *(*[]extensions.IngressTLS)(unsafe.Pointer(&in.TLS)) + out.Rules = *(*[]extensions.IngressRule)(unsafe.Pointer(&in.Rules)) return nil } @@ -1165,37 +988,9 @@ func Convert_v1beta1_IngressSpec_To_extensions_IngressSpec(in *IngressSpec, out } func autoConvert_extensions_IngressSpec_To_v1beta1_IngressSpec(in *extensions.IngressSpec, out *IngressSpec, s conversion.Scope) error { - if in.Backend != nil { - in, out := &in.Backend, &out.Backend - *out = new(IngressBackend) - if err := Convert_extensions_IngressBackend_To_v1beta1_IngressBackend(*in, *out, s); err != nil { - return err - } - } else { - out.Backend = nil - } - if in.TLS != nil { - in, out := &in.TLS, &out.TLS - *out = make([]IngressTLS, len(*in)) - for i := range *in { - if err := Convert_extensions_IngressTLS_To_v1beta1_IngressTLS(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.TLS = nil - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]IngressRule, len(*in)) - for i := range *in { - if err := Convert_extensions_IngressRule_To_v1beta1_IngressRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Rules = nil - } + out.Backend = (*IngressBackend)(unsafe.Pointer(in.Backend)) + out.TLS = *(*[]IngressTLS)(unsafe.Pointer(&in.TLS)) + out.Rules = *(*[]IngressRule)(unsafe.Pointer(&in.Rules)) return nil } @@ -1228,7 +1023,7 @@ func Convert_extensions_IngressStatus_To_v1beta1_IngressStatus(in *extensions.In } func autoConvert_v1beta1_IngressTLS_To_extensions_IngressTLS(in *IngressTLS, out *extensions.IngressTLS, s conversion.Scope) error { - out.Hosts = in.Hosts + out.Hosts = *(*[]string)(unsafe.Pointer(&in.Hosts)) out.SecretName = in.SecretName return nil } @@ -1238,7 +1033,7 @@ func Convert_v1beta1_IngressTLS_To_extensions_IngressTLS(in *IngressTLS, out *ex } func autoConvert_extensions_IngressTLS_To_v1beta1_IngressTLS(in *extensions.IngressTLS, out *IngressTLS, s conversion.Scope) error { - out.Hosts = in.Hosts + out.Hosts = *(*[]string)(unsafe.Pointer(&in.Hosts)) out.SecretName = in.SecretName return nil } @@ -1352,10 +1147,10 @@ func Convert_batch_JobList_To_v1beta1_JobList(in *batch.JobList, out *JobList, s } func autoConvert_v1beta1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s conversion.Scope) error { - out.Parallelism = in.Parallelism - out.Completions = in.Completions - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - out.Selector = in.Selector + out.Parallelism = (*int32)(unsafe.Pointer(in.Parallelism)) + out.Completions = (*int32)(unsafe.Pointer(in.Completions)) + out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) // WARNING: in.AutoSelector requires manual conversion: does not exist in peer-type if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err @@ -1364,10 +1159,10 @@ func autoConvert_v1beta1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpe } func autoConvert_batch_JobSpec_To_v1beta1_JobSpec(in *batch.JobSpec, out *JobSpec, s conversion.Scope) error { - out.Parallelism = in.Parallelism - out.Completions = in.Completions - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - out.Selector = in.Selector + out.Parallelism = (*int32)(unsafe.Pointer(in.Parallelism)) + out.Completions = (*int32)(unsafe.Pointer(in.Completions)) + out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) // WARNING: in.ManualSelector requires manual conversion: does not exist in peer-type if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err @@ -1376,19 +1171,9 @@ func autoConvert_batch_JobSpec_To_v1beta1_JobSpec(in *batch.JobSpec, out *JobSpe } func autoConvert_v1beta1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]batch.JobCondition, len(*in)) - for i := range *in { - if err := Convert_v1beta1_JobCondition_To_batch_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime + out.Conditions = *(*[]batch.JobCondition)(unsafe.Pointer(&in.Conditions)) + out.StartTime = (*unversioned.Time)(unsafe.Pointer(in.StartTime)) + out.CompletionTime = (*unversioned.Time)(unsafe.Pointer(in.CompletionTime)) out.Active = in.Active out.Succeeded = in.Succeeded out.Failed = in.Failed @@ -1400,19 +1185,9 @@ func Convert_v1beta1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobS } func autoConvert_batch_JobStatus_To_v1beta1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]JobCondition, len(*in)) - for i := range *in { - if err := Convert_batch_JobCondition_To_v1beta1_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime + out.Conditions = *(*[]JobCondition)(unsafe.Pointer(&in.Conditions)) + out.StartTime = (*unversioned.Time)(unsafe.Pointer(in.StartTime)) + out.CompletionTime = (*unversioned.Time)(unsafe.Pointer(in.CompletionTime)) out.Active = in.Active out.Succeeded = in.Succeeded out.Failed = in.Failed @@ -1454,28 +1229,8 @@ func Convert_extensions_NetworkPolicy_To_v1beta1_NetworkPolicy(in *extensions.Ne } func autoConvert_v1beta1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule(in *NetworkPolicyIngressRule, out *extensions.NetworkPolicyIngressRule, s conversion.Scope) error { - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]extensions.NetworkPolicyPort, len(*in)) - for i := range *in { - if err := Convert_v1beta1_NetworkPolicyPort_To_extensions_NetworkPolicyPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - if in.From != nil { - in, out := &in.From, &out.From - *out = make([]extensions.NetworkPolicyPeer, len(*in)) - for i := range *in { - if err := Convert_v1beta1_NetworkPolicyPeer_To_extensions_NetworkPolicyPeer(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.From = nil - } + out.Ports = *(*[]extensions.NetworkPolicyPort)(unsafe.Pointer(&in.Ports)) + out.From = *(*[]extensions.NetworkPolicyPeer)(unsafe.Pointer(&in.From)) return nil } @@ -1484,28 +1239,8 @@ func Convert_v1beta1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngress } func autoConvert_extensions_NetworkPolicyIngressRule_To_v1beta1_NetworkPolicyIngressRule(in *extensions.NetworkPolicyIngressRule, out *NetworkPolicyIngressRule, s conversion.Scope) error { - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]NetworkPolicyPort, len(*in)) - for i := range *in { - if err := Convert_extensions_NetworkPolicyPort_To_v1beta1_NetworkPolicyPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - if in.From != nil { - in, out := &in.From, &out.From - *out = make([]NetworkPolicyPeer, len(*in)) - for i := range *in { - if err := Convert_extensions_NetworkPolicyPeer_To_v1beta1_NetworkPolicyPeer(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.From = nil - } + out.Ports = *(*[]NetworkPolicyPort)(unsafe.Pointer(&in.Ports)) + out.From = *(*[]NetworkPolicyPeer)(unsafe.Pointer(&in.From)) return nil } @@ -1515,17 +1250,7 @@ func Convert_extensions_NetworkPolicyIngressRule_To_v1beta1_NetworkPolicyIngress func autoConvert_v1beta1_NetworkPolicyList_To_extensions_NetworkPolicyList(in *NetworkPolicyList, out *extensions.NetworkPolicyList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]extensions.NetworkPolicy, len(*in)) - for i := range *in { - if err := Convert_v1beta1_NetworkPolicy_To_extensions_NetworkPolicy(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]extensions.NetworkPolicy)(unsafe.Pointer(&in.Items)) return nil } @@ -1535,17 +1260,7 @@ func Convert_v1beta1_NetworkPolicyList_To_extensions_NetworkPolicyList(in *Netwo func autoConvert_extensions_NetworkPolicyList_To_v1beta1_NetworkPolicyList(in *extensions.NetworkPolicyList, out *NetworkPolicyList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NetworkPolicy, len(*in)) - for i := range *in { - if err := Convert_extensions_NetworkPolicy_To_v1beta1_NetworkPolicy(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]NetworkPolicy)(unsafe.Pointer(&in.Items)) return nil } @@ -1554,8 +1269,8 @@ func Convert_extensions_NetworkPolicyList_To_v1beta1_NetworkPolicyList(in *exten } func autoConvert_v1beta1_NetworkPolicyPeer_To_extensions_NetworkPolicyPeer(in *NetworkPolicyPeer, out *extensions.NetworkPolicyPeer, s conversion.Scope) error { - out.PodSelector = in.PodSelector - out.NamespaceSelector = in.NamespaceSelector + out.PodSelector = (*unversioned.LabelSelector)(unsafe.Pointer(in.PodSelector)) + out.NamespaceSelector = (*unversioned.LabelSelector)(unsafe.Pointer(in.NamespaceSelector)) return nil } @@ -1564,8 +1279,8 @@ func Convert_v1beta1_NetworkPolicyPeer_To_extensions_NetworkPolicyPeer(in *Netwo } func autoConvert_extensions_NetworkPolicyPeer_To_v1beta1_NetworkPolicyPeer(in *extensions.NetworkPolicyPeer, out *NetworkPolicyPeer, s conversion.Scope) error { - out.PodSelector = in.PodSelector - out.NamespaceSelector = in.NamespaceSelector + out.PodSelector = (*unversioned.LabelSelector)(unsafe.Pointer(in.PodSelector)) + out.NamespaceSelector = (*unversioned.LabelSelector)(unsafe.Pointer(in.NamespaceSelector)) return nil } @@ -1574,14 +1289,8 @@ func Convert_extensions_NetworkPolicyPeer_To_v1beta1_NetworkPolicyPeer(in *exten } func autoConvert_v1beta1_NetworkPolicyPort_To_extensions_NetworkPolicyPort(in *NetworkPolicyPort, out *extensions.NetworkPolicyPort, s conversion.Scope) error { - if in.Protocol != nil { - in, out := &in.Protocol, &out.Protocol - *out = new(api.Protocol) - **out = api.Protocol(**in) - } else { - out.Protocol = nil - } - out.Port = in.Port + out.Protocol = (*api.Protocol)(unsafe.Pointer(in.Protocol)) + out.Port = (*intstr.IntOrString)(unsafe.Pointer(in.Port)) return nil } @@ -1590,14 +1299,8 @@ func Convert_v1beta1_NetworkPolicyPort_To_extensions_NetworkPolicyPort(in *Netwo } func autoConvert_extensions_NetworkPolicyPort_To_v1beta1_NetworkPolicyPort(in *extensions.NetworkPolicyPort, out *NetworkPolicyPort, s conversion.Scope) error { - if in.Protocol != nil { - in, out := &in.Protocol, &out.Protocol - *out = new(v1.Protocol) - **out = v1.Protocol(**in) - } else { - out.Protocol = nil - } - out.Port = in.Port + out.Protocol = (*v1.Protocol)(unsafe.Pointer(in.Protocol)) + out.Port = (*intstr.IntOrString)(unsafe.Pointer(in.Port)) return nil } @@ -1607,17 +1310,7 @@ func Convert_extensions_NetworkPolicyPort_To_v1beta1_NetworkPolicyPort(in *exten func autoConvert_v1beta1_NetworkPolicySpec_To_extensions_NetworkPolicySpec(in *NetworkPolicySpec, out *extensions.NetworkPolicySpec, s conversion.Scope) error { out.PodSelector = in.PodSelector - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]extensions.NetworkPolicyIngressRule, len(*in)) - for i := range *in { - if err := Convert_v1beta1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ingress = nil - } + out.Ingress = *(*[]extensions.NetworkPolicyIngressRule)(unsafe.Pointer(&in.Ingress)) return nil } @@ -1627,17 +1320,7 @@ func Convert_v1beta1_NetworkPolicySpec_To_extensions_NetworkPolicySpec(in *Netwo func autoConvert_extensions_NetworkPolicySpec_To_v1beta1_NetworkPolicySpec(in *extensions.NetworkPolicySpec, out *NetworkPolicySpec, s conversion.Scope) error { out.PodSelector = in.PodSelector - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]NetworkPolicyIngressRule, len(*in)) - for i := range *in { - if err := Convert_extensions_NetworkPolicyIngressRule_To_v1beta1_NetworkPolicyIngressRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ingress = nil - } + out.Ingress = *(*[]NetworkPolicyIngressRule)(unsafe.Pointer(&in.Ingress)) return nil } @@ -1717,42 +1400,10 @@ func Convert_extensions_PodSecurityPolicyList_To_v1beta1_PodSecurityPolicyList(i func autoConvert_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec(in *PodSecurityPolicySpec, out *extensions.PodSecurityPolicySpec, s conversion.Scope) error { out.Privileged = in.Privileged - if in.DefaultAddCapabilities != nil { - in, out := &in.DefaultAddCapabilities, &out.DefaultAddCapabilities - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = api.Capability((*in)[i]) - } - } else { - out.DefaultAddCapabilities = nil - } - if in.RequiredDropCapabilities != nil { - in, out := &in.RequiredDropCapabilities, &out.RequiredDropCapabilities - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = api.Capability((*in)[i]) - } - } else { - out.RequiredDropCapabilities = nil - } - if in.AllowedCapabilities != nil { - in, out := &in.AllowedCapabilities, &out.AllowedCapabilities - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = api.Capability((*in)[i]) - } - } else { - out.AllowedCapabilities = nil - } - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]extensions.FSType, len(*in)) - for i := range *in { - (*out)[i] = extensions.FSType((*in)[i]) - } - } else { - out.Volumes = nil - } + out.DefaultAddCapabilities = *(*[]api.Capability)(unsafe.Pointer(&in.DefaultAddCapabilities)) + out.RequiredDropCapabilities = *(*[]api.Capability)(unsafe.Pointer(&in.RequiredDropCapabilities)) + out.AllowedCapabilities = *(*[]api.Capability)(unsafe.Pointer(&in.AllowedCapabilities)) + out.Volumes = *(*[]extensions.FSType)(unsafe.Pointer(&in.Volumes)) out.HostNetwork = in.HostNetwork if in.HostPorts != nil { in, out := &in.HostPorts, &out.HostPorts @@ -1789,42 +1440,10 @@ func Convert_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec(i func autoConvert_extensions_PodSecurityPolicySpec_To_v1beta1_PodSecurityPolicySpec(in *extensions.PodSecurityPolicySpec, out *PodSecurityPolicySpec, s conversion.Scope) error { out.Privileged = in.Privileged - if in.DefaultAddCapabilities != nil { - in, out := &in.DefaultAddCapabilities, &out.DefaultAddCapabilities - *out = make([]v1.Capability, len(*in)) - for i := range *in { - (*out)[i] = v1.Capability((*in)[i]) - } - } else { - out.DefaultAddCapabilities = nil - } - if in.RequiredDropCapabilities != nil { - in, out := &in.RequiredDropCapabilities, &out.RequiredDropCapabilities - *out = make([]v1.Capability, len(*in)) - for i := range *in { - (*out)[i] = v1.Capability((*in)[i]) - } - } else { - out.RequiredDropCapabilities = nil - } - if in.AllowedCapabilities != nil { - in, out := &in.AllowedCapabilities, &out.AllowedCapabilities - *out = make([]v1.Capability, len(*in)) - for i := range *in { - (*out)[i] = v1.Capability((*in)[i]) - } - } else { - out.AllowedCapabilities = nil - } - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]FSType, len(*in)) - for i := range *in { - (*out)[i] = FSType((*in)[i]) - } - } else { - out.Volumes = nil - } + out.DefaultAddCapabilities = *(*[]v1.Capability)(unsafe.Pointer(&in.DefaultAddCapabilities)) + out.RequiredDropCapabilities = *(*[]v1.Capability)(unsafe.Pointer(&in.RequiredDropCapabilities)) + out.AllowedCapabilities = *(*[]v1.Capability)(unsafe.Pointer(&in.AllowedCapabilities)) + out.Volumes = *(*[]FSType)(unsafe.Pointer(&in.Volumes)) out.HostNetwork = in.HostNetwork if in.HostPorts != nil { in, out := &in.HostPorts, &out.HostPorts @@ -1966,7 +1585,7 @@ func autoConvert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec(in *Replica return err } out.MinReadySeconds = in.MinReadySeconds - out.Selector = in.Selector + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } @@ -1978,7 +1597,7 @@ func autoConvert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec(in *extensi return err } out.MinReadySeconds = in.MinReadySeconds - out.Selector = in.Selector + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } @@ -1991,17 +1610,7 @@ func autoConvert_v1beta1_ReplicaSetStatus_To_extensions_ReplicaSetStatus(in *Rep out.ReadyReplicas = in.ReadyReplicas out.AvailableReplicas = in.AvailableReplicas out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]extensions.ReplicaSetCondition, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ReplicaSetCondition_To_extensions_ReplicaSetCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } + out.Conditions = *(*[]extensions.ReplicaSetCondition)(unsafe.Pointer(&in.Conditions)) return nil } @@ -2015,17 +1624,7 @@ func autoConvert_extensions_ReplicaSetStatus_To_v1beta1_ReplicaSetStatus(in *ext out.ReadyReplicas = in.ReadyReplicas out.AvailableReplicas = in.AvailableReplicas out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ReplicaSetCondition, len(*in)) - for i := range *in { - if err := Convert_extensions_ReplicaSetCondition_To_v1beta1_ReplicaSetCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } + out.Conditions = *(*[]ReplicaSetCondition)(unsafe.Pointer(&in.Conditions)) return nil } @@ -2081,17 +1680,7 @@ func autoConvert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDepl func autoConvert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOptions(in *RunAsUserStrategyOptions, out *extensions.RunAsUserStrategyOptions, s conversion.Scope) error { out.Rule = extensions.RunAsUserStrategy(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]extensions.IDRange, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IDRange_To_extensions_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } + out.Ranges = *(*[]extensions.IDRange)(unsafe.Pointer(&in.Ranges)) return nil } @@ -2101,17 +1690,7 @@ func Convert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOpt func autoConvert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions(in *extensions.RunAsUserStrategyOptions, out *RunAsUserStrategyOptions, s conversion.Scope) error { out.Rule = RunAsUserStrategy(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - if err := Convert_extensions_IDRange_To_v1beta1_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } + out.Ranges = *(*[]IDRange)(unsafe.Pointer(&in.Ranges)) return nil } @@ -2121,16 +1700,7 @@ func Convert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOpt func autoConvert_v1beta1_SELinuxStrategyOptions_To_extensions_SELinuxStrategyOptions(in *SELinuxStrategyOptions, out *extensions.SELinuxStrategyOptions, s conversion.Scope) error { out.Rule = extensions.SELinuxStrategy(in.Rule) - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(api.SELinuxOptions) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } + out.SELinuxOptions = (*api.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions)) return nil } @@ -2140,16 +1710,7 @@ func Convert_v1beta1_SELinuxStrategyOptions_To_extensions_SELinuxStrategyOptions func autoConvert_extensions_SELinuxStrategyOptions_To_v1beta1_SELinuxStrategyOptions(in *extensions.SELinuxStrategyOptions, out *SELinuxStrategyOptions, s conversion.Scope) error { out.Rule = SELinuxStrategy(in.Rule) - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(v1.SELinuxOptions) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } + out.SELinuxOptions = (*v1.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions)) return nil } @@ -2226,17 +1787,7 @@ func autoConvert_extensions_ScaleStatus_To_v1beta1_ScaleStatus(in *extensions.Sc func autoConvert_v1beta1_SupplementalGroupsStrategyOptions_To_extensions_SupplementalGroupsStrategyOptions(in *SupplementalGroupsStrategyOptions, out *extensions.SupplementalGroupsStrategyOptions, s conversion.Scope) error { out.Rule = extensions.SupplementalGroupsStrategyType(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]extensions.IDRange, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IDRange_To_extensions_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } + out.Ranges = *(*[]extensions.IDRange)(unsafe.Pointer(&in.Ranges)) return nil } @@ -2246,17 +1797,7 @@ func Convert_v1beta1_SupplementalGroupsStrategyOptions_To_extensions_Supplementa func autoConvert_extensions_SupplementalGroupsStrategyOptions_To_v1beta1_SupplementalGroupsStrategyOptions(in *extensions.SupplementalGroupsStrategyOptions, out *SupplementalGroupsStrategyOptions, s conversion.Scope) error { out.Rule = SupplementalGroupsStrategyType(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - if err := Convert_extensions_IDRange_To_v1beta1_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } + out.Ranges = *(*[]IDRange)(unsafe.Pointer(&in.Ranges)) return nil } @@ -2270,17 +1811,7 @@ func autoConvert_v1beta1_ThirdPartyResource_To_extensions_ThirdPartyResource(in return err } out.Description = in.Description - if in.Versions != nil { - in, out := &in.Versions, &out.Versions - *out = make([]extensions.APIVersion, len(*in)) - for i := range *in { - if err := Convert_v1beta1_APIVersion_To_extensions_APIVersion(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Versions = nil - } + out.Versions = *(*[]extensions.APIVersion)(unsafe.Pointer(&in.Versions)) return nil } @@ -2294,17 +1825,7 @@ func autoConvert_extensions_ThirdPartyResource_To_v1beta1_ThirdPartyResource(in return err } out.Description = in.Description - if in.Versions != nil { - in, out := &in.Versions, &out.Versions - *out = make([]APIVersion, len(*in)) - for i := range *in { - if err := Convert_extensions_APIVersion_To_v1beta1_APIVersion(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Versions = nil - } + out.Versions = *(*[]APIVersion)(unsafe.Pointer(&in.Versions)) return nil } @@ -2317,9 +1838,7 @@ func autoConvert_v1beta1_ThirdPartyResourceData_To_extensions_ThirdPartyResource if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { return err } - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Data, &out.Data, s); err != nil { - return err - } + out.Data = *(*[]byte)(unsafe.Pointer(&in.Data)) return nil } @@ -2332,9 +1851,7 @@ func autoConvert_extensions_ThirdPartyResourceData_To_v1beta1_ThirdPartyResource if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { return err } - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Data, &out.Data, s); err != nil { - return err - } + out.Data = *(*[]byte)(unsafe.Pointer(&in.Data)) return nil } @@ -2344,17 +1861,7 @@ func Convert_extensions_ThirdPartyResourceData_To_v1beta1_ThirdPartyResourceData func autoConvert_v1beta1_ThirdPartyResourceDataList_To_extensions_ThirdPartyResourceDataList(in *ThirdPartyResourceDataList, out *extensions.ThirdPartyResourceDataList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]extensions.ThirdPartyResourceData, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ThirdPartyResourceData_To_extensions_ThirdPartyResourceData(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]extensions.ThirdPartyResourceData)(unsafe.Pointer(&in.Items)) return nil } @@ -2364,17 +1871,7 @@ func Convert_v1beta1_ThirdPartyResourceDataList_To_extensions_ThirdPartyResource func autoConvert_extensions_ThirdPartyResourceDataList_To_v1beta1_ThirdPartyResourceDataList(in *extensions.ThirdPartyResourceDataList, out *ThirdPartyResourceDataList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ThirdPartyResourceData, len(*in)) - for i := range *in { - if err := Convert_extensions_ThirdPartyResourceData_To_v1beta1_ThirdPartyResourceData(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]ThirdPartyResourceData)(unsafe.Pointer(&in.Items)) return nil } @@ -2384,17 +1881,7 @@ func Convert_extensions_ThirdPartyResourceDataList_To_v1beta1_ThirdPartyResource func autoConvert_v1beta1_ThirdPartyResourceList_To_extensions_ThirdPartyResourceList(in *ThirdPartyResourceList, out *extensions.ThirdPartyResourceList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]extensions.ThirdPartyResource, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ThirdPartyResource_To_extensions_ThirdPartyResource(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]extensions.ThirdPartyResource)(unsafe.Pointer(&in.Items)) return nil } @@ -2404,17 +1891,7 @@ func Convert_v1beta1_ThirdPartyResourceList_To_extensions_ThirdPartyResourceList func autoConvert_extensions_ThirdPartyResourceList_To_v1beta1_ThirdPartyResourceList(in *extensions.ThirdPartyResourceList, out *ThirdPartyResourceList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ThirdPartyResource, len(*in)) - for i := range *in { - if err := Convert_extensions_ThirdPartyResource_To_v1beta1_ThirdPartyResource(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]ThirdPartyResource)(unsafe.Pointer(&in.Items)) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/zz_generated.conversion.go index d9ebae3ed49..d4d09036250 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/imagepolicy/v1alpha1/zz_generated.conversion.go @@ -24,6 +24,7 @@ import ( imagepolicy "k8s.io/client-go/pkg/apis/imagepolicy" conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" ) func init() { @@ -100,18 +101,8 @@ func Convert_imagepolicy_ImageReviewContainerSpec_To_v1alpha1_ImageReviewContain } func autoConvert_v1alpha1_ImageReviewSpec_To_imagepolicy_ImageReviewSpec(in *ImageReviewSpec, out *imagepolicy.ImageReviewSpec, s conversion.Scope) error { - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]imagepolicy.ImageReviewContainerSpec, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_ImageReviewContainerSpec_To_imagepolicy_ImageReviewContainerSpec(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Containers = nil - } - out.Annotations = in.Annotations + out.Containers = *(*[]imagepolicy.ImageReviewContainerSpec)(unsafe.Pointer(&in.Containers)) + out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) out.Namespace = in.Namespace return nil } @@ -121,18 +112,8 @@ func Convert_v1alpha1_ImageReviewSpec_To_imagepolicy_ImageReviewSpec(in *ImageRe } func autoConvert_imagepolicy_ImageReviewSpec_To_v1alpha1_ImageReviewSpec(in *imagepolicy.ImageReviewSpec, out *ImageReviewSpec, s conversion.Scope) error { - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]ImageReviewContainerSpec, len(*in)) - for i := range *in { - if err := Convert_imagepolicy_ImageReviewContainerSpec_To_v1alpha1_ImageReviewContainerSpec(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Containers = nil - } - out.Annotations = in.Annotations + out.Containers = *(*[]ImageReviewContainerSpec)(unsafe.Pointer(&in.Containers)) + out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) out.Namespace = in.Namespace return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/env.go b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/env.go index d3df5b7d01a..687e89edc76 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/env.go +++ b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/env.go @@ -23,9 +23,11 @@ import ( "strings" ) +var GlobalEnvParams = SetEnvParams() + // TODO(phase2) use componentconfig // we need some params for testing etc, let's keep these hidden for now -func GetEnvParams() map[string]string { +func SetEnvParams() *EnvParams { envParams := map[string]string{ // TODO(phase1+): Mode prefix and host_pki_path to another place as constants, and use them everywhere @@ -36,7 +38,7 @@ func GetEnvParams() map[string]string { "hyperkube_image": "", "discovery_image": fmt.Sprintf("gcr.io/google_containers/kube-discovery-%s:%s", runtime.GOARCH, "1.0"), "etcd_image": "", - "component_loglevel": "--v=4", + "component_loglevel": "--v=2", } for k := range envParams { @@ -45,5 +47,13 @@ func GetEnvParams() map[string]string { } } - return envParams + return &EnvParams{ + KubernetesDir: envParams["kubernetes_dir"], + HostPKIPath: envParams["host_pki_path"], + HostEtcdPath: envParams["host_etcd_path"], + HyperkubeImage: envParams["hyperkube_image"], + DiscoveryImage: envParams["discovery_image"], + EtcdImage: envParams["etcd_image"], + ComponentLoglevel: envParams["component_loglevel"], + } } diff --git a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/register.go b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/register.go index 40c6d127d44..ca88aba1b1b 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/register.go +++ b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/register.go @@ -22,17 +22,17 @@ import ( "k8s.io/client-go/pkg/runtime" ) -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - // GroupName is the group name use in this package const GroupName = "kubeadm.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + // Kind takes an unqualified kind and returns a Group qualified GroupKind func Kind(kind string) unversioned.GroupKind { return SchemeGroupVersion.WithKind(kind).GroupKind() @@ -50,6 +50,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ClusterInfo{}, &api.ListOptions{}, &api.DeleteOptions{}, + &api.ExportOptions{}, ) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/types.go b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/types.go index 185beffa04e..f86f4ae4ecb 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/types.go @@ -18,6 +18,16 @@ package kubeadm import "k8s.io/client-go/pkg/api/unversioned" +type EnvParams struct { + KubernetesDir string + HostPKIPath string + HostEtcdPath string + HyperkubeImage string + DiscoveryImage string + EtcdImage string + ComponentLoglevel string +} + type MasterConfiguration struct { unversioned.TypeMeta diff --git a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/defaults.go b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/defaults.go new file mode 100644 index 00000000000..74d3ec2a1e9 --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/defaults.go @@ -0,0 +1,69 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "k8s.io/client-go/pkg/runtime" +) + +const ( + DefaultServiceDNSDomain = "cluster.local" + DefaultServicesSubnet = "10.96.0.0/12" + DefaultKubernetesVersion = "v1.4.4" + DefaultAPIBindPort = 6443 + DefaultDiscoveryBindPort = 9898 +) + +func addDefaultingFuncs(scheme *runtime.Scheme) error { + RegisterDefaults(scheme) + return scheme.AddDefaultingFuncs( + SetDefaults_MasterConfiguration, + SetDefaults_NodeConfiguration, + ) +} + +func SetDefaults_MasterConfiguration(obj *MasterConfiguration) { + if obj.KubernetesVersion == "" { + obj.KubernetesVersion = DefaultKubernetesVersion + } + + if obj.API.BindPort == 0 { + obj.API.BindPort = DefaultAPIBindPort + } + + if obj.Discovery.BindPort == 0 { + obj.Discovery.BindPort = DefaultDiscoveryBindPort + } + + if obj.Networking.ServiceSubnet == "" { + obj.Networking.ServiceSubnet = DefaultServicesSubnet + } + + if obj.Networking.DNSDomain == "" { + obj.Networking.DNSDomain = DefaultServiceDNSDomain + } +} + +func SetDefaults_NodeConfiguration(obj *NodeConfiguration) { + if obj.APIPort == 0 { + obj.APIPort = DefaultAPIBindPort + } + + if obj.DiscoveryPort == 0 { + obj.DiscoveryPort = DefaultDiscoveryBindPort + } +} diff --git a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/doc.go b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/doc.go index 7963bca2563..7ca9c7c2e12 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/doc.go +++ b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/doc.go @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +k8s:defaulter-gen=TypeMeta // +groupName=kubeadm.k8s.io package v1alpha1 diff --git a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/register.go b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/register.go index fddce4338e3..924209fb2b2 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/register.go +++ b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/register.go @@ -22,17 +22,17 @@ import ( "k8s.io/client-go/pkg/runtime" ) -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - // GroupName is the group name use in this package const GroupName = "kubeadm.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1alpha1"} +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs) + AddToScheme = SchemeBuilder.AddToScheme +) + // Kind takes an unqualified kind and returns a Group qualified GroupKind func Kind(kind string) unversioned.GroupKind { return SchemeGroupVersion.WithKind(kind).GroupKind() @@ -50,6 +50,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ClusterInfo{}, &v1.ListOptions{}, &v1.DeleteOptions{}, + &v1.ExportOptions{}, ) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/zz_generated.defaults.go b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/zz_generated.defaults.go new file mode 100644 index 00000000000..0f6162b0da4 --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/zz_generated.defaults.go @@ -0,0 +1,42 @@ +// +build !ignore_autogenerated + +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was autogenerated by defaulter-gen. Do not edit it manually! + +package v1alpha1 + +import ( + runtime "k8s.io/client-go/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&MasterConfiguration{}, func(obj interface{}) { SetObjectDefaults_MasterConfiguration(obj.(*MasterConfiguration)) }) + scheme.AddTypeDefaultingFunc(&NodeConfiguration{}, func(obj interface{}) { SetObjectDefaults_NodeConfiguration(obj.(*NodeConfiguration)) }) + return nil +} + +func SetObjectDefaults_MasterConfiguration(in *MasterConfiguration) { + SetDefaults_MasterConfiguration(in) +} + +func SetObjectDefaults_NodeConfiguration(in *NodeConfiguration) { + SetDefaults_NodeConfiguration(in) +} diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/install/install.go b/staging/src/k8s.io/client-go/pkg/apis/policy/install/install.go index 76ccfdb7f01..674b9043336 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/install/install.go +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/install/install.go @@ -21,19 +21,19 @@ package install import ( "k8s.io/client-go/pkg/apimachinery/announced" "k8s.io/client-go/pkg/apis/policy" - "k8s.io/client-go/pkg/apis/policy/v1alpha1" + "k8s.io/client-go/pkg/apis/policy/v1beta1" ) func init() { if err := announced.NewGroupMetaFactory( &announced.GroupMetaFactoryArgs{ GroupName: policy.GroupName, - VersionPreferenceOrder: []string{v1alpha1.SchemeGroupVersion.Version}, + VersionPreferenceOrder: []string{v1beta1.SchemeGroupVersion.Version}, ImportPrefix: "k8s.io/client-go/pkg/apis/policy", AddInternalObjectsToScheme: policy.AddToScheme, }, announced.VersionToSchemeFunc{ - v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme, + v1beta1.SchemeGroupVersion.Version: v1beta1.AddToScheme, }, ).Announce().RegisterAndEnable(); err != nil { panic(err) diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/types.generated.go b/staging/src/k8s.io/client-go/pkg/apis/policy/types.generated.go index c2a0757c169..4776790e8a2 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/types.generated.go +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/types.generated.go @@ -362,14 +362,14 @@ func (x *PodDisruptionBudgetStatus) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep24 := !z.EncBinary() yy2arr24 := z.EncBasicHandle().StructToArray - var yyq24 [4]bool + var yyq24 [5]bool _, _, _ = yysep24, yyq24, yy2arr24 const yyr24 bool = false var yynn24 int if yyr24 || yy2arr24 { - r.EncodeArrayStart(4) + r.EncodeArrayStart(5) } else { - yynn24 = 4 + yynn24 = 5 for _, b := range yyq24 { if b { yynn24++ @@ -384,17 +384,17 @@ func (x *PodDisruptionBudgetStatus) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym26 if false { } else { - r.EncodeBool(bool(x.PodDisruptionAllowed)) + r.EncodeInt(int64(x.PodDisruptionsAllowed)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("disruptionAllowed")) + r.EncodeString(codecSelferC_UTF81234, string("disruptionsAllowed")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym27 := z.EncBinary() _ = yym27 if false { } else { - r.EncodeBool(bool(x.PodDisruptionAllowed)) + r.EncodeInt(int64(x.PodDisruptionsAllowed)) } } if yyr24 || yy2arr24 { @@ -454,6 +454,33 @@ func (x *PodDisruptionBudgetStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(int64(x.ExpectedPods)) } } + if yyr24 || yy2arr24 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.DisruptedPods == nil { + r.EncodeNil() + } else { + yym38 := z.EncBinary() + _ = yym38 + if false { + } else { + h.encMapstringunversioned_Time((map[string]pkg2_unversioned.Time)(x.DisruptedPods), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("disruptedPods")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.DisruptedPods == nil { + r.EncodeNil() + } else { + yym39 := z.EncBinary() + _ = yym39 + if false { + } else { + h.encMapstringunversioned_Time((map[string]pkg2_unversioned.Time)(x.DisruptedPods), e) + } + } + } if yyr24 || yy2arr24 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -467,25 +494,25 @@ func (x *PodDisruptionBudgetStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym37 := z.DecBinary() - _ = yym37 + yym40 := z.DecBinary() + _ = yym40 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct38 := r.ContainerType() - if yyct38 == codecSelferValueTypeMap1234 { - yyl38 := r.ReadMapStart() - if yyl38 == 0 { + yyct41 := r.ContainerType() + if yyct41 == codecSelferValueTypeMap1234 { + yyl41 := r.ReadMapStart() + if yyl41 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl38, d) + x.codecDecodeSelfFromMap(yyl41, d) } - } else if yyct38 == codecSelferValueTypeArray1234 { - yyl38 := r.ReadArrayStart() - if yyl38 == 0 { + } else if yyct41 == codecSelferValueTypeArray1234 { + yyl41 := r.ReadArrayStart() + if yyl41 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl38, d) + x.codecDecodeSelfFromArray(yyl41, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -497,12 +524,12 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromMap(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys39Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys39Slc - var yyhl39 bool = l >= 0 - for yyj39 := 0; ; yyj39++ { - if yyhl39 { - if yyj39 >= l { + var yys42Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys42Slc + var yyhl42 bool = l >= 0 + for yyj42 := 0; ; yyj42++ { + if yyhl42 { + if yyj42 >= l { break } } else { @@ -511,15 +538,15 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromMap(l int, d *codec1978.D } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys39Slc = r.DecodeBytes(yys39Slc, true, true) - yys39 := string(yys39Slc) + yys42Slc = r.DecodeBytes(yys42Slc, true, true) + yys42 := string(yys42Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys39 { - case "disruptionAllowed": + switch yys42 { + case "disruptionsAllowed": if r.TryDecodeAsNil() { - x.PodDisruptionAllowed = false + x.PodDisruptionsAllowed = 0 } else { - x.PodDisruptionAllowed = bool(r.DecodeBool()) + x.PodDisruptionsAllowed = int32(r.DecodeInt(32)) } case "currentHealthy": if r.TryDecodeAsNil() { @@ -539,10 +566,22 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromMap(l int, d *codec1978.D } else { x.ExpectedPods = int32(r.DecodeInt(32)) } + case "disruptedPods": + if r.TryDecodeAsNil() { + x.DisruptedPods = nil + } else { + yyv47 := &x.DisruptedPods + yym48 := z.DecBinary() + _ = yym48 + if false { + } else { + h.decMapstringunversioned_Time((*map[string]pkg2_unversioned.Time)(yyv47), d) + } + } default: - z.DecStructFieldNotFound(-1, yys39) - } // end switch yys39 - } // end for yyj39 + z.DecStructFieldNotFound(-1, yys42) + } // end switch yys42 + } // end for yyj42 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -550,32 +589,32 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromArray(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj44 int - var yyb44 bool - var yyhl44 bool = l >= 0 - yyj44++ - if yyhl44 { - yyb44 = yyj44 > l + var yyj49 int + var yyb49 bool + var yyhl49 bool = l >= 0 + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l } else { - yyb44 = r.CheckBreak() + yyb49 = r.CheckBreak() } - if yyb44 { + if yyb49 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.PodDisruptionAllowed = false + x.PodDisruptionsAllowed = 0 } else { - x.PodDisruptionAllowed = bool(r.DecodeBool()) + x.PodDisruptionsAllowed = int32(r.DecodeInt(32)) } - yyj44++ - if yyhl44 { - yyb44 = yyj44 > l + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l } else { - yyb44 = r.CheckBreak() + yyb49 = r.CheckBreak() } - if yyb44 { + if yyb49 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -585,13 +624,13 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.CurrentHealthy = int32(r.DecodeInt(32)) } - yyj44++ - if yyhl44 { - yyb44 = yyj44 > l + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l } else { - yyb44 = r.CheckBreak() + yyb49 = r.CheckBreak() } - if yyb44 { + if yyb49 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -601,13 +640,13 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.DesiredHealthy = int32(r.DecodeInt(32)) } - yyj44++ - if yyhl44 { - yyb44 = yyj44 > l + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l } else { - yyb44 = r.CheckBreak() + yyb49 = r.CheckBreak() } - if yyb44 { + if yyb49 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -617,18 +656,40 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.ExpectedPods = int32(r.DecodeInt(32)) } - for { - yyj44++ - if yyhl44 { - yyb44 = yyj44 > l + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l + } else { + yyb49 = r.CheckBreak() + } + if yyb49 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.DisruptedPods = nil + } else { + yyv54 := &x.DisruptedPods + yym55 := z.DecBinary() + _ = yym55 + if false { } else { - yyb44 = r.CheckBreak() + h.decMapstringunversioned_Time((*map[string]pkg2_unversioned.Time)(yyv54), d) } - if yyb44 { + } + for { + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l + } else { + yyb49 = r.CheckBreak() + } + if yyb49 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj44-1, "") + z.DecStructFieldNotFound(yyj49-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -640,39 +701,39 @@ func (x *PodDisruptionBudget) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym49 := z.EncBinary() - _ = yym49 + yym56 := z.EncBinary() + _ = yym56 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep50 := !z.EncBinary() - yy2arr50 := z.EncBasicHandle().StructToArray - var yyq50 [5]bool - _, _, _ = yysep50, yyq50, yy2arr50 - const yyr50 bool = false - yyq50[0] = x.Kind != "" - yyq50[1] = x.APIVersion != "" - yyq50[2] = true - yyq50[3] = true - yyq50[4] = true - var yynn50 int - if yyr50 || yy2arr50 { + yysep57 := !z.EncBinary() + yy2arr57 := z.EncBasicHandle().StructToArray + var yyq57 [5]bool + _, _, _ = yysep57, yyq57, yy2arr57 + const yyr57 bool = false + yyq57[0] = x.Kind != "" + yyq57[1] = x.APIVersion != "" + yyq57[2] = true + yyq57[3] = true + yyq57[4] = true + var yynn57 int + if yyr57 || yy2arr57 { r.EncodeArrayStart(5) } else { - yynn50 = 0 - for _, b := range yyq50 { + yynn57 = 0 + for _, b := range yyq57 { if b { - yynn50++ + yynn57++ } } - r.EncodeMapStart(yynn50) - yynn50 = 0 + r.EncodeMapStart(yynn57) + yynn57 = 0 } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq50[0] { - yym52 := z.EncBinary() - _ = yym52 + if yyq57[0] { + yym59 := z.EncBinary() + _ = yym59 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) @@ -681,23 +742,23 @@ func (x *PodDisruptionBudget) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq50[0] { + if yyq57[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym53 := z.EncBinary() - _ = yym53 + yym60 := z.EncBinary() + _ = yym60 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq50[1] { - yym55 := z.EncBinary() - _ = yym55 + if yyq57[1] { + yym62 := z.EncBinary() + _ = yym62 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) @@ -706,70 +767,70 @@ func (x *PodDisruptionBudget) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq50[1] { + if yyq57[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym56 := z.EncBinary() - _ = yym56 + yym63 := z.EncBinary() + _ = yym63 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq50[2] { - yy58 := &x.ObjectMeta - yy58.CodecEncodeSelf(e) + if yyq57[2] { + yy65 := &x.ObjectMeta + yy65.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq50[2] { + if yyq57[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy59 := &x.ObjectMeta - yy59.CodecEncodeSelf(e) + yy66 := &x.ObjectMeta + yy66.CodecEncodeSelf(e) } } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq50[3] { - yy61 := &x.Spec - yy61.CodecEncodeSelf(e) + if yyq57[3] { + yy68 := &x.Spec + yy68.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq50[3] { + if yyq57[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy62 := &x.Spec - yy62.CodecEncodeSelf(e) + yy69 := &x.Spec + yy69.CodecEncodeSelf(e) } } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq50[4] { - yy64 := &x.Status - yy64.CodecEncodeSelf(e) + if yyq57[4] { + yy71 := &x.Status + yy71.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq50[4] { + if yyq57[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy65 := &x.Status - yy65.CodecEncodeSelf(e) + yy72 := &x.Status + yy72.CodecEncodeSelf(e) } } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -782,25 +843,25 @@ func (x *PodDisruptionBudget) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym66 := z.DecBinary() - _ = yym66 + yym73 := z.DecBinary() + _ = yym73 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct67 := r.ContainerType() - if yyct67 == codecSelferValueTypeMap1234 { - yyl67 := r.ReadMapStart() - if yyl67 == 0 { + yyct74 := r.ContainerType() + if yyct74 == codecSelferValueTypeMap1234 { + yyl74 := r.ReadMapStart() + if yyl74 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl67, d) + x.codecDecodeSelfFromMap(yyl74, d) } - } else if yyct67 == codecSelferValueTypeArray1234 { - yyl67 := r.ReadArrayStart() - if yyl67 == 0 { + } else if yyct74 == codecSelferValueTypeArray1234 { + yyl74 := r.ReadArrayStart() + if yyl74 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl67, d) + x.codecDecodeSelfFromArray(yyl74, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -812,12 +873,12 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys68Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys68Slc - var yyhl68 bool = l >= 0 - for yyj68 := 0; ; yyj68++ { - if yyhl68 { - if yyj68 >= l { + var yys75Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys75Slc + var yyhl75 bool = l >= 0 + for yyj75 := 0; ; yyj75++ { + if yyhl75 { + if yyj75 >= l { break } } else { @@ -826,10 +887,10 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys68Slc = r.DecodeBytes(yys68Slc, true, true) - yys68 := string(yys68Slc) + yys75Slc = r.DecodeBytes(yys75Slc, true, true) + yys75 := string(yys75Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys68 { + switch yys75 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -846,27 +907,27 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromMap(l int, d *codec1978.Decoder if r.TryDecodeAsNil() { x.ObjectMeta = pkg3_api.ObjectMeta{} } else { - yyv71 := &x.ObjectMeta - yyv71.CodecDecodeSelf(d) + yyv78 := &x.ObjectMeta + yyv78.CodecDecodeSelf(d) } case "spec": if r.TryDecodeAsNil() { x.Spec = PodDisruptionBudgetSpec{} } else { - yyv72 := &x.Spec - yyv72.CodecDecodeSelf(d) + yyv79 := &x.Spec + yyv79.CodecDecodeSelf(d) } case "status": if r.TryDecodeAsNil() { x.Status = PodDisruptionBudgetStatus{} } else { - yyv73 := &x.Status - yyv73.CodecDecodeSelf(d) + yyv80 := &x.Status + yyv80.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys68) - } // end switch yys68 - } // end for yyj68 + z.DecStructFieldNotFound(-1, yys75) + } // end switch yys75 + } // end for yyj75 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -874,16 +935,16 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj74 int - var yyb74 bool - var yyhl74 bool = l >= 0 - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + var yyj81 int + var yyb81 bool + var yyhl81 bool = l >= 0 + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -893,13 +954,13 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.Kind = string(r.DecodeString()) } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -909,13 +970,13 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -923,16 +984,16 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.ObjectMeta = pkg3_api.ObjectMeta{} } else { - yyv77 := &x.ObjectMeta - yyv77.CodecDecodeSelf(d) + yyv84 := &x.ObjectMeta + yyv84.CodecDecodeSelf(d) } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -940,16 +1001,16 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.Spec = PodDisruptionBudgetSpec{} } else { - yyv78 := &x.Spec - yyv78.CodecDecodeSelf(d) + yyv85 := &x.Spec + yyv85.CodecDecodeSelf(d) } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -957,21 +1018,21 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.Status = PodDisruptionBudgetStatus{} } else { - yyv79 := &x.Status - yyv79.CodecDecodeSelf(d) + yyv86 := &x.Status + yyv86.CodecDecodeSelf(d) } for { - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj74-1, "") + z.DecStructFieldNotFound(yyj81-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -983,118 +1044,118 @@ func (x *PodDisruptionBudgetList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym80 := z.EncBinary() - _ = yym80 + yym87 := z.EncBinary() + _ = yym87 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep81 := !z.EncBinary() - yy2arr81 := z.EncBasicHandle().StructToArray - var yyq81 [4]bool - _, _, _ = yysep81, yyq81, yy2arr81 - const yyr81 bool = false - yyq81[0] = x.Kind != "" - yyq81[1] = x.APIVersion != "" - yyq81[2] = true - var yynn81 int - if yyr81 || yy2arr81 { + yysep88 := !z.EncBinary() + yy2arr88 := z.EncBasicHandle().StructToArray + var yyq88 [4]bool + _, _, _ = yysep88, yyq88, yy2arr88 + const yyr88 bool = false + yyq88[0] = x.Kind != "" + yyq88[1] = x.APIVersion != "" + yyq88[2] = true + var yynn88 int + if yyr88 || yy2arr88 { r.EncodeArrayStart(4) } else { - yynn81 = 1 - for _, b := range yyq81 { + yynn88 = 1 + for _, b := range yyq88 { if b { - yynn81++ + yynn88++ } } - r.EncodeMapStart(yynn81) - yynn81 = 0 + r.EncodeMapStart(yynn88) + yynn88 = 0 } - if yyr81 || yy2arr81 { + if yyr88 || yy2arr88 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq81[0] { - yym83 := z.EncBinary() - _ = yym83 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq81[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym84 := z.EncBinary() - _ = yym84 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr81 || yy2arr81 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq81[1] { - yym86 := z.EncBinary() - _ = yym86 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq81[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym87 := z.EncBinary() - _ = yym87 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr81 || yy2arr81 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq81[2] { - yy89 := &x.ListMeta + if yyq88[0] { yym90 := z.EncBinary() _ = yym90 if false { - } else if z.HasExtensions() && z.EncExt(yy89) { } else { - z.EncFallback(yy89) + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq88[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym91 := z.EncBinary() + _ = yym91 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr88 || yy2arr88 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq88[1] { + yym93 := z.EncBinary() + _ = yym93 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq88[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym94 := z.EncBinary() + _ = yym94 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr88 || yy2arr88 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq88[2] { + yy96 := &x.ListMeta + yym97 := z.EncBinary() + _ = yym97 + if false { + } else if z.HasExtensions() && z.EncExt(yy96) { + } else { + z.EncFallback(yy96) } } else { r.EncodeNil() } } else { - if yyq81[2] { + if yyq88[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy91 := &x.ListMeta - yym92 := z.EncBinary() - _ = yym92 + yy98 := &x.ListMeta + yym99 := z.EncBinary() + _ = yym99 if false { - } else if z.HasExtensions() && z.EncExt(yy91) { + } else if z.HasExtensions() && z.EncExt(yy98) { } else { - z.EncFallback(yy91) + z.EncFallback(yy98) } } } - if yyr81 || yy2arr81 { + if yyr88 || yy2arr88 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym94 := z.EncBinary() - _ = yym94 + yym101 := z.EncBinary() + _ = yym101 if false { } else { h.encSlicePodDisruptionBudget(([]PodDisruptionBudget)(x.Items), e) @@ -1107,15 +1168,15 @@ func (x *PodDisruptionBudgetList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym95 := z.EncBinary() - _ = yym95 + yym102 := z.EncBinary() + _ = yym102 if false { } else { h.encSlicePodDisruptionBudget(([]PodDisruptionBudget)(x.Items), e) } } } - if yyr81 || yy2arr81 { + if yyr88 || yy2arr88 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -1128,25 +1189,25 @@ func (x *PodDisruptionBudgetList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym96 := z.DecBinary() - _ = yym96 + yym103 := z.DecBinary() + _ = yym103 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct97 := r.ContainerType() - if yyct97 == codecSelferValueTypeMap1234 { - yyl97 := r.ReadMapStart() - if yyl97 == 0 { + yyct104 := r.ContainerType() + if yyct104 == codecSelferValueTypeMap1234 { + yyl104 := r.ReadMapStart() + if yyl104 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl97, d) + x.codecDecodeSelfFromMap(yyl104, d) } - } else if yyct97 == codecSelferValueTypeArray1234 { - yyl97 := r.ReadArrayStart() - if yyl97 == 0 { + } else if yyct104 == codecSelferValueTypeArray1234 { + yyl104 := r.ReadArrayStart() + if yyl104 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl97, d) + x.codecDecodeSelfFromArray(yyl104, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -1158,12 +1219,12 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromMap(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys98Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys98Slc - var yyhl98 bool = l >= 0 - for yyj98 := 0; ; yyj98++ { - if yyhl98 { - if yyj98 >= l { + var yys105Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys105Slc + var yyhl105 bool = l >= 0 + for yyj105 := 0; ; yyj105++ { + if yyhl105 { + if yyj105 >= l { break } } else { @@ -1172,10 +1233,10 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromMap(l int, d *codec1978.Dec } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys98Slc = r.DecodeBytes(yys98Slc, true, true) - yys98 := string(yys98Slc) + yys105Slc = r.DecodeBytes(yys105Slc, true, true) + yys105 := string(yys105Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys98 { + switch yys105 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -1192,31 +1253,31 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromMap(l int, d *codec1978.Dec if r.TryDecodeAsNil() { x.ListMeta = pkg2_unversioned.ListMeta{} } else { - yyv101 := &x.ListMeta - yym102 := z.DecBinary() - _ = yym102 + yyv108 := &x.ListMeta + yym109 := z.DecBinary() + _ = yym109 if false { - } else if z.HasExtensions() && z.DecExt(yyv101) { + } else if z.HasExtensions() && z.DecExt(yyv108) { } else { - z.DecFallback(yyv101, false) + z.DecFallback(yyv108, false) } } case "items": if r.TryDecodeAsNil() { x.Items = nil } else { - yyv103 := &x.Items - yym104 := z.DecBinary() - _ = yym104 + yyv110 := &x.Items + yym111 := z.DecBinary() + _ = yym111 if false { } else { - h.decSlicePodDisruptionBudget((*[]PodDisruptionBudget)(yyv103), d) + h.decSlicePodDisruptionBudget((*[]PodDisruptionBudget)(yyv110), d) } } default: - z.DecStructFieldNotFound(-1, yys98) - } // end switch yys98 - } // end for yyj98 + z.DecStructFieldNotFound(-1, yys105) + } // end switch yys105 + } // end for yyj105 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -1224,16 +1285,16 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromArray(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj105 int - var yyb105 bool - var yyhl105 bool = l >= 0 - yyj105++ - if yyhl105 { - yyb105 = yyj105 > l + var yyj112 int + var yyb112 bool + var yyhl112 bool = l >= 0 + yyj112++ + if yyhl112 { + yyb112 = yyj112 > l } else { - yyb105 = r.CheckBreak() + yyb112 = r.CheckBreak() } - if yyb105 { + if yyb112 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1243,13 +1304,13 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromArray(l int, d *codec1978.D } else { x.Kind = string(r.DecodeString()) } - yyj105++ - if yyhl105 { - yyb105 = yyj105 > l + yyj112++ + if yyhl112 { + yyb112 = yyj112 > l } else { - yyb105 = r.CheckBreak() + yyb112 = r.CheckBreak() } - if yyb105 { + if yyb112 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1259,13 +1320,13 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromArray(l int, d *codec1978.D } else { x.APIVersion = string(r.DecodeString()) } - yyj105++ - if yyhl105 { - yyb105 = yyj105 > l + yyj112++ + if yyhl112 { + yyb112 = yyj112 > l } else { - yyb105 = r.CheckBreak() + yyb112 = r.CheckBreak() } - if yyb105 { + if yyb112 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1273,22 +1334,22 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromArray(l int, d *codec1978.D if r.TryDecodeAsNil() { x.ListMeta = pkg2_unversioned.ListMeta{} } else { - yyv108 := &x.ListMeta - yym109 := z.DecBinary() - _ = yym109 + yyv115 := &x.ListMeta + yym116 := z.DecBinary() + _ = yym116 if false { - } else if z.HasExtensions() && z.DecExt(yyv108) { + } else if z.HasExtensions() && z.DecExt(yyv115) { } else { - z.DecFallback(yyv108, false) + z.DecFallback(yyv115, false) } } - yyj105++ - if yyhl105 { - yyb105 = yyj105 > l + yyj112++ + if yyhl112 { + yyb112 = yyj112 > l } else { - yyb105 = r.CheckBreak() + yyb112 = r.CheckBreak() } - if yyb105 { + if yyb112 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1296,26 +1357,26 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromArray(l int, d *codec1978.D if r.TryDecodeAsNil() { x.Items = nil } else { - yyv110 := &x.Items - yym111 := z.DecBinary() - _ = yym111 + yyv117 := &x.Items + yym118 := z.DecBinary() + _ = yym118 if false { } else { - h.decSlicePodDisruptionBudget((*[]PodDisruptionBudget)(yyv110), d) + h.decSlicePodDisruptionBudget((*[]PodDisruptionBudget)(yyv117), d) } } for { - yyj105++ - if yyhl105 { - yyb105 = yyj105 > l + yyj112++ + if yyhl112 { + yyb112 = yyj112 > l } else { - yyb105 = r.CheckBreak() + yyb112 = r.CheckBreak() } - if yyb105 { + if yyb112 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj105-1, "") + z.DecStructFieldNotFound(yyj112-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -1327,38 +1388,38 @@ func (x *Eviction) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym112 := z.EncBinary() - _ = yym112 + yym119 := z.EncBinary() + _ = yym119 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep113 := !z.EncBinary() - yy2arr113 := z.EncBasicHandle().StructToArray - var yyq113 [4]bool - _, _, _ = yysep113, yyq113, yy2arr113 - const yyr113 bool = false - yyq113[0] = x.Kind != "" - yyq113[1] = x.APIVersion != "" - yyq113[2] = true - yyq113[3] = x.DeleteOptions != nil - var yynn113 int - if yyr113 || yy2arr113 { + yysep120 := !z.EncBinary() + yy2arr120 := z.EncBasicHandle().StructToArray + var yyq120 [4]bool + _, _, _ = yysep120, yyq120, yy2arr120 + const yyr120 bool = false + yyq120[0] = x.Kind != "" + yyq120[1] = x.APIVersion != "" + yyq120[2] = true + yyq120[3] = x.DeleteOptions != nil + var yynn120 int + if yyr120 || yy2arr120 { r.EncodeArrayStart(4) } else { - yynn113 = 0 - for _, b := range yyq113 { + yynn120 = 0 + for _, b := range yyq120 { if b { - yynn113++ + yynn120++ } } - r.EncodeMapStart(yynn113) - yynn113 = 0 + r.EncodeMapStart(yynn120) + yynn120 = 0 } - if yyr113 || yy2arr113 { + if yyr120 || yy2arr120 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq113[0] { - yym115 := z.EncBinary() - _ = yym115 + if yyq120[0] { + yym122 := z.EncBinary() + _ = yym122 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) @@ -1367,23 +1428,23 @@ func (x *Eviction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq113[0] { + if yyq120[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym116 := z.EncBinary() - _ = yym116 + yym123 := z.EncBinary() + _ = yym123 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } } - if yyr113 || yy2arr113 { + if yyr120 || yy2arr120 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq113[1] { - yym118 := z.EncBinary() - _ = yym118 + if yyq120[1] { + yym125 := z.EncBinary() + _ = yym125 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) @@ -1392,38 +1453,38 @@ func (x *Eviction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq113[1] { + if yyq120[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym119 := z.EncBinary() - _ = yym119 + yym126 := z.EncBinary() + _ = yym126 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } - if yyr113 || yy2arr113 { + if yyr120 || yy2arr120 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq113[2] { - yy121 := &x.ObjectMeta - yy121.CodecEncodeSelf(e) + if yyq120[2] { + yy128 := &x.ObjectMeta + yy128.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq113[2] { + if yyq120[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy122 := &x.ObjectMeta - yy122.CodecEncodeSelf(e) + yy129 := &x.ObjectMeta + yy129.CodecEncodeSelf(e) } } - if yyr113 || yy2arr113 { + if yyr120 || yy2arr120 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq113[3] { + if yyq120[3] { if x.DeleteOptions == nil { r.EncodeNil() } else { @@ -1433,7 +1494,7 @@ func (x *Eviction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq113[3] { + if yyq120[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("deleteOptions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -1444,7 +1505,7 @@ func (x *Eviction) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr113 || yy2arr113 { + if yyr120 || yy2arr120 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -1457,25 +1518,25 @@ func (x *Eviction) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym124 := z.DecBinary() - _ = yym124 + yym131 := z.DecBinary() + _ = yym131 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct125 := r.ContainerType() - if yyct125 == codecSelferValueTypeMap1234 { - yyl125 := r.ReadMapStart() - if yyl125 == 0 { + yyct132 := r.ContainerType() + if yyct132 == codecSelferValueTypeMap1234 { + yyl132 := r.ReadMapStart() + if yyl132 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl125, d) + x.codecDecodeSelfFromMap(yyl132, d) } - } else if yyct125 == codecSelferValueTypeArray1234 { - yyl125 := r.ReadArrayStart() - if yyl125 == 0 { + } else if yyct132 == codecSelferValueTypeArray1234 { + yyl132 := r.ReadArrayStart() + if yyl132 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl125, d) + x.codecDecodeSelfFromArray(yyl132, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -1487,12 +1548,12 @@ func (x *Eviction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys126Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys126Slc - var yyhl126 bool = l >= 0 - for yyj126 := 0; ; yyj126++ { - if yyhl126 { - if yyj126 >= l { + var yys133Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys133Slc + var yyhl133 bool = l >= 0 + for yyj133 := 0; ; yyj133++ { + if yyhl133 { + if yyj133 >= l { break } } else { @@ -1501,10 +1562,10 @@ func (x *Eviction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys126Slc = r.DecodeBytes(yys126Slc, true, true) - yys126 := string(yys126Slc) + yys133Slc = r.DecodeBytes(yys133Slc, true, true) + yys133 := string(yys133Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys126 { + switch yys133 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -1521,8 +1582,8 @@ func (x *Eviction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ObjectMeta = pkg3_api.ObjectMeta{} } else { - yyv129 := &x.ObjectMeta - yyv129.CodecDecodeSelf(d) + yyv136 := &x.ObjectMeta + yyv136.CodecDecodeSelf(d) } case "deleteOptions": if r.TryDecodeAsNil() { @@ -1536,9 +1597,9 @@ func (x *Eviction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.DeleteOptions.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys126) - } // end switch yys126 - } // end for yyj126 + z.DecStructFieldNotFound(-1, yys133) + } // end switch yys133 + } // end for yyj133 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -1546,16 +1607,16 @@ func (x *Eviction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj131 int - var yyb131 bool - var yyhl131 bool = l >= 0 - yyj131++ - if yyhl131 { - yyb131 = yyj131 > l + var yyj138 int + var yyb138 bool + var yyhl138 bool = l >= 0 + yyj138++ + if yyhl138 { + yyb138 = yyj138 > l } else { - yyb131 = r.CheckBreak() + yyb138 = r.CheckBreak() } - if yyb131 { + if yyb138 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1565,13 +1626,13 @@ func (x *Eviction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj131++ - if yyhl131 { - yyb131 = yyj131 > l + yyj138++ + if yyhl138 { + yyb138 = yyj138 > l } else { - yyb131 = r.CheckBreak() + yyb138 = r.CheckBreak() } - if yyb131 { + if yyb138 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1581,13 +1642,13 @@ func (x *Eviction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj131++ - if yyhl131 { - yyb131 = yyj131 > l + yyj138++ + if yyhl138 { + yyb138 = yyj138 > l } else { - yyb131 = r.CheckBreak() + yyb138 = r.CheckBreak() } - if yyb131 { + if yyb138 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1595,16 +1656,16 @@ func (x *Eviction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ObjectMeta = pkg3_api.ObjectMeta{} } else { - yyv134 := &x.ObjectMeta - yyv134.CodecDecodeSelf(d) + yyv141 := &x.ObjectMeta + yyv141.CodecDecodeSelf(d) } - yyj131++ - if yyhl131 { - yyb131 = yyj131 > l + yyj138++ + if yyhl138 { + yyb138 = yyj138 > l } else { - yyb131 = r.CheckBreak() + yyb138 = r.CheckBreak() } - if yyb131 { + if yyb138 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1620,30 +1681,155 @@ func (x *Eviction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.DeleteOptions.CodecDecodeSelf(d) } for { - yyj131++ - if yyhl131 { - yyb131 = yyj131 > l + yyj138++ + if yyhl138 { + yyb138 = yyj138 > l } else { - yyb131 = r.CheckBreak() + yyb138 = r.CheckBreak() } - if yyb131 { + if yyb138 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj131-1, "") + z.DecStructFieldNotFound(yyj138-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } +func (x codecSelfer1234) encMapstringunversioned_Time(v map[string]pkg2_unversioned.Time, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeMapStart(len(v)) + for yyk143, yyv143 := range v { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + yym144 := z.EncBinary() + _ = yym144 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(yyk143)) + } + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy145 := &yyv143 + yym146 := z.EncBinary() + _ = yym146 + if false { + } else if z.HasExtensions() && z.EncExt(yy145) { + } else if yym146 { + z.EncBinaryMarshal(yy145) + } else if !yym146 && z.IsJSONHandle() { + z.EncJSONMarshal(yy145) + } else { + z.EncFallback(yy145) + } + } + z.EncSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x codecSelfer1234) decMapstringunversioned_Time(v *map[string]pkg2_unversioned.Time, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv147 := *v + yyl147 := r.ReadMapStart() + yybh147 := z.DecBasicHandle() + if yyv147 == nil { + yyrl147, _ := z.DecInferLen(yyl147, yybh147.MaxInitLen, 40) + yyv147 = make(map[string]pkg2_unversioned.Time, yyrl147) + *v = yyv147 + } + var yymk147 string + var yymv147 pkg2_unversioned.Time + var yymg147 bool + if yybh147.MapValueReset { + yymg147 = true + } + if yyl147 > 0 { + for yyj147 := 0; yyj147 < yyl147; yyj147++ { + z.DecSendContainerState(codecSelfer_containerMapKey1234) + if r.TryDecodeAsNil() { + yymk147 = "" + } else { + yymk147 = string(r.DecodeString()) + } + + if yymg147 { + yymv147 = yyv147[yymk147] + } else { + yymv147 = pkg2_unversioned.Time{} + } + z.DecSendContainerState(codecSelfer_containerMapValue1234) + if r.TryDecodeAsNil() { + yymv147 = pkg2_unversioned.Time{} + } else { + yyv149 := &yymv147 + yym150 := z.DecBinary() + _ = yym150 + if false { + } else if z.HasExtensions() && z.DecExt(yyv149) { + } else if yym150 { + z.DecBinaryUnmarshal(yyv149) + } else if !yym150 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv149) + } else { + z.DecFallback(yyv149, false) + } + } + + if yyv147 != nil { + yyv147[yymk147] = yymv147 + } + } + } else if yyl147 < 0 { + for yyj147 := 0; !r.CheckBreak(); yyj147++ { + z.DecSendContainerState(codecSelfer_containerMapKey1234) + if r.TryDecodeAsNil() { + yymk147 = "" + } else { + yymk147 = string(r.DecodeString()) + } + + if yymg147 { + yymv147 = yyv147[yymk147] + } else { + yymv147 = pkg2_unversioned.Time{} + } + z.DecSendContainerState(codecSelfer_containerMapValue1234) + if r.TryDecodeAsNil() { + yymv147 = pkg2_unversioned.Time{} + } else { + yyv152 := &yymv147 + yym153 := z.DecBinary() + _ = yym153 + if false { + } else if z.HasExtensions() && z.DecExt(yyv152) { + } else if yym153 { + z.DecBinaryUnmarshal(yyv152) + } else if !yym153 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv152) + } else { + z.DecFallback(yyv152, false) + } + } + + if yyv147 != nil { + yyv147[yymk147] = yymv147 + } + } + } // else len==0: TODO: Should we clear map entries? + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + func (x codecSelfer1234) encSlicePodDisruptionBudget(v []PodDisruptionBudget, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv136 := range v { + for _, yyv154 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy137 := &yyv136 - yy137.CodecEncodeSelf(e) + yy155 := &yyv154 + yy155.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -1653,83 +1839,83 @@ func (x codecSelfer1234) decSlicePodDisruptionBudget(v *[]PodDisruptionBudget, d z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv138 := *v - yyh138, yyl138 := z.DecSliceHelperStart() - var yyc138 bool - if yyl138 == 0 { - if yyv138 == nil { - yyv138 = []PodDisruptionBudget{} - yyc138 = true - } else if len(yyv138) != 0 { - yyv138 = yyv138[:0] - yyc138 = true + yyv156 := *v + yyh156, yyl156 := z.DecSliceHelperStart() + var yyc156 bool + if yyl156 == 0 { + if yyv156 == nil { + yyv156 = []PodDisruptionBudget{} + yyc156 = true + } else if len(yyv156) != 0 { + yyv156 = yyv156[:0] + yyc156 = true } - } else if yyl138 > 0 { - var yyrr138, yyrl138 int - var yyrt138 bool - if yyl138 > cap(yyv138) { + } else if yyl156 > 0 { + var yyrr156, yyrl156 int + var yyrt156 bool + if yyl156 > cap(yyv156) { - yyrg138 := len(yyv138) > 0 - yyv2138 := yyv138 - yyrl138, yyrt138 = z.DecInferLen(yyl138, z.DecBasicHandle().MaxInitLen, 312) - if yyrt138 { - if yyrl138 <= cap(yyv138) { - yyv138 = yyv138[:yyrl138] + yyrg156 := len(yyv156) > 0 + yyv2156 := yyv156 + yyrl156, yyrt156 = z.DecInferLen(yyl156, z.DecBasicHandle().MaxInitLen, 320) + if yyrt156 { + if yyrl156 <= cap(yyv156) { + yyv156 = yyv156[:yyrl156] } else { - yyv138 = make([]PodDisruptionBudget, yyrl138) + yyv156 = make([]PodDisruptionBudget, yyrl156) } } else { - yyv138 = make([]PodDisruptionBudget, yyrl138) + yyv156 = make([]PodDisruptionBudget, yyrl156) } - yyc138 = true - yyrr138 = len(yyv138) - if yyrg138 { - copy(yyv138, yyv2138) + yyc156 = true + yyrr156 = len(yyv156) + if yyrg156 { + copy(yyv156, yyv2156) } - } else if yyl138 != len(yyv138) { - yyv138 = yyv138[:yyl138] - yyc138 = true + } else if yyl156 != len(yyv156) { + yyv156 = yyv156[:yyl156] + yyc156 = true } - yyj138 := 0 - for ; yyj138 < yyrr138; yyj138++ { - yyh138.ElemContainerState(yyj138) + yyj156 := 0 + for ; yyj156 < yyrr156; yyj156++ { + yyh156.ElemContainerState(yyj156) if r.TryDecodeAsNil() { - yyv138[yyj138] = PodDisruptionBudget{} + yyv156[yyj156] = PodDisruptionBudget{} } else { - yyv139 := &yyv138[yyj138] - yyv139.CodecDecodeSelf(d) + yyv157 := &yyv156[yyj156] + yyv157.CodecDecodeSelf(d) } } - if yyrt138 { - for ; yyj138 < yyl138; yyj138++ { - yyv138 = append(yyv138, PodDisruptionBudget{}) - yyh138.ElemContainerState(yyj138) + if yyrt156 { + for ; yyj156 < yyl156; yyj156++ { + yyv156 = append(yyv156, PodDisruptionBudget{}) + yyh156.ElemContainerState(yyj156) if r.TryDecodeAsNil() { - yyv138[yyj138] = PodDisruptionBudget{} + yyv156[yyj156] = PodDisruptionBudget{} } else { - yyv140 := &yyv138[yyj138] - yyv140.CodecDecodeSelf(d) + yyv158 := &yyv156[yyj156] + yyv158.CodecDecodeSelf(d) } } } } else { - yyj138 := 0 - for ; !r.CheckBreak(); yyj138++ { + yyj156 := 0 + for ; !r.CheckBreak(); yyj156++ { - if yyj138 >= len(yyv138) { - yyv138 = append(yyv138, PodDisruptionBudget{}) // var yyz138 PodDisruptionBudget - yyc138 = true + if yyj156 >= len(yyv156) { + yyv156 = append(yyv156, PodDisruptionBudget{}) // var yyz156 PodDisruptionBudget + yyc156 = true } - yyh138.ElemContainerState(yyj138) - if yyj138 < len(yyv138) { + yyh156.ElemContainerState(yyj156) + if yyj156 < len(yyv156) { if r.TryDecodeAsNil() { - yyv138[yyj138] = PodDisruptionBudget{} + yyv156[yyj156] = PodDisruptionBudget{} } else { - yyv141 := &yyv138[yyj138] - yyv141.CodecDecodeSelf(d) + yyv159 := &yyv156[yyj156] + yyv159.CodecDecodeSelf(d) } } else { @@ -1737,16 +1923,16 @@ func (x codecSelfer1234) decSlicePodDisruptionBudget(v *[]PodDisruptionBudget, d } } - if yyj138 < len(yyv138) { - yyv138 = yyv138[:yyj138] - yyc138 = true - } else if yyj138 == 0 && yyv138 == nil { - yyv138 = []PodDisruptionBudget{} - yyc138 = true + if yyj156 < len(yyv156) { + yyv156 = yyv156[:yyj156] + yyc156 = true + } else if yyj156 == 0 && yyv156 == nil { + yyv156 = []PodDisruptionBudget{} + yyc156 = true } } - yyh138.End() - if yyc138 { - *v = yyv138 + yyh156.End() + if yyc156 { + *v = yyv156 } } diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/types.go b/staging/src/k8s.io/client-go/pkg/apis/policy/types.go index 949378a7252..8d5b9a94506 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/types.go @@ -40,8 +40,8 @@ type PodDisruptionBudgetSpec struct { // PodDisruptionBudgetStatus represents information about the status of a // PodDisruptionBudget. Status may trail the actual state of a system. type PodDisruptionBudgetStatus struct { - // Whether or not a disruption is currently allowed. - PodDisruptionAllowed bool `json:"disruptionAllowed"` + // Number of pod disruptions that are currently allowed. + PodDisruptionsAllowed int32 `json:"disruptionsAllowed"` // current number of healthy pods CurrentHealthy int32 `json:"currentHealthy"` @@ -51,6 +51,19 @@ type PodDisruptionBudgetStatus struct { // total number of pods counted by this disruption budget ExpectedPods int32 `json:"expectedPods"` + + // DisruptedPods contains information about pods whose eviction was + // processed by the API server eviction subresource handler but has not + // yet been observed by the PodDisruptionBudget controller. + // A pod will be in this map from the time when the API server processed the + // eviction request to the time when the pod is seen by PDB controller + // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod + // and the value is the time when the API server processed the eviction request. If + // the deletion didn't occur and a pod is still there it will be removed from + // the list automatically by PodDisruptionBudget controller after some time. + // If everything goes smooth this map should be empty for the most of the time. + // Large number of entries in the map may indicate problems with pod deletions. + DisruptedPods map[string]unversioned.Time `json:"disruptedPods" protobuf:"bytes,5,rep,name=disruptedPods"` } // +genclient=true @@ -77,9 +90,12 @@ type PodDisruptionBudgetList struct { Items []PodDisruptionBudget `json:"items"` } +// +genclient=true +// +noMethods=true + // Eviction evicts a pod from its node subject to certain policies and safety constraints. // This is a subresource of Pod. A request to cause such an eviction is -// created by POSTing to .../pods//evictions. +// created by POSTing to .../pods//eviction. type Eviction struct { unversioned.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/doc.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/doc.go index 5a24d4a7176..65d58233ee1 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/doc.go +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/doc.go @@ -14,12 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/policy -// +k8s:defaulter-gen=TypeMeta - // Package policy is for any kind of policy object. Suitable examples, even if // they aren't all here, are PodDisruptionBudget, PodSecurityPolicy, // NetworkPolicy, etc. -// +k8s:openapi-gen=true package v1alpha1 diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/register.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/register.go index 5cc55aa9b80..5317fdcfd1b 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/register.go +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/register.go @@ -42,6 +42,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &Eviction{}, &v1.ListOptions{}, &v1.DeleteOptions{}, + &v1.ExportOptions{}, ) // Add the watch version that applies versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/types.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/types.go index 2ae77e43ca2..3affb1bd466 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/types.go +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/types.go @@ -79,7 +79,7 @@ type PodDisruptionBudgetList struct { // Eviction evicts a pod from its node subject to certain policies and safety constraints. // This is a subresource of Pod. A request to cause such an eviction is -// created by POSTing to .../pods//evictions. +// created by POSTing to .../pods//eviction. type Eviction struct { unversioned.TypeMeta `json:",inline"` diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index 3c3df37494c..00000000000 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,214 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by conversion-gen. Do not edit it manually! - -package v1alpha1 - -import ( - api "k8s.io/client-go/pkg/api" - v1 "k8s.io/client-go/pkg/api/v1" - policy "k8s.io/client-go/pkg/apis/policy" - conversion "k8s.io/client-go/pkg/conversion" - runtime "k8s.io/client-go/pkg/runtime" -) - -func init() { - SchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(scheme *runtime.Scheme) error { - return scheme.AddGeneratedConversionFuncs( - Convert_v1alpha1_Eviction_To_policy_Eviction, - Convert_policy_Eviction_To_v1alpha1_Eviction, - Convert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget, - Convert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget, - Convert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList, - Convert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList, - Convert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec, - Convert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec, - Convert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus, - Convert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus, - ) -} - -func autoConvert_v1alpha1_Eviction_To_policy_Eviction(in *Eviction, out *policy.Eviction, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if in.DeleteOptions != nil { - in, out := &in.DeleteOptions, &out.DeleteOptions - *out = new(api.DeleteOptions) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.DeleteOptions = nil - } - return nil -} - -func Convert_v1alpha1_Eviction_To_policy_Eviction(in *Eviction, out *policy.Eviction, s conversion.Scope) error { - return autoConvert_v1alpha1_Eviction_To_policy_Eviction(in, out, s) -} - -func autoConvert_policy_Eviction_To_v1alpha1_Eviction(in *policy.Eviction, out *Eviction, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if in.DeleteOptions != nil { - in, out := &in.DeleteOptions, &out.DeleteOptions - *out = new(v1.DeleteOptions) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.DeleteOptions = nil - } - return nil -} - -func Convert_policy_Eviction_To_v1alpha1_Eviction(in *policy.Eviction, out *Eviction, s conversion.Scope) error { - return autoConvert_policy_Eviction_To_v1alpha1_Eviction(in, out, s) -} - -func autoConvert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in *PodDisruptionBudget, out *policy.PodDisruptionBudget, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in *PodDisruptionBudget, out *policy.PodDisruptionBudget, s conversion.Scope) error { - return autoConvert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in, out, s) -} - -func autoConvert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(in *policy.PodDisruptionBudget, out *PodDisruptionBudget, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(in *policy.PodDisruptionBudget, out *PodDisruptionBudget, s conversion.Scope) error { - return autoConvert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(in, out, s) -} - -func autoConvert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in *PodDisruptionBudgetList, out *policy.PodDisruptionBudgetList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]policy.PodDisruptionBudget, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in *PodDisruptionBudgetList, out *policy.PodDisruptionBudgetList, s conversion.Scope) error { - return autoConvert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in, out, s) -} - -func autoConvert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList(in *policy.PodDisruptionBudgetList, out *PodDisruptionBudgetList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodDisruptionBudget, len(*in)) - for i := range *in { - if err := Convert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList(in *policy.PodDisruptionBudgetList, out *PodDisruptionBudgetList, s conversion.Scope) error { - return autoConvert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList(in, out, s) -} - -func autoConvert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in *PodDisruptionBudgetSpec, out *policy.PodDisruptionBudgetSpec, s conversion.Scope) error { - out.MinAvailable = in.MinAvailable - out.Selector = in.Selector - return nil -} - -func Convert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in *PodDisruptionBudgetSpec, out *policy.PodDisruptionBudgetSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in, out, s) -} - -func autoConvert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(in *policy.PodDisruptionBudgetSpec, out *PodDisruptionBudgetSpec, s conversion.Scope) error { - out.MinAvailable = in.MinAvailable - out.Selector = in.Selector - return nil -} - -func Convert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(in *policy.PodDisruptionBudgetSpec, out *PodDisruptionBudgetSpec, s conversion.Scope) error { - return autoConvert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(in, out, s) -} - -func autoConvert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in *PodDisruptionBudgetStatus, out *policy.PodDisruptionBudgetStatus, s conversion.Scope) error { - out.PodDisruptionAllowed = in.PodDisruptionAllowed - out.CurrentHealthy = in.CurrentHealthy - out.DesiredHealthy = in.DesiredHealthy - out.ExpectedPods = in.ExpectedPods - return nil -} - -func Convert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in *PodDisruptionBudgetStatus, out *policy.PodDisruptionBudgetStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in, out, s) -} - -func autoConvert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(in *policy.PodDisruptionBudgetStatus, out *PodDisruptionBudgetStatus, s conversion.Scope) error { - out.PodDisruptionAllowed = in.PodDisruptionAllowed - out.CurrentHealthy = in.CurrentHealthy - out.DesiredHealthy = in.DesiredHealthy - out.ExpectedPods = in.ExpectedPods - return nil -} - -func Convert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(in *policy.PodDisruptionBudgetStatus, out *PodDisruptionBudgetStatus, s conversion.Scope) error { - return autoConvert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(in, out, s) -} diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/doc.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/doc.go new file mode 100644 index 00000000000..5a338994768 --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/doc.go @@ -0,0 +1,24 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/policy + +// Package policy is for any kind of policy object. Suitable examples, even if +// they aren't all here, are PodDisruptionBudget, PodSecurityPolicy, +// NetworkPolicy, etc. +// +k8s:openapi-gen=true +package v1beta1 diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/generated.pb.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/generated.pb.go similarity index 74% rename from staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/generated.pb.go rename to staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/generated.pb.go index a762391074d..01338aa320b 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/generated.pb.go +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/generated.pb.go @@ -15,14 +15,14 @@ limitations under the License. */ // Code generated by protoc-gen-gogo. -// source: k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.proto +// source: k8s.io/kubernetes/pkg/apis/policy/v1beta1/generated.proto // DO NOT EDIT! /* - Package v1alpha1 is a generated protocol buffer package. + Package v1beta1 is a generated protocol buffer package. It is generated from these files: - k8s.io/kubernetes/pkg/apis/policy/v1alpha1/generated.proto + k8s.io/kubernetes/pkg/apis/policy/v1beta1/generated.proto It has these top-level messages: Eviction @@ -31,7 +31,7 @@ limitations under the License. PodDisruptionBudgetSpec PodDisruptionBudgetStatus */ -package v1alpha1 +package v1beta1 import proto "github.com/gogo/protobuf/proto" import fmt "fmt" @@ -42,6 +42,7 @@ import k8s_io_kubernetes_pkg_api_v1 "k8s.io/client-go/pkg/api/v1" import strings "strings" import reflect "reflect" +import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" import io "io" @@ -77,11 +78,11 @@ func (*PodDisruptionBudgetStatus) Descriptor() ([]byte, []int) { } func init() { - proto.RegisterType((*Eviction)(nil), "k8s.io.client-go.pkg.apis.policy.v1alpha1.Eviction") - proto.RegisterType((*PodDisruptionBudget)(nil), "k8s.io.client-go.pkg.apis.policy.v1alpha1.PodDisruptionBudget") - proto.RegisterType((*PodDisruptionBudgetList)(nil), "k8s.io.client-go.pkg.apis.policy.v1alpha1.PodDisruptionBudgetList") - proto.RegisterType((*PodDisruptionBudgetSpec)(nil), "k8s.io.client-go.pkg.apis.policy.v1alpha1.PodDisruptionBudgetSpec") - proto.RegisterType((*PodDisruptionBudgetStatus)(nil), "k8s.io.client-go.pkg.apis.policy.v1alpha1.PodDisruptionBudgetStatus") + proto.RegisterType((*Eviction)(nil), "k8s.io.client-go.pkg.apis.policy.v1beta1.Eviction") + proto.RegisterType((*PodDisruptionBudget)(nil), "k8s.io.client-go.pkg.apis.policy.v1beta1.PodDisruptionBudget") + proto.RegisterType((*PodDisruptionBudgetList)(nil), "k8s.io.client-go.pkg.apis.policy.v1beta1.PodDisruptionBudgetList") + proto.RegisterType((*PodDisruptionBudgetSpec)(nil), "k8s.io.client-go.pkg.apis.policy.v1beta1.PodDisruptionBudgetSpec") + proto.RegisterType((*PodDisruptionBudgetStatus)(nil), "k8s.io.client-go.pkg.apis.policy.v1beta1.PodDisruptionBudgetStatus") } func (m *Eviction) Marshal() (data []byte, err error) { size := m.Size() @@ -252,12 +253,7 @@ func (m *PodDisruptionBudgetStatus) MarshalTo(data []byte) (int, error) { _ = l data[i] = 0x8 i++ - if m.PodDisruptionAllowed { - data[i] = 1 - } else { - data[i] = 0 - } - i++ + i = encodeVarintGenerated(data, i, uint64(m.PodDisruptionsAllowed)) data[i] = 0x10 i++ i = encodeVarintGenerated(data, i, uint64(m.CurrentHealthy)) @@ -267,6 +263,28 @@ func (m *PodDisruptionBudgetStatus) MarshalTo(data []byte) (int, error) { data[i] = 0x20 i++ i = encodeVarintGenerated(data, i, uint64(m.ExpectedPods)) + if len(m.DisruptedPods) > 0 { + for k := range m.DisruptedPods { + data[i] = 0x2a + i++ + v := m.DisruptedPods[k] + msgSize := (&v).Size() + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + msgSize + sovGenerated(uint64(msgSize)) + i = encodeVarintGenerated(data, i, uint64(mapSize)) + data[i] = 0xa + i++ + i = encodeVarintGenerated(data, i, uint64(len(k))) + i += copy(data[i:], k) + data[i] = 0x12 + i++ + i = encodeVarintGenerated(data, i, uint64((&v).Size())) + n9, err := (&v).MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n9 + } + } return i, nil } @@ -350,10 +368,19 @@ func (m *PodDisruptionBudgetSpec) Size() (n int) { func (m *PodDisruptionBudgetStatus) Size() (n int) { var l int _ = l - n += 2 + n += 1 + sovGenerated(uint64(m.PodDisruptionsAllowed)) n += 1 + sovGenerated(uint64(m.CurrentHealthy)) n += 1 + sovGenerated(uint64(m.DesiredHealthy)) n += 1 + sovGenerated(uint64(m.ExpectedPods)) + if len(m.DisruptedPods) > 0 { + for k, v := range m.DisruptedPods { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } return n } @@ -419,11 +446,22 @@ func (this *PodDisruptionBudgetStatus) String() string { if this == nil { return "nil" } + keysForDisruptedPods := make([]string, 0, len(this.DisruptedPods)) + for k := range this.DisruptedPods { + keysForDisruptedPods = append(keysForDisruptedPods, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForDisruptedPods) + mapStringForDisruptedPods := "map[string]k8s_io_kubernetes_pkg_api_unversioned.Time{" + for _, k := range keysForDisruptedPods { + mapStringForDisruptedPods += fmt.Sprintf("%v: %v,", k, this.DisruptedPods[k]) + } + mapStringForDisruptedPods += "}" s := strings.Join([]string{`&PodDisruptionBudgetStatus{`, - `PodDisruptionAllowed:` + fmt.Sprintf("%v", this.PodDisruptionAllowed) + `,`, + `PodDisruptionsAllowed:` + fmt.Sprintf("%v", this.PodDisruptionsAllowed) + `,`, `CurrentHealthy:` + fmt.Sprintf("%v", this.CurrentHealthy) + `,`, `DesiredHealthy:` + fmt.Sprintf("%v", this.DesiredHealthy) + `,`, `ExpectedPods:` + fmt.Sprintf("%v", this.ExpectedPods) + `,`, + `DisruptedPods:` + mapStringForDisruptedPods + `,`, `}`, }, "") return s @@ -944,9 +982,9 @@ func (m *PodDisruptionBudgetStatus) Unmarshal(data []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PodDisruptionAllowed", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PodDisruptionsAllowed", wireType) } - var v int + m.PodDisruptionsAllowed = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -956,12 +994,11 @@ func (m *PodDisruptionBudgetStatus) Unmarshal(data []byte) error { } b := data[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + m.PodDisruptionsAllowed |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } - m.PodDisruptionAllowed = bool(v != 0) case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CurrentHealthy", wireType) @@ -1019,6 +1056,122 @@ func (m *PodDisruptionBudgetStatus) Unmarshal(data []byte) error { break } } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptedPods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + var keykey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + keykey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey := string(data[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + var valuekey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + valuekey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + mapmsglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue := &k8s_io_kubernetes_pkg_api_unversioned.Time{} + if err := mapvalue.Unmarshal(data[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + if m.DisruptedPods == nil { + m.DisruptedPods = make(map[string]k8s_io_kubernetes_pkg_api_unversioned.Time) + } + m.DisruptedPods[mapkey] = *mapvalue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(data[iNdEx:]) @@ -1146,46 +1299,51 @@ var ( ) var fileDescriptorGenerated = []byte{ - // 654 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x93, 0xdd, 0x6a, 0x13, 0x41, - 0x14, 0xc7, 0xb3, 0xfd, 0x22, 0x4c, 0xd3, 0x62, 0xd7, 0xa2, 0x31, 0xc8, 0x56, 0x72, 0x55, 0xaa, - 0x9d, 0x25, 0x45, 0xa1, 0x78, 0xa1, 0x74, 0xdb, 0x82, 0x15, 0x4b, 0xcb, 0xf6, 0x46, 0x04, 0x85, - 0xc9, 0xce, 0x71, 0x33, 0x66, 0xb3, 0xb3, 0xcc, 0xcc, 0x46, 0x7b, 0xe7, 0x23, 0xf8, 0x0a, 0x3e, - 0x8c, 0x50, 0xbc, 0xea, 0xa5, 0x57, 0xc1, 0xa4, 0x2f, 0x22, 0x3b, 0x99, 0xa4, 0xd9, 0x7c, 0x94, - 0x42, 0xf1, 0x6e, 0xcf, 0xcc, 0xf9, 0xfd, 0xff, 0xe7, 0x9c, 0x3d, 0x83, 0x5e, 0x36, 0x77, 0x25, - 0x66, 0xdc, 0x6d, 0xa6, 0x75, 0x10, 0x31, 0x28, 0x90, 0x6e, 0xd2, 0x0c, 0x5d, 0x92, 0x30, 0xe9, - 0x26, 0x3c, 0x62, 0xc1, 0xb9, 0xdb, 0xae, 0x91, 0x28, 0x69, 0x90, 0x9a, 0x1b, 0x42, 0x0c, 0x82, - 0x28, 0xa0, 0x38, 0x11, 0x5c, 0x71, 0x7b, 0xab, 0xcf, 0xe2, 0x6b, 0x16, 0x27, 0xcd, 0x10, 0x67, - 0x2c, 0xee, 0xb3, 0x78, 0xc0, 0x56, 0xb6, 0x43, 0xa6, 0x1a, 0x69, 0x1d, 0x07, 0xbc, 0xe5, 0x86, - 0x3c, 0xe4, 0xae, 0x96, 0xa8, 0xa7, 0x9f, 0x75, 0xa4, 0x03, 0xfd, 0xd5, 0x97, 0xae, 0xec, 0xcc, - 0x2c, 0xcb, 0x15, 0x20, 0x79, 0x2a, 0x02, 0x18, 0x2f, 0xa7, 0xf2, 0x62, 0x36, 0x93, 0xc6, 0x6d, - 0x10, 0x92, 0xf1, 0x18, 0xe8, 0x04, 0xf6, 0x6c, 0x36, 0xd6, 0x9e, 0xe8, 0xb9, 0xb2, 0x3d, 0x3d, - 0x5b, 0xa4, 0xb1, 0x62, 0xad, 0xc9, 0x9a, 0x6a, 0xd3, 0xd3, 0x53, 0xc5, 0x22, 0x97, 0xc5, 0x4a, - 0x2a, 0x31, 0x8e, 0x54, 0x7f, 0x5b, 0xa8, 0x78, 0xd8, 0x66, 0x81, 0x62, 0x3c, 0xb6, 0xdf, 0xa3, - 0x62, 0x0b, 0x14, 0xa1, 0x44, 0x91, 0xb2, 0xf5, 0xc4, 0xda, 0x5c, 0xde, 0xd9, 0xc4, 0x33, 0xa7, - 0x8e, 0xdb, 0x35, 0x7c, 0x52, 0xff, 0x02, 0x81, 0x3a, 0x06, 0x45, 0x3c, 0xfb, 0xa2, 0xb3, 0x51, - 0xe8, 0x75, 0x36, 0xd0, 0xf5, 0x99, 0x3f, 0x54, 0xb3, 0x29, 0x5a, 0xa1, 0x10, 0x81, 0x82, 0x93, - 0x24, 0x73, 0x92, 0xe5, 0x39, 0x2d, 0xff, 0xf4, 0x66, 0xf9, 0x83, 0x51, 0xc4, 0x5b, 0xeb, 0x75, - 0x36, 0x56, 0x72, 0x47, 0x7e, 0x5e, 0xb4, 0xfa, 0x6b, 0x0e, 0xdd, 0x3f, 0xe5, 0xf4, 0x80, 0x49, - 0x91, 0xea, 0x23, 0x2f, 0xa5, 0x21, 0xa8, 0xff, 0xd8, 0x17, 0xa0, 0x05, 0x99, 0x40, 0x60, 0xda, - 0xd9, 0xc7, 0xb7, 0xdf, 0x51, 0x3c, 0xa5, 0xd0, 0xb3, 0x04, 0x02, 0xaf, 0x64, 0x0c, 0x17, 0xb2, - 0xc8, 0xd7, 0xf2, 0x76, 0x0b, 0x2d, 0x49, 0x45, 0x54, 0x2a, 0xcb, 0xf3, 0xda, 0xe8, 0xf0, 0xae, - 0x46, 0x5a, 0xcc, 0x5b, 0x35, 0x56, 0x4b, 0xfd, 0xd8, 0x37, 0x26, 0xd5, 0x8e, 0x85, 0x1e, 0x4e, - 0xa1, 0xde, 0x31, 0xa9, 0xec, 0x8f, 0x13, 0xb3, 0x74, 0x6f, 0x98, 0xe5, 0xc8, 0x53, 0xc0, 0x19, - 0xae, 0x47, 0x7a, 0xcf, 0xd8, 0x16, 0x07, 0x27, 0xb9, 0x45, 0x59, 0x64, 0x0a, 0x5a, 0xd9, 0x82, - 0xcc, 0x6f, 0x2e, 0xef, 0xbc, 0xbe, 0x63, 0xa3, 0xde, 0x8a, 0xf1, 0x5a, 0x3c, 0xca, 0x54, 0xfd, - 0xbe, 0x78, 0xf5, 0x6a, 0x7a, 0x83, 0xd9, 0xc4, 0xed, 0x06, 0x2a, 0xb5, 0x58, 0xbc, 0xd7, 0x26, - 0x2c, 0x22, 0xf5, 0x08, 0x4c, 0x93, 0x78, 0x46, 0x21, 0xd9, 0xdb, 0xc2, 0xfd, 0xb7, 0x85, 0x8f, - 0x62, 0x75, 0x22, 0xce, 0x94, 0x60, 0x71, 0xe8, 0xad, 0x1b, 0xdf, 0xd2, 0xf1, 0x88, 0x96, 0x9f, - 0x53, 0xb6, 0x3f, 0xa1, 0xa2, 0x84, 0x08, 0x02, 0xc5, 0x85, 0x59, 0xa0, 0xe7, 0xb7, 0x1d, 0x25, - 0xa9, 0x43, 0x74, 0x66, 0x58, 0xaf, 0x94, 0xcd, 0x72, 0x10, 0xf9, 0x43, 0xcd, 0xea, 0xcf, 0x39, - 0xf4, 0x68, 0xe6, 0xcf, 0xb7, 0xdf, 0xa2, 0x35, 0x3a, 0xbc, 0xd9, 0x8b, 0x22, 0xfe, 0x15, 0xa8, - 0x6e, 0xb6, 0xe8, 0x3d, 0x36, 0xc5, 0xaf, 0xe7, 0x68, 0x93, 0xe3, 0x4f, 0x62, 0xf6, 0x2b, 0xb4, - 0x1a, 0xa4, 0x42, 0x40, 0xac, 0xde, 0x00, 0x89, 0x54, 0xe3, 0x5c, 0xf7, 0xb3, 0xe8, 0x3d, 0x30, - 0x42, 0xab, 0xfb, 0xb9, 0x5b, 0x7f, 0x2c, 0x3b, 0xe3, 0x29, 0x48, 0x26, 0x80, 0x0e, 0xf8, 0xf9, - 0x3c, 0x7f, 0x90, 0xbb, 0xf5, 0xc7, 0xb2, 0xed, 0x5d, 0x54, 0x82, 0x6f, 0x09, 0x04, 0x0a, 0xe8, - 0x29, 0xa7, 0xb2, 0xbc, 0xa0, 0xe9, 0xe1, 0x3f, 0x38, 0x1c, 0xb9, 0xf3, 0x73, 0x99, 0xde, 0xd6, - 0x45, 0xd7, 0x29, 0x5c, 0x76, 0x9d, 0xc2, 0x9f, 0xae, 0x53, 0xf8, 0xde, 0x73, 0xac, 0x8b, 0x9e, - 0x63, 0x5d, 0xf6, 0x1c, 0xeb, 0x6f, 0xcf, 0xb1, 0x7e, 0x5c, 0x39, 0x85, 0x0f, 0xc5, 0xc1, 0x7e, - 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x7d, 0xdd, 0x26, 0x2d, 0xbe, 0x06, 0x00, 0x00, + // 728 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x94, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0xc7, 0xe3, 0x26, 0xe9, 0x2f, 0xbf, 0x6d, 0x52, 0x95, 0x85, 0x42, 0x88, 0x84, 0x8b, 0x72, + 0x6a, 0x05, 0x5d, 0x2b, 0x15, 0x48, 0x85, 0x43, 0xa5, 0x9a, 0x54, 0xa2, 0x12, 0x55, 0x2b, 0x17, + 0x09, 0x84, 0x04, 0x92, 0x63, 0x0f, 0xee, 0x12, 0xc7, 0xb6, 0x76, 0xd7, 0x81, 0xdc, 0x78, 0x04, + 0x0e, 0x3c, 0x05, 0xaf, 0xc1, 0xa5, 0xe2, 0xd4, 0x23, 0x17, 0x2a, 0x9a, 0xbe, 0x08, 0xf2, 0x66, + 0x93, 0xda, 0xf9, 0x53, 0x55, 0x2a, 0xdc, 0xbc, 0xbb, 0xf3, 0xf9, 0xce, 0x7c, 0x67, 0x67, 0x8d, + 0x9e, 0xb4, 0x37, 0x39, 0xa1, 0xa1, 0xd1, 0x8e, 0x5b, 0xc0, 0x02, 0x10, 0xc0, 0x8d, 0xa8, 0xed, + 0x19, 0x76, 0x44, 0xb9, 0x11, 0x85, 0x3e, 0x75, 0x7a, 0x46, 0xb7, 0xd1, 0x02, 0x61, 0x37, 0x0c, + 0x0f, 0x02, 0x60, 0xb6, 0x00, 0x97, 0x44, 0x2c, 0x14, 0x21, 0x5e, 0x1b, 0xa0, 0xe4, 0x02, 0x25, + 0x51, 0xdb, 0x23, 0x09, 0x4a, 0x06, 0x28, 0x51, 0x68, 0x6d, 0xdd, 0xa3, 0xe2, 0x28, 0x6e, 0x11, + 0x27, 0xec, 0x18, 0x5e, 0xe8, 0x85, 0x86, 0x54, 0x68, 0xc5, 0xef, 0xe5, 0x4a, 0x2e, 0xe4, 0xd7, + 0x40, 0xb9, 0xb6, 0x31, 0xb3, 0x28, 0x83, 0x01, 0x0f, 0x63, 0xe6, 0xc0, 0x78, 0x35, 0xb5, 0xc7, + 0xb3, 0x99, 0x38, 0xe8, 0x02, 0xe3, 0x34, 0x0c, 0xc0, 0x9d, 0xc0, 0x1e, 0xce, 0xc6, 0xba, 0x13, + 0x96, 0x6b, 0xeb, 0xd3, 0xa3, 0x59, 0x1c, 0x08, 0xda, 0x99, 0xac, 0xa9, 0x31, 0x3d, 0x3c, 0x16, + 0xd4, 0x37, 0x68, 0x20, 0xb8, 0x60, 0xe3, 0x48, 0xfd, 0x87, 0x86, 0x4a, 0x3b, 0x5d, 0xea, 0x08, + 0x1a, 0x06, 0xf8, 0x35, 0x2a, 0x75, 0x40, 0xd8, 0xae, 0x2d, 0xec, 0xaa, 0x76, 0x5f, 0x5b, 0x5d, + 0xd8, 0x58, 0x25, 0x33, 0x9b, 0x4e, 0xba, 0x0d, 0xb2, 0xdf, 0xfa, 0x00, 0x8e, 0xd8, 0x03, 0x61, + 0x9b, 0xf8, 0xf8, 0x74, 0x25, 0xd7, 0x3f, 0x5d, 0x41, 0x17, 0x7b, 0xd6, 0x48, 0x0d, 0xbb, 0xa8, + 0xe2, 0x82, 0x0f, 0x02, 0xf6, 0xa3, 0x24, 0x13, 0xaf, 0xce, 0x49, 0xf9, 0x07, 0x97, 0xcb, 0x37, + 0xd3, 0x88, 0x79, 0xa3, 0x7f, 0xba, 0x52, 0xc9, 0x6c, 0x59, 0x59, 0xd1, 0xfa, 0xf7, 0x39, 0x74, + 0xf3, 0x20, 0x74, 0x9b, 0x94, 0xb3, 0x58, 0x6e, 0x99, 0xb1, 0xeb, 0x81, 0xf8, 0xa7, 0xbe, 0x0a, + 0x3c, 0x02, 0x47, 0xd9, 0x31, 0xc9, 0x95, 0x47, 0x94, 0x4c, 0xa9, 0xf3, 0x30, 0x02, 0xc7, 0x2c, + 0xab, 0x7c, 0x85, 0x64, 0x65, 0x49, 0x75, 0xec, 0xa3, 0x79, 0x2e, 0x6c, 0x11, 0xf3, 0x6a, 0x5e, + 0xe6, 0x69, 0x5e, 0x33, 0x8f, 0xd4, 0x32, 0x17, 0x55, 0xa6, 0xf9, 0xc1, 0xda, 0x52, 0x39, 0xea, + 0xbf, 0x34, 0x74, 0x67, 0x0a, 0xf5, 0x82, 0x72, 0x81, 0xdf, 0x4e, 0x74, 0xd2, 0xb8, 0xa4, 0x93, + 0xa9, 0x87, 0x40, 0x12, 0x5c, 0x36, 0x74, 0x49, 0xa5, 0x2d, 0x0d, 0x77, 0x52, 0xed, 0x74, 0x50, + 0x91, 0x0a, 0xe8, 0x24, 0xe3, 0x91, 0x5f, 0x5d, 0xd8, 0xd8, 0xba, 0x9e, 0x4f, 0xb3, 0xa2, 0x52, + 0x15, 0x77, 0x13, 0x51, 0x6b, 0xa0, 0x5d, 0x3f, 0x9f, 0xee, 0x2f, 0xe9, 0x37, 0x3e, 0x42, 0xe5, + 0x0e, 0x0d, 0xb6, 0xbb, 0x36, 0xf5, 0xed, 0x96, 0x0f, 0xca, 0x23, 0x99, 0x51, 0x47, 0xf2, 0xb0, + 0xc8, 0xe0, 0x61, 0x91, 0xdd, 0x40, 0xec, 0xb3, 0x43, 0xc1, 0x68, 0xe0, 0x99, 0xb7, 0x54, 0xde, + 0xf2, 0x5e, 0x4a, 0xcb, 0xca, 0x28, 0xe3, 0x77, 0xa8, 0xc4, 0xc1, 0x07, 0x47, 0x84, 0x4c, 0x4d, + 0xcf, 0xa3, 0xab, 0x76, 0xd2, 0x6e, 0x81, 0x7f, 0xa8, 0x58, 0xb3, 0x9c, 0xb4, 0x72, 0xb8, 0xb2, + 0x46, 0x9a, 0xf5, 0x6f, 0x05, 0x74, 0x77, 0xe6, 0xdd, 0xe3, 0x3d, 0x84, 0xdd, 0xd1, 0x09, 0xdf, + 0xf6, 0xfd, 0xf0, 0x23, 0xb8, 0xd2, 0x6d, 0xd1, 0xbc, 0xa7, 0xaa, 0x5f, 0xce, 0xe0, 0xc3, 0x20, + 0x6b, 0x0a, 0x88, 0xb7, 0xd0, 0xa2, 0x13, 0x33, 0x06, 0x81, 0x78, 0x0e, 0xb6, 0x2f, 0x8e, 0x7a, + 0xd2, 0x52, 0xd1, 0xbc, 0xad, 0xa4, 0x16, 0x9f, 0x65, 0x4e, 0xad, 0xb1, 0xe8, 0x84, 0x77, 0x81, + 0x53, 0x06, 0xee, 0x90, 0xcf, 0x67, 0xf9, 0x66, 0xe6, 0xd4, 0x1a, 0x8b, 0xc6, 0x9b, 0xa8, 0x0c, + 0x9f, 0x22, 0x70, 0x04, 0xb8, 0x07, 0xa1, 0xcb, 0xab, 0x05, 0x49, 0x8f, 0xae, 0x61, 0x27, 0x75, + 0x66, 0x65, 0x22, 0xf1, 0x57, 0x0d, 0x55, 0x94, 0x21, 0xc5, 0x16, 0xe5, 0xe8, 0xbd, 0xfa, 0x1b, + 0x4f, 0x8c, 0x34, 0xd3, 0xca, 0x3b, 0x81, 0x60, 0x3d, 0x73, 0x59, 0x15, 0x55, 0xc9, 0x9c, 0x59, + 0xd9, 0x22, 0x6a, 0x1d, 0x84, 0x27, 0x59, 0xbc, 0x84, 0xf2, 0x6d, 0xe8, 0xc9, 0x6b, 0xfa, 0xdf, + 0x4a, 0x3e, 0xf1, 0x36, 0x2a, 0x76, 0x6d, 0x3f, 0x86, 0x2b, 0xfc, 0x4f, 0xd3, 0x23, 0xf4, 0x92, + 0x76, 0xc0, 0x1a, 0x90, 0x4f, 0xe7, 0x36, 0x35, 0x73, 0xed, 0xf8, 0x4c, 0xcf, 0x9d, 0x9c, 0xe9, + 0xb9, 0x9f, 0x67, 0x7a, 0xee, 0x73, 0x5f, 0xd7, 0x8e, 0xfb, 0xba, 0x76, 0xd2, 0xd7, 0xb5, 0xdf, + 0x7d, 0x5d, 0xfb, 0x72, 0xae, 0xe7, 0xde, 0xfc, 0xa7, 0xcc, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, + 0xd0, 0x3c, 0x91, 0x46, 0xc1, 0x07, 0x00, 0x00, } diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/generated.proto b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/generated.proto similarity index 73% rename from staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/generated.proto rename to staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/generated.proto index 25a499322f0..741d75d643c 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/generated.proto +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/generated.proto @@ -19,7 +19,7 @@ limitations under the License. syntax = 'proto2'; -package k8s.io.kubernetes.pkg.apis.policy.v1alpha1; +package k8s.io.kubernetes.pkg.apis.policy.v1beta1; import "k8s.io/kubernetes/pkg/api/resource/generated.proto"; import "k8s.io/kubernetes/pkg/api/unversioned/generated.proto"; @@ -28,38 +28,32 @@ import "k8s.io/kubernetes/pkg/runtime/generated.proto"; import "k8s.io/kubernetes/pkg/util/intstr/generated.proto"; // Package-wide variables from generator "generated". -option go_package = "v1alpha1"; +option go_package = "v1beta1"; // Eviction evicts a pod from its node subject to certain policies and safety constraints. // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods//evictions. message Eviction { // ObjectMeta describes the pod that is being evicted. - // +optional optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; // DeleteOptions may be provided - // +optional optional k8s.io.kubernetes.pkg.api.v1.DeleteOptions deleteOptions = 2; } // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods message PodDisruptionBudget { - // +optional optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; // Specification of the desired behavior of the PodDisruptionBudget. - // +optional optional PodDisruptionBudgetSpec spec = 2; // Most recently observed status of the PodDisruptionBudget. - // +optional optional PodDisruptionBudgetStatus status = 3; } // PodDisruptionBudgetList is a collection of PodDisruptionBudgets. message PodDisruptionBudgetList { - // +optional optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1; repeated PodDisruptionBudget items = 2; @@ -71,20 +65,18 @@ message PodDisruptionBudgetSpec { // "selector" will still be available after the eviction, i.e. even in the // absence of the evicted pod. So for example you can prevent all voluntary // evictions by specifying "100%". - // +optional optional k8s.io.kubernetes.pkg.util.intstr.IntOrString minAvailable = 1; // Label query over pods whose evictions are managed by the disruption // budget. - // +optional optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector selector = 2; } // PodDisruptionBudgetStatus represents information about the status of a // PodDisruptionBudget. Status may trail the actual state of a system. message PodDisruptionBudgetStatus { - // Whether or not a disruption is currently allowed. - optional bool disruptionAllowed = 1; + // Number of pod disruptions that are currently allowed. + optional int32 disruptionsAllowed = 1; // current number of healthy pods optional int32 currentHealthy = 2; @@ -94,5 +86,18 @@ message PodDisruptionBudgetStatus { // total number of pods counted by this disruption budget optional int32 expectedPods = 4; + + // DisruptedPods contains information about pods whose eviction was + // processed by the API server eviction subresource handler but has not + // yet been observed by the PodDisruptionBudget controller. + // A pod will be in this map from the time when the API server processed the + // eviction request to the time when the pod is seen by PDB controller + // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod + // and the value is the time when the API server processed the eviction request. If + // the deletion didn't occur and a pod is still there it will be removed from + // the list automatically by PodDisruptionBudget controller after some time. + // If everything goes smooth this map should be empty for the most of the time. + // Large number of entries in the map may indicate problems with pod deletions. + map disruptedPods = 5; } diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/register.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/register.go new file mode 100644 index 00000000000..9901c28b2f3 --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/register.go @@ -0,0 +1,50 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "k8s.io/client-go/pkg/api/unversioned" + "k8s.io/client-go/pkg/api/v1" + "k8s.io/client-go/pkg/runtime" + versionedwatch "k8s.io/client-go/pkg/watch/versioned" +) + +// GroupName is the group name use in this package +const GroupName = "policy" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta1"} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &PodDisruptionBudget{}, + &PodDisruptionBudgetList{}, + &Eviction{}, + &v1.ListOptions{}, + &v1.DeleteOptions{}, + &v1.ExportOptions{}, + ) + // Add the watch version that applies + versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/types.generated.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/types.generated.go similarity index 65% rename from staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/types.generated.go rename to staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/types.generated.go index 3d26017b455..359afa7b2a7 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/types.generated.go +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/types.generated.go @@ -19,7 +19,7 @@ limitations under the License. // THIS FILE IS AUTO-GENERATED BY codecgen. // ************************************************************ -package v1alpha1 +package v1beta1 import ( "errors" @@ -362,14 +362,14 @@ func (x *PodDisruptionBudgetStatus) CodecEncodeSelf(e *codec1978.Encoder) { } else { yysep24 := !z.EncBinary() yy2arr24 := z.EncBasicHandle().StructToArray - var yyq24 [4]bool + var yyq24 [5]bool _, _, _ = yysep24, yyq24, yy2arr24 const yyr24 bool = false var yynn24 int if yyr24 || yy2arr24 { - r.EncodeArrayStart(4) + r.EncodeArrayStart(5) } else { - yynn24 = 4 + yynn24 = 5 for _, b := range yyq24 { if b { yynn24++ @@ -384,17 +384,17 @@ func (x *PodDisruptionBudgetStatus) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym26 if false { } else { - r.EncodeBool(bool(x.PodDisruptionAllowed)) + r.EncodeInt(int64(x.PodDisruptionsAllowed)) } } else { z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("disruptionAllowed")) + r.EncodeString(codecSelferC_UTF81234, string("disruptionsAllowed")) z.EncSendContainerState(codecSelfer_containerMapValue1234) yym27 := z.EncBinary() _ = yym27 if false { } else { - r.EncodeBool(bool(x.PodDisruptionAllowed)) + r.EncodeInt(int64(x.PodDisruptionsAllowed)) } } if yyr24 || yy2arr24 { @@ -454,6 +454,33 @@ func (x *PodDisruptionBudgetStatus) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(int64(x.ExpectedPods)) } } + if yyr24 || yy2arr24 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if x.DisruptedPods == nil { + r.EncodeNil() + } else { + yym38 := z.EncBinary() + _ = yym38 + if false { + } else { + h.encMapstringunversioned_Time((map[string]pkg2_unversioned.Time)(x.DisruptedPods), e) + } + } + } else { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("disruptedPods")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + if x.DisruptedPods == nil { + r.EncodeNil() + } else { + yym39 := z.EncBinary() + _ = yym39 + if false { + } else { + h.encMapstringunversioned_Time((map[string]pkg2_unversioned.Time)(x.DisruptedPods), e) + } + } + } if yyr24 || yy2arr24 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { @@ -467,25 +494,25 @@ func (x *PodDisruptionBudgetStatus) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym37 := z.DecBinary() - _ = yym37 + yym40 := z.DecBinary() + _ = yym40 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct38 := r.ContainerType() - if yyct38 == codecSelferValueTypeMap1234 { - yyl38 := r.ReadMapStart() - if yyl38 == 0 { + yyct41 := r.ContainerType() + if yyct41 == codecSelferValueTypeMap1234 { + yyl41 := r.ReadMapStart() + if yyl41 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl38, d) + x.codecDecodeSelfFromMap(yyl41, d) } - } else if yyct38 == codecSelferValueTypeArray1234 { - yyl38 := r.ReadArrayStart() - if yyl38 == 0 { + } else if yyct41 == codecSelferValueTypeArray1234 { + yyl41 := r.ReadArrayStart() + if yyl41 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl38, d) + x.codecDecodeSelfFromArray(yyl41, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -497,12 +524,12 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromMap(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys39Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys39Slc - var yyhl39 bool = l >= 0 - for yyj39 := 0; ; yyj39++ { - if yyhl39 { - if yyj39 >= l { + var yys42Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys42Slc + var yyhl42 bool = l >= 0 + for yyj42 := 0; ; yyj42++ { + if yyhl42 { + if yyj42 >= l { break } } else { @@ -511,15 +538,15 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromMap(l int, d *codec1978.D } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys39Slc = r.DecodeBytes(yys39Slc, true, true) - yys39 := string(yys39Slc) + yys42Slc = r.DecodeBytes(yys42Slc, true, true) + yys42 := string(yys42Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys39 { - case "disruptionAllowed": + switch yys42 { + case "disruptionsAllowed": if r.TryDecodeAsNil() { - x.PodDisruptionAllowed = false + x.PodDisruptionsAllowed = 0 } else { - x.PodDisruptionAllowed = bool(r.DecodeBool()) + x.PodDisruptionsAllowed = int32(r.DecodeInt(32)) } case "currentHealthy": if r.TryDecodeAsNil() { @@ -539,10 +566,22 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromMap(l int, d *codec1978.D } else { x.ExpectedPods = int32(r.DecodeInt(32)) } + case "disruptedPods": + if r.TryDecodeAsNil() { + x.DisruptedPods = nil + } else { + yyv47 := &x.DisruptedPods + yym48 := z.DecBinary() + _ = yym48 + if false { + } else { + h.decMapstringunversioned_Time((*map[string]pkg2_unversioned.Time)(yyv47), d) + } + } default: - z.DecStructFieldNotFound(-1, yys39) - } // end switch yys39 - } // end for yyj39 + z.DecStructFieldNotFound(-1, yys42) + } // end switch yys42 + } // end for yyj42 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -550,32 +589,32 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromArray(l int, d *codec1978 var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj44 int - var yyb44 bool - var yyhl44 bool = l >= 0 - yyj44++ - if yyhl44 { - yyb44 = yyj44 > l + var yyj49 int + var yyb49 bool + var yyhl49 bool = l >= 0 + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l } else { - yyb44 = r.CheckBreak() + yyb49 = r.CheckBreak() } - if yyb44 { + if yyb49 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } z.DecSendContainerState(codecSelfer_containerArrayElem1234) if r.TryDecodeAsNil() { - x.PodDisruptionAllowed = false + x.PodDisruptionsAllowed = 0 } else { - x.PodDisruptionAllowed = bool(r.DecodeBool()) + x.PodDisruptionsAllowed = int32(r.DecodeInt(32)) } - yyj44++ - if yyhl44 { - yyb44 = yyj44 > l + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l } else { - yyb44 = r.CheckBreak() + yyb49 = r.CheckBreak() } - if yyb44 { + if yyb49 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -585,13 +624,13 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.CurrentHealthy = int32(r.DecodeInt(32)) } - yyj44++ - if yyhl44 { - yyb44 = yyj44 > l + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l } else { - yyb44 = r.CheckBreak() + yyb49 = r.CheckBreak() } - if yyb44 { + if yyb49 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -601,13 +640,13 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.DesiredHealthy = int32(r.DecodeInt(32)) } - yyj44++ - if yyhl44 { - yyb44 = yyj44 > l + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l } else { - yyb44 = r.CheckBreak() + yyb49 = r.CheckBreak() } - if yyb44 { + if yyb49 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -617,18 +656,40 @@ func (x *PodDisruptionBudgetStatus) codecDecodeSelfFromArray(l int, d *codec1978 } else { x.ExpectedPods = int32(r.DecodeInt(32)) } - for { - yyj44++ - if yyhl44 { - yyb44 = yyj44 > l + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l + } else { + yyb49 = r.CheckBreak() + } + if yyb49 { + z.DecSendContainerState(codecSelfer_containerArrayEnd1234) + return + } + z.DecSendContainerState(codecSelfer_containerArrayElem1234) + if r.TryDecodeAsNil() { + x.DisruptedPods = nil + } else { + yyv54 := &x.DisruptedPods + yym55 := z.DecBinary() + _ = yym55 + if false { } else { - yyb44 = r.CheckBreak() + h.decMapstringunversioned_Time((*map[string]pkg2_unversioned.Time)(yyv54), d) } - if yyb44 { + } + for { + yyj49++ + if yyhl49 { + yyb49 = yyj49 > l + } else { + yyb49 = r.CheckBreak() + } + if yyb49 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj44-1, "") + z.DecStructFieldNotFound(yyj49-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -640,39 +701,39 @@ func (x *PodDisruptionBudget) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym49 := z.EncBinary() - _ = yym49 + yym56 := z.EncBinary() + _ = yym56 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep50 := !z.EncBinary() - yy2arr50 := z.EncBasicHandle().StructToArray - var yyq50 [5]bool - _, _, _ = yysep50, yyq50, yy2arr50 - const yyr50 bool = false - yyq50[0] = x.Kind != "" - yyq50[1] = x.APIVersion != "" - yyq50[2] = true - yyq50[3] = true - yyq50[4] = true - var yynn50 int - if yyr50 || yy2arr50 { + yysep57 := !z.EncBinary() + yy2arr57 := z.EncBasicHandle().StructToArray + var yyq57 [5]bool + _, _, _ = yysep57, yyq57, yy2arr57 + const yyr57 bool = false + yyq57[0] = x.Kind != "" + yyq57[1] = x.APIVersion != "" + yyq57[2] = true + yyq57[3] = true + yyq57[4] = true + var yynn57 int + if yyr57 || yy2arr57 { r.EncodeArrayStart(5) } else { - yynn50 = 0 - for _, b := range yyq50 { + yynn57 = 0 + for _, b := range yyq57 { if b { - yynn50++ + yynn57++ } } - r.EncodeMapStart(yynn50) - yynn50 = 0 + r.EncodeMapStart(yynn57) + yynn57 = 0 } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq50[0] { - yym52 := z.EncBinary() - _ = yym52 + if yyq57[0] { + yym59 := z.EncBinary() + _ = yym59 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) @@ -681,23 +742,23 @@ func (x *PodDisruptionBudget) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq50[0] { + if yyq57[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym53 := z.EncBinary() - _ = yym53 + yym60 := z.EncBinary() + _ = yym60 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq50[1] { - yym55 := z.EncBinary() - _ = yym55 + if yyq57[1] { + yym62 := z.EncBinary() + _ = yym62 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) @@ -706,70 +767,70 @@ func (x *PodDisruptionBudget) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq50[1] { + if yyq57[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym56 := z.EncBinary() - _ = yym56 + yym63 := z.EncBinary() + _ = yym63 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq50[2] { - yy58 := &x.ObjectMeta - yy58.CodecEncodeSelf(e) + if yyq57[2] { + yy65 := &x.ObjectMeta + yy65.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq50[2] { + if yyq57[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy59 := &x.ObjectMeta - yy59.CodecEncodeSelf(e) + yy66 := &x.ObjectMeta + yy66.CodecEncodeSelf(e) } } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq50[3] { - yy61 := &x.Spec - yy61.CodecEncodeSelf(e) + if yyq57[3] { + yy68 := &x.Spec + yy68.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq50[3] { + if yyq57[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("spec")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy62 := &x.Spec - yy62.CodecEncodeSelf(e) + yy69 := &x.Spec + yy69.CodecEncodeSelf(e) } } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq50[4] { - yy64 := &x.Status - yy64.CodecEncodeSelf(e) + if yyq57[4] { + yy71 := &x.Status + yy71.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq50[4] { + if yyq57[4] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("status")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy65 := &x.Status - yy65.CodecEncodeSelf(e) + yy72 := &x.Status + yy72.CodecEncodeSelf(e) } } - if yyr50 || yy2arr50 { + if yyr57 || yy2arr57 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -782,25 +843,25 @@ func (x *PodDisruptionBudget) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym66 := z.DecBinary() - _ = yym66 + yym73 := z.DecBinary() + _ = yym73 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct67 := r.ContainerType() - if yyct67 == codecSelferValueTypeMap1234 { - yyl67 := r.ReadMapStart() - if yyl67 == 0 { + yyct74 := r.ContainerType() + if yyct74 == codecSelferValueTypeMap1234 { + yyl74 := r.ReadMapStart() + if yyl74 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl67, d) + x.codecDecodeSelfFromMap(yyl74, d) } - } else if yyct67 == codecSelferValueTypeArray1234 { - yyl67 := r.ReadArrayStart() - if yyl67 == 0 { + } else if yyct74 == codecSelferValueTypeArray1234 { + yyl74 := r.ReadArrayStart() + if yyl74 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl67, d) + x.codecDecodeSelfFromArray(yyl74, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -812,12 +873,12 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromMap(l int, d *codec1978.Decoder var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys68Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys68Slc - var yyhl68 bool = l >= 0 - for yyj68 := 0; ; yyj68++ { - if yyhl68 { - if yyj68 >= l { + var yys75Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys75Slc + var yyhl75 bool = l >= 0 + for yyj75 := 0; ; yyj75++ { + if yyhl75 { + if yyj75 >= l { break } } else { @@ -826,10 +887,10 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromMap(l int, d *codec1978.Decoder } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys68Slc = r.DecodeBytes(yys68Slc, true, true) - yys68 := string(yys68Slc) + yys75Slc = r.DecodeBytes(yys75Slc, true, true) + yys75 := string(yys75Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys68 { + switch yys75 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -846,27 +907,27 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromMap(l int, d *codec1978.Decoder if r.TryDecodeAsNil() { x.ObjectMeta = pkg3_v1.ObjectMeta{} } else { - yyv71 := &x.ObjectMeta - yyv71.CodecDecodeSelf(d) + yyv78 := &x.ObjectMeta + yyv78.CodecDecodeSelf(d) } case "spec": if r.TryDecodeAsNil() { x.Spec = PodDisruptionBudgetSpec{} } else { - yyv72 := &x.Spec - yyv72.CodecDecodeSelf(d) + yyv79 := &x.Spec + yyv79.CodecDecodeSelf(d) } case "status": if r.TryDecodeAsNil() { x.Status = PodDisruptionBudgetStatus{} } else { - yyv73 := &x.Status - yyv73.CodecDecodeSelf(d) + yyv80 := &x.Status + yyv80.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys68) - } // end switch yys68 - } // end for yyj68 + z.DecStructFieldNotFound(-1, yys75) + } // end switch yys75 + } // end for yyj75 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -874,16 +935,16 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj74 int - var yyb74 bool - var yyhl74 bool = l >= 0 - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + var yyj81 int + var yyb81 bool + var yyhl81 bool = l >= 0 + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -893,13 +954,13 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.Kind = string(r.DecodeString()) } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -909,13 +970,13 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod } else { x.APIVersion = string(r.DecodeString()) } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -923,16 +984,16 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.ObjectMeta = pkg3_v1.ObjectMeta{} } else { - yyv77 := &x.ObjectMeta - yyv77.CodecDecodeSelf(d) + yyv84 := &x.ObjectMeta + yyv84.CodecDecodeSelf(d) } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -940,16 +1001,16 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.Spec = PodDisruptionBudgetSpec{} } else { - yyv78 := &x.Spec - yyv78.CodecDecodeSelf(d) + yyv85 := &x.Spec + yyv85.CodecDecodeSelf(d) } - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -957,21 +1018,21 @@ func (x *PodDisruptionBudget) codecDecodeSelfFromArray(l int, d *codec1978.Decod if r.TryDecodeAsNil() { x.Status = PodDisruptionBudgetStatus{} } else { - yyv79 := &x.Status - yyv79.CodecDecodeSelf(d) + yyv86 := &x.Status + yyv86.CodecDecodeSelf(d) } for { - yyj74++ - if yyhl74 { - yyb74 = yyj74 > l + yyj81++ + if yyhl81 { + yyb81 = yyj81 > l } else { - yyb74 = r.CheckBreak() + yyb81 = r.CheckBreak() } - if yyb74 { + if yyb81 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj74-1, "") + z.DecStructFieldNotFound(yyj81-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -983,118 +1044,118 @@ func (x *PodDisruptionBudgetList) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym80 := z.EncBinary() - _ = yym80 + yym87 := z.EncBinary() + _ = yym87 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep81 := !z.EncBinary() - yy2arr81 := z.EncBasicHandle().StructToArray - var yyq81 [4]bool - _, _, _ = yysep81, yyq81, yy2arr81 - const yyr81 bool = false - yyq81[0] = x.Kind != "" - yyq81[1] = x.APIVersion != "" - yyq81[2] = true - var yynn81 int - if yyr81 || yy2arr81 { + yysep88 := !z.EncBinary() + yy2arr88 := z.EncBasicHandle().StructToArray + var yyq88 [4]bool + _, _, _ = yysep88, yyq88, yy2arr88 + const yyr88 bool = false + yyq88[0] = x.Kind != "" + yyq88[1] = x.APIVersion != "" + yyq88[2] = true + var yynn88 int + if yyr88 || yy2arr88 { r.EncodeArrayStart(4) } else { - yynn81 = 1 - for _, b := range yyq81 { + yynn88 = 1 + for _, b := range yyq88 { if b { - yynn81++ + yynn88++ } } - r.EncodeMapStart(yynn81) - yynn81 = 0 + r.EncodeMapStart(yynn88) + yynn88 = 0 } - if yyr81 || yy2arr81 { + if yyr88 || yy2arr88 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq81[0] { - yym83 := z.EncBinary() - _ = yym83 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq81[0] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym84 := z.EncBinary() - _ = yym84 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr81 || yy2arr81 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq81[1] { - yym86 := z.EncBinary() - _ = yym86 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq81[1] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym87 := z.EncBinary() - _ = yym87 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr81 || yy2arr81 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq81[2] { - yy89 := &x.ListMeta + if yyq88[0] { yym90 := z.EncBinary() _ = yym90 if false { - } else if z.HasExtensions() && z.EncExt(yy89) { } else { - z.EncFallback(yy89) + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq88[0] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("kind")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym91 := z.EncBinary() + _ = yym91 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) + } + } + } + if yyr88 || yy2arr88 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq88[1] { + yym93 := z.EncBinary() + _ = yym93 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } else { + r.EncodeString(codecSelferC_UTF81234, "") + } + } else { + if yyq88[1] { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yym94 := z.EncBinary() + _ = yym94 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) + } + } + } + if yyr88 || yy2arr88 { + z.EncSendContainerState(codecSelfer_containerArrayElem1234) + if yyq88[2] { + yy96 := &x.ListMeta + yym97 := z.EncBinary() + _ = yym97 + if false { + } else if z.HasExtensions() && z.EncExt(yy96) { + } else { + z.EncFallback(yy96) } } else { r.EncodeNil() } } else { - if yyq81[2] { + if yyq88[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy91 := &x.ListMeta - yym92 := z.EncBinary() - _ = yym92 + yy98 := &x.ListMeta + yym99 := z.EncBinary() + _ = yym99 if false { - } else if z.HasExtensions() && z.EncExt(yy91) { + } else if z.HasExtensions() && z.EncExt(yy98) { } else { - z.EncFallback(yy91) + z.EncFallback(yy98) } } } - if yyr81 || yy2arr81 { + if yyr88 || yy2arr88 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) if x.Items == nil { r.EncodeNil() } else { - yym94 := z.EncBinary() - _ = yym94 + yym101 := z.EncBinary() + _ = yym101 if false { } else { h.encSlicePodDisruptionBudget(([]PodDisruptionBudget)(x.Items), e) @@ -1107,15 +1168,15 @@ func (x *PodDisruptionBudgetList) CodecEncodeSelf(e *codec1978.Encoder) { if x.Items == nil { r.EncodeNil() } else { - yym95 := z.EncBinary() - _ = yym95 + yym102 := z.EncBinary() + _ = yym102 if false { } else { h.encSlicePodDisruptionBudget(([]PodDisruptionBudget)(x.Items), e) } } } - if yyr81 || yy2arr81 { + if yyr88 || yy2arr88 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -1128,25 +1189,25 @@ func (x *PodDisruptionBudgetList) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym96 := z.DecBinary() - _ = yym96 + yym103 := z.DecBinary() + _ = yym103 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct97 := r.ContainerType() - if yyct97 == codecSelferValueTypeMap1234 { - yyl97 := r.ReadMapStart() - if yyl97 == 0 { + yyct104 := r.ContainerType() + if yyct104 == codecSelferValueTypeMap1234 { + yyl104 := r.ReadMapStart() + if yyl104 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl97, d) + x.codecDecodeSelfFromMap(yyl104, d) } - } else if yyct97 == codecSelferValueTypeArray1234 { - yyl97 := r.ReadArrayStart() - if yyl97 == 0 { + } else if yyct104 == codecSelferValueTypeArray1234 { + yyl104 := r.ReadArrayStart() + if yyl104 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl97, d) + x.codecDecodeSelfFromArray(yyl104, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -1158,12 +1219,12 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromMap(l int, d *codec1978.Dec var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys98Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys98Slc - var yyhl98 bool = l >= 0 - for yyj98 := 0; ; yyj98++ { - if yyhl98 { - if yyj98 >= l { + var yys105Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys105Slc + var yyhl105 bool = l >= 0 + for yyj105 := 0; ; yyj105++ { + if yyhl105 { + if yyj105 >= l { break } } else { @@ -1172,10 +1233,10 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromMap(l int, d *codec1978.Dec } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys98Slc = r.DecodeBytes(yys98Slc, true, true) - yys98 := string(yys98Slc) + yys105Slc = r.DecodeBytes(yys105Slc, true, true) + yys105 := string(yys105Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys98 { + switch yys105 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -1192,31 +1253,31 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromMap(l int, d *codec1978.Dec if r.TryDecodeAsNil() { x.ListMeta = pkg2_unversioned.ListMeta{} } else { - yyv101 := &x.ListMeta - yym102 := z.DecBinary() - _ = yym102 + yyv108 := &x.ListMeta + yym109 := z.DecBinary() + _ = yym109 if false { - } else if z.HasExtensions() && z.DecExt(yyv101) { + } else if z.HasExtensions() && z.DecExt(yyv108) { } else { - z.DecFallback(yyv101, false) + z.DecFallback(yyv108, false) } } case "items": if r.TryDecodeAsNil() { x.Items = nil } else { - yyv103 := &x.Items - yym104 := z.DecBinary() - _ = yym104 + yyv110 := &x.Items + yym111 := z.DecBinary() + _ = yym111 if false { } else { - h.decSlicePodDisruptionBudget((*[]PodDisruptionBudget)(yyv103), d) + h.decSlicePodDisruptionBudget((*[]PodDisruptionBudget)(yyv110), d) } } default: - z.DecStructFieldNotFound(-1, yys98) - } // end switch yys98 - } // end for yyj98 + z.DecStructFieldNotFound(-1, yys105) + } // end switch yys105 + } // end for yyj105 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -1224,16 +1285,16 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromArray(l int, d *codec1978.D var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj105 int - var yyb105 bool - var yyhl105 bool = l >= 0 - yyj105++ - if yyhl105 { - yyb105 = yyj105 > l + var yyj112 int + var yyb112 bool + var yyhl112 bool = l >= 0 + yyj112++ + if yyhl112 { + yyb112 = yyj112 > l } else { - yyb105 = r.CheckBreak() + yyb112 = r.CheckBreak() } - if yyb105 { + if yyb112 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1243,13 +1304,13 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromArray(l int, d *codec1978.D } else { x.Kind = string(r.DecodeString()) } - yyj105++ - if yyhl105 { - yyb105 = yyj105 > l + yyj112++ + if yyhl112 { + yyb112 = yyj112 > l } else { - yyb105 = r.CheckBreak() + yyb112 = r.CheckBreak() } - if yyb105 { + if yyb112 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1259,13 +1320,13 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromArray(l int, d *codec1978.D } else { x.APIVersion = string(r.DecodeString()) } - yyj105++ - if yyhl105 { - yyb105 = yyj105 > l + yyj112++ + if yyhl112 { + yyb112 = yyj112 > l } else { - yyb105 = r.CheckBreak() + yyb112 = r.CheckBreak() } - if yyb105 { + if yyb112 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1273,22 +1334,22 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromArray(l int, d *codec1978.D if r.TryDecodeAsNil() { x.ListMeta = pkg2_unversioned.ListMeta{} } else { - yyv108 := &x.ListMeta - yym109 := z.DecBinary() - _ = yym109 + yyv115 := &x.ListMeta + yym116 := z.DecBinary() + _ = yym116 if false { - } else if z.HasExtensions() && z.DecExt(yyv108) { + } else if z.HasExtensions() && z.DecExt(yyv115) { } else { - z.DecFallback(yyv108, false) + z.DecFallback(yyv115, false) } } - yyj105++ - if yyhl105 { - yyb105 = yyj105 > l + yyj112++ + if yyhl112 { + yyb112 = yyj112 > l } else { - yyb105 = r.CheckBreak() + yyb112 = r.CheckBreak() } - if yyb105 { + if yyb112 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1296,26 +1357,26 @@ func (x *PodDisruptionBudgetList) codecDecodeSelfFromArray(l int, d *codec1978.D if r.TryDecodeAsNil() { x.Items = nil } else { - yyv110 := &x.Items - yym111 := z.DecBinary() - _ = yym111 + yyv117 := &x.Items + yym118 := z.DecBinary() + _ = yym118 if false { } else { - h.decSlicePodDisruptionBudget((*[]PodDisruptionBudget)(yyv110), d) + h.decSlicePodDisruptionBudget((*[]PodDisruptionBudget)(yyv117), d) } } for { - yyj105++ - if yyhl105 { - yyb105 = yyj105 > l + yyj112++ + if yyhl112 { + yyb112 = yyj112 > l } else { - yyb105 = r.CheckBreak() + yyb112 = r.CheckBreak() } - if yyb105 { + if yyb112 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj105-1, "") + z.DecStructFieldNotFound(yyj112-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -1327,38 +1388,38 @@ func (x *Eviction) CodecEncodeSelf(e *codec1978.Encoder) { if x == nil { r.EncodeNil() } else { - yym112 := z.EncBinary() - _ = yym112 + yym119 := z.EncBinary() + _ = yym119 if false { } else if z.HasExtensions() && z.EncExt(x) { } else { - yysep113 := !z.EncBinary() - yy2arr113 := z.EncBasicHandle().StructToArray - var yyq113 [4]bool - _, _, _ = yysep113, yyq113, yy2arr113 - const yyr113 bool = false - yyq113[0] = x.Kind != "" - yyq113[1] = x.APIVersion != "" - yyq113[2] = true - yyq113[3] = x.DeleteOptions != nil - var yynn113 int - if yyr113 || yy2arr113 { + yysep120 := !z.EncBinary() + yy2arr120 := z.EncBasicHandle().StructToArray + var yyq120 [4]bool + _, _, _ = yysep120, yyq120, yy2arr120 + const yyr120 bool = false + yyq120[0] = x.Kind != "" + yyq120[1] = x.APIVersion != "" + yyq120[2] = true + yyq120[3] = x.DeleteOptions != nil + var yynn120 int + if yyr120 || yy2arr120 { r.EncodeArrayStart(4) } else { - yynn113 = 0 - for _, b := range yyq113 { + yynn120 = 0 + for _, b := range yyq120 { if b { - yynn113++ + yynn120++ } } - r.EncodeMapStart(yynn113) - yynn113 = 0 + r.EncodeMapStart(yynn120) + yynn120 = 0 } - if yyr113 || yy2arr113 { + if yyr120 || yy2arr120 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq113[0] { - yym115 := z.EncBinary() - _ = yym115 + if yyq120[0] { + yym122 := z.EncBinary() + _ = yym122 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) @@ -1367,23 +1428,23 @@ func (x *Eviction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq113[0] { + if yyq120[0] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("kind")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym116 := z.EncBinary() - _ = yym116 + yym123 := z.EncBinary() + _ = yym123 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) } } } - if yyr113 || yy2arr113 { + if yyr120 || yy2arr120 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq113[1] { - yym118 := z.EncBinary() - _ = yym118 + if yyq120[1] { + yym125 := z.EncBinary() + _ = yym125 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) @@ -1392,38 +1453,38 @@ func (x *Eviction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeString(codecSelferC_UTF81234, "") } } else { - if yyq113[1] { + if yyq120[1] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym119 := z.EncBinary() - _ = yym119 + yym126 := z.EncBinary() + _ = yym126 if false { } else { r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) } } } - if yyr113 || yy2arr113 { + if yyr120 || yy2arr120 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq113[2] { - yy121 := &x.ObjectMeta - yy121.CodecEncodeSelf(e) + if yyq120[2] { + yy128 := &x.ObjectMeta + yy128.CodecEncodeSelf(e) } else { r.EncodeNil() } } else { - if yyq113[2] { + if yyq120[2] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("metadata")) z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy122 := &x.ObjectMeta - yy122.CodecEncodeSelf(e) + yy129 := &x.ObjectMeta + yy129.CodecEncodeSelf(e) } } - if yyr113 || yy2arr113 { + if yyr120 || yy2arr120 { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq113[3] { + if yyq120[3] { if x.DeleteOptions == nil { r.EncodeNil() } else { @@ -1433,7 +1494,7 @@ func (x *Eviction) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeNil() } } else { - if yyq113[3] { + if yyq120[3] { z.EncSendContainerState(codecSelfer_containerMapKey1234) r.EncodeString(codecSelferC_UTF81234, string("deleteOptions")) z.EncSendContainerState(codecSelfer_containerMapValue1234) @@ -1444,7 +1505,7 @@ func (x *Eviction) CodecEncodeSelf(e *codec1978.Encoder) { } } } - if yyr113 || yy2arr113 { + if yyr120 || yy2arr120 { z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } else { z.EncSendContainerState(codecSelfer_containerMapEnd1234) @@ -1457,25 +1518,25 @@ func (x *Eviction) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yym124 := z.DecBinary() - _ = yym124 + yym131 := z.DecBinary() + _ = yym131 if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - yyct125 := r.ContainerType() - if yyct125 == codecSelferValueTypeMap1234 { - yyl125 := r.ReadMapStart() - if yyl125 == 0 { + yyct132 := r.ContainerType() + if yyct132 == codecSelferValueTypeMap1234 { + yyl132 := r.ReadMapStart() + if yyl132 == 0 { z.DecSendContainerState(codecSelfer_containerMapEnd1234) } else { - x.codecDecodeSelfFromMap(yyl125, d) + x.codecDecodeSelfFromMap(yyl132, d) } - } else if yyct125 == codecSelferValueTypeArray1234 { - yyl125 := r.ReadArrayStart() - if yyl125 == 0 { + } else if yyct132 == codecSelferValueTypeArray1234 { + yyl132 := r.ReadArrayStart() + if yyl132 == 0 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } else { - x.codecDecodeSelfFromArray(yyl125, d) + x.codecDecodeSelfFromArray(yyl132, d) } } else { panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) @@ -1487,12 +1548,12 @@ func (x *Eviction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys126Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys126Slc - var yyhl126 bool = l >= 0 - for yyj126 := 0; ; yyj126++ { - if yyhl126 { - if yyj126 >= l { + var yys133Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys133Slc + var yyhl133 bool = l >= 0 + for yyj133 := 0; ; yyj133++ { + if yyhl133 { + if yyj133 >= l { break } } else { @@ -1501,10 +1562,10 @@ func (x *Eviction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } } z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys126Slc = r.DecodeBytes(yys126Slc, true, true) - yys126 := string(yys126Slc) + yys133Slc = r.DecodeBytes(yys133Slc, true, true) + yys133 := string(yys133Slc) z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys126 { + switch yys133 { case "kind": if r.TryDecodeAsNil() { x.Kind = "" @@ -1521,8 +1582,8 @@ func (x *Eviction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ObjectMeta = pkg3_v1.ObjectMeta{} } else { - yyv129 := &x.ObjectMeta - yyv129.CodecDecodeSelf(d) + yyv136 := &x.ObjectMeta + yyv136.CodecDecodeSelf(d) } case "deleteOptions": if r.TryDecodeAsNil() { @@ -1536,9 +1597,9 @@ func (x *Eviction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.DeleteOptions.CodecDecodeSelf(d) } default: - z.DecStructFieldNotFound(-1, yys126) - } // end switch yys126 - } // end for yyj126 + z.DecStructFieldNotFound(-1, yys133) + } // end switch yys133 + } // end for yyj133 z.DecSendContainerState(codecSelfer_containerMapEnd1234) } @@ -1546,16 +1607,16 @@ func (x *Eviction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer1234 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj131 int - var yyb131 bool - var yyhl131 bool = l >= 0 - yyj131++ - if yyhl131 { - yyb131 = yyj131 > l + var yyj138 int + var yyb138 bool + var yyhl138 bool = l >= 0 + yyj138++ + if yyhl138 { + yyb138 = yyj138 > l } else { - yyb131 = r.CheckBreak() + yyb138 = r.CheckBreak() } - if yyb131 { + if yyb138 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1565,13 +1626,13 @@ func (x *Eviction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Kind = string(r.DecodeString()) } - yyj131++ - if yyhl131 { - yyb131 = yyj131 > l + yyj138++ + if yyhl138 { + yyb138 = yyj138 > l } else { - yyb131 = r.CheckBreak() + yyb138 = r.CheckBreak() } - if yyb131 { + if yyb138 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1581,13 +1642,13 @@ func (x *Eviction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.APIVersion = string(r.DecodeString()) } - yyj131++ - if yyhl131 { - yyb131 = yyj131 > l + yyj138++ + if yyhl138 { + yyb138 = yyj138 > l } else { - yyb131 = r.CheckBreak() + yyb138 = r.CheckBreak() } - if yyb131 { + if yyb138 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1595,16 +1656,16 @@ func (x *Eviction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.ObjectMeta = pkg3_v1.ObjectMeta{} } else { - yyv134 := &x.ObjectMeta - yyv134.CodecDecodeSelf(d) + yyv141 := &x.ObjectMeta + yyv141.CodecDecodeSelf(d) } - yyj131++ - if yyhl131 { - yyb131 = yyj131 > l + yyj138++ + if yyhl138 { + yyb138 = yyj138 > l } else { - yyb131 = r.CheckBreak() + yyb138 = r.CheckBreak() } - if yyb131 { + if yyb138 { z.DecSendContainerState(codecSelfer_containerArrayEnd1234) return } @@ -1620,30 +1681,155 @@ func (x *Eviction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { x.DeleteOptions.CodecDecodeSelf(d) } for { - yyj131++ - if yyhl131 { - yyb131 = yyj131 > l + yyj138++ + if yyhl138 { + yyb138 = yyj138 > l } else { - yyb131 = r.CheckBreak() + yyb138 = r.CheckBreak() } - if yyb131 { + if yyb138 { break } z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj131-1, "") + z.DecStructFieldNotFound(yyj138-1, "") } z.DecSendContainerState(codecSelfer_containerArrayEnd1234) } +func (x codecSelfer1234) encMapstringunversioned_Time(v map[string]pkg2_unversioned.Time, e *codec1978.Encoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + r.EncodeMapStart(len(v)) + for yyk143, yyv143 := range v { + z.EncSendContainerState(codecSelfer_containerMapKey1234) + yym144 := z.EncBinary() + _ = yym144 + if false { + } else { + r.EncodeString(codecSelferC_UTF81234, string(yyk143)) + } + z.EncSendContainerState(codecSelfer_containerMapValue1234) + yy145 := &yyv143 + yym146 := z.EncBinary() + _ = yym146 + if false { + } else if z.HasExtensions() && z.EncExt(yy145) { + } else if yym146 { + z.EncBinaryMarshal(yy145) + } else if !yym146 && z.IsJSONHandle() { + z.EncJSONMarshal(yy145) + } else { + z.EncFallback(yy145) + } + } + z.EncSendContainerState(codecSelfer_containerMapEnd1234) +} + +func (x codecSelfer1234) decMapstringunversioned_Time(v *map[string]pkg2_unversioned.Time, d *codec1978.Decoder) { + var h codecSelfer1234 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv147 := *v + yyl147 := r.ReadMapStart() + yybh147 := z.DecBasicHandle() + if yyv147 == nil { + yyrl147, _ := z.DecInferLen(yyl147, yybh147.MaxInitLen, 40) + yyv147 = make(map[string]pkg2_unversioned.Time, yyrl147) + *v = yyv147 + } + var yymk147 string + var yymv147 pkg2_unversioned.Time + var yymg147 bool + if yybh147.MapValueReset { + yymg147 = true + } + if yyl147 > 0 { + for yyj147 := 0; yyj147 < yyl147; yyj147++ { + z.DecSendContainerState(codecSelfer_containerMapKey1234) + if r.TryDecodeAsNil() { + yymk147 = "" + } else { + yymk147 = string(r.DecodeString()) + } + + if yymg147 { + yymv147 = yyv147[yymk147] + } else { + yymv147 = pkg2_unversioned.Time{} + } + z.DecSendContainerState(codecSelfer_containerMapValue1234) + if r.TryDecodeAsNil() { + yymv147 = pkg2_unversioned.Time{} + } else { + yyv149 := &yymv147 + yym150 := z.DecBinary() + _ = yym150 + if false { + } else if z.HasExtensions() && z.DecExt(yyv149) { + } else if yym150 { + z.DecBinaryUnmarshal(yyv149) + } else if !yym150 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv149) + } else { + z.DecFallback(yyv149, false) + } + } + + if yyv147 != nil { + yyv147[yymk147] = yymv147 + } + } + } else if yyl147 < 0 { + for yyj147 := 0; !r.CheckBreak(); yyj147++ { + z.DecSendContainerState(codecSelfer_containerMapKey1234) + if r.TryDecodeAsNil() { + yymk147 = "" + } else { + yymk147 = string(r.DecodeString()) + } + + if yymg147 { + yymv147 = yyv147[yymk147] + } else { + yymv147 = pkg2_unversioned.Time{} + } + z.DecSendContainerState(codecSelfer_containerMapValue1234) + if r.TryDecodeAsNil() { + yymv147 = pkg2_unversioned.Time{} + } else { + yyv152 := &yymv147 + yym153 := z.DecBinary() + _ = yym153 + if false { + } else if z.HasExtensions() && z.DecExt(yyv152) { + } else if yym153 { + z.DecBinaryUnmarshal(yyv152) + } else if !yym153 && z.IsJSONHandle() { + z.DecJSONUnmarshal(yyv152) + } else { + z.DecFallback(yyv152, false) + } + } + + if yyv147 != nil { + yyv147[yymk147] = yymv147 + } + } + } // else len==0: TODO: Should we clear map entries? + z.DecSendContainerState(codecSelfer_containerMapEnd1234) +} + func (x codecSelfer1234) encSlicePodDisruptionBudget(v []PodDisruptionBudget, e *codec1978.Encoder) { var h codecSelfer1234 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - for _, yyv136 := range v { + for _, yyv154 := range v { z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy137 := &yyv136 - yy137.CodecEncodeSelf(e) + yy155 := &yyv154 + yy155.CodecEncodeSelf(e) } z.EncSendContainerState(codecSelfer_containerArrayEnd1234) } @@ -1653,83 +1839,83 @@ func (x codecSelfer1234) decSlicePodDisruptionBudget(v *[]PodDisruptionBudget, d z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv138 := *v - yyh138, yyl138 := z.DecSliceHelperStart() - var yyc138 bool - if yyl138 == 0 { - if yyv138 == nil { - yyv138 = []PodDisruptionBudget{} - yyc138 = true - } else if len(yyv138) != 0 { - yyv138 = yyv138[:0] - yyc138 = true + yyv156 := *v + yyh156, yyl156 := z.DecSliceHelperStart() + var yyc156 bool + if yyl156 == 0 { + if yyv156 == nil { + yyv156 = []PodDisruptionBudget{} + yyc156 = true + } else if len(yyv156) != 0 { + yyv156 = yyv156[:0] + yyc156 = true } - } else if yyl138 > 0 { - var yyrr138, yyrl138 int - var yyrt138 bool - if yyl138 > cap(yyv138) { + } else if yyl156 > 0 { + var yyrr156, yyrl156 int + var yyrt156 bool + if yyl156 > cap(yyv156) { - yyrg138 := len(yyv138) > 0 - yyv2138 := yyv138 - yyrl138, yyrt138 = z.DecInferLen(yyl138, z.DecBasicHandle().MaxInitLen, 312) - if yyrt138 { - if yyrl138 <= cap(yyv138) { - yyv138 = yyv138[:yyrl138] + yyrg156 := len(yyv156) > 0 + yyv2156 := yyv156 + yyrl156, yyrt156 = z.DecInferLen(yyl156, z.DecBasicHandle().MaxInitLen, 320) + if yyrt156 { + if yyrl156 <= cap(yyv156) { + yyv156 = yyv156[:yyrl156] } else { - yyv138 = make([]PodDisruptionBudget, yyrl138) + yyv156 = make([]PodDisruptionBudget, yyrl156) } } else { - yyv138 = make([]PodDisruptionBudget, yyrl138) + yyv156 = make([]PodDisruptionBudget, yyrl156) } - yyc138 = true - yyrr138 = len(yyv138) - if yyrg138 { - copy(yyv138, yyv2138) + yyc156 = true + yyrr156 = len(yyv156) + if yyrg156 { + copy(yyv156, yyv2156) } - } else if yyl138 != len(yyv138) { - yyv138 = yyv138[:yyl138] - yyc138 = true + } else if yyl156 != len(yyv156) { + yyv156 = yyv156[:yyl156] + yyc156 = true } - yyj138 := 0 - for ; yyj138 < yyrr138; yyj138++ { - yyh138.ElemContainerState(yyj138) + yyj156 := 0 + for ; yyj156 < yyrr156; yyj156++ { + yyh156.ElemContainerState(yyj156) if r.TryDecodeAsNil() { - yyv138[yyj138] = PodDisruptionBudget{} + yyv156[yyj156] = PodDisruptionBudget{} } else { - yyv139 := &yyv138[yyj138] - yyv139.CodecDecodeSelf(d) + yyv157 := &yyv156[yyj156] + yyv157.CodecDecodeSelf(d) } } - if yyrt138 { - for ; yyj138 < yyl138; yyj138++ { - yyv138 = append(yyv138, PodDisruptionBudget{}) - yyh138.ElemContainerState(yyj138) + if yyrt156 { + for ; yyj156 < yyl156; yyj156++ { + yyv156 = append(yyv156, PodDisruptionBudget{}) + yyh156.ElemContainerState(yyj156) if r.TryDecodeAsNil() { - yyv138[yyj138] = PodDisruptionBudget{} + yyv156[yyj156] = PodDisruptionBudget{} } else { - yyv140 := &yyv138[yyj138] - yyv140.CodecDecodeSelf(d) + yyv158 := &yyv156[yyj156] + yyv158.CodecDecodeSelf(d) } } } } else { - yyj138 := 0 - for ; !r.CheckBreak(); yyj138++ { + yyj156 := 0 + for ; !r.CheckBreak(); yyj156++ { - if yyj138 >= len(yyv138) { - yyv138 = append(yyv138, PodDisruptionBudget{}) // var yyz138 PodDisruptionBudget - yyc138 = true + if yyj156 >= len(yyv156) { + yyv156 = append(yyv156, PodDisruptionBudget{}) // var yyz156 PodDisruptionBudget + yyc156 = true } - yyh138.ElemContainerState(yyj138) - if yyj138 < len(yyv138) { + yyh156.ElemContainerState(yyj156) + if yyj156 < len(yyv156) { if r.TryDecodeAsNil() { - yyv138[yyj138] = PodDisruptionBudget{} + yyv156[yyj156] = PodDisruptionBudget{} } else { - yyv141 := &yyv138[yyj138] - yyv141.CodecDecodeSelf(d) + yyv159 := &yyv156[yyj156] + yyv159.CodecDecodeSelf(d) } } else { @@ -1737,16 +1923,16 @@ func (x codecSelfer1234) decSlicePodDisruptionBudget(v *[]PodDisruptionBudget, d } } - if yyj138 < len(yyv138) { - yyv138 = yyv138[:yyj138] - yyc138 = true - } else if yyj138 == 0 && yyv138 == nil { - yyv138 = []PodDisruptionBudget{} - yyc138 = true + if yyj156 < len(yyv156) { + yyv156 = yyv156[:yyj156] + yyc156 = true + } else if yyj156 == 0 && yyv156 == nil { + yyv156 = []PodDisruptionBudget{} + yyc156 = true } } - yyh138.End() - if yyc138 { - *v = yyv138 + yyh156.End() + if yyc156 { + *v = yyv156 } } diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/types.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/types.go new file mode 100644 index 00000000000..2c578fd59e1 --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/types.go @@ -0,0 +1,98 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "k8s.io/client-go/pkg/api/unversioned" + "k8s.io/client-go/pkg/api/v1" + "k8s.io/client-go/pkg/util/intstr" +) + +// PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. +type PodDisruptionBudgetSpec struct { + // An eviction is allowed if at least "minAvailable" pods selected by + // "selector" will still be available after the eviction, i.e. even in the + // absence of the evicted pod. So for example you can prevent all voluntary + // evictions by specifying "100%". + MinAvailable intstr.IntOrString `json:"minAvailable,omitempty" protobuf:"bytes,1,opt,name=minAvailable"` + + // Label query over pods whose evictions are managed by the disruption + // budget. + Selector *unversioned.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"` +} + +// PodDisruptionBudgetStatus represents information about the status of a +// PodDisruptionBudget. Status may trail the actual state of a system. +type PodDisruptionBudgetStatus struct { + // Number of pod disruptions that are currently allowed. + PodDisruptionsAllowed int32 `json:"disruptionsAllowed" protobuf:"varint,1,opt,name=disruptionsAllowed"` + + // current number of healthy pods + CurrentHealthy int32 `json:"currentHealthy" protobuf:"varint,2,opt,name=currentHealthy"` + + // minimum desired number of healthy pods + DesiredHealthy int32 `json:"desiredHealthy" protobuf:"varint,3,opt,name=desiredHealthy"` + + // total number of pods counted by this disruption budget + ExpectedPods int32 `json:"expectedPods" protobuf:"varint,4,opt,name=expectedPods"` + + // DisruptedPods contains information about pods whose eviction was + // processed by the API server eviction subresource handler but has not + // yet been observed by the PodDisruptionBudget controller. + // A pod will be in this map from the time when the API server processed the + // eviction request to the time when the pod is seen by PDB controller + // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod + // and the value is the time when the API server processed the eviction request. If + // the deletion didn't occur and a pod is still there it will be removed from + // the list automatically by PodDisruptionBudget controller after some time. + // If everything goes smooth this map should be empty for the most of the time. + // Large number of entries in the map may indicate problems with pod deletions. + DisruptedPods map[string]unversioned.Time `json:"disruptedPods" protobuf:"bytes,5,rep,name=disruptedPods"` +} + +// +genclient=true + +// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods +type PodDisruptionBudget struct { + unversioned.TypeMeta `json:",inline"` + v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Specification of the desired behavior of the PodDisruptionBudget. + Spec PodDisruptionBudgetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + // Most recently observed status of the PodDisruptionBudget. + Status PodDisruptionBudgetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// PodDisruptionBudgetList is a collection of PodDisruptionBudgets. +type PodDisruptionBudgetList struct { + unversioned.TypeMeta `json:",inline"` + unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []PodDisruptionBudget `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// Eviction evicts a pod from its node subject to certain policies and safety constraints. +// This is a subresource of Pod. A request to cause such an eviction is +// created by POSTing to .../pods//evictions. +type Eviction struct { + unversioned.TypeMeta `json:",inline"` + + // ObjectMeta describes the pod that is being evicted. + v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // DeleteOptions may be provided + DeleteOptions *v1.DeleteOptions `json:"deleteOptions,omitempty" protobuf:"bytes,2,opt,name=deleteOptions"` +} diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/types_swagger_doc_generated.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/types_swagger_doc_generated.go similarity index 70% rename from staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/types_swagger_doc_generated.go rename to staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/types_swagger_doc_generated.go index f11858ff242..c1823a69185 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/types_swagger_doc_generated.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 // This file contains a collection of methods that can be used from go-restful to // generate Swagger API documentation for its models. Please read this PR for more @@ -66,11 +66,12 @@ func (PodDisruptionBudgetSpec) SwaggerDoc() map[string]string { } var map_PodDisruptionBudgetStatus = map[string]string{ - "": "PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.", - "disruptionAllowed": "Whether or not a disruption is currently allowed.", - "currentHealthy": "current number of healthy pods", - "desiredHealthy": "minimum desired number of healthy pods", - "expectedPods": "total number of pods counted by this disruption budget", + "": "PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.", + "disruptionsAllowed": "Number of pod disruptions that are currently allowed.", + "currentHealthy": "current number of healthy pods", + "desiredHealthy": "minimum desired number of healthy pods", + "expectedPods": "total number of pods counted by this disruption budget", + "disruptedPods": "DisruptedPods contains information about pods whose eviction was processed by the API server eviction subresource handler but has not yet been observed by the PodDisruptionBudget controller. A pod will be in this map from the time when the API server processed the eviction request to the time when the pod is seen by PDB controller as having been marked for deletion (or after a timeout). The key in the map is the name of the pod and the value is the time when the API server processed the eviction request. If the deletion didn't occur and a pod is still there it will be removed from the list automatically by PodDisruptionBudget controller after some time. If everything goes smooth this map should be empty for the most of the time. Large number of entries in the map may indicate problems with pod deletions.", } func (PodDisruptionBudgetStatus) SwaggerDoc() map[string]string { diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.conversion.go new file mode 100644 index 00000000000..b515d61917e --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.conversion.go @@ -0,0 +1,180 @@ +// +build !ignore_autogenerated + +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was autogenerated by conversion-gen. Do not edit it manually! + +package v1beta1 + +import ( + api "k8s.io/client-go/pkg/api" + unversioned "k8s.io/client-go/pkg/api/unversioned" + v1 "k8s.io/client-go/pkg/api/v1" + policy "k8s.io/client-go/pkg/apis/policy" + conversion "k8s.io/client-go/pkg/conversion" + runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" +) + +func init() { + SchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(scheme *runtime.Scheme) error { + return scheme.AddGeneratedConversionFuncs( + Convert_v1beta1_Eviction_To_policy_Eviction, + Convert_policy_Eviction_To_v1beta1_Eviction, + Convert_v1beta1_PodDisruptionBudget_To_policy_PodDisruptionBudget, + Convert_policy_PodDisruptionBudget_To_v1beta1_PodDisruptionBudget, + Convert_v1beta1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList, + Convert_policy_PodDisruptionBudgetList_To_v1beta1_PodDisruptionBudgetList, + Convert_v1beta1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec, + Convert_policy_PodDisruptionBudgetSpec_To_v1beta1_PodDisruptionBudgetSpec, + Convert_v1beta1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus, + Convert_policy_PodDisruptionBudgetStatus_To_v1beta1_PodDisruptionBudgetStatus, + ) +} + +func autoConvert_v1beta1_Eviction_To_policy_Eviction(in *Eviction, out *policy.Eviction, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + out.DeleteOptions = (*api.DeleteOptions)(unsafe.Pointer(in.DeleteOptions)) + return nil +} + +func Convert_v1beta1_Eviction_To_policy_Eviction(in *Eviction, out *policy.Eviction, s conversion.Scope) error { + return autoConvert_v1beta1_Eviction_To_policy_Eviction(in, out, s) +} + +func autoConvert_policy_Eviction_To_v1beta1_Eviction(in *policy.Eviction, out *Eviction, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + out.DeleteOptions = (*v1.DeleteOptions)(unsafe.Pointer(in.DeleteOptions)) + return nil +} + +func Convert_policy_Eviction_To_v1beta1_Eviction(in *policy.Eviction, out *Eviction, s conversion.Scope) error { + return autoConvert_policy_Eviction_To_v1beta1_Eviction(in, out, s) +} + +func autoConvert_v1beta1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in *PodDisruptionBudget, out *policy.PodDisruptionBudget, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + if err := Convert_v1beta1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +func Convert_v1beta1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in *PodDisruptionBudget, out *policy.PodDisruptionBudget, s conversion.Scope) error { + return autoConvert_v1beta1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in, out, s) +} + +func autoConvert_policy_PodDisruptionBudget_To_v1beta1_PodDisruptionBudget(in *policy.PodDisruptionBudget, out *PodDisruptionBudget, s conversion.Scope) error { + // TODO: Inefficient conversion - can we improve it? + if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { + return err + } + if err := Convert_policy_PodDisruptionBudgetSpec_To_v1beta1_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_policy_PodDisruptionBudgetStatus_To_v1beta1_PodDisruptionBudgetStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +func Convert_policy_PodDisruptionBudget_To_v1beta1_PodDisruptionBudget(in *policy.PodDisruptionBudget, out *PodDisruptionBudget, s conversion.Scope) error { + return autoConvert_policy_PodDisruptionBudget_To_v1beta1_PodDisruptionBudget(in, out, s) +} + +func autoConvert_v1beta1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in *PodDisruptionBudgetList, out *policy.PodDisruptionBudgetList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]policy.PodDisruptionBudget)(unsafe.Pointer(&in.Items)) + return nil +} + +func Convert_v1beta1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in *PodDisruptionBudgetList, out *policy.PodDisruptionBudgetList, s conversion.Scope) error { + return autoConvert_v1beta1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in, out, s) +} + +func autoConvert_policy_PodDisruptionBudgetList_To_v1beta1_PodDisruptionBudgetList(in *policy.PodDisruptionBudgetList, out *PodDisruptionBudgetList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]PodDisruptionBudget)(unsafe.Pointer(&in.Items)) + return nil +} + +func Convert_policy_PodDisruptionBudgetList_To_v1beta1_PodDisruptionBudgetList(in *policy.PodDisruptionBudgetList, out *PodDisruptionBudgetList, s conversion.Scope) error { + return autoConvert_policy_PodDisruptionBudgetList_To_v1beta1_PodDisruptionBudgetList(in, out, s) +} + +func autoConvert_v1beta1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in *PodDisruptionBudgetSpec, out *policy.PodDisruptionBudgetSpec, s conversion.Scope) error { + out.MinAvailable = in.MinAvailable + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) + return nil +} + +func Convert_v1beta1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in *PodDisruptionBudgetSpec, out *policy.PodDisruptionBudgetSpec, s conversion.Scope) error { + return autoConvert_v1beta1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in, out, s) +} + +func autoConvert_policy_PodDisruptionBudgetSpec_To_v1beta1_PodDisruptionBudgetSpec(in *policy.PodDisruptionBudgetSpec, out *PodDisruptionBudgetSpec, s conversion.Scope) error { + out.MinAvailable = in.MinAvailable + out.Selector = (*unversioned.LabelSelector)(unsafe.Pointer(in.Selector)) + return nil +} + +func Convert_policy_PodDisruptionBudgetSpec_To_v1beta1_PodDisruptionBudgetSpec(in *policy.PodDisruptionBudgetSpec, out *PodDisruptionBudgetSpec, s conversion.Scope) error { + return autoConvert_policy_PodDisruptionBudgetSpec_To_v1beta1_PodDisruptionBudgetSpec(in, out, s) +} + +func autoConvert_v1beta1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in *PodDisruptionBudgetStatus, out *policy.PodDisruptionBudgetStatus, s conversion.Scope) error { + out.PodDisruptionsAllowed = in.PodDisruptionsAllowed + out.CurrentHealthy = in.CurrentHealthy + out.DesiredHealthy = in.DesiredHealthy + out.ExpectedPods = in.ExpectedPods + out.DisruptedPods = *(*map[string]unversioned.Time)(unsafe.Pointer(&in.DisruptedPods)) + return nil +} + +func Convert_v1beta1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in *PodDisruptionBudgetStatus, out *policy.PodDisruptionBudgetStatus, s conversion.Scope) error { + return autoConvert_v1beta1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in, out, s) +} + +func autoConvert_policy_PodDisruptionBudgetStatus_To_v1beta1_PodDisruptionBudgetStatus(in *policy.PodDisruptionBudgetStatus, out *PodDisruptionBudgetStatus, s conversion.Scope) error { + out.PodDisruptionsAllowed = in.PodDisruptionsAllowed + out.CurrentHealthy = in.CurrentHealthy + out.DesiredHealthy = in.DesiredHealthy + out.ExpectedPods = in.ExpectedPods + out.DisruptedPods = *(*map[string]unversioned.Time)(unsafe.Pointer(&in.DisruptedPods)) + return nil +} + +func Convert_policy_PodDisruptionBudgetStatus_To_v1beta1_PodDisruptionBudgetStatus(in *policy.PodDisruptionBudgetStatus, out *PodDisruptionBudgetStatus, s conversion.Scope) error { + return autoConvert_policy_PodDisruptionBudgetStatus_To_v1beta1_PodDisruptionBudgetStatus(in, out, s) +} diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go similarity index 61% rename from staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go rename to staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go index 94b655816a5..0cd6b7c2686 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go @@ -18,7 +18,7 @@ limitations under the License. // This file was autogenerated by deepcopy-gen. Do not edit it manually! -package v1alpha1 +package v1beta1 import ( unversioned "k8s.io/client-go/pkg/api/unversioned" @@ -36,15 +36,15 @@ func init() { // to allow building arbitrary schemes. func RegisterDeepCopies(scheme *runtime.Scheme) error { return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_Eviction, InType: reflect.TypeOf(&Eviction{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodDisruptionBudget, InType: reflect.TypeOf(&PodDisruptionBudget{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodDisruptionBudgetList, InType: reflect.TypeOf(&PodDisruptionBudgetList{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodDisruptionBudgetSpec, InType: reflect.TypeOf(&PodDisruptionBudgetSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodDisruptionBudgetStatus, InType: reflect.TypeOf(&PodDisruptionBudgetStatus{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Eviction, InType: reflect.TypeOf(&Eviction{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_PodDisruptionBudget, InType: reflect.TypeOf(&PodDisruptionBudget{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_PodDisruptionBudgetList, InType: reflect.TypeOf(&PodDisruptionBudgetList{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_PodDisruptionBudgetSpec, InType: reflect.TypeOf(&PodDisruptionBudgetSpec{})}, + conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_PodDisruptionBudgetStatus, InType: reflect.TypeOf(&PodDisruptionBudgetStatus{})}, ) } -func DeepCopy_v1alpha1_Eviction(in interface{}, out interface{}, c *conversion.Cloner) error { +func DeepCopy_v1beta1_Eviction(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*Eviction) out := out.(*Eviction) @@ -65,7 +65,7 @@ func DeepCopy_v1alpha1_Eviction(in interface{}, out interface{}, c *conversion.C } } -func DeepCopy_v1alpha1_PodDisruptionBudget(in interface{}, out interface{}, c *conversion.Cloner) error { +func DeepCopy_v1beta1_PodDisruptionBudget(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*PodDisruptionBudget) out := out.(*PodDisruptionBudget) @@ -73,15 +73,17 @@ func DeepCopy_v1alpha1_PodDisruptionBudget(in interface{}, out interface{}, c *c if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } - if err := DeepCopy_v1alpha1_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, c); err != nil { + if err := DeepCopy_v1beta1_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, c); err != nil { + return err + } + if err := DeepCopy_v1beta1_PodDisruptionBudgetStatus(&in.Status, &out.Status, c); err != nil { return err } - out.Status = in.Status return nil } } -func DeepCopy_v1alpha1_PodDisruptionBudgetList(in interface{}, out interface{}, c *conversion.Cloner) error { +func DeepCopy_v1beta1_PodDisruptionBudgetList(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*PodDisruptionBudgetList) out := out.(*PodDisruptionBudgetList) @@ -91,7 +93,7 @@ func DeepCopy_v1alpha1_PodDisruptionBudgetList(in interface{}, out interface{}, in, out := &in.Items, &out.Items *out = make([]PodDisruptionBudget, len(*in)) for i := range *in { - if err := DeepCopy_v1alpha1_PodDisruptionBudget(&(*in)[i], &(*out)[i], c); err != nil { + if err := DeepCopy_v1beta1_PodDisruptionBudget(&(*in)[i], &(*out)[i], c); err != nil { return err } } @@ -102,7 +104,7 @@ func DeepCopy_v1alpha1_PodDisruptionBudgetList(in interface{}, out interface{}, } } -func DeepCopy_v1alpha1_PodDisruptionBudgetSpec(in interface{}, out interface{}, c *conversion.Cloner) error { +func DeepCopy_v1beta1_PodDisruptionBudgetSpec(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*PodDisruptionBudgetSpec) out := out.(*PodDisruptionBudgetSpec) @@ -120,14 +122,23 @@ func DeepCopy_v1alpha1_PodDisruptionBudgetSpec(in interface{}, out interface{}, } } -func DeepCopy_v1alpha1_PodDisruptionBudgetStatus(in interface{}, out interface{}, c *conversion.Cloner) error { +func DeepCopy_v1beta1_PodDisruptionBudgetStatus(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*PodDisruptionBudgetStatus) out := out.(*PodDisruptionBudgetStatus) - out.PodDisruptionAllowed = in.PodDisruptionAllowed + out.PodDisruptionsAllowed = in.PodDisruptionsAllowed out.CurrentHealthy = in.CurrentHealthy out.DesiredHealthy = in.DesiredHealthy out.ExpectedPods = in.ExpectedPods + if in.DisruptedPods != nil { + in, out := &in.DisruptedPods, &out.DisruptedPods + *out = make(map[string]unversioned.Time) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } else { + out.DisruptedPods = nil + } return nil } } diff --git a/staging/src/k8s.io/client-go/pkg/apis/policy/zz_generated.deepcopy.go b/staging/src/k8s.io/client-go/pkg/apis/policy/zz_generated.deepcopy.go index bd13ae0874f..5215c480d48 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/policy/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/client-go/pkg/apis/policy/zz_generated.deepcopy.go @@ -76,7 +76,9 @@ func DeepCopy_policy_PodDisruptionBudget(in interface{}, out interface{}, c *con if err := DeepCopy_policy_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, c); err != nil { return err } - out.Status = in.Status + if err := DeepCopy_policy_PodDisruptionBudgetStatus(&in.Status, &out.Status, c); err != nil { + return err + } return nil } } @@ -124,10 +126,19 @@ func DeepCopy_policy_PodDisruptionBudgetStatus(in interface{}, out interface{}, { in := in.(*PodDisruptionBudgetStatus) out := out.(*PodDisruptionBudgetStatus) - out.PodDisruptionAllowed = in.PodDisruptionAllowed + out.PodDisruptionsAllowed = in.PodDisruptionsAllowed out.CurrentHealthy = in.CurrentHealthy out.DesiredHealthy = in.DesiredHealthy out.ExpectedPods = in.ExpectedPods + if in.DisruptedPods != nil { + in, out := &in.DisruptedPods, &out.DisruptedPods + *out = make(map[string]unversioned.Time) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } else { + out.DisruptedPods = nil + } return nil } } diff --git a/staging/src/k8s.io/client-go/pkg/apis/rbac/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/rbac/v1alpha1/zz_generated.conversion.go index 58efb7b1811..1181cf7fff5 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/rbac/v1alpha1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/rbac/v1alpha1/zz_generated.conversion.go @@ -24,6 +24,7 @@ import ( rbac "k8s.io/client-go/pkg/apis/rbac" conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" ) func init() { @@ -110,17 +111,7 @@ func autoConvert_v1alpha1_ClusterRoleBinding_To_rbac_ClusterRoleBinding(in *Clus if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { return err } - if in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]rbac.Subject, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_Subject_To_rbac_Subject(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subjects = nil - } + out.Subjects = *(*[]rbac.Subject)(unsafe.Pointer(&in.Subjects)) if err := Convert_v1alpha1_RoleRef_To_rbac_RoleRef(&in.RoleRef, &out.RoleRef, s); err != nil { return err } @@ -136,17 +127,7 @@ func autoConvert_rbac_ClusterRoleBinding_To_v1alpha1_ClusterRoleBinding(in *rbac if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { return err } - if in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]Subject, len(*in)) - for i := range *in { - if err := Convert_rbac_Subject_To_v1alpha1_Subject(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subjects = nil - } + out.Subjects = *(*[]Subject)(unsafe.Pointer(&in.Subjects)) if err := Convert_rbac_RoleRef_To_v1alpha1_RoleRef(&in.RoleRef, &out.RoleRef, s); err != nil { return err } @@ -159,17 +140,7 @@ func Convert_rbac_ClusterRoleBinding_To_v1alpha1_ClusterRoleBinding(in *rbac.Clu func autoConvert_v1alpha1_ClusterRoleBindingList_To_rbac_ClusterRoleBindingList(in *ClusterRoleBindingList, out *rbac.ClusterRoleBindingList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]rbac.ClusterRoleBinding, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_ClusterRoleBinding_To_rbac_ClusterRoleBinding(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]rbac.ClusterRoleBinding)(unsafe.Pointer(&in.Items)) return nil } @@ -179,17 +150,7 @@ func Convert_v1alpha1_ClusterRoleBindingList_To_rbac_ClusterRoleBindingList(in * func autoConvert_rbac_ClusterRoleBindingList_To_v1alpha1_ClusterRoleBindingList(in *rbac.ClusterRoleBindingList, out *ClusterRoleBindingList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterRoleBinding, len(*in)) - for i := range *in { - if err := Convert_rbac_ClusterRoleBinding_To_v1alpha1_ClusterRoleBinding(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]ClusterRoleBinding)(unsafe.Pointer(&in.Items)) return nil } @@ -238,14 +199,14 @@ func Convert_rbac_ClusterRoleList_To_v1alpha1_ClusterRoleList(in *rbac.ClusterRo } func autoConvert_v1alpha1_PolicyRule_To_rbac_PolicyRule(in *PolicyRule, out *rbac.PolicyRule, s conversion.Scope) error { - out.Verbs = in.Verbs + out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs)) if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.AttributeRestrictions, &out.AttributeRestrictions, s); err != nil { return err } - out.APIGroups = in.APIGroups - out.Resources = in.Resources - out.ResourceNames = in.ResourceNames - out.NonResourceURLs = in.NonResourceURLs + out.APIGroups = *(*[]string)(unsafe.Pointer(&in.APIGroups)) + out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources)) + out.ResourceNames = *(*[]string)(unsafe.Pointer(&in.ResourceNames)) + out.NonResourceURLs = *(*[]string)(unsafe.Pointer(&in.NonResourceURLs)) return nil } @@ -254,14 +215,14 @@ func Convert_v1alpha1_PolicyRule_To_rbac_PolicyRule(in *PolicyRule, out *rbac.Po } func autoConvert_rbac_PolicyRule_To_v1alpha1_PolicyRule(in *rbac.PolicyRule, out *PolicyRule, s conversion.Scope) error { - out.Verbs = in.Verbs + out.Verbs = *(*[]string)(unsafe.Pointer(&in.Verbs)) if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.AttributeRestrictions, &out.AttributeRestrictions, s); err != nil { return err } - out.APIGroups = in.APIGroups - out.Resources = in.Resources - out.ResourceNames = in.ResourceNames - out.NonResourceURLs = in.NonResourceURLs + out.APIGroups = *(*[]string)(unsafe.Pointer(&in.APIGroups)) + out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources)) + out.ResourceNames = *(*[]string)(unsafe.Pointer(&in.ResourceNames)) + out.NonResourceURLs = *(*[]string)(unsafe.Pointer(&in.NonResourceURLs)) return nil } @@ -320,17 +281,7 @@ func autoConvert_v1alpha1_RoleBinding_To_rbac_RoleBinding(in *RoleBinding, out * if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { return err } - if in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]rbac.Subject, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_Subject_To_rbac_Subject(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subjects = nil - } + out.Subjects = *(*[]rbac.Subject)(unsafe.Pointer(&in.Subjects)) if err := Convert_v1alpha1_RoleRef_To_rbac_RoleRef(&in.RoleRef, &out.RoleRef, s); err != nil { return err } @@ -346,17 +297,7 @@ func autoConvert_rbac_RoleBinding_To_v1alpha1_RoleBinding(in *rbac.RoleBinding, if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { return err } - if in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]Subject, len(*in)) - for i := range *in { - if err := Convert_rbac_Subject_To_v1alpha1_Subject(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subjects = nil - } + out.Subjects = *(*[]Subject)(unsafe.Pointer(&in.Subjects)) if err := Convert_rbac_RoleRef_To_v1alpha1_RoleRef(&in.RoleRef, &out.RoleRef, s); err != nil { return err } @@ -369,17 +310,7 @@ func Convert_rbac_RoleBinding_To_v1alpha1_RoleBinding(in *rbac.RoleBinding, out func autoConvert_v1alpha1_RoleBindingList_To_rbac_RoleBindingList(in *RoleBindingList, out *rbac.RoleBindingList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]rbac.RoleBinding, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_RoleBinding_To_rbac_RoleBinding(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]rbac.RoleBinding)(unsafe.Pointer(&in.Items)) return nil } @@ -389,17 +320,7 @@ func Convert_v1alpha1_RoleBindingList_To_rbac_RoleBindingList(in *RoleBindingLis func autoConvert_rbac_RoleBindingList_To_v1alpha1_RoleBindingList(in *rbac.RoleBindingList, out *RoleBindingList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]RoleBinding, len(*in)) - for i := range *in { - if err := Convert_rbac_RoleBinding_To_v1alpha1_RoleBinding(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]RoleBinding)(unsafe.Pointer(&in.Items)) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/apis/storage/v1beta1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/apis/storage/v1beta1/zz_generated.conversion.go index 8cb5a5afcb9..e72c7977685 100644 --- a/staging/src/k8s.io/client-go/pkg/apis/storage/v1beta1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/apis/storage/v1beta1/zz_generated.conversion.go @@ -24,6 +24,7 @@ import ( storage "k8s.io/client-go/pkg/apis/storage" conversion "k8s.io/client-go/pkg/conversion" runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" ) func init() { @@ -47,7 +48,7 @@ func autoConvert_v1beta1_StorageClass_To_storage_StorageClass(in *StorageClass, return err } out.Provisioner = in.Provisioner - out.Parameters = in.Parameters + out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters)) return nil } @@ -61,7 +62,7 @@ func autoConvert_storage_StorageClass_To_v1beta1_StorageClass(in *storage.Storag return err } out.Provisioner = in.Provisioner - out.Parameters = in.Parameters + out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters)) return nil } @@ -71,17 +72,7 @@ func Convert_storage_StorageClass_To_v1beta1_StorageClass(in *storage.StorageCla func autoConvert_v1beta1_StorageClassList_To_storage_StorageClassList(in *StorageClassList, out *storage.StorageClassList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]storage.StorageClass, len(*in)) - for i := range *in { - if err := Convert_v1beta1_StorageClass_To_storage_StorageClass(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]storage.StorageClass)(unsafe.Pointer(&in.Items)) return nil } @@ -91,17 +82,7 @@ func Convert_v1beta1_StorageClassList_To_storage_StorageClassList(in *StorageCla func autoConvert_storage_StorageClassList_To_v1beta1_StorageClassList(in *storage.StorageClassList, out *StorageClassList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]StorageClass, len(*in)) - for i := range *in { - if err := Convert_storage_StorageClass_To_v1beta1_StorageClass(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]StorageClass)(unsafe.Pointer(&in.Items)) return nil } diff --git a/staging/src/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/register.go b/staging/src/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/register.go index ca71ff99060..669b5625526 100644 --- a/staging/src/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/register.go +++ b/staging/src/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/register.go @@ -40,6 +40,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ClusterList{}, &v1.ListOptions{}, &v1.DeleteOptions{}, + &v1.ExportOptions{}, ) versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/staging/src/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/zz_generated.conversion.go b/staging/src/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/zz_generated.conversion.go index 54a5259dd31..e6f326169b9 100644 --- a/staging/src/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/zz_generated.conversion.go +++ b/staging/src/k8s.io/client-go/pkg/federation/apis/federation/v1beta1/zz_generated.conversion.go @@ -26,6 +26,7 @@ import ( conversion "k8s.io/client-go/pkg/conversion" federation "k8s.io/client-go/pkg/federation/apis/federation" runtime "k8s.io/client-go/pkg/runtime" + unsafe "unsafe" ) func init() { @@ -117,17 +118,7 @@ func Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federat func autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]federation.Cluster, len(*in)) - for i := range *in { - if err := Convert_v1beta1_Cluster_To_federation_Cluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]federation.Cluster)(unsafe.Pointer(&in.Items)) return nil } @@ -137,17 +128,7 @@ func Convert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out func autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error { out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - if err := Convert_federation_Cluster_To_v1beta1_Cluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } + out.Items = *(*[]Cluster)(unsafe.Pointer(&in.Items)) return nil } @@ -156,27 +137,8 @@ func Convert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.Cluste } func autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error { - if in.ServerAddressByClientCIDRs != nil { - in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs - *out = make([]federation.ServerAddressByClientCIDR, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ServerAddressByClientCIDRs = nil - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(api.LocalObjectReference) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.SecretRef = nil - } + out.ServerAddressByClientCIDRs = *(*[]federation.ServerAddressByClientCIDR)(unsafe.Pointer(&in.ServerAddressByClientCIDRs)) + out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) return nil } @@ -185,27 +147,8 @@ func Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out } func autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - if in.ServerAddressByClientCIDRs != nil { - in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs - *out = make([]ServerAddressByClientCIDR, len(*in)) - for i := range *in { - if err := Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ServerAddressByClientCIDRs = nil - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.LocalObjectReference) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.SecretRef = nil - } + out.ServerAddressByClientCIDRs = *(*[]ServerAddressByClientCIDR)(unsafe.Pointer(&in.ServerAddressByClientCIDRs)) + out.SecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) return nil } @@ -214,18 +157,8 @@ func Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.Cluste } func autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]federation.ClusterCondition, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.Zones = in.Zones + out.Conditions = *(*[]federation.ClusterCondition)(unsafe.Pointer(&in.Conditions)) + out.Zones = *(*[]string)(unsafe.Pointer(&in.Zones)) out.Region = in.Region return nil } @@ -235,18 +168,8 @@ func Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus } func autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ClusterCondition, len(*in)) - for i := range *in { - if err := Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.Zones = in.Zones + out.Conditions = *(*[]ClusterCondition)(unsafe.Pointer(&in.Conditions)) + out.Zones = *(*[]string)(unsafe.Pointer(&in.Zones)) out.Region = in.Region return nil } diff --git a/staging/src/k8s.io/client-go/pkg/runtime/scheme.go b/staging/src/k8s.io/client-go/pkg/runtime/scheme.go index 104801eb954..b191e5fb424 100644 --- a/staging/src/k8s.io/client-go/pkg/runtime/scheme.go +++ b/staging/src/k8s.io/client-go/pkg/runtime/scheme.go @@ -519,6 +519,15 @@ func (s *Scheme) convertToVersion(copy bool, in Object, target GroupVersioner) ( gvk, ok := target.KindForGroupVersionKinds(kinds) if !ok { + // try to see if this type is listed as unversioned (for legacy support) + // TODO: when we move to server API versions, we should completely remove the unversioned concept + if unversionedKind, ok := s.unversionedTypes[t]; ok { + if gvk, ok := target.KindForGroupVersionKinds([]unversioned.GroupVersionKind{unversionedKind}); ok { + return copyAndSetTargetKind(copy, s, in, gvk) + } + return copyAndSetTargetKind(copy, s, in, unversionedKind) + } + // TODO: should this be a typed error? return nil, fmt.Errorf("%v is not suitable for converting to %q", t, target) } diff --git a/staging/src/k8s.io/client-go/pkg/third_party/forked/golang/template/exec.go b/staging/src/k8s.io/client-go/pkg/third_party/forked/golang/template/exec.go new file mode 100644 index 00000000000..739fd3509ce --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/third_party/forked/golang/template/exec.go @@ -0,0 +1,94 @@ +//This package is copied from Go library text/template. +//The original private functions indirect and printableValue +//are exported as public functions. +package template + +import ( + "fmt" + "reflect" +) + +var Indirect = indirect +var PrintableValue = printableValue + +var ( + errorType = reflect.TypeOf((*error)(nil)).Elem() + fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem() +) + +// indirect returns the item at the end of indirection, and a bool to indicate if it's nil. +// We indirect through pointers and empty interfaces (only) because +// non-empty interfaces have methods we might need. +func indirect(v reflect.Value) (rv reflect.Value, isNil bool) { + for ; v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface; v = v.Elem() { + if v.IsNil() { + return v, true + } + if v.Kind() == reflect.Interface && v.NumMethod() > 0 { + break + } + } + return v, false +} + +// printableValue returns the, possibly indirected, interface value inside v that +// is best for a call to formatted printer. +func printableValue(v reflect.Value) (interface{}, bool) { + if v.Kind() == reflect.Ptr { + v, _ = indirect(v) // fmt.Fprint handles nil. + } + if !v.IsValid() { + return "", true + } + + if !v.Type().Implements(errorType) && !v.Type().Implements(fmtStringerType) { + if v.CanAddr() && (reflect.PtrTo(v.Type()).Implements(errorType) || reflect.PtrTo(v.Type()).Implements(fmtStringerType)) { + v = v.Addr() + } else { + switch v.Kind() { + case reflect.Chan, reflect.Func: + return nil, false + } + } + } + return v.Interface(), true +} + +// canBeNil reports whether an untyped nil can be assigned to the type. See reflect.Zero. +func canBeNil(typ reflect.Type) bool { + switch typ.Kind() { + case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: + return true + } + return false +} + +// isTrue reports whether the value is 'true', in the sense of not the zero of its type, +// and whether the value has a meaningful truth value. +func isTrue(val reflect.Value) (truth, ok bool) { + if !val.IsValid() { + // Something like var x interface{}, never set. It's a form of nil. + return false, true + } + switch val.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + truth = val.Len() > 0 + case reflect.Bool: + truth = val.Bool() + case reflect.Complex64, reflect.Complex128: + truth = val.Complex() != 0 + case reflect.Chan, reflect.Func, reflect.Ptr, reflect.Interface: + truth = !val.IsNil() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + truth = val.Int() != 0 + case reflect.Float32, reflect.Float64: + truth = val.Float() != 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + truth = val.Uint() != 0 + case reflect.Struct: + truth = true // Struct values are always true. + default: + return + } + return truth, true +} diff --git a/staging/src/k8s.io/client-go/pkg/third_party/forked/golang/template/funcs.go b/staging/src/k8s.io/client-go/pkg/third_party/forked/golang/template/funcs.go new file mode 100644 index 00000000000..27a008b0a7e --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/third_party/forked/golang/template/funcs.go @@ -0,0 +1,599 @@ +//This package is copied from Go library text/template. +//The original private functions eq, ge, gt, le, lt, and ne +//are exported as public functions. +package template + +import ( + "bytes" + "errors" + "fmt" + "io" + "net/url" + "reflect" + "strings" + "unicode" + "unicode/utf8" +) + +var Equal = eq +var GreaterEqual = ge +var Greater = gt +var LessEqual = le +var Less = lt +var NotEqual = ne + +// FuncMap is the type of the map defining the mapping from names to functions. +// Each function must have either a single return value, or two return values of +// which the second has type error. In that case, if the second (error) +// return value evaluates to non-nil during execution, execution terminates and +// Execute returns that error. +type FuncMap map[string]interface{} + +var builtins = FuncMap{ + "and": and, + "call": call, + "html": HTMLEscaper, + "index": index, + "js": JSEscaper, + "len": length, + "not": not, + "or": or, + "print": fmt.Sprint, + "printf": fmt.Sprintf, + "println": fmt.Sprintln, + "urlquery": URLQueryEscaper, + + // Comparisons + "eq": eq, // == + "ge": ge, // >= + "gt": gt, // > + "le": le, // <= + "lt": lt, // < + "ne": ne, // != +} + +var builtinFuncs = createValueFuncs(builtins) + +// createValueFuncs turns a FuncMap into a map[string]reflect.Value +func createValueFuncs(funcMap FuncMap) map[string]reflect.Value { + m := make(map[string]reflect.Value) + addValueFuncs(m, funcMap) + return m +} + +// addValueFuncs adds to values the functions in funcs, converting them to reflect.Values. +func addValueFuncs(out map[string]reflect.Value, in FuncMap) { + for name, fn := range in { + v := reflect.ValueOf(fn) + if v.Kind() != reflect.Func { + panic("value for " + name + " not a function") + } + if !goodFunc(v.Type()) { + panic(fmt.Errorf("can't install method/function %q with %d results", name, v.Type().NumOut())) + } + out[name] = v + } +} + +// AddFuncs adds to values the functions in funcs. It does no checking of the input - +// call addValueFuncs first. +func addFuncs(out, in FuncMap) { + for name, fn := range in { + out[name] = fn + } +} + +// goodFunc checks that the function or method has the right result signature. +func goodFunc(typ reflect.Type) bool { + // We allow functions with 1 result or 2 results where the second is an error. + switch { + case typ.NumOut() == 1: + return true + case typ.NumOut() == 2 && typ.Out(1) == errorType: + return true + } + return false +} + +// findFunction looks for a function in the template, and global map. +func findFunction(name string) (reflect.Value, bool) { + if fn := builtinFuncs[name]; fn.IsValid() { + return fn, true + } + return reflect.Value{}, false +} + +// Indexing. + +// index returns the result of indexing its first argument by the following +// arguments. Thus "index x 1 2 3" is, in Go syntax, x[1][2][3]. Each +// indexed item must be a map, slice, or array. +func index(item interface{}, indices ...interface{}) (interface{}, error) { + v := reflect.ValueOf(item) + for _, i := range indices { + index := reflect.ValueOf(i) + var isNil bool + if v, isNil = indirect(v); isNil { + return nil, fmt.Errorf("index of nil pointer") + } + switch v.Kind() { + case reflect.Array, reflect.Slice, reflect.String: + var x int64 + switch index.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + x = index.Int() + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + x = int64(index.Uint()) + default: + return nil, fmt.Errorf("cannot index slice/array with type %s", index.Type()) + } + if x < 0 || x >= int64(v.Len()) { + return nil, fmt.Errorf("index out of range: %d", x) + } + v = v.Index(int(x)) + case reflect.Map: + if !index.IsValid() { + index = reflect.Zero(v.Type().Key()) + } + if !index.Type().AssignableTo(v.Type().Key()) { + return nil, fmt.Errorf("%s is not index type for %s", index.Type(), v.Type()) + } + if x := v.MapIndex(index); x.IsValid() { + v = x + } else { + v = reflect.Zero(v.Type().Elem()) + } + default: + return nil, fmt.Errorf("can't index item of type %s", v.Type()) + } + } + return v.Interface(), nil +} + +// Length + +// length returns the length of the item, with an error if it has no defined length. +func length(item interface{}) (int, error) { + v, isNil := indirect(reflect.ValueOf(item)) + if isNil { + return 0, fmt.Errorf("len of nil pointer") + } + switch v.Kind() { + case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String: + return v.Len(), nil + } + return 0, fmt.Errorf("len of type %s", v.Type()) +} + +// Function invocation + +// call returns the result of evaluating the first argument as a function. +// The function must return 1 result, or 2 results, the second of which is an error. +func call(fn interface{}, args ...interface{}) (interface{}, error) { + v := reflect.ValueOf(fn) + typ := v.Type() + if typ.Kind() != reflect.Func { + return nil, fmt.Errorf("non-function of type %s", typ) + } + if !goodFunc(typ) { + return nil, fmt.Errorf("function called with %d args; should be 1 or 2", typ.NumOut()) + } + numIn := typ.NumIn() + var dddType reflect.Type + if typ.IsVariadic() { + if len(args) < numIn-1 { + return nil, fmt.Errorf("wrong number of args: got %d want at least %d", len(args), numIn-1) + } + dddType = typ.In(numIn - 1).Elem() + } else { + if len(args) != numIn { + return nil, fmt.Errorf("wrong number of args: got %d want %d", len(args), numIn) + } + } + argv := make([]reflect.Value, len(args)) + for i, arg := range args { + value := reflect.ValueOf(arg) + // Compute the expected type. Clumsy because of variadics. + var argType reflect.Type + if !typ.IsVariadic() || i < numIn-1 { + argType = typ.In(i) + } else { + argType = dddType + } + if !value.IsValid() && canBeNil(argType) { + value = reflect.Zero(argType) + } + if !value.Type().AssignableTo(argType) { + return nil, fmt.Errorf("arg %d has type %s; should be %s", i, value.Type(), argType) + } + argv[i] = value + } + result := v.Call(argv) + if len(result) == 2 && !result[1].IsNil() { + return result[0].Interface(), result[1].Interface().(error) + } + return result[0].Interface(), nil +} + +// Boolean logic. + +func truth(a interface{}) bool { + t, _ := isTrue(reflect.ValueOf(a)) + return t +} + +// and computes the Boolean AND of its arguments, returning +// the first false argument it encounters, or the last argument. +func and(arg0 interface{}, args ...interface{}) interface{} { + if !truth(arg0) { + return arg0 + } + for i := range args { + arg0 = args[i] + if !truth(arg0) { + break + } + } + return arg0 +} + +// or computes the Boolean OR of its arguments, returning +// the first true argument it encounters, or the last argument. +func or(arg0 interface{}, args ...interface{}) interface{} { + if truth(arg0) { + return arg0 + } + for i := range args { + arg0 = args[i] + if truth(arg0) { + break + } + } + return arg0 +} + +// not returns the Boolean negation of its argument. +func not(arg interface{}) (truth bool) { + truth, _ = isTrue(reflect.ValueOf(arg)) + return !truth +} + +// Comparison. + +// TODO: Perhaps allow comparison between signed and unsigned integers. + +var ( + errBadComparisonType = errors.New("invalid type for comparison") + errBadComparison = errors.New("incompatible types for comparison") + errNoComparison = errors.New("missing argument for comparison") +) + +type kind int + +const ( + invalidKind kind = iota + boolKind + complexKind + intKind + floatKind + integerKind + stringKind + uintKind +) + +func basicKind(v reflect.Value) (kind, error) { + switch v.Kind() { + case reflect.Bool: + return boolKind, nil + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return intKind, nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return uintKind, nil + case reflect.Float32, reflect.Float64: + return floatKind, nil + case reflect.Complex64, reflect.Complex128: + return complexKind, nil + case reflect.String: + return stringKind, nil + } + return invalidKind, errBadComparisonType +} + +// eq evaluates the comparison a == b || a == c || ... +func eq(arg1 interface{}, arg2 ...interface{}) (bool, error) { + v1 := reflect.ValueOf(arg1) + k1, err := basicKind(v1) + if err != nil { + return false, err + } + if len(arg2) == 0 { + return false, errNoComparison + } + for _, arg := range arg2 { + v2 := reflect.ValueOf(arg) + k2, err := basicKind(v2) + if err != nil { + return false, err + } + truth := false + if k1 != k2 { + // Special case: Can compare integer values regardless of type's sign. + switch { + case k1 == intKind && k2 == uintKind: + truth = v1.Int() >= 0 && uint64(v1.Int()) == v2.Uint() + case k1 == uintKind && k2 == intKind: + truth = v2.Int() >= 0 && v1.Uint() == uint64(v2.Int()) + default: + return false, errBadComparison + } + } else { + switch k1 { + case boolKind: + truth = v1.Bool() == v2.Bool() + case complexKind: + truth = v1.Complex() == v2.Complex() + case floatKind: + truth = v1.Float() == v2.Float() + case intKind: + truth = v1.Int() == v2.Int() + case stringKind: + truth = v1.String() == v2.String() + case uintKind: + truth = v1.Uint() == v2.Uint() + default: + panic("invalid kind") + } + } + if truth { + return true, nil + } + } + return false, nil +} + +// ne evaluates the comparison a != b. +func ne(arg1, arg2 interface{}) (bool, error) { + // != is the inverse of ==. + equal, err := eq(arg1, arg2) + return !equal, err +} + +// lt evaluates the comparison a < b. +func lt(arg1, arg2 interface{}) (bool, error) { + v1 := reflect.ValueOf(arg1) + k1, err := basicKind(v1) + if err != nil { + return false, err + } + v2 := reflect.ValueOf(arg2) + k2, err := basicKind(v2) + if err != nil { + return false, err + } + truth := false + if k1 != k2 { + // Special case: Can compare integer values regardless of type's sign. + switch { + case k1 == intKind && k2 == uintKind: + truth = v1.Int() < 0 || uint64(v1.Int()) < v2.Uint() + case k1 == uintKind && k2 == intKind: + truth = v2.Int() >= 0 && v1.Uint() < uint64(v2.Int()) + default: + return false, errBadComparison + } + } else { + switch k1 { + case boolKind, complexKind: + return false, errBadComparisonType + case floatKind: + truth = v1.Float() < v2.Float() + case intKind: + truth = v1.Int() < v2.Int() + case stringKind: + truth = v1.String() < v2.String() + case uintKind: + truth = v1.Uint() < v2.Uint() + default: + panic("invalid kind") + } + } + return truth, nil +} + +// le evaluates the comparison <= b. +func le(arg1, arg2 interface{}) (bool, error) { + // <= is < or ==. + lessThan, err := lt(arg1, arg2) + if lessThan || err != nil { + return lessThan, err + } + return eq(arg1, arg2) +} + +// gt evaluates the comparison a > b. +func gt(arg1, arg2 interface{}) (bool, error) { + // > is the inverse of <=. + lessOrEqual, err := le(arg1, arg2) + if err != nil { + return false, err + } + return !lessOrEqual, nil +} + +// ge evaluates the comparison a >= b. +func ge(arg1, arg2 interface{}) (bool, error) { + // >= is the inverse of <. + lessThan, err := lt(arg1, arg2) + if err != nil { + return false, err + } + return !lessThan, nil +} + +// HTML escaping. + +var ( + htmlQuot = []byte(""") // shorter than """ + htmlApos = []byte("'") // shorter than "'" and apos was not in HTML until HTML5 + htmlAmp = []byte("&") + htmlLt = []byte("<") + htmlGt = []byte(">") +) + +// HTMLEscape writes to w the escaped HTML equivalent of the plain text data b. +func HTMLEscape(w io.Writer, b []byte) { + last := 0 + for i, c := range b { + var html []byte + switch c { + case '"': + html = htmlQuot + case '\'': + html = htmlApos + case '&': + html = htmlAmp + case '<': + html = htmlLt + case '>': + html = htmlGt + default: + continue + } + w.Write(b[last:i]) + w.Write(html) + last = i + 1 + } + w.Write(b[last:]) +} + +// HTMLEscapeString returns the escaped HTML equivalent of the plain text data s. +func HTMLEscapeString(s string) string { + // Avoid allocation if we can. + if strings.IndexAny(s, `'"&<>`) < 0 { + return s + } + var b bytes.Buffer + HTMLEscape(&b, []byte(s)) + return b.String() +} + +// HTMLEscaper returns the escaped HTML equivalent of the textual +// representation of its arguments. +func HTMLEscaper(args ...interface{}) string { + return HTMLEscapeString(evalArgs(args)) +} + +// JavaScript escaping. + +var ( + jsLowUni = []byte(`\u00`) + hex = []byte("0123456789ABCDEF") + + jsBackslash = []byte(`\\`) + jsApos = []byte(`\'`) + jsQuot = []byte(`\"`) + jsLt = []byte(`\x3C`) + jsGt = []byte(`\x3E`) +) + +// JSEscape writes to w the escaped JavaScript equivalent of the plain text data b. +func JSEscape(w io.Writer, b []byte) { + last := 0 + for i := 0; i < len(b); i++ { + c := b[i] + + if !jsIsSpecial(rune(c)) { + // fast path: nothing to do + continue + } + w.Write(b[last:i]) + + if c < utf8.RuneSelf { + // Quotes, slashes and angle brackets get quoted. + // Control characters get written as \u00XX. + switch c { + case '\\': + w.Write(jsBackslash) + case '\'': + w.Write(jsApos) + case '"': + w.Write(jsQuot) + case '<': + w.Write(jsLt) + case '>': + w.Write(jsGt) + default: + w.Write(jsLowUni) + t, b := c>>4, c&0x0f + w.Write(hex[t : t+1]) + w.Write(hex[b : b+1]) + } + } else { + // Unicode rune. + r, size := utf8.DecodeRune(b[i:]) + if unicode.IsPrint(r) { + w.Write(b[i : i+size]) + } else { + fmt.Fprintf(w, "\\u%04X", r) + } + i += size - 1 + } + last = i + 1 + } + w.Write(b[last:]) +} + +// JSEscapeString returns the escaped JavaScript equivalent of the plain text data s. +func JSEscapeString(s string) string { + // Avoid allocation if we can. + if strings.IndexFunc(s, jsIsSpecial) < 0 { + return s + } + var b bytes.Buffer + JSEscape(&b, []byte(s)) + return b.String() +} + +func jsIsSpecial(r rune) bool { + switch r { + case '\\', '\'', '"', '<', '>': + return true + } + return r < ' ' || utf8.RuneSelf <= r +} + +// JSEscaper returns the escaped JavaScript equivalent of the textual +// representation of its arguments. +func JSEscaper(args ...interface{}) string { + return JSEscapeString(evalArgs(args)) +} + +// URLQueryEscaper returns the escaped value of the textual representation of +// its arguments in a form suitable for embedding in a URL query. +func URLQueryEscaper(args ...interface{}) string { + return url.QueryEscape(evalArgs(args)) +} + +// evalArgs formats the list of arguments into a string. It is therefore equivalent to +// fmt.Sprint(args...) +// except that each argument is indirected (if a pointer), as required, +// using the same rules as the default string evaluation during template +// execution. +func evalArgs(args []interface{}) string { + ok := false + var s string + // Fast path for simple common case. + if len(args) == 1 { + s, ok = args[0].(string) + } + if !ok { + for i, arg := range args { + a, ok := printableValue(reflect.ValueOf(arg)) + if ok { + args[i] = a + } // else left fmt do its thing + } + s = fmt.Sprint(args...) + } + return s +} diff --git a/staging/src/k8s.io/client-go/pkg/util/cert/cert.go b/staging/src/k8s.io/client-go/pkg/util/cert/cert.go index 32e968bb60e..fff5b38d634 100644 --- a/staging/src/k8s.io/client-go/pkg/util/cert/cert.go +++ b/staging/src/k8s.io/client-go/pkg/util/cert/cert.go @@ -126,16 +126,13 @@ func MakeEllipticPrivateKeyPEM() ([]byte, error) { return pem.EncodeToMemory(privateKeyPemBlock), nil } -// GenerateSelfSignedCert creates a self-signed certificate and key for the given host. +// GenerateSelfSignedCertKey creates a self-signed certificate and key for the given host. // 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 -// The certificate will be created with file mode 0644. The key will be created with file mode 0600. -// If the certificate or key files already exist, they will be overwritten. -// Any parent directories of the certPath or keyPath will be created as needed with file mode 0755. -func GenerateSelfSignedCert(host, certPath, keyPath string, alternateIPs []net.IP, alternateDNS []string) error { +func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS []string) ([]byte, []byte, error) { priv, err := rsa.GenerateKey(cryptorand.Reader, 2048) if err != nil { - return err + return nil, nil, err } template := x509.Certificate{ @@ -163,30 +160,22 @@ func GenerateSelfSignedCert(host, certPath, keyPath string, alternateIPs []net.I derBytes, err := x509.CreateCertificate(cryptorand.Reader, &template, &template, &priv.PublicKey, priv) if err != nil { - return err + return nil, nil, err } // Generate cert certBuffer := bytes.Buffer{} if err := pem.Encode(&certBuffer, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}); err != nil { - return err + return nil, nil, err } // Generate key keyBuffer := bytes.Buffer{} if err := pem.Encode(&keyBuffer, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)}); err != nil { - return err + return nil, nil, err } - if err := WriteCert(certPath, certBuffer.Bytes()); err != nil { - return err - } - - if err := WriteKey(keyPath, keyBuffer.Bytes()); err != nil { - return err - } - - return nil + return certBuffer.Bytes(), keyBuffer.Bytes(), nil } // FormatBytesCert receives byte array certificate and formats in human-readable format diff --git a/staging/src/k8s.io/client-go/pkg/util/config/feature_gate.go b/staging/src/k8s.io/client-go/pkg/util/config/feature_gate.go index 00c2f4e6f9e..11996dabf14 100644 --- a/staging/src/k8s.io/client-go/pkg/util/config/feature_gate.go +++ b/staging/src/k8s.io/client-go/pkg/util/config/feature_gate.go @@ -42,6 +42,7 @@ const ( appArmor = "AppArmor" dynamicKubeletConfig = "DynamicKubeletConfig" dynamicVolumeProvisioning = "DynamicVolumeProvisioning" + streamingProxyRedirects = "StreamingProxyRedirects" ) var ( @@ -53,6 +54,7 @@ var ( appArmor: {true, beta}, dynamicKubeletConfig: {false, alpha}, dynamicVolumeProvisioning: {true, alpha}, + streamingProxyRedirects: {false, alpha}, } // Special handling for a few gates. @@ -85,6 +87,8 @@ const ( // a string like feature1=true,feature2=false,... type FeatureGate interface { AddFlag(fs *pflag.FlagSet) + Set(value string) error + KnownFeatures() []string // Every feature gate should add method here following this template: // @@ -104,9 +108,13 @@ type FeatureGate interface { // alpha: v1.3 DynamicVolumeProvisioning() bool - // owner: mtaufen + // owner: @mtaufen // alpha: v1.4 DynamicKubeletConfig() bool + + // owner: timstclair + // alpha: v1.5 + StreamingProxyRedirects() bool } // featureGate implements FeatureGate as well as pflag.Value for flag parsing. @@ -195,6 +203,12 @@ func (f *featureGate) DynamicVolumeProvisioning() bool { return f.lookup(dynamicVolumeProvisioning) } +// StreamingProxyRedirects controls whether the apiserver should intercept (and follow) +// redirects from the backend (Kubelet) for streaming requests (exec/attach/port-forward). +func (f *featureGate) StreamingProxyRedirects() bool { + return f.lookup(streamingProxyRedirects) +} + func (f *featureGate) lookup(key string) bool { defaultValue := f.known[key].enabled if f.enabled != nil { @@ -208,6 +222,14 @@ func (f *featureGate) lookup(key string) bool { // AddFlag adds a flag for setting global feature gates to the specified FlagSet. func (f *featureGate) AddFlag(fs *pflag.FlagSet) { + known := f.KnownFeatures() + fs.Var(f, flagName, ""+ + "A set of key=value pairs that describe feature gates for alpha/experimental features. "+ + "Options are:\n"+strings.Join(known, "\n")) +} + +// Returns a string describing the FeatureGate's known features. +func (f *featureGate) KnownFeatures() []string { var known []string for k, v := range f.known { pre := "" @@ -217,7 +239,5 @@ func (f *featureGate) AddFlag(fs *pflag.FlagSet) { known = append(known, fmt.Sprintf("%s=true|false (%sdefault=%t)", k, pre, v.enabled)) } sort.Strings(known) - fs.Var(f, flagName, ""+ - "A set of key=value pairs that describe feature gates for alpha/experimental features. "+ - "Options are:\n"+strings.Join(known, "\n")) + return known } diff --git a/staging/src/k8s.io/client-go/pkg/util/config/namedcertkey_flag.go b/staging/src/k8s.io/client-go/pkg/util/config/namedcertkey_flag.go new file mode 100644 index 00000000000..39f20f681f7 --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/util/config/namedcertkey_flag.go @@ -0,0 +1,113 @@ +/* +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 config + +import ( + "errors" + "flag" + "strings" +) + +// NamedCertKey is a flag value parsing "certfile,keyfile" and "certfile,keyfile:name,name,name". +type NamedCertKey struct { + Names []string + CertFile, KeyFile string +} + +var _ flag.Value = &NamedCertKey{} + +func (nkc *NamedCertKey) String() string { + s := nkc.CertFile + "," + nkc.KeyFile + if len(nkc.Names) > 0 { + s = s + ":" + strings.Join(nkc.Names, ",") + } + return s +} + +func (nkc *NamedCertKey) Set(value string) error { + cs := strings.SplitN(value, ":", 2) + var keycert string + if len(cs) == 2 { + var names string + keycert, names = strings.TrimSpace(cs[0]), strings.TrimSpace(cs[1]) + if names == "" { + return errors.New("empty names list is not allowed") + } + nkc.Names = nil + for _, name := range strings.Split(names, ",") { + nkc.Names = append(nkc.Names, strings.TrimSpace(name)) + } + } else { + nkc.Names = nil + keycert = strings.TrimSpace(cs[0]) + } + cs = strings.Split(keycert, ",") + if len(cs) != 2 { + return errors.New("expected comma separated certificate and key file paths") + } + nkc.CertFile = strings.TrimSpace(cs[0]) + nkc.KeyFile = strings.TrimSpace(cs[1]) + return nil +} + +func (*NamedCertKey) Type() string { + return "namedCertKey" +} + +// NamedCertKeyArray is a flag value parsing NamedCertKeys, each passed with its own +// flag instance (in contrast to comma separated slices). +type NamedCertKeyArray struct { + value *[]NamedCertKey + changed bool +} + +var _ flag.Value = &NamedCertKey{} + +// NewNamedKeyCertArray creates a new NamedCertKeyArray with the internal value +// pointing to p. +func NewNamedCertKeyArray(p *[]NamedCertKey) *NamedCertKeyArray { + return &NamedCertKeyArray{ + value: p, + } +} + +func (a *NamedCertKeyArray) Set(val string) error { + nkc := NamedCertKey{} + err := nkc.Set(val) + if err != nil { + return err + } + if !a.changed { + *a.value = []NamedCertKey{nkc} + a.changed = true + } else { + *a.value = append(*a.value, nkc) + } + return nil +} + +func (a *NamedCertKeyArray) Type() string { + return "namedCertKey" +} + +func (a *NamedCertKeyArray) String() string { + nkcs := make([]string, 0, len(*a.value)) + for i := range *a.value { + nkcs = append(nkcs, (*a.value)[i].String()) + } + return "[" + strings.Join(nkcs, ";") + "]" +} diff --git a/staging/src/k8s.io/client-go/pkg/util/flowcontrol/throttle.go b/staging/src/k8s.io/client-go/pkg/util/flowcontrol/throttle.go index 42170a18922..4126d071c56 100644 --- a/staging/src/k8s.io/client-go/pkg/util/flowcontrol/throttle.go +++ b/staging/src/k8s.io/client-go/pkg/util/flowcontrol/throttle.go @@ -19,7 +19,7 @@ package flowcontrol import ( "sync" - "k8s.io/kubernetes/pkg/util/ratelimit" + "k8s.io/client-go/pkg/util/ratelimit" ) type RateLimiter interface { diff --git a/staging/src/k8s.io/client-go/pkg/util/jsonpath/doc.go b/staging/src/k8s.io/client-go/pkg/util/jsonpath/doc.go new file mode 100644 index 00000000000..2a6e1706170 --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/util/jsonpath/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// package jsonpath is a template engine using jsonpath syntax, +// which can be seen at http://goessner.net/articles/JsonPath/. +// In addition, it has {range} {end} function to iterate list and slice. +package jsonpath diff --git a/staging/src/k8s.io/client-go/pkg/util/jsonpath/jsonpath.go b/staging/src/k8s.io/client-go/pkg/util/jsonpath/jsonpath.go new file mode 100644 index 00000000000..11a1c521a10 --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/util/jsonpath/jsonpath.go @@ -0,0 +1,498 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package jsonpath + +import ( + "bytes" + "fmt" + "io" + "reflect" + "strings" + + "k8s.io/client-go/pkg/third_party/forked/golang/template" +) + +type JSONPath struct { + name string + parser *Parser + stack [][]reflect.Value //push and pop values in different scopes + cur []reflect.Value //current scope values + beginRange int + inRange int + endRange int + + allowMissingKeys bool +} + +func New(name string) *JSONPath { + return &JSONPath{ + name: name, + beginRange: 0, + inRange: 0, + endRange: 0, + } +} + +// AllowMissingKeys allows a caller to specify whether they want an error if a field or map key +// cannot be located, or simply an empty result. The receiver is returned for chaining. +func (j *JSONPath) AllowMissingKeys(allow bool) *JSONPath { + j.allowMissingKeys = allow + return j +} + +// Parse parse the given template, return error +func (j *JSONPath) Parse(text string) (err error) { + j.parser, err = Parse(j.name, text) + return +} + +// Execute bounds data into template and write the result +func (j *JSONPath) Execute(wr io.Writer, data interface{}) error { + fullResults, err := j.FindResults(data) + if err != nil { + return err + } + for ix := range fullResults { + if err := j.PrintResults(wr, fullResults[ix]); err != nil { + return err + } + } + return nil +} + +func (j *JSONPath) FindResults(data interface{}) ([][]reflect.Value, error) { + if j.parser == nil { + return nil, fmt.Errorf("%s is an incomplete jsonpath template", j.name) + } + + j.cur = []reflect.Value{reflect.ValueOf(data)} + nodes := j.parser.Root.Nodes + fullResult := [][]reflect.Value{} + for i := 0; i < len(nodes); i++ { + node := nodes[i] + results, err := j.walk(j.cur, node) + if err != nil { + return nil, err + } + + //encounter an end node, break the current block + if j.endRange > 0 && j.endRange <= j.inRange { + j.endRange -= 1 + break + } + //encounter a range node, start a range loop + if j.beginRange > 0 { + j.beginRange -= 1 + j.inRange += 1 + for k, value := range results { + j.parser.Root.Nodes = nodes[i+1:] + if k == len(results)-1 { + j.inRange -= 1 + } + nextResults, err := j.FindResults(value.Interface()) + if err != nil { + return nil, err + } + fullResult = append(fullResult, nextResults...) + } + break + } + fullResult = append(fullResult, results) + } + return fullResult, nil +} + +// PrintResults write the results into writer +func (j *JSONPath) PrintResults(wr io.Writer, results []reflect.Value) error { + for i, r := range results { + text, err := j.evalToText(r) + if err != nil { + return err + } + if i != len(results)-1 { + text = append(text, ' ') + } + if _, err = wr.Write(text); err != nil { + return err + } + } + return nil +} + +// walk visits tree rooted at the given node in DFS order +func (j *JSONPath) walk(value []reflect.Value, node Node) ([]reflect.Value, error) { + switch node := node.(type) { + case *ListNode: + return j.evalList(value, node) + case *TextNode: + return []reflect.Value{reflect.ValueOf(node.Text)}, nil + case *FieldNode: + return j.evalField(value, node) + case *ArrayNode: + return j.evalArray(value, node) + case *FilterNode: + return j.evalFilter(value, node) + case *IntNode: + return j.evalInt(value, node) + case *FloatNode: + return j.evalFloat(value, node) + case *WildcardNode: + return j.evalWildcard(value, node) + case *RecursiveNode: + return j.evalRecursive(value, node) + case *UnionNode: + return j.evalUnion(value, node) + case *IdentifierNode: + return j.evalIdentifier(value, node) + default: + return value, fmt.Errorf("unexpected Node %v", node) + } +} + +// evalInt evaluates IntNode +func (j *JSONPath) evalInt(input []reflect.Value, node *IntNode) ([]reflect.Value, error) { + result := make([]reflect.Value, len(input)) + for i := range input { + result[i] = reflect.ValueOf(node.Value) + } + return result, nil +} + +// evalFloat evaluates FloatNode +func (j *JSONPath) evalFloat(input []reflect.Value, node *FloatNode) ([]reflect.Value, error) { + result := make([]reflect.Value, len(input)) + for i := range input { + result[i] = reflect.ValueOf(node.Value) + } + return result, nil +} + +// evalList evaluates ListNode +func (j *JSONPath) evalList(value []reflect.Value, node *ListNode) ([]reflect.Value, error) { + var err error + curValue := value + for _, node := range node.Nodes { + curValue, err = j.walk(curValue, node) + if err != nil { + return curValue, err + } + } + return curValue, nil +} + +// evalIdentifier evaluates IdentifierNode +func (j *JSONPath) evalIdentifier(input []reflect.Value, node *IdentifierNode) ([]reflect.Value, error) { + results := []reflect.Value{} + switch node.Name { + case "range": + j.stack = append(j.stack, j.cur) + j.beginRange += 1 + results = input + case "end": + if j.endRange < j.inRange { //inside a loop, break the current block + j.endRange += 1 + break + } + // the loop is about to end, pop value and continue the following execution + if len(j.stack) > 0 { + j.cur, j.stack = j.stack[len(j.stack)-1], j.stack[:len(j.stack)-1] + } else { + return results, fmt.Errorf("not in range, nothing to end") + } + default: + return input, fmt.Errorf("unrecognized identifier %v", node.Name) + } + return results, nil +} + +// evalArray evaluates ArrayNode +func (j *JSONPath) evalArray(input []reflect.Value, node *ArrayNode) ([]reflect.Value, error) { + result := []reflect.Value{} + for _, value := range input { + + value, isNil := template.Indirect(value) + if isNil { + continue + } + if value.Kind() != reflect.Array && value.Kind() != reflect.Slice { + return input, fmt.Errorf("%v is not array or slice", value.Type()) + } + params := node.Params + if !params[0].Known { + params[0].Value = 0 + } + if params[0].Value < 0 { + params[0].Value += value.Len() + } + if !params[1].Known { + params[1].Value = value.Len() + } + + if params[1].Value < 0 { + params[1].Value += value.Len() + } + + sliceLength := value.Len() + if params[1].Value != params[0].Value { // if you're requesting zero elements, allow it through. + if params[0].Value >= sliceLength { + return input, fmt.Errorf("array index out of bounds: index %d, length %d", params[0].Value, sliceLength) + } + if params[1].Value > sliceLength { + return input, fmt.Errorf("array index out of bounds: index %d, length %d", params[1].Value-1, sliceLength) + } + } + + if !params[2].Known { + value = value.Slice(params[0].Value, params[1].Value) + } else { + value = value.Slice3(params[0].Value, params[1].Value, params[2].Value) + } + for i := 0; i < value.Len(); i++ { + result = append(result, value.Index(i)) + } + } + return result, nil +} + +// evalUnion evaluates UnionNode +func (j *JSONPath) evalUnion(input []reflect.Value, node *UnionNode) ([]reflect.Value, error) { + result := []reflect.Value{} + for _, listNode := range node.Nodes { + temp, err := j.evalList(input, listNode) + if err != nil { + return input, err + } + result = append(result, temp...) + } + return result, nil +} + +func (j *JSONPath) findFieldInValue(value *reflect.Value, node *FieldNode) (reflect.Value, error) { + t := value.Type() + var inlineValue *reflect.Value + for ix := 0; ix < t.NumField(); ix++ { + f := t.Field(ix) + jsonTag := f.Tag.Get("json") + parts := strings.Split(jsonTag, ",") + if len(parts) == 0 { + continue + } + if parts[0] == node.Value { + return value.Field(ix), nil + } + if len(parts[0]) == 0 { + val := value.Field(ix) + inlineValue = &val + } + } + if inlineValue != nil { + if inlineValue.Kind() == reflect.Struct { + // handle 'inline' + match, err := j.findFieldInValue(inlineValue, node) + if err != nil { + return reflect.Value{}, err + } + if match.IsValid() { + return match, nil + } + } + } + return value.FieldByName(node.Value), nil +} + +// evalField evaluates field of struct or key of map. +func (j *JSONPath) evalField(input []reflect.Value, node *FieldNode) ([]reflect.Value, error) { + results := []reflect.Value{} + // If there's no input, there's no output + if len(input) == 0 { + return results, nil + } + for _, value := range input { + var result reflect.Value + value, isNil := template.Indirect(value) + if isNil { + continue + } + + if value.Kind() == reflect.Struct { + var err error + if result, err = j.findFieldInValue(&value, node); err != nil { + return nil, err + } + } else if value.Kind() == reflect.Map { + mapKeyType := value.Type().Key() + nodeValue := reflect.ValueOf(node.Value) + // node value type must be convertible to map key type + if !nodeValue.Type().ConvertibleTo(mapKeyType) { + return results, fmt.Errorf("%s is not convertible to %s", nodeValue, mapKeyType) + } + result = value.MapIndex(nodeValue.Convert(mapKeyType)) + } + if result.IsValid() { + results = append(results, result) + } + } + if len(results) == 0 { + if j.allowMissingKeys { + return results, nil + } + return results, fmt.Errorf("%s is not found", node.Value) + } + return results, nil +} + +// evalWildcard extract all contents of the given value +func (j *JSONPath) evalWildcard(input []reflect.Value, node *WildcardNode) ([]reflect.Value, error) { + results := []reflect.Value{} + for _, value := range input { + value, isNil := template.Indirect(value) + if isNil { + continue + } + + kind := value.Kind() + if kind == reflect.Struct { + for i := 0; i < value.NumField(); i++ { + results = append(results, value.Field(i)) + } + } else if kind == reflect.Map { + for _, key := range value.MapKeys() { + results = append(results, value.MapIndex(key)) + } + } else if kind == reflect.Array || kind == reflect.Slice || kind == reflect.String { + for i := 0; i < value.Len(); i++ { + results = append(results, value.Index(i)) + } + } + } + return results, nil +} + +// evalRecursive visit the given value recursively and push all of them to result +func (j *JSONPath) evalRecursive(input []reflect.Value, node *RecursiveNode) ([]reflect.Value, error) { + result := []reflect.Value{} + for _, value := range input { + results := []reflect.Value{} + value, isNil := template.Indirect(value) + if isNil { + continue + } + + kind := value.Kind() + if kind == reflect.Struct { + for i := 0; i < value.NumField(); i++ { + results = append(results, value.Field(i)) + } + } else if kind == reflect.Map { + for _, key := range value.MapKeys() { + results = append(results, value.MapIndex(key)) + } + } else if kind == reflect.Array || kind == reflect.Slice || kind == reflect.String { + for i := 0; i < value.Len(); i++ { + results = append(results, value.Index(i)) + } + } + if len(results) != 0 { + result = append(result, value) + output, err := j.evalRecursive(results, node) + if err != nil { + return result, err + } + result = append(result, output...) + } + } + return result, nil +} + +// evalFilter filter array according to FilterNode +func (j *JSONPath) evalFilter(input []reflect.Value, node *FilterNode) ([]reflect.Value, error) { + results := []reflect.Value{} + for _, value := range input { + value, _ = template.Indirect(value) + + if value.Kind() != reflect.Array && value.Kind() != reflect.Slice { + return input, fmt.Errorf("%v is not array or slice and cannot be filtered", value) + } + for i := 0; i < value.Len(); i++ { + temp := []reflect.Value{value.Index(i)} + lefts, err := j.evalList(temp, node.Left) + + //case exists + if node.Operator == "exists" { + if len(lefts) > 0 { + results = append(results, value.Index(i)) + } + continue + } + + if err != nil { + return input, err + } + + var left, right interface{} + if len(lefts) != 1 { + return input, fmt.Errorf("can only compare one element at a time") + } + left = lefts[0].Interface() + + rights, err := j.evalList(temp, node.Right) + if err != nil { + return input, err + } + if len(rights) != 1 { + return input, fmt.Errorf("can only compare one element at a time") + } + right = rights[0].Interface() + + pass := false + switch node.Operator { + case "<": + pass, err = template.Less(left, right) + case ">": + pass, err = template.Greater(left, right) + case "==": + pass, err = template.Equal(left, right) + case "!=": + pass, err = template.NotEqual(left, right) + case "<=": + pass, err = template.LessEqual(left, right) + case ">=": + pass, err = template.GreaterEqual(left, right) + default: + return results, fmt.Errorf("unrecognized filter operator %s", node.Operator) + } + if err != nil { + return results, err + } + if pass { + results = append(results, value.Index(i)) + } + } + } + return results, nil +} + +// evalToText translates reflect value to corresponding text +func (j *JSONPath) evalToText(v reflect.Value) ([]byte, error) { + iface, ok := template.PrintableValue(v) + if !ok { + return nil, fmt.Errorf("can't print type %s", v.Type()) + } + var buffer bytes.Buffer + fmt.Fprint(&buffer, iface) + return buffer.Bytes(), nil +} diff --git a/staging/src/k8s.io/client-go/pkg/util/jsonpath/node.go b/staging/src/k8s.io/client-go/pkg/util/jsonpath/node.go new file mode 100644 index 00000000000..f0a27853d84 --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/util/jsonpath/node.go @@ -0,0 +1,239 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package jsonpath + +import "fmt" + +// NodeType identifies the type of a parse tree node. +type NodeType int + +// Type returns itself and provides an easy default implementation +func (t NodeType) Type() NodeType { + return t +} + +func (t NodeType) String() string { + return NodeTypeName[t] +} + +const ( + NodeText NodeType = iota + NodeArray + NodeList + NodeField + NodeIdentifier + NodeFilter + NodeInt + NodeFloat + NodeWildcard + NodeRecursive + NodeUnion +) + +var NodeTypeName = map[NodeType]string{ + NodeText: "NodeText", + NodeArray: "NodeArray", + NodeList: "NodeList", + NodeField: "NodeField", + NodeIdentifier: "NodeIdentifier", + NodeFilter: "NodeFilter", + NodeInt: "NodeInt", + NodeFloat: "NodeFloat", + NodeWildcard: "NodeWildcard", + NodeRecursive: "NodeRecursive", + NodeUnion: "NodeUnion", +} + +type Node interface { + Type() NodeType + String() string +} + +// ListNode holds a sequence of nodes. +type ListNode struct { + NodeType + Nodes []Node // The element nodes in lexical order. +} + +func newList() *ListNode { + return &ListNode{NodeType: NodeList} +} + +func (l *ListNode) append(n Node) { + l.Nodes = append(l.Nodes, n) +} + +func (l *ListNode) String() string { + return fmt.Sprintf("%s", l.Type()) +} + +// TextNode holds plain text. +type TextNode struct { + NodeType + Text string // The text; may span newlines. +} + +func newText(text string) *TextNode { + return &TextNode{NodeType: NodeText, Text: text} +} + +func (t *TextNode) String() string { + return fmt.Sprintf("%s: %s", t.Type(), t.Text) +} + +// FieldNode holds field of struct +type FieldNode struct { + NodeType + Value string +} + +func newField(value string) *FieldNode { + return &FieldNode{NodeType: NodeField, Value: value} +} + +func (f *FieldNode) String() string { + return fmt.Sprintf("%s: %s", f.Type(), f.Value) +} + +// IdentifierNode holds an identifier +type IdentifierNode struct { + NodeType + Name string +} + +func newIdentifier(value string) *IdentifierNode { + return &IdentifierNode{ + NodeType: NodeIdentifier, + Name: value, + } +} + +func (f *IdentifierNode) String() string { + return fmt.Sprintf("%s: %s", f.Type(), f.Name) +} + +// ParamsEntry holds param information for ArrayNode +type ParamsEntry struct { + Value int + Known bool //whether the value is known when parse it +} + +// ArrayNode holds start, end, step information for array index selection +type ArrayNode struct { + NodeType + Params [3]ParamsEntry //start, end, step +} + +func newArray(params [3]ParamsEntry) *ArrayNode { + return &ArrayNode{ + NodeType: NodeArray, + Params: params, + } +} + +func (a *ArrayNode) String() string { + return fmt.Sprintf("%s: %v", a.Type(), a.Params) +} + +// FilterNode holds operand and operator information for filter +type FilterNode struct { + NodeType + Left *ListNode + Right *ListNode + Operator string +} + +func newFilter(left, right *ListNode, operator string) *FilterNode { + return &FilterNode{ + NodeType: NodeFilter, + Left: left, + Right: right, + Operator: operator, + } +} + +func (f *FilterNode) String() string { + return fmt.Sprintf("%s: %s %s %s", f.Type(), f.Left, f.Operator, f.Right) +} + +// IntNode holds integer value +type IntNode struct { + NodeType + Value int +} + +func newInt(num int) *IntNode { + return &IntNode{NodeType: NodeInt, Value: num} +} + +func (i *IntNode) String() string { + return fmt.Sprintf("%s: %d", i.Type(), i.Value) +} + +// FloatNode holds float value +type FloatNode struct { + NodeType + Value float64 +} + +func newFloat(num float64) *FloatNode { + return &FloatNode{NodeType: NodeFloat, Value: num} +} + +func (i *FloatNode) String() string { + return fmt.Sprintf("%s: %f", i.Type(), i.Value) +} + +// WildcardNode means a wildcard +type WildcardNode struct { + NodeType +} + +func newWildcard() *WildcardNode { + return &WildcardNode{NodeType: NodeWildcard} +} + +func (i *WildcardNode) String() string { + return fmt.Sprintf("%s", i.Type()) +} + +// RecursiveNode means a recursive descent operator +type RecursiveNode struct { + NodeType +} + +func newRecursive() *RecursiveNode { + return &RecursiveNode{NodeType: NodeRecursive} +} + +func (r *RecursiveNode) String() string { + return fmt.Sprintf("%s", r.Type()) +} + +// UnionNode is union of ListNode +type UnionNode struct { + NodeType + Nodes []*ListNode +} + +func newUnion(nodes []*ListNode) *UnionNode { + return &UnionNode{NodeType: NodeUnion, Nodes: nodes} +} + +func (u *UnionNode) String() string { + return fmt.Sprintf("%s", u.Type()) +} diff --git a/staging/src/k8s.io/client-go/pkg/util/jsonpath/parser.go b/staging/src/k8s.io/client-go/pkg/util/jsonpath/parser.go new file mode 100644 index 00000000000..7dc38d31fc3 --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/util/jsonpath/parser.go @@ -0,0 +1,433 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package jsonpath + +import ( + "fmt" + "regexp" + "strconv" + "strings" + "unicode" + "unicode/utf8" +) + +const eof = -1 + +const ( + leftDelim = "{" + rightDelim = "}" +) + +type Parser struct { + Name string + Root *ListNode + input string + cur *ListNode + pos int + start int + width int +} + +// Parse parsed the given text and return a node Parser. +// If an error is encountered, parsing stops and an empty +// Parser is returned with the error +func Parse(name, text string) (*Parser, error) { + p := NewParser(name) + err := p.Parse(text) + if err != nil { + p = nil + } + return p, err +} + +func NewParser(name string) *Parser { + return &Parser{ + Name: name, + } +} + +// parseAction parsed the expression inside delimiter +func parseAction(name, text string) (*Parser, error) { + p, err := Parse(name, fmt.Sprintf("%s%s%s", leftDelim, text, rightDelim)) + // when error happens, p will be nil, so we need to return here + if err != nil { + return p, err + } + p.Root = p.Root.Nodes[0].(*ListNode) + return p, nil +} + +func (p *Parser) Parse(text string) error { + p.input = text + p.Root = newList() + p.pos = 0 + return p.parseText(p.Root) +} + +// consumeText return the parsed text since last cosumeText +func (p *Parser) consumeText() string { + value := p.input[p.start:p.pos] + p.start = p.pos + return value +} + +// next returns the next rune in the input. +func (p *Parser) next() rune { + if int(p.pos) >= len(p.input) { + p.width = 0 + return eof + } + r, w := utf8.DecodeRuneInString(p.input[p.pos:]) + p.width = w + p.pos += p.width + return r +} + +// peek returns but does not consume the next rune in the input. +func (p *Parser) peek() rune { + r := p.next() + p.backup() + return r +} + +// backup steps back one rune. Can only be called once per call of next. +func (p *Parser) backup() { + p.pos -= p.width +} + +func (p *Parser) parseText(cur *ListNode) error { + for { + if strings.HasPrefix(p.input[p.pos:], leftDelim) { + if p.pos > p.start { + cur.append(newText(p.consumeText())) + } + return p.parseLeftDelim(cur) + } + if p.next() == eof { + break + } + } + // Correctly reached EOF. + if p.pos > p.start { + cur.append(newText(p.consumeText())) + } + return nil +} + +// parseLeftDelim scans the left delimiter, which is known to be present. +func (p *Parser) parseLeftDelim(cur *ListNode) error { + p.pos += len(leftDelim) + p.consumeText() + newNode := newList() + cur.append(newNode) + cur = newNode + return p.parseInsideAction(cur) +} + +func (p *Parser) parseInsideAction(cur *ListNode) error { + prefixMap := map[string]func(*ListNode) error{ + rightDelim: p.parseRightDelim, + "[?(": p.parseFilter, + "..": p.parseRecursive, + } + for prefix, parseFunc := range prefixMap { + if strings.HasPrefix(p.input[p.pos:], prefix) { + return parseFunc(cur) + } + } + + switch r := p.next(); { + case r == eof || isEndOfLine(r): + return fmt.Errorf("unclosed action") + case r == ' ': + p.consumeText() + case r == '@' || r == '$': //the current object, just pass it + p.consumeText() + case r == '[': + return p.parseArray(cur) + case r == '"': + return p.parseQuote(cur) + case r == '.': + return p.parseField(cur) + case r == '+' || r == '-' || unicode.IsDigit(r): + p.backup() + return p.parseNumber(cur) + case isAlphaNumeric(r): + p.backup() + return p.parseIdentifier(cur) + default: + return fmt.Errorf("unrecognized character in action: %#U", r) + } + return p.parseInsideAction(cur) +} + +// parseRightDelim scans the right delimiter, which is known to be present. +func (p *Parser) parseRightDelim(cur *ListNode) error { + p.pos += len(rightDelim) + p.consumeText() + cur = p.Root + return p.parseText(cur) +} + +// parseIdentifier scans build-in keywords, like "range" "end" +func (p *Parser) parseIdentifier(cur *ListNode) error { + var r rune + for { + r = p.next() + if isTerminator(r) { + p.backup() + break + } + } + value := p.consumeText() + cur.append(newIdentifier(value)) + return p.parseInsideAction(cur) +} + +// parseRecursive scans the recursive desent operator .. +func (p *Parser) parseRecursive(cur *ListNode) error { + p.pos += len("..") + p.consumeText() + cur.append(newRecursive()) + if r := p.peek(); isAlphaNumeric(r) { + return p.parseField(cur) + } + return p.parseInsideAction(cur) +} + +// parseNumber scans number +func (p *Parser) parseNumber(cur *ListNode) error { + r := p.peek() + if r == '+' || r == '-' { + r = p.next() + } + for { + r = p.next() + if r != '.' && !unicode.IsDigit(r) { + p.backup() + break + } + } + value := p.consumeText() + i, err := strconv.Atoi(value) + if err == nil { + cur.append(newInt(i)) + return p.parseInsideAction(cur) + } + d, err := strconv.ParseFloat(value, 64) + if err == nil { + cur.append(newFloat(d)) + return p.parseInsideAction(cur) + } + return fmt.Errorf("cannot parse number %s", value) +} + +// parseArray scans array index selection +func (p *Parser) parseArray(cur *ListNode) error { +Loop: + for { + switch p.next() { + case eof, '\n': + return fmt.Errorf("unterminated array") + case ']': + break Loop + } + } + text := p.consumeText() + text = string(text[1 : len(text)-1]) + if text == "*" { + text = ":" + } + + //union operator + strs := strings.Split(text, ",") + if len(strs) > 1 { + union := []*ListNode{} + for _, str := range strs { + parser, err := parseAction("union", fmt.Sprintf("[%s]", strings.Trim(str, " "))) + if err != nil { + return err + } + union = append(union, parser.Root) + } + cur.append(newUnion(union)) + return p.parseInsideAction(cur) + } + + // dict key + reg := regexp.MustCompile(`^'([^']*)'$`) + value := reg.FindStringSubmatch(text) + if value != nil { + parser, err := parseAction("arraydict", fmt.Sprintf(".%s", value[1])) + if err != nil { + return err + } + for _, node := range parser.Root.Nodes { + cur.append(node) + } + return p.parseInsideAction(cur) + } + + //slice operator + reg = regexp.MustCompile(`^(-?[\d]*)(:-?[\d]*)?(:[\d]*)?$`) + value = reg.FindStringSubmatch(text) + if value == nil { + return fmt.Errorf("invalid array index %s", text) + } + value = value[1:] + params := [3]ParamsEntry{} + for i := 0; i < 3; i++ { + if value[i] != "" { + if i > 0 { + value[i] = value[i][1:] + } + if i > 0 && value[i] == "" { + params[i].Known = false + } else { + var err error + params[i].Known = true + params[i].Value, err = strconv.Atoi(value[i]) + if err != nil { + return fmt.Errorf("array index %s is not a number", value[i]) + } + } + } else { + if i == 1 { + params[i].Known = true + params[i].Value = params[0].Value + 1 + } else { + params[i].Known = false + params[i].Value = 0 + } + } + } + cur.append(newArray(params)) + return p.parseInsideAction(cur) +} + +// parseFilter scans filter inside array selection +func (p *Parser) parseFilter(cur *ListNode) error { + p.pos += len("[?(") + p.consumeText() +Loop: + for { + switch p.next() { + case eof, '\n': + return fmt.Errorf("unterminated filter") + case ')': + break Loop + } + } + if p.next() != ']' { + return fmt.Errorf("unclosed array expect ]") + } + reg := regexp.MustCompile(`^([^!<>=]+)([!<>=]+)(.+?)$`) + text := p.consumeText() + text = string(text[:len(text)-2]) + value := reg.FindStringSubmatch(text) + if value == nil { + parser, err := parseAction("text", text) + if err != nil { + return err + } + cur.append(newFilter(parser.Root, newList(), "exists")) + } else { + leftParser, err := parseAction("left", value[1]) + if err != nil { + return err + } + rightParser, err := parseAction("right", value[3]) + if err != nil { + return err + } + cur.append(newFilter(leftParser.Root, rightParser.Root, value[2])) + } + return p.parseInsideAction(cur) +} + +// parseQuote unquotes string inside double quote +func (p *Parser) parseQuote(cur *ListNode) error { +Loop: + for { + switch p.next() { + case eof, '\n': + return fmt.Errorf("unterminated quoted string") + case '"': + break Loop + } + } + value := p.consumeText() + s, err := strconv.Unquote(value) + if err != nil { + return fmt.Errorf("unquote string %s error %v", value, err) + } + cur.append(newText(s)) + return p.parseInsideAction(cur) +} + +// parseField scans a field until a terminator +func (p *Parser) parseField(cur *ListNode) error { + p.consumeText() + for p.advance() { + } + value := p.consumeText() + if value == "*" { + cur.append(newWildcard()) + } else { + cur.append(newField(strings.Replace(value, "\\", "", -1))) + } + return p.parseInsideAction(cur) +} + +// advance scans until next non-escaped terminator +func (p *Parser) advance() bool { + r := p.next() + if r == '\\' { + p.next() + } else if isTerminator(r) { + p.backup() + return false + } + return true +} + +// isTerminator reports whether the input is at valid termination character to appear after an identifier. +func isTerminator(r rune) bool { + if isSpace(r) || isEndOfLine(r) { + return true + } + switch r { + case eof, '.', ',', '[', ']', '$', '@', '{', '}': + return true + } + return false +} + +// isSpace reports whether r is a space character. +func isSpace(r rune) bool { + return r == ' ' || r == '\t' +} + +// isEndOfLine reports whether r is an end-of-line character. +func isEndOfLine(r rune) bool { + return r == '\r' || r == '\n' +} + +// isAlphaNumeric reports whether r is an alphabetic, digit, or underscore. +func isAlphaNumeric(r rune) bool { + return r == '_' || unicode.IsLetter(r) || unicode.IsDigit(r) +} diff --git a/staging/src/k8s.io/client-go/pkg/util/ratelimit/bucket.go b/staging/src/k8s.io/client-go/pkg/util/ratelimit/bucket.go new file mode 100644 index 00000000000..752a251d05c --- /dev/null +++ b/staging/src/k8s.io/client-go/pkg/util/ratelimit/bucket.go @@ -0,0 +1,170 @@ +/* +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 ratelimit + +import ( + "math" + "sync" + "time" +) + +// Bucket models a token bucket +type Bucket struct { + unitsPerNano float64 + nanosPerUnit float64 + capacity int64 + + mutex sync.Mutex + available int64 + lastRefill int64 + // fractionalAvailable "buffers" any amounts that flowed into the bucket smaller than one unit + // This lets us retain precision even with pathological refill rates like (1E9 + 1) per second + fractionalAvailable float64 +} + +// NewBucketWithRate creates a new token bucket, with maximum capacity = initial capacity, and a refill rate of qps +// We use floats for refill calculations, which introduces the possibility of truncation and rounding errors. +// For "sensible" qps values though, is is acceptable: jbeda did some tests here https://play.golang.org/p/LSKUOGz2LG +func NewBucketWithRate(qps float64, capacity int64) *Bucket { + unitsPerNano := qps / 1E9 + nanosPerUnit := 1E9 / qps + b := &Bucket{ + unitsPerNano: unitsPerNano, + nanosPerUnit: nanosPerUnit, + capacity: capacity, + available: capacity, + lastRefill: time.Now().UnixNano(), + } + return b +} + +// Take takes n units from the bucket, reducing the available quantity even below zero, +// but then returns the amount of time we should wait +func (b *Bucket) Take(n int64) time.Duration { + b.mutex.Lock() + defer b.mutex.Unlock() + + var d time.Duration + if b.available >= n { + // Fast path when bucket has sufficient availability before refilling + } else { + b.refill() + + if b.available < n { + deficit := n - b.available + d = time.Duration(int64(float64(deficit) * b.nanosPerUnit)) + } + } + + b.available -= n + + return d +} + +// TakeAvailable immediately takes whatever quantity is available, up to max +func (b *Bucket) TakeAvailable(max int64) int64 { + b.mutex.Lock() + defer b.mutex.Unlock() + + var took int64 + if b.available >= max { + // Fast path when bucket has sufficient availability before refilling + took = max + } else { + b.refill() + + took = b.available + + if took < 0 { + took = 0 + } else if took > max { + took = max + } + } + + if took > 0 { + b.available -= took + } + + return took +} + +// Wait combines a call to Take with a sleep call +func (b *Bucket) Wait(n int64) { + d := b.Take(n) + if d != 0 { + time.Sleep(d) + } +} + +// Capacity returns the maximum capacity of the bucket +func (b *Bucket) Capacity() int64 { + return b.capacity +} + +// Available returns the quantity available in the bucket (which may be negative), but does not take it. +// This function is for diagnostic / informational purposes only - the returned capacity may immediately +// be inaccurate if another thread is operating on the bucket concurrently. +func (b *Bucket) Available() int64 { + b.mutex.Lock() + defer b.mutex.Unlock() + + b.refill() + + return b.available +} + +// refill replenishes the bucket based on elapsed time; mutex must be held +func (b *Bucket) refill() { + // Note that we really want a monotonic clock here, but go says no: + // https://github.com/golang/go/issues/12914 + now := time.Now().UnixNano() + + b.refillAtTimestamp(now) +} + +// refillAtTimestamp is the logic of the refill function, for testing +func (b *Bucket) refillAtTimestamp(now int64) { + nanosSinceLastRefill := now - b.lastRefill + if nanosSinceLastRefill <= 0 { + // we really want monotonic + return + } + + // Compute units that have flowed into bucket + refillFloat := (float64(nanosSinceLastRefill) * b.unitsPerNano) + b.fractionalAvailable + if refillFloat > float64(b.capacity) { + // float64 > MaxInt64 can be converted to negative int64; side step this + b.available = b.capacity + + // Don't worry about the fractional units with huge refill rates + } else { + whole, fraction := math.Modf(refillFloat) + refill := int64(whole) + b.fractionalAvailable = fraction + if refill != 0 { + // Refill with overflow + b.available += refill + if b.available >= b.capacity { + b.available = b.capacity + b.fractionalAvailable = 0 + } + } + + } + b.lastRefill = now +} diff --git a/staging/src/k8s.io/client-go/pkg/util/testing/fake_handler.go b/staging/src/k8s.io/client-go/pkg/util/testing/fake_handler.go index 71f8f534c93..6790cfd8ce0 100644 --- a/staging/src/k8s.io/client-go/pkg/util/testing/fake_handler.go +++ b/staging/src/k8s.io/client-go/pkg/util/testing/fake_handler.go @@ -88,6 +88,9 @@ func (f *FakeHandler) ServeHTTP(response http.ResponseWriter, request *http.Requ f.T.Logf("Received read error: %v", err) } f.RequestBody = string(bodyReceived) + if f.T != nil { + f.T.Logf("request body: %s", f.RequestBody) + } } func (f *FakeHandler) ValidateRequestCount(t TestInterface, count int) bool { diff --git a/staging/src/k8s.io/client-go/pkg/util/validation/validation.go b/staging/src/k8s.io/client-go/pkg/util/validation/validation.go index aac2357d74f..aaf63190887 100644 --- a/staging/src/k8s.io/client-go/pkg/util/validation/validation.go +++ b/staging/src/k8s.io/client-go/pkg/util/validation/validation.go @@ -225,7 +225,7 @@ func IsValidPortName(port string) []string { errs = append(errs, "must contain only alpha-numeric characters (a-z, 0-9), and hyphens (-)") } if !portNameOneLetterRegexp.MatchString(port) { - errs = append(errs, "must contain at least one letter (a-z)") + errs = append(errs, "must contain at least one letter or number (a-z, 0-9)") } if strings.Contains(port, "--") { errs = append(errs, "must not contain consecutive hyphens") diff --git a/staging/src/k8s.io/client-go/pkg/util/wait/wait.go b/staging/src/k8s.io/client-go/pkg/util/wait/wait.go index ceafded127f..979ce168bbd 100644 --- a/staging/src/k8s.io/client-go/pkg/util/wait/wait.go +++ b/staging/src/k8s.io/client-go/pkg/util/wait/wait.go @@ -192,6 +192,20 @@ func PollInfinite(interval time.Duration, condition ConditionFunc) error { return PollUntil(interval, condition, done) } +// PollImmediateInfinite is identical to PollInfinite, except that it +// performs the first check immediately, not waiting interval +// beforehand. +func PollImmediateInfinite(interval time.Duration, condition ConditionFunc) error { + done, err := condition() + if err != nil { + return err + } + if done { + return nil + } + return PollInfinite(interval, condition) +} + // PollUntil is like Poll, but it takes a stop change instead of total duration func PollUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error { return WaitFor(poller(interval, 0), condition, stopCh) diff --git a/staging/src/k8s.io/client-go/pkg/watch/until.go b/staging/src/k8s.io/client-go/pkg/watch/until.go index a388bb02858..f05eecc8242 100644 --- a/staging/src/k8s.io/client-go/pkg/watch/until.go +++ b/staging/src/k8s.io/client-go/pkg/watch/until.go @@ -19,9 +19,6 @@ package watch import ( "time" - "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/api/meta" - "k8s.io/client-go/pkg/runtime" "k8s.io/client-go/pkg/util/wait" ) @@ -84,78 +81,3 @@ func Until(timeout time.Duration, watcher Interface, conditions ...ConditionFunc } return lastEvent, nil } - -// ListerWatcher is any object that knows how to perform an initial list and start a watch on a resource. -type ListerWatcher interface { - // List should return a list type object; the Items field will be extracted, and the - // ResourceVersion field will be used to start the watch in the right place. - List(options api.ListOptions) (runtime.Object, error) - // Watch should begin a watch at the specified version. - Watch(options api.ListOptions) (Interface, error) -} - -// TODO: check for watch expired error and retry watch from latest point? Same issue exists for Until. -func ListWatchUntil(timeout time.Duration, lw ListerWatcher, conditions ...ConditionFunc) (*Event, error) { - if len(conditions) == 0 { - return nil, nil - } - - list, err := lw.List(api.ListOptions{}) - if err != nil { - return nil, err - } - initialItems, err := meta.ExtractList(list) - if err != nil { - return nil, err - } - - // use the initial items as simulated "adds" - var lastEvent *Event - currIndex := 0 - passedConditions := 0 - for _, condition := range conditions { - // check the next condition against the previous event and short circuit waiting for the next watch - if lastEvent != nil { - done, err := condition(*lastEvent) - if err != nil { - return lastEvent, err - } - if done { - passedConditions = passedConditions + 1 - continue - } - } - - ConditionSucceeded: - for currIndex < len(initialItems) { - lastEvent = &Event{Type: Added, Object: initialItems[currIndex]} - currIndex++ - - done, err := condition(*lastEvent) - if err != nil { - return lastEvent, err - } - if done { - passedConditions = passedConditions + 1 - break ConditionSucceeded - } - } - } - if passedConditions == len(conditions) { - return lastEvent, nil - } - remainingConditions := conditions[passedConditions:] - - metaObj, err := meta.ListAccessor(list) - if err != nil { - return nil, err - } - currResourceVersion := metaObj.GetResourceVersion() - - watch, err := lw.Watch(api.ListOptions{ResourceVersion: currResourceVersion}) - if err != nil { - return nil, err - } - - return Until(timeout, watch, remainingConditions...) -} diff --git a/staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp/OWNERS b/staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp/OWNERS new file mode 100644 index 00000000000..d75421c5efd --- /dev/null +++ b/staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp/OWNERS @@ -0,0 +1,3 @@ +assignees: + - cjcullen + - jlowdermilk diff --git a/staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go b/staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go index 48b8d524fc1..bf5b253de51 100644 --- a/staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go +++ b/staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go @@ -17,13 +17,20 @@ limitations under the License. package gcp import ( + "bytes" + "encoding/json" + "fmt" "net/http" + "os/exec" + "strings" "time" "github.com/golang/glog" "golang.org/x/net/context" "golang.org/x/oauth2" "golang.org/x/oauth2/google" + "k8s.io/client-go/pkg/util/jsonpath" + "k8s.io/client-go/pkg/util/yaml" "k8s.io/client-go/rest" ) @@ -39,11 +46,22 @@ type gcpAuthProvider struct { } func newGCPAuthProvider(_ string, gcpConfig map[string]string, persister rest.AuthProviderConfigPersister) (rest.AuthProvider, error) { - ts, err := newCachedTokenSource(gcpConfig["access-token"], gcpConfig["expiry"], persister) + cmd, useCmd := gcpConfig["cmd-path"] + var ts oauth2.TokenSource + var err error + if useCmd { + ts, err = newCmdTokenSource(cmd, gcpConfig["token-key"], gcpConfig["expiry-key"], gcpConfig["time-fmt"]) + } else { + ts, err = google.DefaultTokenSource(context.Background(), "https://www.googleapis.com/auth/cloud-platform") + } if err != nil { return nil, err } - return &gcpAuthProvider{ts, persister}, nil + cts, err := newCachedTokenSource(gcpConfig["access-token"], gcpConfig["expiry"], persister, ts, gcpConfig) + if err != nil { + return nil, err + } + return &gcpAuthProvider{cts, persister}, nil } func (g *gcpAuthProvider) WrapTransport(rt http.RoundTripper) http.RoundTripper { @@ -60,22 +78,23 @@ type cachedTokenSource struct { accessToken string expiry time.Time persister rest.AuthProviderConfigPersister + cache map[string]string } -func newCachedTokenSource(accessToken, expiry string, persister rest.AuthProviderConfigPersister) (*cachedTokenSource, error) { +func newCachedTokenSource(accessToken, expiry string, persister rest.AuthProviderConfigPersister, ts oauth2.TokenSource, cache map[string]string) (*cachedTokenSource, error) { var expiryTime time.Time if parsedTime, err := time.Parse(time.RFC3339Nano, expiry); err == nil { expiryTime = parsedTime } - ts, err := google.DefaultTokenSource(context.Background(), "https://www.googleapis.com/auth/cloud-platform") - if err != nil { - return nil, err + if cache == nil { + cache = make(map[string]string) } return &cachedTokenSource{ source: ts, accessToken: accessToken, expiry: expiryTime, persister: persister, + cache: cache, }, nil } @@ -93,13 +112,100 @@ func (t *cachedTokenSource) Token() (*oauth2.Token, error) { return nil, err } if t.persister != nil { - cached := map[string]string{ - "access-token": tok.AccessToken, - "expiry": tok.Expiry.Format(time.RFC3339Nano), - } - if err := t.persister.Persist(cached); err != nil { + t.cache["access-token"] = tok.AccessToken + t.cache["expiry"] = tok.Expiry.Format(time.RFC3339Nano) + if err := t.persister.Persist(t.cache); err != nil { glog.V(4).Infof("Failed to persist token: %v", err) } } return tok, nil } + +type commandTokenSource struct { + cmd string + args []string + tokenKey string + expiryKey string + timeFmt string +} + +func newCmdTokenSource(cmd, tokenKey, expiryKey, timeFmt string) (*commandTokenSource, error) { + if len(timeFmt) == 0 { + timeFmt = time.RFC3339Nano + } + if len(tokenKey) == 0 { + tokenKey = "{.access_token}" + } + if len(expiryKey) == 0 { + expiryKey = "{.token_expiry}" + } + fields := strings.Fields(cmd) + if len(fields) == 0 { + return nil, fmt.Errorf("missing access token cmd") + } + return &commandTokenSource{ + cmd: fields[0], + args: fields[1:], + tokenKey: tokenKey, + expiryKey: expiryKey, + timeFmt: timeFmt, + }, nil +} + +func (c *commandTokenSource) Token() (*oauth2.Token, error) { + fullCmd := fmt.Sprintf("%s %s", c.cmd, strings.Join(c.args, " ")) + cmd := exec.Command(c.cmd, c.args...) + output, err := cmd.Output() + if err != nil { + return nil, fmt.Errorf("error executing access token command %q: %v", fullCmd, err) + } + token, err := c.parseTokenCmdOutput(output) + if err != nil { + return nil, fmt.Errorf("error parsing output for access token command %q: %v", fullCmd, err) + } + return token, nil +} + +func (c *commandTokenSource) parseTokenCmdOutput(output []byte) (*oauth2.Token, error) { + output, err := yaml.ToJSON(output) + if err != nil { + return nil, err + } + var data interface{} + if err := json.Unmarshal(output, &data); err != nil { + return nil, err + } + + accessToken, err := parseJSONPath(data, "token-key", c.tokenKey) + if err != nil { + return nil, fmt.Errorf("error parsing token-key %q: %v", c.tokenKey, err) + } + expiryStr, err := parseJSONPath(data, "expiry-key", c.expiryKey) + if err != nil { + return nil, fmt.Errorf("error parsing expiry-key %q: %v", c.expiryKey, err) + } + var expiry time.Time + if t, err := time.Parse(c.timeFmt, expiryStr); err != nil { + glog.V(4).Infof("Failed to parse token expiry from %s (fmt=%s): %v", expiryStr, c.timeFmt, err) + } else { + expiry = t + } + + return &oauth2.Token{ + AccessToken: accessToken, + TokenType: "Bearer", + Expiry: expiry, + }, nil +} + +func parseJSONPath(input interface{}, name, template string) (string, error) { + j := jsonpath.New(name) + buf := new(bytes.Buffer) + if err := j.Parse(template); err != nil { + return "", err + } + if err := j.Execute(buf, input); err != nil { + return "", err + } + return buf.String(), nil +} diff --git a/staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_test.go b/staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_test.go new file mode 100644 index 00000000000..dfd25bbf1b7 --- /dev/null +++ b/staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_test.go @@ -0,0 +1,143 @@ +/* +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 gcp + +import ( + "fmt" + "reflect" + "strings" + "testing" + "time" + + "golang.org/x/oauth2" +) + +func TestCmdTokenSource(t *testing.T) { + fakeExpiry := time.Date(2016, 10, 31, 22, 31, 9, 123000000, time.UTC) + customFmt := "2006-01-02 15:04:05.999999999" + + tests := []struct { + name string + output []byte + cmd, tokenKey, expiryKey, timeFmt string + tok *oauth2.Token + expectErr error + }{ + { + "defaults", + []byte(`{ + "access_token": "faketoken", + "token_expiry": "2016-10-31T22:31:09.123000000Z" +}`), + "/fake/cmd/path", "", "", "", + &oauth2.Token{ + AccessToken: "faketoken", + TokenType: "Bearer", + Expiry: fakeExpiry, + }, + nil, + }, + { + "custom keys", + []byte(`{ + "token": "faketoken", + "token_expiry": { + "datetime": "2016-10-31 22:31:09.123" + } +}`), + "/fake/cmd/path", "{.token}", "{.token_expiry.datetime}", customFmt, + &oauth2.Token{ + AccessToken: "faketoken", + TokenType: "Bearer", + Expiry: fakeExpiry, + }, + nil, + }, + { + "missing cmd", + nil, + "", "", "", "", + nil, + fmt.Errorf("missing access token cmd"), + }, + { + "missing token-key", + []byte(`{ + "broken": "faketoken", + "token_expiry": { + "datetime": "2016-10-31 22:31:09.123000000Z" + } +}`), + "/fake/cmd/path", "{.token}", "", "", + nil, + fmt.Errorf("error parsing token-key %q", "{.token}"), + }, + { + "missing expiry-key", + []byte(`{ + "access_token": "faketoken", + "expires": "2016-10-31T22:31:09.123000000Z" +}`), + "/fake/cmd/path", "", "{.expiry}", "", + nil, + fmt.Errorf("error parsing expiry-key %q", "{.expiry}"), + }, + { + "invalid expiry timestamp", + []byte(`{ + "access_token": "faketoken", + "token_expiry": "sometime soon, idk" +}`), + "/fake/cmd/path", "", "", "", + &oauth2.Token{ + AccessToken: "faketoken", + TokenType: "Bearer", + Expiry: time.Time{}, + }, + nil, + }, + { + "bad JSON", + []byte(`{ + "access_token": "faketoken", + "token_expiry": "sometime soon, idk" + ------ +`), + "/fake/cmd", "", "", "", + nil, + fmt.Errorf("invalid character '-' after object key:value pair"), + }, + } + + for _, tc := range tests { + ts, err := newCmdTokenSource(tc.cmd, tc.tokenKey, tc.expiryKey, tc.timeFmt) + if err != nil { + if !strings.Contains(err.Error(), tc.expectErr.Error()) { + t.Errorf("%s newCmdTokenSource error: %v, want %v", tc.name, err, tc.expectErr) + } + continue + } + tok, err := ts.parseTokenCmdOutput(tc.output) + + if err != tc.expectErr && !strings.Contains(err.Error(), tc.expectErr.Error()) { + t.Errorf("%s parseCmdTokenSource error: %v, want %v", tc.name, err, tc.expectErr) + } + if !reflect.DeepEqual(tok, tc.tok) { + t.Errorf("%s got token %v, want %v", tc.name, tok, tc.tok) + } + } +} diff --git a/staging/src/k8s.io/client-go/rest/client.go b/staging/src/k8s.io/client-go/rest/client.go index 6e392cf0f5a..79559edb493 100644 --- a/staging/src/k8s.io/client-go/rest/client.go +++ b/staging/src/k8s.io/client-go/rest/client.go @@ -173,9 +173,16 @@ func createSerializers(config ContentConfig) (*Serializers, error) { info = mediaTypes[0] } - internalGV := unversioned.GroupVersion{ - Group: config.GroupVersion.Group, - Version: runtime.APIVersionInternal, + internalGV := unversioned.GroupVersions{ + { + Group: config.GroupVersion.Group, + Version: runtime.APIVersionInternal, + }, + // always include the legacy group as a decoding target to handle non-error `Status` return types + { + Group: "", + Version: runtime.APIVersionInternal, + }, } s := &Serializers{ diff --git a/staging/src/k8s.io/client-go/rest/client_test.go b/staging/src/k8s.io/client-go/rest/client_test.go index 8acaef81edb..b8a0221bb58 100644 --- a/staging/src/k8s.io/client-go/rest/client_test.go +++ b/staging/src/k8s.io/client-go/rest/client_test.go @@ -47,6 +47,26 @@ type TestParam struct { testBodyErrorIsNotNil bool } +// TestSerializer makes sure that you're always able to decode an unversioned API object +func TestSerializer(t *testing.T) { + contentConfig := ContentConfig{ + ContentType: "application/json", + GroupVersion: &unversioned.GroupVersion{Group: "other", Version: runtime.APIVersionInternal}, + NegotiatedSerializer: api.Codecs, + } + + serializer, err := createSerializers(contentConfig) + if err != nil { + t.Fatal(err) + } + // bytes based on actual return from API server when encoding an "unversioned" object + obj, err := runtime.Decode(serializer.Decoder, []byte(`{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Success"}`)) + t.Log(obj) + if err != nil { + t.Fatal(err) + } +} + func TestDoRequestSuccess(t *testing.T) { testServer, fakeHandler, status := testServerEnv(t, 200) defer testServer.Close() @@ -79,13 +99,52 @@ func TestDoRequestFailed(t *testing.T) { testServer := httptest.NewServer(&fakeHandler) defer testServer.Close() + c, err := restClient(testServer) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + err = c.Get().Do().Error() + if err == nil { + t.Errorf("unexpected non-error") + } + ss, ok := err.(errors.APIStatus) + if !ok { + t.Errorf("unexpected error type %v", err) + } + actual := ss.Status() + if !reflect.DeepEqual(status, &actual) { + t.Errorf("Unexpected mis-match: %s", diff.ObjectReflectDiff(status, &actual)) + } +} + +func TestDoRawRequestFailed(t *testing.T) { + status := &unversioned.Status{ + Code: http.StatusNotFound, + Status: unversioned.StatusFailure, + Reason: unversioned.StatusReasonNotFound, + Message: "the server could not find the requested resource", + Details: &unversioned.StatusDetails{ + Causes: []unversioned.StatusCause{ + {Type: unversioned.CauseTypeUnexpectedServerResponse, Message: "unknown"}, + }, + }, + } + expectedBody, _ := runtime.Encode(testapi.Default.Codec(), status) + fakeHandler := utiltesting.FakeHandler{ + StatusCode: 404, + ResponseBody: string(expectedBody), + T: t, + } + testServer := httptest.NewServer(&fakeHandler) + defer testServer.Close() + c, err := restClient(testServer) if err != nil { t.Fatalf("unexpected error: %v", err) } body, err := c.Get().Do().Raw() - if err == nil || body != nil { + if err == nil || body == nil { t.Errorf("unexpected non-error: %#v", body) } ss, ok := err.(errors.APIStatus) @@ -93,12 +152,8 @@ func TestDoRequestFailed(t *testing.T) { t.Errorf("unexpected error type %v", err) } actual := ss.Status() - expected := *status - // The decoder will apply the default Version and Kind to the Status. - expected.APIVersion = "v1" - expected.Kind = "Status" - if !reflect.DeepEqual(&expected, &actual) { - t.Errorf("Unexpected mis-match: %s", diff.ObjectDiff(status, &actual)) + if !reflect.DeepEqual(status, &actual) { + t.Errorf("Unexpected mis-match: %s", diff.ObjectReflectDiff(status, &actual)) } } @@ -162,10 +217,11 @@ func TestBadRequest(t *testing.T) { } func validate(testParam TestParam, t *testing.T, body []byte, fakeHandler *utiltesting.FakeHandler) { - if testParam.expectingError { - if testParam.actualError == nil { - t.Errorf("Expected error") - } + switch { + case testParam.expectingError && testParam.actualError == nil: + t.Errorf("Expected error") + case !testParam.expectingError && testParam.actualError != nil: + t.Error(testParam.actualError) } if !testParam.expCreated { if testParam.actualCreated { diff --git a/staging/src/k8s.io/client-go/rest/request.go b/staging/src/k8s.io/client-go/rest/request.go index ef4cc6a10b8..f5926e3b9f0 100644 --- a/staging/src/k8s.io/client-go/rest/request.go +++ b/staging/src/k8s.io/client-go/rest/request.go @@ -930,33 +930,21 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu } } - // Did the server give us a status response? - isStatusResponse := false - status := &unversioned.Status{} - // Because release-1.1 server returns Status with empty APIVersion at paths - // to the Extensions resources, we need to use DecodeInto here to provide - // default groupVersion, otherwise a status response won't be correctly - // decoded. - err := runtime.DecodeInto(decoder, body, status) - if err == nil && len(status.Status) > 0 { - isStatusResponse = true - } - switch { case resp.StatusCode == http.StatusSwitchingProtocols: // no-op, we've been upgraded case resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent: - if !isStatusResponse { - return Result{err: r.transformUnstructuredResponseError(resp, req, body)} + // calculate an unstructured error from the response which the Result object may use if the caller + // did not return a structured error. + retryAfter, _ := retryAfterSeconds(resp) + err := r.newUnstructuredResponseError(body, isTextResponse(resp), resp.StatusCode, req.Method, retryAfter) + return Result{ + body: body, + contentType: contentType, + statusCode: resp.StatusCode, + decoder: decoder, + err: err, } - return Result{err: errors.FromObject(status)} - } - - // If the server gave us a status back, look at what it was. - success := resp.StatusCode >= http.StatusOK && resp.StatusCode <= http.StatusPartialContent - if isStatusResponse && (status.Status != unversioned.StatusSuccess && !success) { - // "Failed" requests are clearly just an error and it makes sense to return them as such. - return Result{err: errors.FromObject(status)} } return Result{ @@ -967,6 +955,9 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu } } +// maxUnstructuredResponseTextBytes is an upper bound on how much output to include in the unstructured error. +const maxUnstructuredResponseTextBytes = 2048 + // transformUnstructuredResponseError handles an error from the server that is not in a structured form. // It is expected to transform any response that is not recognizable as a clear server sent error from the // K8S API using the information provided with the request. In practice, HTTP proxies and client libraries @@ -987,20 +978,29 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu // TODO: introduce transformation of generic http.Client.Do() errors that separates 4. func (r *Request) transformUnstructuredResponseError(resp *http.Response, req *http.Request, body []byte) error { if body == nil && resp.Body != nil { - if data, err := ioutil.ReadAll(resp.Body); err == nil { + if data, err := ioutil.ReadAll(&io.LimitedReader{R: resp.Body, N: maxUnstructuredResponseTextBytes}); err == nil { body = data } } + retryAfter, _ := retryAfterSeconds(resp) + return r.newUnstructuredResponseError(body, isTextResponse(resp), resp.StatusCode, req.Method, retryAfter) +} + +// newUnstructuredResponseError instantiates the appropriate generic error for the provided input. It also logs the body. +func (r *Request) newUnstructuredResponseError(body []byte, isTextResponse bool, statusCode int, method string, retryAfter int) error { + // cap the amount of output we create + if len(body) > maxUnstructuredResponseTextBytes { + body = body[:maxUnstructuredResponseTextBytes] + } glog.V(8).Infof("Response Body: %#v", string(body)) message := "unknown" - if isTextResponse(resp) { + if isTextResponse { message = strings.TrimSpace(string(body)) } - retryAfter, _ := retryAfterSeconds(resp) return errors.NewGenericServerResponse( - resp.StatusCode, - req.Method, + statusCode, + method, unversioned.GroupResource{ Group: r.content.GroupVersion.Group, Resource: r.resource, @@ -1064,15 +1064,31 @@ func (r Result) Raw() ([]byte, error) { return r.body, r.err } -// Get returns the result as an object. +// Get returns the result as an object, which means it passes through the decoder. +// If the returned object is of type Status and has .Status != StatusSuccess, the +// additional information in Status will be used to enrich the error. func (r Result) Get() (runtime.Object, error) { if r.err != nil { - return nil, r.err + // Check whether the result has a Status object in the body and prefer that. + return nil, r.Error() } if r.decoder == nil { return nil, fmt.Errorf("serializer for %s doesn't exist", r.contentType) } - return runtime.Decode(r.decoder, r.body) + + // decode, but if the result is Status return that as an error instead. + out, _, err := r.decoder.Decode(r.body, nil, nil) + if err != nil { + return nil, err + } + switch t := out.(type) { + case *unversioned.Status: + // any status besides StatusSuccess is considered an error. + if t.Status != unversioned.StatusSuccess { + return nil, errors.FromObject(t) + } + } + return out, nil } // StatusCode returns the HTTP status code of the request. (Only valid if no @@ -1083,14 +1099,31 @@ func (r Result) StatusCode(statusCode *int) Result { } // Into stores the result into obj, if possible. If obj is nil it is ignored. +// If the returned object is of type Status and has .Status != StatusSuccess, the +// additional information in Status will be used to enrich the error. func (r Result) Into(obj runtime.Object) error { if r.err != nil { - return r.err + // Check whether the result has a Status object in the body and prefer that. + return r.Error() } if r.decoder == nil { return fmt.Errorf("serializer for %s doesn't exist", r.contentType) } - return runtime.DecodeInto(r.decoder, r.body, obj) + + out, _, err := r.decoder.Decode(r.body, nil, obj) + if err != nil || out == obj { + return err + } + // if a different object is returned, see if it is Status and avoid double decoding + // the object. + switch t := out.(type) { + case *unversioned.Status: + // any status besides StatusSuccess is considered an error. + if t.Status != unversioned.StatusSuccess { + return errors.FromObject(t) + } + } + return nil } // WasCreated updates the provided bool pointer to whether the server returned @@ -1101,7 +1134,29 @@ func (r Result) WasCreated(wasCreated *bool) Result { } // Error returns the error executing the request, nil if no error occurred. +// If the returned object is of type Status and has Status != StatusSuccess, the +// additional information in Status will be used to enrich the error. // See the Request.Do() comment for what errors you might get. func (r Result) Error() error { + // if we have received an unexpected server error, and we have a body and decoder, we can try to extract + // a Status object. + if r.err == nil || !errors.IsUnexpectedServerError(r.err) || len(r.body) == 0 || r.decoder == nil { + return r.err + } + + // attempt to convert the body into a Status object + // to be backwards compatible with old servers that do not return a version, default to "v1" + out, _, err := r.decoder.Decode(r.body, &unversioned.GroupVersionKind{Version: "v1"}, nil) + if err != nil { + glog.V(5).Infof("body was not decodable (unable to check for Status): %v", err) + return r.err + } + switch t := out.(type) { + case *unversioned.Status: + // because we default the kind, we *must* check for StatusFailure + if t.Status == unversioned.StatusFailure { + return errors.FromObject(t) + } + } return r.err } diff --git a/staging/src/k8s.io/client-go/rest/request_test.go b/staging/src/k8s.io/client-go/rest/request_test.go index 3ac9e24147b..1771374dd2c 100755 --- a/staging/src/k8s.io/client-go/rest/request_test.go +++ b/staging/src/k8s.io/client-go/rest/request_test.go @@ -41,6 +41,7 @@ import ( "k8s.io/client-go/pkg/runtime" "k8s.io/client-go/pkg/runtime/serializer/streaming" "k8s.io/client-go/pkg/util/clock" + "k8s.io/client-go/pkg/util/diff" "k8s.io/client-go/pkg/util/flowcontrol" "k8s.io/client-go/pkg/util/httpstream" "k8s.io/client-go/pkg/util/intstr" @@ -582,7 +583,8 @@ func TestTransformUnstructuredError(t *testing.T) { Resource string Name string - ErrFn func(error) bool + ErrFn func(error) bool + Transformed error }{ { Resource: "foo", @@ -626,9 +628,46 @@ func TestTransformUnstructuredError(t *testing.T) { }, ErrFn: apierrors.IsBadRequest, }, + { + // status in response overrides transformed result + Req: &http.Request{}, + Res: &http.Response{StatusCode: http.StatusBadRequest, Body: ioutil.NopCloser(bytes.NewReader([]byte(`{"kind":"Status","apiVersion":"v1","status":"Failure","code":404}`)))}, + ErrFn: apierrors.IsBadRequest, + Transformed: &apierrors.StatusError{ + ErrStatus: unversioned.Status{Status: unversioned.StatusFailure, Code: http.StatusNotFound}, + }, + }, + { + // successful status is ignored + Req: &http.Request{}, + Res: &http.Response{StatusCode: http.StatusBadRequest, Body: ioutil.NopCloser(bytes.NewReader([]byte(`{"kind":"Status","apiVersion":"v1","status":"Success","code":404}`)))}, + ErrFn: apierrors.IsBadRequest, + }, + { + // empty object does not change result + Req: &http.Request{}, + Res: &http.Response{StatusCode: http.StatusBadRequest, Body: ioutil.NopCloser(bytes.NewReader([]byte(`{}`)))}, + ErrFn: apierrors.IsBadRequest, + }, + { + // we default apiVersion for backwards compatibility with old clients + // TODO: potentially remove in 1.7 + Req: &http.Request{}, + Res: &http.Response{StatusCode: http.StatusBadRequest, Body: ioutil.NopCloser(bytes.NewReader([]byte(`{"kind":"Status","status":"Failure","code":404}`)))}, + ErrFn: apierrors.IsBadRequest, + Transformed: &apierrors.StatusError{ + ErrStatus: unversioned.Status{Status: unversioned.StatusFailure, Code: http.StatusNotFound}, + }, + }, + { + // we do not default kind + Req: &http.Request{}, + Res: &http.Response{StatusCode: http.StatusBadRequest, Body: ioutil.NopCloser(bytes.NewReader([]byte(`{"status":"Failure","code":404}`)))}, + ErrFn: apierrors.IsBadRequest, + }, } - for _, testCase := range testCases { + for i, testCase := range testCases { r := &Request{ content: defaultContentConfig(), serializers: defaultSerializers(), @@ -641,12 +680,40 @@ func TestTransformUnstructuredError(t *testing.T) { t.Errorf("unexpected error: %v", err) continue } + if !apierrors.IsUnexpectedServerError(err) { + t.Errorf("%d: unexpected error type: %v", i, err) + } if len(testCase.Name) != 0 && !strings.Contains(err.Error(), testCase.Name) { t.Errorf("unexpected error string: %s", err) } if len(testCase.Resource) != 0 && !strings.Contains(err.Error(), testCase.Resource) { t.Errorf("unexpected error string: %s", err) } + + // verify Error() properly transforms the error + transformed := result.Error() + expect := testCase.Transformed + if expect == nil { + expect = err + } + if !reflect.DeepEqual(expect, transformed) { + t.Errorf("%d: unexpected Error(): %s", i, diff.ObjectReflectDiff(expect, transformed)) + } + + // verify result.Get properly transforms the error + if _, err := result.Get(); !reflect.DeepEqual(expect, err) { + t.Errorf("%d: unexpected error on Get(): %s", i, diff.ObjectReflectDiff(expect, err)) + } + + // verify result.Into properly handles the error + if err := result.Into(&api.Pod{}); !reflect.DeepEqual(expect, err) { + t.Errorf("%d: unexpected error on Into(): %s", i, diff.ObjectReflectDiff(expect, err)) + } + + // verify result.Raw leaves the error in the untransformed state + if _, err := result.Raw(); !reflect.DeepEqual(result.err, err) { + t.Errorf("%d: unexpected error on Raw(): %s", i, diff.ObjectReflectDiff(expect, err)) + } } } diff --git a/staging/src/k8s.io/client-go/tools/cache/listers.go b/staging/src/k8s.io/client-go/tools/cache/listers.go index 2d262a1c516..eafac197af0 100644 --- a/staging/src/k8s.io/client-go/tools/cache/listers.go +++ b/staging/src/k8s.io/client-go/tools/cache/listers.go @@ -25,7 +25,6 @@ import ( "k8s.io/client-go/pkg/api/meta" "k8s.io/client-go/pkg/api/unversioned" "k8s.io/client-go/pkg/apis/apps" - "k8s.io/client-go/pkg/apis/batch" "k8s.io/client-go/pkg/apis/certificates" "k8s.io/client-go/pkg/apis/extensions" "k8s.io/client-go/pkg/apis/policy" @@ -294,56 +293,6 @@ func (s *StoreToEndpointsLister) GetServiceEndpoints(svc *api.Service) (ep api.E return } -// StoreToJobLister gives a store List and Exists methods. The store must contain only Jobs. -type StoreToJobLister struct { - Store -} - -// Exists checks if the given job exists in the store. -func (s *StoreToJobLister) Exists(job *batch.Job) (bool, error) { - _, exists, err := s.Store.Get(job) - if err != nil { - return false, err - } - return exists, nil -} - -// StoreToJobLister lists all jobs in the store. -func (s *StoreToJobLister) List() (jobs batch.JobList, err error) { - for _, c := range s.Store.List() { - jobs.Items = append(jobs.Items, *(c.(*batch.Job))) - } - return jobs, nil -} - -// GetPodJobs returns a list of jobs managing a pod. Returns an error only if no matching jobs are found. -func (s *StoreToJobLister) GetPodJobs(pod *api.Pod) (jobs []batch.Job, err error) { - var selector labels.Selector - var job batch.Job - - if len(pod.Labels) == 0 { - err = fmt.Errorf("no jobs found for pod %v because it has no labels", pod.Name) - return - } - - for _, m := range s.Store.List() { - job = *m.(*batch.Job) - if job.Namespace != pod.Namespace { - continue - } - - selector, _ = unversioned.LabelSelectorAsSelector(job.Spec.Selector) - if !selector.Matches(labels.Set(pod.Labels)) { - continue - } - jobs = append(jobs, job) - } - if len(jobs) == 0 { - err = fmt.Errorf("could not find jobs for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels) - } - return -} - // Typed wrapper around a store of PersistentVolumes type StoreToPVFetcher struct { Store diff --git a/staging/src/k8s.io/client-go/tools/cache/listers_test.go b/staging/src/k8s.io/client-go/tools/cache/listers_test.go index 6b4ce360a1b..ff1d0b3e405 100644 --- a/staging/src/k8s.io/client-go/tools/cache/listers_test.go +++ b/staging/src/k8s.io/client-go/tools/cache/listers_test.go @@ -22,7 +22,6 @@ import ( "k8s.io/client-go/pkg/api" apierrors "k8s.io/client-go/pkg/api/errors" "k8s.io/client-go/pkg/api/unversioned" - "k8s.io/client-go/pkg/apis/batch" "k8s.io/client-go/pkg/apis/extensions" "k8s.io/client-go/pkg/labels" "k8s.io/client-go/pkg/util/sets" @@ -517,177 +516,6 @@ func TestStoreToDaemonSetLister(t *testing.T) { } } -func TestStoreToJobLister(t *testing.T) { - store := NewStore(MetaNamespaceKeyFunc) - lister := StoreToJobLister{store} - testCases := []struct { - inJobs []*batch.Job - list func() ([]batch.Job, error) - outJobNames sets.String - expectErr bool - msg string - }{ - // Basic listing - { - inJobs: []*batch.Job{ - {ObjectMeta: api.ObjectMeta{Name: "basic"}}, - }, - list: func() ([]batch.Job, error) { - list, err := lister.List() - return list.Items, err - }, - outJobNames: sets.NewString("basic"), - msg: "basic listing failed", - }, - // Listing multiple jobs - { - inJobs: []*batch.Job{ - {ObjectMeta: api.ObjectMeta{Name: "basic"}}, - {ObjectMeta: api.ObjectMeta{Name: "complex"}}, - {ObjectMeta: api.ObjectMeta{Name: "complex2"}}, - }, - list: func() ([]batch.Job, error) { - list, err := lister.List() - return list.Items, err - }, - outJobNames: sets.NewString("basic", "complex", "complex2"), - msg: "listing multiple jobs failed", - }, - // No pod labels - { - inJobs: []*batch.Job{ - { - ObjectMeta: api.ObjectMeta{Name: "basic", Namespace: "ns"}, - Spec: batch.JobSpec{ - Selector: &unversioned.LabelSelector{ - MatchLabels: map[string]string{"foo": "baz"}, - }, - }, - }, - }, - list: func() ([]batch.Job, error) { - pod := &api.Pod{ - ObjectMeta: api.ObjectMeta{Name: "pod", Namespace: "ns"}, - } - return lister.GetPodJobs(pod) - }, - outJobNames: sets.NewString(), - expectErr: true, - msg: "listing jobs failed when pod has no labels: expected error, got none", - }, - // No Job selectors - { - inJobs: []*batch.Job{ - { - ObjectMeta: api.ObjectMeta{Name: "basic", Namespace: "ns"}, - }, - }, - list: func() ([]batch.Job, error) { - pod := &api.Pod{ - ObjectMeta: api.ObjectMeta{ - Name: "pod", - Namespace: "ns", - Labels: map[string]string{"foo": "bar"}, - }, - } - return lister.GetPodJobs(pod) - }, - outJobNames: sets.NewString(), - expectErr: true, - msg: "listing jobs failed when job has no selector: expected error, got none", - }, - // Matching labels to selectors and namespace - { - inJobs: []*batch.Job{ - { - ObjectMeta: api.ObjectMeta{Name: "foo"}, - Spec: batch.JobSpec{ - Selector: &unversioned.LabelSelector{ - MatchLabels: map[string]string{"foo": "bar"}, - }, - }, - }, - { - ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "ns"}, - Spec: batch.JobSpec{ - Selector: &unversioned.LabelSelector{ - MatchLabels: map[string]string{"foo": "bar"}, - }, - }, - }, - }, - list: func() ([]batch.Job, error) { - pod := &api.Pod{ - ObjectMeta: api.ObjectMeta{ - Name: "pod", - Labels: map[string]string{"foo": "bar"}, - Namespace: "ns", - }, - } - return lister.GetPodJobs(pod) - }, - outJobNames: sets.NewString("bar"), - msg: "listing jobs with namespace and selector failed", - }, - // Matching labels to selectors and namespace, error case - { - inJobs: []*batch.Job{ - { - ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "foo"}, - Spec: batch.JobSpec{ - Selector: &unversioned.LabelSelector{ - MatchLabels: map[string]string{"foo": "bar"}, - }, - }, - }, - { - ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "bar"}, - Spec: batch.JobSpec{ - Selector: &unversioned.LabelSelector{ - MatchLabels: map[string]string{"foo": "bar"}, - }, - }, - }, - }, - list: func() ([]batch.Job, error) { - pod := &api.Pod{ - ObjectMeta: api.ObjectMeta{ - Name: "pod", - Labels: map[string]string{"foo": "bar"}, - Namespace: "baz", - }, - } - return lister.GetPodJobs(pod) - }, - expectErr: true, - msg: "listing jobs with namespace and selector failed: expected error, got none", - }, - } - for _, c := range testCases { - for _, r := range c.inJobs { - store.Add(r) - } - - Jobs, err := c.list() - if err != nil && c.expectErr { - continue - } else if c.expectErr { - t.Errorf("%v", c.msg) - continue - } else if err != nil { - t.Errorf("Unexpected error %#v", err) - continue - } - JobNames := make([]string, len(Jobs)) - for ix := range Jobs { - JobNames[ix] = Jobs[ix].Name - } - if !c.outJobNames.HasAll(JobNames...) || len(JobNames) != len(c.outJobNames) { - t.Errorf("%v : expected %v, got %v", c.msg, JobNames, c.outJobNames) - } - } -} - func TestStoreToPodLister(t *testing.T) { // We test with and without a namespace index, because StoreToPodLister has // special logic to work on namespaces even when no namespace index is diff --git a/staging/src/k8s.io/client-go/tools/cache/listwatch.go b/staging/src/k8s.io/client-go/tools/cache/listwatch.go index dddb83d7165..d3c7d67dbab 100644 --- a/staging/src/k8s.io/client-go/tools/cache/listwatch.go +++ b/staging/src/k8s.io/client-go/tools/cache/listwatch.go @@ -20,12 +20,22 @@ import ( "time" "k8s.io/client-go/pkg/api" + "k8s.io/client-go/pkg/api/meta" "k8s.io/client-go/pkg/fields" "k8s.io/client-go/pkg/runtime" "k8s.io/client-go/pkg/watch" "k8s.io/client-go/rest" ) +// ListerWatcher is any object that knows how to perform an initial list and start a watch on a resource. +type ListerWatcher interface { + // List should return a list type object; the Items field will be extracted, and the + // ResourceVersion field will be used to start the watch in the right place. + List(options api.ListOptions) (runtime.Object, error) + // Watch should begin a watch at the specified version. + Watch(options api.ListOptions) (watch.Interface, error) +} + // ListFunc knows how to list resources type ListFunc func(options api.ListOptions) (runtime.Object, error) @@ -84,3 +94,69 @@ func (lw *ListWatch) List(options api.ListOptions) (runtime.Object, error) { func (lw *ListWatch) Watch(options api.ListOptions) (watch.Interface, error) { return lw.WatchFunc(options) } + +// TODO: check for watch expired error and retry watch from latest point? Same issue exists for Until. +func ListWatchUntil(timeout time.Duration, lw ListerWatcher, conditions ...watch.ConditionFunc) (*watch.Event, error) { + if len(conditions) == 0 { + return nil, nil + } + + list, err := lw.List(api.ListOptions{}) + if err != nil { + return nil, err + } + initialItems, err := meta.ExtractList(list) + if err != nil { + return nil, err + } + + // use the initial items as simulated "adds" + var lastEvent *watch.Event + currIndex := 0 + passedConditions := 0 + for _, condition := range conditions { + // check the next condition against the previous event and short circuit waiting for the next watch + if lastEvent != nil { + done, err := condition(*lastEvent) + if err != nil { + return lastEvent, err + } + if done { + passedConditions = passedConditions + 1 + continue + } + } + + ConditionSucceeded: + for currIndex < len(initialItems) { + lastEvent = &watch.Event{Type: watch.Added, Object: initialItems[currIndex]} + currIndex++ + + done, err := condition(*lastEvent) + if err != nil { + return lastEvent, err + } + if done { + passedConditions = passedConditions + 1 + break ConditionSucceeded + } + } + } + if passedConditions == len(conditions) { + return lastEvent, nil + } + remainingConditions := conditions[passedConditions:] + + metaObj, err := meta.ListAccessor(list) + if err != nil { + return nil, err + } + currResourceVersion := metaObj.GetResourceVersion() + + watchInterface, err := lw.Watch(api.ListOptions{ResourceVersion: currResourceVersion}) + if err != nil { + return nil, err + } + + return watch.Until(timeout, watchInterface, remainingConditions...) +} diff --git a/staging/src/k8s.io/client-go/tools/cache/reflector.go b/staging/src/k8s.io/client-go/tools/cache/reflector.go index 1f3017d0341..d189a1b53fa 100644 --- a/staging/src/k8s.io/client-go/tools/cache/reflector.go +++ b/staging/src/k8s.io/client-go/tools/cache/reflector.go @@ -43,15 +43,6 @@ import ( "k8s.io/client-go/pkg/watch" ) -// ListerWatcher is any object that knows how to perform an initial list and start a watch on a resource. -type ListerWatcher interface { - // List should return a list type object; the Items field will be extracted, and the - // ResourceVersion field will be used to start the watch in the right place. - List(options api.ListOptions) (runtime.Object, error) - // Watch should begin a watch at the specified version. - Watch(options api.ListOptions) (watch.Interface, error) -} - // Reflector watches a specified resource and causes all changes to be reflected in the given store. type Reflector struct { // name identifies this reflector. By default it will be a file:line if possible. diff --git a/vendor/BUILD b/vendor/BUILD index 3e7e75e02a7..17b5fc94dcf 100644 --- a/vendor/BUILD +++ b/vendor/BUILD @@ -8571,6 +8571,7 @@ go_library( tags = ["automanaged"], deps = [ "//vendor:github.com/emicklei/go-restful/swagger", + "//vendor:github.com/golang/glog", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/errors", "//vendor:k8s.io/client-go/pkg/api/meta", @@ -8632,15 +8633,16 @@ go_library( deps = [ "//vendor:github.com/golang/glog", "//vendor:k8s.io/client-go/discovery", - "//vendor:k8s.io/client-go/kubernetes/typed/apps/v1alpha1", + "//vendor:k8s.io/client-go/kubernetes/typed/apps/v1beta1", "//vendor:k8s.io/client-go/kubernetes/typed/authentication/v1beta1", "//vendor:k8s.io/client-go/kubernetes/typed/authorization/v1beta1", "//vendor:k8s.io/client-go/kubernetes/typed/autoscaling/v1", "//vendor:k8s.io/client-go/kubernetes/typed/batch/v1", + "//vendor:k8s.io/client-go/kubernetes/typed/batch/v2alpha1", "//vendor:k8s.io/client-go/kubernetes/typed/certificates/v1alpha1", "//vendor:k8s.io/client-go/kubernetes/typed/core/v1", "//vendor:k8s.io/client-go/kubernetes/typed/extensions/v1beta1", - "//vendor:k8s.io/client-go/kubernetes/typed/policy/v1alpha1", + "//vendor:k8s.io/client-go/kubernetes/typed/policy/v1beta1", "//vendor:k8s.io/client-go/kubernetes/typed/rbac/v1alpha1", "//vendor:k8s.io/client-go/kubernetes/typed/storage/v1beta1", "//vendor:k8s.io/client-go/pkg/api/install", @@ -8672,8 +8674,8 @@ go_library( "//vendor:k8s.io/client-go/discovery", "//vendor:k8s.io/client-go/discovery/fake", "//vendor:k8s.io/client-go/kubernetes", - "//vendor:k8s.io/client-go/kubernetes/typed/apps/v1alpha1", - "//vendor:k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake", + "//vendor:k8s.io/client-go/kubernetes/typed/apps/v1beta1", + "//vendor:k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake", "//vendor:k8s.io/client-go/kubernetes/typed/authentication/v1beta1", "//vendor:k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake", "//vendor:k8s.io/client-go/kubernetes/typed/authorization/v1beta1", @@ -8682,14 +8684,16 @@ go_library( "//vendor:k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake", "//vendor:k8s.io/client-go/kubernetes/typed/batch/v1", "//vendor:k8s.io/client-go/kubernetes/typed/batch/v1/fake", + "//vendor:k8s.io/client-go/kubernetes/typed/batch/v2alpha1", + "//vendor:k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake", "//vendor:k8s.io/client-go/kubernetes/typed/certificates/v1alpha1", "//vendor:k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake", "//vendor:k8s.io/client-go/kubernetes/typed/core/v1", "//vendor:k8s.io/client-go/kubernetes/typed/core/v1/fake", "//vendor:k8s.io/client-go/kubernetes/typed/extensions/v1beta1", "//vendor:k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake", - "//vendor:k8s.io/client-go/kubernetes/typed/policy/v1alpha1", - "//vendor:k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake", + "//vendor:k8s.io/client-go/kubernetes/typed/policy/v1beta1", + "//vendor:k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake", "//vendor:k8s.io/client-go/kubernetes/typed/rbac/v1alpha1", "//vendor:k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake", "//vendor:k8s.io/client-go/kubernetes/typed/storage/v1beta1", @@ -8702,47 +8706,6 @@ go_library( ], ) -go_library( - name = "k8s.io/client-go/kubernetes/typed/apps/v1alpha1", - srcs = [ - "k8s.io/client-go/kubernetes/typed/apps/v1alpha1/apps_client.go", - "k8s.io/client-go/kubernetes/typed/apps/v1alpha1/doc.go", - "k8s.io/client-go/kubernetes/typed/apps/v1alpha1/generated_expansion.go", - "k8s.io/client-go/kubernetes/typed/apps/v1alpha1/statefulset.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apimachinery/registered", - "//vendor:k8s.io/client-go/pkg/apis/apps/v1alpha1", - "//vendor:k8s.io/client-go/pkg/runtime/serializer", - "//vendor:k8s.io/client-go/pkg/watch", - "//vendor:k8s.io/client-go/rest", - ], -) - -go_library( - name = "k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake", - srcs = [ - "k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/doc.go", - "k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/fake_apps_client.go", - "k8s.io/client-go/kubernetes/typed/apps/v1alpha1/fake/fake_statefulset.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:k8s.io/client-go/kubernetes/typed/apps/v1alpha1", - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/unversioned", - "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apis/apps/v1alpha1", - "//vendor:k8s.io/client-go/pkg/labels", - "//vendor:k8s.io/client-go/pkg/watch", - "//vendor:k8s.io/client-go/rest", - "//vendor:k8s.io/client-go/testing", - ], -) - go_library( name = "k8s.io/client-go/kubernetes/typed/authentication/v1beta1", srcs = [ @@ -8750,11 +8713,14 @@ go_library( "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/doc.go", "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go", "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go", + "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go", ], tags = ["automanaged"], deps = [ "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/apimachinery/registered", + "//vendor:k8s.io/client-go/pkg/apis/authentication/v1beta1", "//vendor:k8s.io/client-go/pkg/runtime/serializer", "//vendor:k8s.io/client-go/rest", ], @@ -8766,10 +8732,12 @@ go_library( "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go", "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go", "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go", + "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview_expansion.go", ], tags = ["automanaged"], deps = [ "//vendor:k8s.io/client-go/kubernetes/typed/authentication/v1beta1", + "//vendor:k8s.io/client-go/pkg/apis/authentication/v1beta1", "//vendor:k8s.io/client-go/rest", "//vendor:k8s.io/client-go/testing", ], @@ -8782,13 +8750,16 @@ go_library( "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/doc.go", "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go", "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go", + "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go", "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go", + "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go", "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go", "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go", ], tags = ["automanaged"], deps = [ "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/apimachinery/registered", "//vendor:k8s.io/client-go/pkg/apis/authorization/v1beta1", "//vendor:k8s.io/client-go/pkg/runtime/serializer", @@ -8801,8 +8772,11 @@ go_library( srcs = [ "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go", "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go", + "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_generated_expansion.go", "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go", + "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview_expansion.go", "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go", + "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview_expansion.go", "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go", "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview_expansion.go", ], @@ -8826,6 +8800,7 @@ go_library( tags = ["automanaged"], deps = [ "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apimachinery/registered", "//vendor:k8s.io/client-go/pkg/apis/autoscaling/v1", @@ -8867,6 +8842,7 @@ go_library( tags = ["automanaged"], deps = [ "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apimachinery/registered", "//vendor:k8s.io/client-go/pkg/apis/batch/v1", @@ -8902,12 +8878,14 @@ go_library( srcs = [ "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificates_client.go", "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest.go", + "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest_expansion.go", "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/doc.go", "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/generated_expansion.go", ], tags = ["automanaged"], deps = [ "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apimachinery/registered", "//vendor:k8s.io/client-go/pkg/apis/certificates/v1alpha1", @@ -8923,6 +8901,7 @@ go_library( "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/doc.go", "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificates_client.go", "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest.go", + "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest_expansion.go", ], tags = ["automanaged"], deps = [ @@ -8953,6 +8932,7 @@ go_library( "k8s.io/client-go/kubernetes/typed/core/v1/namespace.go", "k8s.io/client-go/kubernetes/typed/core/v1/namespace_expansion.go", "k8s.io/client-go/kubernetes/typed/core/v1/node.go", + "k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go", "k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go", "k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go", "k8s.io/client-go/kubernetes/typed/core/v1/pod.go", @@ -8968,6 +8948,7 @@ go_library( tags = ["automanaged"], deps = [ "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apimachinery/registered", "//vendor:k8s.io/client-go/pkg/apis/policy/v1alpha1", @@ -8994,6 +8975,7 @@ go_library( "k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go", "k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace_expansion.go", "k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go", + "k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node_expansion.go", "k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go", "k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go", "k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go", @@ -9094,6 +9076,7 @@ go_library( tags = ["automanaged"], deps = [ "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apimachinery/registered", "//vendor:k8s.io/client-go/pkg/apis/policy/v1alpha1", @@ -9138,6 +9121,7 @@ go_library( tags = ["automanaged"], deps = [ "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apimachinery/registered", "//vendor:k8s.io/client-go/pkg/apis/rbac/v1alpha1", @@ -9182,6 +9166,7 @@ go_library( tags = ["automanaged"], deps = [ "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apimachinery/registered", "//vendor:k8s.io/client-go/pkg/apis/storage/v1beta1", @@ -9358,6 +9343,7 @@ go_library( "//vendor:k8s.io/client-go/pkg/apis/apps", "//vendor:k8s.io/client-go/pkg/apis/apps/install", "//vendor:k8s.io/client-go/pkg/apis/authentication/install", + "//vendor:k8s.io/client-go/pkg/apis/authorization", "//vendor:k8s.io/client-go/pkg/apis/authorization/install", "//vendor:k8s.io/client-go/pkg/apis/autoscaling", "//vendor:k8s.io/client-go/pkg/apis/autoscaling/install", @@ -9536,39 +9522,7 @@ go_library( deps = [ "//vendor:k8s.io/client-go/pkg/apimachinery/announced", "//vendor:k8s.io/client-go/pkg/apis/apps", - "//vendor:k8s.io/client-go/pkg/apis/apps/v1alpha1", - ], -) - -go_library( - name = "k8s.io/client-go/pkg/apis/apps/v1alpha1", - srcs = [ - "k8s.io/client-go/pkg/apis/apps/v1alpha1/conversion.go", - "k8s.io/client-go/pkg/apis/apps/v1alpha1/defaults.go", - "k8s.io/client-go/pkg/apis/apps/v1alpha1/doc.go", - "k8s.io/client-go/pkg/apis/apps/v1alpha1/generated.pb.go", - "k8s.io/client-go/pkg/apis/apps/v1alpha1/register.go", - "k8s.io/client-go/pkg/apis/apps/v1alpha1/types.generated.go", - "k8s.io/client-go/pkg/apis/apps/v1alpha1/types.go", - "k8s.io/client-go/pkg/apis/apps/v1alpha1/types_swagger_doc_generated.go", - "k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.conversion.go", - "k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.deepcopy.go", - "k8s.io/client-go/pkg/apis/apps/v1alpha1/zz_generated.defaults.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:github.com/gogo/protobuf/proto", - "//vendor:github.com/ugorji/go/codec", - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/resource", - "//vendor:k8s.io/client-go/pkg/api/unversioned", - "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apis/apps", - "//vendor:k8s.io/client-go/pkg/conversion", - "//vendor:k8s.io/client-go/pkg/runtime", - "//vendor:k8s.io/client-go/pkg/types", - "//vendor:k8s.io/client-go/pkg/util/intstr", - "//vendor:k8s.io/client-go/pkg/watch/versioned", + "//vendor:k8s.io/client-go/pkg/apis/apps/v1beta1", ], ) @@ -10098,7 +10052,6 @@ go_library( go_library( name = "k8s.io/client-go/pkg/apis/kubeadm", srcs = [ - "k8s.io/client-go/pkg/apis/kubeadm/defaults.go", "k8s.io/client-go/pkg/apis/kubeadm/doc.go", "k8s.io/client-go/pkg/apis/kubeadm/env.go", "k8s.io/client-go/pkg/apis/kubeadm/register.go", @@ -10129,9 +10082,11 @@ go_library( go_library( name = "k8s.io/client-go/pkg/apis/kubeadm/v1alpha1", srcs = [ + "k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/defaults.go", "k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/doc.go", "k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/register.go", "k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/types.go", + "k8s.io/client-go/pkg/apis/kubeadm/v1alpha1/zz_generated.defaults.go", ], tags = ["automanaged"], deps = [ @@ -10169,7 +10124,7 @@ go_library( deps = [ "//vendor:k8s.io/client-go/pkg/apimachinery/announced", "//vendor:k8s.io/client-go/pkg/apis/policy", - "//vendor:k8s.io/client-go/pkg/apis/policy/v1alpha1", + "//vendor:k8s.io/client-go/pkg/apis/policy/v1beta1", ], ) @@ -10177,25 +10132,14 @@ go_library( name = "k8s.io/client-go/pkg/apis/policy/v1alpha1", srcs = [ "k8s.io/client-go/pkg/apis/policy/v1alpha1/doc.go", - "k8s.io/client-go/pkg/apis/policy/v1alpha1/generated.pb.go", "k8s.io/client-go/pkg/apis/policy/v1alpha1/register.go", - "k8s.io/client-go/pkg/apis/policy/v1alpha1/types.generated.go", "k8s.io/client-go/pkg/apis/policy/v1alpha1/types.go", - "k8s.io/client-go/pkg/apis/policy/v1alpha1/types_swagger_doc_generated.go", - "k8s.io/client-go/pkg/apis/policy/v1alpha1/zz_generated.conversion.go", - "k8s.io/client-go/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go", ], tags = ["automanaged"], deps = [ - "//vendor:github.com/gogo/protobuf/proto", - "//vendor:github.com/ugorji/go/codec", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/apis/policy", - "//vendor:k8s.io/client-go/pkg/conversion", "//vendor:k8s.io/client-go/pkg/runtime", - "//vendor:k8s.io/client-go/pkg/types", "//vendor:k8s.io/client-go/pkg/util/intstr", "//vendor:k8s.io/client-go/pkg/watch/versioned", ], @@ -10710,6 +10654,7 @@ go_library( "k8s.io/client-go/pkg/util/config/configuration_map.go", "k8s.io/client-go/pkg/util/config/doc.go", "k8s.io/client-go/pkg/util/config/feature_gate.go", + "k8s.io/client-go/pkg/util/config/namedcertkey_flag.go", ], tags = ["automanaged"], deps = [ @@ -10746,9 +10691,9 @@ go_library( ], tags = ["automanaged"], deps = [ - "//pkg/util/ratelimit:go_default_library", "//vendor:k8s.io/client-go/pkg/util/clock", "//vendor:k8s.io/client-go/pkg/util/integer", + "//vendor:k8s.io/client-go/pkg/util/ratelimit", ], ) @@ -10975,8 +10920,6 @@ go_library( tags = ["automanaged"], deps = [ "//vendor:github.com/golang/glog", - "//vendor:k8s.io/client-go/pkg/api", - "//vendor:k8s.io/client-go/pkg/api/meta", "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/runtime", "//vendor:k8s.io/client-go/pkg/util/net", @@ -11035,6 +10978,8 @@ go_library( "//vendor:golang.org/x/net/context", "//vendor:golang.org/x/oauth2", "//vendor:golang.org/x/oauth2/google", + "//vendor:k8s.io/client-go/pkg/util/jsonpath", + "//vendor:k8s.io/client-go/pkg/util/yaml", "//vendor:k8s.io/client-go/rest", ], ) @@ -11167,7 +11112,6 @@ go_library( "//vendor:k8s.io/client-go/pkg/api/meta", "//vendor:k8s.io/client-go/pkg/api/unversioned", "//vendor:k8s.io/client-go/pkg/apis/apps", - "//vendor:k8s.io/client-go/pkg/apis/batch", "//vendor:k8s.io/client-go/pkg/apis/certificates", "//vendor:k8s.io/client-go/pkg/apis/extensions", "//vendor:k8s.io/client-go/pkg/apis/policy", @@ -11532,3 +11476,241 @@ go_library( ], tags = ["automanaged"], ) + +go_library( + name = "k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/difflib", + srcs = ["k8s.io/client-go/_vendor/github.com/pmezard/go-difflib/difflib/difflib.go"], + tags = ["automanaged"], +) + +go_library( + name = "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert", + srcs = [ + "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/assertions.go", + "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/doc.go", + "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/errors.go", + "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/forward_assertions.go", + "k8s.io/client-go/_vendor/github.com/stretchr/testify/assert/http_assertions.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:github.com/davecgh/go-spew/spew", + "//vendor:github.com/pmezard/go-difflib/difflib", + ], +) + +go_library( + name = "k8s.io/client-go/kubernetes/typed/apps/v1beta1", + srcs = [ + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go", + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/doc.go", + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/generated_expansion.go", + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apimachinery/registered", + "//vendor:k8s.io/client-go/pkg/apis/apps/v1beta1", + "//vendor:k8s.io/client-go/pkg/runtime/serializer", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + ], +) + +go_library( + name = "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake", + srcs = [ + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go", + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go", + "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/kubernetes/typed/apps/v1beta1", + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apis/apps/v1beta1", + "//vendor:k8s.io/client-go/pkg/labels", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + "//vendor:k8s.io/client-go/testing", + ], +) + +go_library( + name = "k8s.io/client-go/kubernetes/typed/batch/v2alpha1", + srcs = [ + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/batch_client.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/doc.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/generated_expansion.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/job.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apimachinery/registered", + "//vendor:k8s.io/client-go/pkg/apis/batch/v2alpha1", + "//vendor:k8s.io/client-go/pkg/runtime/serializer", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + ], +) + +go_library( + name = "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake", + srcs = [ + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/doc.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_batch_client.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go", + "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_job.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/kubernetes/typed/batch/v2alpha1", + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apis/batch/v2alpha1", + "//vendor:k8s.io/client-go/pkg/labels", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + "//vendor:k8s.io/client-go/testing", + ], +) + +go_library( + name = "k8s.io/client-go/kubernetes/typed/policy/v1beta1", + srcs = [ + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/doc.go", + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/generated_expansion.go", + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go", + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apimachinery/registered", + "//vendor:k8s.io/client-go/pkg/apis/policy/v1beta1", + "//vendor:k8s.io/client-go/pkg/runtime/serializer", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + ], +) + +go_library( + name = "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake", + srcs = [ + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go", + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go", + "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:k8s.io/client-go/kubernetes/typed/policy/v1beta1", + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apis/policy/v1beta1", + "//vendor:k8s.io/client-go/pkg/labels", + "//vendor:k8s.io/client-go/pkg/watch", + "//vendor:k8s.io/client-go/rest", + "//vendor:k8s.io/client-go/testing", + ], +) + +go_library( + name = "k8s.io/client-go/pkg/apis/apps/v1beta1", + srcs = [ + "k8s.io/client-go/pkg/apis/apps/v1beta1/conversion.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/defaults.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/doc.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/generated.pb.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/register.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/types.generated.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/types.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/types_swagger_doc_generated.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.conversion.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.deepcopy.go", + "k8s.io/client-go/pkg/apis/apps/v1beta1/zz_generated.defaults.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:github.com/gogo/protobuf/proto", + "//vendor:github.com/ugorji/go/codec", + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/resource", + "//vendor:k8s.io/client-go/pkg/api/unversioned", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apis/apps", + "//vendor:k8s.io/client-go/pkg/conversion", + "//vendor:k8s.io/client-go/pkg/runtime", + "//vendor:k8s.io/client-go/pkg/types", + "//vendor:k8s.io/client-go/pkg/util/intstr", + "//vendor:k8s.io/client-go/pkg/watch/versioned", + ], +) + +go_library( + name = "k8s.io/client-go/pkg/apis/policy/v1beta1", + srcs = [ + "k8s.io/client-go/pkg/apis/policy/v1beta1/doc.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/generated.pb.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/register.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/types.generated.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/types.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/types_swagger_doc_generated.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.conversion.go", + "k8s.io/client-go/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go", + ], + tags = ["automanaged"], + deps = [ + "//vendor:github.com/gogo/protobuf/proto", + "//vendor:github.com/gogo/protobuf/sortkeys", + "//vendor:github.com/ugorji/go/codec", + "//vendor:k8s.io/client-go/pkg/api", + "//vendor:k8s.io/client-go/pkg/api/unversioned", + "//vendor:k8s.io/client-go/pkg/api/v1", + "//vendor:k8s.io/client-go/pkg/apis/policy", + "//vendor:k8s.io/client-go/pkg/conversion", + "//vendor:k8s.io/client-go/pkg/runtime", + "//vendor:k8s.io/client-go/pkg/types", + "//vendor:k8s.io/client-go/pkg/util/intstr", + "//vendor:k8s.io/client-go/pkg/watch/versioned", + ], +) + +go_library( + name = "k8s.io/client-go/pkg/third_party/forked/golang/template", + srcs = [ + "k8s.io/client-go/pkg/third_party/forked/golang/template/exec.go", + "k8s.io/client-go/pkg/third_party/forked/golang/template/funcs.go", + ], + tags = ["automanaged"], +) + +go_library( + name = "k8s.io/client-go/pkg/util/jsonpath", + srcs = [ + "k8s.io/client-go/pkg/util/jsonpath/doc.go", + "k8s.io/client-go/pkg/util/jsonpath/jsonpath.go", + "k8s.io/client-go/pkg/util/jsonpath/node.go", + "k8s.io/client-go/pkg/util/jsonpath/parser.go", + ], + tags = ["automanaged"], + deps = ["//vendor:k8s.io/client-go/pkg/third_party/forked/golang/template"], +) + +go_library( + name = "k8s.io/client-go/pkg/util/ratelimit", + srcs = ["k8s.io/client-go/pkg/util/ratelimit/bucket.go"], + tags = ["automanaged"], +)