Use framework.ExpectNoError() instead Expect()

The e2e test framework has ExpectNoError() for readable test code.
This replaces Expect(err).NotTo(HaveOccurred()) with it.
This commit is contained in:
Kenichi Omichi
2019-02-15 04:10:36 +00:00
parent 596406581e
commit 2635b6d95c
14 changed files with 58 additions and 70 deletions

View File

@@ -20,8 +20,6 @@ import (
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
. "github.com/onsi/gomega"
"k8s.io/klog"
)
@@ -53,7 +51,7 @@ func NumberOfNVIDIAGPUs(node *v1.Node) int64 {
// NVIDIADevicePlugin returns the official Google Device Plugin pod for NVIDIA GPU in GKE
func NVIDIADevicePlugin() *v1.Pod {
ds, err := DsFromManifest(GPUDevicePluginDSYAML)
Expect(err).NotTo(HaveOccurred())
ExpectNoError(err)
p := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "device-plugin-nvidia-gpu-" + string(uuid.NewUUID()),