@@ -19,23 +19,32 @@ import {type ContextCommandTasks} from './tasks.js';
19
19
import * as helpers from '../../core/helpers.js' ;
20
20
import * as constants from '../../core/constants.js' ;
21
21
import * as ContextFlags from './flags.js' ;
22
+ import { RemoteConfigTasks } from '../../core/config/remote/remote_config_tasks.js' ;
23
+ import type { RemoteConfigManager } from '../../core/config/remote/remote_config_manager.js' ;
24
+ import { connectConfigBuilder } from './configs.js' ;
22
25
23
26
export class ContextCommandHandlers implements CommandHandlers {
24
27
readonly parent : BaseCommand ;
25
28
readonly tasks : ContextCommandTasks ;
29
+ public readonly remoteConfigManager : RemoteConfigManager ;
30
+ private getConfig : any ;
26
31
27
- constructor ( parent : BaseCommand , tasks : ContextCommandTasks ) {
32
+ constructor ( parent : BaseCommand , tasks : ContextCommandTasks , remoteConfigManager : RemoteConfigManager ) {
28
33
this . parent = parent ;
29
34
this . tasks = tasks ;
35
+ this . remoteConfigManager = remoteConfigManager ;
36
+ this . getConfig = parent . getConfig . bind ( parent ) ;
30
37
}
31
38
32
39
async connect ( argv : any ) {
33
40
argv = helpers . addFlagsToArgv ( argv , ContextFlags . USE_FLAGS ) ;
34
41
35
42
const action = this . parent . commandActionBuilder (
36
43
[
37
- this . tasks . initialize ( argv ) ,
38
- this . parent . getLocalConfig ( ) . promptLocalConfigTask ( ) ,
44
+ this . tasks . initialize ( argv , connectConfigBuilder . bind ( this ) ) ,
45
+ this . parent . getLocalConfig ( ) . promptLocalConfigTask ( this . parent . getK8 ( ) ) ,
46
+ this . tasks . selectContext ( argv ) ,
47
+ RemoteConfigTasks . loadRemoteConfig . bind ( this ) ( argv ) ,
39
48
this . tasks . updateLocalConfig ( argv ) ,
40
49
] ,
41
50
{
0 commit comments