@@ -107,7 +107,7 @@ export class Command {
107107 static listCatalogServicesJson ( ) {
108108 return `${ Command . listCatalogServices ( ) } -o json` ;
109109 }
110- static listStorageNames ( project : string , app : string , component : string ) {
110+ static listStorageNames ( ) {
111111 return `odo storage list -o json` ;
112112 }
113113 static printOcVersion ( ) {
@@ -141,11 +141,11 @@ export class Command {
141141 return `odo login ${ clusterURL } --token=${ ocToken } --insecure-skip-tls-verify` ;
142142 }
143143 @verbose
144- static createStorage ( project : string , app : string , component : string , storageName : string , mountPath : string , storageSize : string ) {
145- return `odo storage create ${ storageName } --path=${ mountPath } --size=${ storageSize } --project ${ project } --app ${ app } --component ${ component } ` ;
144+ static createStorage ( storageName : string , mountPath : string , storageSize : string ) {
145+ return `odo storage create ${ storageName } --path=${ mountPath } --size=${ storageSize } }` ;
146146 }
147- static deleteStorage ( project : string , app : string , component : string , storage : string ) {
148- return `odo storage delete ${ storage } -f --project ${ project } --app ${ app } --component ${ component } ` ;
147+ static deleteStorage ( storage : string ) {
148+ return `odo storage delete ${ storage } -f` ;
149149 }
150150 static waitForStorageToBeGone ( project : string , app : string , storage : string ) {
151151 return `oc wait pvc/${ storage } -${ app } -pvc --for=delete --namespace ${ project } ` ;
@@ -761,10 +761,7 @@ export class OdoImpl implements Odo {
761761 }
762762
763763 public async _getStorageNames ( component : OpenShiftObject ) : Promise < OpenShiftObject [ ] > {
764- const app = component . getParent ( ) ;
765- const appName = app . getName ( ) ;
766- const projName = app . getParent ( ) . getName ( ) ;
767- const result : cliInstance . CliExitData = await this . execute ( Command . listStorageNames ( projName , appName , component . getName ( ) ) , component . contextPath ? component . contextPath . fsPath : Platform . getUserHomePath ( ) ) ;
764+ const result : cliInstance . CliExitData = await this . execute ( Command . listStorageNames ( ) , component . contextPath ? component . contextPath . fsPath : Platform . getUserHomePath ( ) ) ;
768765 return this . loadItems ( result ) . map < OpenShiftObject > ( ( value ) => new OpenShiftObjectImpl ( component , value . metadata . name , ContextType . STORAGE , false , OdoImpl . instance , TreeItemCollapsibleState . None ) ) ;
769766 }
770767
@@ -1022,13 +1019,13 @@ export class OdoImpl implements Odo {
10221019 }
10231020
10241021 public async createStorage ( component : OpenShiftObject , name : string , mountPath : string , size : string ) : Promise < OpenShiftObject > {
1025- await this . execute ( Command . createStorage ( component . getParent ( ) . getParent ( ) . getName ( ) , component . getParent ( ) . getName ( ) , component . getName ( ) , name , mountPath , size ) , component . contextPath . fsPath ) ;
1022+ await this . execute ( Command . createStorage ( name , mountPath , size ) , component . contextPath . fsPath ) ;
10261023 return this . insertAndReveal ( new OpenShiftObjectImpl ( component , name , ContextType . STORAGE , false , this , TreeItemCollapsibleState . None ) ) ;
10271024 }
10281025
10291026 public async deleteStorage ( storage : OpenShiftObject ) : Promise < OpenShiftObject > {
10301027 const component = storage . getParent ( ) ;
1031- await this . execute ( Command . deleteStorage ( component . getParent ( ) . getParent ( ) . getName ( ) , component . getParent ( ) . getName ( ) , component . getName ( ) , storage . getName ( ) ) , component . contextPath . fsPath ) ;
1028+ await this . execute ( Command . deleteStorage ( storage . getName ( ) ) , component . contextPath . fsPath ) ;
10321029 await this . execute ( Command . waitForStorageToBeGone ( storage . getParent ( ) . getParent ( ) . getParent ( ) . getName ( ) , storage . getParent ( ) . getParent ( ) . getName ( ) , storage . getName ( ) ) , process . cwd ( ) , false ) ;
10331030 return this . deleteAndRefresh ( storage ) ;
10341031 }
0 commit comments