mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 11:45:20 +00:00
Add verification for CRD installation
Signed-off-by: danfengl <danfengl@vmware.com>
This commit is contained in:
@@ -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())
|
||||
})
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user