mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-29 11:16:08 +00:00
E2E supports VKS data mover environment.
* Add new flag HAS_VSPHERE_PLUGIN for E2E test. * Modify the E2E README for the new parameter. * Add the VolumeSnapshotClass for VKS. * Modify the plugin install logic. * Modify the cases to support data mover case in VKS. Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
This commit is contained in:
@@ -120,9 +120,8 @@ func RunKibishiiTests(veleroCfg VeleroConfig, backupName, restoreName, backupLoc
|
||||
|
||||
// Checkpoint for a successful backup
|
||||
if useVolumeSnapshots {
|
||||
if providerName == Vsphere {
|
||||
if veleroCfg.HasVspherePlugin {
|
||||
// Wait for uploads started by the Velero Plugin for vSphere to complete
|
||||
// TODO - remove after upload progress monitoring is implemented
|
||||
fmt.Println("Waiting for vSphere uploads to complete")
|
||||
if err := WaitForVSphereUploadCompletion(oneHourTimeout, time.Hour, kibishiiNamespace, 2); err != nil {
|
||||
return errors.Wrapf(err, "Error waiting for uploads to complete")
|
||||
|
||||
@@ -320,7 +320,7 @@ func installVeleroServer(ctx context.Context, cli, cloudProvider string, options
|
||||
|
||||
if len(options.Features) > 0 {
|
||||
args = append(args, "--features", options.Features)
|
||||
if !strings.EqualFold(cloudProvider, test.Vsphere) && strings.EqualFold(options.Features, test.FeatureCSI) && options.UseVolumeSnapshots {
|
||||
if strings.EqualFold(options.Features, test.FeatureCSI) && options.UseVolumeSnapshots {
|
||||
// https://github.com/openebs/zfs-localpv/blob/develop/docs/snapshot.md
|
||||
fmt.Printf("Start to install %s VolumeSnapshotClass ... \n", cloudProvider)
|
||||
if err := k8s.KubectlApplyByFile(ctx, fmt.Sprintf("../testdata/volume-snapshot-class/%s.yaml", cloudProvider)); err != nil {
|
||||
|
||||
@@ -107,7 +107,7 @@ var PluginsMatrix = map[string]map[string][]string{
|
||||
},
|
||||
}
|
||||
|
||||
func getPluginsByVersion(version, cloudProvider, objectStoreProvider string, needDataMoverPlugin bool) ([]string, error) {
|
||||
func getPluginsByVersion(version string, cloudProvider string, needDataMoverPlugin bool) ([]string, error) {
|
||||
var cloudMap map[string][]string
|
||||
arr := strings.Split(version, ".")
|
||||
if len(arr) >= 3 {
|
||||
@@ -133,18 +133,6 @@ func getPluginsByVersion(version, cloudProvider, objectStoreProvider string, nee
|
||||
return nil, errors.Errorf("fail to get plugins by version: %s and provider %s", version, cloudProvider)
|
||||
}
|
||||
}
|
||||
// TODO: Is this section need?
|
||||
if objectStoreProvider != cloudProvider {
|
||||
pluginsForObjectStoreProvider, ok := cloudMap[objectStoreProvider]
|
||||
if !ok {
|
||||
return nil, errors.Errorf("fail to get plugins by version: %s and object store provider %s", version, objectStoreProvider)
|
||||
}
|
||||
for _, p := range pluginsForObjectStoreProvider {
|
||||
if !slices.Contains(plugins, p) {
|
||||
plugins = append(plugins, p)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if needDataMoverPlugin {
|
||||
pluginsForDatamover, ok := cloudMap["datamover"]
|
||||
@@ -630,7 +618,7 @@ func getProviderPlugins(ctx context.Context, veleroCLI string, cloudProvider str
|
||||
return nil, errors.WithMessage(err, "failed to get velero version")
|
||||
}
|
||||
|
||||
plugins, err := getPluginsByVersion(version, cloudProvider, cloudProvider, false)
|
||||
plugins, err := getPluginsByVersion(version, cloudProvider, false)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessagef(err, "Fail to get plugin by provider %s and version %s", cloudProvider, version)
|
||||
}
|
||||
@@ -673,7 +661,7 @@ func getPlugins(ctx context.Context, veleroCfg VeleroConfig) ([]string, error) {
|
||||
if veleroCfg.SnapshotMoveData && veleroCfg.DataMoverPlugin == "" && !veleroCfg.IsUpgradeTest {
|
||||
needDataMoverPlugin = true
|
||||
}
|
||||
plugins, err = getPluginsByVersion(version, cloudProvider, objectStoreProvider, needDataMoverPlugin)
|
||||
plugins, err = getPluginsByVersion(version, cloudProvider, needDataMoverPlugin)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessagef(err, "Fail to get plugin by provider %s and version %s", objectStoreProvider, version)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user