Skip to content

Commit

Permalink
Merge pull request #6983 from danfengliu/fix-resource-groupname-issue
Browse files Browse the repository at this point in the history
Fix fail to get backup repo due to missing api group name issue
  • Loading branch information
Lyndon-Li authored Oct 24, 2023
2 parents 27f301c + d2fc9fa commit e2ec855
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/util/velero/velero_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ import (

"github.com/pkg/errors"
"golang.org/x/exp/slices"
ver "k8s.io/apimachinery/pkg/util/version"
"k8s.io/apimachinery/pkg/util/wait"

kbclient "sigs.k8s.io/controller-runtime/pkg/client"

ver "k8s.io/apimachinery/pkg/util/version"

velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
cliinstall "github.com/vmware-tanzu/velero/pkg/cmd/cli/install"
"github.com/vmware-tanzu/velero/pkg/cmd/util/flag"
Expand Down Expand Up @@ -1161,7 +1159,7 @@ func SnapshotCRsCountShouldBe(ctx context.Context, namespace, backupName string,
}

func BackupRepositoriesCountShouldBe(ctx context.Context, veleroNamespace, targetNamespace string, expectedCount int) error {
resticArr, err := GetResticRepositories(ctx, veleroNamespace, targetNamespace)
resticArr, err := GetRepositories(ctx, veleroNamespace, targetNamespace)
if err != nil {
return errors.Wrapf(err, "Fail to get BackupRepositories")
}
Expand All @@ -1172,11 +1170,11 @@ func BackupRepositoriesCountShouldBe(ctx context.Context, veleroNamespace, targe
}
}

func GetResticRepositories(ctx context.Context, veleroNamespace, targetNamespace string) ([]string, error) {
func GetRepositories(ctx context.Context, veleroNamespace, targetNamespace string) ([]string, error) {
cmds := []*common.OsCommandLine{}
cmd := &common.OsCommandLine{
Cmd: "kubectl",
Args: []string{"get", "-n", veleroNamespace, "BackupRepositories"},
Args: []string{"get", "-n", veleroNamespace, "backuprepositories.velero.io"},
}
cmds = append(cmds, cmd)

Expand Down

0 comments on commit e2ec855

Please sign in to comment.