Bumping k8s dependencies to 1.13
This commit is contained in:
35
vendor/k8s.io/kubernetes/pkg/volume/secret/secret.go
generated
vendored
35
vendor/k8s.io/kubernetes/pkg/volume/secret/secret.go
generated
vendored
@@ -24,7 +24,6 @@ import (
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
ioutil "k8s.io/kubernetes/pkg/util/io"
|
||||
"k8s.io/kubernetes/pkg/util/mount"
|
||||
"k8s.io/kubernetes/pkg/util/strings"
|
||||
"k8s.io/kubernetes/pkg/volume"
|
||||
@@ -100,7 +99,6 @@ func (plugin *secretPlugin) NewMounter(spec *volume.Spec, pod *v1.Pod, opts volu
|
||||
pod.UID,
|
||||
plugin,
|
||||
plugin.host.GetMounter(plugin.GetPluginName()),
|
||||
plugin.host.GetWriter(),
|
||||
volume.NewCachedMetrics(volume.NewMetricsDu(getPath(pod.UID, spec.Name(), plugin.host))),
|
||||
},
|
||||
source: *spec.Volume.Secret,
|
||||
@@ -117,7 +115,6 @@ func (plugin *secretPlugin) NewUnmounter(volName string, podUID types.UID) (volu
|
||||
podUID,
|
||||
plugin,
|
||||
plugin.host.GetMounter(plugin.GetPluginName()),
|
||||
plugin.host.GetWriter(),
|
||||
volume.NewCachedMetrics(volume.NewMetricsDu(getPath(podUID, volName, plugin.host))),
|
||||
},
|
||||
}, nil
|
||||
@@ -140,7 +137,6 @@ type secretVolume struct {
|
||||
podUID types.UID
|
||||
plugin *secretPlugin
|
||||
mounter mount.Interface
|
||||
writer ioutil.Writer
|
||||
volume.MetricsProvider
|
||||
}
|
||||
|
||||
@@ -206,13 +202,6 @@ func (b *secretVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
|
||||
}
|
||||
}
|
||||
|
||||
if err := wrapped.SetUpAt(dir, fsGroup); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := volumeutil.MakeNestedMountpoints(b.volName, dir, b.pod); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
totalBytes := totalSecretBytes(secret)
|
||||
glog.V(3).Infof("Received secret %v/%v containing (%v) pieces of data, %v total bytes",
|
||||
b.pod.Namespace,
|
||||
@@ -225,6 +214,29 @@ func (b *secretVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
|
||||
return err
|
||||
}
|
||||
|
||||
setupSuccess := false
|
||||
if err := wrapped.SetUpAt(dir, fsGroup); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := volumeutil.MakeNestedMountpoints(b.volName, dir, b.pod); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
// Clean up directories if setup fails
|
||||
if !setupSuccess {
|
||||
unmounter, unmountCreateErr := b.plugin.NewUnmounter(b.volName, b.podUID)
|
||||
if unmountCreateErr != nil {
|
||||
glog.Errorf("error cleaning up mount %s after failure. Create unmounter failed with %v", b.volName, unmountCreateErr)
|
||||
return
|
||||
}
|
||||
tearDownErr := unmounter.TearDown()
|
||||
if tearDownErr != nil {
|
||||
glog.Errorf("error tearing down volume %s with : %v", b.volName, tearDownErr)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
writerContext := fmt.Sprintf("pod %v/%v volume %v", b.pod.Namespace, b.pod.Name, b.volName)
|
||||
writer, err := volumeutil.NewAtomicWriter(dir, writerContext)
|
||||
if err != nil {
|
||||
@@ -243,6 +255,7 @@ func (b *secretVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
|
||||
glog.Errorf("Error applying volume ownership settings for group: %v", fsGroup)
|
||||
return err
|
||||
}
|
||||
setupSuccess = true
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user