mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
VolumeHost.GetNodeName method added for CSI fix
This commit is contained in:
@@ -53,6 +53,7 @@ type fakeVolumeHost struct {
|
||||
exec mount.Exec
|
||||
writer io.Writer
|
||||
nodeLabels map[string]string
|
||||
nodeName string
|
||||
}
|
||||
|
||||
func NewFakeVolumeHost(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin) *fakeVolumeHost {
|
||||
@@ -69,6 +70,12 @@ func NewFakeVolumeHostWithNodeLabels(rootDir string, kubeClient clientset.Interf
|
||||
return volHost
|
||||
}
|
||||
|
||||
func NewFakeVolumeHostWithNodeName(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, nodeName string) *fakeVolumeHost {
|
||||
volHost := newFakeVolumeHost(rootDir, kubeClient, plugins, nil)
|
||||
volHost.nodeName = nodeName
|
||||
return volHost
|
||||
}
|
||||
|
||||
func newFakeVolumeHost(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, cloud cloudprovider.Interface) *fakeVolumeHost {
|
||||
host := &fakeVolumeHost{rootDir: rootDir, kubeClient: kubeClient, cloud: cloud}
|
||||
host.mounter = &mount.FakeMounter{}
|
||||
@@ -177,6 +184,10 @@ func (f *fakeVolumeHost) GetNodeLabels() (map[string]string, error) {
|
||||
return f.nodeLabels, nil
|
||||
}
|
||||
|
||||
func (f *fakeVolumeHost) GetNodeName() types.NodeName {
|
||||
return types.NodeName(f.nodeName)
|
||||
}
|
||||
|
||||
func ProbeVolumePlugins(config VolumeConfig) []VolumePlugin {
|
||||
if _, ok := config.OtherAttributes["fake-property"]; ok {
|
||||
return []VolumePlugin{
|
||||
|
||||
Reference in New Issue
Block a user