@@ -194,27 +194,6 @@ export class Component extends OpenShiftItem {
194194
195195 @vsCommand ( 'openshift.component.dev.onPodman' )
196196 static async devOnPodman ( component : ComponentWorkspaceFolder ) {
197- if ( workspace . getConfiguration ( 'openshiftToolkit' ) . get ( 'devModeRunOnPodman' ) ) {
198- let choice = 'Cancel' ;
199- do {
200- const choices = [ 'About Podman' , 'Continue' , 'Continue and don\'t ask again' ] ;
201- choice = await window . showWarningMessage (
202- 'The command \'Start Dev on Podman\' is experimental. It requires Podman to be installed and configured. It isn\'t guaranteed to work.' ,
203- ...choices ) ;
204- switch ( choice ) {
205- case choices [ 0 ] : // open link to external site with podman documentation
206- await commands . executeCommand ( 'vscode.open' , Uri . parse ( 'https://docs.podman.io/en/latest/index.html' ) ) ;
207- break ;
208- case choices [ 1 ] : // continue with execution
209- break ;
210- case choices [ 2 ] : // save request to not show warning again
211- await workspace . getConfiguration ( 'openshiftToolkit' ) . update ( 'devModeRunOnPodman' , false ) ;
212- break ;
213- default :
214- return ;
215- }
216- } while ( choice === 'About Podman' )
217- }
218197 return Component . dev ( component , 'podman' ) ;
219198 }
220199
@@ -390,10 +369,14 @@ export class Component extends OpenShiftItem {
390369 . get < boolean > ( 'useWebviewInsteadOfTerminalView' ) ;
391370 }
392371
393- static createExperimentalEnv ( componentFolder ) {
372+ static createExperimentalEnv ( componentFolder : ComponentWorkspaceFolder ) {
394373 return Component . getComponentDevState ( componentFolder ) . runOn ? { ODO_EXPERIMENTAL_MODE : 'true' } : { } ;
395374 }
396375
376+ static getDevPlatform ( componentFolder : ComponentWorkspaceFolder ) : string {
377+ return Component . getComponentDevState ( componentFolder ) . runOn ;
378+ }
379+
397380 @vsCommand ( 'openshift.component.describe' , true )
398381 static async describe ( componentFolder : ComponentWorkspaceFolder ) : Promise < string > {
399382 const command = Command . describeComponent ;
@@ -407,11 +390,12 @@ export class Component extends OpenShiftItem {
407390 @vsCommand ( 'openshift.component.log' , true )
408391 static log ( componentFolder : ComponentWorkspaceFolder ) : Promise < string > {
409392 const componentName = componentFolder . component . devfileData . devfile . metadata . name ;
393+ const showLogCmd = Command . showLog ( Component . getDevPlatform ( componentFolder ) ) ;
410394 if ( Component . isUsingWebviewEditor ( ) ) {
411- LogViewLoader . loadView ( `${ componentName } Log` , Command . showLog , componentFolder , Component . createExperimentalEnv ( componentFolder ) ) ;
395+ LogViewLoader . loadView ( `${ componentName } Log` , showLogCmd , componentFolder ) ;
412396 } else {
413397 void Component . odo . executeInTerminal (
414- Command . showLog ( ) ,
398+ showLogCmd ,
415399 componentFolder . contextPath ,
416400 `OpenShift: Show '${ componentName } ' Component Log` ) ;
417401 }
@@ -421,11 +405,12 @@ export class Component extends OpenShiftItem {
421405 @vsCommand ( 'openshift.component.followLog' , true )
422406 static followLog ( componentFolder : ComponentWorkspaceFolder ) : Promise < string > {
423407 const componentName = componentFolder . component . devfileData . devfile . metadata . name ;
408+ const showLogCmd = Command . showLogAndFollow ( Component . getDevPlatform ( componentFolder ) ) ;
424409 if ( Component . isUsingWebviewEditor ( ) ) {
425- LogViewLoader . loadView ( `${ componentName } Follow Log` , Command . showLogAndFollow , componentFolder ) ;
410+ LogViewLoader . loadView ( `${ componentName } Follow Log` , showLogCmd , componentFolder ) ;
426411 } else {
427412 void Component . odo . executeInTerminal (
428- Command . showLogAndFollow ( ) ,
413+ showLogCmd ,
429414 componentFolder . contextPath ,
430415 `OpenShift: Follow '${ componentName } ' Component Log` ) ;
431416 }
0 commit comments