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:
parent
bbb1341599
commit
31d463e477
2 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue