Skip to content

Commit

Permalink
Use the SC mapping cm in all migration cases.
Browse files Browse the repository at this point in the history
The migration case is verified under the following environments now:
* CSI.
* CSI data mover.
* FSB.

Signed-off-by: Xun Jiang <[email protected]>
  • Loading branch information
blackpiglet committed Dec 30, 2024
1 parent 32499fc commit ab33e06
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions test/e2e/migration/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (m *migrationE2E) Init() error {
Expect(m.TestCase.Init()).To(Succeed())
})

// We can assume CSI, data mover and the FSB migration all work in current test environment.
By("Skip check", func() {
if m.VeleroCfg.DefaultClusterContext == "" || m.VeleroCfg.StandbyClusterContext == "" {
Skip("Migration test needs 2 clusters")
Expand Down Expand Up @@ -356,26 +357,26 @@ func (m *migrationE2E) Restore() error {
})

By(fmt.Sprintf("Restore %s", m.CaseBaseName), func() {
if m.VeleroCfg.SnapshotMoveData {
cmName := "datamover-storage-class-config"
labels := map[string]string{"velero.io/change-storage-class": "RestoreItemAction",
"velero.io/plugin-config": ""}
data := map[string]string{kibishii.KibishiiStorageClassName: test.StorageClassName}

By(fmt.Sprintf("Create ConfigMap %s in namespace %s",
cmName, StandbyVeleroCfg.VeleroNamespace), func() {
_, err := k8sutil.CreateConfigMap(
StandbyVeleroCfg.StandbyClient.ClientGo,
StandbyVeleroCfg.VeleroNamespace,
cmName,
labels,
data,
)
Expect(err).To(Succeed(), fmt.Sprintf(
"failed to create ConfigMap in the namespace %q",
StandbyVeleroCfg.VeleroNamespace))
})
}
// Use the e2e-storage-class SC instead of the kibishii-storage-class,
// because the Standby cluster doesn't have a chance to create the kibishii resource.
cmName := "datamover-storage-class-config"
labels := map[string]string{"velero.io/change-storage-class": "RestoreItemAction",
"velero.io/plugin-config": ""}
data := map[string]string{kibishii.KibishiiStorageClassName: test.StorageClassName}

By(fmt.Sprintf("Create ConfigMap %s in namespace %s",
cmName, StandbyVeleroCfg.VeleroNamespace), func() {
_, err := k8sutil.CreateConfigMap(
StandbyVeleroCfg.StandbyClient.ClientGo,
StandbyVeleroCfg.VeleroNamespace,
cmName,
labels,
data,
)
Expect(err).To(Succeed(), fmt.Sprintf(
"failed to create ConfigMap in the namespace %q",
StandbyVeleroCfg.VeleroNamespace))
})

Expect(veleroutil.VeleroRestore(
m.Ctx,
Expand Down

0 comments on commit ab33e06

Please sign in to comment.