16
16
*/
17
17
import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer' ;
18
18
import chalk from 'chalk' ;
19
- import { Listr , type ListrTask } from 'listr2' ;
19
+ import { Listr } from 'listr2' ;
20
20
import { IllegalArgumentError , MissingArgumentError , SoloError } from '../core/errors.js' ;
21
21
import { BaseCommand } from './base.js' ;
22
22
import { Flags as flags } from './flags.js' ;
@@ -40,6 +40,8 @@ import {EnvoyProxyComponent} from '../core/config/remote/components/envoy_proxy_
40
40
import { HaProxyComponent } from '../core/config/remote/components/ha_proxy_component.js' ;
41
41
import { v4 as uuidv4 } from 'uuid' ;
42
42
import * as Base64 from 'js-base64' ;
43
+ import type { SoloListrTask } from '../types/index.js' ;
44
+ import type { Namespace } from '../core/config/remote/types.js' ;
43
45
44
46
export interface NetworkDeployConfigClass {
45
47
applicationEnv : string ;
@@ -772,10 +774,15 @@ export class NetworkCommand extends BaseCommand {
772
774
self . logger . error ( message ) ;
773
775
self . logger . showUser ( chalk . red ( message ) ) ;
774
776
networkDestroySuccess = false ;
777
+
775
778
if ( ctx . config . deletePvcs && ctx . config . deleteSecrets && ctx . config . force ) {
776
779
self . k8 . deleteNamespace ( ctx . config . namespace ) ;
780
+ } else {
781
+ // If the namespace is not being deleted,
782
+ // remove all components data from the remote configuration
783
+ self . remoteConfigManager . deleteComponents ( ) ;
777
784
}
778
- } , constants . NETWORK_DESTROY_WAIT_TIMEOUT * 1000 ) ;
785
+ } , constants . NETWORK_DESTROY_WAIT_TIMEOUT * 1_000 ) ;
779
786
780
787
await self . destroyTask ( ctx , task ) ;
781
788
@@ -794,7 +801,7 @@ export class NetworkCommand extends BaseCommand {
794
801
795
802
try {
796
803
await tasks . run ( ) ;
797
- } catch ( e : Error | any ) {
804
+ } catch ( e : Error | unknown ) {
798
805
throw new SoloError ( 'Error destroying network' , e ) ;
799
806
} finally {
800
807
await lease . release ( ) ;
@@ -947,7 +954,7 @@ export class NetworkCommand extends BaseCommand {
947
954
}
948
955
949
956
/** Adds the consensus node, envoy and haproxy components to remote config. */
950
- public addNodesAndProxies ( ) : ListrTask < any , any , any > {
957
+ public addNodesAndProxies ( ) : SoloListrTask < { config : { namespace : Namespace ; nodeAliases : NodeAliases } } > {
951
958
return {
952
959
title : 'Add node and proxies to remote config' ,
953
960
skip : ( ) : boolean => ! this . remoteConfigManager . isLoaded ( ) ,
0 commit comments