Update code for latest k8s
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
8f5e37a83c
commit
5f7ac28059
792 changed files with 25023 additions and 19841 deletions
2
vendor/k8s.io/apimachinery/pkg/util/errors/errors.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/util/errors/errors.go
generated
vendored
|
@ -21,7 +21,7 @@ import (
|
|||
"fmt"
|
||||
)
|
||||
|
||||
// MessageCountMap contains occurance for each error message.
|
||||
// MessageCountMap contains occurrence for each error message.
|
||||
type MessageCountMap map[string]int
|
||||
|
||||
// Aggregate represents an object that contains multiple errors, but does not
|
||||
|
|
2
vendor/k8s.io/apimachinery/pkg/util/intstr/generated.pb.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/util/intstr/generated.pb.go
generated
vendored
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
2
vendor/k8s.io/apimachinery/pkg/util/intstr/generated.proto
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/util/intstr/generated.proto
generated
vendored
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2017 The Kubernetes Authors.
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
22
vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go
generated
vendored
22
vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go
generated
vendored
|
@ -24,9 +24,6 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
openapi "k8s.io/kube-openapi/pkg/common"
|
||||
|
||||
"github.com/go-openapi/spec"
|
||||
"github.com/golang/glog"
|
||||
"github.com/google/gofuzz"
|
||||
)
|
||||
|
@ -120,16 +117,15 @@ func (intstr IntOrString) MarshalJSON() ([]byte, error) {
|
|||
}
|
||||
}
|
||||
|
||||
func (_ IntOrString) OpenAPIDefinition() openapi.OpenAPIDefinition {
|
||||
return openapi.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"string"},
|
||||
Format: "int-or-string",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
// OpenAPISchemaType is used by the kube-openapi generator when constructing
|
||||
// the OpenAPI spec of this type.
|
||||
//
|
||||
// See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators
|
||||
func (_ IntOrString) OpenAPISchemaType() []string { return []string{"string"} }
|
||||
|
||||
// OpenAPISchemaFormat is used by the kube-openapi generator when constructing
|
||||
// the OpenAPI spec of this type.
|
||||
func (_ IntOrString) OpenAPISchemaFormat() string { return "int-or-string" }
|
||||
|
||||
func (intstr *IntOrString) Fuzz(c fuzz.Continue) {
|
||||
if intstr == nil {
|
||||
|
|
14
vendor/k8s.io/apimachinery/pkg/util/net/util.go
generated
vendored
14
vendor/k8s.io/apimachinery/pkg/util/net/util.go
generated
vendored
|
@ -18,6 +18,8 @@ package net
|
|||
|
||||
import (
|
||||
"net"
|
||||
"net/url"
|
||||
"os"
|
||||
"reflect"
|
||||
"syscall"
|
||||
)
|
||||
|
@ -38,8 +40,16 @@ func IPNetEqual(ipnet1, ipnet2 *net.IPNet) bool {
|
|||
|
||||
// Returns if the given err is "connection reset by peer" error.
|
||||
func IsConnectionReset(err error) bool {
|
||||
opErr, ok := err.(*net.OpError)
|
||||
if ok && opErr.Err.Error() == syscall.ECONNRESET.Error() {
|
||||
if urlErr, ok := err.(*url.Error); ok {
|
||||
err = urlErr.Err
|
||||
}
|
||||
if opErr, ok := err.(*net.OpError); ok {
|
||||
err = opErr.Err
|
||||
}
|
||||
if osErr, ok := err.(*os.SyscallError); ok {
|
||||
err = osErr.Err
|
||||
}
|
||||
if errno, ok := err.(syscall.Errno); ok && errno == syscall.ECONNRESET {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
2
vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go
generated
vendored
|
@ -43,7 +43,7 @@ var PanicHandlers = []func(interface{}){logPanic}
|
|||
// TODO: remove this function. We are switching to a world where it's safe for
|
||||
// apiserver to panic, since it will be restarted by kubelet. At the beginning
|
||||
// of the Kubernetes project, nothing was going to restart apiserver and so
|
||||
// catching panics was important. But it's actually much simpler for montoring
|
||||
// catching panics was important. But it's actually much simpler for monitoring
|
||||
// software if we just exit when an unexpected panic happens.
|
||||
func HandleCrash(additionalHandlers ...func(interface{})) {
|
||||
if r := recover(); r != nil {
|
||||
|
|
28
vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go
generated
vendored
28
vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go
generated
vendored
|
@ -423,7 +423,7 @@ func normalizeElementOrder(patch, serverOnly, patchOrder, serverOrder []interfac
|
|||
// scan from the place of last insertion in `right` to the end of `right`,
|
||||
// the place is before the first item that is greater than the item we want to insert.
|
||||
// example usage: using server-only items as left and patch items as right. We insert server-only items
|
||||
// to patch list. We use the order of live object as record for comparision.
|
||||
// to patch list. We use the order of live object as record for comparison.
|
||||
func mergeSortedSlice(left, right, serverOrder []interface{}, mergeKey string, kind reflect.Kind) []interface{} {
|
||||
// Returns if l is less than r, and if both have been found.
|
||||
// If l and r both present and l is in front of r, l is less than r.
|
||||
|
@ -1322,23 +1322,23 @@ func mergeMap(original, patch map[string]interface{}, schema LookupPatchMeta, me
|
|||
// If they're both maps or lists, recurse into the value.
|
||||
switch originalType.Kind() {
|
||||
case reflect.Map:
|
||||
subschema, patchMeta, err := schema.LookupPatchMetadataForStruct(k)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
subschema, patchMeta, err2 := schema.LookupPatchMetadataForStruct(k)
|
||||
if err2 != nil {
|
||||
return nil, err2
|
||||
}
|
||||
_, patchStrategy, err := extractRetainKeysPatchStrategy(patchMeta.GetPatchStrategies())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
_, patchStrategy, err2 := extractRetainKeysPatchStrategy(patchMeta.GetPatchStrategies())
|
||||
if err2 != nil {
|
||||
return nil, err2
|
||||
}
|
||||
original[k], err = mergeMapHandler(original[k], patchV, subschema, patchStrategy, mergeOptions)
|
||||
case reflect.Slice:
|
||||
subschema, patchMeta, err := schema.LookupPatchMetadataForSlice(k)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
subschema, patchMeta, err2 := schema.LookupPatchMetadataForSlice(k)
|
||||
if err2 != nil {
|
||||
return nil, err2
|
||||
}
|
||||
_, patchStrategy, err := extractRetainKeysPatchStrategy(patchMeta.GetPatchStrategies())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
_, patchStrategy, err2 := extractRetainKeysPatchStrategy(patchMeta.GetPatchStrategies())
|
||||
if err2 != nil {
|
||||
return nil, err2
|
||||
}
|
||||
original[k], err = mergeSliceHandler(original[k], patchV, subschema, patchStrategy, patchMeta.GetPatchMergeKey(), isDeleteList, mergeOptions)
|
||||
default:
|
||||
|
@ -2109,7 +2109,7 @@ func sliceTypeAssertion(original, patch interface{}) ([]interface{}, []interface
|
|||
}
|
||||
|
||||
// extractRetainKeysPatchStrategy process patch strategy, which is a string may contains multiple
|
||||
// patch strategies seperated by ",". It returns a boolean var indicating if it has
|
||||
// patch strategies separated by ",". It returns a boolean var indicating if it has
|
||||
// retainKeys strategies and a string for the other strategy.
|
||||
func extractRetainKeysPatchStrategy(strategies []string) (bool, string, error) {
|
||||
switch len(strategies) {
|
||||
|
|
6
vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go
generated
vendored
6
vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go
generated
vendored
|
@ -122,12 +122,12 @@ func (d *YAMLDecoder) Read(data []byte) (n int, err error) {
|
|||
if left <= len(data) {
|
||||
copy(data, d.remaining)
|
||||
d.remaining = nil
|
||||
return len(d.remaining), nil
|
||||
return left, nil
|
||||
}
|
||||
|
||||
// caller will need to reread
|
||||
copy(data, d.remaining[:left])
|
||||
d.remaining = d.remaining[left:]
|
||||
copy(data, d.remaining[:len(data)])
|
||||
d.remaining = d.remaining[len(data):]
|
||||
return len(data), io.ErrShortBuffer
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue