Make volume attachment watch timeout configurable for csiAttacher

This commit is contained in:
Chris Henzie
2020-12-28 12:22:10 -08:00
parent b4e3f272b9
commit 195a5af23b
5 changed files with 63 additions and 28 deletions

View File

@@ -22,6 +22,7 @@ import (
"os"
"path/filepath"
"testing"
"time"
api "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
@@ -881,13 +882,16 @@ func TestPluginNewAttacher(t *testing.T) {
t.Fatalf("failed to create new attacher: %v", err)
}
csiAttacher := attacher.(*csiAttacher)
csiAttacher := getCsiAttacherFromVolumeAttacher(attacher)
if csiAttacher.plugin == nil {
t.Error("plugin not set for attacher")
}
if csiAttacher.k8s == nil {
t.Error("Kubernetes client not set for attacher")
}
if csiAttacher.watchTimeout == time.Duration(0) {
t.Error("watch timeout not set for attacher")
}
}
func TestPluginNewDetacher(t *testing.T) {
@@ -901,13 +905,16 @@ func TestPluginNewDetacher(t *testing.T) {
t.Fatalf("failed to create new detacher: %v", err)
}
csiDetacher := detacher.(*csiAttacher)
csiDetacher := getCsiAttacherFromVolumeDetacher(detacher)
if csiDetacher.plugin == nil {
t.Error("plugin not set for detacher")
}
if csiDetacher.k8s == nil {
t.Error("Kubernetes client not set for detacher")
}
if csiDetacher.watchTimeout == time.Duration(0) {
t.Error("watch timeout not set for detacher")
}
}
func TestPluginCanAttach(t *testing.T) {