Update vendor

pull/782/head
Darren Shepherd 5 years ago
parent 8a9c8675c2
commit 6d24760c9c

@ -4,7 +4,7 @@ var (
gitMajor = "1"
gitMinor = "15"
gitVersion = "v1.15.3-k3s.1"
gitCommit = "2258cf7b7c767ecca887c5fc17784b3f8472b271"
gitCommit = "77c93d8d16059eb6873a8a154bbd70518b4e9db4"
gitTreeState = "clean"
buildDate = "2019-08-29T05:27+00:00Z"
buildDate = "2019-08-30T18:26+00:00Z"
)

@ -4,7 +4,7 @@ var (
gitMajor = "1"
gitMinor = "15"
gitVersion = "v1.15.3-k3s.1"
gitCommit = "2258cf7b7c767ecca887c5fc17784b3f8472b271"
gitCommit = "77c93d8d16059eb6873a8a154bbd70518b4e9db4"
gitTreeState = "clean"
buildDate = "2019-08-29T05:27+00:00Z"
buildDate = "2019-08-30T18:26+00:00Z"
)

@ -23,7 +23,6 @@ import (
"path"
"sort"
"strings"
"sync"
"time"
"context"
@ -64,12 +63,6 @@ const (
csiResyncPeriod = time.Minute
)
var (
WaitForValidHostName bool
csiPluginInstance *csiPlugin
csiPluginLock sync.Mutex
)
var deprecatedSocketDirVersions = []string{"0.1.0", "0.2.0", "0.3.0", "0.4.0"}
type csiPlugin struct {
@ -86,18 +79,11 @@ const ephemeralDriverMode driverMode = "ephemeral"
// ProbeVolumePlugins returns implemented plugins
func ProbeVolumePlugins() []volume.VolumePlugin {
csiPluginLock.Lock()
defer csiPluginLock.Unlock()
if csiPluginInstance != nil {
return []volume.VolumePlugin{csiPluginInstance}
}
csiPluginInstance = &csiPlugin{
p := &csiPlugin{
host: nil,
blockEnabled: utilfeature.DefaultFeatureGate.Enabled(features.CSIBlockVolume),
}
return []volume.VolumePlugin{csiPluginInstance}
return []volume.VolumePlugin{p}
}
// volume.VolumePlugin methods
@ -221,21 +207,6 @@ func (h *RegistrationHandler) DeRegisterPlugin(pluginName string) {
}
func (p *csiPlugin) Init(host volume.VolumeHost) error {
csiPluginLock.Lock()
defer csiPluginLock.Unlock()
if WaitForValidHostName && host.GetHostName() == "" {
for {
if p.host != nil {
return nil
}
csiPluginLock.Unlock()
time.Sleep(time.Second)
klog.Infof("Waiting for CSI volume hostname")
csiPluginLock.Lock()
}
}
p.host = host
if utilfeature.DefaultFeatureGate.Enabled(features.CSIDriverRegistry) {
@ -274,21 +245,25 @@ func (p *csiPlugin) Init(host volume.VolumeHost) error {
}
// Initializing the label management channels
nim = nodeinfomanager.NewNodeInfoManager(host.GetNodeName(), host, migratedPlugins)
localNim := nodeinfomanager.NewNodeInfoManager(host.GetNodeName(), host, migratedPlugins)
if utilfeature.DefaultFeatureGate.Enabled(features.CSINodeInfo) &&
utilfeature.DefaultFeatureGate.Enabled(features.CSIMigration) {
// This function prevents Kubelet from posting Ready status until CSINodeInfo
// is both installed and initialized
if err := initializeCSINode(host); err != nil {
if err := initializeCSINode(host, localNim); err != nil {
return fmt.Errorf("failed to initialize CSINodeInfo: %v", err)
}
}
if _, ok := host.(volume.KubeletVolumeHost); ok {
nim = localNim
}
return nil
}
func initializeCSINode(host volume.VolumeHost) error {
func initializeCSINode(host volume.VolumeHost, nim nodeinfomanager.Interface) error {
kvh, ok := host.(volume.KubeletVolumeHost)
if !ok {
klog.V(4).Info("Cast from VolumeHost to KubeletVolumeHost failed. Skipping CSINodeInfo initialization, not running on kubelet")

@ -18,6 +18,10 @@ package volume
import (
"fmt"
"net"
"strings"
"sync"
authenticationv1 "k8s.io/api/authentication/v1"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
@ -37,9 +41,6 @@ import (
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/volume/util/recyclerclient"
"k8s.io/kubernetes/pkg/volume/util/subpath"
"net"
"strings"
"sync"
)
type ProbeOperation uint32
@ -576,10 +577,6 @@ func (pm *VolumePluginMgr) InitPlugins(plugins []VolumePlugin, prober DynamicPlu
pm.mutex.Lock()
defer pm.mutex.Unlock()
if pm.Host != nil {
return nil
}
pm.Host = host
if prober == nil {

Loading…
Cancel
Save