Skip to content

Commit aac86d1

Browse files
mgencurclaude
andcommitted
feat: Enable ROSA cluster support in HCP backup/restore tests
- Add external-rosa mode for HC_BACKUP_RESTORE_MODE to support existing ROSA clusters - Introduce HC_NAMESPACE parameter for configurable cluster namespace management - Add service cluster kubeconfig support via SC_KUBECONFIG parameter for ROSA ManifestWork operations - Implement ManifestWork backup/deletion functionality for ROSA cluster lifecycle management - Add open-cluster-management.io/api dependency to support ManifestWork operations - Create separate OADP deployment operations for default vs ROSA scenarios - Skip DPA HCP plugin modification for ROSA where DPA is managed via ManifestWork - Add VSL_AWS_PROFILE parameter for volume snapshot location AWS profile configuration - Refactor backup/restore suite to use pluggable deployment strategies - Update test configuration to handle both regular HCP and ROSA cluster workflows 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 038659f commit aac86d1

14 files changed

+543
-140
lines changed

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,13 @@ IMG ?= quay.io/konveyor/oadp-operator:latest
6565
# You can override this with environment variable (e.g., export TTL_DURATION=4h)
6666
TTL_DURATION ?= 1h
6767

68-
# HC_NAME is the name of the HostedCluster to use for HCP tests when
69-
# hc_backup_restore_mode is set to external. Otherwise, HC_NAME is ignored.
68+
# HC_BACKUP_RESTORE_MODE is the mode of the HostedCluster to use for HCP tests.
69+
HC_BACKUP_RESTORE_MODE ?= external # create, external, external-rosa
70+
# HC_NAME is the name of the HostedCluster to use for HCP tests when HC_BACKUP_RESTORE_MODE is
71+
# set to external. Otherwise, HC_NAME is ignored.
7072
HC_NAME ?= ""
73+
# HC_NAMESPACE is the namespace for HostedClusters to use for HCP tests.
74+
HC_NAMESPACE ?= clusters
7175

7276
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
7377
ifeq (,$(shell go env GOBIN))
@@ -747,6 +751,7 @@ CI_CRED_FILE ?= ${CLUSTER_PROFILE_DIR}/.awscred
747751
BSL_REGION ?= us-east-1
748752
VSL_REGION ?= ${LEASED_RESOURCE}
749753
BSL_AWS_PROFILE ?= default
754+
VSL_AWS_PROFILE ?= default
750755
# BSL_AWS_PROFILE ?= migration-engineering
751756

752757
# bucket file
@@ -800,6 +805,7 @@ test-e2e-setup: login-required build-must-gather
800805
OADP_CRED_FILE="$(OADP_CRED_FILE)" \
801806
BUCKET="$(OADP_BUCKET)" \
802807
TARGET_CI_CRED_FILE="$(CI_CRED_FILE)" \
808+
VSL_AWS_PROFILE="$(VSL_AWS_PROFILE)" \
803809
VSL_REGION="$(VSL_REGION)" \
804810
BSL_REGION="$(BSL_REGION)" \
805811
BSL_AWS_PROFILE="$(BSL_AWS_PROFILE)" \
@@ -836,7 +842,7 @@ else
836842
endif
837843
ifeq ($(TEST_HCP_EXTERNAL),true)
838844
TEST_FILTER += && (hcp_external)
839-
HCP_EXTERNAL_ARGS = -hc_backup_restore_mode=external -hc_name=$(HC_NAME)
845+
HCP_EXTERNAL_ARGS = -hc_backup_restore_mode=$(HC_BACKUP_RESTORE_MODE) -hc_name=$(HC_NAME) -hc_namespace=$(HC_NAMESPACE) -sc_kubeconfig=$(SC_KUBECONFIG)
840846
else
841847
TEST_FILTER += && (! hcp_external)
842848
endif

docs/developer/testing/TESTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,23 @@ HC_NAME=hc1 \
110110
make test-e2e
111111
```
112112

113+
### Run selected test for HCP against external HostedControlPlane on ROSA
114+
115+
* KUBECONFIG must point to the management cluster
116+
* SC_KUBECONFIG must point to the Service Cluster with ManifestWork resources
117+
* In order to break the guest cluster, the tests delete ManifestWork resources on the Service Cluster.
118+
119+
120+
```bash
121+
TEST_HCP_EXTERNAL=true \
122+
HC_BACKUP_RESTORE_MODE=external-rosa \
123+
HC_NAME=hc1 \
124+
HC_NAMESPACE=xyz \
125+
SC_KUBECONFIG=/path/to/service/cluster/kubeconfig \
126+
make test-e2e
127+
```
128+
129+
113130
### Run tests with custom images
114131

115132
You can run tests with custom images by setting the following environment variables:

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ require (
2222
k8s.io/apimachinery v0.33.3
2323
k8s.io/client-go v0.33.3
2424
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
25+
open-cluster-management.io/api v0.15.0
2526
sigs.k8s.io/controller-runtime v0.21.0
2627
)
2728

@@ -194,6 +195,7 @@ require (
194195
google.golang.org/protobuf v1.36.6 // indirect
195196
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
196197
gopkg.in/inf.v0 v0.9.1 // indirect
198+
gopkg.in/yaml.v2 v2.4.0 // indirect
197199
gopkg.in/yaml.v3 v3.0.1 // indirect
198200
k8s.io/cli-runtime v0.33.3 // indirect
199201
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect

go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,6 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+
739739
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
740740
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
741741
github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E=
742-
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
743742
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
744743
github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg=
745744
github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
@@ -1567,6 +1566,8 @@ k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
15671566
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
15681567
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
15691568
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
1569+
open-cluster-management.io/api v0.15.0 h1:lRee1KOlGHZb2scTA7ff9E9Fxt2hJc7jpkHnaCbvkOU=
1570+
open-cluster-management.io/api v0.15.0/go.mod h1:9erZEWEn4bEqh0nIX2wA7f/s3KCuFycQdBrPrRzi0QM=
15701571
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
15711572
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
15721573
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

tests/e2e/backup_restore_cli_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ var _ = ginkgo.Describe("Backup and restore tests via OADP CLI", ginkgo.Label("c
231231

232232
var _ = ginkgo.AfterAll(func() {
233233
// Same cleanup as original
234-
waitOADPReadiness(lib.KOPIA)
234+
NewOADPDeploymentOperationDefault().Deploy(lib.KOPIA)
235235

236236
log.Printf("Creating real DataProtectionTest before must-gather")
237237
bsls, err := dpaCR.ListBSLs()

tests/e2e/backup_restore_suite_test.go

Lines changed: 105 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,108 @@ type ApplicationBackupRestoreCase struct {
4343
PvcSuffixName string
4444
}
4545

46+
// OADPDeploymentOperation is a helper to deploy OADP resources for a given backup restore type.
47+
type OADPDeploymentOperation struct {
48+
CreateDPA bool
49+
CreateVolumeSnapshotClass bool
50+
CreateBSL bool
51+
CreateVSL bool
52+
}
53+
54+
func NewOADPDeploymentOperationDefault() *OADPDeploymentOperation {
55+
return &OADPDeploymentOperation{
56+
CreateDPA: true,
57+
CreateVolumeSnapshotClass: true,
58+
CreateBSL: false,
59+
CreateVSL: false,
60+
}
61+
}
62+
63+
func NewOADPDeploymentOperationROSA() *OADPDeploymentOperation {
64+
return &OADPDeploymentOperation{
65+
CreateDPA: false,
66+
CreateVolumeSnapshotClass: false,
67+
CreateBSL: true,
68+
CreateVSL: true,
69+
}
70+
}
71+
72+
func (o *OADPDeploymentOperation) Deploy(backupRestoreType lib.BackupRestoreType) {
73+
if o.CreateDPA {
74+
err := dpaCR.CreateOrUpdate(dpaCR.Build(backupRestoreType))
75+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
76+
77+
log.Print("Checking if DPA is reconciled")
78+
gomega.Eventually(dpaCR.IsReconciledTrue(), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
79+
80+
if backupRestoreType == lib.KOPIA || backupRestoreType == lib.CSIDataMover {
81+
log.Printf("Waiting for Node Agent pods to be running")
82+
gomega.Eventually(lib.AreNodeAgentPodsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
83+
}
84+
}
85+
86+
log.Printf("Waiting for Velero Pod to be running")
87+
gomega.Eventually(lib.VeleroPodIsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
88+
89+
if o.CreateVolumeSnapshotClass {
90+
if backupRestoreType == lib.CSI || backupRestoreType == lib.CSIDataMover {
91+
if provider == "aws" || provider == "ibmcloud" || provider == "gcp" || provider == "azure" || provider == "openstack" {
92+
log.Printf("Creating VolumeSnapshotClass for CSI backuprestore")
93+
snapshotClassPath := fmt.Sprintf("./sample-applications/snapclass-csi/%s.yaml", provider)
94+
err := lib.InstallApplication(dpaCR.Client, snapshotClassPath)
95+
gomega.Expect(err).ToNot(gomega.HaveOccurred())
96+
}
97+
}
98+
}
99+
100+
if o.CreateBSL {
101+
log.Print("Creating BSL")
102+
err := dpaCR.CreateBackupStorageLocation()
103+
gomega.Expect(err).ToNot(gomega.HaveOccurred())
104+
}
105+
106+
log.Print("Checking if BSL is available")
107+
gomega.Eventually(dpaCR.BSLsAreAvailable(), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
108+
109+
if o.CreateVSL {
110+
log.Print("Creating VSL")
111+
err := dpaCR.CreateVolumeSnapshotLocation()
112+
gomega.Expect(err).ToNot(gomega.HaveOccurred())
113+
// Velero does not change status of VSL objects.
114+
// Users can only confirm if VSLs are correct configured when running a native snapshot backup/restore
115+
}
116+
}
117+
118+
func (o *OADPDeploymentOperation) Undeploy(backupRestoreType lib.BackupRestoreType) {
119+
if o.CreateVolumeSnapshotClass {
120+
if backupRestoreType == lib.CSI || backupRestoreType == lib.CSIDataMover {
121+
log.Printf("Deleting VolumeSnapshot for CSI backuprestore")
122+
snapshotClassPath := fmt.Sprintf("./sample-applications/snapclass-csi/%s.yaml", provider)
123+
err := lib.UninstallApplication(dpaCR.Client, snapshotClassPath)
124+
gomega.Expect(err).ToNot(gomega.HaveOccurred())
125+
}
126+
}
127+
128+
if o.CreateDPA {
129+
log.Printf("Deleting DPA")
130+
err := dpaCR.Delete()
131+
gomega.Expect(err).ToNot(gomega.HaveOccurred())
132+
gomega.Eventually(dpaCR.IsDeleted(), time.Minute*2, time.Second*5).Should(gomega.BeTrue())
133+
}
134+
135+
if o.CreateBSL {
136+
log.Printf("Deleting BSL")
137+
err := dpaCR.DeleteBackupStorageLocation()
138+
gomega.Expect(err).ToNot(gomega.HaveOccurred())
139+
}
140+
141+
if o.CreateVSL {
142+
log.Printf("Deleting VSL")
143+
err := dpaCR.DeleteVolumeSnapshotLocation()
144+
gomega.Expect(err).ToNot(gomega.HaveOccurred())
145+
}
146+
}
147+
46148
func todoListReady(preBackupState bool, twoVol bool, database string) VerificationFunction {
47149
return VerificationFunction(func(ocClient client.Client, namespace string) error {
48150
log.Printf("checking for the NAMESPACE: %s", namespace)
@@ -72,40 +174,10 @@ func parksAppReady(preBackupState bool, twoVol bool, DCReadyCheck bool) Verifica
72174
})
73175
}
74176

75-
func waitOADPReadiness(backupRestoreType lib.BackupRestoreType) {
76-
err := dpaCR.CreateOrUpdate(dpaCR.Build(backupRestoreType))
77-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
78-
79-
log.Print("Checking if DPA is reconciled")
80-
gomega.Eventually(dpaCR.IsReconciledTrue(), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
81-
82-
log.Printf("Waiting for Velero Pod to be running")
83-
gomega.Eventually(lib.VeleroPodIsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
84-
85-
if backupRestoreType == lib.KOPIA || backupRestoreType == lib.CSIDataMover {
86-
log.Printf("Waiting for Node Agent pods to be running")
87-
gomega.Eventually(lib.AreNodeAgentPodsRunning(kubernetesClientForSuiteRun, namespace), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
88-
}
89-
90-
// Velero does not change status of VSL objects. Users can only confirm if VSLs are correct configured when running a native snapshot backup/restore
91-
92-
log.Print("Checking if BSL is available")
93-
gomega.Eventually(dpaCR.BSLsAreAvailable(), time.Minute*3, time.Second*5).Should(gomega.BeTrue())
94-
}
95-
96177
func prepareBackupAndRestore(brCase BackupRestoreCase, updateLastInstallTime func()) (string, string) {
97178
updateLastInstallTime()
98179

99-
waitOADPReadiness(brCase.BackupRestoreType)
100-
101-
if brCase.BackupRestoreType == lib.CSI || brCase.BackupRestoreType == lib.CSIDataMover {
102-
if provider == "aws" || provider == "ibmcloud" || provider == "gcp" || provider == "azure" || provider == "openstack" {
103-
log.Printf("Creating VolumeSnapshotClass for CSI backuprestore of %s", brCase.Name)
104-
snapshotClassPath := fmt.Sprintf("./sample-applications/snapclass-csi/%s.yaml", provider)
105-
err := lib.InstallApplication(dpaCR.Client, snapshotClassPath)
106-
gomega.Expect(err).ToNot(gomega.HaveOccurred())
107-
}
108-
}
180+
NewOADPDeploymentOperationDefault().Deploy(brCase.BackupRestoreType)
109181

110182
// TODO: check registry deployments are deleted
111183
// TODO: check S3 for images
@@ -319,22 +391,10 @@ func getFailedTestLogs(oadpNamespace string, appNamespace string, installTime ti
319391
func tearDownBackupAndRestore(brCase BackupRestoreCase, installTime time.Time, report ginkgo.SpecReport) {
320392
log.Println("Post backup and restore state: ", report.State.String())
321393
gatherLogs(brCase, installTime, report)
322-
tearDownDPAResources(brCase)
394+
NewOADPDeploymentOperationDefault().Undeploy(brCase.BackupRestoreType)
323395
deleteNamespace(brCase.Namespace)
324396
}
325397

326-
func tearDownDPAResources(brCase BackupRestoreCase) {
327-
if brCase.BackupRestoreType == lib.CSI || brCase.BackupRestoreType == lib.CSIDataMover {
328-
log.Printf("Deleting VolumeSnapshot for CSI backuprestore of %s", brCase.Name)
329-
snapshotClassPath := fmt.Sprintf("./sample-applications/snapclass-csi/%s.yaml", provider)
330-
err := lib.UninstallApplication(dpaCR.Client, snapshotClassPath)
331-
gomega.Expect(err).ToNot(gomega.HaveOccurred())
332-
}
333-
334-
err := dpaCR.Delete()
335-
gomega.Expect(err).ToNot(gomega.HaveOccurred())
336-
}
337-
338398
func gatherLogs(brCase BackupRestoreCase, installTime time.Time, report ginkgo.SpecReport) {
339399
if report.Failed() {
340400
knownFlake = lib.CheckIfFlakeOccurred(accumulatedTestLogs)
@@ -366,7 +426,7 @@ var _ = ginkgo.Describe("Backup and restore tests", ginkgo.Ordered, func() {
366426
var _ = ginkgo.AfterAll(func() {
367427
// DPA just needs to have BSL so gathering of backups/restores logs/describe work
368428
// using kopia to collect more info (DaemonSet)
369-
waitOADPReadiness(lib.KOPIA)
429+
NewOADPDeploymentOperationDefault().Deploy(lib.KOPIA)
370430

371431
//DPT Test and MustGather should be paired together
372432
log.Printf("skipMustGather: %v", skipMustGather)

tests/e2e/e2e_suite_test.go

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,31 @@ import (
66
"os"
77
"strconv"
88
"testing"
9-
"time"
109

1110
"github.com/onsi/ginkgo/v2"
1211
"github.com/onsi/gomega"
1312
"k8s.io/apimachinery/pkg/util/uuid"
1413
"k8s.io/client-go/dynamic"
1514
"k8s.io/client-go/kubernetes"
1615
"k8s.io/client-go/rest"
16+
"k8s.io/client-go/tools/clientcmd"
17+
workv1 "open-cluster-management.io/api/work/v1"
1718
ctrl "sigs.k8s.io/controller-runtime"
1819
"sigs.k8s.io/controller-runtime/pkg/client"
1920
"sigs.k8s.io/controller-runtime/pkg/client/config"
2021
"sigs.k8s.io/controller-runtime/pkg/log/zap"
2122

2223
"github.com/openshift/oadp-operator/tests/e2e/lib"
24+
libhcp "github.com/openshift/oadp-operator/tests/e2e/lib/hcp"
2325
)
2426

2527
var (
2628
// Common vars obtained from flags passed in ginkgo.
27-
bslCredFile, namespace, instanceName, provider, vslCredFile, settings, artifact_dir string
28-
flakeAttempts int64
29+
bslCredFile, namespace, instanceName, provider, vslCredFile, settings, artifact_dir, scKubeconfig string
30+
flakeAttempts int64
2931

3032
kubernetesClientForSuiteRun *kubernetes.Clientset
33+
crClientForServiceCluster client.Client
3134
runTimeClientForSuiteRun client.Client
3235
dynamicClientForSuiteRun dynamic.Interface
3336

@@ -37,6 +40,7 @@ var (
3740
vslSecretName string
3841

3942
kubeConfig *rest.Config
43+
kubeConfigForSC *rest.Config
4044
knownFlake bool
4145
accumulatedTestLogs []string
4246

@@ -45,6 +49,7 @@ var (
4549
skipMustGather bool
4650
hcBackupRestoreMode string
4751
hcName string
52+
hcNamespace string
4853
)
4954

5055
func init() {
@@ -63,6 +68,8 @@ func init() {
6368
flag.BoolVar(&skipMustGather, "skipMustGather", false, "avoid errors with local execution and cluster architecture")
6469
flag.StringVar(&hcBackupRestoreMode, "hc_backup_restore_mode", string(HCModeCreate), "Type of HC test to run")
6570
flag.StringVar(&hcName, "hc_name", "", "Name of the HostedCluster to use for HCP tests")
71+
flag.StringVar(&hcNamespace, "hc_namespace", libhcp.ClustersNamespace, "Namespace for HostedClusters")
72+
flag.StringVar(&scKubeconfig, "sc_kubeconfig", "", "Path to kubeconfig file for Service Cluster. Only used for HCP tests and ROSA.")
6673

6774
// helps with launching debug sessions from IDE
6875
if os.Getenv("E2E_USE_ENV_FLAGS") == "true" {
@@ -127,6 +134,9 @@ func init() {
127134
if os.Getenv("HC_NAME") != "" {
128135
hcName = os.Getenv("HC_NAME")
129136
}
137+
if os.Getenv("SC_KUBECONFIG") != "" {
138+
scKubeconfig = os.Getenv("SC_KUBECONFIG")
139+
}
130140
}
131141
}
132142

@@ -144,6 +154,20 @@ func TestOADPE2E(t *testing.T) {
144154
kubernetesClientForSuiteRun, err = kubernetes.NewForConfig(kubeConfig)
145155
gomega.Expect(err).NotTo(gomega.HaveOccurred())
146156

157+
// Set up kubeConfigForSC if sc_kubeconfig flag is provided
158+
if scKubeconfig != "" {
159+
kubeConfigForSC, err = clientcmd.BuildConfigFromFlags("", scKubeconfig)
160+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
161+
162+
kubeConfigForSC.QPS = kubeConfig.QPS
163+
kubeConfigForSC.Burst = kubeConfig.Burst
164+
165+
scheme := lib.Scheme
166+
workv1.Install(scheme)
167+
crClientForServiceCluster, err = client.New(kubeConfigForSC, client.Options{Scheme: scheme})
168+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
169+
}
170+
147171
runTimeClientForSuiteRun, err = client.New(kubeConfig, client.Options{Scheme: lib.Scheme})
148172
gomega.Expect(err).NotTo(gomega.HaveOccurred())
149173

@@ -213,8 +237,9 @@ var _ = ginkgo.AfterSuite(func() {
213237
gomega.Expect(err).ToNot(gomega.HaveOccurred())
214238
err = lib.DeleteSecret(kubernetesClientForSuiteRun, namespace, bslSecretNameWithCarriageReturn)
215239
gomega.Expect(err).ToNot(gomega.HaveOccurred())
216-
log.Printf("Deleting DPA")
217-
err = dpaCR.Delete()
218-
gomega.Expect(err).ToNot(gomega.HaveOccurred())
219-
gomega.Eventually(dpaCR.IsDeleted(), time.Minute*2, time.Second*5).Should(gomega.BeTrue())
240+
oadpDeploymentOperation := NewOADPDeploymentOperationDefault()
241+
if HCBackupRestoreMode(hcBackupRestoreMode) == HCModeExternalROSA {
242+
oadpDeploymentOperation = NewOADPDeploymentOperationROSA()
243+
}
244+
oadpDeploymentOperation.Undeploy(lib.KOPIA)
220245
})

0 commit comments

Comments
 (0)