Skip to content

Commit 96f1b48

Browse files
committed
Add Support for Restoring OCS Operator CRs in ODF CLI
Signed-off-by: Oded Viner <[email protected]>
1 parent 1629ef0 commit 96f1b48

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cmd/odf/restore/crds.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package restore
22

33
import (
44
"github.com/red-hat-storage/odf-cli/cmd/odf/root"
5+
"github.com/rook/kubectl-rook-ceph/pkg/crds"
56
"github.com/rook/kubectl-rook-ceph/pkg/k8sutil"
67
pkgrestore "github.com/rook/kubectl-rook-ceph/pkg/restore"
78
"github.com/spf13/cobra"
@@ -20,7 +21,16 @@ var deletedCmd = &cobra.Command{
2021
},
2122
Run: func(cmd *cobra.Command, args []string) {
2223
k8sutil.SetDeploymentScale(cmd.Context(), root.ClientSets.Kube, root.OperatorNamespace, "ocs-operator", 0)
23-
pkgrestore.RestoreCrd(cmd.Context(), root.ClientSets, root.OperatorNamespace, root.StorageClusterNamespace, args)
24+
var groupName string
25+
var versionResource string
26+
if args[0] == "storageclusters" {
27+
groupName = "ocs.openshift.io"
28+
versionResource = "v1"
29+
} else {
30+
groupName = crds.CephRookIoGroup
31+
versionResource = crds.CephRookResourcesVersion
32+
}
33+
pkgrestore.RestoreCrd(cmd.Context(), root.ClientSets, root.OperatorNamespace, root.StorageClusterNamespace, groupName, versionResource, args)
2434
k8sutil.SetDeploymentScale(cmd.Context(), root.ClientSets.Kube, root.OperatorNamespace, "ocs-operator", 1)
2535

2636
},

0 commit comments

Comments
 (0)