File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,16 @@ function isError<T>(result: Result<T>): result is { error: any } {
99 return ( result as { error : any } ) . error !== undefined ;
1010}
1111
12- type LocalPersistentVolume = V1PersistentVolume & {
12+ export enum VolumeType {
13+ Hardware = 'Hardware' ,
14+ Virtual = 'Virtual' ,
15+ }
16+
17+ export type LocalPersistentVolume = V1PersistentVolume & {
1318 IP : string ;
1419 devicePath : string ;
1520 nodeName : string ;
16- volumeType : 'rawBlockDevice' | 'lvmLogicalVolume' | 'sparseLoopDevice' ;
21+ volumeType : VolumeType ;
1722} ;
1823
1924export default class Metalk8sLocalVolumeProvider {
@@ -59,10 +64,8 @@ export default class Metalk8sLocalVolumeProvider {
5964 item . spec ?. rawBlockDevice ?. devicePath || item . metadata [ 'name' ] ,
6065 nodeName : item . spec . nodeName ,
6166 volumeType : item . spec . rawBlockDevice
62- ? ( 'rawBlockDevice' as 'rawBlockDevice' )
63- : item . spec . lvmLogicalVolume
64- ? ( 'lvmLogicalVolume' as 'lvmLogicalVolume' )
65- : ( 'sparseLoopDevice' as 'sparseLoopDevice' ) ,
67+ ? VolumeType . Hardware
68+ : VolumeType . Virtual ,
6669 } ,
6770 ] ;
6871 } , [ ] as LocalPersistentVolume [ ] ) ;
You can’t perform that action at this time.
0 commit comments