From 40a4456243138b300e0d0ec55fa5a9f00331d345 Mon Sep 17 00:00:00 2001 From: "Mr. Vendor" Date: Mon, 24 Dec 2018 15:02:11 +0100 Subject: [PATCH] Update vendor directory Update dependency files in `vendor` directory. --- Gopkg.lock | 20 +++---- .../appengine/internal/api.go | 5 +- .../appengine/internal/identity.go | 12 +++-- .../appengine/internal/main.go | 1 + .../appengine/internal/main_common.go | 7 +++ .../appengine/internal/main_vm.go | 21 ++++++++ .../pkg/apis/core/validation/validation.go | 52 +++---------------- .../volume/persistentvolume/pv_controller.go | 4 +- .../algorithm/predicates/predicates.go | 14 ++--- 9 files changed, 72 insertions(+), 64 deletions(-) create mode 100644 vendor/google.golang.org/appengine/internal/main_common.go diff --git a/Gopkg.lock b/Gopkg.lock index c888ec182..7065b8b22 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -806,7 +806,7 @@ revision = "f51c12702a4d776e4c1fa9b0fabab841babae631" [[projects]] - digest = "1:655acbef8faad33db29b6a35655341fb4a594e87e56635f05a3e70ed0bd7bd95" + digest = "1:34c10243da5972105edd1b4b883e2bd918fbb3f73fbe14d6af6929e547173494" name = "google.golang.org/appengine" packages = [ "internal", @@ -818,8 +818,8 @@ "urlfetch", ] pruneopts = "NUT" - revision = "4a4468ece617fc8205e99368fa2200e9d1fad421" - version = "v1.3.0" + revision = "e9657d882bb81064595ca3b56cbe2546bbabf7b1" + version = "v1.4.0" [[projects]] digest = "1:93180612a69db36a06d801302b867d53a50a8a5f0943b34db66adc0574ea57df" @@ -1067,7 +1067,7 @@ "third_party/forked/golang/reflect", ] pruneopts = "NUT" - revision = "110b8e1801665ddf67cf9c5187b1975de2c62f7f" + revision = "688d824527473e1e3f6c3f0b01171308393bdfe3" [[projects]] branch = "release-1.10" @@ -1084,7 +1084,7 @@ "pkg/util/flag", ] pruneopts = "NUT" - revision = "b0bd5c8b39384f2f85a7b9eb6ae14222c276b555" + revision = "56f0d9f8f1c3d4e170132aeb935134b9da006c79" [[projects]] branch = "release-7.0" @@ -1259,7 +1259,7 @@ "util/workqueue", ] pruneopts = "NUT" - revision = "745ca830039794f7b927b8a2c2a58dcc1e8a0a72" + revision = "16a8a034ed284c656d27f043a57624e4873b7ad3" [[projects]] branch = "release-2.10" @@ -1295,7 +1295,7 @@ revision = "39cb288412c48cb533ba4be5d6c28620b9a0c1b4" [[projects]] - digest = "1:c73bedc5f3feb2435fb026cf3ad18b69bb31d61dc443ecb1bea319ccf286de56" + digest = "1:d532afc6587e5cab989817836523c340ec8b7312c3b8c4124320bae21f8035f1" name = "k8s.io/kubernetes" packages = [ "pkg/api/events", @@ -1462,8 +1462,8 @@ "pkg/volume/util/types", ] pruneopts = "NUT" - revision = "637c7e288581ee40ab4ca210618a89a555b6e7e9" - version = "v1.10.11" + revision = "c757b93cf034d49af3a3b8ecee3b9639a7a11df7" + version = "v1.10.12" [[projects]] digest = "1:5271b4ee2724d8c2ad7df650a5f9db46d01ce558769469713feba0e3e6079292" @@ -1504,6 +1504,8 @@ "k8s.io/apimachinery/pkg/api/resource", "k8s.io/apimachinery/pkg/apis/meta/v1", "k8s.io/apimachinery/pkg/runtime", + "k8s.io/apimachinery/pkg/runtime/schema", + "k8s.io/apimachinery/pkg/util/intstr", "k8s.io/apimachinery/pkg/watch", "k8s.io/client-go/kubernetes", "k8s.io/client-go/kubernetes/fake", diff --git a/vendor/google.golang.org/appengine/internal/api.go b/vendor/google.golang.org/appengine/internal/api.go index c95149525..bbc1cb9c3 100644 --- a/vendor/google.golang.org/appengine/internal/api.go +++ b/vendor/google.golang.org/appengine/internal/api.go @@ -579,7 +579,10 @@ func logf(c *context, level int64, format string, args ...interface{}) { Level: &level, Message: &s, }) - log.Print(logLevelName[level] + ": " + s) + // Only duplicate log to stderr if not running on App Engine second generation + if !IsSecondGen() { + log.Print(logLevelName[level] + ": " + s) + } } // flushLog attempts to flush any pending logs to the appserver. diff --git a/vendor/google.golang.org/appengine/internal/identity.go b/vendor/google.golang.org/appengine/internal/identity.go index 6d89d6372..9b4134e42 100644 --- a/vendor/google.golang.org/appengine/internal/identity.go +++ b/vendor/google.golang.org/appengine/internal/identity.go @@ -31,9 +31,15 @@ func AppID(c netcontext.Context) string { // ../appengine.go. See that file for commentary. func IsStandard() bool { // appengineStandard will be true for first-gen runtimes (<= Go 1.9) but not - // second-gen (>= Go 1.11). Second-gen runtimes set $GAE_ENV so we use that - // to check if we're on a second-gen runtime. - return appengineStandard || os.Getenv("GAE_ENV") == "standard" + // second-gen (>= Go 1.11). + return appengineStandard || IsSecondGen() +} + +// IsStandard is the implementation of the wrapper function of the same name in +// ../appengine.go. See that file for commentary. +func IsSecondGen() bool { + // Second-gen runtimes set $GAE_ENV so we use that to check if we're on a second-gen runtime. + return os.Getenv("GAE_ENV") == "standard" } // IsFlex is the implementation of the wrapper function of the same name in diff --git a/vendor/google.golang.org/appengine/internal/main.go b/vendor/google.golang.org/appengine/internal/main.go index 49036163c..1e765312f 100644 --- a/vendor/google.golang.org/appengine/internal/main.go +++ b/vendor/google.golang.org/appengine/internal/main.go @@ -11,5 +11,6 @@ import ( ) func Main() { + MainPath = "" appengine_internal.Main() } diff --git a/vendor/google.golang.org/appengine/internal/main_common.go b/vendor/google.golang.org/appengine/internal/main_common.go new file mode 100644 index 000000000..357dce4dd --- /dev/null +++ b/vendor/google.golang.org/appengine/internal/main_common.go @@ -0,0 +1,7 @@ +package internal + +// MainPath stores the file path of the main package. On App Engine Standard +// using Go version 1.9 and below, this will be unset. On App Engine Flex and +// App Engine Standard second-gen (Go 1.11 and above), this will be the +// filepath to package main. +var MainPath string diff --git a/vendor/google.golang.org/appengine/internal/main_vm.go b/vendor/google.golang.org/appengine/internal/main_vm.go index 822e784a4..ddb79a333 100644 --- a/vendor/google.golang.org/appengine/internal/main_vm.go +++ b/vendor/google.golang.org/appengine/internal/main_vm.go @@ -12,9 +12,12 @@ import ( "net/http" "net/url" "os" + "path/filepath" + "runtime" ) func Main() { + MainPath = filepath.Dir(findMainPath()) installHealthChecker(http.DefaultServeMux) port := "8080" @@ -31,6 +34,24 @@ func Main() { } } +// Find the path to package main by looking at the root Caller. +func findMainPath() string { + pc := make([]uintptr, 100) + n := runtime.Callers(2, pc) + frames := runtime.CallersFrames(pc[:n]) + for { + frame, more := frames.Next() + // Tests won't have package main, instead they have testing.tRunner + if frame.Function == "main.main" || frame.Function == "testing.tRunner" { + return frame.File + } + if !more { + break + } + } + return "" +} + func installHealthChecker(mux *http.ServeMux) { // If no health check handler has been installed by this point, add a trivial one. const healthPath = "/_ah/health" diff --git a/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go b/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go index 8d12dad07..f7bc992d0 100644 --- a/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go +++ b/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go @@ -4764,50 +4764,16 @@ func ValidateNamespaceFinalizeUpdate(newNamespace, oldNamespace *core.Namespace) return allErrs } -// Construct lookup map of old subset IPs to NodeNames. -func updateEpAddrToNodeNameMap(ipToNodeName map[string]string, addresses []core.EndpointAddress) { - for n := range addresses { - if addresses[n].NodeName == nil { - continue - } - ipToNodeName[addresses[n].IP] = *addresses[n].NodeName - } -} - -// Build a map across all subsets of IP -> NodeName -func buildEndpointAddressNodeNameMap(subsets []core.EndpointSubset) map[string]string { - ipToNodeName := make(map[string]string) - for i := range subsets { - updateEpAddrToNodeNameMap(ipToNodeName, subsets[i].Addresses) - updateEpAddrToNodeNameMap(ipToNodeName, subsets[i].NotReadyAddresses) - } - return ipToNodeName -} - -func validateEpAddrNodeNameTransition(addr *core.EndpointAddress, ipToNodeName map[string]string, fldPath *field.Path) field.ErrorList { - errList := field.ErrorList{} - existingNodeName, found := ipToNodeName[addr.IP] - if !found { - return errList - } - if addr.NodeName == nil || *addr.NodeName == existingNodeName { - return errList - } - // NodeName entry found for this endpoint IP, but user is attempting to change NodeName - return append(errList, field.Forbidden(fldPath, fmt.Sprintf("Cannot change NodeName for %s to %s", addr.IP, *addr.NodeName))) -} - // ValidateEndpoints tests if required fields are set. func ValidateEndpoints(endpoints *core.Endpoints) field.ErrorList { allErrs := ValidateObjectMeta(&endpoints.ObjectMeta, true, ValidateEndpointsName, field.NewPath("metadata")) allErrs = append(allErrs, ValidateEndpointsSpecificAnnotations(endpoints.Annotations, field.NewPath("annotations"))...) - allErrs = append(allErrs, validateEndpointSubsets(endpoints.Subsets, []core.EndpointSubset{}, field.NewPath("subsets"))...) + allErrs = append(allErrs, validateEndpointSubsets(endpoints.Subsets, field.NewPath("subsets"))...) return allErrs } -func validateEndpointSubsets(subsets []core.EndpointSubset, oldSubsets []core.EndpointSubset, fldPath *field.Path) field.ErrorList { +func validateEndpointSubsets(subsets []core.EndpointSubset, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} - ipToNodeName := buildEndpointAddressNodeNameMap(oldSubsets) for i := range subsets { ss := &subsets[i] idxPath := fldPath.Index(i) @@ -4818,10 +4784,10 @@ func validateEndpointSubsets(subsets []core.EndpointSubset, oldSubsets []core.En allErrs = append(allErrs, field.Required(idxPath, "must specify `addresses` or `notReadyAddresses`")) } for addr := range ss.Addresses { - allErrs = append(allErrs, validateEndpointAddress(&ss.Addresses[addr], idxPath.Child("addresses").Index(addr), ipToNodeName)...) + allErrs = append(allErrs, validateEndpointAddress(&ss.Addresses[addr], idxPath.Child("addresses").Index(addr))...) } for addr := range ss.NotReadyAddresses { - allErrs = append(allErrs, validateEndpointAddress(&ss.NotReadyAddresses[addr], idxPath.Child("notReadyAddresses").Index(addr), ipToNodeName)...) + allErrs = append(allErrs, validateEndpointAddress(&ss.NotReadyAddresses[addr], idxPath.Child("notReadyAddresses").Index(addr))...) } for port := range ss.Ports { allErrs = append(allErrs, validateEndpointPort(&ss.Ports[port], len(ss.Ports) > 1, idxPath.Child("ports").Index(port))...) @@ -4831,7 +4797,7 @@ func validateEndpointSubsets(subsets []core.EndpointSubset, oldSubsets []core.En return allErrs } -func validateEndpointAddress(address *core.EndpointAddress, fldPath *field.Path, ipToNodeName map[string]string) field.ErrorList { +func validateEndpointAddress(address *core.EndpointAddress, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} for _, msg := range validation.IsValidIP(address.IP) { allErrs = append(allErrs, field.Invalid(fldPath.Child("ip"), address.IP, msg)) @@ -4845,10 +4811,6 @@ func validateEndpointAddress(address *core.EndpointAddress, fldPath *field.Path, allErrs = append(allErrs, field.Invalid(fldPath.Child("nodeName"), *address.NodeName, msg)) } } - allErrs = append(allErrs, validateEpAddrNodeNameTransition(address, ipToNodeName, fldPath.Child("nodeName"))...) - if len(allErrs) > 0 { - return allErrs - } allErrs = append(allErrs, validateNonSpecialIP(address.IP, fldPath.Child("ip"))...) return allErrs } @@ -4898,9 +4860,11 @@ func validateEndpointPort(port *core.EndpointPort, requireName bool, fldPath *fi } // ValidateEndpointsUpdate tests to make sure an endpoints update can be applied. +// NodeName changes are allowed during update to accommodate the case where nodeIP or PodCIDR is reused. +// An existing endpoint ip will have a different nodeName if this happens. func ValidateEndpointsUpdate(newEndpoints, oldEndpoints *core.Endpoints) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&newEndpoints.ObjectMeta, &oldEndpoints.ObjectMeta, field.NewPath("metadata")) - allErrs = append(allErrs, validateEndpointSubsets(newEndpoints.Subsets, oldEndpoints.Subsets, field.NewPath("subsets"))...) + allErrs = append(allErrs, validateEndpointSubsets(newEndpoints.Subsets, field.NewPath("subsets"))...) allErrs = append(allErrs, ValidateEndpointsSpecificAnnotations(newEndpoints.Annotations, field.NewPath("annotations"))...) return allErrs } diff --git a/vendor/k8s.io/kubernetes/pkg/controller/volume/persistentvolume/pv_controller.go b/vendor/k8s.io/kubernetes/pkg/controller/volume/persistentvolume/pv_controller.go index 64a6a2ab8..bb154f109 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/volume/persistentvolume/pv_controller.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/volume/persistentvolume/pv_controller.go @@ -290,7 +290,9 @@ func (ctrl *PersistentVolumeController) shouldDelayBinding(claim *v1.PersistentV } if class.VolumeBindingMode == nil { - return false, fmt.Errorf("VolumeBindingMode not set for StorageClass %q", className) + // In an HA upgrade scenario, the API server may still be on a lower version + // than the controller-manager. Default to behavior as if the feature is off. + return false, nil } // TODO: add check to handle dynamic provisioning later diff --git a/vendor/k8s.io/kubernetes/pkg/scheduler/algorithm/predicates/predicates.go b/vendor/k8s.io/kubernetes/pkg/scheduler/algorithm/predicates/predicates.go index 217d1934a..1aade758c 100644 --- a/vendor/k8s.io/kubernetes/pkg/scheduler/algorithm/predicates/predicates.go +++ b/vendor/k8s.io/kubernetes/pkg/scheduler/algorithm/predicates/predicates.go @@ -588,12 +588,14 @@ func (c *VolumeZoneChecker) predicate(pod *v1.Pod, meta algorithm.PredicateMetad if scName != nil && len(*scName) > 0 { class, _ := c.classInfo.GetStorageClassInfo(*scName) if class != nil { - if class.VolumeBindingMode == nil { - return false, nil, fmt.Errorf("VolumeBindingMode not set for StorageClass %q", scName) - } - if *class.VolumeBindingMode == storagev1.VolumeBindingWaitForFirstConsumer { - // Skip unbound volumes - continue + if class.VolumeBindingMode != nil { + // In an HA Upgrade scenario, the API server may still be + // on a lower version than the scheduler. Default to + // behavior as if the feature is off + if *class.VolumeBindingMode == storagev1.VolumeBindingWaitForFirstConsumer { + // Skip unbound volumes + continue + } } } }