@@ -29,6 +29,7 @@ import { Command } from './odo/command';
2929import { BuilderImage } from './odo/builderImage' ;
3030import { ImageStream } from './odo/imageStream' ;
3131import { VsCommandError } from './vscommand' ;
32+ import { Storage } from './odo/storage' ;
3233
3334import bs = require( 'binary-search' ) ;
3435
@@ -217,7 +218,7 @@ export class OpenShiftApplication extends OpenShiftObjectImpl {
217218}
218219
219220export class OpenShiftStorage extends OpenShiftObjectImpl {
220- constructor ( parent : OpenShiftObject , name : string ) {
221+ constructor ( parent : OpenShiftObject , name : string , public readonly mountPath : string ) {
221222 super ( parent , name , ContextType . STORAGE , 'storage-node.png' , TreeItemCollapsibleState . None ) ;
222223 }
223224
@@ -341,7 +342,7 @@ export interface Odo {
341342 getComponentChildren ( component : OpenShiftObject ) : Promise < OpenShiftObject [ ] > ;
342343 getRoutes ( component : OpenShiftObject ) : Promise < OpenShiftObject [ ] > ;
343344 getComponentPorts ( component : OpenShiftObject ) : Promise < odo . Port [ ] > ;
344- getStorageNames ( component : OpenShiftObject ) : Promise < OpenShiftObject [ ] > ;
345+ getStorageNames ( component : OpenShiftObject ) : Promise < OpenShiftStorage [ ] > ;
345346 getServiceTemplates ( ) : Promise < string [ ] > ;
346347 getServiceTemplatePlans ( svc : string ) : Promise < string [ ] > ;
347348 getServices ( application : OpenShiftObject ) : Promise < OpenShiftObject [ ] > ;
@@ -732,13 +733,13 @@ export class OdoImpl implements Odo {
732733 . map ( ( value ) => new OpenShiftUrl ( component , value . metadata . name ) ) ;
733734 }
734735
735- async getStorageNames ( component : OpenShiftObject ) : Promise < OpenShiftObject [ ] > {
736- return ( await this . getComponentChildren ( component ) ) . filter ( ( value ) => value . contextValue === ContextType . STORAGE ) ;
736+ async getStorageNames ( component : OpenShiftObject ) : Promise < OpenShiftStorage [ ] > {
737+ return ( await this . getComponentChildren ( component ) ) . filter ( ( value ) => value . contextValue === ContextType . STORAGE ) as OpenShiftStorage [ ] ;
737738 }
738739
739740 public async _getStorageNames ( component : OpenShiftObject ) : Promise < OpenShiftObject [ ] > {
740741 const result : cliInstance . CliExitData = await this . execute ( Command . listStorageNames ( ) , component . contextPath ? component . contextPath . fsPath : Platform . getUserHomePath ( ) ) ;
741- return this . loadItems < Storage > ( result ) . map < OpenShiftObject > ( ( value ) => new OpenShiftStorage ( component , value . metadata . name ) ) ;
742+ return this . loadItems < Storage > ( result ) . map < OpenShiftObject > ( ( value ) => new OpenShiftStorage ( component , value . metadata . name , value . spec . path ) ) ;
742743 }
743744
744745 public async getServiceTemplates ( ) : Promise < string [ ] > {
@@ -1003,7 +1004,7 @@ export class OdoImpl implements Odo {
10031004
10041005 public async createStorage ( component : OpenShiftObject , name : string , mountPath : string , size : string ) : Promise < OpenShiftObject > {
10051006 await this . execute ( Command . createStorage ( name , mountPath , size ) , component . contextPath . fsPath ) ;
1006- return this . insertAndReveal ( new OpenShiftStorage ( component , name ) ) ;
1007+ return this . insertAndReveal ( new OpenShiftStorage ( component , name , mountPath ) ) ;
10071008 }
10081009
10091010 public async deleteStorage ( storage : OpenShiftObject ) : Promise < OpenShiftObject > {
0 commit comments