Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick to 1.10 Add verification for CRD installation #5632

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/e2e/basic/enable_api_group_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ func APIExtensionsVersionsTest() {
By(fmt.Sprintf("Install CRD of apiextenstions v1beta1 in cluster-A (%s)", VeleroCfg.DefaultCluster), func() {
Expect(installCRD(context.Background(), srcCrdYaml)).To(Succeed())
Expect(CRDShouldExist(context.Background(), crdName)).To(Succeed())
Expect(WaitForCRDEstablished(crdName)).To(Succeed())
Expect(AddLabelToCRD(context.Background(), crdName, label)).To(Succeed())
})

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/migration/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func MigrationTest(useVolumeSnapshots bool, veleroCLI2Version VeleroCLI2Version)
UUIDgen, err = uuid.NewRandom()
Expect(err).To(Succeed())

oneHourTimeout, _ := context.WithTimeout(context.Background(), time.Minute*10)
oneHourTimeout, _ := context.WithTimeout(context.Background(), time.Minute*60)

if veleroCLI2Version.VeleroCLI == "" {
//Assume tag of velero server image is identical to velero CLI version
Expand Down
14 changes: 14 additions & 0 deletions test/e2e/util/k8s/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,17 @@ func DeleteVeleroDs(ctx context.Context) error {
fmt.Println(args)
return exec.CommandContext(ctx, "kubectl", args...).Run()
}

func WaitForCRDEstablished(crdName string) error {
arg := []string{"wait", "--for", "condition=established", "--timeout=60s", "crd/" + crdName}
cmd := exec.CommandContext(context.Background(), "kubectl", arg...)
fmt.Printf("Kubectl exec cmd =%v\n", cmd)
stdout, stderr, err := veleroexec.RunCommand(cmd)
fmt.Println(stdout)
if err != nil {
fmt.Println(stderr)
fmt.Println(err)
return err
}
return nil
}
2 changes: 1 addition & 1 deletion test/e2e/util/kibishii/kibishii_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func installKibishii(ctx context.Context, namespace string, cloudPlatform, veler
}

func generateData(ctx context.Context, namespace string, kibishiiData *KibishiiData) error {
timeout, _ := context.WithTimeout(context.Background(), time.Minute*10)
timeout, _ := context.WithTimeout(context.Background(), time.Minute*20)
kibishiiGenerateCmd := exec.CommandContext(timeout, "kubectl", "exec", "-n", namespace, "jump-pad", "--",
"/usr/local/bin/generate.sh", strconv.Itoa(kibishiiData.Levels), strconv.Itoa(kibishiiData.DirsPerLevel),
strconv.Itoa(kibishiiData.FilesPerLevel), strconv.Itoa(kibishiiData.FileLength),
Expand Down