Fix issues of E2E test for API group, migration and pv opt-out backup

1. One of API group test failed due to other PR with fix for treat PartiallyFailed as failure to collect debugbundle without wrap the origin error;
2. Fix migration test issue of wrong velero cli for backup commmand;
3. Fix wrong pararmeter name issue for pv opt-out backup test.

Signed-off-by: danfengl <danfengl@vmware.com>
This commit is contained in:
danfengl
2022-09-28 02:29:38 +00:00
parent 3f3a5050d6
commit e699a3e9f2
6 changed files with 25 additions and 34 deletions

View File

@@ -6,10 +6,6 @@ import (
"context"
"fmt"
"os/exec"
"github.com/pkg/errors"
veleroexec "github.com/vmware-tanzu/velero/pkg/util/exec"
)
type OsCommandLine struct {
@@ -56,15 +52,3 @@ func GetListBy2Pipes(ctx context.Context, cmdline1, cmdline2, cmdline3 OsCommand
return ret, nil
}
func KubectlApplyFile(ctx context.Context, yaml string) error {
fmt.Printf("Kube apply file %s.\n", yaml)
cmd := exec.CommandContext(ctx, "kubectl", "apply", "-f", yaml)
_, stderr, err := veleroexec.RunCommand(cmd)
if err != nil {
return errors.Wrap(err, stderr)
}
return nil
}

View File

@@ -443,7 +443,7 @@ func VeleroCmdExec(ctx context.Context, veleroCLI string, args []string) error {
err := cmd.Run()
retAll := outBuf.String() + " " + errBuf.String()
if strings.Contains(strings.ToLower(retAll), "failed") {
return errors.New(fmt.Sprintf("velero cmd =%v return with failure\n", cmd))
return errors.Wrap(err, fmt.Sprintf("velero cmd =%v return with failure\n", cmd))
}
if err != nil {
return err