@@ -2,9 +2,7 @@ package ceph
2
2
3
3
import (
4
4
"github.com/red-hat-storage/odf-cli/cmd/odf/root"
5
- "github.com/rook/kubectl-rook-ceph/pkg/exec"
6
- "github.com/rook/kubectl-rook-ceph/pkg/k8sutil"
7
- "github.com/rook/kubectl-rook-ceph/pkg/logging"
5
+ "github.com/rook/kubectl-rook-ceph/pkg/rbd"
8
6
"github.com/spf13/cobra"
9
7
)
10
8
@@ -14,17 +12,16 @@ var RbdCmd = &cobra.Command{
14
12
Short : "call a 'rbd' CLI command with arbitrary args" ,
15
13
DisableFlagParsing : true ,
16
14
Args : cobra .MinimumNArgs (1 ),
17
- Run : func (cmd * cobra.Command , args []string ) {
18
- logging .Info ("running 'rbd' command with args: %v" , args )
19
- // verify operator pod is running
20
- _ , err := k8sutil .WaitForPodToRun (cmd .Context (), root .ClientSets .Kube , root .OperatorNamespace , "app=rook-ceph-operator" )
21
- if err != nil {
22
- logging .Fatal (err )
23
- }
15
+ }
24
16
25
- _ , err = exec .RunCommandInOperatorPod (cmd .Context (), root .ClientSets , cmd .Use , args , root .OperatorNamespace , root .StorageClusterNamespace , false )
26
- if err != nil {
27
- logging .Fatal (err )
28
- }
17
+ var listCmdRbd = & cobra.Command {
18
+ Use : "ls" ,
19
+ Short : "Print the list of rbd images." ,
20
+ Run : func (cmd * cobra.Command , args []string ) {
21
+ rbd .ListImages (cmd .Context (), root .ClientSets , root .OperatorNamespace , root .StorageClusterNamespace )
29
22
},
30
23
}
24
+
25
+ func init () {
26
+ RbdCmd .AddCommand (listCmdRbd )
27
+ }
0 commit comments