mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-08 22:23:15 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user