@@ -22,7 +22,6 @@ import (
22
22
"strings"
23
23
24
24
"github.com/minio/directpv/pkg/apis/directpv.min.io/types"
25
- directpvtypes "github.com/minio/directpv/pkg/apis/directpv.min.io/types"
26
25
"github.com/minio/directpv/pkg/ellipsis"
27
26
"github.com/minio/directpv/pkg/utils"
28
27
"github.com/spf13/cobra"
@@ -31,16 +30,16 @@ import (
31
30
var errInvalidLabel = errors .New ("invalid label" )
32
31
33
32
var driveStatusValues = []string {
34
- strings .ToLower (string (directpvtypes .DriveStatusError )),
35
- strings .ToLower (string (directpvtypes .DriveStatusLost )),
36
- strings .ToLower (string (directpvtypes .DriveStatusMoving )),
37
- strings .ToLower (string (directpvtypes .DriveStatusReady )),
38
- strings .ToLower (string (directpvtypes .DriveStatusRemoved )),
33
+ strings .ToLower (string (types .DriveStatusError )),
34
+ strings .ToLower (string (types .DriveStatusLost )),
35
+ strings .ToLower (string (types .DriveStatusMoving )),
36
+ strings .ToLower (string (types .DriveStatusReady )),
37
+ strings .ToLower (string (types .DriveStatusRemoved )),
39
38
}
40
39
41
40
var volumeStatusValues = []string {
42
- strings .ToLower (string (directpvtypes .VolumeStatusPending )),
43
- strings .ToLower (string (directpvtypes .VolumeStatusReady )),
41
+ strings .ToLower (string (types .VolumeStatusPending )),
42
+ strings .ToLower (string (types .VolumeStatusReady )),
44
43
}
45
44
46
45
var (
@@ -132,10 +131,10 @@ func setFlagOpts(cmd *cobra.Command) {
132
131
var (
133
132
wideOutput bool
134
133
135
- driveStatusSelectors []directpvtypes .DriveStatus
136
- driveIDSelectors []directpvtypes .DriveID
137
- volumeStatusSelectors []directpvtypes .VolumeStatus
138
- labelSelectors map [directpvtypes .LabelKey ]directpvtypes .LabelValue
134
+ driveStatusSelectors []types .DriveStatus
135
+ driveIDSelectors []types .DriveID
136
+ volumeStatusSelectors []types .VolumeStatus
137
+ labelSelectors map [types .LabelKey ]types .LabelValue
139
138
140
139
dryRunPrinter func (interface {})
141
140
)
@@ -181,7 +180,7 @@ func validateDriveNameArgs() error {
181
180
func validateDriveStatusArgs () error {
182
181
for i := range driveStatusArgs {
183
182
driveStatusArgs [i ] = strings .TrimSpace (driveStatusArgs [i ])
184
- status , err := directpvtypes .ToDriveStatus (driveStatusArgs [i ])
183
+ status , err := types .ToDriveStatus (driveStatusArgs [i ])
185
184
if err != nil {
186
185
return err
187
186
}
@@ -199,7 +198,7 @@ func validateDriveIDArgs() error {
199
198
if ! utils .IsUUID (driveIDArgs [i ]) {
200
199
return fmt .Errorf ("invalid drive ID %v" , driveIDArgs [i ])
201
200
}
202
- driveIDSelectors = append (driveIDSelectors , directpvtypes .DriveID (driveIDArgs [i ]))
201
+ driveIDSelectors = append (driveIDSelectors , types .DriveID (driveIDArgs [i ]))
203
202
}
204
203
return nil
205
204
}
@@ -255,7 +254,7 @@ func validateVolumeNameArgs() error {
255
254
func validateVolumeStatusArgs () error {
256
255
for i := range volumeStatusArgs {
257
256
volumeStatusArgs [i ] = strings .TrimSpace (volumeStatusArgs [i ])
258
- status , err := directpvtypes .ToVolumeStatus (volumeStatusArgs [i ])
257
+ status , err := types .ToVolumeStatus (volumeStatusArgs [i ])
259
258
if err != nil {
260
259
return err
261
260
}
@@ -266,7 +265,7 @@ func validateVolumeStatusArgs() error {
266
265
267
266
func validateLabelArgs () error {
268
267
if labelSelectors == nil {
269
- labelSelectors = make (map [directpvtypes .LabelKey ]directpvtypes .LabelValue )
268
+ labelSelectors = make (map [types .LabelKey ]types .LabelValue )
270
269
}
271
270
for i := range labelArgs {
272
271
tokens := strings .Split (labelArgs [i ], "=" )
0 commit comments