Skip to content

Commit

Permalink
Modify upgrade and migration cases.
Browse files Browse the repository at this point in the history
Signed-off-by: Xun Jiang <[email protected]>
  • Loading branch information
blackpiglet committed Nov 13, 2024
1 parent bcb60ed commit f9d421e
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 99 deletions.
8 changes: 4 additions & 4 deletions test/e2e/backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ func BackupRestoreTest(backupRestoreTestConfig BackupRestoreTestConfig) {
secretKey,
)).To(Succeed())

bsls := []string{"default", additionalBsl}
BSLs := []string{"default", additionalBsl}

for _, bsl := range bsls {
for _, bsl := range BSLs {
backupName = fmt.Sprintf("backup-%s", bsl)
restoreName = fmt.Sprintf("restore-%s", bsl)
// We limit the length of backup name here to avoid the issue of vsphere plugin https://github.com/vmware-tanzu/velero-plugin-for-vsphere/issues/370
Expand All @@ -209,8 +209,8 @@ func BackupRestoreTest(backupRestoreTestConfig BackupRestoreTestConfig) {
restoreName = fmt.Sprintf("%s-%s", restoreName, UUIDgen)
}
veleroCfg.ProvideSnapshotsVolumeParam = !provideSnapshotVolumesParmInBackup
workloadNmespace := kibishiiNamespace + bsl
Expect(RunKibishiiTests(veleroCfg, backupName, restoreName, bsl, workloadNmespace, useVolumeSnapshots, !useVolumeSnapshots)).To(Succeed(),
workloadNS := kibishiiNamespace + bsl
Expect(RunKibishiiTests(veleroCfg, backupName, restoreName, bsl, workloadNS, useVolumeSnapshots, !useVolumeSnapshots)).To(Succeed(),
"Failed to successfully backup and restore Kibishii namespace using BSL %s", bsl)
}
})
Expand Down
26 changes: 13 additions & 13 deletions test/e2e/bsl-mgmt/deletion.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (
bslDeletionTestNs = "bsl-deletion"
)

// Test backup and restore of Kibishi using restic
// Test backup and restore of Kibishii using restic

func BslDeletionWithSnapshots() {
BslDeletionTest(true)
Expand Down Expand Up @@ -141,10 +141,10 @@ func BslDeletionTest(useVolumeSnapshots bool) {
podName1 := "kibishii-deployment-0"
podName2 := "kibishii-deployment-1"

label_1 := "for=1"
label1 := "for=1"
// TODO remove when issue https://github.com/vmware-tanzu/velero/issues/4724 is fixed
//label_2 := "for!=1"
label_2 := "for=2"
//label2 := "for!=1"
label2 := "for=2"
By("Create namespace for sample workload", func() {
Expect(CreateNamespace(oneHourTimeout, *veleroCfg.ClientToInstallVelero, bslDeletionTestNs)).To(Succeed())
})
Expand All @@ -157,8 +157,8 @@ func BslDeletionTest(useVolumeSnapshots bool) {

// Restic can not backup PV only, so pod need to be labeled also
By("Label all 2 worker-pods of Kibishii", func() {
Expect(AddLabelToPod(context.Background(), podName1, bslDeletionTestNs, label_1)).To(Succeed())
Expect(AddLabelToPod(context.Background(), "kibishii-deployment-1", bslDeletionTestNs, label_2)).To(Succeed())
Expect(AddLabelToPod(context.Background(), podName1, bslDeletionTestNs, label1)).To(Succeed())
Expect(AddLabelToPod(context.Background(), "kibishii-deployment-1", bslDeletionTestNs, label2)).To(Succeed())
})

By("Get all 2 PVCs of Kibishii and label them separately ", func() {
Expand All @@ -172,8 +172,8 @@ func BslDeletionTest(useVolumeSnapshots bool) {
fmt.Println(pvc)
Expect(pvc).To(HaveLen(1))
pvc2 := pvc[0]
Expect(AddLabelToPvc(context.Background(), pvc1, bslDeletionTestNs, label_1)).To(Succeed())
Expect(AddLabelToPvc(context.Background(), pvc2, bslDeletionTestNs, label_2)).To(Succeed())
Expect(AddLabelToPvc(context.Background(), pvc1, bslDeletionTestNs, label1)).To(Succeed())
Expect(AddLabelToPvc(context.Background(), pvc2, bslDeletionTestNs, label2)).To(Succeed())
})

var BackupCfg BackupConfig
Expand All @@ -182,7 +182,7 @@ func BslDeletionTest(useVolumeSnapshots bool) {
BackupCfg.BackupLocation = backupLocation1
BackupCfg.UseVolumeSnapshots = useVolumeSnapshots
BackupCfg.DefaultVolumesToFsBackup = !useVolumeSnapshots
BackupCfg.Selector = label_1
BackupCfg.Selector = label1
By(fmt.Sprintf("Backup one of PV of sample workload by label-1 - Kibishii by the first BSL %s", backupLocation1), func() {
// TODO currently, the upgrade case covers the upgrade path from 1.6 to main and the velero v1.6 doesn't support "debug" command
// TODO move to "runDebug" after we bump up to 1.7 in the upgrade case
Expand All @@ -195,7 +195,7 @@ func BslDeletionTest(useVolumeSnapshots bool) {

BackupCfg.BackupName = backupName2
BackupCfg.BackupLocation = backupLocation2
BackupCfg.Selector = label_2
BackupCfg.Selector = label2
By(fmt.Sprintf("Back up the other one PV of sample workload with label-2 into the additional BSL %s", backupLocation2), func() {
Expect(VeleroBackupNamespace(oneHourTimeout, veleroCfg.VeleroCLI,
veleroCfg.VeleroNamespace, BackupCfg)).To(Succeed(), func() string {
Expand All @@ -205,8 +205,7 @@ func BslDeletionTest(useVolumeSnapshots bool) {
})

if useVolumeSnapshots {
if veleroCfg.CloudProvider == Vsphere {
// TODO - remove after upload progress monitoring is implemented
if veleroCfg.HasVspherePlugin {
By("Waiting for vSphere uploads to complete", func() {
Expect(WaitForVSphereUploadCompletion(oneHourTimeout, time.Hour,
bslDeletionTestNs, 2)).To(Succeed())
Expand Down Expand Up @@ -324,14 +323,15 @@ func BslDeletionTest(useVolumeSnapshots bool) {
// })

if useVolumeSnapshots {
if veleroCfg.CloudProvider == Vsphere {
if veleroCfg.HasVspherePlugin {
By(fmt.Sprintf("Snapshot in backup %s should still exist, because snapshot CR will be deleted 24 hours later if the status is a success", backupName2), func() {
Expect(SnapshotCRsCountShouldBe(context.Background(), bslDeletionTestNs,
backupName1, 1)).To(Succeed())
Expect(SnapshotCRsCountShouldBe(context.Background(), bslDeletionTestNs,
backupName2, 1)).To(Succeed())
})
}

var snapshotCheckPoint SnapshotCheckPoint
snapshotCheckPoint.NamespaceBackedUp = bslDeletionTestNs
By(fmt.Sprintf("Snapshot should not be deleted in cloud object store after deleting bsl %s", backupLocation1), func() {
Expand Down
39 changes: 6 additions & 33 deletions test/e2e/migration/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/google/uuid"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"golang.org/x/mod/semver"

. "github.com/vmware-tanzu/velero/test"
util "github.com/vmware-tanzu/velero/test/util/csi"
Expand Down Expand Up @@ -142,38 +141,12 @@ func MigrationTest(useVolumeSnapshots bool, veleroCLI2Version VeleroCLI2Version)
if veleroCLI2Version.VeleroVersion == "self" {
veleroCLI2Version.VeleroCLI = veleroCfg.VeleroCLI
} else {
fmt.Printf("Using default images address of Velero CLI %s\n", veleroCLI2Version.VeleroVersion)
OriginVeleroCfg.VeleroImage = ""
OriginVeleroCfg.RestoreHelperImage = ""
OriginVeleroCfg.Plugins = ""

versionWithoutPatch := semver.MajorMinor(veleroCLI2Version.VeleroVersion)
// Read migration case needs plugins from the PluginsMatrix map.
migrationNeedPlugins, ok := PluginsMatrix[versionWithoutPatch]
Expect(ok).To(BeTrue())

if OriginVeleroCfg.CloudProvider == Azure {
OriginVeleroCfg.Plugins = migrationNeedPlugins[Azure][0]
}
if OriginVeleroCfg.CloudProvider == AWS {
OriginVeleroCfg.Plugins = migrationNeedPlugins[AWS][0]
}
// If HasVspherePlugin is false, only install the AWS plugin.
// If do nothing here, the default behavior is
// installing both AWS and vSphere plugins.
if OriginVeleroCfg.CloudProvider == Vsphere &&
!OriginVeleroCfg.HasVspherePlugin {
OriginVeleroCfg.Plugins = migrationNeedPlugins[AWS][0]
}
// Because Velero CSI plugin is deprecated in v1.14,
// only need to install it for version lower than v1.14.
if strings.Contains(OriginVeleroCfg.Features, FeatureCSI) &&
semver.Compare(versionWithoutPatch, "v1.14") < 0 {
OriginVeleroCfg.Plugins = OriginVeleroCfg.Plugins + "," + migrationNeedPlugins[CSI][0]
}
if OriginVeleroCfg.SnapshotMoveData && OriginVeleroCfg.CloudProvider == Azure {
OriginVeleroCfg.Plugins = OriginVeleroCfg.Plugins + "," + migrationNeedPlugins[AWS][0]
}
OriginVeleroCfg, err = SetImagesToDefaultValues(
OriginVeleroCfg,
veleroCLI2Version.VeleroVersion,
)
Expect(err).To(Succeed(), "Fail to set images for the migrate-from Velero installation.")

veleroCLI2Version.VeleroCLI, err = InstallVeleroCLI(veleroCLI2Version.VeleroVersion)
Expect(err).To(Succeed())
}
Expand Down
15 changes: 7 additions & 8 deletions test/e2e/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,16 @@ func BackupUpgradeRestoreTest(useVolumeSnapshots bool, veleroCLI2Version VeleroC
veleroCfg.GCFrequency = ""
By(fmt.Sprintf("Install the expected old version Velero (%s) for upgrade",
veleroCLI2Version.VeleroVersion), func() {
//Set VeleroImage and RestoreHelperImage to blank
//VeleroImage and RestoreHelperImage should be the default value in originalCli
tmpCfgForOldVeleroInstall := veleroCfg
tmpCfgForOldVeleroInstall.UpgradeFromVeleroVersion = veleroCLI2Version.VeleroVersion
tmpCfgForOldVeleroInstall.VeleroCLI = veleroCLI2Version.VeleroCLI
tmpCfgForOldVeleroInstall.VeleroImage = ""
tmpCfgForOldVeleroInstall.RestoreHelperImage = ""
tmpCfgForOldVeleroInstall.Plugins = ""

tmpCfgForOldVeleroInstall, err = SetImagesToDefaultValues(
tmpCfgForOldVeleroInstall,
veleroCLI2Version.VeleroVersion,
)
Expect(err).To(Succeed(), "Fail to set the images for upgrade-from Velero installation.")

tmpCfgForOldVeleroInstall.UploaderType = ""
version, err := GetVeleroVersion(oneHourTimeout, tmpCfgForOldVeleroInstall.VeleroCLI, true)
Expect(err).To(Succeed(), "Fail to get Velero version")
Expand All @@ -145,9 +147,6 @@ func BackupUpgradeRestoreTest(useVolumeSnapshots bool, veleroCLI2Version VeleroC
tmpCfgForOldVeleroInstall.UseRestic = !useVolumeSnapshots
tmpCfgForOldVeleroInstall.UseNodeAgent = false
}
//TODO: Remove this setting when upgrade path is from 1.13 to higher
//TODO: version, or self version 1.12 and older versions have no this parameter.
tmpCfgForOldVeleroInstall.WithoutDisableInformerCacheParam = true

Expect(VeleroInstall(context.Background(), &tmpCfgForOldVeleroInstall, false)).To(Succeed())
Expect(CheckVeleroVersion(context.Background(), tmpCfgForOldVeleroInstall.VeleroCLI,
Expand Down
2 changes: 2 additions & 0 deletions test/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const AWS = "aws"
const GCP = "gcp"
const Vsphere = "vsphere"
const CSI = "csi"
const Velero = "velero"
const VeleroRestoreHelper = "velero-restore-helper"

const UploaderTypeRestic = "restic"

Expand Down
11 changes: 9 additions & 2 deletions test/util/kibishii/kibishii_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,15 @@ func GetKibishiiPVCNameList(workerCount int) []string {
}

// RunKibishiiTests runs kibishii tests on the provider.
func RunKibishiiTests(veleroCfg VeleroConfig, backupName, restoreName, backupLocation, kibishiiNamespace string,
useVolumeSnapshots, defaultVolumesToFsBackup bool) error {
func RunKibishiiTests(
veleroCfg VeleroConfig,
backupName string,
restoreName string,
backupLocation string,
kibishiiNamespace string,
useVolumeSnapshots bool,
defaultVolumesToFsBackup bool,
) error {
pvCount := len(KibishiiPVCNameList)
client := *veleroCfg.ClientToInstallVelero
oneHourTimeout, ctxCancel := context.WithTimeout(context.Background(), time.Minute*60)
Expand Down
138 changes: 99 additions & 39 deletions test/util/velero/velero_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (

"github.com/pkg/errors"
"golang.org/x/exp/slices"
"golang.org/x/mod/semver"
ver "k8s.io/apimachinery/pkg/util/version"
"k8s.io/apimachinery/pkg/util/wait"
kbclient "sigs.k8s.io/controller-runtime/pkg/client"
Expand All @@ -54,67 +55,126 @@ const BackupObjectsPrefix = "backups"
const RestoreObjectsPrefix = "restores"
const PluginsObjectsPrefix = "plugins"

var PluginsMatrix = map[string]map[string][]string{
var ImagesMatrix = map[string]map[string][]string{
"v1.10": {
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.6.0"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.6.0"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.1"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.6.0"},
"csi": {"gcr.io/velero-gcp/velero-plugin-for-csi:v0.4.0"},
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.6.0"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.6.0"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.1"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.6.0"},
"csi": {"gcr.io/velero-gcp/velero-plugin-for-csi:v0.4.0"},
"velero": {"gcr.io/velero-gcp/velero:v1.10.2"},
"velero-restore-helper": {"gcr.io/velero-gcp/velero-restore-helper:v1.10.2"},
},
"v1.11": {
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.7.0"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.7.0"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.1"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.7.0"},
"csi": {"gcr.io/velero-gcp/velero-plugin-for-csi:v0.5.0"},
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.7.0"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.7.0"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.1"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.7.0"},
"csi": {"gcr.io/velero-gcp/velero-plugin-for-csi:v0.5.0"},
"velero": {"gcr.io/velero-gcp/velero:v1.11.1"},
"velero-restore-helper": {"gcr.io/velero-gcp/velero-restore-helper:v1.11.1"},
},
"v1.12": {
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.8.0"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.8.0"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.1"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.8.0"},
"csi": {"gcr.io/velero-gcp/velero-plugin-for-csi:v0.6.0"},
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.8.0"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.8.0"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.1"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.8.0"},
"csi": {"gcr.io/velero-gcp/velero-plugin-for-csi:v0.6.0"},
"velero": {"gcr.io/velero-gcp/velero:v1.12.4"},
"velero-restore-helper": {"gcr.io/velero-gcp/velero-restore-helper:v1.12.4"},
},
"v1.13": {
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.9.2"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.9.2"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.2"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.9.2"},
"csi": {"gcr.io/velero-gcp/velero-plugin-for-csi:v0.7.1"},
"datamover": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.9.2"},
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.9.2"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.9.2"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.2"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.9.2"},
"csi": {"gcr.io/velero-gcp/velero-plugin-for-csi:v0.7.1"},
"datamover": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.9.2"},
"velero": {"gcr.io/velero-gcp/velero:v1.13.2"},
"velero-restore-helper": {"gcr.io/velero-gcp/velero-restore-helper:v1.13.2"},
},
"v1.14": {
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.10.1"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.10.1"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.2"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.10.1"},
"datamover": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.10.1"},
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.10.1"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.10.1"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.2"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.10.1"},
"datamover": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.10.1"},
"velero": {"gcr.io/velero-gcp/velero:v1.14.1"},
"velero-restore-helper": {"gcr.io/velero-gcp/velero-restore-helper:v1.14.1"},
},
"v1.15": {
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.11.0"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.11.0"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.2"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.11.0"},
"datamover": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.11.0"},
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.11.0"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:v1.11.0"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.2"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:v1.11.0"},
"datamover": {"gcr.io/velero-gcp/velero-plugin-for-aws:v1.11.0"},
"velero": {"gcr.io/velero-gcp/velero:v1.15.0"},
"velero-restore-helper": {"gcr.io/velero-gcp/velero-restore-helper:v1.15.0"},
},
"main": {
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:main"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:main"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.2"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:main"},
"datamover": {"gcr.io/velero-gcp/velero-plugin-for-aws:main"},
"aws": {"gcr.io/velero-gcp/velero-plugin-for-aws:main"},
"azure": {"gcr.io/velero-gcp/velero-plugin-for-microsoft-azure:main"},
"vsphere": {"gcr.io/velero-gcp/velero-plugin-for-vsphere:v1.5.2"},
"gcp": {"gcr.io/velero-gcp/velero-plugin-for-gcp:main"},
"datamover": {"gcr.io/velero-gcp/velero-plugin-for-aws:main"},
"velero": {"gcr.io/velero-gcp/velero:main"},
"velero-restore-helper": {"gcr.io/velero-gcp/velero-restore-helper:main"},
},
}

func SetImagesToDefaultValues(config VeleroConfig, version string) (VeleroConfig, error) {
fmt.Printf("Get the images for version %s\n", version)

ret := config

ret.Plugins = ""

versionWithoutPatch := semver.MajorMinor(version)
// Read migration case needs images from the PluginsMatrix map.
images, ok := ImagesMatrix[versionWithoutPatch]
if !ok {
return config, fmt.Errorf("fail to read the images for version %s from the ImagesMatrix",
versionWithoutPatch)
}

ret.VeleroImage = images[Velero][0]
ret.RestoreHelperImage = images[VeleroRestoreHelper][0]

if ret.CloudProvider == Azure {
ret.Plugins = images[Azure][0]
}
if ret.CloudProvider == AWS {
ret.Plugins = images[AWS][0]
}
// If HasVspherePlugin is false, only install the AWS plugin.
// If do nothing here, the default behavior is
// installing both AWS and vSphere plugins.
if ret.CloudProvider == Vsphere &&
!ret.HasVspherePlugin {
ret.Plugins = images[AWS][0]
}

// Because Velero CSI plugin is deprecated in v1.14,
// only need to install it for version lower than v1.14.
if strings.Contains(ret.Features, FeatureCSI) &&
semver.Compare(versionWithoutPatch, "v1.14") < 0 {
ret.Plugins = ret.Plugins + "," + images[CSI][0]
}
if ret.SnapshotMoveData && ret.CloudProvider == Azure {
ret.Plugins = ret.Plugins + "," + images[AWS][0]
}

return ret, nil
}

func getPluginsByVersion(version string, cloudProvider string, needDataMoverPlugin bool) ([]string, error) {
var cloudMap map[string][]string
arr := strings.Split(version, ".")
if len(arr) >= 3 {
cloudMap = PluginsMatrix[arr[0]+"."+arr[1]]
cloudMap = ImagesMatrix[arr[0]+"."+arr[1]]
}
if len(cloudMap) == 0 {
cloudMap = PluginsMatrix["main"]
cloudMap = ImagesMatrix["main"]
if len(cloudMap) == 0 {
return nil, errors.Errorf("fail to get plugins by version: main")
}
Expand Down

0 comments on commit f9d421e

Please sign in to comment.