@@ -9,15 +9,13 @@ import { CliChannel } from '../cli';
99import { Oc } from '../oc/ocWrapper' ;
1010import { Odo } from '../odo/odoWrapper' ;
1111import { isTektonAware } from '../tekton/tekton' ;
12- import { Platform } from '../util/platform' ;
1312import { Progress } from '../util/progress' ;
1413import { OpenShiftTerminalApi , OpenShiftTerminalManager } from '../webview/openshift-terminal/openShiftTerminal' ;
1514import { ServerlessCommand , Utils } from './commands' ;
1615import { GitModel , getGitBranchInteractively , getGitRepoInteractively , getGitStateByPath } from './git/git' ;
1716import { isKnativeServingAware } from './knative' ;
1817import { multiStep } from './multiStepInput' ;
19- import { FunctionContent , FunctionObject , FunctionSession , InvokeFunction } from './types' ;
20- import { ServerlessFunctionView } from './view' ;
18+ import { FunctionContent , FunctionObject , FunctionSession } from './types' ;
2119
2220export class Functions {
2321
@@ -129,7 +127,7 @@ export class Functions {
129127 teminal : terminal
130128 } ;
131129 this . addSession ( context , session ) ;
132- ServerlessFunctionView . getInstance ( ) . refresh ( context ) ;
130+ void commands . executeCommand ( 'openshift.Serverless. refresh' , context ) ;
133131 }
134132
135133 private addSession ( context : FunctionObject , session : FunctionSession ) {
@@ -192,7 +190,7 @@ export class Functions {
192190 teminal : terminal
193191 }
194192 this . addSession ( context , session ) ;
195- ServerlessFunctionView . getInstance ( ) . refresh ( context ) ;
193+ void commands . executeCommand ( 'openshift.Serverless. refresh' , context ) ;
196194 this . buildTerminalMap . set ( terminalKey , terminal ) ;
197195 }
198196
@@ -218,7 +216,7 @@ export class Functions {
218216 teminal : terminal
219217 }
220218 this . addSession ( context , session ) ;
221- ServerlessFunctionView . getInstance ( ) . refresh ( context ) ;
219+ void commands . executeCommand ( 'openshift.Serverless. refresh' , context ) ;
222220 this . runTerminalMap . set ( `run-${ context . folderURI . fsPath } ` , terminal ) ;
223221 }
224222
@@ -240,14 +238,6 @@ export class Functions {
240238 } ) ;
241239 }
242240
243- public async getTemplates ( ) : Promise < any [ ] > {
244- const result = await Odo . Instance . execute ( ServerlessCommand . getTemplates ( ) , undefined , false ) ;
245- if ( result . error ) {
246- void window . showErrorMessage ( result . error . message ) ;
247- }
248- return JSON . parse ( result . stdout ) as any [ ] ;
249- }
250-
251241 public async deploy ( context : FunctionObject ) {
252242 const currentNamespace : string = await Oc . Instance . getActiveProject ( ) ;
253243 const yamlContent = await Utils . getFuncYamlContent ( context . folderURI . fsPath ) ;
@@ -309,17 +299,7 @@ export class Functions {
309299 teminal : terminal
310300 } ;
311301 this . addSession ( context , session ) ;
312- ServerlessFunctionView . getInstance ( ) . refresh ( context ) ;
313- }
314-
315- public async invoke ( functionName : string , invokeFunData : InvokeFunction ) : Promise < void > {
316- await OpenShiftTerminalManager . getInstance ( ) . createTerminal (
317- ServerlessCommand . invokeFunction ( invokeFunData ) ,
318- `Invoke: ${ functionName } ` ,
319- undefined , undefined , {
320- onExit : undefined
321- } , true
322- ) ;
302+ void commands . executeCommand ( 'openshift.Serverless.refresh' , context ) ;
323303 }
324304
325305 public async config ( title : string , context : FunctionObject , mode : string , isAdd = true ) {
@@ -377,16 +357,6 @@ export class Functions {
377357 } ) ;
378358 }
379359
380- public getDefaultImages ( name : string ) : string [ ] {
381- const imageList : string [ ] = [ ] ;
382- const defaultUsername = Platform . getEnv ( ) ;
383- const defaultQuayImage = `quay.io/${ Platform . getOS ( ) === 'win32' ? defaultUsername . USERNAME : defaultUsername . USER } /${ name } :latest` ;
384- const defaultDockerImage = `docker.io/${ Platform . getOS ( ) === 'win32' ? defaultUsername . USERNAME : defaultUsername . USER } /${ name } :latest` ;
385- imageList . push ( defaultQuayImage ) ;
386- imageList . push ( defaultDockerImage ) ;
387- return imageList ;
388- }
389-
390360 public async getImage ( folderURI : Uri ) : Promise < string > {
391361 const yamlContent = await Utils . getFuncYamlContent ( folderURI . fsPath ) ;
392362 if ( yamlContent ?. image && Functions . imageRegex . test ( yamlContent . image ) ) {
0 commit comments