decouple testfiles from framework

This drops testfiles.ReadOrDie and updated testfiles.Exists to return an
error, forcing the caller to decide whether to call framework.Fail or do
something else.

It makes for a slightly less friendly API, but also means the package is
decoupled from framework again, as per the comments at the top of the
file
This commit is contained in:
Aaron Crickenberger
2020-06-22 15:33:41 -07:00
parent 71c352dee3
commit 28768166f5
12 changed files with 87 additions and 38 deletions

View File

@@ -80,7 +80,12 @@ func numberOfSampleResources(node *v1.Node) int64 {
// getSampleDevicePluginPod returns the Device Plugin pod for sample resources in e2e tests.
func getSampleDevicePluginPod() *v1.Pod {
ds := readDaemonSetV1OrDie(e2etestfiles.ReadOrDie(sampleDevicePluginDSYAML))
data, err := e2etestfiles.Read(sampleDevicePluginDSYAML)
if err != nil {
framework.Fail(err.Error())
}
ds := readDaemonSetV1OrDie(data)
p := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: sampleDevicePluginName,