diff --git a/test/e2e/framework/gpu_util.go b/test/e2e/framework/gpu_util.go index 17abe0b2af9..80da1aff16c 100644 --- a/test/e2e/framework/gpu_util.go +++ b/test/e2e/framework/gpu_util.go @@ -21,6 +21,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" + "github.com/golang/glog" . "github.com/onsi/gomega" ) @@ -69,7 +70,16 @@ func NVIDIADevicePlugin() *v1.Pod { func GetGPUDevicePluginImage() string { ds, err := DsFromManifest(GPUDevicePluginDSYAML) - if err != nil || ds == nil || len(ds.Spec.Template.Spec.Containers) < 1 { + if err != nil { + glog.Errorf("Failed to parse the device plugin image: %v", err) + return "" + } + if ds == nil { + glog.Errorf("Failed to parse the device plugin image: the extracted DaemonSet is nil") + return "" + } + if len(ds.Spec.Template.Spec.Containers) < 1 { + glog.Errorf("Failed to parse the device plugin image: cannot extract the container from YAML") return "" } return ds.Spec.Template.Spec.Containers[0].Image