1
0
Fork 0
mirror of https://github.com/kastenhq/kubestr.git synced 2024-12-14 11:57:56 +00:00

fix for misplaced defer (#63)

This commit is contained in:
Sirish Bathina 2021-04-06 07:39:47 -10:00 committed by GitHub
parent bbb1341599
commit 31d463e477
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -134,12 +134,12 @@ func (f *FIOrunner) RunFioHelper(ctx context.Context, args *RunFIOArgs) (*RunFIO
fmt.Println("PVC created", pvc.Name)
pod, err := f.fioSteps.createPod(ctx, pvc.Name, configMap.Name, testFileName, args.Namespace, args.Image)
defer func() {
_ = f.fioSteps.deletePod(context.TODO(), pod.Name, args.Namespace)
}()
if err != nil {
return nil, errors.Wrap(err, "Failed to create POD")
}
defer func() {
_ = f.fioSteps.deletePod(context.TODO(), pod.Name, args.Namespace)
}()
fmt.Println("Pod created", pod.Name)
fmt.Printf("Running FIO test (%s) on StorageClass (%s) with a PVC of Size (%s)\n", testFileName, args.StorageClass, args.Size)
fioOutput, err := f.fioSteps.runFIOCommand(ctx, pod.Name, ContainerName, testFileName, args.Namespace)

View file

@ -194,7 +194,7 @@ func (s *FIOTestSuite) TestRunFioHelper(c *C) {
Namespace: "foo",
},
checker: NotNil,
expectedSteps: []string{"VN", "SCE", "LCM", "CPVC", "CPOD", "DPOD", "DPVC", "DCM"},
expectedSteps: []string{"VN", "SCE", "LCM", "CPVC", "CPOD", "DPVC", "DCM"},
},
{ // create PVC error
cli: fake.NewSimpleClientset(),