update dependencies of containerd/cri

List generated by running:
`git diff c9d45e6526 19589b4bf9 vendor.conf`

in the containerd/cri repositoru

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas 2020-01-25 13:02:50 -05:00
parent 53ced5ffe1
commit 0dc69620b8
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59
81 changed files with 3685 additions and 1808 deletions

View File

@ -63,25 +63,26 @@ github.com/docker/docker d1d5f6476656c6aad457e2a91d34
github.com/docker/spdystream 449fdfce4d962303d702fec724ef0ad181c92528 github.com/docker/spdystream 449fdfce4d962303d702fec724ef0ad181c92528
github.com/emicklei/go-restful b993709ae1a4f6dd19cfa475232614441b11c9d5 # v2.9.5 github.com/emicklei/go-restful b993709ae1a4f6dd19cfa475232614441b11c9d5 # v2.9.5
github.com/google/gofuzz f140a6486e521aad38f5917de355cbf147cc0496 # v1.0.0 github.com/google/gofuzz f140a6486e521aad38f5917de355cbf147cc0496 # v1.0.0
github.com/json-iterator/go 27518f6661eba504be5a7a9a9f6d9460d892ade3 # v1.1.7 github.com/json-iterator/go 03217c3e97663914aec3faafde50d081f197a0a2 # v1.1.8
github.com/modern-go/concurrent bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94 # 1.0.3 github.com/modern-go/concurrent bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94 # 1.0.3
github.com/modern-go/reflect2 4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd # 1.0.1 github.com/modern-go/reflect2 4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd # 1.0.1
github.com/opencontainers/selinux 5215b1806f52b1fcc2070a8826c542c9d33cd3cf github.com/opencontainers/selinux 5215b1806f52b1fcc2070a8826c542c9d33cd3cf
github.com/seccomp/libseccomp-golang 689e3c1541a84461afc49c1c87352a6cedf72e9c # v0.9.1 github.com/seccomp/libseccomp-golang 689e3c1541a84461afc49c1c87352a6cedf72e9c # v0.9.1
github.com/stretchr/testify 221dbe5ed46703ee255b1da0dec05086f5035f62 # v1.4.0
github.com/tchap/go-patricia 666120de432aea38ab06bd5c818f04f4129882c9 # v2.2.6 github.com/tchap/go-patricia 666120de432aea38ab06bd5c818f04f4129882c9 # v2.2.6
golang.org/x/crypto 5c40567a22f818bd14a1ea7245dad9f8ef0691aa golang.org/x/crypto 60c769a6c58655dab1b9adac0d58967dd517cfba
golang.org/x/oauth2 0f29369cfe4552d0e4bcddc57cc75f4d7e672a33 golang.org/x/oauth2 0f29369cfe4552d0e4bcddc57cc75f4d7e672a33
golang.org/x/time 85acf8d2951cb2a3bde7632f9ff273ef0379bcbd golang.org/x/time 9d24e82272b4f38b78bc8cff74fa936d31ccd8ef
gopkg.in/inf.v0 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4 # v0.9.0 gopkg.in/inf.v0 d2d2541c53f18d2a059457998ce2876cc8e67cbf # v0.9.1
gopkg.in/yaml.v2 51d6538a90f86fe93ac480b35f37b2be17fef232 # v2.2.2 gopkg.in/yaml.v2 f221b8435cfb71e54062f6c6e99e9ade30b124d5 # v2.2.4
k8s.io/api d2ab659560cb09bd6c9a3011b6468f0025c65e63 # kubernetes-1.16.0-rc.2 k8s.io/api 7643814f1c97f24ccfb38c2b85a7bb3c7f494346 # kubernetes-1.17.1
k8s.io/apimachinery 27d36303b6556f377b4f34e64705fa9024a12b0c # kubernetes-1.16.0-rc.2 k8s.io/apimachinery 79c2a76c473a20cdc4ce59cae4b72529b5d9d16b # kubernetes-1.17.1
k8s.io/apiserver 5669a5603d961de1ecb7a73b85199e4799081334 # kubernetes-1.16.0-rc.2 k8s.io/apiserver 5381f05fcb881d39af12eeecab5645364229300c # kubernetes-1.17.1
k8s.io/client-go 5ff489491ea74e098486c3530bbfa0171dc7bf95 # kubernetes-1.16.0-rc.2 k8s.io/client-go 69012f50f4b0243bccdb82c24402a10224a91f51 # kubernetes-1.17.1
k8s.io/cri-api 608eb1dad4ac015f9d4f36a3fc70ad3e579af892 # kubernetes-1.16.0-rc.2 k8s.io/cri-api 775aa3c1cf7380ba8b7362f5a52f1e6d2e130bb9 # kubernetes-1.17.1
k8s.io/klog 3ca30a56d8a775276f9cdae009ba326fdc05af7f # v0.4.0 k8s.io/klog 2ca9ad30301bf30a8a6e0fa2110db6b8df699a91 # v1.0.0
k8s.io/kubernetes 4cb51f0d2d8392ea12aeae13182b41008b3a268e # v1.16.0-rc.2 k8s.io/kubernetes d224476cd0730baca2b6e357d144171ed74192d6 # v1.17.1
k8s.io/utils c2654d5206da6b7b6ace12841e8f359bb89b443c k8s.io/utils e782cd3c129fc98ee807f3c889c0f26eb7c9daf5
sigs.k8s.io/yaml fd68e9863619f6ec2fdd8625fe1f02e7c877e480 # v1.1.0 sigs.k8s.io/yaml fd68e9863619f6ec2fdd8625fe1f02e7c877e480 # v1.1.0
# zfs dependencies # zfs dependencies

View File

@ -74,6 +74,7 @@ type Iterator struct {
buf []byte buf []byte
head int head int
tail int tail int
depth int
captureStartedAt int captureStartedAt int
captured []byte captured []byte
Error error Error error
@ -88,6 +89,7 @@ func NewIterator(cfg API) *Iterator {
buf: nil, buf: nil,
head: 0, head: 0,
tail: 0, tail: 0,
depth: 0,
} }
} }
@ -99,6 +101,7 @@ func Parse(cfg API, reader io.Reader, bufSize int) *Iterator {
buf: make([]byte, bufSize), buf: make([]byte, bufSize),
head: 0, head: 0,
tail: 0, tail: 0,
depth: 0,
} }
} }
@ -110,6 +113,7 @@ func ParseBytes(cfg API, input []byte) *Iterator {
buf: input, buf: input,
head: 0, head: 0,
tail: len(input), tail: len(input),
depth: 0,
} }
} }
@ -128,6 +132,7 @@ func (iter *Iterator) Reset(reader io.Reader) *Iterator {
iter.reader = reader iter.reader = reader
iter.head = 0 iter.head = 0
iter.tail = 0 iter.tail = 0
iter.depth = 0
return iter return iter
} }
@ -137,6 +142,7 @@ func (iter *Iterator) ResetBytes(input []byte) *Iterator {
iter.buf = input iter.buf = input
iter.head = 0 iter.head = 0
iter.tail = len(input) iter.tail = len(input)
iter.depth = 0
return iter return iter
} }
@ -320,3 +326,24 @@ func (iter *Iterator) Read() interface{} {
return nil return nil
} }
} }
// limit maximum depth of nesting, as allowed by https://tools.ietf.org/html/rfc7159#section-9
const maxDepth = 10000
func (iter *Iterator) incrementDepth() (success bool) {
iter.depth++
if iter.depth <= maxDepth {
return true
}
iter.ReportError("incrementDepth", "exceeded max depth")
return false
}
func (iter *Iterator) decrementDepth() (success bool) {
iter.depth--
if iter.depth >= 0 {
return true
}
iter.ReportError("decrementDepth", "unexpected negative nesting")
return false
}

View File

@ -28,26 +28,32 @@ func (iter *Iterator) ReadArray() (ret bool) {
func (iter *Iterator) ReadArrayCB(callback func(*Iterator) bool) (ret bool) { func (iter *Iterator) ReadArrayCB(callback func(*Iterator) bool) (ret bool) {
c := iter.nextToken() c := iter.nextToken()
if c == '[' { if c == '[' {
if !iter.incrementDepth() {
return false
}
c = iter.nextToken() c = iter.nextToken()
if c != ']' { if c != ']' {
iter.unreadByte() iter.unreadByte()
if !callback(iter) { if !callback(iter) {
iter.decrementDepth()
return false return false
} }
c = iter.nextToken() c = iter.nextToken()
for c == ',' { for c == ',' {
if !callback(iter) { if !callback(iter) {
iter.decrementDepth()
return false return false
} }
c = iter.nextToken() c = iter.nextToken()
} }
if c != ']' { if c != ']' {
iter.ReportError("ReadArrayCB", "expect ] in the end, but found "+string([]byte{c})) iter.ReportError("ReadArrayCB", "expect ] in the end, but found "+string([]byte{c}))
iter.decrementDepth()
return false return false
} }
return true return iter.decrementDepth()
} }
return true return iter.decrementDepth()
} }
if c == 'n' { if c == 'n' {
iter.skipThreeBytes('u', 'l', 'l') iter.skipThreeBytes('u', 'l', 'l')

View File

@ -112,6 +112,9 @@ func (iter *Iterator) ReadObjectCB(callback func(*Iterator, string) bool) bool {
c := iter.nextToken() c := iter.nextToken()
var field string var field string
if c == '{' { if c == '{' {
if !iter.incrementDepth() {
return false
}
c = iter.nextToken() c = iter.nextToken()
if c == '"' { if c == '"' {
iter.unreadByte() iter.unreadByte()
@ -121,6 +124,7 @@ func (iter *Iterator) ReadObjectCB(callback func(*Iterator, string) bool) bool {
iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
} }
if !callback(iter, field) { if !callback(iter, field) {
iter.decrementDepth()
return false return false
} }
c = iter.nextToken() c = iter.nextToken()
@ -131,20 +135,23 @@ func (iter *Iterator) ReadObjectCB(callback func(*Iterator, string) bool) bool {
iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
} }
if !callback(iter, field) { if !callback(iter, field) {
iter.decrementDepth()
return false return false
} }
c = iter.nextToken() c = iter.nextToken()
} }
if c != '}' { if c != '}' {
iter.ReportError("ReadObjectCB", `object not ended with }`) iter.ReportError("ReadObjectCB", `object not ended with }`)
iter.decrementDepth()
return false return false
} }
return true return iter.decrementDepth()
} }
if c == '}' { if c == '}' {
return true return iter.decrementDepth()
} }
iter.ReportError("ReadObjectCB", `expect " after }, but found `+string([]byte{c})) iter.ReportError("ReadObjectCB", `expect " after }, but found `+string([]byte{c}))
iter.decrementDepth()
return false return false
} }
if c == 'n' { if c == 'n' {
@ -159,15 +166,20 @@ func (iter *Iterator) ReadObjectCB(callback func(*Iterator, string) bool) bool {
func (iter *Iterator) ReadMapCB(callback func(*Iterator, string) bool) bool { func (iter *Iterator) ReadMapCB(callback func(*Iterator, string) bool) bool {
c := iter.nextToken() c := iter.nextToken()
if c == '{' { if c == '{' {
if !iter.incrementDepth() {
return false
}
c = iter.nextToken() c = iter.nextToken()
if c == '"' { if c == '"' {
iter.unreadByte() iter.unreadByte()
field := iter.ReadString() field := iter.ReadString()
if iter.nextToken() != ':' { if iter.nextToken() != ':' {
iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c})) iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c}))
iter.decrementDepth()
return false return false
} }
if !callback(iter, field) { if !callback(iter, field) {
iter.decrementDepth()
return false return false
} }
c = iter.nextToken() c = iter.nextToken()
@ -175,23 +187,27 @@ func (iter *Iterator) ReadMapCB(callback func(*Iterator, string) bool) bool {
field = iter.ReadString() field = iter.ReadString()
if iter.nextToken() != ':' { if iter.nextToken() != ':' {
iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c})) iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c}))
iter.decrementDepth()
return false return false
} }
if !callback(iter, field) { if !callback(iter, field) {
iter.decrementDepth()
return false return false
} }
c = iter.nextToken() c = iter.nextToken()
} }
if c != '}' { if c != '}' {
iter.ReportError("ReadMapCB", `object not ended with }`) iter.ReportError("ReadMapCB", `object not ended with }`)
iter.decrementDepth()
return false return false
} }
return true return iter.decrementDepth()
} }
if c == '}' { if c == '}' {
return true return iter.decrementDepth()
} }
iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c})) iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c}))
iter.decrementDepth()
return false return false
} }
if c == 'n' { if c == 'n' {

View File

@ -22,6 +22,9 @@ func (iter *Iterator) skipNumber() {
func (iter *Iterator) skipArray() { func (iter *Iterator) skipArray() {
level := 1 level := 1
if !iter.incrementDepth() {
return
}
for { for {
for i := iter.head; i < iter.tail; i++ { for i := iter.head; i < iter.tail; i++ {
switch iter.buf[i] { switch iter.buf[i] {
@ -31,8 +34,14 @@ func (iter *Iterator) skipArray() {
i = iter.head - 1 // it will be i++ soon i = iter.head - 1 // it will be i++ soon
case '[': // If open symbol, increase level case '[': // If open symbol, increase level
level++ level++
if !iter.incrementDepth() {
return
}
case ']': // If close symbol, increase level case ']': // If close symbol, increase level
level-- level--
if !iter.decrementDepth() {
return
}
// If we have returned to the original level, we're done // If we have returned to the original level, we're done
if level == 0 { if level == 0 {
@ -50,6 +59,10 @@ func (iter *Iterator) skipArray() {
func (iter *Iterator) skipObject() { func (iter *Iterator) skipObject() {
level := 1 level := 1
if !iter.incrementDepth() {
return
}
for { for {
for i := iter.head; i < iter.tail; i++ { for i := iter.head; i < iter.tail; i++ {
switch iter.buf[i] { switch iter.buf[i] {
@ -59,8 +72,14 @@ func (iter *Iterator) skipObject() {
i = iter.head - 1 // it will be i++ soon i = iter.head - 1 // it will be i++ soon
case '{': // If open symbol, increase level case '{': // If open symbol, increase level
level++ level++
if !iter.incrementDepth() {
return
}
case '}': // If close symbol, increase level case '}': // If close symbol, increase level
level-- level--
if !iter.decrementDepth() {
return
}
// If we have returned to the original level, we're done // If we have returned to the original level, we're done
if level == 0 { if level == 0 {

View File

@ -60,6 +60,7 @@ func (b *ctx) append(prefix string) *ctx {
// ReadVal copy the underlying JSON into go interface, same as json.Unmarshal // ReadVal copy the underlying JSON into go interface, same as json.Unmarshal
func (iter *Iterator) ReadVal(obj interface{}) { func (iter *Iterator) ReadVal(obj interface{}) {
depth := iter.depth
cacheKey := reflect2.RTypeOf(obj) cacheKey := reflect2.RTypeOf(obj)
decoder := iter.cfg.getDecoderFromCache(cacheKey) decoder := iter.cfg.getDecoderFromCache(cacheKey)
if decoder == nil { if decoder == nil {
@ -76,6 +77,10 @@ func (iter *Iterator) ReadVal(obj interface{}) {
return return
} }
decoder.Decode(ptr, iter) decoder.Decode(ptr, iter)
if iter.depth != depth {
iter.ReportError("ReadVal", "unexpected mismatched nesting")
return
}
} }
// WriteVal copy the go interface into underlying JSON, same as json.Marshal // WriteVal copy the go interface into underlying JSON, same as json.Marshal

View File

@ -341,10 +341,10 @@ func describeStruct(ctx *ctx, typ reflect2.Type) *StructDescriptor {
if ctx.onlyTaggedField && !hastag && !field.Anonymous() { if ctx.onlyTaggedField && !hastag && !field.Anonymous() {
continue continue
} }
tagParts := strings.Split(tag, ",")
if tag == "-" { if tag == "-" {
continue continue
} }
tagParts := strings.Split(tag, ",")
if field.Anonymous() && (tag == "" || tagParts[0] == "") { if field.Anonymous() && (tag == "" || tagParts[0] == "") {
if field.Type().Kind() == reflect.Struct { if field.Type().Kind() == reflect.Struct {
structDescriptor := describeStruct(ctx, field.Type()) structDescriptor := describeStruct(ctx, field.Type())

View File

@ -249,6 +249,10 @@ type mapEncoder struct {
} }
func (encoder *mapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { func (encoder *mapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
if *(*unsafe.Pointer)(ptr) == nil {
stream.WriteNil()
return
}
stream.WriteObjectStart() stream.WriteObjectStart()
iter := encoder.mapType.UnsafeIterate(ptr) iter := encoder.mapType.UnsafeIterate(ptr)
for i := 0; iter.HasNext(); i++ { for i := 0; iter.HasNext(); i++ {

View File

@ -3,8 +3,9 @@ package jsoniter
import ( import (
"encoding" "encoding"
"encoding/json" "encoding/json"
"github.com/modern-go/reflect2"
"unsafe" "unsafe"
"github.com/modern-go/reflect2"
) )
var marshalerType = reflect2.TypeOfPtr((*json.Marshaler)(nil)).Elem() var marshalerType = reflect2.TypeOfPtr((*json.Marshaler)(nil)).Elem()
@ -93,10 +94,17 @@ func (encoder *marshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
stream.WriteNil() stream.WriteNil()
return return
} }
bytes, err := json.Marshal(obj) marshaler := obj.(json.Marshaler)
bytes, err := marshaler.MarshalJSON()
if err != nil { if err != nil {
stream.Error = err stream.Error = err
} else { } else {
// html escape was already done by jsoniter
// but the extra '\n' should be trimed
l := len(bytes)
if l > 0 && bytes[l-1] == '\n' {
bytes = bytes[:l-1]
}
stream.Write(bytes) stream.Write(bytes)
} }
} }

View File

@ -500,6 +500,9 @@ func (decoder *generalStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator)
if !iter.readObjectStart() { if !iter.readObjectStart() {
return return
} }
if !iter.incrementDepth() {
return
}
var c byte var c byte
for c = ','; c == ','; c = iter.nextToken() { for c = ','; c == ','; c = iter.nextToken() {
decoder.decodeOneField(ptr, iter) decoder.decodeOneField(ptr, iter)
@ -510,6 +513,7 @@ func (decoder *generalStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator)
if c != '}' { if c != '}' {
iter.ReportError("struct Decode", `expect }, but found `+string([]byte{c})) iter.ReportError("struct Decode", `expect }, but found `+string([]byte{c}))
} }
iter.decrementDepth()
} }
func (decoder *generalStructDecoder) decodeOneField(ptr unsafe.Pointer, iter *Iterator) { func (decoder *generalStructDecoder) decodeOneField(ptr unsafe.Pointer, iter *Iterator) {
@ -571,6 +575,9 @@ func (decoder *oneFieldStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator)
if !iter.readObjectStart() { if !iter.readObjectStart() {
return return
} }
if !iter.incrementDepth() {
return
}
for { for {
if iter.readFieldHash() == decoder.fieldHash { if iter.readFieldHash() == decoder.fieldHash {
decoder.fieldDecoder.Decode(ptr, iter) decoder.fieldDecoder.Decode(ptr, iter)
@ -584,6 +591,7 @@ func (decoder *oneFieldStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator)
if iter.Error != nil && iter.Error != io.EOF { if iter.Error != nil && iter.Error != io.EOF {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
} }
iter.decrementDepth()
} }
type twoFieldsStructDecoder struct { type twoFieldsStructDecoder struct {
@ -598,6 +606,9 @@ func (decoder *twoFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
if !iter.readObjectStart() { if !iter.readObjectStart() {
return return
} }
if !iter.incrementDepth() {
return
}
for { for {
switch iter.readFieldHash() { switch iter.readFieldHash() {
case decoder.fieldHash1: case decoder.fieldHash1:
@ -614,6 +625,7 @@ func (decoder *twoFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
if iter.Error != nil && iter.Error != io.EOF { if iter.Error != nil && iter.Error != io.EOF {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
} }
iter.decrementDepth()
} }
type threeFieldsStructDecoder struct { type threeFieldsStructDecoder struct {
@ -630,6 +642,9 @@ func (decoder *threeFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
if !iter.readObjectStart() { if !iter.readObjectStart() {
return return
} }
if !iter.incrementDepth() {
return
}
for { for {
switch iter.readFieldHash() { switch iter.readFieldHash() {
case decoder.fieldHash1: case decoder.fieldHash1:
@ -648,6 +663,7 @@ func (decoder *threeFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
if iter.Error != nil && iter.Error != io.EOF { if iter.Error != nil && iter.Error != io.EOF {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
} }
iter.decrementDepth()
} }
type fourFieldsStructDecoder struct { type fourFieldsStructDecoder struct {
@ -666,6 +682,9 @@ func (decoder *fourFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
if !iter.readObjectStart() { if !iter.readObjectStart() {
return return
} }
if !iter.incrementDepth() {
return
}
for { for {
switch iter.readFieldHash() { switch iter.readFieldHash() {
case decoder.fieldHash1: case decoder.fieldHash1:
@ -686,6 +705,7 @@ func (decoder *fourFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
if iter.Error != nil && iter.Error != io.EOF { if iter.Error != nil && iter.Error != io.EOF {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
} }
iter.decrementDepth()
} }
type fiveFieldsStructDecoder struct { type fiveFieldsStructDecoder struct {
@ -706,6 +726,9 @@ func (decoder *fiveFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
if !iter.readObjectStart() { if !iter.readObjectStart() {
return return
} }
if !iter.incrementDepth() {
return
}
for { for {
switch iter.readFieldHash() { switch iter.readFieldHash() {
case decoder.fieldHash1: case decoder.fieldHash1:
@ -728,6 +751,7 @@ func (decoder *fiveFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
if iter.Error != nil && iter.Error != io.EOF { if iter.Error != nil && iter.Error != io.EOF {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
} }
iter.decrementDepth()
} }
type sixFieldsStructDecoder struct { type sixFieldsStructDecoder struct {
@ -750,6 +774,9 @@ func (decoder *sixFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
if !iter.readObjectStart() { if !iter.readObjectStart() {
return return
} }
if !iter.incrementDepth() {
return
}
for { for {
switch iter.readFieldHash() { switch iter.readFieldHash() {
case decoder.fieldHash1: case decoder.fieldHash1:
@ -774,6 +801,7 @@ func (decoder *sixFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
if iter.Error != nil && iter.Error != io.EOF { if iter.Error != nil && iter.Error != io.EOF {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
} }
iter.decrementDepth()
} }
type sevenFieldsStructDecoder struct { type sevenFieldsStructDecoder struct {
@ -798,6 +826,9 @@ func (decoder *sevenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
if !iter.readObjectStart() { if !iter.readObjectStart() {
return return
} }
if !iter.incrementDepth() {
return
}
for { for {
switch iter.readFieldHash() { switch iter.readFieldHash() {
case decoder.fieldHash1: case decoder.fieldHash1:
@ -824,6 +855,7 @@ func (decoder *sevenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
if iter.Error != nil && iter.Error != io.EOF { if iter.Error != nil && iter.Error != io.EOF {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
} }
iter.decrementDepth()
} }
type eightFieldsStructDecoder struct { type eightFieldsStructDecoder struct {
@ -850,6 +882,9 @@ func (decoder *eightFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
if !iter.readObjectStart() { if !iter.readObjectStart() {
return return
} }
if !iter.incrementDepth() {
return
}
for { for {
switch iter.readFieldHash() { switch iter.readFieldHash() {
case decoder.fieldHash1: case decoder.fieldHash1:
@ -878,6 +913,7 @@ func (decoder *eightFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
if iter.Error != nil && iter.Error != io.EOF { if iter.Error != nil && iter.Error != io.EOF {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
} }
iter.decrementDepth()
} }
type nineFieldsStructDecoder struct { type nineFieldsStructDecoder struct {
@ -906,6 +942,9 @@ func (decoder *nineFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
if !iter.readObjectStart() { if !iter.readObjectStart() {
return return
} }
if !iter.incrementDepth() {
return
}
for { for {
switch iter.readFieldHash() { switch iter.readFieldHash() {
case decoder.fieldHash1: case decoder.fieldHash1:
@ -936,6 +975,7 @@ func (decoder *nineFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
if iter.Error != nil && iter.Error != io.EOF { if iter.Error != nil && iter.Error != io.EOF {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
} }
iter.decrementDepth()
} }
type tenFieldsStructDecoder struct { type tenFieldsStructDecoder struct {
@ -966,6 +1006,9 @@ func (decoder *tenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
if !iter.readObjectStart() { if !iter.readObjectStart() {
return return
} }
if !iter.incrementDepth() {
return
}
for { for {
switch iter.readFieldHash() { switch iter.readFieldHash() {
case decoder.fieldHash1: case decoder.fieldHash1:
@ -998,6 +1041,7 @@ func (decoder *tenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
if iter.Error != nil && iter.Error != io.EOF { if iter.Error != nil && iter.Error != io.EOF {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
} }
iter.decrementDepth()
} }
type structFieldDecoder struct { type structFieldDecoder struct {

1
vendor/golang.org/x/time/go.mod generated vendored Normal file
View File

@ -0,0 +1 @@
module golang.org/x/time

2
vendor/gopkg.in/inf.v0/dec.go generated vendored
View File

@ -104,7 +104,7 @@ var bigInt = [...]*big.Int{
var exp10cache [64]big.Int = func() [64]big.Int { var exp10cache [64]big.Int = func() [64]big.Int {
e10, e10i := [64]big.Int{}, bigInt[1] e10, e10i := [64]big.Int{}, bigInt[1]
for i, _ := range e10 { for i := range e10 {
e10[i].Set(e10i) e10[i].Set(e10i)
e10i = new(big.Int).Mul(e10i, bigInt[10]) e10i = new(big.Int).Mul(e10i, bigInt[10])
} }

38
vendor/gopkg.in/yaml.v2/decode.go generated vendored
View File

@ -229,6 +229,10 @@ type decoder struct {
mapType reflect.Type mapType reflect.Type
terrors []string terrors []string
strict bool strict bool
decodeCount int
aliasCount int
aliasDepth int
} }
var ( var (
@ -314,7 +318,39 @@ func (d *decoder) prepare(n *node, out reflect.Value) (newout reflect.Value, unm
return out, false, false return out, false, false
} }
const (
// 400,000 decode operations is ~500kb of dense object declarations, or ~5kb of dense object declarations with 10000% alias expansion
alias_ratio_range_low = 400000
// 4,000,000 decode operations is ~5MB of dense object declarations, or ~4.5MB of dense object declarations with 10% alias expansion
alias_ratio_range_high = 4000000
// alias_ratio_range is the range over which we scale allowed alias ratios
alias_ratio_range = float64(alias_ratio_range_high - alias_ratio_range_low)
)
func allowedAliasRatio(decodeCount int) float64 {
switch {
case decodeCount <= alias_ratio_range_low:
// allow 99% to come from alias expansion for small-to-medium documents
return 0.99
case decodeCount >= alias_ratio_range_high:
// allow 10% to come from alias expansion for very large documents
return 0.10
default:
// scale smoothly from 99% down to 10% over the range.
// this maps to 396,000 - 400,000 allowed alias-driven decodes over the range.
// 400,000 decode operations is ~100MB of allocations in worst-case scenarios (single-item maps).
return 0.99 - 0.89*(float64(decodeCount-alias_ratio_range_low)/alias_ratio_range)
}
}
func (d *decoder) unmarshal(n *node, out reflect.Value) (good bool) { func (d *decoder) unmarshal(n *node, out reflect.Value) (good bool) {
d.decodeCount++
if d.aliasDepth > 0 {
d.aliasCount++
}
if d.aliasCount > 100 && d.decodeCount > 1000 && float64(d.aliasCount)/float64(d.decodeCount) > allowedAliasRatio(d.decodeCount) {
failf("document contains excessive aliasing")
}
switch n.kind { switch n.kind {
case documentNode: case documentNode:
return d.document(n, out) return d.document(n, out)
@ -353,7 +389,9 @@ func (d *decoder) alias(n *node, out reflect.Value) (good bool) {
failf("anchor '%s' value contains itself", n.value) failf("anchor '%s' value contains itself", n.value)
} }
d.aliases[n] = true d.aliases[n] = true
d.aliasDepth++
good = d.unmarshal(n.alias, out) good = d.unmarshal(n.alias, out)
d.aliasDepth--
delete(d.aliases, n) delete(d.aliases, n)
return good return good
} }

2
vendor/gopkg.in/yaml.v2/resolve.go generated vendored
View File

@ -81,7 +81,7 @@ func resolvableTag(tag string) bool {
return false return false
} }
var yamlStyleFloat = regexp.MustCompile(`^[-+]?[0-9]*\.?[0-9]+([eE][-+][0-9]+)?$`) var yamlStyleFloat = regexp.MustCompile(`^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$`)
func resolve(tag string, in string) (rtag string, out interface{}) { func resolve(tag string, in string) (rtag string, out interface{}) {
if !resolvableTag(tag) { if !resolvableTag(tag) {

16
vendor/gopkg.in/yaml.v2/scannerc.go generated vendored
View File

@ -906,6 +906,9 @@ func yaml_parser_remove_simple_key(parser *yaml_parser_t) bool {
return true return true
} }
// max_flow_level limits the flow_level
const max_flow_level = 10000
// Increase the flow level and resize the simple key list if needed. // Increase the flow level and resize the simple key list if needed.
func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool { func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
// Reset the simple key on the next level. // Reset the simple key on the next level.
@ -913,6 +916,11 @@ func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
// Increase the flow level. // Increase the flow level.
parser.flow_level++ parser.flow_level++
if parser.flow_level > max_flow_level {
return yaml_parser_set_scanner_error(parser,
"while increasing flow level", parser.simple_keys[len(parser.simple_keys)-1].mark,
fmt.Sprintf("exceeded max depth of %d", max_flow_level))
}
return true return true
} }
@ -925,6 +933,9 @@ func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {
return true return true
} }
// max_indents limits the indents stack size
const max_indents = 10000
// Push the current indentation level to the stack and set the new level // Push the current indentation level to the stack and set the new level
// the current column is greater than the indentation level. In this case, // the current column is greater than the indentation level. In this case,
// append or insert the specified token into the token queue. // append or insert the specified token into the token queue.
@ -939,6 +950,11 @@ func yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml
// indentation level. // indentation level.
parser.indents = append(parser.indents, parser.indent) parser.indents = append(parser.indents, parser.indent)
parser.indent = column parser.indent = column
if len(parser.indents) > max_indents {
return yaml_parser_set_scanner_error(parser,
"while increasing indent level", parser.simple_keys[len(parser.simple_keys)-1].mark,
fmt.Sprintf("exceeded max depth of %d", max_indents))
}
// Create a token and insert it into the queue. // Create a token and insert it into the queue.
token := yaml_token_t{ token := yaml_token_t{

File diff suppressed because it is too large Load Diff

View File

@ -1142,7 +1142,7 @@ message EnvVar {
// EnvVarSource represents a source for the value of an EnvVar. // EnvVarSource represents a source for the value of an EnvVar.
message EnvVarSource { message EnvVarSource {
// Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, // Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations,
// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP. // spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
// +optional // +optional
optional ObjectFieldSelector fieldRef = 1; optional ObjectFieldSelector fieldRef = 1;
@ -3145,6 +3145,15 @@ message PodLogOptions {
// slightly more or slightly less than the specified limit. // slightly more or slightly less than the specified limit.
// +optional // +optional
optional int64 limitBytes = 8; optional int64 limitBytes = 8;
// insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the
// serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver
// and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real
// kubelet. If the kubelet is configured to verify the apiserver's TLS credentials, it does not mean the
// connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept
// the actual log data coming from the real kubelet).
// +optional
optional bool insecureSkipTLSVerifyBackend = 9;
} }
// PodPortForwardOptions is the query options to a Pod's port forward call // PodPortForwardOptions is the query options to a Pod's port forward call
@ -3375,7 +3384,6 @@ message PodSpec {
// in the same pod, and the first process in each container will not be assigned PID 1. // in the same pod, and the first process in each container will not be assigned PID 1.
// HostPID and ShareProcessNamespace cannot both be set. // HostPID and ShareProcessNamespace cannot both be set.
// Optional: Default to false. // Optional: Default to false.
// This field is beta-level and may be disabled with the PodShareProcessNamespace feature.
// +k8s:conversion-gen=false // +k8s:conversion-gen=false
// +optional // +optional
optional bool shareProcessNamespace = 27; optional bool shareProcessNamespace = 27;
@ -4733,6 +4741,21 @@ message ServiceSpec {
// cluster (e.g. IPv6 in IPv4 only cluster) is an error condition and will fail during clusterIP assignment. // cluster (e.g. IPv6 in IPv4 only cluster) is an error condition and will fail during clusterIP assignment.
// +optional // +optional
optional string ipFamily = 15; optional string ipFamily = 15;
// topologyKeys is a preference-order list of topology keys which
// implementations of services should use to preferentially sort endpoints
// when accessing this Service, it can not be used at the same time as
// externalTrafficPolicy=Local.
// Topology keys must be valid label keys and at most 16 keys may be specified.
// Endpoints are chosen based on the first topology key with available backends.
// If this field is specified and all entries have no backends that match
// the topology of the client, the service has no backends for that client
// and connections should fail.
// The special value "*" may be used to mean "any topology". This catch-all
// value, if used, only makes sense as the last value in the list.
// If this is not specified or empty, no topology constraints will be applied.
// +optional
repeated string topologyKeys = 16;
} }
// ServiceStatus represents the current status of a service. // ServiceStatus represents the current status of a service.
@ -5032,7 +5055,6 @@ message VolumeMount {
// Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. // Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment.
// Defaults to "" (volume's root). // Defaults to "" (volume's root).
// SubPathExpr and SubPath are mutually exclusive. // SubPathExpr and SubPath are mutually exclusive.
// This field is beta in 1.15.
// +optional // +optional
optional string subPathExpr = 6; optional string subPathExpr = 6;
} }
@ -5249,7 +5271,7 @@ message WindowsSecurityContextOptions {
// Defaults to the user specified in image metadata if unspecified. // Defaults to the user specified in image metadata if unspecified.
// May also be set in PodSecurityContext. If set in both SecurityContext and // May also be set in PodSecurityContext. If set in both SecurityContext and
// PodSecurityContext, the value specified in SecurityContext takes precedence. // PodSecurityContext, the value specified in SecurityContext takes precedence.
// This field is alpha-level and it is only honored by servers that enable the WindowsRunAsUserName feature flag. // This field is beta-level and may be disabled with the WindowsRunAsUserName feature flag.
// +optional // +optional
optional string runAsUserName = 3; optional string runAsUserName = 3;
} }

54
vendor/k8s.io/api/core/v1/types.go generated vendored
View File

@ -30,6 +30,8 @@ const (
NamespaceAll string = "" NamespaceAll string = ""
// NamespaceNodeLease is the namespace where we place node lease objects (used for node heartbeats) // NamespaceNodeLease is the namespace where we place node lease objects (used for node heartbeats)
NamespaceNodeLease string = "kube-node-lease" NamespaceNodeLease string = "kube-node-lease"
// TopologyKeyAny is the service topology key that matches any node
TopologyKeyAny string = "*"
) )
// Volume represents a named volume in a pod that may be accessed by any container in the pod. // Volume represents a named volume in a pod that may be accessed by any container in the pod.
@ -1784,7 +1786,6 @@ type VolumeMount struct {
// Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. // Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment.
// Defaults to "" (volume's root). // Defaults to "" (volume's root).
// SubPathExpr and SubPath are mutually exclusive. // SubPathExpr and SubPath are mutually exclusive.
// This field is beta in 1.15.
// +optional // +optional
SubPathExpr string `json:"subPathExpr,omitempty" protobuf:"bytes,6,opt,name=subPathExpr"` SubPathExpr string `json:"subPathExpr,omitempty" protobuf:"bytes,6,opt,name=subPathExpr"`
} }
@ -1847,7 +1848,7 @@ type EnvVar struct {
// EnvVarSource represents a source for the value of an EnvVar. // EnvVarSource represents a source for the value of an EnvVar.
type EnvVarSource struct { type EnvVarSource struct {
// Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, // Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations,
// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP. // spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
// +optional // +optional
FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty" protobuf:"bytes,1,opt,name=fieldRef"` FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty" protobuf:"bytes,1,opt,name=fieldRef"`
// Selects a resource of the container: only resources limits and requests // Selects a resource of the container: only resources limits and requests
@ -2941,7 +2942,6 @@ type PodSpec struct {
// in the same pod, and the first process in each container will not be assigned PID 1. // in the same pod, and the first process in each container will not be assigned PID 1.
// HostPID and ShareProcessNamespace cannot both be set. // HostPID and ShareProcessNamespace cannot both be set.
// Optional: Default to false. // Optional: Default to false.
// This field is beta-level and may be disabled with the PodShareProcessNamespace feature.
// +k8s:conversion-gen=false // +k8s:conversion-gen=false
// +optional // +optional
ShareProcessNamespace *bool `json:"shareProcessNamespace,omitempty" protobuf:"varint,27,opt,name=shareProcessNamespace"` ShareProcessNamespace *bool `json:"shareProcessNamespace,omitempty" protobuf:"varint,27,opt,name=shareProcessNamespace"`
@ -3828,6 +3828,8 @@ const (
IPv4Protocol IPFamily = "IPv4" IPv4Protocol IPFamily = "IPv4"
// IPv6Protocol indicates that this IP is IPv6 protocol // IPv6Protocol indicates that this IP is IPv6 protocol
IPv6Protocol IPFamily = "IPv6" IPv6Protocol IPFamily = "IPv6"
// MaxServiceTopologyKeys is the largest number of topology keys allowed on a service
MaxServiceTopologyKeys = 16
) )
// ServiceSpec describes the attributes that a user creates on a service. // ServiceSpec describes the attributes that a user creates on a service.
@ -3942,6 +3944,7 @@ type ServiceSpec struct {
// of peer discovery. // of peer discovery.
// +optional // +optional
PublishNotReadyAddresses bool `json:"publishNotReadyAddresses,omitempty" protobuf:"varint,13,opt,name=publishNotReadyAddresses"` PublishNotReadyAddresses bool `json:"publishNotReadyAddresses,omitempty" protobuf:"varint,13,opt,name=publishNotReadyAddresses"`
// sessionAffinityConfig contains the configurations of session affinity. // sessionAffinityConfig contains the configurations of session affinity.
// +optional // +optional
SessionAffinityConfig *SessionAffinityConfig `json:"sessionAffinityConfig,omitempty" protobuf:"bytes,14,opt,name=sessionAffinityConfig"` SessionAffinityConfig *SessionAffinityConfig `json:"sessionAffinityConfig,omitempty" protobuf:"bytes,14,opt,name=sessionAffinityConfig"`
@ -3955,6 +3958,21 @@ type ServiceSpec struct {
// cluster (e.g. IPv6 in IPv4 only cluster) is an error condition and will fail during clusterIP assignment. // cluster (e.g. IPv6 in IPv4 only cluster) is an error condition and will fail during clusterIP assignment.
// +optional // +optional
IPFamily *IPFamily `json:"ipFamily,omitempty" protobuf:"bytes,15,opt,name=ipFamily,Configcasttype=IPFamily"` IPFamily *IPFamily `json:"ipFamily,omitempty" protobuf:"bytes,15,opt,name=ipFamily,Configcasttype=IPFamily"`
// topologyKeys is a preference-order list of topology keys which
// implementations of services should use to preferentially sort endpoints
// when accessing this Service, it can not be used at the same time as
// externalTrafficPolicy=Local.
// Topology keys must be valid label keys and at most 16 keys may be specified.
// Endpoints are chosen based on the first topology key with available backends.
// If this field is specified and all entries have no backends that match
// the topology of the client, the service has no backends for that client
// and connections should fail.
// The special value "*" may be used to mean "any topology". This catch-all
// value, if used, only makes sense as the last value in the list.
// If this is not specified or empty, no topology constraints will be applied.
// +optional
TopologyKeys []string `json:"topologyKeys,omitempty" protobuf:"bytes,16,opt,name=topologyKeys"`
} }
// ServicePort contains information on service's port. // ServicePort contains information on service's port.
@ -4233,7 +4251,7 @@ type NodeSpec struct {
// Deprecated. Not all kubelets will set this field. Remove field after 1.13. // Deprecated. Not all kubelets will set this field. Remove field after 1.13.
// see: https://issues.k8s.io/61966 // see: https://issues.k8s.io/61966
// +optional // +optional
DoNotUse_ExternalID string `json:"externalID,omitempty" protobuf:"bytes,2,opt,name=externalID"` DoNotUseExternalID string `json:"externalID,omitempty" protobuf:"bytes,2,opt,name=externalID"`
} }
// NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. // NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil.
@ -4660,6 +4678,12 @@ const (
NamespaceTerminating NamespacePhase = "Terminating" NamespaceTerminating NamespacePhase = "Terminating"
) )
const (
// NamespaceTerminatingCause is returned as a defaults.cause item when a change is
// forbidden due to the namespace being terminated.
NamespaceTerminatingCause metav1.CauseType = "NamespaceTerminating"
)
type NamespaceConditionType string type NamespaceConditionType string
// These are valid conditions of a namespace. // These are valid conditions of a namespace.
@ -4670,6 +4694,10 @@ const (
NamespaceDeletionContentFailure NamespaceConditionType = "NamespaceDeletionContentFailure" NamespaceDeletionContentFailure NamespaceConditionType = "NamespaceDeletionContentFailure"
// NamespaceDeletionGVParsingFailure contains information about namespace deleter errors parsing GV for legacy types. // NamespaceDeletionGVParsingFailure contains information about namespace deleter errors parsing GV for legacy types.
NamespaceDeletionGVParsingFailure NamespaceConditionType = "NamespaceDeletionGroupVersionParsingFailure" NamespaceDeletionGVParsingFailure NamespaceConditionType = "NamespaceDeletionGroupVersionParsingFailure"
// NamespaceContentRemaining contains information about resources remaining in a namespace.
NamespaceContentRemaining NamespaceConditionType = "NamespaceContentRemaining"
// NamespaceFinalizersRemaining contains information about which finalizers are on resources remaining in a namespace.
NamespaceFinalizersRemaining NamespaceConditionType = "NamespaceFinalizersRemaining"
) )
// NamespaceCondition contains details about state of namespace. // NamespaceCondition contains details about state of namespace.
@ -4765,6 +4793,7 @@ type Preconditions struct {
UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodLogOptions is the query options for a Pod's logs REST call. // PodLogOptions is the query options for a Pod's logs REST call.
@ -4805,8 +4834,18 @@ type PodLogOptions struct {
// slightly more or slightly less than the specified limit. // slightly more or slightly less than the specified limit.
// +optional // +optional
LimitBytes *int64 `json:"limitBytes,omitempty" protobuf:"varint,8,opt,name=limitBytes"` LimitBytes *int64 `json:"limitBytes,omitempty" protobuf:"varint,8,opt,name=limitBytes"`
// insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the
// serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver
// and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real
// kubelet. If the kubelet is configured to verify the apiserver's TLS credentials, it does not mean the
// connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept
// the actual log data coming from the real kubelet).
// +optional
InsecureSkipTLSVerifyBackend bool `json:"insecureSkipTLSVerifyBackend,omitempty" protobuf:"varint,9,opt,name=insecureSkipTLSVerifyBackend"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodAttachOptions is the query options to a Pod's remote attach call. // PodAttachOptions is the query options to a Pod's remote attach call.
@ -4844,6 +4883,7 @@ type PodAttachOptions struct {
Container string `json:"container,omitempty" protobuf:"bytes,5,opt,name=container"` Container string `json:"container,omitempty" protobuf:"bytes,5,opt,name=container"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodExecOptions is the query options to a Pod's remote exec call. // PodExecOptions is the query options to a Pod's remote exec call.
@ -4882,6 +4922,7 @@ type PodExecOptions struct {
Command []string `json:"command" protobuf:"bytes,6,rep,name=command"` Command []string `json:"command" protobuf:"bytes,6,rep,name=command"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodPortForwardOptions is the query options to a Pod's port forward call // PodPortForwardOptions is the query options to a Pod's port forward call
@ -4899,6 +4940,7 @@ type PodPortForwardOptions struct {
Ports []int32 `json:"ports,omitempty" protobuf:"varint,1,rep,name=ports"` Ports []int32 `json:"ports,omitempty" protobuf:"varint,1,rep,name=ports"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodProxyOptions is the query options to a Pod's proxy call. // PodProxyOptions is the query options to a Pod's proxy call.
@ -4910,6 +4952,7 @@ type PodProxyOptions struct {
Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// NodeProxyOptions is the query options to a Node's proxy call. // NodeProxyOptions is the query options to a Node's proxy call.
@ -4921,6 +4964,7 @@ type NodeProxyOptions struct {
Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ServiceProxyOptions is the query options to a Service's proxy call. // ServiceProxyOptions is the query options to a Service's proxy call.
@ -5764,7 +5808,7 @@ type WindowsSecurityContextOptions struct {
// Defaults to the user specified in image metadata if unspecified. // Defaults to the user specified in image metadata if unspecified.
// May also be set in PodSecurityContext. If set in both SecurityContext and // May also be set in PodSecurityContext. If set in both SecurityContext and
// PodSecurityContext, the value specified in SecurityContext takes precedence. // PodSecurityContext, the value specified in SecurityContext takes precedence.
// This field is alpha-level and it is only honored by servers that enable the WindowsRunAsUserName feature flag. // This field is beta-level and may be disabled with the WindowsRunAsUserName feature flag.
// +optional // +optional
RunAsUserName *string `json:"runAsUserName,omitempty" protobuf:"bytes,3,opt,name=runAsUserName"` RunAsUserName *string `json:"runAsUserName,omitempty" protobuf:"bytes,3,opt,name=runAsUserName"`
} }

View File

@ -566,7 +566,7 @@ func (EnvVar) SwaggerDoc() map[string]string {
var map_EnvVarSource = map[string]string{ var map_EnvVarSource = map[string]string{
"": "EnvVarSource represents a source for the value of an EnvVar.", "": "EnvVarSource represents a source for the value of an EnvVar.",
"fieldRef": "Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP.", "fieldRef": "Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.",
"resourceFieldRef": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.", "resourceFieldRef": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.",
"configMapKeyRef": "Selects a key of a ConfigMap.", "configMapKeyRef": "Selects a key of a ConfigMap.",
"secretKeyRef": "Selects a key of a secret in the pod's namespace", "secretKeyRef": "Selects a key of a secret in the pod's namespace",
@ -1528,15 +1528,16 @@ func (PodList) SwaggerDoc() map[string]string {
} }
var map_PodLogOptions = map[string]string{ var map_PodLogOptions = map[string]string{
"": "PodLogOptions is the query options for a Pod's logs REST call.", "": "PodLogOptions is the query options for a Pod's logs REST call.",
"container": "The container for which to stream logs. Defaults to only container if there is one container in the pod.", "container": "The container for which to stream logs. Defaults to only container if there is one container in the pod.",
"follow": "Follow the log stream of the pod. Defaults to false.", "follow": "Follow the log stream of the pod. Defaults to false.",
"previous": "Return previous terminated container logs. Defaults to false.", "previous": "Return previous terminated container logs. Defaults to false.",
"sinceSeconds": "A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.", "sinceSeconds": "A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.",
"sinceTime": "An RFC3339 timestamp from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.", "sinceTime": "An RFC3339 timestamp from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.",
"timestamps": "If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false.", "timestamps": "If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false.",
"tailLines": "If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime", "tailLines": "If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime",
"limitBytes": "If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit.", "limitBytes": "If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit.",
"insecureSkipTLSVerifyBackend": "insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver's TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet).",
} }
func (PodLogOptions) SwaggerDoc() map[string]string { func (PodLogOptions) SwaggerDoc() map[string]string {
@ -1613,7 +1614,7 @@ var map_PodSpec = map[string]string{
"hostNetwork": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.", "hostNetwork": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.",
"hostPID": "Use the host's pid namespace. Optional: Default to false.", "hostPID": "Use the host's pid namespace. Optional: Default to false.",
"hostIPC": "Use the host's ipc namespace. Optional: Default to false.", "hostIPC": "Use the host's ipc namespace. Optional: Default to false.",
"shareProcessNamespace": "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false. This field is beta-level and may be disabled with the PodShareProcessNamespace feature.", "shareProcessNamespace": "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.",
"securityContext": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", "securityContext": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.",
"imagePullSecrets": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", "imagePullSecrets": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod",
"hostname": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", "hostname": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.",
@ -2203,6 +2204,7 @@ var map_ServiceSpec = map[string]string{
"publishNotReadyAddresses": "publishNotReadyAddresses, when set to true, indicates that DNS implementations must publish the notReadyAddresses of subsets for the Endpoints associated with the Service. The default value is false. The primary use case for setting this field is to use a StatefulSet's Headless Service to propagate SRV records for its Pods without respect to their readiness for purpose of peer discovery.", "publishNotReadyAddresses": "publishNotReadyAddresses, when set to true, indicates that DNS implementations must publish the notReadyAddresses of subsets for the Endpoints associated with the Service. The default value is false. The primary use case for setting this field is to use a StatefulSet's Headless Service to propagate SRV records for its Pods without respect to their readiness for purpose of peer discovery.",
"sessionAffinityConfig": "sessionAffinityConfig contains the configurations of session affinity.", "sessionAffinityConfig": "sessionAffinityConfig contains the configurations of session affinity.",
"ipFamily": "ipFamily specifies whether this Service has a preference for a particular IP family (e.g. IPv4 vs. IPv6). If a specific IP family is requested, the clusterIP field will be allocated from that family, if it is available in the cluster. If no IP family is requested, the cluster's primary IP family will be used. Other IP fields (loadBalancerIP, loadBalancerSourceRanges, externalIPs) and controllers which allocate external load-balancers should use the same IP family. Endpoints for this Service will be of this family. This field is immutable after creation. Assigning a ServiceIPFamily not available in the cluster (e.g. IPv6 in IPv4 only cluster) is an error condition and will fail during clusterIP assignment.", "ipFamily": "ipFamily specifies whether this Service has a preference for a particular IP family (e.g. IPv4 vs. IPv6). If a specific IP family is requested, the clusterIP field will be allocated from that family, if it is available in the cluster. If no IP family is requested, the cluster's primary IP family will be used. Other IP fields (loadBalancerIP, loadBalancerSourceRanges, externalIPs) and controllers which allocate external load-balancers should use the same IP family. Endpoints for this Service will be of this family. This field is immutable after creation. Assigning a ServiceIPFamily not available in the cluster (e.g. IPv6 in IPv4 only cluster) is an error condition and will fail during clusterIP assignment.",
"topologyKeys": "topologyKeys is a preference-order list of topology keys which implementations of services should use to preferentially sort endpoints when accessing this Service, it can not be used at the same time as externalTrafficPolicy=Local. Topology keys must be valid label keys and at most 16 keys may be specified. Endpoints are chosen based on the first topology key with available backends. If this field is specified and all entries have no backends that match the topology of the client, the service has no backends for that client and connections should fail. The special value \"*\" may be used to mean \"any topology\". This catch-all value, if used, only makes sense as the last value in the list. If this is not specified or empty, no topology constraints will be applied.",
} }
func (ServiceSpec) SwaggerDoc() map[string]string { func (ServiceSpec) SwaggerDoc() map[string]string {
@ -2366,7 +2368,7 @@ var map_VolumeMount = map[string]string{
"mountPath": "Path within the container at which the volume should be mounted. Must not contain ':'.", "mountPath": "Path within the container at which the volume should be mounted. Must not contain ':'.",
"subPath": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).", "subPath": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).",
"mountPropagation": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.", "mountPropagation": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.",
"subPathExpr": "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive. This field is beta in 1.15.", "subPathExpr": "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.",
} }
func (VolumeMount) SwaggerDoc() map[string]string { func (VolumeMount) SwaggerDoc() map[string]string {
@ -2456,7 +2458,7 @@ var map_WindowsSecurityContextOptions = map[string]string{
"": "WindowsSecurityContextOptions contain Windows-specific options and credentials.", "": "WindowsSecurityContextOptions contain Windows-specific options and credentials.",
"gmsaCredentialSpecName": "GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.", "gmsaCredentialSpecName": "GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.",
"gmsaCredentialSpec": "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.", "gmsaCredentialSpec": "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.",
"runAsUserName": "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. This field is alpha-level and it is only honored by servers that enable the WindowsRunAsUserName feature flag.", "runAsUserName": "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. This field is beta-level and may be disabled with the WindowsRunAsUserName feature flag.",
} }
func (WindowsSecurityContextOptions) SwaggerDoc() map[string]string { func (WindowsSecurityContextOptions) SwaggerDoc() map[string]string {

View File

@ -17,15 +17,23 @@ limitations under the License.
package v1 package v1
const ( const (
LabelHostname = "kubernetes.io/hostname" LabelHostname = "kubernetes.io/hostname"
LabelZoneFailureDomain = "failure-domain.beta.kubernetes.io/zone"
LabelZoneRegion = "failure-domain.beta.kubernetes.io/region"
LabelInstanceType = "beta.kubernetes.io/instance-type" LabelZoneFailureDomain = "failure-domain.beta.kubernetes.io/zone"
LabelZoneRegion = "failure-domain.beta.kubernetes.io/region"
LabelZoneFailureDomainStable = "topology.kubernetes.io/zone"
LabelZoneRegionStable = "topology.kubernetes.io/region"
LabelInstanceType = "beta.kubernetes.io/instance-type"
LabelInstanceTypeStable = "node.kubernetes.io/instance-type"
LabelOSStable = "kubernetes.io/os" LabelOSStable = "kubernetes.io/os"
LabelArchStable = "kubernetes.io/arch" LabelArchStable = "kubernetes.io/arch"
// LabelWindowsBuild is used on Windows nodes to specify the Windows build number starting with v1.17.0.
// It's in the format MajorVersion.MinorVersion.BuildNumber (for ex: 10.0.17763)
LabelWindowsBuild = "node.kubernetes.io/windows-build"
// LabelNamespaceSuffixKubelet is an allowed label namespace suffix kubelets can self-set ([*.]kubelet.kubernetes.io/*) // LabelNamespaceSuffixKubelet is an allowed label namespace suffix kubelets can self-set ([*.]kubelet.kubernetes.io/*)
LabelNamespaceSuffixKubelet = "kubelet.kubernetes.io" LabelNamespaceSuffixKubelet = "kubelet.kubernetes.io"
// LabelNamespaceSuffixNode is an allowed label namespace suffix kubelets can self-set ([*.]node.kubernetes.io/*) // LabelNamespaceSuffixNode is an allowed label namespace suffix kubelets can self-set ([*.]node.kubernetes.io/*)

55
vendor/k8s.io/api/core/v1/well_known_taints.go generated vendored Normal file
View File

@ -0,0 +1,55 @@
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT 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
const (
// TaintNodeNotReady will be added when node is not ready
// and feature-gate for TaintBasedEvictions flag is enabled,
// and removed when node becomes ready.
TaintNodeNotReady = "node.kubernetes.io/not-ready"
// TaintNodeUnreachable will be added when node becomes unreachable
// (corresponding to NodeReady status ConditionUnknown)
// and feature-gate for TaintBasedEvictions flag is enabled,
// and removed when node becomes reachable (NodeReady status ConditionTrue).
TaintNodeUnreachable = "node.kubernetes.io/unreachable"
// TaintNodeUnschedulable will be added when node becomes unschedulable
// and feature-gate for TaintNodesByCondition flag is enabled,
// and removed when node becomes scheduable.
TaintNodeUnschedulable = "node.kubernetes.io/unschedulable"
// TaintNodeMemoryPressure will be added when node has memory pressure
// and feature-gate for TaintNodesByCondition flag is enabled,
// and removed when node has enough memory.
TaintNodeMemoryPressure = "node.kubernetes.io/memory-pressure"
// TaintNodeDiskPressure will be added when node has disk pressure
// and feature-gate for TaintNodesByCondition flag is enabled,
// and removed when node has enough disk.
TaintNodeDiskPressure = "node.kubernetes.io/disk-pressure"
// TaintNodeNetworkUnavailable will be added when node's network is unavailable
// and feature-gate for TaintNodesByCondition flag is enabled,
// and removed when network becomes ready.
TaintNodeNetworkUnavailable = "node.kubernetes.io/network-unavailable"
// TaintNodePIDPressure will be added when node has pid pressure
// and feature-gate for TaintNodesByCondition flag is enabled,
// and removed when node has enough disk.
TaintNodePIDPressure = "node.kubernetes.io/pid-pressure"
)

View File

@ -5186,6 +5186,11 @@ func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec) {
*out = new(IPFamily) *out = new(IPFamily)
**out = **in **out = **in
} }
if in.TopologyKeys != nil {
in, out := &in.TopologyKeys, &out.TopologyKeys
*out = make([]string, len(*in))
copy(*out, *in)
}
return return
} }

11
vendor/k8s.io/api/go.mod generated vendored
View File

@ -6,13 +6,12 @@ go 1.12
require ( require (
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
github.com/stretchr/testify v1.3.0 github.com/stretchr/testify v1.4.0
k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655 k8s.io/apimachinery v0.17.1
) )
replace ( replace (
golang.org/x/sync => golang.org/x/sync v0.0.0-20181108010431-42b317875d0f golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13
golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503 golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13
golang.org/x/text => golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db k8s.io/apimachinery => k8s.io/apimachinery v0.17.1
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655
) )

29
vendor/k8s.io/apimachinery/go.mod generated vendored
View File

@ -11,33 +11,32 @@ require (
github.com/evanphx/json-patch v4.2.0+incompatible github.com/evanphx/json-patch v4.2.0+incompatible
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903
github.com/golang/protobuf v1.3.1 github.com/golang/protobuf v1.3.2
github.com/google/go-cmp v0.3.0 github.com/google/go-cmp v0.3.0
github.com/google/gofuzz v1.0.0 github.com/google/gofuzz v1.0.0
github.com/google/uuid v1.1.1 github.com/google/uuid v1.1.1
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d
github.com/hashicorp/golang-lru v0.5.1 github.com/hashicorp/golang-lru v0.5.1
github.com/json-iterator/go v1.1.7 github.com/json-iterator/go v1.1.8
github.com/kr/pretty v0.1.0 // indirect github.com/kr/pretty v0.1.0 // indirect
github.com/modern-go/reflect2 v1.0.1 github.com/modern-go/reflect2 v1.0.1
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f
github.com/onsi/ginkgo v1.8.0 // indirect github.com/onsi/ginkgo v1.10.1 // indirect
github.com/onsi/gomega v1.5.0 // indirect github.com/onsi/gomega v1.7.0 // indirect
github.com/spf13/pflag v1.0.3 github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.3.0 github.com/stretchr/testify v1.4.0
golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc golang.org/x/net v0.0.0-20191004110552-13f9640d40b9
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f // indirect golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 // indirect
golang.org/x/text v0.3.2 // indirect golang.org/x/text v0.3.2 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/inf.v0 v0.9.0 gopkg.in/inf.v0 v0.9.1
gopkg.in/yaml.v2 v2.2.2 gopkg.in/yaml.v2 v2.2.4
k8s.io/klog v0.4.0 k8s.io/klog v1.0.0
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
sigs.k8s.io/yaml v1.1.0 sigs.k8s.io/yaml v1.1.0
) )
replace ( replace (
golang.org/x/sync => golang.org/x/sync v0.0.0-20181108010431-42b317875d0f golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13
golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503 golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13
golang.org/x/text => golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db
) )

View File

@ -70,6 +70,28 @@ func (e *StatusError) DebugError() (string, []interface{}) {
return "server response object: %#v", []interface{}{e.ErrStatus} return "server response object: %#v", []interface{}{e.ErrStatus}
} }
// HasStatusCause returns true if the provided error has a details cause
// with the provided type name.
func HasStatusCause(err error, name metav1.CauseType) bool {
_, ok := StatusCause(err, name)
return ok
}
// StatusCause returns the named cause from the provided error if it exists and
// the error is of the type APIStatus. Otherwise it returns false.
func StatusCause(err error, name metav1.CauseType) (metav1.StatusCause, bool) {
apierr, ok := err.(APIStatus)
if !ok || apierr == nil || apierr.Status().Details == nil {
return metav1.StatusCause{}, false
}
for _, cause := range apierr.Status().Details.Causes {
if cause.Type == name {
return cause, true
}
}
return metav1.StatusCause{}, false
}
// UnexpectedObjectError can be returned by FromObject if it's passed a non-status object. // UnexpectedObjectError can be returned by FromObject if it's passed a non-status object.
type UnexpectedObjectError struct { type UnexpectedObjectError struct {
Object runtime.Object Object runtime.Object
@ -201,6 +223,7 @@ func NewApplyConflict(causes []metav1.StatusCause, message string) *StatusError
} }
// NewGone returns an error indicating the item no longer available at the server and no forwarding address is known. // NewGone returns an error indicating the item no longer available at the server and no forwarding address is known.
// DEPRECATED: Please use NewResourceExpired instead.
func NewGone(message string) *StatusError { func NewGone(message string) *StatusError {
return &StatusError{metav1.Status{ return &StatusError{metav1.Status{
Status: metav1.StatusFailure, Status: metav1.StatusFailure,

View File

@ -21,15 +21,11 @@ import (
metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
) )
// GroupName is the group name for this API. // GroupName is the group name for this API.
const GroupName = "meta.k8s.io" const GroupName = "meta.k8s.io"
// Scheme is the registry for any type that adheres to the meta API spec.
var scheme = runtime.NewScheme()
var ( var (
// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
@ -38,22 +34,16 @@ var (
AddToScheme = localSchemeBuilder.AddToScheme AddToScheme = localSchemeBuilder.AddToScheme
) )
// Codecs provides access to encoding and decoding for the scheme.
var Codecs = serializer.NewCodecFactory(scheme)
// SchemeGroupVersion is group version used to register these objects // SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
// ParameterCodec handles versioning of objects that are converted to query parameters.
var ParameterCodec = runtime.NewParameterCodec(scheme)
// Kind takes an unqualified kind and returns a Group qualified GroupKind // Kind takes an unqualified kind and returns a Group qualified GroupKind
func Kind(kind string) schema.GroupKind { func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind() return SchemeGroupVersion.WithKind(kind).GroupKind()
} }
// addToGroupVersion registers common meta types into schemas. // addToGroupVersion registers common meta types into schemas.
func addToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion) error { func addToGroupVersion(scheme *runtime.Scheme) error {
if err := scheme.AddIgnoredConversionType(&metav1.TypeMeta{}, &metav1.TypeMeta{}); err != nil { if err := scheme.AddIgnoredConversionType(&metav1.TypeMeta{}, &metav1.TypeMeta{}); err != nil {
return err return err
} }
@ -104,7 +94,6 @@ func addToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
// Unlike other API groups, meta internal knows about all meta external versions, but keeps // Unlike other API groups, meta internal knows about all meta external versions, but keeps
// the logic for conversion private. // the logic for conversion private.
func init() { func init() {
if err := addToGroupVersion(scheme, SchemeGroupVersion); err != nil { localSchemeBuilder.Register(addToGroupVersion)
panic(err) localSchemeBuilder.Register(metav1.RegisterConversions)
}
} }

View File

@ -22,7 +22,7 @@ import (
// IsControlledBy checks if the object has a controllerRef set to the given owner // IsControlledBy checks if the object has a controllerRef set to the given owner
func IsControlledBy(obj Object, owner Object) bool { func IsControlledBy(obj Object, owner Object) bool {
ref := GetControllerOf(obj) ref := GetControllerOfNoCopy(obj)
if ref == nil { if ref == nil {
return false return false
} }
@ -31,9 +31,20 @@ func IsControlledBy(obj Object, owner Object) bool {
// GetControllerOf returns a pointer to a copy of the controllerRef if controllee has a controller // GetControllerOf returns a pointer to a copy of the controllerRef if controllee has a controller
func GetControllerOf(controllee Object) *OwnerReference { func GetControllerOf(controllee Object) *OwnerReference {
for _, ref := range controllee.GetOwnerReferences() { ref := GetControllerOfNoCopy(controllee)
if ref.Controller != nil && *ref.Controller { if ref == nil {
return &ref return nil
}
cp := *ref
return &cp
}
// GetControllerOf returns a pointer to the controllerRef if controllee has a controller
func GetControllerOfNoCopy(controllee Object) *OwnerReference {
refs := controllee.GetOwnerReferences()
for i := range refs {
if refs[i].Controller != nil && *refs[i].Controller {
return &refs[i]
} }
} }
return nil return nil

View File

@ -18,6 +18,7 @@ package v1
import ( import (
"fmt" "fmt"
"net/url"
"strconv" "strconv"
"strings" "strings"
@ -26,6 +27,7 @@ import (
"k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/intstr"
) )
@ -35,12 +37,17 @@ func AddConversionFuncs(scheme *runtime.Scheme) error {
Convert_v1_ListMeta_To_v1_ListMeta, Convert_v1_ListMeta_To_v1_ListMeta,
Convert_v1_DeleteOptions_To_v1_DeleteOptions,
Convert_intstr_IntOrString_To_intstr_IntOrString, Convert_intstr_IntOrString_To_intstr_IntOrString,
Convert_Pointer_intstr_IntOrString_To_intstr_IntOrString,
Convert_intstr_IntOrString_To_Pointer_intstr_IntOrString,
Convert_Pointer_v1_Duration_To_v1_Duration, Convert_Pointer_v1_Duration_To_v1_Duration,
Convert_v1_Duration_To_Pointer_v1_Duration, Convert_v1_Duration_To_Pointer_v1_Duration,
Convert_Slice_string_To_v1_Time, Convert_Slice_string_To_v1_Time,
Convert_Slice_string_To_Pointer_v1_Time,
Convert_v1_Time_To_v1_Time, Convert_v1_Time_To_v1_Time,
Convert_v1_MicroTime_To_v1_MicroTime, Convert_v1_MicroTime_To_v1_MicroTime,
@ -76,7 +83,7 @@ func AddConversionFuncs(scheme *runtime.Scheme) error {
Convert_Slice_string_To_Slice_int32, Convert_Slice_string_To_Slice_int32,
Convert_Slice_string_To_v1_DeletionPropagation, Convert_Slice_string_To_Pointer_v1_DeletionPropagation,
Convert_Slice_string_To_v1_IncludeObjectPolicy, Convert_Slice_string_To_v1_IncludeObjectPolicy,
) )
@ -194,12 +201,33 @@ func Convert_v1_ListMeta_To_v1_ListMeta(in, out *ListMeta, s conversion.Scope) e
return nil return nil
} }
// +k8s:conversion-fn=copy-only
func Convert_v1_DeleteOptions_To_v1_DeleteOptions(in, out *DeleteOptions, s conversion.Scope) error {
*out = *in
return nil
}
// +k8s:conversion-fn=copy-only // +k8s:conversion-fn=copy-only
func Convert_intstr_IntOrString_To_intstr_IntOrString(in, out *intstr.IntOrString, s conversion.Scope) error { func Convert_intstr_IntOrString_To_intstr_IntOrString(in, out *intstr.IntOrString, s conversion.Scope) error {
*out = *in *out = *in
return nil return nil
} }
func Convert_Pointer_intstr_IntOrString_To_intstr_IntOrString(in **intstr.IntOrString, out *intstr.IntOrString, s conversion.Scope) error {
if *in == nil {
*out = intstr.IntOrString{} // zero value
return nil
}
*out = **in // copy
return nil
}
func Convert_intstr_IntOrString_To_Pointer_intstr_IntOrString(in *intstr.IntOrString, out **intstr.IntOrString, s conversion.Scope) error {
temp := *in // copy
*out = &temp
return nil
}
// +k8s:conversion-fn=copy-only // +k8s:conversion-fn=copy-only
func Convert_v1_Time_To_v1_Time(in *Time, out *Time, s conversion.Scope) error { func Convert_v1_Time_To_v1_Time(in *Time, out *Time, s conversion.Scope) error {
// Cannot deep copy these, because time.Time has unexported fields. // Cannot deep copy these, because time.Time has unexported fields.
@ -230,14 +258,30 @@ func Convert_v1_Duration_To_Pointer_v1_Duration(in *Duration, out **Duration, s
} }
// Convert_Slice_string_To_v1_Time allows converting a URL query parameter value // Convert_Slice_string_To_v1_Time allows converting a URL query parameter value
func Convert_Slice_string_To_v1_Time(input *[]string, out *Time, s conversion.Scope) error { func Convert_Slice_string_To_v1_Time(in *[]string, out *Time, s conversion.Scope) error {
str := "" str := ""
if len(*input) > 0 { if len(*in) > 0 {
str = (*input)[0] str = (*in)[0]
} }
return out.UnmarshalQueryParameter(str) return out.UnmarshalQueryParameter(str)
} }
func Convert_Slice_string_To_Pointer_v1_Time(in *[]string, out **Time, s conversion.Scope) error {
if in == nil {
return nil
}
str := ""
if len(*in) > 0 {
str = (*in)[0]
}
temp := Time{}
if err := temp.UnmarshalQueryParameter(str); err != nil {
return err
}
*out = &temp
return nil
}
func Convert_string_To_labels_Selector(in *string, out *labels.Selector, s conversion.Scope) error { func Convert_string_To_labels_Selector(in *string, out *labels.Selector, s conversion.Scope) error {
selector, err := labels.Parse(*in) selector, err := labels.Parse(*in)
if err != nil { if err != nil {
@ -310,20 +354,53 @@ func Convert_Slice_string_To_Slice_int32(in *[]string, out *[]int32, s conversio
return nil return nil
} }
// Convert_Slice_string_To_v1_DeletionPropagation allows converting a URL query parameter propagationPolicy // Convert_Slice_string_To_Pointer_v1_DeletionPropagation allows converting a URL query parameter propagationPolicy
func Convert_Slice_string_To_v1_DeletionPropagation(input *[]string, out *DeletionPropagation, s conversion.Scope) error { func Convert_Slice_string_To_Pointer_v1_DeletionPropagation(in *[]string, out **DeletionPropagation, s conversion.Scope) error {
if len(*input) > 0 { var str string
*out = DeletionPropagation((*input)[0]) if len(*in) > 0 {
str = (*in)[0]
} else { } else {
*out = "" str = ""
} }
temp := DeletionPropagation(str)
*out = &temp
return nil return nil
} }
// Convert_Slice_string_To_v1_IncludeObjectPolicy allows converting a URL query parameter value // Convert_Slice_string_To_v1_IncludeObjectPolicy allows converting a URL query parameter value
func Convert_Slice_string_To_v1_IncludeObjectPolicy(input *[]string, out *IncludeObjectPolicy, s conversion.Scope) error { func Convert_Slice_string_To_v1_IncludeObjectPolicy(in *[]string, out *IncludeObjectPolicy, s conversion.Scope) error {
if len(*input) > 0 { if len(*in) > 0 {
*out = IncludeObjectPolicy((*input)[0]) *out = IncludeObjectPolicy((*in)[0])
}
return nil
}
// Convert_url_Values_To_v1_DeleteOptions allows converting a URL to DeleteOptions.
func Convert_url_Values_To_v1_DeleteOptions(in *url.Values, out *DeleteOptions, s conversion.Scope) error {
if err := autoConvert_url_Values_To_v1_DeleteOptions(in, out, s); err != nil {
return err
}
uid := types.UID("")
if values, ok := (*in)["uid"]; ok && len(values) > 0 {
uid = types.UID(values[0])
}
resourceVersion := ""
if values, ok := (*in)["resourceVersion"]; ok && len(values) > 0 {
resourceVersion = values[0]
}
if len(uid) > 0 || len(resourceVersion) > 0 {
if out.Preconditions == nil {
out.Preconditions = &Preconditions{}
}
if len(uid) > 0 {
out.Preconditions.UID = &uid
}
if len(resourceVersion) > 0 {
out.Preconditions.ResourceVersion = &resourceVersion
}
} }
return nil return nil
} }

View File

@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// +k8s:conversion-gen=false
// +k8s:deepcopy-gen=package // +k8s:deepcopy-gen=package
// +k8s:openapi-gen=true // +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta // +k8s:defaulter-gen=TypeMeta

View File

@ -163,6 +163,7 @@ message DeleteOptions {
// Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be // Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be
// returned. // returned.
// +k8s:conversion-gen=false
// +optional // +optional
optional Preconditions preconditions = 2; optional Preconditions preconditions = 2;
@ -416,9 +417,6 @@ message ListOptions {
// If this is not a watch, this field is ignored. // If this is not a watch, this field is ignored.
// If the feature gate WatchBookmarks is not enabled in apiserver, // If the feature gate WatchBookmarks is not enabled in apiserver,
// this field is ignored. // this field is ignored.
//
// This field is beta.
//
// +optional // +optional
optional bool allowWatchBookmarks = 9; optional bool allowWatchBookmarks = 9;
@ -663,6 +661,15 @@ message ObjectMeta {
// is an identifier for the responsible component that will remove the entry // is an identifier for the responsible component that will remove the entry
// from the list. If the deletionTimestamp of the object is non-nil, entries // from the list. If the deletionTimestamp of the object is non-nil, entries
// in this list can only be removed. // in this list can only be removed.
// Finalizers may be processed and removed in any order. Order is NOT enforced
// because it introduces significant risk of stuck finalizers.
// finalizers is a shared field, any actor with permission can reorder it.
// If the finalizer list is processed in order, then this can lead to a situation
// in which the component responsible for the first finalizer in the list is
// waiting for a signal (field value, external system, or other) produced by a
// component responsible for a finalizer later in the list, resulting in a deadlock.
// Without enforced ordering finalizers are free to order amongst themselves and
// are not vulnerable to ordering changes in the list.
// +optional // +optional
// +patchStrategy=merge // +patchStrategy=merge
repeated string finalizers = 14; repeated string finalizers = 14;

View File

@ -25,6 +25,13 @@ import (
// GroupName is the group name for this API. // GroupName is the group name for this API.
const GroupName = "meta.k8s.io" const GroupName = "meta.k8s.io"
var (
// localSchemeBuilder is used to make compiler happy for autogenerated
// conversions. However, it's not used.
schemeBuilder runtime.SchemeBuilder
localSchemeBuilder = &schemeBuilder
)
// SchemeGroupVersion is group version used to register these objects // SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
@ -40,6 +47,31 @@ func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind() return SchemeGroupVersion.WithKind(kind).GroupKind()
} }
// scheme is the registry for the common types that adhere to the meta v1 API spec.
var scheme = runtime.NewScheme()
// ParameterCodec knows about query parameters used with the meta v1 API spec.
var ParameterCodec = runtime.NewParameterCodec(scheme)
func addEventConversionFuncs(scheme *runtime.Scheme) error {
return scheme.AddConversionFuncs(
Convert_v1_WatchEvent_To_watch_Event,
Convert_v1_InternalEvent_To_v1_WatchEvent,
Convert_watch_Event_To_v1_WatchEvent,
Convert_v1_WatchEvent_To_v1_InternalEvent,
)
}
var optionsTypes = []runtime.Object{
&ListOptions{},
&ExportOptions{},
&GetOptions{},
&DeleteOptions{},
&CreateOptions{},
&UpdateOptions{},
&PatchOptions{},
}
// AddToGroupVersion registers common meta types into schemas. // AddToGroupVersion registers common meta types into schemas.
func AddToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion) { func AddToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion) {
scheme.AddKnownTypeWithName(groupVersion.WithKind(WatchEventKind), &WatchEvent{}) scheme.AddKnownTypeWithName(groupVersion.WithKind(WatchEventKind), &WatchEvent{})
@ -48,21 +80,7 @@ func AddToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
&InternalEvent{}, &InternalEvent{},
) )
// Supports legacy code paths, most callers should use metav1.ParameterCodec for now // Supports legacy code paths, most callers should use metav1.ParameterCodec for now
scheme.AddKnownTypes(groupVersion, scheme.AddKnownTypes(groupVersion, optionsTypes...)
&ListOptions{},
&ExportOptions{},
&GetOptions{},
&DeleteOptions{},
&CreateOptions{},
&UpdateOptions{},
&PatchOptions{},
)
utilruntime.Must(scheme.AddConversionFuncs(
Convert_v1_WatchEvent_To_watch_Event,
Convert_v1_InternalEvent_To_v1_WatchEvent,
Convert_watch_Event_To_v1_WatchEvent,
Convert_v1_WatchEvent_To_v1_InternalEvent,
))
// Register Unversioned types under their own special group // Register Unversioned types under their own special group
scheme.AddUnversionedTypes(Unversioned, scheme.AddUnversionedTypes(Unversioned,
&Status{}, &Status{},
@ -72,36 +90,14 @@ func AddToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
&APIResourceList{}, &APIResourceList{},
) )
utilruntime.Must(addEventConversionFuncs(scheme))
// register manually. This usually goes through the SchemeBuilder, which we cannot use here. // register manually. This usually goes through the SchemeBuilder, which we cannot use here.
utilruntime.Must(AddConversionFuncs(scheme)) utilruntime.Must(AddConversionFuncs(scheme))
utilruntime.Must(RegisterDefaults(scheme)) utilruntime.Must(RegisterDefaults(scheme))
} }
// scheme is the registry for the common types that adhere to the meta v1 API spec. // AddMetaToScheme registers base meta types into schemas.
var scheme = runtime.NewScheme()
// ParameterCodec knows about query parameters used with the meta v1 API spec.
var ParameterCodec = runtime.NewParameterCodec(scheme)
func init() {
scheme.AddUnversionedTypes(SchemeGroupVersion,
&ListOptions{},
&ExportOptions{},
&GetOptions{},
&DeleteOptions{},
&CreateOptions{},
&UpdateOptions{},
&PatchOptions{},
)
if err := AddMetaToScheme(scheme); err != nil {
panic(err)
}
// register manually. This usually goes through the SchemeBuilder, which we cannot use here.
utilruntime.Must(RegisterDefaults(scheme))
}
func AddMetaToScheme(scheme *runtime.Scheme) error { func AddMetaToScheme(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion, scheme.AddKnownTypes(SchemeGroupVersion,
&Table{}, &Table{},
@ -114,3 +110,12 @@ func AddMetaToScheme(scheme *runtime.Scheme) error {
Convert_Slice_string_To_v1_IncludeObjectPolicy, Convert_Slice_string_To_v1_IncludeObjectPolicy,
) )
} }
func init() {
scheme.AddUnversionedTypes(SchemeGroupVersion, optionsTypes...)
utilruntime.Must(AddMetaToScheme(scheme))
// register manually. This usually goes through the SchemeBuilder, which we cannot use here.
utilruntime.Must(RegisterDefaults(scheme))
}

View File

@ -250,6 +250,15 @@ type ObjectMeta struct {
// is an identifier for the responsible component that will remove the entry // is an identifier for the responsible component that will remove the entry
// from the list. If the deletionTimestamp of the object is non-nil, entries // from the list. If the deletionTimestamp of the object is non-nil, entries
// in this list can only be removed. // in this list can only be removed.
// Finalizers may be processed and removed in any order. Order is NOT enforced
// because it introduces significant risk of stuck finalizers.
// finalizers is a shared field, any actor with permission can reorder it.
// If the finalizer list is processed in order, then this can lead to a situation
// in which the component responsible for the first finalizer in the list is
// waiting for a signal (field value, external system, or other) produced by a
// component responsible for a finalizer later in the list, resulting in a deadlock.
// Without enforced ordering finalizers are free to order amongst themselves and
// are not vulnerable to ordering changes in the list.
// +optional // +optional
// +patchStrategy=merge // +patchStrategy=merge
Finalizers []string `json:"finalizers,omitempty" patchStrategy:"merge" protobuf:"bytes,14,rep,name=finalizers"` Finalizers []string `json:"finalizers,omitempty" patchStrategy:"merge" protobuf:"bytes,14,rep,name=finalizers"`
@ -313,6 +322,7 @@ type OwnerReference struct {
BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty" protobuf:"varint,7,opt,name=blockOwnerDeletion"` BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty" protobuf:"varint,7,opt,name=blockOwnerDeletion"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ListOptions is the query options to a standard REST list call. // ListOptions is the query options to a standard REST list call.
@ -342,9 +352,6 @@ type ListOptions struct {
// If this is not a watch, this field is ignored. // If this is not a watch, this field is ignored.
// If the feature gate WatchBookmarks is not enabled in apiserver, // If the feature gate WatchBookmarks is not enabled in apiserver,
// this field is ignored. // this field is ignored.
//
// This field is beta.
//
// +optional // +optional
AllowWatchBookmarks bool `json:"allowWatchBookmarks,omitempty" protobuf:"varint,9,opt,name=allowWatchBookmarks"` AllowWatchBookmarks bool `json:"allowWatchBookmarks,omitempty" protobuf:"varint,9,opt,name=allowWatchBookmarks"`
@ -395,6 +402,7 @@ type ListOptions struct {
Continue string `json:"continue,omitempty" protobuf:"bytes,8,opt,name=continue"` Continue string `json:"continue,omitempty" protobuf:"bytes,8,opt,name=continue"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ExportOptions is the query options to the standard REST get call. // ExportOptions is the query options to the standard REST get call.
@ -409,6 +417,7 @@ type ExportOptions struct {
Exact bool `json:"exact" protobuf:"varint,2,opt,name=exact"` Exact bool `json:"exact" protobuf:"varint,2,opt,name=exact"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// GetOptions is the standard query options to the standard REST get call. // GetOptions is the standard query options to the standard REST get call.
@ -446,6 +455,7 @@ const (
DryRunAll = "All" DryRunAll = "All"
) )
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// DeleteOptions may be provided when deleting an API object. // DeleteOptions may be provided when deleting an API object.
@ -461,6 +471,7 @@ type DeleteOptions struct {
// Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be // Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be
// returned. // returned.
// +k8s:conversion-gen=false
// +optional // +optional
Preconditions *Preconditions `json:"preconditions,omitempty" protobuf:"bytes,2,opt,name=preconditions"` Preconditions *Preconditions `json:"preconditions,omitempty" protobuf:"bytes,2,opt,name=preconditions"`
@ -491,6 +502,7 @@ type DeleteOptions struct {
DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,5,rep,name=dryRun"` DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,5,rep,name=dryRun"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// CreateOptions may be provided when creating an API object. // CreateOptions may be provided when creating an API object.
@ -514,6 +526,7 @@ type CreateOptions struct {
FieldManager string `json:"fieldManager,omitempty" protobuf:"bytes,3,name=fieldManager"` FieldManager string `json:"fieldManager,omitempty" protobuf:"bytes,3,name=fieldManager"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PatchOptions may be provided when patching an API object. // PatchOptions may be provided when patching an API object.
@ -546,6 +559,7 @@ type PatchOptions struct {
FieldManager string `json:"fieldManager,omitempty" protobuf:"bytes,3,name=fieldManager"` FieldManager string `json:"fieldManager,omitempty" protobuf:"bytes,3,name=fieldManager"`
} }
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// UpdateOptions may be provided when updating an API object. // UpdateOptions may be provided when updating an API object.
@ -1258,6 +1272,7 @@ const (
) )
// TableOptions are used when a Table is requested by the caller. // TableOptions are used when a Table is requested by the caller.
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type TableOptions struct { type TableOptions struct {
TypeMeta `json:",inline"` TypeMeta `json:",inline"`

View File

@ -194,7 +194,7 @@ var map_ListOptions = map[string]string{
"labelSelector": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", "labelSelector": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
"fieldSelector": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", "fieldSelector": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
"watch": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", "watch": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
"allowWatchBookmarks": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.\n\nThis field is beta.", "allowWatchBookmarks": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.",
"resourceVersion": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", "resourceVersion": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
"timeoutSeconds": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", "timeoutSeconds": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
"limit": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "limit": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
@ -234,7 +234,7 @@ var map_ObjectMeta = map[string]string{
"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", "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", "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",
"ownerReferences": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", "ownerReferences": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.",
"finalizers": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.", "finalizers": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.",
"clusterName": "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.", "clusterName": "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.",
"managedFields": "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", "managedFields": "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.",
} }

View File

@ -27,6 +27,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/json" "k8s.io/apimachinery/pkg/util/json"
"k8s.io/klog"
) )
// NestedFieldCopy returns a deep copy of the value of a nested field. // NestedFieldCopy returns a deep copy of the value of a nested field.
@ -329,6 +330,8 @@ var UnstructuredJSONScheme runtime.Codec = unstructuredJSONScheme{}
type unstructuredJSONScheme struct{} type unstructuredJSONScheme struct{}
const unstructuredJSONSchemeIdentifier runtime.Identifier = "unstructuredJSON"
func (s unstructuredJSONScheme) Decode(data []byte, _ *schema.GroupVersionKind, obj runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) { func (s unstructuredJSONScheme) Decode(data []byte, _ *schema.GroupVersionKind, obj runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) {
var err error var err error
if obj != nil { if obj != nil {
@ -349,7 +352,14 @@ func (s unstructuredJSONScheme) Decode(data []byte, _ *schema.GroupVersionKind,
return obj, &gvk, nil return obj, &gvk, nil
} }
func (unstructuredJSONScheme) Encode(obj runtime.Object, w io.Writer) error { func (s unstructuredJSONScheme) Encode(obj runtime.Object, w io.Writer) error {
if co, ok := obj.(runtime.CacheableObject); ok {
return co.CacheEncode(s.Identifier(), s.doEncode, w)
}
return s.doEncode(obj, w)
}
func (unstructuredJSONScheme) doEncode(obj runtime.Object, w io.Writer) error {
switch t := obj.(type) { switch t := obj.(type) {
case *Unstructured: case *Unstructured:
return json.NewEncoder(w).Encode(t.Object) return json.NewEncoder(w).Encode(t.Object)
@ -373,6 +383,11 @@ func (unstructuredJSONScheme) Encode(obj runtime.Object, w io.Writer) error {
} }
} }
// Identifier implements runtime.Encoder interface.
func (unstructuredJSONScheme) Identifier() runtime.Identifier {
return unstructuredJSONSchemeIdentifier
}
func (s unstructuredJSONScheme) decode(data []byte) (runtime.Object, error) { func (s unstructuredJSONScheme) decode(data []byte) (runtime.Object, error) {
type detector struct { type detector struct {
Items gojson.RawMessage Items gojson.RawMessage
@ -400,12 +415,6 @@ func (s unstructuredJSONScheme) decodeInto(data []byte, obj runtime.Object) erro
return s.decodeToUnstructured(data, x) return s.decodeToUnstructured(data, x)
case *UnstructuredList: case *UnstructuredList:
return s.decodeToList(data, x) return s.decodeToList(data, x)
case *runtime.VersionedObjects:
o, err := s.decode(data)
if err == nil {
x.Objects = []runtime.Object{o}
}
return err
default: default:
return json.Unmarshal(data, x) return json.Unmarshal(data, x)
} }
@ -460,12 +469,30 @@ func (s unstructuredJSONScheme) decodeToList(data []byte, list *UnstructuredList
return nil return nil
} }
type JSONFallbackEncoder struct { type jsonFallbackEncoder struct {
runtime.Encoder encoder runtime.Encoder
identifier runtime.Identifier
} }
func (c JSONFallbackEncoder) Encode(obj runtime.Object, w io.Writer) error { func NewJSONFallbackEncoder(encoder runtime.Encoder) runtime.Encoder {
err := c.Encoder.Encode(obj, w) result := map[string]string{
"name": "fallback",
"base": string(encoder.Identifier()),
}
identifier, err := gojson.Marshal(result)
if err != nil {
klog.Fatalf("Failed marshaling identifier for jsonFallbackEncoder: %v", err)
}
return &jsonFallbackEncoder{
encoder: encoder,
identifier: runtime.Identifier(identifier),
}
}
func (c *jsonFallbackEncoder) Encode(obj runtime.Object, w io.Writer) error {
// There is no need to handle runtime.CacheableObject, as we only
// fallback to other encoders here.
err := c.encoder.Encode(obj, w)
if runtime.IsNotRegisteredError(err) { if runtime.IsNotRegisteredError(err) {
switch obj.(type) { switch obj.(type) {
case *Unstructured, *UnstructuredList: case *Unstructured, *UnstructuredList:
@ -474,3 +501,8 @@ func (c JSONFallbackEncoder) Encode(obj runtime.Object, w io.Writer) error {
} }
return err return err
} }
// Identifier implements runtime.Encoder interface.
func (c *jsonFallbackEncoder) Identifier() runtime.Identifier {
return c.identifier
}

View File

@ -0,0 +1,523 @@
// +build !ignore_autogenerated
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by conversion-gen. DO NOT EDIT.
package v1
import (
url "net/url"
unsafe "unsafe"
resource "k8s.io/apimachinery/pkg/api/resource"
conversion "k8s.io/apimachinery/pkg/conversion"
fields "k8s.io/apimachinery/pkg/fields"
labels "k8s.io/apimachinery/pkg/labels"
runtime "k8s.io/apimachinery/pkg/runtime"
intstr "k8s.io/apimachinery/pkg/util/intstr"
watch "k8s.io/apimachinery/pkg/watch"
)
func init() {
localSchemeBuilder.Register(RegisterConversions)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*CreateOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_url_Values_To_v1_CreateOptions(a.(*url.Values), b.(*CreateOptions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*DeleteOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_url_Values_To_v1_DeleteOptions(a.(*url.Values), b.(*DeleteOptions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*ExportOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_url_Values_To_v1_ExportOptions(a.(*url.Values), b.(*ExportOptions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*GetOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_url_Values_To_v1_GetOptions(a.(*url.Values), b.(*GetOptions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*ListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_url_Values_To_v1_ListOptions(a.(*url.Values), b.(*ListOptions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*PatchOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_url_Values_To_v1_PatchOptions(a.(*url.Values), b.(*PatchOptions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*TableOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_url_Values_To_v1_TableOptions(a.(*url.Values), b.(*TableOptions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*UpdateOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_url_Values_To_v1_UpdateOptions(a.(*url.Values), b.(*UpdateOptions), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*map[string]string)(nil), (*LabelSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Map_string_To_string_To_v1_LabelSelector(a.(*map[string]string), b.(*LabelSelector), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((**bool)(nil), (*bool)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Pointer_bool_To_bool(a.(**bool), b.(*bool), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((**float64)(nil), (*float64)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Pointer_float64_To_float64(a.(**float64), b.(*float64), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((**int32)(nil), (*int32)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Pointer_int32_To_int32(a.(**int32), b.(*int32), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((**int64)(nil), (*int)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Pointer_int64_To_int(a.(**int64), b.(*int), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((**int64)(nil), (*int64)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Pointer_int64_To_int64(a.(**int64), b.(*int64), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((**intstr.IntOrString)(nil), (*intstr.IntOrString)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Pointer_intstr_IntOrString_To_intstr_IntOrString(a.(**intstr.IntOrString), b.(*intstr.IntOrString), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((**string)(nil), (*string)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Pointer_string_To_string(a.(**string), b.(*string), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((**Duration)(nil), (*Duration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Pointer_v1_Duration_To_v1_Duration(a.(**Duration), b.(*Duration), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*[]string)(nil), (**DeletionPropagation)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Slice_string_To_Pointer_v1_DeletionPropagation(a.(*[]string), b.(**DeletionPropagation), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*[]string)(nil), (**Time)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Slice_string_To_Pointer_v1_Time(a.(*[]string), b.(**Time), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*[]string)(nil), (*[]int32)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Slice_string_To_Slice_int32(a.(*[]string), b.(*[]int32), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*[]string)(nil), (*IncludeObjectPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Slice_string_To_v1_IncludeObjectPolicy(a.(*[]string), b.(*IncludeObjectPolicy), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*[]string)(nil), (*Time)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_Slice_string_To_v1_Time(a.(*[]string), b.(*Time), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*bool)(nil), (**bool)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_bool_To_Pointer_bool(a.(*bool), b.(**bool), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*fields.Selector)(nil), (*string)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_fields_Selector_To_string(a.(*fields.Selector), b.(*string), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*float64)(nil), (**float64)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_float64_To_Pointer_float64(a.(*float64), b.(**float64), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*int32)(nil), (**int32)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_int32_To_Pointer_int32(a.(*int32), b.(**int32), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*int64)(nil), (**int64)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_int64_To_Pointer_int64(a.(*int64), b.(**int64), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*int)(nil), (**int64)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_int_To_Pointer_int64(a.(*int), b.(**int64), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*intstr.IntOrString)(nil), (**intstr.IntOrString)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_intstr_IntOrString_To_Pointer_intstr_IntOrString(a.(*intstr.IntOrString), b.(**intstr.IntOrString), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*intstr.IntOrString)(nil), (*intstr.IntOrString)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_intstr_IntOrString_To_intstr_IntOrString(a.(*intstr.IntOrString), b.(*intstr.IntOrString), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*labels.Selector)(nil), (*string)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_labels_Selector_To_string(a.(*labels.Selector), b.(*string), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*resource.Quantity)(nil), (*resource.Quantity)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_resource_Quantity_To_resource_Quantity(a.(*resource.Quantity), b.(*resource.Quantity), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*string)(nil), (**string)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_string_To_Pointer_string(a.(*string), b.(**string), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*string)(nil), (*fields.Selector)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_string_To_fields_Selector(a.(*string), b.(*fields.Selector), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*string)(nil), (*labels.Selector)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_string_To_labels_Selector(a.(*string), b.(*labels.Selector), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*url.Values)(nil), (*DeleteOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_url_Values_To_v1_DeleteOptions(a.(*url.Values), b.(*DeleteOptions), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*DeleteOptions)(nil), (*DeleteOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_DeleteOptions_To_v1_DeleteOptions(a.(*DeleteOptions), b.(*DeleteOptions), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*Duration)(nil), (**Duration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_Duration_To_Pointer_v1_Duration(a.(*Duration), b.(**Duration), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*InternalEvent)(nil), (*WatchEvent)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_InternalEvent_To_v1_WatchEvent(a.(*InternalEvent), b.(*WatchEvent), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*LabelSelector)(nil), (*map[string]string)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_LabelSelector_To_Map_string_To_string(a.(*LabelSelector), b.(*map[string]string), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*ListMeta)(nil), (*ListMeta)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_ListMeta_To_v1_ListMeta(a.(*ListMeta), b.(*ListMeta), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*MicroTime)(nil), (*MicroTime)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_MicroTime_To_v1_MicroTime(a.(*MicroTime), b.(*MicroTime), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*Time)(nil), (*Time)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_Time_To_v1_Time(a.(*Time), b.(*Time), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*TypeMeta)(nil), (*TypeMeta)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_TypeMeta_To_v1_TypeMeta(a.(*TypeMeta), b.(*TypeMeta), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*WatchEvent)(nil), (*InternalEvent)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_WatchEvent_To_v1_InternalEvent(a.(*WatchEvent), b.(*InternalEvent), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*WatchEvent)(nil), (*watch.Event)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_WatchEvent_To_watch_Event(a.(*WatchEvent), b.(*watch.Event), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*watch.Event)(nil), (*WatchEvent)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_watch_Event_To_v1_WatchEvent(a.(*watch.Event), b.(*WatchEvent), scope)
}); err != nil {
return err
}
return nil
}
func autoConvert_url_Values_To_v1_CreateOptions(in *url.Values, out *CreateOptions, s conversion.Scope) error {
// WARNING: Field TypeMeta does not have json tag, skipping.
if values, ok := map[string][]string(*in)["dryRun"]; ok && len(values) > 0 {
out.DryRun = *(*[]string)(unsafe.Pointer(&values))
} else {
out.DryRun = nil
}
if values, ok := map[string][]string(*in)["fieldManager"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_string(&values, &out.FieldManager, s); err != nil {
return err
}
} else {
out.FieldManager = ""
}
return nil
}
// Convert_url_Values_To_v1_CreateOptions is an autogenerated conversion function.
func Convert_url_Values_To_v1_CreateOptions(in *url.Values, out *CreateOptions, s conversion.Scope) error {
return autoConvert_url_Values_To_v1_CreateOptions(in, out, s)
}
func autoConvert_url_Values_To_v1_DeleteOptions(in *url.Values, out *DeleteOptions, s conversion.Scope) error {
// WARNING: Field TypeMeta does not have json tag, skipping.
if values, ok := map[string][]string(*in)["gracePeriodSeconds"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_Pointer_int64(&values, &out.GracePeriodSeconds, s); err != nil {
return err
}
} else {
out.GracePeriodSeconds = nil
}
// INFO: in.Preconditions opted out of conversion generation
if values, ok := map[string][]string(*in)["orphanDependents"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_Pointer_bool(&values, &out.OrphanDependents, s); err != nil {
return err
}
} else {
out.OrphanDependents = nil
}
if values, ok := map[string][]string(*in)["propagationPolicy"]; ok && len(values) > 0 {
if err := Convert_Slice_string_To_Pointer_v1_DeletionPropagation(&values, &out.PropagationPolicy, s); err != nil {
return err
}
} else {
out.PropagationPolicy = nil
}
if values, ok := map[string][]string(*in)["dryRun"]; ok && len(values) > 0 {
out.DryRun = *(*[]string)(unsafe.Pointer(&values))
} else {
out.DryRun = nil
}
return nil
}
func autoConvert_url_Values_To_v1_ExportOptions(in *url.Values, out *ExportOptions, s conversion.Scope) error {
// WARNING: Field TypeMeta does not have json tag, skipping.
if values, ok := map[string][]string(*in)["export"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_bool(&values, &out.Export, s); err != nil {
return err
}
} else {
out.Export = false
}
if values, ok := map[string][]string(*in)["exact"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_bool(&values, &out.Exact, s); err != nil {
return err
}
} else {
out.Exact = false
}
return nil
}
// Convert_url_Values_To_v1_ExportOptions is an autogenerated conversion function.
func Convert_url_Values_To_v1_ExportOptions(in *url.Values, out *ExportOptions, s conversion.Scope) error {
return autoConvert_url_Values_To_v1_ExportOptions(in, out, s)
}
func autoConvert_url_Values_To_v1_GetOptions(in *url.Values, out *GetOptions, s conversion.Scope) error {
// WARNING: Field TypeMeta does not have json tag, skipping.
if values, ok := map[string][]string(*in)["resourceVersion"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_string(&values, &out.ResourceVersion, s); err != nil {
return err
}
} else {
out.ResourceVersion = ""
}
return nil
}
// Convert_url_Values_To_v1_GetOptions is an autogenerated conversion function.
func Convert_url_Values_To_v1_GetOptions(in *url.Values, out *GetOptions, s conversion.Scope) error {
return autoConvert_url_Values_To_v1_GetOptions(in, out, s)
}
func autoConvert_url_Values_To_v1_ListOptions(in *url.Values, out *ListOptions, s conversion.Scope) error {
// WARNING: Field TypeMeta does not have json tag, skipping.
if values, ok := map[string][]string(*in)["labelSelector"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_string(&values, &out.LabelSelector, s); err != nil {
return err
}
} else {
out.LabelSelector = ""
}
if values, ok := map[string][]string(*in)["fieldSelector"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_string(&values, &out.FieldSelector, s); err != nil {
return err
}
} else {
out.FieldSelector = ""
}
if values, ok := map[string][]string(*in)["watch"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_bool(&values, &out.Watch, s); err != nil {
return err
}
} else {
out.Watch = false
}
if values, ok := map[string][]string(*in)["allowWatchBookmarks"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_bool(&values, &out.AllowWatchBookmarks, s); err != nil {
return err
}
} else {
out.AllowWatchBookmarks = false
}
if values, ok := map[string][]string(*in)["resourceVersion"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_string(&values, &out.ResourceVersion, s); err != nil {
return err
}
} else {
out.ResourceVersion = ""
}
if values, ok := map[string][]string(*in)["timeoutSeconds"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_Pointer_int64(&values, &out.TimeoutSeconds, s); err != nil {
return err
}
} else {
out.TimeoutSeconds = nil
}
if values, ok := map[string][]string(*in)["limit"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_int64(&values, &out.Limit, s); err != nil {
return err
}
} else {
out.Limit = 0
}
if values, ok := map[string][]string(*in)["continue"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_string(&values, &out.Continue, s); err != nil {
return err
}
} else {
out.Continue = ""
}
return nil
}
// Convert_url_Values_To_v1_ListOptions is an autogenerated conversion function.
func Convert_url_Values_To_v1_ListOptions(in *url.Values, out *ListOptions, s conversion.Scope) error {
return autoConvert_url_Values_To_v1_ListOptions(in, out, s)
}
func autoConvert_url_Values_To_v1_PatchOptions(in *url.Values, out *PatchOptions, s conversion.Scope) error {
// WARNING: Field TypeMeta does not have json tag, skipping.
if values, ok := map[string][]string(*in)["dryRun"]; ok && len(values) > 0 {
out.DryRun = *(*[]string)(unsafe.Pointer(&values))
} else {
out.DryRun = nil
}
if values, ok := map[string][]string(*in)["force"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_Pointer_bool(&values, &out.Force, s); err != nil {
return err
}
} else {
out.Force = nil
}
if values, ok := map[string][]string(*in)["fieldManager"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_string(&values, &out.FieldManager, s); err != nil {
return err
}
} else {
out.FieldManager = ""
}
return nil
}
// Convert_url_Values_To_v1_PatchOptions is an autogenerated conversion function.
func Convert_url_Values_To_v1_PatchOptions(in *url.Values, out *PatchOptions, s conversion.Scope) error {
return autoConvert_url_Values_To_v1_PatchOptions(in, out, s)
}
func autoConvert_url_Values_To_v1_TableOptions(in *url.Values, out *TableOptions, s conversion.Scope) error {
// WARNING: Field TypeMeta does not have json tag, skipping.
if values, ok := map[string][]string(*in)["-"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_bool(&values, &out.NoHeaders, s); err != nil {
return err
}
} else {
out.NoHeaders = false
}
if values, ok := map[string][]string(*in)["includeObject"]; ok && len(values) > 0 {
if err := Convert_Slice_string_To_v1_IncludeObjectPolicy(&values, &out.IncludeObject, s); err != nil {
return err
}
} else {
out.IncludeObject = ""
}
return nil
}
// Convert_url_Values_To_v1_TableOptions is an autogenerated conversion function.
func Convert_url_Values_To_v1_TableOptions(in *url.Values, out *TableOptions, s conversion.Scope) error {
return autoConvert_url_Values_To_v1_TableOptions(in, out, s)
}
func autoConvert_url_Values_To_v1_UpdateOptions(in *url.Values, out *UpdateOptions, s conversion.Scope) error {
// WARNING: Field TypeMeta does not have json tag, skipping.
if values, ok := map[string][]string(*in)["dryRun"]; ok && len(values) > 0 {
out.DryRun = *(*[]string)(unsafe.Pointer(&values))
} else {
out.DryRun = nil
}
if values, ok := map[string][]string(*in)["fieldManager"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_string(&values, &out.FieldManager, s); err != nil {
return err
}
} else {
out.FieldManager = ""
}
return nil
}
// Convert_url_Values_To_v1_UpdateOptions is an autogenerated conversion function.
func Convert_url_Values_To_v1_UpdateOptions(in *url.Values, out *UpdateOptions, s conversion.Scope) error {
return autoConvert_url_Values_To_v1_UpdateOptions(in, out, s)
}

View File

@ -19,6 +19,7 @@ package v1beta1
import ( import (
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
) )
// GroupName is the group name for this API. // GroupName is the group name for this API.
@ -38,12 +39,7 @@ var scheme = runtime.NewScheme()
// ParameterCodec knows about query parameters used with the meta v1beta1 API spec. // ParameterCodec knows about query parameters used with the meta v1beta1 API spec.
var ParameterCodec = runtime.NewParameterCodec(scheme) var ParameterCodec = runtime.NewParameterCodec(scheme)
func init() { // AddMetaToScheme registers base meta types into schemas.
if err := AddMetaToScheme(scheme); err != nil {
panic(err)
}
}
func AddMetaToScheme(scheme *runtime.Scheme) error { func AddMetaToScheme(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion, scheme.AddKnownTypes(SchemeGroupVersion,
&Table{}, &Table{},
@ -55,7 +51,11 @@ func AddMetaToScheme(scheme *runtime.Scheme) error {
return scheme.AddConversionFuncs( return scheme.AddConversionFuncs(
Convert_Slice_string_To_v1beta1_IncludeObjectPolicy, Convert_Slice_string_To_v1beta1_IncludeObjectPolicy,
) )
}
func init() {
utilruntime.Must(AddMetaToScheme(scheme))
// register manually. This usually goes through the SchemeBuilder, which we cannot use here. // register manually. This usually goes through the SchemeBuilder, which we cannot use here.
//scheme.AddGeneratedDeepCopyFuncs(GetGeneratedDeepCopyFuncs()...) utilruntime.Must(RegisterDefaults(scheme))
} }

View File

@ -54,6 +54,11 @@ type Selector interface {
// Make a deep copy of the selector. // Make a deep copy of the selector.
DeepCopySelector() Selector DeepCopySelector() Selector
// RequiresExactMatch allows a caller to introspect whether a given selector
// requires a single specific label to be set, and if so returns the value it
// requires.
RequiresExactMatch(label string) (value string, found bool)
} }
// Everything returns a selector that matches all labels. // Everything returns a selector that matches all labels.
@ -63,12 +68,13 @@ func Everything() Selector {
type nothingSelector struct{} type nothingSelector struct{}
func (n nothingSelector) Matches(_ Labels) bool { return false } func (n nothingSelector) Matches(_ Labels) bool { return false }
func (n nothingSelector) Empty() bool { return false } func (n nothingSelector) Empty() bool { return false }
func (n nothingSelector) String() string { return "" } func (n nothingSelector) String() string { return "" }
func (n nothingSelector) Add(_ ...Requirement) Selector { return n } func (n nothingSelector) Add(_ ...Requirement) Selector { return n }
func (n nothingSelector) Requirements() (Requirements, bool) { return nil, false } func (n nothingSelector) Requirements() (Requirements, bool) { return nil, false }
func (n nothingSelector) DeepCopySelector() Selector { return n } func (n nothingSelector) DeepCopySelector() Selector { return n }
func (n nothingSelector) RequiresExactMatch(label string) (value string, found bool) { return "", false }
// Nothing returns a selector that matches no labels // Nothing returns a selector that matches no labels
func Nothing() Selector { func Nothing() Selector {
@ -358,6 +364,23 @@ func (lsel internalSelector) String() string {
return strings.Join(reqs, ",") return strings.Join(reqs, ",")
} }
// RequiresExactMatch introspect whether a given selector requires a single specific field
// to be set, and if so returns the value it requires.
func (lsel internalSelector) RequiresExactMatch(label string) (value string, found bool) {
for ix := range lsel {
if lsel[ix].key == label {
switch lsel[ix].operator {
case selection.Equals, selection.DoubleEquals, selection.In:
if len(lsel[ix].strValues) == 1 {
return lsel[ix].strValues[0], true
}
}
return "", false
}
}
return "", false
}
// Token represents constant definition for lexer token // Token represents constant definition for lexer token
type Token int type Token int
@ -850,7 +873,7 @@ func SelectorFromSet(ls Set) Selector {
if ls == nil || len(ls) == 0 { if ls == nil || len(ls) == 0 {
return internalSelector{} return internalSelector{}
} }
var requirements internalSelector requirements := make([]Requirement, 0, len(ls))
for label, value := range ls { for label, value := range ls {
r, err := NewRequirement(label, selection.Equals, []string{value}) r, err := NewRequirement(label, selection.Equals, []string{value})
if err == nil { if err == nil {
@ -862,7 +885,7 @@ func SelectorFromSet(ls Set) Selector {
} }
// sort to have deterministic string representation // sort to have deterministic string representation
sort.Sort(ByKey(requirements)) sort.Sort(ByKey(requirements))
return requirements return internalSelector(requirements)
} }
// SelectorFromValidatedSet returns a Selector which will match exactly the given Set. // SelectorFromValidatedSet returns a Selector which will match exactly the given Set.
@ -872,13 +895,13 @@ func SelectorFromValidatedSet(ls Set) Selector {
if ls == nil || len(ls) == 0 { if ls == nil || len(ls) == 0 {
return internalSelector{} return internalSelector{}
} }
var requirements internalSelector requirements := make([]Requirement, 0, len(ls))
for label, value := range ls { for label, value := range ls {
requirements = append(requirements, Requirement{key: label, operator: selection.Equals, strValues: []string{value}}) requirements = append(requirements, Requirement{key: label, operator: selection.Equals, strValues: []string{value}})
} }
// sort to have deterministic string representation // sort to have deterministic string representation
sort.Sort(ByKey(requirements)) sort.Sort(ByKey(requirements))
return requirements return internalSelector(requirements)
} }
// ParseToRequirements takes a string representing a selector and returns a list of // ParseToRequirements takes a string representing a selector and returns a list of

View File

@ -19,13 +19,17 @@ package runtime
import ( import (
"bytes" "bytes"
"encoding/base64" "encoding/base64"
"encoding/json"
"fmt" "fmt"
"io" "io"
"net/url" "net/url"
"reflect" "reflect"
"strconv"
"strings"
"k8s.io/apimachinery/pkg/conversion/queryparams" "k8s.io/apimachinery/pkg/conversion/queryparams"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/klog"
) )
// codec binds an encoder and decoder. // codec binds an encoder and decoder.
@ -100,10 +104,19 @@ type NoopEncoder struct {
var _ Serializer = NoopEncoder{} var _ Serializer = NoopEncoder{}
const noopEncoderIdentifier Identifier = "noop"
func (n NoopEncoder) Encode(obj Object, w io.Writer) error { func (n NoopEncoder) Encode(obj Object, w io.Writer) error {
// There is no need to handle runtime.CacheableObject, as we don't
// process the obj at all.
return fmt.Errorf("encoding is not allowed for this codec: %v", reflect.TypeOf(n.Decoder)) return fmt.Errorf("encoding is not allowed for this codec: %v", reflect.TypeOf(n.Decoder))
} }
// Identifier implements runtime.Encoder interface.
func (n NoopEncoder) Identifier() Identifier {
return noopEncoderIdentifier
}
// NoopDecoder converts an Encoder to a Serializer or Codec for code that expects them but only uses encoding. // NoopDecoder converts an Encoder to a Serializer or Codec for code that expects them but only uses encoding.
type NoopDecoder struct { type NoopDecoder struct {
Encoder Encoder
@ -193,19 +206,51 @@ func (c *parameterCodec) EncodeParameters(obj Object, to schema.GroupVersion) (u
type base64Serializer struct { type base64Serializer struct {
Encoder Encoder
Decoder Decoder
identifier Identifier
} }
func NewBase64Serializer(e Encoder, d Decoder) Serializer { func NewBase64Serializer(e Encoder, d Decoder) Serializer {
return &base64Serializer{e, d} return &base64Serializer{
Encoder: e,
Decoder: d,
identifier: identifier(e),
}
}
func identifier(e Encoder) Identifier {
result := map[string]string{
"name": "base64",
}
if e != nil {
result["encoder"] = string(e.Identifier())
}
identifier, err := json.Marshal(result)
if err != nil {
klog.Fatalf("Failed marshaling identifier for base64Serializer: %v", err)
}
return Identifier(identifier)
} }
func (s base64Serializer) Encode(obj Object, stream io.Writer) error { func (s base64Serializer) Encode(obj Object, stream io.Writer) error {
if co, ok := obj.(CacheableObject); ok {
return co.CacheEncode(s.Identifier(), s.doEncode, stream)
}
return s.doEncode(obj, stream)
}
func (s base64Serializer) doEncode(obj Object, stream io.Writer) error {
e := base64.NewEncoder(base64.StdEncoding, stream) e := base64.NewEncoder(base64.StdEncoding, stream)
err := s.Encoder.Encode(obj, e) err := s.Encoder.Encode(obj, e)
e.Close() e.Close()
return err return err
} }
// Identifier implements runtime.Encoder interface.
func (s base64Serializer) Identifier() Identifier {
return s.identifier
}
func (s base64Serializer) Decode(data []byte, defaults *schema.GroupVersionKind, into Object) (Object, *schema.GroupVersionKind, error) { func (s base64Serializer) Decode(data []byte, defaults *schema.GroupVersionKind, into Object) (Object, *schema.GroupVersionKind, error) {
out := make([]byte, base64.StdEncoding.DecodedLen(len(data))) out := make([]byte, base64.StdEncoding.DecodedLen(len(data)))
n, err := base64.StdEncoding.Decode(out, data) n, err := base64.StdEncoding.Decode(out, data)
@ -238,6 +283,11 @@ var (
DisabledGroupVersioner GroupVersioner = disabledGroupVersioner{} DisabledGroupVersioner GroupVersioner = disabledGroupVersioner{}
) )
const (
internalGroupVersionerIdentifier = "internal"
disabledGroupVersionerIdentifier = "disabled"
)
type internalGroupVersioner struct{} type internalGroupVersioner struct{}
// KindForGroupVersionKinds returns an internal Kind if one is found, or converts the first provided kind to the internal version. // KindForGroupVersionKinds returns an internal Kind if one is found, or converts the first provided kind to the internal version.
@ -253,6 +303,11 @@ func (internalGroupVersioner) KindForGroupVersionKinds(kinds []schema.GroupVersi
return schema.GroupVersionKind{}, false return schema.GroupVersionKind{}, false
} }
// Identifier implements GroupVersioner interface.
func (internalGroupVersioner) Identifier() string {
return internalGroupVersionerIdentifier
}
type disabledGroupVersioner struct{} type disabledGroupVersioner struct{}
// KindForGroupVersionKinds returns false for any input. // KindForGroupVersionKinds returns false for any input.
@ -260,19 +315,9 @@ func (disabledGroupVersioner) KindForGroupVersionKinds(kinds []schema.GroupVersi
return schema.GroupVersionKind{}, false return schema.GroupVersionKind{}, false
} }
// GroupVersioners implements GroupVersioner and resolves to the first exact match for any kind. // Identifier implements GroupVersioner interface.
type GroupVersioners []GroupVersioner func (disabledGroupVersioner) Identifier() string {
return disabledGroupVersionerIdentifier
// KindForGroupVersionKinds returns the first match of any of the group versioners, or false if no match occurred.
func (gvs GroupVersioners) KindForGroupVersionKinds(kinds []schema.GroupVersionKind) (schema.GroupVersionKind, bool) {
for _, gv := range gvs {
target, ok := gv.KindForGroupVersionKinds(kinds)
if !ok {
continue
}
return target, true
}
return schema.GroupVersionKind{}, false
} }
// Assert that schema.GroupVersion and GroupVersions implement GroupVersioner // Assert that schema.GroupVersion and GroupVersions implement GroupVersioner
@ -330,3 +375,22 @@ func (v multiGroupVersioner) KindForGroupVersionKinds(kinds []schema.GroupVersio
} }
return schema.GroupVersionKind{}, false return schema.GroupVersionKind{}, false
} }
// Identifier implements GroupVersioner interface.
func (v multiGroupVersioner) Identifier() string {
groupKinds := make([]string, 0, len(v.acceptedGroupKinds))
for _, gk := range v.acceptedGroupKinds {
groupKinds = append(groupKinds, gk.String())
}
result := map[string]string{
"name": "multi",
"target": v.target.String(),
"accepted": strings.Join(groupKinds, ","),
"coerce": strconv.FormatBool(v.coerce),
}
identifier, err := json.Marshal(result)
if err != nil {
klog.Fatalf("Failed marshaling Identifier for %#v: %v", v, err)
}
return string(identifier)
}

View File

@ -61,19 +61,21 @@ var DefaultStringConversions = []interface{}{
Convert_Slice_string_To_int64, Convert_Slice_string_To_int64,
} }
func Convert_Slice_string_To_string(input *[]string, out *string, s conversion.Scope) error { func Convert_Slice_string_To_string(in *[]string, out *string, s conversion.Scope) error {
if len(*input) == 0 { if len(*in) == 0 {
*out = "" *out = ""
return nil
} }
*out = (*input)[0] *out = (*in)[0]
return nil return nil
} }
func Convert_Slice_string_To_int(input *[]string, out *int, s conversion.Scope) error { func Convert_Slice_string_To_int(in *[]string, out *int, s conversion.Scope) error {
if len(*input) == 0 { if len(*in) == 0 {
*out = 0 *out = 0
return nil
} }
str := (*input)[0] str := (*in)[0]
i, err := strconv.Atoi(str) i, err := strconv.Atoi(str)
if err != nil { if err != nil {
return err return err
@ -83,15 +85,16 @@ func Convert_Slice_string_To_int(input *[]string, out *int, s conversion.Scope)
} }
// Convert_Slice_string_To_bool will convert a string parameter to boolean. // Convert_Slice_string_To_bool will convert a string parameter to boolean.
// Only the absence of a value, a value of "false", or a value of "0" resolve to false. // Only the absence of a value (i.e. zero-length slice), a value of "false", or a
// value of "0" resolve to false.
// Any other value (including empty string) resolves to true. // Any other value (including empty string) resolves to true.
func Convert_Slice_string_To_bool(input *[]string, out *bool, s conversion.Scope) error { func Convert_Slice_string_To_bool(in *[]string, out *bool, s conversion.Scope) error {
if len(*input) == 0 { if len(*in) == 0 {
*out = false *out = false
return nil return nil
} }
switch strings.ToLower((*input)[0]) { switch {
case "false", "0": case (*in)[0] == "0", strings.EqualFold((*in)[0], "false"):
*out = false *out = false
default: default:
*out = true *out = true
@ -99,15 +102,79 @@ func Convert_Slice_string_To_bool(input *[]string, out *bool, s conversion.Scope
return nil return nil
} }
func Convert_Slice_string_To_int64(input *[]string, out *int64, s conversion.Scope) error { // Convert_Slice_string_To_bool will convert a string parameter to boolean.
if len(*input) == 0 { // Only the absence of a value (i.e. zero-length slice), a value of "false", or a
*out = 0 // value of "0" resolve to false.
// Any other value (including empty string) resolves to true.
func Convert_Slice_string_To_Pointer_bool(in *[]string, out **bool, s conversion.Scope) error {
if len(*in) == 0 {
boolVar := false
*out = &boolVar
return nil
} }
str := (*input)[0] switch {
i, err := strconv.ParseInt(str, 10, 64) case (*in)[0] == "0", strings.EqualFold((*in)[0], "false"):
boolVar := false
*out = &boolVar
default:
boolVar := true
*out = &boolVar
}
return nil
}
func string_to_int64(in string) (int64, error) {
return strconv.ParseInt(in, 10, 64)
}
func Convert_string_To_int64(in *string, out *int64, s conversion.Scope) error {
if in == nil {
*out = 0
return nil
}
i, err := string_to_int64(*in)
if err != nil { if err != nil {
return err return err
} }
*out = i *out = i
return nil return nil
} }
func Convert_Slice_string_To_int64(in *[]string, out *int64, s conversion.Scope) error {
if len(*in) == 0 {
*out = 0
return nil
}
i, err := string_to_int64((*in)[0])
if err != nil {
return err
}
*out = i
return nil
}
func Convert_string_To_Pointer_int64(in *string, out **int64, s conversion.Scope) error {
if in == nil {
*out = nil
return nil
}
i, err := string_to_int64(*in)
if err != nil {
return err
}
*out = &i
return nil
}
func Convert_Slice_string_To_Pointer_int64(in *[]string, out **int64, s conversion.Scope) error {
if len(*in) == 0 {
*out = nil
return nil
}
i, err := string_to_int64((*in)[0])
if err != nil {
return err
}
*out = &i
return nil
}

View File

@ -37,13 +37,36 @@ type GroupVersioner interface {
// Scheme.New(target) and then perform a conversion between the current Go type and the destination Go type. // Scheme.New(target) and then perform a conversion between the current Go type and the destination Go type.
// Sophisticated implementations may use additional information about the input kinds to pick a destination kind. // Sophisticated implementations may use additional information about the input kinds to pick a destination kind.
KindForGroupVersionKinds(kinds []schema.GroupVersionKind) (target schema.GroupVersionKind, ok bool) KindForGroupVersionKinds(kinds []schema.GroupVersionKind) (target schema.GroupVersionKind, ok bool)
// Identifier returns string representation of the object.
// Identifiers of two different encoders should be equal only if for every input
// kinds they return the same result.
Identifier() string
} }
// Identifier represents an identifier.
// Identitier of two different objects should be equal if and only if for every
// input the output they produce is exactly the same.
type Identifier string
// Encoder writes objects to a serialized form // Encoder writes objects to a serialized form
type Encoder interface { type Encoder interface {
// Encode writes an object to a stream. Implementations may return errors if the versions are // Encode writes an object to a stream. Implementations may return errors if the versions are
// incompatible, or if no conversion is defined. // incompatible, or if no conversion is defined.
Encode(obj Object, w io.Writer) error Encode(obj Object, w io.Writer) error
// Identifier returns an identifier of the encoder.
// Identifiers of two different encoders should be equal if and only if for every input
// object it will be encoded to the same representation by both of them.
//
// Identifier is inteted for use with CacheableObject#CacheEncode method. In order to
// correctly handle CacheableObject, Encode() method should look similar to below, where
// doEncode() is the encoding logic of implemented encoder:
// func (e *MyEncoder) Encode(obj Object, w io.Writer) error {
// if co, ok := obj.(CacheableObject); ok {
// return co.CacheEncode(e.Identifier(), e.doEncode, w)
// }
// return e.doEncode(obj, w)
// }
Identifier() Identifier
} }
// Decoder attempts to load an object from data. // Decoder attempts to load an object from data.
@ -132,6 +155,28 @@ type NegotiatedSerializer interface {
DecoderToVersion(serializer Decoder, gv GroupVersioner) Decoder DecoderToVersion(serializer Decoder, gv GroupVersioner) Decoder
} }
// ClientNegotiator handles turning an HTTP content type into the appropriate encoder.
// Use NewClientNegotiator or NewVersionedClientNegotiator to create this interface from
// a NegotiatedSerializer.
type ClientNegotiator interface {
// Encoder returns the appropriate encoder for the provided contentType (e.g. application/json)
// and any optional mediaType parameters (e.g. pretty=1), or an error. If no serializer is found
// a NegotiateError will be returned. The current client implementations consider params to be
// optional modifiers to the contentType and will ignore unrecognized parameters.
Encoder(contentType string, params map[string]string) (Encoder, error)
// Decoder returns the appropriate decoder for the provided contentType (e.g. application/json)
// and any optional mediaType parameters (e.g. pretty=1), or an error. If no serializer is found
// a NegotiateError will be returned. The current client implementations consider params to be
// optional modifiers to the contentType and will ignore unrecognized parameters.
Decoder(contentType string, params map[string]string) (Decoder, error)
// StreamDecoder returns the appropriate stream decoder for the provided contentType (e.g.
// application/json) and any optional mediaType parameters (e.g. pretty=1), or an error. If no
// serializer is found a NegotiateError will be returned. The Serializer and Framer will always
// be returned if a Decoder is returned. The current client implementations consider params to be
// optional modifiers to the contentType and will ignore unrecognized parameters.
StreamDecoder(contentType string, params map[string]string) (Decoder, Serializer, Framer, error)
}
// StorageSerializer is an interface used for obtaining encoders, decoders, and serializers // StorageSerializer is an interface used for obtaining encoders, decoders, and serializers
// that can read and write data at rest. This would commonly be used by client tools that must // that can read and write data at rest. This would commonly be used by client tools that must
// read files, or server side storage interfaces that persist restful objects. // read files, or server side storage interfaces that persist restful objects.
@ -256,6 +301,27 @@ type Object interface {
DeepCopyObject() Object DeepCopyObject() Object
} }
// CacheableObject allows an object to cache its different serializations
// to avoid performing the same serialization multiple times.
type CacheableObject interface {
// CacheEncode writes an object to a stream. The <encode> function will
// be used in case of cache miss. The <encode> function takes ownership
// of the object.
// If CacheableObject is a wrapper, then deep-copy of the wrapped object
// should be passed to <encode> function.
// CacheEncode assumes that for two different calls with the same <id>,
// <encode> function will also be the same.
CacheEncode(id Identifier, encode func(Object, io.Writer) error, w io.Writer) error
// GetObject returns a deep-copy of an object to be encoded - the caller of
// GetObject() is the owner of returned object. The reason for making a copy
// is to avoid bugs, where caller modifies the object and forgets to copy it,
// thus modifying the object for everyone.
// The object returned by GetObject should be the same as the one that is supposed
// to be passed to <encode> function in CacheEncode method.
// If CacheableObject is a wrapper, the copy of wrapped object should be returned.
GetObject() Object
}
// Unstructured objects store values as map[string]interface{}, with only values that can be serialized // Unstructured objects store values as map[string]interface{}, with only values that can be serialized
// to JSON allowed. // to JSON allowed.
type Unstructured interface { type Unstructured interface {

146
vendor/k8s.io/apimachinery/pkg/runtime/negotiate.go generated vendored Normal file
View File

@ -0,0 +1,146 @@
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT 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 runtime
import (
"fmt"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// NegotiateError is returned when a ClientNegotiator is unable to locate
// a serializer for the requested operation.
type NegotiateError struct {
ContentType string
Stream bool
}
func (e NegotiateError) Error() string {
if e.Stream {
return fmt.Sprintf("no stream serializers registered for %s", e.ContentType)
}
return fmt.Sprintf("no serializers registered for %s", e.ContentType)
}
type clientNegotiator struct {
serializer NegotiatedSerializer
encode, decode GroupVersioner
}
func (n *clientNegotiator) Encoder(contentType string, params map[string]string) (Encoder, error) {
// TODO: `pretty=1` is handled in NegotiateOutputMediaType, consider moving it to this method
// if client negotiators truly need to use it
mediaTypes := n.serializer.SupportedMediaTypes()
info, ok := SerializerInfoForMediaType(mediaTypes, contentType)
if !ok {
if len(contentType) != 0 || len(mediaTypes) == 0 {
return nil, NegotiateError{ContentType: contentType}
}
info = mediaTypes[0]
}
return n.serializer.EncoderForVersion(info.Serializer, n.encode), nil
}
func (n *clientNegotiator) Decoder(contentType string, params map[string]string) (Decoder, error) {
mediaTypes := n.serializer.SupportedMediaTypes()
info, ok := SerializerInfoForMediaType(mediaTypes, contentType)
if !ok {
if len(contentType) != 0 || len(mediaTypes) == 0 {
return nil, NegotiateError{ContentType: contentType}
}
info = mediaTypes[0]
}
return n.serializer.DecoderToVersion(info.Serializer, n.decode), nil
}
func (n *clientNegotiator) StreamDecoder(contentType string, params map[string]string) (Decoder, Serializer, Framer, error) {
mediaTypes := n.serializer.SupportedMediaTypes()
info, ok := SerializerInfoForMediaType(mediaTypes, contentType)
if !ok {
if len(contentType) != 0 || len(mediaTypes) == 0 {
return nil, nil, nil, NegotiateError{ContentType: contentType, Stream: true}
}
info = mediaTypes[0]
}
if info.StreamSerializer == nil {
return nil, nil, nil, NegotiateError{ContentType: info.MediaType, Stream: true}
}
return n.serializer.DecoderToVersion(info.Serializer, n.decode), info.StreamSerializer.Serializer, info.StreamSerializer.Framer, nil
}
// NewClientNegotiator will attempt to retrieve the appropriate encoder, decoder, or
// stream decoder for a given content type. Does not perform any conversion, but will
// encode the object to the desired group, version, and kind. Use when creating a client.
func NewClientNegotiator(serializer NegotiatedSerializer, gv schema.GroupVersion) ClientNegotiator {
return &clientNegotiator{
serializer: serializer,
encode: gv,
}
}
// NewInternalClientNegotiator applies the default client rules for connecting to a Kubernetes apiserver
// where objects are converted to gv prior to sending and decoded to their internal representation prior
// to retrieval.
//
// DEPRECATED: Internal clients are deprecated and will be removed in a future Kubernetes release.
func NewInternalClientNegotiator(serializer NegotiatedSerializer, gv schema.GroupVersion) ClientNegotiator {
decode := schema.GroupVersions{
{
Group: gv.Group,
Version: APIVersionInternal,
},
// always include the legacy group as a decoding target to handle non-error `Status` return types
{
Group: "",
Version: APIVersionInternal,
},
}
return &clientNegotiator{
encode: gv,
decode: decode,
serializer: serializer,
}
}
// NewSimpleClientNegotiator will negotiate for a single serializer. This should only be used
// for testing or when the caller is taking responsibility for setting the GVK on encoded objects.
func NewSimpleClientNegotiator(info SerializerInfo, gv schema.GroupVersion) ClientNegotiator {
return &clientNegotiator{
serializer: &simpleNegotiatedSerializer{info: info},
encode: gv,
}
}
type simpleNegotiatedSerializer struct {
info SerializerInfo
}
func NewSimpleNegotiatedSerializer(info SerializerInfo) NegotiatedSerializer {
return &simpleNegotiatedSerializer{info: info}
}
func (n *simpleNegotiatedSerializer) SupportedMediaTypes() []SerializerInfo {
return []SerializerInfo{n.info}
}
func (n *simpleNegotiatedSerializer) EncoderForVersion(e Encoder, _ GroupVersioner) Encoder {
return e
}
func (n *simpleNegotiatedSerializer) DecoderToVersion(d Decoder, _gv GroupVersioner) Decoder {
return d
}

View File

@ -29,33 +29,3 @@ func (obj *TypeMeta) GroupVersionKind() schema.GroupVersionKind {
} }
func (obj *TypeMeta) GetObjectKind() schema.ObjectKind { return obj } func (obj *TypeMeta) GetObjectKind() schema.ObjectKind { return obj }
// GetObjectKind implements Object for VersionedObjects, returning an empty ObjectKind
// interface if no objects are provided, or the ObjectKind interface of the object in the
// highest array position.
func (obj *VersionedObjects) GetObjectKind() schema.ObjectKind {
last := obj.Last()
if last == nil {
return schema.EmptyObjectKind
}
return last.GetObjectKind()
}
// First returns the leftmost object in the VersionedObjects array, which is usually the
// object as serialized on the wire.
func (obj *VersionedObjects) First() Object {
if len(obj.Objects) == 0 {
return nil
}
return obj.Objects[0]
}
// Last is the rightmost object in the VersionedObjects array, which is the object after
// all transformations have been applied. This is the same object that would be returned
// by Decode in a normal invocation (without VersionedObjects in the into argument).
func (obj *VersionedObjects) Last() Object {
if len(obj.Objects) == 0 {
return nil
}
return obj.Objects[len(obj.Objects)-1]
}

View File

@ -191,6 +191,11 @@ func (gv GroupVersion) String() string {
return gv.Version return gv.Version
} }
// Identifier implements runtime.GroupVersioner interface.
func (gv GroupVersion) Identifier() string {
return gv.String()
}
// KindForGroupVersionKinds identifies the preferred GroupVersionKind out of a list. It returns ok false // KindForGroupVersionKinds identifies the preferred GroupVersionKind out of a list. It returns ok false
// if none of the options match the group. It prefers a match to group and version over just group. // if none of the options match the group. It prefers a match to group and version over just group.
// TODO: Move GroupVersion to a package under pkg/runtime, since it's used by scheme. // TODO: Move GroupVersion to a package under pkg/runtime, since it's used by scheme.
@ -246,6 +251,15 @@ func (gv GroupVersion) WithResource(resource string) GroupVersionResource {
// in fewer places. // in fewer places.
type GroupVersions []GroupVersion type GroupVersions []GroupVersion
// Identifier implements runtime.GroupVersioner interface.
func (gv GroupVersions) Identifier() string {
groupVersions := make([]string, 0, len(gv))
for i := range gv {
groupVersions = append(groupVersions, gv[i].String())
}
return fmt.Sprintf("[%s]", strings.Join(groupVersions, ","))
}
// KindForGroupVersionKinds identifies the preferred GroupVersionKind out of a list. It returns ok false // KindForGroupVersionKinds identifies the preferred GroupVersionKind out of a list. It returns ok false
// if none of the options match the group. // if none of the options match the group.
func (gvs GroupVersions) KindForGroupVersionKinds(kinds []GroupVersionKind) (GroupVersionKind, bool) { func (gvs GroupVersions) KindForGroupVersionKinds(kinds []GroupVersionKind) (GroupVersionKind, bool) {

View File

@ -31,6 +31,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/serializer/recognizer" "k8s.io/apimachinery/pkg/runtime/serializer/recognizer"
"k8s.io/apimachinery/pkg/util/framer" "k8s.io/apimachinery/pkg/util/framer"
utilyaml "k8s.io/apimachinery/pkg/util/yaml" utilyaml "k8s.io/apimachinery/pkg/util/yaml"
"k8s.io/klog"
) )
// NewSerializer creates a JSON serializer that handles encoding versioned objects into the proper JSON form. If typer // NewSerializer creates a JSON serializer that handles encoding versioned objects into the proper JSON form. If typer
@ -53,13 +54,28 @@ func NewYAMLSerializer(meta MetaFactory, creater runtime.ObjectCreater, typer ru
// and are immutable. // and are immutable.
func NewSerializerWithOptions(meta MetaFactory, creater runtime.ObjectCreater, typer runtime.ObjectTyper, options SerializerOptions) *Serializer { func NewSerializerWithOptions(meta MetaFactory, creater runtime.ObjectCreater, typer runtime.ObjectTyper, options SerializerOptions) *Serializer {
return &Serializer{ return &Serializer{
meta: meta, meta: meta,
creater: creater, creater: creater,
typer: typer, typer: typer,
options: options, options: options,
identifier: identifier(options),
} }
} }
// identifier computes Identifier of Encoder based on the given options.
func identifier(options SerializerOptions) runtime.Identifier {
result := map[string]string{
"name": "json",
"yaml": strconv.FormatBool(options.Yaml),
"pretty": strconv.FormatBool(options.Pretty),
}
identifier, err := json.Marshal(result)
if err != nil {
klog.Fatalf("Failed marshaling identifier for json Serializer: %v", err)
}
return runtime.Identifier(identifier)
}
// SerializerOptions holds the options which are used to configure a JSON/YAML serializer. // SerializerOptions holds the options which are used to configure a JSON/YAML serializer.
// example: // example:
// (1) To configure a JSON serializer, set `Yaml` to `false`. // (1) To configure a JSON serializer, set `Yaml` to `false`.
@ -85,6 +101,8 @@ type Serializer struct {
options SerializerOptions options SerializerOptions
creater runtime.ObjectCreater creater runtime.ObjectCreater
typer runtime.ObjectTyper typer runtime.ObjectTyper
identifier runtime.Identifier
} }
// Serializer implements Serializer // Serializer implements Serializer
@ -188,16 +206,6 @@ func gvkWithDefaults(actual, defaultGVK schema.GroupVersionKind) schema.GroupVer
// On success or most errors, the method will return the calculated schema kind. // On success or most errors, the method will return the calculated schema kind.
// The gvk calculate priority will be originalData > default gvk > into // The gvk calculate priority will be originalData > default gvk > into
func (s *Serializer) Decode(originalData []byte, gvk *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) { func (s *Serializer) Decode(originalData []byte, gvk *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) {
if versioned, ok := into.(*runtime.VersionedObjects); ok {
into = versioned.Last()
obj, actual, err := s.Decode(originalData, gvk, into)
if err != nil {
return nil, actual, err
}
versioned.Objects = []runtime.Object{obj}
return versioned, actual, nil
}
data := originalData data := originalData
if s.options.Yaml { if s.options.Yaml {
altered, err := yaml.YAMLToJSON(data) altered, err := yaml.YAMLToJSON(data)
@ -286,6 +294,13 @@ func (s *Serializer) Decode(originalData []byte, gvk *schema.GroupVersionKind, i
// Encode serializes the provided object to the given writer. // Encode serializes the provided object to the given writer.
func (s *Serializer) Encode(obj runtime.Object, w io.Writer) error { func (s *Serializer) Encode(obj runtime.Object, w io.Writer) error {
if co, ok := obj.(runtime.CacheableObject); ok {
return co.CacheEncode(s.Identifier(), s.doEncode, w)
}
return s.doEncode(obj, w)
}
func (s *Serializer) doEncode(obj runtime.Object, w io.Writer) error {
if s.options.Yaml { if s.options.Yaml {
json, err := caseSensitiveJsonIterator.Marshal(obj) json, err := caseSensitiveJsonIterator.Marshal(obj)
if err != nil { if err != nil {
@ -311,6 +326,11 @@ func (s *Serializer) Encode(obj runtime.Object, w io.Writer) error {
return encoder.Encode(obj) return encoder.Encode(obj)
} }
// Identifier implements runtime.Encoder interface.
func (s *Serializer) Identifier() runtime.Identifier {
return s.identifier
}
// RecognizesData implements the RecognizingDecoder interface. // RecognizesData implements the RecognizingDecoder interface.
func (s *Serializer) RecognizesData(peek io.Reader) (ok, unknown bool, err error) { func (s *Serializer) RecognizesData(peek io.Reader) (ok, unknown bool, err error) {
if s.options.Yaml { if s.options.Yaml {

View File

@ -86,6 +86,8 @@ type Serializer struct {
var _ runtime.Serializer = &Serializer{} var _ runtime.Serializer = &Serializer{}
var _ recognizer.RecognizingDecoder = &Serializer{} var _ recognizer.RecognizingDecoder = &Serializer{}
const serializerIdentifier runtime.Identifier = "protobuf"
// Decode attempts to convert the provided data into a protobuf message, extract the stored schema kind, apply the provided default // Decode attempts to convert the provided data into a protobuf message, extract the stored schema kind, apply the provided default
// gvk, and then load that data into an object matching the desired schema kind or the provided into. If into is *runtime.Unknown, // gvk, and then load that data into an object matching the desired schema kind or the provided into. If into is *runtime.Unknown,
// the raw data will be extracted and no decoding will be performed. If into is not registered with the typer, then the object will // the raw data will be extracted and no decoding will be performed. If into is not registered with the typer, then the object will
@ -93,23 +95,6 @@ var _ recognizer.RecognizingDecoder = &Serializer{}
// not fully qualified with kind/version/group, the type of the into will be used to alter the returned gvk. On success or most // not fully qualified with kind/version/group, the type of the into will be used to alter the returned gvk. On success or most
// errors, the method will return the calculated schema kind. // errors, the method will return the calculated schema kind.
func (s *Serializer) Decode(originalData []byte, gvk *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) { func (s *Serializer) Decode(originalData []byte, gvk *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) {
if versioned, ok := into.(*runtime.VersionedObjects); ok {
into = versioned.Last()
obj, actual, err := s.Decode(originalData, gvk, into)
if err != nil {
return nil, actual, err
}
// the last item in versioned becomes into, so if versioned was not originally empty we reset the object
// array so the first position is the decoded object and the second position is the outermost object.
// if there were no objects in the versioned list passed to us, only add ourselves.
if into != nil && into != obj {
versioned.Objects = []runtime.Object{obj, into}
} else {
versioned.Objects = []runtime.Object{obj}
}
return versioned, actual, err
}
prefixLen := len(s.prefix) prefixLen := len(s.prefix)
switch { switch {
case len(originalData) == 0: case len(originalData) == 0:
@ -176,6 +161,13 @@ func (s *Serializer) Decode(originalData []byte, gvk *schema.GroupVersionKind, i
// Encode serializes the provided object to the given writer. // Encode serializes the provided object to the given writer.
func (s *Serializer) Encode(obj runtime.Object, w io.Writer) error { func (s *Serializer) Encode(obj runtime.Object, w io.Writer) error {
if co, ok := obj.(runtime.CacheableObject); ok {
return co.CacheEncode(s.Identifier(), s.doEncode, w)
}
return s.doEncode(obj, w)
}
func (s *Serializer) doEncode(obj runtime.Object, w io.Writer) error {
prefixSize := uint64(len(s.prefix)) prefixSize := uint64(len(s.prefix))
var unk runtime.Unknown var unk runtime.Unknown
@ -245,6 +237,11 @@ func (s *Serializer) Encode(obj runtime.Object, w io.Writer) error {
} }
} }
// Identifier implements runtime.Encoder interface.
func (s *Serializer) Identifier() runtime.Identifier {
return serializerIdentifier
}
// RecognizesData implements the RecognizingDecoder interface. // RecognizesData implements the RecognizingDecoder interface.
func (s *Serializer) RecognizesData(peek io.Reader) (bool, bool, error) { func (s *Serializer) RecognizesData(peek io.Reader) (bool, bool, error) {
prefix := make([]byte, 4) prefix := make([]byte, 4)
@ -321,6 +318,8 @@ type RawSerializer struct {
var _ runtime.Serializer = &RawSerializer{} var _ runtime.Serializer = &RawSerializer{}
const rawSerializerIdentifier runtime.Identifier = "raw-protobuf"
// Decode attempts to convert the provided data into a protobuf message, extract the stored schema kind, apply the provided default // Decode attempts to convert the provided data into a protobuf message, extract the stored schema kind, apply the provided default
// gvk, and then load that data into an object matching the desired schema kind or the provided into. If into is *runtime.Unknown, // gvk, and then load that data into an object matching the desired schema kind or the provided into. If into is *runtime.Unknown,
// the raw data will be extracted and no decoding will be performed. If into is not registered with the typer, then the object will // the raw data will be extracted and no decoding will be performed. If into is not registered with the typer, then the object will
@ -332,20 +331,6 @@ func (s *RawSerializer) Decode(originalData []byte, gvk *schema.GroupVersionKind
return nil, nil, fmt.Errorf("this serializer requires an object to decode into: %#v", s) return nil, nil, fmt.Errorf("this serializer requires an object to decode into: %#v", s)
} }
if versioned, ok := into.(*runtime.VersionedObjects); ok {
into = versioned.Last()
obj, actual, err := s.Decode(originalData, gvk, into)
if err != nil {
return nil, actual, err
}
if into != nil && into != obj {
versioned.Objects = []runtime.Object{obj, into}
} else {
versioned.Objects = []runtime.Object{obj}
}
return versioned, actual, err
}
if len(originalData) == 0 { if len(originalData) == 0 {
// TODO: treat like decoding {} from JSON with defaulting // TODO: treat like decoding {} from JSON with defaulting
return nil, nil, fmt.Errorf("empty data") return nil, nil, fmt.Errorf("empty data")
@ -419,6 +404,13 @@ func unmarshalToObject(typer runtime.ObjectTyper, creater runtime.ObjectCreater,
// Encode serializes the provided object to the given writer. Overrides is ignored. // Encode serializes the provided object to the given writer. Overrides is ignored.
func (s *RawSerializer) Encode(obj runtime.Object, w io.Writer) error { func (s *RawSerializer) Encode(obj runtime.Object, w io.Writer) error {
if co, ok := obj.(runtime.CacheableObject); ok {
return co.CacheEncode(s.Identifier(), s.doEncode, w)
}
return s.doEncode(obj, w)
}
func (s *RawSerializer) doEncode(obj runtime.Object, w io.Writer) error {
switch t := obj.(type) { switch t := obj.(type) {
case bufferedReverseMarshaller: case bufferedReverseMarshaller:
// this path performs a single allocation during write but requires the caller to implement // this path performs a single allocation during write but requires the caller to implement
@ -460,6 +452,11 @@ func (s *RawSerializer) Encode(obj runtime.Object, w io.Writer) error {
} }
} }
// Identifier implements runtime.Encoder interface.
func (s *RawSerializer) Identifier() runtime.Identifier {
return rawSerializerIdentifier
}
var LengthDelimitedFramer = lengthDelimitedFramer{} var LengthDelimitedFramer = lengthDelimitedFramer{}
type lengthDelimitedFramer struct{} type lengthDelimitedFramer struct{}

View File

@ -17,12 +17,15 @@ limitations under the License.
package versioning package versioning
import ( import (
"encoding/json"
"io" "io"
"reflect" "reflect"
"sync"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/klog"
) )
// NewDefaultingCodecForScheme is a convenience method for callers that are using a scheme. // NewDefaultingCodecForScheme is a convenience method for callers that are using a scheme.
@ -62,6 +65,8 @@ func NewCodec(
encodeVersion: encodeVersion, encodeVersion: encodeVersion,
decodeVersion: decodeVersion, decodeVersion: decodeVersion,
identifier: identifier(encodeVersion, encoder),
originalSchemeName: originalSchemeName, originalSchemeName: originalSchemeName,
} }
return internal return internal
@ -78,19 +83,47 @@ type codec struct {
encodeVersion runtime.GroupVersioner encodeVersion runtime.GroupVersioner
decodeVersion runtime.GroupVersioner decodeVersion runtime.GroupVersioner
identifier runtime.Identifier
// originalSchemeName is optional, but when filled in it holds the name of the scheme from which this codec originates // originalSchemeName is optional, but when filled in it holds the name of the scheme from which this codec originates
originalSchemeName string originalSchemeName string
} }
var identifiersMap sync.Map
type codecIdentifier struct {
EncodeGV string `json:"encodeGV,omitempty"`
Encoder string `json:"encoder,omitempty"`
Name string `json:"name,omitempty"`
}
// identifier computes Identifier of Encoder based on codec parameters.
func identifier(encodeGV runtime.GroupVersioner, encoder runtime.Encoder) runtime.Identifier {
result := codecIdentifier{
Name: "versioning",
}
if encodeGV != nil {
result.EncodeGV = encodeGV.Identifier()
}
if encoder != nil {
result.Encoder = string(encoder.Identifier())
}
if id, ok := identifiersMap.Load(result); ok {
return id.(runtime.Identifier)
}
identifier, err := json.Marshal(result)
if err != nil {
klog.Fatalf("Failed marshaling identifier for codec: %v", err)
}
identifiersMap.Store(result, runtime.Identifier(identifier))
return runtime.Identifier(identifier)
}
// Decode attempts a decode of the object, then tries to convert it to the internal version. If into is provided and the decoding is // Decode attempts a decode of the object, then tries to convert it to the internal version. If into is provided and the decoding is
// successful, the returned runtime.Object will be the value passed as into. Note that this may bypass conversion if you pass an // successful, the returned runtime.Object will be the value passed as into. Note that this may bypass conversion if you pass an
// into that matches the serialized version. // into that matches the serialized version.
func (c *codec) Decode(data []byte, defaultGVK *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) { func (c *codec) Decode(data []byte, defaultGVK *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) {
versioned, isVersioned := into.(*runtime.VersionedObjects)
if isVersioned {
into = versioned.Last()
}
// If the into object is unstructured and expresses an opinion about its group/version, // If the into object is unstructured and expresses an opinion about its group/version,
// create a new instance of the type so we always exercise the conversion path (skips short-circuiting on `into == obj`) // create a new instance of the type so we always exercise the conversion path (skips short-circuiting on `into == obj`)
decodeInto := into decodeInto := into
@ -115,22 +148,11 @@ func (c *codec) Decode(data []byte, defaultGVK *schema.GroupVersionKind, into ru
if into != nil { if into != nil {
// perform defaulting if requested // perform defaulting if requested
if c.defaulter != nil { if c.defaulter != nil {
// create a copy to ensure defaulting is not applied to the original versioned objects
if isVersioned {
versioned.Objects = []runtime.Object{obj.DeepCopyObject()}
}
c.defaulter.Default(obj) c.defaulter.Default(obj)
} else {
if isVersioned {
versioned.Objects = []runtime.Object{obj}
}
} }
// Short-circuit conversion if the into object is same object // Short-circuit conversion if the into object is same object
if into == obj { if into == obj {
if isVersioned {
return versioned, gvk, nil
}
return into, gvk, nil return into, gvk, nil
} }
@ -138,19 +160,9 @@ func (c *codec) Decode(data []byte, defaultGVK *schema.GroupVersionKind, into ru
return nil, gvk, err return nil, gvk, err
} }
if isVersioned {
versioned.Objects = append(versioned.Objects, into)
return versioned, gvk, nil
}
return into, gvk, nil return into, gvk, nil
} }
// Convert if needed.
if isVersioned {
// create a copy, because ConvertToVersion does not guarantee non-mutation of objects
versioned.Objects = []runtime.Object{obj.DeepCopyObject()}
}
// perform defaulting if requested // perform defaulting if requested
if c.defaulter != nil { if c.defaulter != nil {
c.defaulter.Default(obj) c.defaulter.Default(obj)
@ -160,18 +172,19 @@ func (c *codec) Decode(data []byte, defaultGVK *schema.GroupVersionKind, into ru
if err != nil { if err != nil {
return nil, gvk, err return nil, gvk, err
} }
if isVersioned {
if versioned.Last() != out {
versioned.Objects = append(versioned.Objects, out)
}
return versioned, gvk, nil
}
return out, gvk, nil return out, gvk, nil
} }
// Encode ensures the provided object is output in the appropriate group and version, invoking // Encode ensures the provided object is output in the appropriate group and version, invoking
// conversion if necessary. Unversioned objects (according to the ObjectTyper) are output as is. // conversion if necessary. Unversioned objects (according to the ObjectTyper) are output as is.
func (c *codec) Encode(obj runtime.Object, w io.Writer) error { func (c *codec) Encode(obj runtime.Object, w io.Writer) error {
if co, ok := obj.(runtime.CacheableObject); ok {
return co.CacheEncode(c.Identifier(), c.doEncode, w)
}
return c.doEncode(obj, w)
}
func (c *codec) doEncode(obj runtime.Object, w io.Writer) error {
switch obj := obj.(type) { switch obj := obj.(type) {
case *runtime.Unknown: case *runtime.Unknown:
return c.encoder.Encode(obj, w) return c.encoder.Encode(obj, w)
@ -230,3 +243,8 @@ func (c *codec) Encode(obj runtime.Object, w io.Writer) error {
// Conversion is responsible for setting the proper group, version, and kind onto the outgoing object // Conversion is responsible for setting the proper group, version, and kind onto the outgoing object
return c.encoder.Encode(out, w) return c.encoder.Encode(out, w)
} }
// Identifier implements runtime.Encoder interface.
func (c *codec) Identifier() runtime.Identifier {
return c.identifier
}

View File

@ -124,16 +124,3 @@ type Unknown struct {
// Unspecified means ContentTypeJSON. // Unspecified means ContentTypeJSON.
ContentType string `protobuf:"bytes,4,opt,name=contentType"` ContentType string `protobuf:"bytes,4,opt,name=contentType"`
} }
// VersionedObjects is used by Decoders to give callers a way to access all versions
// of an object during the decoding process.
//
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:deepcopy-gen=true
type VersionedObjects struct {
// Objects is the set of objects retrieved during decoding, in order of conversion.
// The 0 index is the object as serialized on the wire. If conversion has occurred,
// other objects may be present. The right most object is the same as would be returned
// by a normal Decode call.
Objects []Object
}

View File

@ -73,36 +73,3 @@ func (in *Unknown) DeepCopyObject() Object {
} }
return nil return nil
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VersionedObjects) DeepCopyInto(out *VersionedObjects) {
*out = *in
if in.Objects != nil {
in, out := &in.Objects, &out.Objects
*out = make([]Object, len(*in))
for i := range *in {
if (*in)[i] != nil {
(*out)[i] = (*in)[i].DeepCopyObject()
}
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionedObjects.
func (in *VersionedObjects) DeepCopy() *VersionedObjects {
if in == nil {
return nil
}
out := new(VersionedObjects)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new Object.
func (in *VersionedObjects) DeepCopyObject() Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

View File

@ -45,7 +45,7 @@ type IntOrString struct {
} }
// Type represents the stored type of IntOrString. // Type represents the stored type of IntOrString.
type Type int type Type int64
const ( const (
Int Type = iota // The IntOrString holds an int. Int Type = iota // The IntOrString holds an int.

View File

@ -19,6 +19,7 @@ package json
import ( import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"fmt"
"io" "io"
) )
@ -34,6 +35,9 @@ func Marshal(v interface{}) ([]byte, error) {
return json.Marshal(v) return json.Marshal(v)
} }
// limit recursive depth to prevent stack overflow errors
const maxDepth = 10000
// Unmarshal unmarshals the given data // Unmarshal unmarshals the given data
// If v is a *map[string]interface{}, numbers are converted to int64 or float64 // If v is a *map[string]interface{}, numbers are converted to int64 or float64
func Unmarshal(data []byte, v interface{}) error { func Unmarshal(data []byte, v interface{}) error {
@ -48,7 +52,7 @@ func Unmarshal(data []byte, v interface{}) error {
return err return err
} }
// If the decode succeeds, post-process the map to convert json.Number objects to int64 or float64 // If the decode succeeds, post-process the map to convert json.Number objects to int64 or float64
return convertMapNumbers(*v) return convertMapNumbers(*v, 0)
case *[]interface{}: case *[]interface{}:
// Build a decoder from the given data // Build a decoder from the given data
@ -60,7 +64,7 @@ func Unmarshal(data []byte, v interface{}) error {
return err return err
} }
// If the decode succeeds, post-process the map to convert json.Number objects to int64 or float64 // If the decode succeeds, post-process the map to convert json.Number objects to int64 or float64
return convertSliceNumbers(*v) return convertSliceNumbers(*v, 0)
default: default:
return json.Unmarshal(data, v) return json.Unmarshal(data, v)
@ -69,16 +73,20 @@ func Unmarshal(data []byte, v interface{}) error {
// convertMapNumbers traverses the map, converting any json.Number values to int64 or float64. // convertMapNumbers traverses the map, converting any json.Number values to int64 or float64.
// values which are map[string]interface{} or []interface{} are recursively visited // values which are map[string]interface{} or []interface{} are recursively visited
func convertMapNumbers(m map[string]interface{}) error { func convertMapNumbers(m map[string]interface{}, depth int) error {
if depth > maxDepth {
return fmt.Errorf("exceeded max depth of %d", maxDepth)
}
var err error var err error
for k, v := range m { for k, v := range m {
switch v := v.(type) { switch v := v.(type) {
case json.Number: case json.Number:
m[k], err = convertNumber(v) m[k], err = convertNumber(v)
case map[string]interface{}: case map[string]interface{}:
err = convertMapNumbers(v) err = convertMapNumbers(v, depth+1)
case []interface{}: case []interface{}:
err = convertSliceNumbers(v) err = convertSliceNumbers(v, depth+1)
} }
if err != nil { if err != nil {
return err return err
@ -89,16 +97,20 @@ func convertMapNumbers(m map[string]interface{}) error {
// convertSliceNumbers traverses the slice, converting any json.Number values to int64 or float64. // convertSliceNumbers traverses the slice, converting any json.Number values to int64 or float64.
// values which are map[string]interface{} or []interface{} are recursively visited // values which are map[string]interface{} or []interface{} are recursively visited
func convertSliceNumbers(s []interface{}) error { func convertSliceNumbers(s []interface{}, depth int) error {
if depth > maxDepth {
return fmt.Errorf("exceeded max depth of %d", maxDepth)
}
var err error var err error
for i, v := range s { for i, v := range s {
switch v := v.(type) { switch v := v.(type) {
case json.Number: case json.Number:
s[i], err = convertNumber(v) s[i], err = convertNumber(v)
case map[string]interface{}: case map[string]interface{}:
err = convertMapNumbers(v) err = convertMapNumbers(v, depth+1)
case []interface{}: case []interface{}:
err = convertSliceNumbers(v) err = convertSliceNumbers(v, depth+1)
} }
if err != nil { if err != nil {
return err return err

View File

@ -82,7 +82,7 @@ var stackCreator = regexp.MustCompile(`(?m)^created by (.*)\n\s+(.*):(\d+) \+0x[
func extractStackCreator() (string, int, bool) { func extractStackCreator() (string, int, bool) {
stack := debug.Stack() stack := debug.Stack()
matches := stackCreator.FindStringSubmatch(string(stack)) matches := stackCreator.FindStringSubmatch(string(stack))
if matches == nil || len(matches) != 4 { if len(matches) != 4 {
return "", 0, false return "", 0, false
} }
line, err := strconv.Atoi(matches[3]) line, err := strconv.Atoi(matches[3])

View File

@ -36,6 +36,18 @@ const (
familyIPv6 AddressFamily = 6 familyIPv6 AddressFamily = 6
) )
type AddressFamilyPreference []AddressFamily
var (
preferIPv4 = AddressFamilyPreference{familyIPv4, familyIPv6}
preferIPv6 = AddressFamilyPreference{familyIPv6, familyIPv4}
)
const (
// LoopbackInterfaceName is the default name of the loopback interface
LoopbackInterfaceName = "lo"
)
const ( const (
ipv4RouteFile = "/proc/net/route" ipv4RouteFile = "/proc/net/route"
ipv6RouteFile = "/proc/net/ipv6_route" ipv6RouteFile = "/proc/net/ipv6_route"
@ -53,7 +65,7 @@ type RouteFile struct {
parse func(input io.Reader) ([]Route, error) parse func(input io.Reader) ([]Route, error)
} }
// noRoutesError can be returned by ChooseBindAddress() in case of no routes // noRoutesError can be returned in case of no routes
type noRoutesError struct { type noRoutesError struct {
message string message string
} }
@ -254,7 +266,7 @@ func getIPFromInterface(intfName string, forFamily AddressFamily, nw networkInte
return nil, nil return nil, nil
} }
// memberOF tells if the IP is of the desired family. Used for checking interface addresses. // memberOf tells if the IP is of the desired family. Used for checking interface addresses.
func memberOf(ip net.IP, family AddressFamily) bool { func memberOf(ip net.IP, family AddressFamily) bool {
if ip.To4() != nil { if ip.To4() != nil {
return family == familyIPv4 return family == familyIPv4
@ -265,8 +277,8 @@ func memberOf(ip net.IP, family AddressFamily) bool {
// chooseIPFromHostInterfaces looks at all system interfaces, trying to find one that is up that // chooseIPFromHostInterfaces looks at all system interfaces, trying to find one that is up that
// has a global unicast address (non-loopback, non-link local, non-point2point), and returns the IP. // has a global unicast address (non-loopback, non-link local, non-point2point), and returns the IP.
// Searches for IPv4 addresses, and then IPv6 addresses. // addressFamilies determines whether it prefers IPv4 or IPv6
func chooseIPFromHostInterfaces(nw networkInterfacer) (net.IP, error) { func chooseIPFromHostInterfaces(nw networkInterfacer, addressFamilies AddressFamilyPreference) (net.IP, error) {
intfs, err := nw.Interfaces() intfs, err := nw.Interfaces()
if err != nil { if err != nil {
return nil, err return nil, err
@ -274,7 +286,7 @@ func chooseIPFromHostInterfaces(nw networkInterfacer) (net.IP, error) {
if len(intfs) == 0 { if len(intfs) == 0 {
return nil, fmt.Errorf("no interfaces found on host.") return nil, fmt.Errorf("no interfaces found on host.")
} }
for _, family := range []AddressFamily{familyIPv4, familyIPv6} { for _, family := range addressFamilies {
klog.V(4).Infof("Looking for system interface with a global IPv%d address", uint(family)) klog.V(4).Infof("Looking for system interface with a global IPv%d address", uint(family))
for _, intf := range intfs { for _, intf := range intfs {
if !isInterfaceUp(&intf) { if !isInterfaceUp(&intf) {
@ -321,15 +333,19 @@ func chooseIPFromHostInterfaces(nw networkInterfacer) (net.IP, error) {
// IP of the interface with a gateway on it (with priority given to IPv4). For a node // IP of the interface with a gateway on it (with priority given to IPv4). For a node
// with no internet connection, it returns error. // with no internet connection, it returns error.
func ChooseHostInterface() (net.IP, error) { func ChooseHostInterface() (net.IP, error) {
return chooseHostInterface(preferIPv4)
}
func chooseHostInterface(addressFamilies AddressFamilyPreference) (net.IP, error) {
var nw networkInterfacer = networkInterface{} var nw networkInterfacer = networkInterface{}
if _, err := os.Stat(ipv4RouteFile); os.IsNotExist(err) { if _, err := os.Stat(ipv4RouteFile); os.IsNotExist(err) {
return chooseIPFromHostInterfaces(nw) return chooseIPFromHostInterfaces(nw, addressFamilies)
} }
routes, err := getAllDefaultRoutes() routes, err := getAllDefaultRoutes()
if err != nil { if err != nil {
return nil, err return nil, err
} }
return chooseHostInterfaceFromRoute(routes, nw) return chooseHostInterfaceFromRoute(routes, nw, addressFamilies)
} }
// networkInterfacer defines an interface for several net library functions. Production // networkInterfacer defines an interface for several net library functions. Production
@ -377,10 +393,10 @@ func getAllDefaultRoutes() ([]Route, error) {
} }
// chooseHostInterfaceFromRoute cycles through each default route provided, looking for a // chooseHostInterfaceFromRoute cycles through each default route provided, looking for a
// global IP address from the interface for the route. Will first look all each IPv4 route for // global IP address from the interface for the route. addressFamilies determines whether it
// an IPv4 IP, and then will look at each IPv6 route for an IPv6 IP. // prefers IPv4 or IPv6
func chooseHostInterfaceFromRoute(routes []Route, nw networkInterfacer) (net.IP, error) { func chooseHostInterfaceFromRoute(routes []Route, nw networkInterfacer, addressFamilies AddressFamilyPreference) (net.IP, error) {
for _, family := range []AddressFamily{familyIPv4, familyIPv6} { for _, family := range addressFamilies {
klog.V(4).Infof("Looking for default routes with IPv%d addresses", uint(family)) klog.V(4).Infof("Looking for default routes with IPv%d addresses", uint(family))
for _, route := range routes { for _, route := range routes {
if route.Family != family { if route.Family != family {
@ -401,12 +417,19 @@ func chooseHostInterfaceFromRoute(routes []Route, nw networkInterfacer) (net.IP,
return nil, fmt.Errorf("unable to select an IP from default routes.") return nil, fmt.Errorf("unable to select an IP from default routes.")
} }
// If bind-address is usable, return it directly // ResolveBindAddress returns the IP address of a daemon, based on the given bindAddress:
// If bind-address is not usable (unset, 0.0.0.0, or loopback), we will use the host's default // If bindAddress is unset, it returns the host's default IP, as with ChooseHostInterface().
// interface. // If bindAddress is unspecified or loopback, it returns the default IP of the same
func ChooseBindAddress(bindAddress net.IP) (net.IP, error) { // address family as bindAddress.
// Otherwise, it just returns bindAddress.
func ResolveBindAddress(bindAddress net.IP) (net.IP, error) {
addressFamilies := preferIPv4
if bindAddress != nil && memberOf(bindAddress, familyIPv6) {
addressFamilies = preferIPv6
}
if bindAddress == nil || bindAddress.IsUnspecified() || bindAddress.IsLoopback() { if bindAddress == nil || bindAddress.IsUnspecified() || bindAddress.IsLoopback() {
hostIP, err := ChooseHostInterface() hostIP, err := chooseHostInterface(addressFamilies)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -414,3 +437,21 @@ func ChooseBindAddress(bindAddress net.IP) (net.IP, error) {
} }
return bindAddress, nil return bindAddress, nil
} }
// ChooseBindAddressForInterface choose a global IP for a specific interface, with priority given to IPv4.
// This is required in case of network setups where default routes are present, but network
// interfaces use only link-local addresses (e.g. as described in RFC5549).
// e.g when using BGP to announce a host IP over link-local ip addresses and this ip address is attached to the lo interface.
func ChooseBindAddressForInterface(intfName string) (net.IP, error) {
var nw networkInterfacer = networkInterface{}
for _, family := range preferIPv4 {
ip, err := getIPFromInterface(intfName, family, nw)
if err != nil {
return nil, err
}
if ip != nil {
return ip, nil
}
}
return nil, fmt.Errorf("unable to select an IP from %s network interface", intfName)
}

View File

@ -204,7 +204,7 @@ func Forbidden(field *Path, detail string) *Error {
// Invalid, but the returned error will not include the too-long // Invalid, but the returned error will not include the too-long
// value. // value.
func TooLong(field *Path, value interface{}, maxLength int) *Error { func TooLong(field *Path, value interface{}, maxLength int) *Error {
return &Error{ErrorTypeTooLong, field.String(), value, fmt.Sprintf("must have at most %d characters", maxLength)} return &Error{ErrorTypeTooLong, field.String(), value, fmt.Sprintf("must have at most %d bytes", maxLength)}
} }
// TooMany returns a *Error indicating "too many". This is used to // TooMany returns a *Error indicating "too many". This is used to

View File

@ -70,7 +70,11 @@ func IsQualifiedName(value string) []string {
return errs return errs
} }
// IsFullyQualifiedName checks if the name is fully qualified. // IsFullyQualifiedName checks if the name is fully qualified. This is similar
// to IsFullyQualifiedDomainName but requires a minimum of 3 segments instead of
// 2 and does not accept a trailing . as valid.
// TODO: This function is deprecated and preserved until all callers migrate to
// IsFullyQualifiedDomainName; please don't add new callers.
func IsFullyQualifiedName(fldPath *field.Path, name string) field.ErrorList { func IsFullyQualifiedName(fldPath *field.Path, name string) field.ErrorList {
var allErrors field.ErrorList var allErrors field.ErrorList
if len(name) == 0 { if len(name) == 0 {
@ -85,6 +89,26 @@ func IsFullyQualifiedName(fldPath *field.Path, name string) field.ErrorList {
return allErrors return allErrors
} }
// IsFullyQualifiedDomainName checks if the domain name is fully qualified. This
// is similar to IsFullyQualifiedName but only requires a minimum of 2 segments
// instead of 3 and accepts a trailing . as valid.
func IsFullyQualifiedDomainName(fldPath *field.Path, name string) field.ErrorList {
var allErrors field.ErrorList
if len(name) == 0 {
return append(allErrors, field.Required(fldPath, ""))
}
if strings.HasSuffix(name, ".") {
name = name[:len(name)-1]
}
if errs := IsDNS1123Subdomain(name); len(errs) > 0 {
return append(allErrors, field.Invalid(fldPath, name, strings.Join(errs, ",")))
}
if len(strings.Split(name, ".")) < 2 {
return append(allErrors, field.Invalid(fldPath, name, "should be a domain with at least two segments separated by dots"))
}
return allErrors
}
const labelValueFmt string = "(" + qualifiedNameFmt + ")?" const labelValueFmt string = "(" + qualifiedNameFmt + ")?"
const labelValueErrMsg string = "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character" const labelValueErrMsg string = "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character"
@ -285,6 +309,26 @@ func IsValidIP(value string) []string {
return nil return nil
} }
// IsValidIPv4Address tests that the argument is a valid IPv4 address.
func IsValidIPv4Address(fldPath *field.Path, value string) field.ErrorList {
var allErrors field.ErrorList
ip := net.ParseIP(value)
if ip == nil || ip.To4() == nil {
allErrors = append(allErrors, field.Invalid(fldPath, value, "must be a valid IPv4 address"))
}
return allErrors
}
// IsValidIPv6Address tests that the argument is a valid IPv6 address.
func IsValidIPv6Address(fldPath *field.Path, value string) field.ErrorList {
var allErrors field.ErrorList
ip := net.ParseIP(value)
if ip == nil || ip.To4() != nil {
allErrors = append(allErrors, field.Invalid(fldPath, value, "must be a valid IPv6 address"))
}
return allErrors
}
const percentFmt string = "[0-9]+%" const percentFmt string = "[0-9]+%"
const percentErrMsg string = "a valid percent string must be a numeric string followed by an ending '%'" const percentErrMsg string = "a valid percent string must be a numeric string followed by an ending '%'"

76
vendor/k8s.io/apiserver/go.mod generated vendored
View File

@ -6,70 +6,60 @@ go 1.12
require ( require (
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/coreos/bbolt v1.3.1-coreos.6 // indirect
github.com/coreos/etcd v3.3.15+incompatible
github.com/coreos/go-oidc v2.1.0+incompatible github.com/coreos/go-oidc v2.1.0+incompatible
github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7 github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea
github.com/davecgh/go-spew v1.1.1
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible github.com/emicklei/go-restful v2.9.5+incompatible
github.com/evanphx/json-patch v4.2.0+incompatible github.com/evanphx/json-patch v4.2.0+incompatible
github.com/go-openapi/spec v0.19.2 github.com/go-openapi/jsonreference v0.19.3 // indirect
github.com/go-openapi/spec v0.19.3
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
github.com/google/go-cmp v0.3.0 github.com/google/go-cmp v0.3.0
github.com/google/gofuzz v1.0.0 github.com/google/gofuzz v1.0.0
github.com/google/uuid v1.1.1
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d
github.com/gorilla/websocket v1.4.0 // indirect github.com/gorilla/websocket v1.4.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway v1.3.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 github.com/hashicorp/golang-lru v0.5.1
github.com/jonboulle/clockwork v0.1.0 // indirect github.com/mailru/easyjson v0.7.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
github.com/pborman/uuid v1.2.0 github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.8.0 // indirect
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021 // indirect github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021 // indirect
github.com/prometheus/client_golang v0.9.2 github.com/prometheus/client_golang v1.0.0
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
github.com/sirupsen/logrus v1.4.2 // indirect github.com/sirupsen/logrus v1.4.2 // indirect
github.com/soheilhy/cmux v0.1.3 // indirect github.com/spf13/pflag v1.0.5
github.com/spf13/pflag v1.0.3 github.com/stretchr/testify v1.4.0
github.com/stretchr/testify v1.3.0 go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8 // indirect go.uber.org/zap v1.10.0
github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18 // indirect golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569 // indirect golang.org/x/net v0.0.0-20191004110552-13f9640d40b9
go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df // indirect
go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15 // indirect
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8
golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 // indirect google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 // indirect
google.golang.org/grpc v1.23.0 google.golang.org/grpc v1.23.1
gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/square/go-jose.v2 v2.2.2 gopkg.in/square/go-jose.v2 v2.2.2
gopkg.in/yaml.v2 v2.2.2 gopkg.in/yaml.v2 v2.2.4
gotest.tools v2.2.0+incompatible // indirect gotest.tools v2.2.0+incompatible // indirect
k8s.io/api v0.0.0-20190913200010-d2ab659560cb k8s.io/api v0.17.1
k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655 k8s.io/apimachinery v0.17.1
k8s.io/client-go v0.0.0-20190913200447-5ff489491ea7 k8s.io/client-go v0.17.1
k8s.io/component-base v0.0.0-20190913200627-c1db07a83ddd k8s.io/component-base v0.17.1
k8s.io/klog v0.4.0 k8s.io/klog v1.0.0
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
k8s.io/utils v0.0.0-20190801114015-581e00157fb1 k8s.io/utils v0.0.0-20191114184206-e782cd3c129f
sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06
sigs.k8s.io/yaml v1.1.0 sigs.k8s.io/yaml v1.1.0
) )
replace ( replace (
golang.org/x/crypto => golang.org/x/crypto v0.0.0-20181025213731-e84da0312774 golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13
golang.org/x/lint => golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1 golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13
golang.org/x/oauth2 => golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a k8s.io/api => k8s.io/api v0.17.1
golang.org/x/sync => golang.org/x/sync v0.0.0-20181108010431-42b317875d0f k8s.io/apimachinery => k8s.io/apimachinery v0.17.1
golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503 k8s.io/client-go => k8s.io/client-go v0.17.1
golang.org/x/text => golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db k8s.io/component-base => k8s.io/component-base v0.17.1
golang.org/x/time => golang.org/x/time v0.0.0-20161028155119-f51c12702a4d
k8s.io/api => k8s.io/api v0.0.0-20190913200010-d2ab659560cb
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655
k8s.io/client-go => k8s.io/client-go v0.0.0-20190913200447-5ff489491ea7
k8s.io/component-base => k8s.io/component-base v0.0.0-20190913200627-c1db07a83ddd
) )

21
vendor/k8s.io/client-go/README.md generated vendored
View File

@ -2,9 +2,9 @@
Go clients for talking to a [kubernetes](http://kubernetes.io/) cluster. Go clients for talking to a [kubernetes](http://kubernetes.io/) cluster.
We currently recommend using the v12.0.0 tag. See [INSTALL.md](/INSTALL.md) for We recommend using the `kubernetes-1.x.y` tag matching the current Kubernetes release (`kubernetes-1.15.3` at the time this was written).
detailed installation instructions. `go get k8s.io/client-go/...` works, but See [INSTALL.md](/INSTALL.md) for detailed installation instructions.
will build `master`, which doesn't handle the dependencies well. `go get k8s.io/client-go@master` works, but will fetch `master`, which may be less stable than a tagged release.
[![BuildStatus Widget]][BuildStatus Result] [![BuildStatus Widget]][BuildStatus Result]
[![GoReport Widget]][GoReport Status] [![GoReport Widget]][GoReport Status]
@ -164,8 +164,8 @@ This repository is still a mirror of
the code development is still done in the staging area. Since Kubernetes 1.8 the code development is still done in the staging area. Since Kubernetes 1.8
release, when syncing the code from the staging area, we also sync the Kubernetes release, when syncing the code from the staging area, we also sync the Kubernetes
version tags to client-go, prefixed with "kubernetes-". For example, if you check version tags to client-go, prefixed with "kubernetes-". For example, if you check
out the `kubernetes-v1.8.0` tag in client-go, the code you get is exactly the out the `kubernetes-1.15.3` tag in client-go, the code you get is exactly the
same as if you check out the `v1.8.0` tag in kubernetes, and change directory to same as if you check out the `v1.15.3` tag in Kubernetes, and change directory to
`staging/src/k8s.io/client-go`. The purpose is to let users quickly find matching `staging/src/k8s.io/client-go`. The purpose is to let users quickly find matching
commits among published repos, like commits among published repos, like
[sample-apiserver](https://github.com/kubernetes/sample-apiserver), [sample-apiserver](https://github.com/kubernetes/sample-apiserver),
@ -176,10 +176,13 @@ you care about backwards compatibility.
### How to get it ### How to get it
You can use `go get k8s.io/client-go/...` to get client-go, but **you will get Use go1.11+ and fetch the desired version using the `go get` command. For example:
the unstable master branch** and `client-go`'s vendored dependencies will not be
added to your `$GOPATH`. So we think most users will want to use a dependency ```
management system. See [INSTALL.md](/INSTALL.md) for detailed instructions. go get k8s.io/client-go@kubernetes-1.15.3
```
See [INSTALL.md](/INSTALL.md) for detailed instructions.
### How to use it ### How to use it

37
vendor/k8s.io/client-go/go.mod generated vendored
View File

@ -12,35 +12,32 @@ require (
github.com/evanphx/json-patch v4.2.0+incompatible github.com/evanphx/json-patch v4.2.0+incompatible
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903
github.com/golang/protobuf v1.3.1 github.com/golang/protobuf v1.3.2
github.com/google/btree v1.0.0 // indirect
github.com/google/gofuzz v1.0.0 github.com/google/gofuzz v1.0.0
github.com/google/uuid v1.1.1
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d
github.com/gophercloud/gophercloud v0.1.0 github.com/gophercloud/gophercloud v0.1.0
github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7 github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
github.com/imdario/mergo v0.3.5 github.com/imdario/mergo v0.3.5
github.com/peterbourgon/diskv v2.0.1+incompatible github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/spf13/pflag v1.0.3 github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.3.0 github.com/stretchr/testify v1.4.0
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc golang.org/x/net v0.0.0-20191004110552-13f9640d40b9
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
google.golang.org/appengine v1.5.0 // indirect google.golang.org/appengine v1.5.0 // indirect
k8s.io/api v0.0.0-20190913200010-d2ab659560cb k8s.io/api v0.17.1
k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655 k8s.io/apimachinery v0.17.1
k8s.io/klog v0.4.0 k8s.io/klog v1.0.0
k8s.io/utils v0.0.0-20190801114015-581e00157fb1 k8s.io/utils v0.0.0-20191114184206-e782cd3c129f
sigs.k8s.io/yaml v1.1.0 sigs.k8s.io/yaml v1.1.0
) )
replace ( replace (
golang.org/x/crypto => golang.org/x/crypto v0.0.0-20181025213731-e84da0312774 golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13
golang.org/x/lint => golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1 golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13
golang.org/x/oauth2 => golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a k8s.io/api => k8s.io/api v0.17.1
golang.org/x/sync => golang.org/x/sync v0.0.0-20181108010431-42b317875d0f k8s.io/apimachinery => k8s.io/apimachinery v0.17.1
golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503
golang.org/x/text => golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db
golang.org/x/time => golang.org/x/time v0.0.0-20161028155119-f51c12702a4d
k8s.io/api => k8s.io/api v0.0.0-20190913200010-d2ab659560cb
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655
) )

View File

@ -51,11 +51,6 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddGeneratedConversionFunc((*clientauthentication.ExecCredentialSpec)(nil), (*ExecCredentialSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_clientauthentication_ExecCredentialSpec_To_v1beta1_ExecCredentialSpec(a.(*clientauthentication.ExecCredentialSpec), b.(*ExecCredentialSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*ExecCredentialStatus)(nil), (*clientauthentication.ExecCredentialStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddGeneratedConversionFunc((*ExecCredentialStatus)(nil), (*clientauthentication.ExecCredentialStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(a.(*ExecCredentialStatus), b.(*clientauthentication.ExecCredentialStatus), scope) return Convert_v1beta1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(a.(*ExecCredentialStatus), b.(*clientauthentication.ExecCredentialStatus), scope)
}); err != nil { }); err != nil {

View File

@ -48,6 +48,7 @@ import (
) )
const execInfoEnv = "KUBERNETES_EXEC_INFO" const execInfoEnv = "KUBERNETES_EXEC_INFO"
const onRotateListWarningLength = 1000
var scheme = runtime.NewScheme() var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme) var codecs = serializer.NewCodecFactory(scheme)
@ -164,7 +165,7 @@ type Authenticator struct {
cachedCreds *credentials cachedCreds *credentials
exp time.Time exp time.Time
onRotate func() onRotateList []func()
} }
type credentials struct { type credentials struct {
@ -191,7 +192,15 @@ func (a *Authenticator) UpdateTransportConfig(c *transport.Config) error {
dial = (&net.Dialer{Timeout: 30 * time.Second, KeepAlive: 30 * time.Second}).DialContext dial = (&net.Dialer{Timeout: 30 * time.Second, KeepAlive: 30 * time.Second}).DialContext
} }
d := connrotation.NewDialer(dial) d := connrotation.NewDialer(dial)
a.onRotate = d.CloseAll
a.mu.Lock()
defer a.mu.Unlock()
a.onRotateList = append(a.onRotateList, d.CloseAll)
onRotateListLength := len(a.onRotateList)
if onRotateListLength > onRotateListWarningLength {
klog.Warningf("constructing many client instances from the same exec auth config can cause performance problems during cert rotation and can exhaust available network connections; %d clients constructed calling %q", onRotateListLength, a.cmd)
}
c.Dial = d.DialContext c.Dial = d.DialContext
return nil return nil
@ -353,8 +362,10 @@ func (a *Authenticator) refreshCredsLocked(r *clientauthentication.Response) err
a.cachedCreds = newCreds a.cachedCreds = newCreds
// Only close all connections when TLS cert rotates. Token rotation doesn't // Only close all connections when TLS cert rotates. Token rotation doesn't
// need the extra noise. // need the extra noise.
if a.onRotate != nil && oldCreds != nil && !reflect.DeepEqual(oldCreds.cert, a.cachedCreds.cert) { if len(a.onRotateList) > 0 && oldCreds != nil && !reflect.DeepEqual(oldCreds.cert, a.cachedCreds.cert) {
a.onRotate() for _, onRotate := range a.onRotateList {
onRotate()
}
} }
return nil return nil
} }

View File

@ -17,8 +17,6 @@ limitations under the License.
package rest package rest
import ( import (
"fmt"
"mime"
"net/http" "net/http"
"net/url" "net/url"
"os" "os"
@ -51,6 +49,28 @@ type Interface interface {
APIVersion() schema.GroupVersion APIVersion() schema.GroupVersion
} }
// ClientContentConfig controls how RESTClient communicates with the server.
//
// TODO: ContentConfig will be updated to accept a Negotiator instead of a
// NegotiatedSerializer and NegotiatedSerializer will be removed.
type ClientContentConfig struct {
// AcceptContentTypes specifies the types the client will accept and is optional.
// If not set, ContentType will be used to define the Accept header
AcceptContentTypes string
// ContentType specifies the wire format used to communicate with the server.
// This value will be set as the Accept header on requests made to the server if
// AcceptContentTypes is not set, and as the default content type on any object
// sent to the server. If not set, "application/json" is used.
ContentType string
// GroupVersion is the API version to talk to. Must be provided when initializing
// a RESTClient directly. When initializing a Client, will be set with the default
// code version. This is used as the default group version for VersionedParams.
GroupVersion schema.GroupVersion
// Negotiator is used for obtaining encoders and decoders for multiple
// supported media types.
Negotiator runtime.ClientNegotiator
}
// RESTClient imposes common Kubernetes API conventions on a set of resource paths. // RESTClient imposes common Kubernetes API conventions on a set of resource paths.
// The baseURL is expected to point to an HTTP or HTTPS path that is the parent // The baseURL is expected to point to an HTTP or HTTPS path that is the parent
// of one or more resources. The server should return a decodable API resource // of one or more resources. The server should return a decodable API resource
@ -64,34 +84,27 @@ type RESTClient struct {
// versionedAPIPath is a path segment connecting the base URL to the resource root // versionedAPIPath is a path segment connecting the base URL to the resource root
versionedAPIPath string versionedAPIPath string
// contentConfig is the information used to communicate with the server. // content describes how a RESTClient encodes and decodes responses.
contentConfig ContentConfig content ClientContentConfig
// serializers contain all serializers for underlying content type.
serializers Serializers
// creates BackoffManager that is passed to requests. // creates BackoffManager that is passed to requests.
createBackoffMgr func() BackoffManager createBackoffMgr func() BackoffManager
// TODO extract this into a wrapper interface via the RESTClient interface in kubectl. // rateLimiter is shared among all requests created by this client unless specifically
Throttle flowcontrol.RateLimiter // overridden.
rateLimiter flowcontrol.RateLimiter
// Set specific behavior of the client. If not set http.DefaultClient will be used. // Set specific behavior of the client. If not set http.DefaultClient will be used.
Client *http.Client Client *http.Client
} }
type Serializers struct {
Encoder runtime.Encoder
Decoder runtime.Decoder
StreamingSerializer runtime.Serializer
Framer runtime.Framer
RenegotiatedDecoder func(contentType string, params map[string]string) (runtime.Decoder, error)
}
// NewRESTClient creates a new RESTClient. This client performs generic REST functions // NewRESTClient creates a new RESTClient. This client performs generic REST functions
// such as Get, Put, Post, and Delete on specified paths. Codec controls encoding and // such as Get, Put, Post, and Delete on specified paths.
// decoding of responses from the server. func NewRESTClient(baseURL *url.URL, versionedAPIPath string, config ClientContentConfig, rateLimiter flowcontrol.RateLimiter, client *http.Client) (*RESTClient, error) {
func NewRESTClient(baseURL *url.URL, versionedAPIPath string, config ContentConfig, maxQPS float32, maxBurst int, rateLimiter flowcontrol.RateLimiter, client *http.Client) (*RESTClient, error) { if len(config.ContentType) == 0 {
config.ContentType = "application/json"
}
base := *baseURL base := *baseURL
if !strings.HasSuffix(base.Path, "/") { if !strings.HasSuffix(base.Path, "/") {
base.Path += "/" base.Path += "/"
@ -99,31 +112,14 @@ func NewRESTClient(baseURL *url.URL, versionedAPIPath string, config ContentConf
base.RawQuery = "" base.RawQuery = ""
base.Fragment = "" base.Fragment = ""
if config.GroupVersion == nil {
config.GroupVersion = &schema.GroupVersion{}
}
if len(config.ContentType) == 0 {
config.ContentType = "application/json"
}
serializers, err := createSerializers(config)
if err != nil {
return nil, err
}
var throttle flowcontrol.RateLimiter
if maxQPS > 0 && rateLimiter == nil {
throttle = flowcontrol.NewTokenBucketRateLimiter(maxQPS, maxBurst)
} else if rateLimiter != nil {
throttle = rateLimiter
}
return &RESTClient{ return &RESTClient{
base: &base, base: &base,
versionedAPIPath: versionedAPIPath, versionedAPIPath: versionedAPIPath,
contentConfig: config, content: config,
serializers: *serializers,
createBackoffMgr: readExpBackoffConfig, createBackoffMgr: readExpBackoffConfig,
Throttle: throttle, rateLimiter: rateLimiter,
Client: client,
Client: client,
}, nil }, nil
} }
@ -132,7 +128,7 @@ func (c *RESTClient) GetRateLimiter() flowcontrol.RateLimiter {
if c == nil { if c == nil {
return nil return nil
} }
return c.Throttle return c.rateLimiter
} }
// readExpBackoffConfig handles the internal logic of determining what the // readExpBackoffConfig handles the internal logic of determining what the
@ -153,58 +149,6 @@ func readExpBackoffConfig() BackoffManager {
time.Duration(backoffDurationInt)*time.Second)} time.Duration(backoffDurationInt)*time.Second)}
} }
// createSerializers creates all necessary serializers for given contentType.
// TODO: the negotiated serializer passed to this method should probably return
// serializers that control decoding and versioning without this package
// being aware of the types. Depends on whether RESTClient must deal with
// generic infrastructure.
func createSerializers(config ContentConfig) (*Serializers, error) {
mediaTypes := config.NegotiatedSerializer.SupportedMediaTypes()
contentType := config.ContentType
mediaType, _, err := mime.ParseMediaType(contentType)
if err != nil {
return nil, fmt.Errorf("the content type specified in the client configuration is not recognized: %v", err)
}
info, ok := runtime.SerializerInfoForMediaType(mediaTypes, mediaType)
if !ok {
if len(contentType) != 0 || len(mediaTypes) == 0 {
return nil, fmt.Errorf("no serializers registered for %s", contentType)
}
info = mediaTypes[0]
}
internalGV := schema.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{
Encoder: config.NegotiatedSerializer.EncoderForVersion(info.Serializer, *config.GroupVersion),
Decoder: config.NegotiatedSerializer.DecoderToVersion(info.Serializer, internalGV),
RenegotiatedDecoder: func(contentType string, params map[string]string) (runtime.Decoder, error) {
info, ok := runtime.SerializerInfoForMediaType(mediaTypes, contentType)
if !ok {
return nil, fmt.Errorf("serializer for %s not registered", contentType)
}
return config.NegotiatedSerializer.DecoderToVersion(info.Serializer, internalGV), nil
},
}
if info.StreamSerializer != nil {
s.StreamingSerializer = info.StreamSerializer.Serializer
s.Framer = info.StreamSerializer.Framer
}
return s, nil
}
// Verb begins a request with a verb (GET, POST, PUT, DELETE). // Verb begins a request with a verb (GET, POST, PUT, DELETE).
// //
// Example usage of RESTClient's request building interface: // Example usage of RESTClient's request building interface:
@ -219,12 +163,7 @@ func createSerializers(config ContentConfig) (*Serializers, error) {
// list, ok := resp.(*api.PodList) // list, ok := resp.(*api.PodList)
// //
func (c *RESTClient) Verb(verb string) *Request { func (c *RESTClient) Verb(verb string) *Request {
backoff := c.createBackoffMgr() return NewRequest(c).Verb(verb)
if c.Client == nil {
return NewRequest(nil, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle, 0)
}
return NewRequest(c.Client, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle, c.Client.Timeout)
} }
// Post begins a POST request. Short for c.Verb("POST"). // Post begins a POST request. Short for c.Verb("POST").
@ -254,5 +193,5 @@ func (c *RESTClient) Delete() *Request {
// APIVersion returns the APIVersion this RESTClient is expected to use. // APIVersion returns the APIVersion this RESTClient is expected to use.
func (c *RESTClient) APIVersion() schema.GroupVersion { func (c *RESTClient) APIVersion() schema.GroupVersion {
return *c.contentConfig.GroupVersion return c.content.GroupVersion
} }

View File

@ -269,6 +269,9 @@ type ContentConfig struct {
GroupVersion *schema.GroupVersion GroupVersion *schema.GroupVersion
// NegotiatedSerializer is used for obtaining encoders and decoders for multiple // NegotiatedSerializer is used for obtaining encoders and decoders for multiple
// supported media types. // supported media types.
//
// TODO: NegotiatedSerializer will be phased out as internal clients are removed
// from Kubernetes.
NegotiatedSerializer runtime.NegotiatedSerializer NegotiatedSerializer runtime.NegotiatedSerializer
} }
@ -283,14 +286,6 @@ func RESTClientFor(config *Config) (*RESTClient, error) {
if config.NegotiatedSerializer == nil { if config.NegotiatedSerializer == nil {
return nil, fmt.Errorf("NegotiatedSerializer is required when initializing a RESTClient") return nil, fmt.Errorf("NegotiatedSerializer is required when initializing a RESTClient")
} }
qps := config.QPS
if config.QPS == 0.0 {
qps = DefaultQPS
}
burst := config.Burst
if config.Burst == 0 {
burst = DefaultBurst
}
baseURL, versionedAPIPath, err := defaultServerUrlFor(config) baseURL, versionedAPIPath, err := defaultServerUrlFor(config)
if err != nil { if err != nil {
@ -310,7 +305,33 @@ func RESTClientFor(config *Config) (*RESTClient, error) {
} }
} }
return NewRESTClient(baseURL, versionedAPIPath, config.ContentConfig, qps, burst, config.RateLimiter, httpClient) rateLimiter := config.RateLimiter
if rateLimiter == nil {
qps := config.QPS
if config.QPS == 0.0 {
qps = DefaultQPS
}
burst := config.Burst
if config.Burst == 0 {
burst = DefaultBurst
}
if qps > 0 {
rateLimiter = flowcontrol.NewTokenBucketRateLimiter(qps, burst)
}
}
var gv schema.GroupVersion
if config.GroupVersion != nil {
gv = *config.GroupVersion
}
clientContent := ClientContentConfig{
AcceptContentTypes: config.AcceptContentTypes,
ContentType: config.ContentType,
GroupVersion: gv,
Negotiator: runtime.NewClientNegotiator(config.NegotiatedSerializer, gv),
}
return NewRESTClient(baseURL, versionedAPIPath, clientContent, rateLimiter, httpClient)
} }
// UnversionedRESTClientFor is the same as RESTClientFor, except that it allows // UnversionedRESTClientFor is the same as RESTClientFor, except that it allows
@ -338,13 +359,33 @@ func UnversionedRESTClientFor(config *Config) (*RESTClient, error) {
} }
} }
versionConfig := config.ContentConfig rateLimiter := config.RateLimiter
if versionConfig.GroupVersion == nil { if rateLimiter == nil {
v := metav1.SchemeGroupVersion qps := config.QPS
versionConfig.GroupVersion = &v if config.QPS == 0.0 {
qps = DefaultQPS
}
burst := config.Burst
if config.Burst == 0 {
burst = DefaultBurst
}
if qps > 0 {
rateLimiter = flowcontrol.NewTokenBucketRateLimiter(qps, burst)
}
} }
return NewRESTClient(baseURL, versionedAPIPath, versionConfig, config.QPS, config.Burst, config.RateLimiter, httpClient) gv := metav1.SchemeGroupVersion
if config.GroupVersion != nil {
gv = *config.GroupVersion
}
clientContent := ClientContentConfig{
AcceptContentTypes: config.AcceptContentTypes,
ContentType: config.ContentType,
GroupVersion: gv,
Negotiator: runtime.NewClientNegotiator(config.NegotiatedSerializer, gv),
}
return NewRESTClient(baseURL, versionedAPIPath, clientContent, rateLimiter, httpClient)
} }
// SetKubernetesDefaults sets default values on the provided client config for accessing the // SetKubernetesDefaults sets default values on the provided client config for accessing the

View File

@ -48,7 +48,8 @@ import (
var ( var (
// longThrottleLatency defines threshold for logging requests. All requests being // longThrottleLatency defines threshold for logging requests. All requests being
// throttle for more than longThrottleLatency will be logged. // throttled (via the provided rateLimiter) for more than longThrottleLatency will
// be logged.
longThrottleLatency = 50 * time.Millisecond longThrottleLatency = 50 * time.Millisecond
) )
@ -74,19 +75,20 @@ func (r *RequestConstructionError) Error() string {
return fmt.Sprintf("request construction error: '%v'", r.Err) return fmt.Sprintf("request construction error: '%v'", r.Err)
} }
var noBackoff = &NoBackoff{}
// Request allows for building up a request to a server in a chained fashion. // Request allows for building up a request to a server in a chained fashion.
// Any errors are stored until the end of your call, so you only have to // Any errors are stored until the end of your call, so you only have to
// check once. // check once.
type Request struct { type Request struct {
// required c *RESTClient
client HTTPClient
verb string
baseURL *url.URL rateLimiter flowcontrol.RateLimiter
content ContentConfig backoff BackoffManager
serializers Serializers timeout time.Duration
// generic components accessible via method setters // generic components accessible via method setters
verb string
pathPrefix string pathPrefix string
subpath string subpath string
params url.Values params url.Values
@ -98,7 +100,6 @@ type Request struct {
resource string resource string
resourceName string resourceName string
subresource string subresource string
timeout time.Duration
// output // output
err error err error
@ -106,42 +107,63 @@ type Request struct {
// This is only used for per-request timeouts, deadlines, and cancellations. // This is only used for per-request timeouts, deadlines, and cancellations.
ctx context.Context ctx context.Context
backoffMgr BackoffManager
throttle flowcontrol.RateLimiter
} }
// NewRequest creates a new request helper object for accessing runtime.Objects on a server. // NewRequest creates a new request helper object for accessing runtime.Objects on a server.
func NewRequest(client HTTPClient, verb string, baseURL *url.URL, versionedAPIPath string, content ContentConfig, serializers Serializers, backoff BackoffManager, throttle flowcontrol.RateLimiter, timeout time.Duration) *Request { func NewRequest(c *RESTClient) *Request {
var backoff BackoffManager
if c.createBackoffMgr != nil {
backoff = c.createBackoffMgr()
}
if backoff == nil { if backoff == nil {
klog.V(2).Infof("Not implementing request backoff strategy.") backoff = noBackoff
backoff = &NoBackoff{}
} }
pathPrefix := "/" var pathPrefix string
if baseURL != nil { if c.base != nil {
pathPrefix = path.Join(pathPrefix, baseURL.Path) pathPrefix = path.Join("/", c.base.Path, c.versionedAPIPath)
} else {
pathPrefix = path.Join("/", c.versionedAPIPath)
} }
var timeout time.Duration
if c.Client != nil {
timeout = c.Client.Timeout
}
r := &Request{ r := &Request{
client: client, c: c,
verb: verb, rateLimiter: c.rateLimiter,
baseURL: baseURL, backoff: backoff,
pathPrefix: path.Join(pathPrefix, versionedAPIPath),
content: content,
serializers: serializers,
backoffMgr: backoff,
throttle: throttle,
timeout: timeout, timeout: timeout,
pathPrefix: pathPrefix,
} }
switch { switch {
case len(content.AcceptContentTypes) > 0: case len(c.content.AcceptContentTypes) > 0:
r.SetHeader("Accept", content.AcceptContentTypes) r.SetHeader("Accept", c.content.AcceptContentTypes)
case len(content.ContentType) > 0: case len(c.content.ContentType) > 0:
r.SetHeader("Accept", content.ContentType+", */*") r.SetHeader("Accept", c.content.ContentType+", */*")
} }
return r return r
} }
// NewRequestWithClient creates a Request with an embedded RESTClient for use in test scenarios.
func NewRequestWithClient(base *url.URL, versionedAPIPath string, content ClientContentConfig, client *http.Client) *Request {
return NewRequest(&RESTClient{
base: base,
versionedAPIPath: versionedAPIPath,
content: content,
Client: client,
})
}
// Verb sets the verb this request will use.
func (r *Request) Verb(verb string) *Request {
r.verb = verb
return r
}
// Prefix adds segments to the relative beginning to the request path. These // Prefix adds segments to the relative beginning to the request path. These
// items will be placed before the optional Namespace, Resource, or Name sections. // items will be placed before the optional Namespace, Resource, or Name sections.
// Setting AbsPath will clear any previously set Prefix segments // Setting AbsPath will clear any previously set Prefix segments
@ -184,17 +206,17 @@ func (r *Request) Resource(resource string) *Request {
// or defaults to the stub implementation if nil is provided // or defaults to the stub implementation if nil is provided
func (r *Request) BackOff(manager BackoffManager) *Request { func (r *Request) BackOff(manager BackoffManager) *Request {
if manager == nil { if manager == nil {
r.backoffMgr = &NoBackoff{} r.backoff = &NoBackoff{}
return r return r
} }
r.backoffMgr = manager r.backoff = manager
return r return r
} }
// Throttle receives a rate-limiter and sets or replaces an existing request limiter // Throttle receives a rate-limiter and sets or replaces an existing request limiter
func (r *Request) Throttle(limiter flowcontrol.RateLimiter) *Request { func (r *Request) Throttle(limiter flowcontrol.RateLimiter) *Request {
r.throttle = limiter r.rateLimiter = limiter
return r return r
} }
@ -272,8 +294,8 @@ func (r *Request) AbsPath(segments ...string) *Request {
if r.err != nil { if r.err != nil {
return r return r
} }
r.pathPrefix = path.Join(r.baseURL.Path, path.Join(segments...)) r.pathPrefix = path.Join(r.c.base.Path, path.Join(segments...))
if len(segments) == 1 && (len(r.baseURL.Path) > 1 || len(segments[0]) > 1) && strings.HasSuffix(segments[0], "/") { if len(segments) == 1 && (len(r.c.base.Path) > 1 || len(segments[0]) > 1) && strings.HasSuffix(segments[0], "/") {
// preserve any trailing slashes for legacy behavior // preserve any trailing slashes for legacy behavior
r.pathPrefix += "/" r.pathPrefix += "/"
} }
@ -317,7 +339,7 @@ func (r *Request) Param(paramName, s string) *Request {
// VersionedParams will not write query parameters that have omitempty set and are empty. If a // VersionedParams will not write query parameters that have omitempty set and are empty. If a
// parameter has already been set it is appended to (Params and VersionedParams are additive). // parameter has already been set it is appended to (Params and VersionedParams are additive).
func (r *Request) VersionedParams(obj runtime.Object, codec runtime.ParameterCodec) *Request { func (r *Request) VersionedParams(obj runtime.Object, codec runtime.ParameterCodec) *Request {
return r.SpecificallyVersionedParams(obj, codec, *r.content.GroupVersion) return r.SpecificallyVersionedParams(obj, codec, r.c.content.GroupVersion)
} }
func (r *Request) SpecificallyVersionedParams(obj runtime.Object, codec runtime.ParameterCodec, version schema.GroupVersion) *Request { func (r *Request) SpecificallyVersionedParams(obj runtime.Object, codec runtime.ParameterCodec, version schema.GroupVersion) *Request {
@ -397,14 +419,19 @@ func (r *Request) Body(obj interface{}) *Request {
if reflect.ValueOf(t).IsNil() { if reflect.ValueOf(t).IsNil() {
return r return r
} }
data, err := runtime.Encode(r.serializers.Encoder, t) encoder, err := r.c.content.Negotiator.Encoder(r.c.content.ContentType, nil)
if err != nil {
r.err = err
return r
}
data, err := runtime.Encode(encoder, t)
if err != nil { if err != nil {
r.err = err r.err = err
return r return r
} }
glogBody("Request Body", data) glogBody("Request Body", data)
r.body = bytes.NewReader(data) r.body = bytes.NewReader(data)
r.SetHeader("Content-Type", r.content.ContentType) r.SetHeader("Content-Type", r.c.content.ContentType)
default: default:
r.err = fmt.Errorf("unknown type used for body: %+v", obj) r.err = fmt.Errorf("unknown type used for body: %+v", obj)
} }
@ -433,8 +460,8 @@ func (r *Request) URL() *url.URL {
} }
finalURL := &url.URL{} finalURL := &url.URL{}
if r.baseURL != nil { if r.c.base != nil {
*finalURL = *r.baseURL *finalURL = *r.c.base
} }
finalURL.Path = p finalURL.Path = p
@ -468,8 +495,8 @@ func (r Request) finalURLTemplate() url.URL {
segments := strings.Split(r.URL().Path, "/") segments := strings.Split(r.URL().Path, "/")
groupIndex := 0 groupIndex := 0
index := 0 index := 0
if r.URL() != nil && r.baseURL != nil && strings.Contains(r.URL().Path, r.baseURL.Path) { if r.URL() != nil && r.c.base != nil && strings.Contains(r.URL().Path, r.c.base.Path) {
groupIndex += len(strings.Split(r.baseURL.Path, "/")) groupIndex += len(strings.Split(r.c.base.Path, "/"))
} }
if groupIndex >= len(segments) { if groupIndex >= len(segments) {
return *url return *url
@ -522,16 +549,16 @@ func (r Request) finalURLTemplate() url.URL {
} }
func (r *Request) tryThrottle() error { func (r *Request) tryThrottle() error {
if r.throttle == nil { if r.rateLimiter == nil {
return nil return nil
} }
now := time.Now() now := time.Now()
var err error var err error
if r.ctx != nil { if r.ctx != nil {
err = r.throttle.Wait(r.ctx) err = r.rateLimiter.Wait(r.ctx)
} else { } else {
r.throttle.Accept() r.rateLimiter.Accept()
} }
if latency := time.Since(now); latency > longThrottleLatency { if latency := time.Since(now); latency > longThrottleLatency {
@ -544,27 +571,11 @@ func (r *Request) tryThrottle() error {
// Watch attempts to begin watching the requested location. // Watch attempts to begin watching the requested location.
// Returns a watch.Interface, or an error. // Returns a watch.Interface, or an error.
func (r *Request) Watch() (watch.Interface, error) { func (r *Request) Watch() (watch.Interface, error) {
return r.WatchWithSpecificDecoders(
func(body io.ReadCloser) streaming.Decoder {
framer := r.serializers.Framer.NewFrameReader(body)
return streaming.NewDecoder(framer, r.serializers.StreamingSerializer)
},
r.serializers.Decoder,
)
}
// WatchWithSpecificDecoders attempts to begin watching the requested location with a *different* decoder.
// Turns out that you want one "standard" decoder for the watch event and one "personal" decoder for the content
// Returns a watch.Interface, or an error.
func (r *Request) WatchWithSpecificDecoders(wrapperDecoderFn func(io.ReadCloser) streaming.Decoder, embeddedDecoder runtime.Decoder) (watch.Interface, error) {
// We specifically don't want to rate limit watches, so we // We specifically don't want to rate limit watches, so we
// don't use r.throttle here. // don't use r.rateLimiter here.
if r.err != nil { if r.err != nil {
return nil, r.err return nil, r.err
} }
if r.serializers.Framer == nil {
return nil, fmt.Errorf("watching resources is not possible with this client (content-type: %s)", r.content.ContentType)
}
url := r.URL().String() url := r.URL().String()
req, err := http.NewRequest(r.verb, url, r.body) req, err := http.NewRequest(r.verb, url, r.body)
@ -575,18 +586,18 @@ func (r *Request) WatchWithSpecificDecoders(wrapperDecoderFn func(io.ReadCloser)
req = req.WithContext(r.ctx) req = req.WithContext(r.ctx)
} }
req.Header = r.headers req.Header = r.headers
client := r.client client := r.c.Client
if client == nil { if client == nil {
client = http.DefaultClient client = http.DefaultClient
} }
r.backoffMgr.Sleep(r.backoffMgr.CalculateBackoff(r.URL())) r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL()))
resp, err := client.Do(req) resp, err := client.Do(req)
updateURLMetrics(r, resp, err) updateURLMetrics(r, resp, err)
if r.baseURL != nil { if r.c.base != nil {
if err != nil { if err != nil {
r.backoffMgr.UpdateBackoff(r.baseURL, err, 0) r.backoff.UpdateBackoff(r.c.base, err, 0)
} else { } else {
r.backoffMgr.UpdateBackoff(r.baseURL, err, resp.StatusCode) r.backoff.UpdateBackoff(r.c.base, err, resp.StatusCode)
} }
} }
if err != nil { if err != nil {
@ -604,9 +615,22 @@ func (r *Request) WatchWithSpecificDecoders(wrapperDecoderFn func(io.ReadCloser)
} }
return nil, fmt.Errorf("for request %s, got status: %v", url, resp.StatusCode) return nil, fmt.Errorf("for request %s, got status: %v", url, resp.StatusCode)
} }
wrapperDecoder := wrapperDecoderFn(resp.Body)
contentType := resp.Header.Get("Content-Type")
mediaType, params, err := mime.ParseMediaType(contentType)
if err != nil {
klog.V(4).Infof("Unexpected content type from the server: %q: %v", contentType, err)
}
objectDecoder, streamingSerializer, framer, err := r.c.content.Negotiator.StreamDecoder(mediaType, params)
if err != nil {
return nil, err
}
frameReader := framer.NewFrameReader(resp.Body)
watchEventDecoder := streaming.NewDecoder(frameReader, streamingSerializer)
return watch.NewStreamWatcher( return watch.NewStreamWatcher(
restclientwatch.NewDecoder(wrapperDecoder, embeddedDecoder), restclientwatch.NewDecoder(watchEventDecoder, objectDecoder),
// use 500 to indicate that the cause of the error is unknown - other error codes // use 500 to indicate that the cause of the error is unknown - other error codes
// are more specific to HTTP interactions, and set a reason // are more specific to HTTP interactions, and set a reason
errors.NewClientErrorReporter(http.StatusInternalServerError, r.verb, "ClientWatchDecoding"), errors.NewClientErrorReporter(http.StatusInternalServerError, r.verb, "ClientWatchDecoding"),
@ -617,8 +641,8 @@ func (r *Request) WatchWithSpecificDecoders(wrapperDecoderFn func(io.ReadCloser)
// It also handles corner cases for incomplete/invalid request data. // It also handles corner cases for incomplete/invalid request data.
func updateURLMetrics(req *Request, resp *http.Response, err error) { func updateURLMetrics(req *Request, resp *http.Response, err error) {
url := "none" url := "none"
if req.baseURL != nil { if req.c.base != nil {
url = req.baseURL.Host url = req.c.base.Host
} }
// Errors can be arbitrary strings. Unbound label cardinality is not suitable for a metric // Errors can be arbitrary strings. Unbound label cardinality is not suitable for a metric
@ -656,18 +680,18 @@ func (r *Request) Stream() (io.ReadCloser, error) {
req = req.WithContext(r.ctx) req = req.WithContext(r.ctx)
} }
req.Header = r.headers req.Header = r.headers
client := r.client client := r.c.Client
if client == nil { if client == nil {
client = http.DefaultClient client = http.DefaultClient
} }
r.backoffMgr.Sleep(r.backoffMgr.CalculateBackoff(r.URL())) r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL()))
resp, err := client.Do(req) resp, err := client.Do(req)
updateURLMetrics(r, resp, err) updateURLMetrics(r, resp, err)
if r.baseURL != nil { if r.c.base != nil {
if err != nil { if err != nil {
r.backoffMgr.UpdateBackoff(r.URL(), err, 0) r.backoff.UpdateBackoff(r.URL(), err, 0)
} else { } else {
r.backoffMgr.UpdateBackoff(r.URL(), err, resp.StatusCode) r.backoff.UpdateBackoff(r.URL(), err, resp.StatusCode)
} }
} }
if err != nil { if err != nil {
@ -691,6 +715,33 @@ func (r *Request) Stream() (io.ReadCloser, error) {
} }
} }
// requestPreflightCheck looks for common programmer errors on Request.
//
// We tackle here two programmer mistakes. The first one is to try to create
// something(POST) using an empty string as namespace with namespaceSet as
// true. If namespaceSet is true then namespace should also be defined. The
// second mistake is, when under the same circumstances, the programmer tries
// to GET, PUT or DELETE a named resource(resourceName != ""), again, if
// namespaceSet is true then namespace must not be empty.
func (r *Request) requestPreflightCheck() error {
if !r.namespaceSet {
return nil
}
if len(r.namespace) > 0 {
return nil
}
switch r.verb {
case "POST":
return fmt.Errorf("an empty namespace may not be set during creation")
case "GET", "PUT", "DELETE":
if len(r.resourceName) > 0 {
return fmt.Errorf("an empty namespace may not be set when a resource name is provided")
}
}
return nil
}
// request connects to the server and invokes the provided function when a server response is // request connects to the server and invokes the provided function when a server response is
// received. It handles retry behavior and up front validation of requests. It will invoke // received. It handles retry behavior and up front validation of requests. It will invoke
// fn at most once. It will return an error if a problem occurred prior to connecting to the // fn at most once. It will return an error if a problem occurred prior to connecting to the
@ -707,15 +758,11 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error {
return r.err return r.err
} }
// TODO: added to catch programmer errors (invoking operations with an object with an empty namespace) if err := r.requestPreflightCheck(); err != nil {
if (r.verb == "GET" || r.verb == "PUT" || r.verb == "DELETE") && r.namespaceSet && len(r.resourceName) > 0 && len(r.namespace) == 0 { return err
return fmt.Errorf("an empty namespace may not be set when a resource name is provided")
}
if (r.verb == "POST") && r.namespaceSet && len(r.namespace) == 0 {
return fmt.Errorf("an empty namespace may not be set during creation")
} }
client := r.client client := r.c.Client
if client == nil { if client == nil {
client = http.DefaultClient client = http.DefaultClient
} }
@ -742,11 +789,11 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error {
} }
req.Header = r.headers req.Header = r.headers
r.backoffMgr.Sleep(r.backoffMgr.CalculateBackoff(r.URL())) r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL()))
if retries > 0 { if retries > 0 {
// We are retrying the request that we already send to apiserver // We are retrying the request that we already send to apiserver
// at least once before. // at least once before.
// This request should also be throttled with the client-internal throttler. // This request should also be throttled with the client-internal rate limiter.
if err := r.tryThrottle(); err != nil { if err := r.tryThrottle(); err != nil {
return err return err
} }
@ -754,9 +801,9 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error {
resp, err := client.Do(req) resp, err := client.Do(req)
updateURLMetrics(r, resp, err) updateURLMetrics(r, resp, err)
if err != nil { if err != nil {
r.backoffMgr.UpdateBackoff(r.URL(), err, 0) r.backoff.UpdateBackoff(r.URL(), err, 0)
} else { } else {
r.backoffMgr.UpdateBackoff(r.URL(), err, resp.StatusCode) r.backoff.UpdateBackoff(r.URL(), err, resp.StatusCode)
} }
if err != nil { if err != nil {
// "Connection reset by peer" is usually a transient error. // "Connection reset by peer" is usually a transient error.
@ -799,7 +846,7 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error {
} }
klog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", seconds, retries, url) klog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", seconds, retries, url)
r.backoffMgr.Sleep(time.Duration(seconds) * time.Second) r.backoff.Sleep(time.Duration(seconds) * time.Second)
return false return false
} }
fn(req, resp) fn(req, resp)
@ -815,8 +862,6 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error {
// processing. // processing.
// //
// Error type: // Error type:
// * If the request can't be constructed, or an error happened earlier while building its
// arguments: *RequestConstructionError
// * If the server responds with a status: *errors.StatusError or *errors.UnexpectedObjectError // * If the server responds with a status: *errors.StatusError or *errors.UnexpectedObjectError
// * http.Client.Do errors are returned directly. // * http.Client.Do errors are returned directly.
func (r *Request) Do() Result { func (r *Request) Do() Result {
@ -887,14 +932,18 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu
glogBody("Response Body", body) glogBody("Response Body", body)
// verify the content type is accurate // verify the content type is accurate
var decoder runtime.Decoder
contentType := resp.Header.Get("Content-Type") contentType := resp.Header.Get("Content-Type")
decoder := r.serializers.Decoder if len(contentType) == 0 {
if len(contentType) > 0 && (decoder == nil || (len(r.content.ContentType) > 0 && contentType != r.content.ContentType)) { contentType = r.c.content.ContentType
}
if len(contentType) > 0 {
var err error
mediaType, params, err := mime.ParseMediaType(contentType) mediaType, params, err := mime.ParseMediaType(contentType)
if err != nil { if err != nil {
return Result{err: errors.NewInternalError(err)} return Result{err: errors.NewInternalError(err)}
} }
decoder, err = r.serializers.RenegotiatedDecoder(mediaType, params) decoder, err = r.c.content.Negotiator.Decoder(mediaType, params)
if err != nil { if err != nil {
// if we fail to negotiate a decoder, treat this as an unstructured error // if we fail to negotiate a decoder, treat this as an unstructured error
switch { switch {
@ -1014,7 +1063,7 @@ func (r *Request) newUnstructuredResponseError(body []byte, isTextResponse bool,
} }
var groupResource schema.GroupResource var groupResource schema.GroupResource
if len(r.resource) > 0 { if len(r.resource) > 0 {
groupResource.Group = r.content.GroupVersion.Group groupResource.Group = r.c.content.GroupVersion.Group
groupResource.Resource = r.resource groupResource.Resource = r.resource
} }
return errors.NewGenericServerResponse( return errors.NewGenericServerResponse(

View File

@ -31,10 +31,12 @@ import (
type Config struct { type Config struct {
// Legacy field from pkg/api/types.go TypeMeta. // Legacy field from pkg/api/types.go TypeMeta.
// TODO(jlowdermilk): remove this after eliminating downstream dependencies. // TODO(jlowdermilk): remove this after eliminating downstream dependencies.
// +k8s:conversion-gen=false
// +optional // +optional
Kind string `json:"kind,omitempty"` Kind string `json:"kind,omitempty"`
// Legacy field from pkg/api/types.go TypeMeta. // Legacy field from pkg/api/types.go TypeMeta.
// TODO(jlowdermilk): remove this after eliminating downstream dependencies. // TODO(jlowdermilk): remove this after eliminating downstream dependencies.
// +k8s:conversion-gen=false
// +optional // +optional
APIVersion string `json:"apiVersion,omitempty"` APIVersion string `json:"apiVersion,omitempty"`
// Preferences holds general information to be use for cli interactions // Preferences holds general information to be use for cli interactions
@ -64,6 +66,7 @@ type Preferences struct {
// Cluster contains information about how to communicate with a kubernetes cluster // Cluster contains information about how to communicate with a kubernetes cluster
type Cluster struct { type Cluster struct {
// LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized.
// +k8s:conversion-gen=false
LocationOfOrigin string LocationOfOrigin string
// Server is the address of the kubernetes cluster (https://hostname:port). // Server is the address of the kubernetes cluster (https://hostname:port).
Server string `json:"server"` Server string `json:"server"`
@ -84,6 +87,7 @@ type Cluster struct {
// AuthInfo contains information that describes identity information. This is use to tell the kubernetes cluster who you are. // AuthInfo contains information that describes identity information. This is use to tell the kubernetes cluster who you are.
type AuthInfo struct { type AuthInfo struct {
// LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized.
// +k8s:conversion-gen=false
LocationOfOrigin string LocationOfOrigin string
// ClientCertificate is the path to a client cert file for TLS. // ClientCertificate is the path to a client cert file for TLS.
// +optional // +optional
@ -132,6 +136,7 @@ type AuthInfo struct {
// Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with) // Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with)
type Context struct { type Context struct {
// LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized.
// +k8s:conversion-gen=false
LocationOfOrigin string LocationOfOrigin string
// Cluster is the name of the cluster for this context // Cluster is the name of the cluster for this context
Cluster string `json:"cluster"` Cluster string `json:"cluster"`

View File

@ -72,7 +72,22 @@ func WriteCert(certPath string, data []byte) error {
// NewPool returns an x509.CertPool containing the certificates in the given PEM-encoded file. // NewPool returns an x509.CertPool containing the certificates in the given PEM-encoded file.
// Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates // Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates
func NewPool(filename string) (*x509.CertPool, error) { func NewPool(filename string) (*x509.CertPool, error) {
certs, err := CertsFromFile(filename) pemBlock, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
pool, err := NewPoolFromBytes(pemBlock)
if err != nil {
return nil, fmt.Errorf("error creating pool from %s: %s", filename, err)
}
return pool, nil
}
// NewPoolFromBytes returns an x509.CertPool containing the certificates in the given PEM-encoded bytes.
// Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates
func NewPoolFromBytes(pemBlock []byte) (*x509.CertPool, error) {
certs, err := ParseCertsPEM(pemBlock)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package cert package cert
import ( import (
"bytes"
"crypto/x509" "crypto/x509"
"encoding/pem" "encoding/pem"
"errors" "errors"
@ -59,3 +60,14 @@ func ParseCertsPEM(pemCerts []byte) ([]*x509.Certificate, error) {
} }
return certs, nil return certs, nil
} }
// EncodeCertificates returns the PEM-encoded byte array that represents by the specified certs.
func EncodeCertificates(certs ...*x509.Certificate) ([]byte, error) {
b := bytes.Buffer{}
for _, cert := range certs {
if err := pem.Encode(&b, &pem.Block{Type: CertificateBlockType, Bytes: cert.Raw}); err != nil {
return []byte{}, err
}
}
return b.Bytes(), nil
}

102
vendor/k8s.io/client-go/util/cert/server_inspection.go generated vendored Normal file
View File

@ -0,0 +1,102 @@
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT 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 cert
import (
"crypto/tls"
"crypto/x509"
"fmt"
"net/url"
"strings"
)
// GetClientCANames gets the CA names for client certs that a server accepts. This is useful when inspecting the
// state of particular servers. apiHost is "host:port"
func GetClientCANames(apiHost string) ([]string, error) {
// when we run this the second time, we know which one we are expecting
acceptableCAs := []string{}
tlsConfig := &tls.Config{
InsecureSkipVerify: true, // this is insecure to always get to the GetClientCertificate
GetClientCertificate: func(hello *tls.CertificateRequestInfo) (*tls.Certificate, error) {
acceptableCAs = []string{}
for _, curr := range hello.AcceptableCAs {
acceptableCAs = append(acceptableCAs, string(curr))
}
return &tls.Certificate{}, nil
},
}
conn, err := tls.Dial("tcp", apiHost, tlsConfig)
if err != nil {
return nil, err
}
if err := conn.Close(); err != nil {
return nil, err
}
return acceptableCAs, nil
}
// GetClientCANamesForURL is GetClientCANames against a URL string like we use in kubeconfigs
func GetClientCANamesForURL(kubeConfigURL string) ([]string, error) {
apiserverURL, err := url.Parse(kubeConfigURL)
if err != nil {
return nil, err
}
return GetClientCANames(apiserverURL.Host)
}
// GetServingCertificates returns the x509 certs used by a server as certificates and pem encoded bytes.
// The serverName is optional for specifying a different name to get SNI certificates. apiHost is "host:port"
func GetServingCertificates(apiHost, serverName string) ([]*x509.Certificate, [][]byte, error) {
tlsConfig := &tls.Config{
InsecureSkipVerify: true, // this is insecure so that we always get connected
}
// if a name is specified for SNI, set it.
if len(serverName) > 0 {
tlsConfig.ServerName = serverName
}
conn, err := tls.Dial("tcp", apiHost, tlsConfig)
if err != nil {
return nil, nil, err
}
if err = conn.Close(); err != nil {
return nil, nil, fmt.Errorf("failed to close connection : %v", err)
}
peerCerts := conn.ConnectionState().PeerCertificates
peerCertBytes := [][]byte{}
for _, a := range peerCerts {
actualCert, err := EncodeCertificates(a)
if err != nil {
return nil, nil, err
}
peerCertBytes = append(peerCertBytes, []byte(strings.TrimSpace(string(actualCert))))
}
return peerCerts, peerCertBytes, err
}
// GetServingCertificatesForURL is GetServingCertificates against a URL string like we use in kubeconfigs
func GetServingCertificatesForURL(kubeConfigURL, serverName string) ([]*x509.Certificate, [][]byte, error) {
apiserverURL, err := url.Parse(kubeConfigURL)
if err != nil {
return nil, nil, err
}
return GetServingCertificates(apiserverURL.Host, serverName)
}

20
vendor/k8s.io/cri-api/go.mod generated vendored
View File

@ -7,19 +7,19 @@ go 1.12
require ( require (
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
github.com/golang/protobuf v1.3.1 // indirect github.com/golang/protobuf v1.3.2 // indirect
github.com/stretchr/testify v1.3.0 github.com/kr/pretty v0.1.0 // indirect
golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc // indirect github.com/stretchr/testify v1.4.0
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f // indirect golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 // indirect
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 // indirect
golang.org/x/text v0.3.2 // indirect golang.org/x/text v0.3.2 // indirect
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 // indirect google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 // indirect
google.golang.org/grpc v1.23.0 google.golang.org/grpc v1.23.1
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v2 v2.2.4 // indirect
) )
replace ( replace (
golang.org/x/lint => golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1 golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13
golang.org/x/oauth2 => golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13
golang.org/x/sync => golang.org/x/sync v0.0.0-20181108010431-42b317875d0f
golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503
golang.org/x/text => golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db
) )

34
vendor/k8s.io/klog/klog.go generated vendored
View File

@ -142,7 +142,7 @@ func (s *severity) Set(value string) error {
if v, ok := severityByName(value); ok { if v, ok := severityByName(value); ok {
threshold = v threshold = v
} else { } else {
v, err := strconv.Atoi(value) v, err := strconv.ParseInt(value, 10, 32)
if err != nil { if err != nil {
return err return err
} }
@ -226,7 +226,7 @@ func (l *Level) Get() interface{} {
// Set is part of the flag.Value interface. // Set is part of the flag.Value interface.
func (l *Level) Set(value string) error { func (l *Level) Set(value string) error {
v, err := strconv.Atoi(value) v, err := strconv.ParseInt(value, 10, 32)
if err != nil { if err != nil {
return err return err
} }
@ -294,7 +294,7 @@ func (m *moduleSpec) Set(value string) error {
return errVmoduleSyntax return errVmoduleSyntax
} }
pattern := patLev[0] pattern := patLev[0]
v, err := strconv.Atoi(patLev[1]) v, err := strconv.ParseInt(patLev[1], 10, 32)
if err != nil { if err != nil {
return errors.New("syntax error: expect comma-separated list of filename=N") return errors.New("syntax error: expect comma-separated list of filename=N")
} }
@ -396,31 +396,23 @@ type flushSyncWriter interface {
io.Writer io.Writer
} }
// init sets up the defaults and runs flushDaemon.
func init() { func init() {
// Default stderrThreshold is ERROR. logging.stderrThreshold = errorLog // Default stderrThreshold is ERROR.
logging.stderrThreshold = errorLog
logging.setVState(0, nil, false) logging.setVState(0, nil, false)
logging.logDir = ""
logging.logFile = ""
logging.logFileMaxSizeMB = 1800
logging.toStderr = true
logging.alsoToStderr = false
logging.skipHeaders = false
logging.addDirHeader = false
logging.skipLogHeaders = false
go logging.flushDaemon() go logging.flushDaemon()
} }
var initDefaultsOnce sync.Once
// InitFlags is for explicitly initializing the flags. // InitFlags is for explicitly initializing the flags.
func InitFlags(flagset *flag.FlagSet) { func InitFlags(flagset *flag.FlagSet) {
// Initialize defaults.
initDefaultsOnce.Do(func() {
logging.logDir = ""
logging.logFile = ""
logging.logFileMaxSizeMB = 1800
logging.toStderr = true
logging.alsoToStderr = false
logging.skipHeaders = false
logging.addDirHeader = false
logging.skipLogHeaders = false
})
if flagset == nil { if flagset == nil {
flagset = flag.CommandLine flagset = flag.CommandLine
} }

9
vendor/k8s.io/kubernetes/README.md generated vendored
View File

@ -7,7 +7,7 @@
---- ----
Kubernetes is an open source system for managing [containerized applications] Kubernetes is an open source system for managing [containerized applications]
across multiple hosts; providing basic mechanisms for deployment, maintenance, across multiple hosts. It provides basic mechanisms for deployment, maintenance,
and scaling of applications. and scaling of applications.
Kubernetes builds upon a decade and a half of experience at Google running Kubernetes builds upon a decade and a half of experience at Google running
@ -15,8 +15,8 @@ production workloads at scale using a system called [Borg],
combined with best-of-breed ideas and practices from the community. combined with best-of-breed ideas and practices from the community.
Kubernetes is hosted by the Cloud Native Computing Foundation ([CNCF]). Kubernetes is hosted by the Cloud Native Computing Foundation ([CNCF]).
If you are a company that wants to help shape the evolution of If your company wants to help shape the evolution of
technologies that are container-packaged, dynamically-scheduled technologies that are container-packaged, dynamically scheduled,
and microservices-oriented, consider joining the CNCF. and microservices-oriented, consider joining the CNCF.
For details about who's involved and how Kubernetes plays a role, For details about who's involved and how Kubernetes plays a role,
read the CNCF [announcement]. read the CNCF [announcement].
@ -31,6 +31,9 @@ Try our [interactive tutorial].
Take a free course on [Scalable Microservices with Kubernetes]. Take a free course on [Scalable Microservices with Kubernetes].
To use Kubernetes code as a library in other applications, see the [list of published components](https://git.k8s.io/kubernetes/staging/README.md).
Use of the `k8s.io/kubernetes` module or `k8s.io/kubernetes/...` packages as libraries is not supported.
## To start developing Kubernetes ## To start developing Kubernetes
The [community repository] hosts all information about The [community repository] hosts all information about

352
vendor/k8s.io/kubernetes/go.mod generated vendored
View File

@ -8,107 +8,99 @@ go 1.12
require ( require (
bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690 bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690
github.com/Azure/azure-sdk-for-go v32.5.0+incompatible github.com/Azure/azure-sdk-for-go v35.0.0+incompatible
github.com/Azure/go-autorest/autorest v0.9.0 github.com/Azure/go-autorest/autorest v0.9.0
github.com/Azure/go-autorest/autorest/adal v0.5.0 github.com/Azure/go-autorest/autorest/adal v0.5.0
github.com/Azure/go-autorest/autorest/to v0.2.0 github.com/Azure/go-autorest/autorest/to v0.2.0
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534 github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534
github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab
github.com/Microsoft/go-winio v0.4.11 github.com/Microsoft/go-winio v0.4.11
github.com/Microsoft/hcsshim v0.8.6 github.com/Microsoft/hcsshim v0.0.0-20190417211021-672e52e9209d
github.com/PuerkitoBio/purell v1.1.1 github.com/PuerkitoBio/purell v1.1.1
github.com/Rican7/retry v0.1.0 // indirect github.com/Rican7/retry v0.1.0 // indirect
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e
github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7 // indirect github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7 // indirect
github.com/aws/aws-sdk-go v1.16.26 github.com/aws/aws-sdk-go v1.16.26
github.com/bazelbuild/bazel-gazelle v0.0.0-20181012220611-c728ce9f663e github.com/bazelbuild/bazel-gazelle v0.19.1-0.20191105222053-70208cbdc798
github.com/bazelbuild/buildtools v0.0.0-20180226164855-80c7f0d45d7e github.com/bazelbuild/buildtools v0.0.0-20190917191645-69366ca98f89
github.com/blang/semver v3.5.0+incompatible github.com/blang/semver v3.5.0+incompatible
github.com/boltdb/bolt v1.3.1 // indirect github.com/boltdb/bolt v1.3.1 // indirect
github.com/caddyserver/caddy v1.0.3 github.com/caddyserver/caddy v1.0.3
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c
github.com/checkpoint-restore/go-criu v0.0.0-20190109184317-bdb7599cd87b // indirect github.com/checkpoint-restore/go-criu v0.0.0-20190109184317-bdb7599cd87b // indirect
github.com/client9/misspell v0.3.4 github.com/client9/misspell v0.3.4
github.com/cloudflare/cfssl v0.0.0-20180726162950-56268a613adf
github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313 github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313
github.com/codegangsta/negroni v1.0.0 // indirect github.com/codegangsta/negroni v1.0.0 // indirect
github.com/container-storage-interface/spec v1.1.0 github.com/container-storage-interface/spec v1.2.0
github.com/containerd/console v0.0.0-20170925154832-84eeaae905fa // indirect github.com/containerd/console v0.0.0-20170925154832-84eeaae905fa // indirect
github.com/containerd/containerd v1.0.2 // indirect github.com/containerd/containerd v1.0.2 // indirect
github.com/containerd/typeurl v0.0.0-20190228175220-2a93cfde8c20 // indirect github.com/containerd/typeurl v0.0.0-20190228175220-2a93cfde8c20 // indirect
github.com/containernetworking/cni v0.7.1 github.com/containernetworking/cni v0.7.1
github.com/coredns/corefile-migration v1.0.2 github.com/coredns/corefile-migration v1.0.4
github.com/coreos/etcd v3.3.15+incompatible github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea
github.com/coreos/rkt v1.30.0 // indirect
github.com/cpuguy83/go-md2man v1.0.10 github.com/cpuguy83/go-md2man v1.0.10
github.com/cyphar/filepath-securejoin v0.2.2 // indirect github.com/cyphar/filepath-securejoin v0.2.2 // indirect
github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew v1.1.1
github.com/docker/distribution v2.7.1+incompatible github.com/docker/distribution v2.7.1+incompatible
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0
github.com/docker/go-connections v0.3.0 github.com/docker/go-connections v0.3.0
github.com/docker/go-units v0.3.3 github.com/docker/go-units v0.4.0
github.com/docker/libnetwork v0.0.0-20180830151422-a9cd636e3789 github.com/docker/libnetwork v0.8.0-dev.2.0.20190624125649-f0e46a78ea34
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e
github.com/emicklei/go-restful v2.9.5+incompatible github.com/emicklei/go-restful v2.9.5+incompatible
github.com/euank/go-kmsg-parser v2.0.0+incompatible // indirect github.com/euank/go-kmsg-parser v2.0.0+incompatible // indirect
github.com/evanphx/json-patch v4.2.0+incompatible github.com/evanphx/json-patch v4.2.0+incompatible
github.com/fsnotify/fsnotify v1.4.7 github.com/fsnotify/fsnotify v1.4.7
github.com/go-bindata/go-bindata v3.1.1+incompatible github.com/go-bindata/go-bindata v3.1.1+incompatible
github.com/go-openapi/loads v0.19.2 github.com/go-openapi/analysis v0.19.5
github.com/go-openapi/spec v0.19.2 github.com/go-openapi/loads v0.19.4
github.com/go-openapi/strfmt v0.19.0 github.com/go-openapi/spec v0.19.3
github.com/go-openapi/validate v0.19.2 github.com/go-openapi/strfmt v0.19.3
github.com/go-openapi/validate v0.19.5
github.com/go-ozzo/ozzo-validation v3.5.0+incompatible // indirect github.com/go-ozzo/ozzo-validation v3.5.0+incompatible // indirect
github.com/godbus/dbus v4.1.0+incompatible github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f // indirect
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903
github.com/golang/mock v1.2.0 github.com/golang/mock v1.2.0
github.com/golang/protobuf v1.3.1 github.com/google/cadvisor v0.35.0
github.com/google/cadvisor v0.34.0
github.com/google/certificate-transparency-go v1.0.21 // indirect
github.com/google/go-cmp v0.3.0 github.com/google/go-cmp v0.3.0
github.com/google/gofuzz v1.0.0 github.com/google/gofuzz v1.0.0
github.com/google/uuid v1.1.1
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d
github.com/gorilla/context v1.1.1 // indirect github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/mux v1.7.0 // indirect github.com/gorilla/mux v1.7.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 github.com/hashicorp/golang-lru v0.5.1
github.com/heketi/heketi v9.0.0+incompatible github.com/heketi/heketi v9.0.1-0.20190917153846-c2e2a4ab7ab9+incompatible
github.com/heketi/rest v0.0.0-20180404230133-aa6a65207413 // indirect
github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6 // indirect github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6 // indirect
github.com/heketi/utils v0.0.0-20170317161834-435bc5bdfa64 // indirect github.com/json-iterator/go v1.1.8
github.com/json-iterator/go v1.1.7
github.com/karrick/godirwalk v1.7.5 // indirect github.com/karrick/godirwalk v1.7.5 // indirect
github.com/libopenstorage/openstorage v1.0.0 github.com/libopenstorage/openstorage v1.0.0
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de
github.com/lithammer/dedent v1.1.0 github.com/lithammer/dedent v1.1.0
github.com/lpabon/godbc v0.1.1 // indirect github.com/lpabon/godbc v0.1.1 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mattn/go-shellwords v1.0.5 // indirect github.com/mattn/go-shellwords v1.0.5 // indirect
github.com/mesos/mesos-go v0.0.9 // indirect github.com/mesos/mesos-go v0.0.9 // indirect
github.com/miekg/dns v1.1.4 github.com/miekg/dns v1.1.4
github.com/mindprince/gonvml v0.0.0-20171110221305-fee913ce8fb2 // indirect github.com/mindprince/gonvml v0.0.0-20190828220739-9ebdce4bb989 // indirect
github.com/mistifyio/go-zfs v2.1.1+incompatible // indirect github.com/mistifyio/go-zfs v2.1.1+incompatible // indirect
github.com/mohae/deepcopy v0.0.0-20170603005431-491d3605edfb // indirect github.com/mohae/deepcopy v0.0.0-20170603005431-491d3605edfb // indirect
github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect
github.com/mrunalp/fileutils v0.0.0-20160930181131-4ee1cc9a8058 // indirect github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618 // indirect
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
github.com/mvdan/xurls v1.1.0 github.com/mvdan/xurls v1.1.0
github.com/onsi/ginkgo v1.8.0 github.com/onsi/ginkgo v1.10.1
github.com/onsi/gomega v1.5.0 github.com/onsi/gomega v1.7.0
github.com/opencontainers/go-digest v1.0.0-rc1 github.com/opencontainers/go-digest v1.0.0-rc1
github.com/opencontainers/image-spec v1.0.1 // indirect github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/opencontainers/runc v1.0.0-rc2.0.20190611121236-6cc515888830 github.com/opencontainers/runc v1.0.0-rc9
github.com/opencontainers/runtime-spec v1.0.0 // indirect github.com/opencontainers/runtime-spec v1.0.0 // indirect
github.com/opencontainers/selinux v1.2.2 github.com/opencontainers/selinux v1.3.1-0.20190929122143-5215b1806f52
github.com/pborman/uuid v1.2.0 github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.8.0
github.com/pmezard/go-difflib v1.0.0 github.com/pmezard/go-difflib v1.0.0
github.com/pquerna/ffjson v0.0.0-20180717144149-af8b230fcd20 // indirect github.com/pquerna/ffjson v0.0.0-20180717144149-af8b230fcd20 // indirect
github.com/prometheus/client_golang v0.9.2 github.com/prometheus/client_golang v1.0.0
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 github.com/prometheus/common v0.4.1
github.com/quobyte/api v0.1.2 github.com/quobyte/api v0.1.2
github.com/robfig/cron v1.1.0 github.com/robfig/cron v1.1.0
github.com/seccomp/libseccomp-golang v0.9.1 // indirect github.com/seccomp/libseccomp-golang v0.9.1 // indirect
@ -116,30 +108,30 @@ require (
github.com/spf13/afero v1.2.2 github.com/spf13/afero v1.2.2
github.com/spf13/cobra v0.0.5 github.com/spf13/cobra v0.0.5
github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.3 github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.3.2 github.com/spf13/viper v1.3.2
github.com/storageos/go-api v0.0.0-20180912212459-343b3eff91fc github.com/storageos/go-api v0.0.0-20180912212459-343b3eff91fc
github.com/stretchr/testify v1.3.0 github.com/stretchr/testify v1.4.0
github.com/syndtr/gocapability v0.0.0-20160928074757-e7cb7fa329f4 // indirect github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 // indirect
github.com/thecodeteam/goscaleio v0.1.0 github.com/thecodeteam/goscaleio v0.1.0
github.com/urfave/negroni v1.0.0 // indirect github.com/urfave/negroni v1.0.0 // indirect
github.com/vishvananda/netlink v0.0.0-20171020171820-b2de5d10e38e github.com/vishvananda/netlink v1.0.0
github.com/vishvananda/netns v0.0.0-20171111001504-be1fbeda1936 // indirect github.com/vishvananda/netns v0.0.0-20171111001504-be1fbeda1936 // indirect
github.com/vmware/govmomi v0.20.1 github.com/vmware/govmomi v0.20.3
github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1 // indirect go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
golang.org/x/lint v0.0.0-20190409202823-959b441ac422 golang.org/x/lint v0.0.0-20190409202823-959b441ac422
golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc golang.org/x/net v0.0.0-20191004110552-13f9640d40b9
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485
google.golang.org/api v0.6.1-0.20190607001116-5213b8090861 google.golang.org/api v0.6.1-0.20190607001116-5213b8090861
google.golang.org/grpc v1.23.0 google.golang.org/grpc v1.23.1
gopkg.in/gcfg.v1 v1.2.0 gopkg.in/gcfg.v1 v1.2.0
gopkg.in/square/go-jose.v2 v2.2.2 gopkg.in/square/go-jose.v2 v2.2.2
gopkg.in/yaml.v2 v2.2.2 gopkg.in/yaml.v2 v2.2.4
gotest.tools v2.2.0+incompatible gotest.tools v2.2.0+incompatible
gotest.tools/gotestsum v0.3.5 gotest.tools/gotestsum v0.3.5
honnef.co/go/tools v0.0.1-2019.2.2 honnef.co/go/tools v0.0.1-2019.2.2
@ -157,28 +149,28 @@ require (
k8s.io/csi-translation-lib v0.0.0 k8s.io/csi-translation-lib v0.0.0
k8s.io/gengo v0.0.0-20190822140433-26a664648505 k8s.io/gengo v0.0.0-20190822140433-26a664648505
k8s.io/heapster v1.2.0-beta.1 k8s.io/heapster v1.2.0-beta.1
k8s.io/klog v0.4.0 k8s.io/klog v1.0.0
k8s.io/kube-aggregator v0.0.0 k8s.io/kube-aggregator v0.0.0
k8s.io/kube-controller-manager v0.0.0 k8s.io/kube-controller-manager v0.0.0
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
k8s.io/kube-proxy v0.0.0 k8s.io/kube-proxy v0.0.0
k8s.io/kube-scheduler v0.0.0 k8s.io/kube-scheduler v0.0.0
k8s.io/kubectl v0.0.0 k8s.io/kubectl v0.0.0
k8s.io/kubelet v0.0.0 k8s.io/kubelet v0.0.0
k8s.io/legacy-cloud-providers v0.0.0 k8s.io/legacy-cloud-providers v0.0.0
k8s.io/metrics v0.0.0 k8s.io/metrics v0.0.0
k8s.io/repo-infra v0.0.0-20181204233714-00fe14e3d1a3 k8s.io/repo-infra v0.0.1-alpha.1
k8s.io/sample-apiserver v0.0.0 k8s.io/sample-apiserver v0.0.0
k8s.io/utils v0.0.0-20190801114015-581e00157fb1 k8s.io/system-validators v1.0.4
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f
sigs.k8s.io/kustomize v2.0.3+incompatible sigs.k8s.io/kustomize v2.0.3+incompatible
sigs.k8s.io/yaml v1.1.0 sigs.k8s.io/yaml v1.1.0
vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc
) )
replace ( replace (
bitbucket.org/bertimus9/systemstat => bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690 bitbucket.org/bertimus9/systemstat => bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690
cloud.google.com/go => cloud.google.com/go v0.38.0 cloud.google.com/go => cloud.google.com/go v0.38.0
github.com/Azure/azure-sdk-for-go => github.com/Azure/azure-sdk-for-go v32.5.0+incompatible github.com/Azure/azure-sdk-for-go => github.com/Azure/azure-sdk-for-go v35.0.0+incompatible
github.com/Azure/go-ansiterm => github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 github.com/Azure/go-ansiterm => github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78
github.com/Azure/go-autorest/autorest => github.com/Azure/go-autorest/autorest v0.9.0 github.com/Azure/go-autorest/autorest => github.com/Azure/go-autorest/autorest v0.9.0
github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.5.0 github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.5.0
@ -194,22 +186,32 @@ replace (
github.com/JeffAshton/win_pdh => github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab github.com/JeffAshton/win_pdh => github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab
github.com/MakeNowJust/heredoc => github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd github.com/MakeNowJust/heredoc => github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd
github.com/Microsoft/go-winio => github.com/Microsoft/go-winio v0.4.11 github.com/Microsoft/go-winio => github.com/Microsoft/go-winio v0.4.11
github.com/Microsoft/hcsshim => github.com/Microsoft/hcsshim v0.8.6 github.com/Microsoft/hcsshim => github.com/Microsoft/hcsshim v0.0.0-20190417211021-672e52e9209d
github.com/NYTimes/gziphandler => github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 github.com/NYTimes/gziphandler => github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46
github.com/OpenPeeDeeP/depguard => github.com/OpenPeeDeeP/depguard v1.0.1
github.com/PuerkitoBio/purell => github.com/PuerkitoBio/purell v1.1.1 github.com/PuerkitoBio/purell => github.com/PuerkitoBio/purell v1.1.1
github.com/PuerkitoBio/urlesc => github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 github.com/PuerkitoBio/urlesc => github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
github.com/Rican7/retry => github.com/Rican7/retry v0.1.0 github.com/Rican7/retry => github.com/Rican7/retry v0.1.0
github.com/StackExchange/wmi => github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6
github.com/agnivade/levenshtein => github.com/agnivade/levenshtein v1.0.1
github.com/alecthomas/template => github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc
github.com/alecthomas/units => github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf
github.com/andreyvit/diff => github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
github.com/anmitsu/go-shlex => github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239
github.com/armon/circbuf => github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e github.com/armon/circbuf => github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e
github.com/armon/consul-api => github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 github.com/armon/consul-api => github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6
github.com/asaskevich/govalidator => github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a github.com/asaskevich/govalidator => github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
github.com/auth0/go-jwt-middleware => github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7 github.com/auth0/go-jwt-middleware => github.com/auth0/go-jwt-middleware v0.0.0-20170425171159-5493cabe49f7
github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.16.26 github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.16.26
github.com/bazelbuild/bazel-gazelle => github.com/bazelbuild/bazel-gazelle v0.0.0-20181012220611-c728ce9f663e github.com/bazelbuild/bazel-gazelle => github.com/bazelbuild/bazel-gazelle v0.19.1-0.20191105222053-70208cbdc798
github.com/bazelbuild/buildtools => github.com/bazelbuild/buildtools v0.0.0-20180226164855-80c7f0d45d7e github.com/bazelbuild/buildtools => github.com/bazelbuild/buildtools v0.0.0-20190917191645-69366ca98f89
github.com/beorn7/perks => github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 github.com/bazelbuild/rules_go => github.com/bazelbuild/rules_go v0.0.0-20190719190356-6dae44dc5cab
github.com/beorn7/perks => github.com/beorn7/perks v1.0.0
github.com/bgentry/speakeasy => github.com/bgentry/speakeasy v0.1.0
github.com/bifurcation/mint => github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115 github.com/bifurcation/mint => github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115
github.com/blang/semver => github.com/blang/semver v3.5.0+incompatible github.com/blang/semver => github.com/blang/semver v3.5.0+incompatible
github.com/boltdb/bolt => github.com/boltdb/bolt v1.3.1 github.com/boltdb/bolt => github.com/boltdb/bolt v1.3.1
github.com/bradfitz/go-smtpd => github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625
github.com/caddyserver/caddy => github.com/caddyserver/caddy v1.0.3 github.com/caddyserver/caddy => github.com/caddyserver/caddy v1.0.3
github.com/cenkalti/backoff => github.com/cenkalti/backoff v2.1.1+incompatible github.com/cenkalti/backoff => github.com/cenkalti/backoff v2.1.1+incompatible
github.com/cespare/prettybench => github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c github.com/cespare/prettybench => github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c
@ -217,24 +219,23 @@ replace (
github.com/checkpoint-restore/go-criu => github.com/checkpoint-restore/go-criu v0.0.0-20190109184317-bdb7599cd87b github.com/checkpoint-restore/go-criu => github.com/checkpoint-restore/go-criu v0.0.0-20190109184317-bdb7599cd87b
github.com/cheekybits/genny => github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9 github.com/cheekybits/genny => github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9
github.com/client9/misspell => github.com/client9/misspell v0.3.4 github.com/client9/misspell => github.com/client9/misspell v0.3.4
github.com/cloudflare/cfssl => github.com/cloudflare/cfssl v0.0.0-20180726162950-56268a613adf
github.com/clusterhq/flocker-go => github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313 github.com/clusterhq/flocker-go => github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313
github.com/cockroachdb/datadriven => github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa
github.com/codegangsta/negroni => github.com/codegangsta/negroni v1.0.0 github.com/codegangsta/negroni => github.com/codegangsta/negroni v1.0.0
github.com/container-storage-interface/spec => github.com/container-storage-interface/spec v1.1.0 github.com/container-storage-interface/spec => github.com/container-storage-interface/spec v1.2.0
github.com/containerd/console => github.com/containerd/console v0.0.0-20170925154832-84eeaae905fa github.com/containerd/console => github.com/containerd/console v0.0.0-20170925154832-84eeaae905fa
github.com/containerd/containerd => github.com/containerd/containerd v1.0.2 github.com/containerd/containerd => github.com/containerd/containerd v1.0.2
github.com/containerd/typeurl => github.com/containerd/typeurl v0.0.0-20190228175220-2a93cfde8c20 github.com/containerd/typeurl => github.com/containerd/typeurl v0.0.0-20190228175220-2a93cfde8c20
github.com/containernetworking/cni => github.com/containernetworking/cni v0.7.1 github.com/containernetworking/cni => github.com/containernetworking/cni v0.7.1
github.com/coredns/corefile-migration => github.com/coredns/corefile-migration v1.0.2 github.com/coredns/corefile-migration => github.com/coredns/corefile-migration v1.0.4
github.com/coreos/bbolt => github.com/coreos/bbolt v1.3.1-coreos.6 github.com/coreos/etcd => github.com/coreos/etcd v3.3.10+incompatible
github.com/coreos/etcd => github.com/coreos/etcd v3.3.15+incompatible
github.com/coreos/go-etcd => github.com/coreos/go-etcd v2.0.0+incompatible github.com/coreos/go-etcd => github.com/coreos/go-etcd v2.0.0+incompatible
github.com/coreos/go-oidc => github.com/coreos/go-oidc v2.1.0+incompatible github.com/coreos/go-oidc => github.com/coreos/go-oidc v2.1.0+incompatible
github.com/coreos/go-semver => github.com/coreos/go-semver v0.3.0 github.com/coreos/go-semver => github.com/coreos/go-semver v0.3.0
github.com/coreos/go-systemd => github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7 github.com/coreos/go-systemd => github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e
github.com/coreos/pkg => github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea github.com/coreos/pkg => github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea
github.com/coreos/rkt => github.com/coreos/rkt v1.30.0
github.com/cpuguy83/go-md2man => github.com/cpuguy83/go-md2man v1.0.10 github.com/cpuguy83/go-md2man => github.com/cpuguy83/go-md2man v1.0.10
github.com/creack/pty => github.com/creack/pty v1.1.7
github.com/cyphar/filepath-securejoin => github.com/cyphar/filepath-securejoin v0.2.2 github.com/cyphar/filepath-securejoin => github.com/cyphar/filepath-securejoin v0.2.2
github.com/davecgh/go-spew => github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew => github.com/davecgh/go-spew v1.1.1
github.com/daviddengcn/go-colortext => github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd github.com/daviddengcn/go-colortext => github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd
@ -243,8 +244,8 @@ replace (
github.com/docker/distribution => github.com/docker/distribution v2.7.1+incompatible github.com/docker/distribution => github.com/docker/distribution v2.7.1+incompatible
github.com/docker/docker => github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 github.com/docker/docker => github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0
github.com/docker/go-connections => github.com/docker/go-connections v0.3.0 github.com/docker/go-connections => github.com/docker/go-connections v0.3.0
github.com/docker/go-units => github.com/docker/go-units v0.3.3 github.com/docker/go-units => github.com/docker/go-units v0.4.0
github.com/docker/libnetwork => github.com/docker/libnetwork v0.0.0-20180830151422-a9cd636e3789 github.com/docker/libnetwork => github.com/docker/libnetwork v0.8.0-dev.2.0.20190624125649-f0e46a78ea34
github.com/docker/spdystream => github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 github.com/docker/spdystream => github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96
github.com/dustin/go-humanize => github.com/dustin/go-humanize v1.0.0 github.com/dustin/go-humanize => github.com/dustin/go-humanize v1.0.0
github.com/elazarl/goproxy => github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e github.com/elazarl/goproxy => github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e
@ -253,38 +254,72 @@ replace (
github.com/evanphx/json-patch => github.com/evanphx/json-patch v4.2.0+incompatible github.com/evanphx/json-patch => github.com/evanphx/json-patch v4.2.0+incompatible
github.com/exponent-io/jsonpath => github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d github.com/exponent-io/jsonpath => github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d
github.com/fatih/camelcase => github.com/fatih/camelcase v1.0.0 github.com/fatih/camelcase => github.com/fatih/camelcase v1.0.0
github.com/fatih/color => github.com/fatih/color v1.6.0 github.com/fatih/color => github.com/fatih/color v1.7.0
github.com/flynn/go-shlex => github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 github.com/flynn/go-shlex => github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.4.7 github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.4.7
github.com/ghodss/yaml => github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4 github.com/ghodss/yaml => github.com/ghodss/yaml v1.0.0
github.com/globalsign/mgo => github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 github.com/gliderlabs/ssh => github.com/gliderlabs/ssh v0.1.1
github.com/go-acme/lego => github.com/go-acme/lego v2.5.0+incompatible github.com/go-acme/lego => github.com/go-acme/lego v2.5.0+incompatible
github.com/go-bindata/go-bindata => github.com/go-bindata/go-bindata v3.1.1+incompatible github.com/go-bindata/go-bindata => github.com/go-bindata/go-bindata v3.1.1+incompatible
github.com/go-critic/go-critic => github.com/go-critic/go-critic v0.3.5-0.20190526074819-1df300866540
github.com/go-kit/kit => github.com/go-kit/kit v0.8.0
github.com/go-lintpack/lintpack => github.com/go-lintpack/lintpack v0.5.2
github.com/go-logfmt/logfmt => github.com/go-logfmt/logfmt v0.3.0
github.com/go-logr/logr => github.com/go-logr/logr v0.1.0 github.com/go-logr/logr => github.com/go-logr/logr v0.1.0
github.com/go-openapi/analysis => github.com/go-openapi/analysis v0.19.2 github.com/go-ole/go-ole => github.com/go-ole/go-ole v1.2.1
github.com/go-openapi/analysis => github.com/go-openapi/analysis v0.19.5
github.com/go-openapi/errors => github.com/go-openapi/errors v0.19.2 github.com/go-openapi/errors => github.com/go-openapi/errors v0.19.2
github.com/go-openapi/jsonpointer => github.com/go-openapi/jsonpointer v0.19.2 github.com/go-openapi/jsonpointer => github.com/go-openapi/jsonpointer v0.19.3
github.com/go-openapi/jsonreference => github.com/go-openapi/jsonreference v0.19.2 github.com/go-openapi/jsonreference => github.com/go-openapi/jsonreference v0.19.3
github.com/go-openapi/loads => github.com/go-openapi/loads v0.19.2 github.com/go-openapi/loads => github.com/go-openapi/loads v0.19.4
github.com/go-openapi/runtime => github.com/go-openapi/runtime v0.19.0 github.com/go-openapi/runtime => github.com/go-openapi/runtime v0.19.4
github.com/go-openapi/spec => github.com/go-openapi/spec v0.19.2 github.com/go-openapi/spec => github.com/go-openapi/spec v0.19.3
github.com/go-openapi/strfmt => github.com/go-openapi/strfmt v0.19.0 github.com/go-openapi/strfmt => github.com/go-openapi/strfmt v0.19.3
github.com/go-openapi/swag => github.com/go-openapi/swag v0.19.2 github.com/go-openapi/swag => github.com/go-openapi/swag v0.19.5
github.com/go-openapi/validate => github.com/go-openapi/validate v0.19.2 github.com/go-openapi/validate => github.com/go-openapi/validate v0.19.5
github.com/go-ozzo/ozzo-validation => github.com/go-ozzo/ozzo-validation v3.5.0+incompatible github.com/go-ozzo/ozzo-validation => github.com/go-ozzo/ozzo-validation v3.5.0+incompatible
github.com/godbus/dbus => github.com/godbus/dbus v4.1.0+incompatible github.com/go-stack/stack => github.com/go-stack/stack v1.8.0
github.com/go-toolsmith/astcast => github.com/go-toolsmith/astcast v1.0.0
github.com/go-toolsmith/astcopy => github.com/go-toolsmith/astcopy v1.0.0
github.com/go-toolsmith/astequal => github.com/go-toolsmith/astequal v1.0.0
github.com/go-toolsmith/astfmt => github.com/go-toolsmith/astfmt v1.0.0
github.com/go-toolsmith/astinfo => github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21
github.com/go-toolsmith/astp => github.com/go-toolsmith/astp v1.0.0
github.com/go-toolsmith/pkgload => github.com/go-toolsmith/pkgload v1.0.0
github.com/go-toolsmith/strparse => github.com/go-toolsmith/strparse v1.0.0
github.com/go-toolsmith/typep => github.com/go-toolsmith/typep v1.0.0
github.com/gobwas/glob => github.com/gobwas/glob v0.2.3
github.com/godbus/dbus => github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f
github.com/gogo/protobuf => github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/gogo/protobuf => github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
github.com/golang/glog => github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/glog => github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/groupcache => github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 github.com/golang/groupcache => github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903
github.com/golang/mock => github.com/golang/mock v1.2.0 github.com/golang/mock => github.com/golang/mock v1.2.0
github.com/golang/protobuf => github.com/golang/protobuf v1.3.1 github.com/golang/protobuf => github.com/golang/protobuf v1.3.2
github.com/golangci/check => github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2
github.com/golangci/dupl => github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a
github.com/golangci/errcheck => github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6
github.com/golangci/go-misc => github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613
github.com/golangci/go-tools => github.com/golangci/go-tools v0.0.0-20190318055746-e32c54105b7c
github.com/golangci/goconst => github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3
github.com/golangci/gocyclo => github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee
github.com/golangci/gofmt => github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98
github.com/golangci/golangci-lint => github.com/golangci/golangci-lint v1.18.0
github.com/golangci/gosec => github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547
github.com/golangci/ineffassign => github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc
github.com/golangci/lint-1 => github.com/golangci/lint-1 v0.0.0-20190420132249-ee948d087217
github.com/golangci/maligned => github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca
github.com/golangci/misspell => github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770
github.com/golangci/prealloc => github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21
github.com/golangci/revgrep => github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0
github.com/golangci/unconvert => github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4
github.com/golangplus/bytes => github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450 github.com/golangplus/bytes => github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450
github.com/golangplus/fmt => github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995 github.com/golangplus/fmt => github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995
github.com/golangplus/testing => github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e github.com/golangplus/testing => github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e
github.com/google/btree => github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c github.com/google/btree => github.com/google/btree v1.0.0
github.com/google/cadvisor => github.com/google/cadvisor v0.34.0 github.com/google/cadvisor => github.com/google/cadvisor v0.35.0
github.com/google/certificate-transparency-go => github.com/google/certificate-transparency-go v1.0.21
github.com/google/go-cmp => github.com/google/go-cmp v0.3.0 github.com/google/go-cmp => github.com/google/go-cmp v0.3.0
github.com/google/go-github => github.com/google/go-github v17.0.0+incompatible
github.com/google/go-querystring => github.com/google/go-querystring v1.0.0
github.com/google/gofuzz => github.com/google/gofuzz v1.0.0 github.com/google/gofuzz => github.com/google/gofuzz v1.0.0
github.com/google/martian => github.com/google/martian v2.1.0+incompatible github.com/google/martian => github.com/google/martian v2.1.0+incompatible
github.com/google/pprof => github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57 github.com/google/pprof => github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57
@ -297,31 +332,34 @@ replace (
github.com/gorilla/context => github.com/gorilla/context v1.1.1 github.com/gorilla/context => github.com/gorilla/context v1.1.1
github.com/gorilla/mux => github.com/gorilla/mux v1.7.0 github.com/gorilla/mux => github.com/gorilla/mux v1.7.0
github.com/gorilla/websocket => github.com/gorilla/websocket v1.4.0 github.com/gorilla/websocket => github.com/gorilla/websocket v1.4.0
github.com/gregjones/httpcache => github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7 github.com/gostaticanalysis/analysisutil => github.com/gostaticanalysis/analysisutil v0.0.3
github.com/grpc-ecosystem/go-grpc-middleware => github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79 github.com/gregjones/httpcache => github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
github.com/grpc-ecosystem/go-grpc-middleware => github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4
github.com/grpc-ecosystem/go-grpc-prometheus => github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/go-grpc-prometheus => github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway => github.com/grpc-ecosystem/grpc-gateway v1.3.0 github.com/grpc-ecosystem/grpc-gateway => github.com/grpc-ecosystem/grpc-gateway v1.9.5
github.com/hashicorp/go-syslog => github.com/hashicorp/go-syslog v1.0.0 github.com/hashicorp/go-syslog => github.com/hashicorp/go-syslog v1.0.0
github.com/hashicorp/golang-lru => github.com/hashicorp/golang-lru v0.5.1 github.com/hashicorp/golang-lru => github.com/hashicorp/golang-lru v0.5.1
github.com/hashicorp/hcl => github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl => github.com/hashicorp/hcl v1.0.0
github.com/heketi/heketi => github.com/heketi/heketi v9.0.0+incompatible github.com/heketi/heketi => github.com/heketi/heketi v9.0.1-0.20190917153846-c2e2a4ab7ab9+incompatible
github.com/heketi/rest => github.com/heketi/rest v0.0.0-20180404230133-aa6a65207413
github.com/heketi/tests => github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6 github.com/heketi/tests => github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6
github.com/heketi/utils => github.com/heketi/utils v0.0.0-20170317161834-435bc5bdfa64
github.com/hpcloud/tail => github.com/hpcloud/tail v1.0.0 github.com/hpcloud/tail => github.com/hpcloud/tail v1.0.0
github.com/imdario/mergo => github.com/imdario/mergo v0.3.5 github.com/imdario/mergo => github.com/imdario/mergo v0.3.5
github.com/inconshreveable/mousetrap => github.com/inconshreveable/mousetrap v1.0.0 github.com/inconshreveable/mousetrap => github.com/inconshreveable/mousetrap v1.0.0
github.com/jellevandenhooff/dkim => github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1
github.com/jimstudt/http-authentication => github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a github.com/jimstudt/http-authentication => github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a
github.com/jmespath/go-jmespath => github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af github.com/jmespath/go-jmespath => github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af
github.com/jonboulle/clockwork => github.com/jonboulle/clockwork v0.1.0 github.com/jonboulle/clockwork => github.com/jonboulle/clockwork v0.1.0
github.com/json-iterator/go => github.com/json-iterator/go v1.1.7 github.com/json-iterator/go => github.com/json-iterator/go v1.1.8
github.com/jstemmer/go-junit-report => github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 github.com/jstemmer/go-junit-report => github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
github.com/jtolds/gls => github.com/jtolds/gls v4.20.0+incompatible github.com/jtolds/gls => github.com/jtolds/gls v4.20.0+incompatible
github.com/julienschmidt/httprouter => github.com/julienschmidt/httprouter v1.2.0
github.com/karrick/godirwalk => github.com/karrick/godirwalk v1.7.5 github.com/karrick/godirwalk => github.com/karrick/godirwalk v1.7.5
github.com/kisielk/errcheck => github.com/kisielk/errcheck v1.2.0 github.com/kisielk/errcheck => github.com/kisielk/errcheck v1.2.0
github.com/kisielk/gotool => github.com/kisielk/gotool v1.0.0 github.com/kisielk/gotool => github.com/kisielk/gotool v1.0.0
github.com/klauspost/compress => github.com/klauspost/compress v1.4.1
github.com/klauspost/cpuid => github.com/klauspost/cpuid v1.2.0 github.com/klauspost/cpuid => github.com/klauspost/cpuid v1.2.0
github.com/konsorten/go-windows-terminal-sequences => github.com/konsorten/go-windows-terminal-sequences v1.0.1 github.com/konsorten/go-windows-terminal-sequences => github.com/konsorten/go-windows-terminal-sequences v1.0.1
github.com/kr/logfmt => github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515
github.com/kr/pretty => github.com/kr/pretty v0.1.0 github.com/kr/pretty => github.com/kr/pretty v0.1.0
github.com/kr/pty => github.com/kr/pty v1.1.5 github.com/kr/pty => github.com/kr/pty v1.1.5
github.com/kr/text => github.com/kr/text v0.1.0 github.com/kr/text => github.com/kr/text v0.1.0
@ -329,124 +367,161 @@ replace (
github.com/libopenstorage/openstorage => github.com/libopenstorage/openstorage v1.0.0 github.com/libopenstorage/openstorage => github.com/libopenstorage/openstorage v1.0.0
github.com/liggitt/tabwriter => github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de github.com/liggitt/tabwriter => github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de
github.com/lithammer/dedent => github.com/lithammer/dedent v1.1.0 github.com/lithammer/dedent => github.com/lithammer/dedent v1.1.0
github.com/logrusorgru/aurora => github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e
github.com/lpabon/godbc => github.com/lpabon/godbc v0.1.1 github.com/lpabon/godbc => github.com/lpabon/godbc v0.1.1
github.com/lucas-clemente/aes12 => github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f github.com/lucas-clemente/aes12 => github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f
github.com/lucas-clemente/quic-clients => github.com/lucas-clemente/quic-clients v0.1.0 github.com/lucas-clemente/quic-clients => github.com/lucas-clemente/quic-clients v0.1.0
github.com/lucas-clemente/quic-go => github.com/lucas-clemente/quic-go v0.10.2 github.com/lucas-clemente/quic-go => github.com/lucas-clemente/quic-go v0.10.2
github.com/lucas-clemente/quic-go-certificates => github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced github.com/lucas-clemente/quic-go-certificates => github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced
github.com/magiconair/properties => github.com/magiconair/properties v1.8.1 github.com/magiconair/properties => github.com/magiconair/properties v1.8.1
github.com/mailru/easyjson => github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 github.com/mailru/easyjson => github.com/mailru/easyjson v0.7.0
github.com/marten-seemann/qtls => github.com/marten-seemann/qtls v0.2.3 github.com/marten-seemann/qtls => github.com/marten-seemann/qtls v0.2.3
github.com/mattn/go-colorable => github.com/mattn/go-colorable v0.0.9 github.com/mattn/go-colorable => github.com/mattn/go-colorable v0.0.9
github.com/mattn/go-isatty => github.com/mattn/go-isatty v0.0.3 github.com/mattn/go-isatty => github.com/mattn/go-isatty v0.0.9
github.com/mattn/go-runewidth => github.com/mattn/go-runewidth v0.0.2
github.com/mattn/go-shellwords => github.com/mattn/go-shellwords v1.0.5 github.com/mattn/go-shellwords => github.com/mattn/go-shellwords v1.0.5
github.com/mattn/goveralls => github.com/mattn/goveralls v0.0.2
github.com/matttproud/golang_protobuf_extensions => github.com/matttproud/golang_protobuf_extensions v1.0.1 github.com/matttproud/golang_protobuf_extensions => github.com/matttproud/golang_protobuf_extensions v1.0.1
github.com/mesos/mesos-go => github.com/mesos/mesos-go v0.0.9 github.com/mesos/mesos-go => github.com/mesos/mesos-go v0.0.9
github.com/mholt/certmagic => github.com/mholt/certmagic v0.6.2-0.20190624175158-6a42ef9fe8c2 github.com/mholt/certmagic => github.com/mholt/certmagic v0.6.2-0.20190624175158-6a42ef9fe8c2
github.com/miekg/dns => github.com/miekg/dns v1.1.4 github.com/miekg/dns => github.com/miekg/dns v1.1.4
github.com/mindprince/gonvml => github.com/mindprince/gonvml v0.0.0-20171110221305-fee913ce8fb2 github.com/mindprince/gonvml => github.com/mindprince/gonvml v0.0.0-20190828220739-9ebdce4bb989
github.com/mistifyio/go-zfs => github.com/mistifyio/go-zfs v2.1.1+incompatible github.com/mistifyio/go-zfs => github.com/mistifyio/go-zfs v2.1.1+incompatible
github.com/mitchellh/go-homedir => github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir => github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/go-ps => github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936
github.com/mitchellh/go-wordwrap => github.com/mitchellh/go-wordwrap v1.0.0 github.com/mitchellh/go-wordwrap => github.com/mitchellh/go-wordwrap v1.0.0
github.com/mitchellh/mapstructure => github.com/mitchellh/mapstructure v1.1.2 github.com/mitchellh/mapstructure => github.com/mitchellh/mapstructure v1.1.2
github.com/modern-go/concurrent => github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd github.com/modern-go/concurrent => github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
github.com/modern-go/reflect2 => github.com/modern-go/reflect2 v1.0.1 github.com/modern-go/reflect2 => github.com/modern-go/reflect2 v1.0.1
github.com/mohae/deepcopy => github.com/mohae/deepcopy v0.0.0-20170603005431-491d3605edfb github.com/mohae/deepcopy => github.com/mohae/deepcopy v0.0.0-20170603005431-491d3605edfb
github.com/morikuni/aec => github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c github.com/morikuni/aec => github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c
github.com/mrunalp/fileutils => github.com/mrunalp/fileutils v0.0.0-20160930181131-4ee1cc9a8058 github.com/mozilla/tls-observatory => github.com/mozilla/tls-observatory v0.0.0-20180409132520-8791a200eb40
github.com/munnerz/goautoneg => github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d github.com/mrunalp/fileutils => github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618
github.com/munnerz/goautoneg => github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
github.com/mvdan/xurls => github.com/mvdan/xurls v1.1.0 github.com/mvdan/xurls => github.com/mvdan/xurls v1.1.0
github.com/mwitkow/go-conntrack => github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223
github.com/mxk/go-flowrate => github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f github.com/mxk/go-flowrate => github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f
github.com/naoina/go-stringutil => github.com/naoina/go-stringutil v0.1.0 github.com/naoina/go-stringutil => github.com/naoina/go-stringutil v0.1.0
github.com/naoina/toml => github.com/naoina/toml v0.1.1 github.com/naoina/toml => github.com/naoina/toml v0.1.1
github.com/onsi/ginkgo => github.com/onsi/ginkgo v1.8.0 github.com/nbutton23/zxcvbn-go => github.com/nbutton23/zxcvbn-go v0.0.0-20171102151520-eafdab6b0663
github.com/onsi/gomega => github.com/onsi/gomega v1.5.0 github.com/olekukonko/tablewriter => github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5
github.com/onsi/ginkgo => github.com/onsi/ginkgo v1.10.1
github.com/onsi/gomega => github.com/onsi/gomega v1.7.0
github.com/opencontainers/go-digest => github.com/opencontainers/go-digest v1.0.0-rc1 github.com/opencontainers/go-digest => github.com/opencontainers/go-digest v1.0.0-rc1
github.com/opencontainers/image-spec => github.com/opencontainers/image-spec v1.0.1 github.com/opencontainers/image-spec => github.com/opencontainers/image-spec v1.0.1
github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc2.0.20190611121236-6cc515888830 github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc9
github.com/opencontainers/runtime-spec => github.com/opencontainers/runtime-spec v1.0.0 github.com/opencontainers/runtime-spec => github.com/opencontainers/runtime-spec v1.0.0
github.com/opencontainers/selinux => github.com/opencontainers/selinux v1.2.2 github.com/opencontainers/selinux => github.com/opencontainers/selinux v1.3.1-0.20190929122143-5215b1806f52
github.com/pborman/uuid => github.com/pborman/uuid v1.2.0
github.com/pelletier/go-toml => github.com/pelletier/go-toml v1.2.0 github.com/pelletier/go-toml => github.com/pelletier/go-toml v1.2.0
github.com/peterbourgon/diskv => github.com/peterbourgon/diskv v2.0.1+incompatible github.com/peterbourgon/diskv => github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/pkg/errors => github.com/pkg/errors v0.8.0 github.com/pkg/errors => github.com/pkg/errors v0.8.1
github.com/pmezard/go-difflib => github.com/pmezard/go-difflib v1.0.0 github.com/pmezard/go-difflib => github.com/pmezard/go-difflib v1.0.0
github.com/pquerna/cachecontrol => github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021 github.com/pquerna/cachecontrol => github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021
github.com/pquerna/ffjson => github.com/pquerna/ffjson v0.0.0-20180717144149-af8b230fcd20 github.com/pquerna/ffjson => github.com/pquerna/ffjson v0.0.0-20180717144149-af8b230fcd20
github.com/prometheus/client_golang => github.com/prometheus/client_golang v0.9.2 github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.0.0
github.com/prometheus/client_model => github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 github.com/prometheus/client_model => github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
github.com/prometheus/common => github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 github.com/prometheus/common => github.com/prometheus/common v0.4.1
github.com/prometheus/procfs => github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a github.com/prometheus/procfs => github.com/prometheus/procfs v0.0.2
github.com/quasilyte/go-consistent => github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c
github.com/quobyte/api => github.com/quobyte/api v0.1.2 github.com/quobyte/api => github.com/quobyte/api v0.1.2
github.com/remyoudompheng/bigfft => github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446 github.com/remyoudompheng/bigfft => github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446
github.com/robfig/cron => github.com/robfig/cron v1.1.0 github.com/robfig/cron => github.com/robfig/cron v1.1.0
github.com/rogpeppe/fastuuid => github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af
github.com/rogpeppe/go-internal => github.com/rogpeppe/go-internal v1.3.0 github.com/rogpeppe/go-internal => github.com/rogpeppe/go-internal v1.3.0
github.com/rubiojr/go-vhd => github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c github.com/rubiojr/go-vhd => github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c
github.com/russross/blackfriday => github.com/russross/blackfriday v1.5.2 github.com/russross/blackfriday => github.com/russross/blackfriday v1.5.2
github.com/ryanuber/go-glob => github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735
github.com/satori/go.uuid => github.com/satori/go.uuid v1.2.0 github.com/satori/go.uuid => github.com/satori/go.uuid v1.2.0
github.com/seccomp/libseccomp-golang => github.com/seccomp/libseccomp-golang v0.9.1 github.com/seccomp/libseccomp-golang => github.com/seccomp/libseccomp-golang v0.9.1
github.com/sergi/go-diff => github.com/sergi/go-diff v1.0.0
github.com/shirou/gopsutil => github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7
github.com/shirou/w32 => github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4
github.com/shurcooL/go => github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e
github.com/shurcooL/go-goon => github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041
github.com/sirupsen/logrus => github.com/sirupsen/logrus v1.4.2 github.com/sirupsen/logrus => github.com/sirupsen/logrus v1.4.2
github.com/smartystreets/assertions => github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d github.com/smartystreets/assertions => github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d
github.com/smartystreets/goconvey => github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a github.com/smartystreets/goconvey => github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a
github.com/soheilhy/cmux => github.com/soheilhy/cmux v0.1.3 github.com/soheilhy/cmux => github.com/soheilhy/cmux v0.1.4
github.com/sourcegraph/go-diff => github.com/sourcegraph/go-diff v0.5.1
github.com/spf13/afero => github.com/spf13/afero v1.2.2 github.com/spf13/afero => github.com/spf13/afero v1.2.2
github.com/spf13/cast => github.com/spf13/cast v1.3.0 github.com/spf13/cast => github.com/spf13/cast v1.3.0
github.com/spf13/cobra => github.com/spf13/cobra v0.0.5 github.com/spf13/cobra => github.com/spf13/cobra v0.0.5
github.com/spf13/jwalterweatherman => github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/jwalterweatherman => github.com/spf13/jwalterweatherman v1.1.0
github.com/spf13/pflag => github.com/spf13/pflag v1.0.3 github.com/spf13/pflag => github.com/spf13/pflag v1.0.5
github.com/spf13/viper => github.com/spf13/viper v1.3.2 github.com/spf13/viper => github.com/spf13/viper v1.3.2
github.com/storageos/go-api => github.com/storageos/go-api v0.0.0-20180912212459-343b3eff91fc github.com/storageos/go-api => github.com/storageos/go-api v0.0.0-20180912212459-343b3eff91fc
github.com/stretchr/objx => github.com/stretchr/objx v0.2.0 github.com/stretchr/objx => github.com/stretchr/objx v0.2.0
github.com/stretchr/testify => github.com/stretchr/testify v1.3.0 github.com/stretchr/testify => github.com/stretchr/testify v1.4.0
github.com/syndtr/gocapability => github.com/syndtr/gocapability v0.0.0-20160928074757-e7cb7fa329f4 github.com/syndtr/gocapability => github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2
github.com/tarm/serial => github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07
github.com/thecodeteam/goscaleio => github.com/thecodeteam/goscaleio v0.1.0 github.com/thecodeteam/goscaleio => github.com/thecodeteam/goscaleio v0.1.0
github.com/tidwall/pretty => github.com/tidwall/pretty v1.0.0
github.com/timakin/bodyclose => github.com/timakin/bodyclose v0.0.0-20190721030226-87058b9bfcec
github.com/tmc/grpc-websocket-proxy => github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8 github.com/tmc/grpc-websocket-proxy => github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8
github.com/ugorji/go/codec => github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 github.com/ugorji/go/codec => github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8
github.com/ultraware/funlen => github.com/ultraware/funlen v0.0.2
github.com/urfave/cli => github.com/urfave/cli v1.20.0
github.com/urfave/negroni => github.com/urfave/negroni v1.0.0 github.com/urfave/negroni => github.com/urfave/negroni v1.0.0
github.com/vishvananda/netlink => github.com/vishvananda/netlink v0.0.0-20171020171820-b2de5d10e38e github.com/valyala/bytebufferpool => github.com/valyala/bytebufferpool v1.0.0
github.com/valyala/fasthttp => github.com/valyala/fasthttp v1.2.0
github.com/valyala/quicktemplate => github.com/valyala/quicktemplate v1.1.1
github.com/valyala/tcplisten => github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a
github.com/vektah/gqlparser => github.com/vektah/gqlparser v1.1.2
github.com/vishvananda/netlink => github.com/vishvananda/netlink v1.0.0
github.com/vishvananda/netns => github.com/vishvananda/netns v0.0.0-20171111001504-be1fbeda1936 github.com/vishvananda/netns => github.com/vishvananda/netns v0.0.0-20171111001504-be1fbeda1936
github.com/vmware/govmomi => github.com/vmware/govmomi v0.20.1 github.com/vmware/govmomi => github.com/vmware/govmomi v0.20.3
github.com/xiang90/probing => github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18 github.com/xiang90/probing => github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2
github.com/xlab/handysort => github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1 github.com/xlab/handysort => github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1
github.com/xordataexchange/crypt => github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 github.com/xordataexchange/crypt => github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77
go.etcd.io/bbolt => go.etcd.io/bbolt v1.3.3
go.etcd.io/etcd => go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738
go.mongodb.org/mongo-driver => go.mongodb.org/mongo-driver v1.1.2
go.opencensus.io => go.opencensus.io v0.21.0 go.opencensus.io => go.opencensus.io v0.21.0
go.uber.org/atomic => go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569 go.uber.org/atomic => go.uber.org/atomic v1.3.2
go.uber.org/multierr => go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df go.uber.org/multierr => go.uber.org/multierr v1.1.0
go.uber.org/zap => go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15 go.uber.org/zap => go.uber.org/zap v1.10.0
golang.org/x/crypto => golang.org/x/crypto v0.0.0-20181025213731-e84da0312774 go4.org => go4.org v0.0.0-20180809161055-417644f6feb5
golang.org/x/build => golang.org/x/build v0.0.0-20190927031335-2835ba2e683f
golang.org/x/crypto => golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
golang.org/x/exp => golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495 golang.org/x/exp => golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495
golang.org/x/image => golang.org/x/image v0.0.0-20190227222117-0694c2d4d067 golang.org/x/image => golang.org/x/image v0.0.0-20190227222117-0694c2d4d067
golang.org/x/lint => golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1 golang.org/x/lint => golang.org/x/lint v0.0.0-20190409202823-959b441ac422
golang.org/x/mobile => golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6 golang.org/x/mobile => golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6
golang.org/x/mod => golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e golang.org/x/mod => golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e
golang.org/x/net => golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc golang.org/x/net => golang.org/x/net v0.0.0-20191004110552-13f9640d40b9
golang.org/x/oauth2 => golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a golang.org/x/oauth2 => golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sync => golang.org/x/sync v0.0.0-20181108010431-42b317875d0f golang.org/x/perf => golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852
golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503 golang.org/x/sync => golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
golang.org/x/text => golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13
golang.org/x/time => golang.org/x/time v0.0.0-20161028155119-f51c12702a4d golang.org/x/text => golang.org/x/text v0.3.2
golang.org/x/tools => golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac golang.org/x/time => golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13
golang.org/x/xerrors => golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
gonum.org/v1/gonum => gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 gonum.org/v1/gonum => gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485
gonum.org/v1/netlib => gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e gonum.org/v1/netlib => gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e
google.golang.org/api => google.golang.org/api v0.6.1-0.20190607001116-5213b8090861 google.golang.org/api => google.golang.org/api v0.6.1-0.20190607001116-5213b8090861
google.golang.org/appengine => google.golang.org/appengine v1.5.0 google.golang.org/appengine => google.golang.org/appengine v1.5.0
google.golang.org/genproto => google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 google.golang.org/genproto => google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873
google.golang.org/grpc => google.golang.org/grpc v1.23.0 google.golang.org/grpc => google.golang.org/grpc v1.23.1
gopkg.in/airbrake/gobrake.v2 => gopkg.in/airbrake/gobrake.v2 v2.0.9 gopkg.in/airbrake/gobrake.v2 => gopkg.in/airbrake/gobrake.v2 v2.0.9
gopkg.in/alecthomas/kingpin.v2 => gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/check.v1 => gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 gopkg.in/check.v1 => gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
gopkg.in/cheggaaa/pb.v1 => gopkg.in/cheggaaa/pb.v1 v1.0.25
gopkg.in/errgo.v2 => gopkg.in/errgo.v2 v2.1.0 gopkg.in/errgo.v2 => gopkg.in/errgo.v2 v2.1.0
gopkg.in/fsnotify.v1 => gopkg.in/fsnotify.v1 v1.4.7 gopkg.in/fsnotify.v1 => gopkg.in/fsnotify.v1 v1.4.7
gopkg.in/gcfg.v1 => gopkg.in/gcfg.v1 v1.2.0 gopkg.in/gcfg.v1 => gopkg.in/gcfg.v1 v1.2.0
gopkg.in/gemnasium/logrus-airbrake-hook.v2 => gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 gopkg.in/gemnasium/logrus-airbrake-hook.v2 => gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2
gopkg.in/inf.v0 => gopkg.in/inf.v0 v0.9.0 gopkg.in/inf.v0 => gopkg.in/inf.v0 v0.9.1
gopkg.in/mcuadros/go-syslog.v2 => gopkg.in/mcuadros/go-syslog.v2 v2.2.1 gopkg.in/mcuadros/go-syslog.v2 => gopkg.in/mcuadros/go-syslog.v2 v2.2.1
gopkg.in/natefinch/lumberjack.v2 => gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/natefinch/lumberjack.v2 => gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/resty.v1 => gopkg.in/resty.v1 v1.12.0
gopkg.in/square/go-jose.v2 => gopkg.in/square/go-jose.v2 v2.2.2 gopkg.in/square/go-jose.v2 => gopkg.in/square/go-jose.v2 v2.2.2
gopkg.in/tomb.v1 => gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 gopkg.in/tomb.v1 => gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
gopkg.in/warnings.v0 => gopkg.in/warnings.v0 v0.1.1 gopkg.in/warnings.v0 => gopkg.in/warnings.v0 v0.1.1
gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.2.2 gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.2.4
gotest.tools => gotest.tools v2.2.0+incompatible gotest.tools => gotest.tools v2.2.0+incompatible
gotest.tools/gotestsum => gotest.tools/gotestsum v0.3.5 gotest.tools/gotestsum => gotest.tools/gotestsum v0.3.5
grpc.go4.org => grpc.go4.org v0.0.0-20170609214715-11d0a25b4919
honnef.co/go/tools => honnef.co/go/tools v0.0.1-2019.2.2 honnef.co/go/tools => honnef.co/go/tools v0.0.1-2019.2.2
k8s.io/api => ./staging/src/k8s.io/api k8s.io/api => ./staging/src/k8s.io/api
k8s.io/apiextensions-apiserver => ./staging/src/k8s.io/apiextensions-apiserver k8s.io/apiextensions-apiserver => ./staging/src/k8s.io/apiextensions-apiserver
@ -462,10 +537,10 @@ replace (
k8s.io/csi-translation-lib => ./staging/src/k8s.io/csi-translation-lib k8s.io/csi-translation-lib => ./staging/src/k8s.io/csi-translation-lib
k8s.io/gengo => k8s.io/gengo v0.0.0-20190822140433-26a664648505 k8s.io/gengo => k8s.io/gengo v0.0.0-20190822140433-26a664648505
k8s.io/heapster => k8s.io/heapster v1.2.0-beta.1 k8s.io/heapster => k8s.io/heapster v1.2.0-beta.1
k8s.io/klog => k8s.io/klog v0.4.0 k8s.io/klog => k8s.io/klog v1.0.0
k8s.io/kube-aggregator => ./staging/src/k8s.io/kube-aggregator k8s.io/kube-aggregator => ./staging/src/k8s.io/kube-aggregator
k8s.io/kube-controller-manager => ./staging/src/k8s.io/kube-controller-manager k8s.io/kube-controller-manager => ./staging/src/k8s.io/kube-controller-manager
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
k8s.io/kube-proxy => ./staging/src/k8s.io/kube-proxy k8s.io/kube-proxy => ./staging/src/k8s.io/kube-proxy
k8s.io/kube-scheduler => ./staging/src/k8s.io/kube-scheduler k8s.io/kube-scheduler => ./staging/src/k8s.io/kube-scheduler
k8s.io/kubectl => ./staging/src/k8s.io/kubectl k8s.io/kubectl => ./staging/src/k8s.io/kubectl
@ -473,18 +548,23 @@ replace (
k8s.io/legacy-cloud-providers => ./staging/src/k8s.io/legacy-cloud-providers k8s.io/legacy-cloud-providers => ./staging/src/k8s.io/legacy-cloud-providers
k8s.io/metrics => ./staging/src/k8s.io/metrics k8s.io/metrics => ./staging/src/k8s.io/metrics
k8s.io/node-api => ./staging/src/k8s.io/node-api k8s.io/node-api => ./staging/src/k8s.io/node-api
k8s.io/repo-infra => k8s.io/repo-infra v0.0.0-20181204233714-00fe14e3d1a3 k8s.io/repo-infra => k8s.io/repo-infra v0.0.1-alpha.1
k8s.io/sample-apiserver => ./staging/src/k8s.io/sample-apiserver k8s.io/sample-apiserver => ./staging/src/k8s.io/sample-apiserver
k8s.io/sample-cli-plugin => ./staging/src/k8s.io/sample-cli-plugin k8s.io/sample-cli-plugin => ./staging/src/k8s.io/sample-cli-plugin
k8s.io/sample-controller => ./staging/src/k8s.io/sample-controller k8s.io/sample-controller => ./staging/src/k8s.io/sample-controller
k8s.io/utils => k8s.io/utils v0.0.0-20190801114015-581e00157fb1 k8s.io/system-validators => k8s.io/system-validators v1.0.4
k8s.io/utils => k8s.io/utils v0.0.0-20191114184206-e782cd3c129f
modernc.org/cc => modernc.org/cc v1.0.0 modernc.org/cc => modernc.org/cc v1.0.0
modernc.org/golex => modernc.org/golex v1.0.0 modernc.org/golex => modernc.org/golex v1.0.0
modernc.org/mathutil => modernc.org/mathutil v1.0.0 modernc.org/mathutil => modernc.org/mathutil v1.0.0
modernc.org/strutil => modernc.org/strutil v1.0.0 modernc.org/strutil => modernc.org/strutil v1.0.0
modernc.org/xc => modernc.org/xc v1.0.0 modernc.org/xc => modernc.org/xc v1.0.0
mvdan.cc/interfacer => mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed
mvdan.cc/lint => mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b
mvdan.cc/unparam => mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34
sigs.k8s.io/kustomize => sigs.k8s.io/kustomize v2.0.3+incompatible sigs.k8s.io/kustomize => sigs.k8s.io/kustomize v2.0.3+incompatible
sigs.k8s.io/structured-merge-diff => sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca sigs.k8s.io/structured-merge-diff => sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06
sigs.k8s.io/yaml => sigs.k8s.io/yaml v1.1.0 sigs.k8s.io/yaml => sigs.k8s.io/yaml v1.1.0
sourcegraph.com/sqs/pbtypes => sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4
vbom.ml/util => vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc vbom.ml/util => vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc
) )

View File

@ -26,7 +26,7 @@ const (
// PodPresetOptOutAnnotationKey represents the annotation key for a pod to exempt itself from pod preset manipulation // PodPresetOptOutAnnotationKey represents the annotation key for a pod to exempt itself from pod preset manipulation
PodPresetOptOutAnnotationKey string = "podpreset.admission.kubernetes.io/exclude" PodPresetOptOutAnnotationKey string = "podpreset.admission.kubernetes.io/exclude"
// MirrorAnnotationKey represents the annotation key set by kubelets when creating mirror pods // MirrorPodAnnotationKey represents the annotation key set by kubelets when creating mirror pods
MirrorPodAnnotationKey string = "kubernetes.io/config.mirror" MirrorPodAnnotationKey string = "kubernetes.io/config.mirror"
// TolerationsAnnotationKey represents the key of tolerations data (json serialized) // TolerationsAnnotationKey represents the key of tolerations data (json serialized)
@ -56,7 +56,7 @@ const (
// in the Annotations of a Node. // in the Annotations of a Node.
PreferAvoidPodsAnnotationKey string = "scheduler.alpha.kubernetes.io/preferAvoidPods" PreferAvoidPodsAnnotationKey string = "scheduler.alpha.kubernetes.io/preferAvoidPods"
// ObjectTTLAnnotations represents a suggestion for kubelet for how long it can cache // ObjectTTLAnnotationKey represents a suggestion for kubelet for how long it can cache
// an object (e.g. secret, config map) before fetching it again from apiserver. // an object (e.g. secret, config map) before fetching it again from apiserver.
// This annotation can be attached to node. // This annotation can be attached to node.
ObjectTTLAnnotationKey string = "node.alpha.kubernetes.io/ttl" ObjectTTLAnnotationKey string = "node.alpha.kubernetes.io/ttl"
@ -65,7 +65,7 @@ const (
// the kubelet prior to running // the kubelet prior to running
BootstrapCheckpointAnnotationKey string = "node.kubernetes.io/bootstrap-checkpoint" BootstrapCheckpointAnnotationKey string = "node.kubernetes.io/bootstrap-checkpoint"
// annotation key prefix used to identify non-convertible json paths. // NonConvertibleAnnotationPrefix annotation key prefix used to identify non-convertible json paths.
NonConvertibleAnnotationPrefix = "non-convertible.kubernetes.io" NonConvertibleAnnotationPrefix = "non-convertible.kubernetes.io"
kubectlPrefix = "kubectl.kubernetes.io/" kubectlPrefix = "kubectl.kubernetes.io/"

View File

@ -16,7 +16,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package // +k8s:deepcopy-gen=package
// Package api contains the latest (or "internal") version of the // Package core contains the latest (or "internal") version of the
// Kubernetes API objects. This is the API objects as represented in memory. // Kubernetes API objects. This is the API objects as represented in memory.
// The contract presented to clients is located in the versioned packages, // The contract presented to clients is located in the versioned packages,
// which are sub-directories. The first one is "v1". Those packages // which are sub-directories. The first one is "v1". Those packages

View File

@ -24,5 +24,8 @@ import "encoding/json"
var _ = json.Marshaler(&AvoidPods{}) var _ = json.Marshaler(&AvoidPods{})
var _ = json.Unmarshaler(&AvoidPods{}) var _ = json.Unmarshaler(&AvoidPods{})
// MarshalJSON panics to prevent marshalling of internal structs
func (AvoidPods) MarshalJSON() ([]byte, error) { panic("do not marshal internal struct") } func (AvoidPods) MarshalJSON() ([]byte, error) { panic("do not marshal internal struct") }
func (*AvoidPods) UnmarshalJSON([]byte) error { panic("do not unmarshal to internal struct") }
// UnmarshalJSON panics to prevent unmarshalling of internal structs
func (*AvoidPods) UnmarshalJSON([]byte) error { panic("do not unmarshal to internal struct") }

View File

@ -23,12 +23,15 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
) )
// SetGroupVersionKind sets the API version and kind of the object reference
func (obj *ObjectReference) SetGroupVersionKind(gvk schema.GroupVersionKind) { func (obj *ObjectReference) SetGroupVersionKind(gvk schema.GroupVersionKind) {
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind() obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
} }
// GroupVersionKind returns the API version and kind of the object reference
func (obj *ObjectReference) GroupVersionKind() schema.GroupVersionKind { func (obj *ObjectReference) GroupVersionKind() schema.GroupVersionKind {
return schema.FromAPIVersionAndKind(obj.APIVersion, obj.Kind) return schema.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
} }
// GetObjectKind returns the kind of object reference
func (obj *ObjectReference) GetObjectKind() schema.ObjectKind { return obj } func (obj *ObjectReference) GetObjectKind() schema.ObjectKind { return obj }

View File

@ -39,8 +39,12 @@ func Resource(resource string) schema.GroupResource {
} }
var ( var (
// SchemeBuilder object to register various known types
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
// AddToScheme represents a func that can be used to apply all the registered
// funcs in a scheme
AddToScheme = SchemeBuilder.AddToScheme
) )
func addKnownTypes(scheme *runtime.Scheme) error { func addKnownTypes(scheme *runtime.Scheme) error {

View File

@ -20,35 +20,37 @@ import (
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
) )
func (self ResourceName) String() string { func (rn ResourceName) String() string {
return string(self) return string(rn)
} }
// Returns the CPU limit if specified. // CPU returns the CPU limit if specified.
func (self *ResourceList) Cpu() *resource.Quantity { func (rl *ResourceList) CPU() *resource.Quantity {
if val, ok := (*self)[ResourceCPU]; ok { if val, ok := (*rl)[ResourceCPU]; ok {
return &val return &val
} }
return &resource.Quantity{Format: resource.DecimalSI} return &resource.Quantity{Format: resource.DecimalSI}
} }
// Returns the Memory limit if specified. // Memory returns the Memory limit if specified.
func (self *ResourceList) Memory() *resource.Quantity { func (rl *ResourceList) Memory() *resource.Quantity {
if val, ok := (*self)[ResourceMemory]; ok { if val, ok := (*rl)[ResourceMemory]; ok {
return &val return &val
} }
return &resource.Quantity{Format: resource.BinarySI} return &resource.Quantity{Format: resource.BinarySI}
} }
func (self *ResourceList) Pods() *resource.Quantity { // Pods returns the list of pods
if val, ok := (*self)[ResourcePods]; ok { func (rl *ResourceList) Pods() *resource.Quantity {
if val, ok := (*rl)[ResourcePods]; ok {
return &val return &val
} }
return &resource.Quantity{} return &resource.Quantity{}
} }
func (self *ResourceList) StorageEphemeral() *resource.Quantity { // StorageEphemeral returns the list of ephemeral storage volumes, if any
if val, ok := (*self)[ResourceEphemeralStorage]; ok { func (rl *ResourceList) StorageEphemeral() *resource.Quantity {
if val, ok := (*rl)[ResourceEphemeralStorage]; ok {
return &val return &val
} }
return &resource.Quantity{} return &resource.Quantity{}

View File

@ -27,7 +27,7 @@ func (t *Taint) MatchTaint(taintToMatch Taint) bool {
return t.Key == taintToMatch.Key && t.Effect == taintToMatch.Effect return t.Key == taintToMatch.Key && t.Effect == taintToMatch.Effect
} }
// taint.ToString() converts taint struct to string in format '<key>=<value>:<effect>', '<key>=<value>:', '<key>:<effect>', or '<key>'. // ToString converts taint struct to string in format '<key>=<value>:<effect>', '<key>=<value>:', '<key>:<effect>', or '<key>'.
func (t *Taint) ToString() string { func (t *Taint) ToString() string {
if len(t.Effect) == 0 { if len(t.Effect) == 0 {
if len(t.Value) == 0 { if len(t.Value) == 0 {

File diff suppressed because it is too large Load Diff

View File

@ -5171,6 +5171,11 @@ func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec) {
*out = new(IPFamily) *out = new(IPFamily)
**out = **in **out = **in
} }
if in.TopologyKeys != nil {
in, out := &in.TopologyKeys, &out.TopologyKeys
*out = make([]string, len(*in))
copy(*out, *in)
}
return return
} }

4
vendor/k8s.io/utils/README.md generated vendored
View File

@ -46,12 +46,12 @@ an existing package to this repository.
- [Clock](/clock) provides an interface for time-based operations. It allows - [Clock](/clock) provides an interface for time-based operations. It allows
mocking time for testing. mocking time for testing.
- [Pointers](/pointers) provides some functions for pointer-based operations. - [Pointer](/pointer) provides some functions for pointer-based operations.
- [Io](/io) provides interfaces for working with file IO. Currently it provides - [Io](/io) provides interfaces for working with file IO. Currently it provides
functionality for consistently reading a file. functionality for consistently reading a file.
- [NSEnter](/nsenter) provies interfaces for executing and interacting with - [NSEnter](/nsenter) provides interfaces for executing and interacting with
processes running within a namespace. processes running within a namespace.
[Build Status]: https://travis-ci.org/kubernetes/utils.svg?branch=master [Build Status]: https://travis-ci.org/kubernetes/utils.svg?branch=master

10
vendor/k8s.io/utils/go.mod generated vendored Normal file
View File

@ -0,0 +1,10 @@
module k8s.io/utils
go 1.12
require (
github.com/davecgh/go-spew v1.1.1
github.com/spf13/afero v1.2.2
github.com/stretchr/testify v1.3.0
k8s.io/klog v0.3.0
)