Skip to content

Commit c8b2039

Browse files
committed
.k8.>.K0014.
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent fa49246 commit c8b2039

File tree

8 files changed

+29
-29
lines changed

8 files changed

+29
-29
lines changed

src/commands/account.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class AccountCommand extends BaseCommand {
191191
title: 'Prepare for account key updates',
192192
task: async ctx => {
193193
const namespace = await resolveNamespaceFromDeployment(this.localConfig, this.configManager, task);
194-
const secrets = await self.k8.secrets().list(namespace, ['solo.hedera.com/account-id']);
194+
const secrets = await self.K0014.secrets().list(namespace, ['solo.hedera.com/account-id']);
195195
ctx.updateSecrets = secrets.length > 0;
196196

197197
ctx.accountsBatchedSet = self.accountManager.batchAccounts(this.systemAccounts);

src/commands/deployment.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class DeploymentCommand extends BaseCommand {
107107
title: 'Validate context',
108108
task: async (ctx, task) => {
109109
ctx.config.context = ctx.config.context ?? self.configManager.getFlag<string>(flags.context);
110-
const availableContexts = self.k8.contexts().list();
110+
const availableContexts = self.K0014.contexts().list();
111111

112112
if (availableContexts.includes(ctx.config.context)) {
113113
task.title += chalk.green(`- validated context ${ctx.config.context}`);
@@ -132,7 +132,7 @@ export class DeploymentCommand extends BaseCommand {
132132
subTasks.push({
133133
title: `Testing connection to cluster: ${chalk.cyan(cluster)}`,
134134
task: async (_, task) => {
135-
if (!(await self.k8.contexts().testContextConnection(context))) {
135+
if (!(await self.K0014.contexts().testContextConnection(context))) {
136136
task.title = `${task.title} - ${chalk.red('Cluster connection failed')}`;
137137

138138
throw new SoloError(`Cluster connection failed for: ${cluster}`);
@@ -199,9 +199,9 @@ export class DeploymentCommand extends BaseCommand {
199199

200200
const context = self.localConfig.clusterContextMapping[clusterName];
201201

202-
self.k8.contexts().updateCurrent(context);
202+
self.K0014.contexts().updateCurrent(context);
203203

204-
const namespaces = await self.k8.namespaces().list();
204+
const namespaces = await self.K0014.namespaces().list();
205205
const namespacesWithRemoteConfigs: NamespaceNameAsString[] = [];
206206

207207
for (const namespace of namespaces) {

src/commands/explorer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class ExplorerCommand extends BaseCommand {
190190

191191
ctx.config.valuesArg += await self.prepareValuesArg(ctx.config);
192192

193-
if (!(await self.k8.namespaces().has(ctx.config.namespace))) {
193+
if (!(await self.K0014.namespaces().has(ctx.config.namespace))) {
194194
throw new SoloError(`namespace ${ctx.config.namespace} does not exist`);
195195
}
196196

@@ -378,7 +378,7 @@ export class ExplorerCommand extends BaseCommand {
378378
self.configManager.update(argv);
379379
const namespace = await resolveNamespaceFromDeployment(this.localConfig, this.configManager, task);
380380

381-
if (!(await self.k8.namespaces().has(namespace))) {
381+
if (!(await self.K0014.namespaces().has(namespace))) {
382382
throw new SoloError(`namespace ${namespace} does not exist`);
383383
}
384384

src/commands/mirror_node.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export class MirrorNodeCommand extends BaseCommand {
297297
}
298298
}
299299

300-
if (!(await self.k8.namespaces().has(ctx.config.namespace))) {
300+
if (!(await self.K0014.namespaces().has(ctx.config.namespace))) {
301301
throw new SoloError(`namespace ${ctx.config.namespace} does not exist`);
302302
}
303303

@@ -562,7 +562,7 @@ export class MirrorNodeCommand extends BaseCommand {
562562
self.configManager.update(argv);
563563
const namespace = await resolveNamespaceFromDeployment(this.localConfig, this.configManager, task);
564564

565-
if (!(await self.k8.namespaces().has(namespace))) {
565+
if (!(await self.K0014.namespaces().has(namespace))) {
566566
throw new SoloError(`namespace ${namespace} does not exist`);
567567
}
568568

@@ -599,7 +599,7 @@ export class MirrorNodeCommand extends BaseCommand {
599599

600600
if (pvcs) {
601601
for (const pvc of pvcs) {
602-
await self.k8.pvcs().delete(PvcRef.of(ctx.config.namespace, PvcName.of(pvc)));
602+
await self.K0014.pvcs().delete(PvcRef.of(ctx.config.namespace, PvcName.of(pvc)));
603603
}
604604
}
605605
},

src/commands/network.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -457,22 +457,22 @@ export class NetworkCommand extends BaseCommand {
457457
await self.chartManager.uninstall(ctx.config.namespace, constants.SOLO_DEPLOYMENT_CHART);
458458

459459
if (ctx.config.deletePvcs) {
460-
const pvcs = await self.k8.pvcs().list(ctx.config.namespace, []);
460+
const pvcs = await self.K0014.pvcs().list(ctx.config.namespace, []);
461461
task.title = `Deleting PVCs in namespace ${ctx.config.namespace}`;
462462
if (pvcs) {
463463
for (const pvc of pvcs) {
464-
await self.k8.pvcs().delete(PvcRef.of(ctx.config.namespace, PvcName.of(pvc)));
464+
await self.K0014.pvcs().delete(PvcRef.of(ctx.config.namespace, PvcName.of(pvc)));
465465
}
466466
}
467467
}
468468

469469
if (ctx.config.deleteSecrets) {
470470
task.title = `Deleting secrets in namespace ${ctx.config.namespace}`;
471-
const secrets = await self.k8.secrets().list(ctx.config.namespace);
471+
const secrets = await self.K0014.secrets().list(ctx.config.namespace);
472472

473473
if (secrets) {
474474
for (const secret of secrets) {
475-
await self.k8.secrets().delete(ctx.config.namespace, secret.name);
475+
await self.K0014.secrets().delete(ctx.config.namespace, secret.name);
476476
}
477477
}
478478
}
@@ -768,7 +768,7 @@ export class NetworkCommand extends BaseCommand {
768768
networkDestroySuccess = false;
769769

770770
if (ctx.config.deletePvcs && ctx.config.deleteSecrets && ctx.config.force) {
771-
self.k8.namespaces().delete(ctx.config.namespace);
771+
self.K0014.namespaces().delete(ctx.config.namespace);
772772
} else {
773773
// If the namespace is not being deleted,
774774
// remove all components data from the remote configuration

src/commands/node/tasks.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -696,10 +696,10 @@ export class NodeCommandTasks {
696696

697697
// if directory data/upgrade/current/data/keys does not exist, then use data/upgrade/current
698698
let keyDir = `${constants.HEDERA_HAPI_PATH}/data/upgrade/current/data/keys`;
699-
if (!(await self.k8.containers().readByRef(containerRef).hasDir(keyDir))) {
699+
if (!(await self.K0014.containers().readByRef(containerRef).hasDir(keyDir))) {
700700
keyDir = `${constants.HEDERA_HAPI_PATH}/data/upgrade/current`;
701701
}
702-
const signedKeyFiles = (await self.k8.containers().readByRef(containerRef).listDir(keyDir)).filter(file =>
702+
const signedKeyFiles = (await self.K0014.containers().readByRef(containerRef).listDir(keyDir)).filter(file =>
703703
file.name.startsWith(constants.SIGNING_KEY_PREFIX),
704704
);
705705
await self.k8
@@ -755,10 +755,10 @@ export class NodeCommandTasks {
755755
const containerRef = ContainerRef.of(podRef, constants.ROOT_CONTAINER);
756756
for (const upgradeDir of upgradeDirectories) {
757757
// check if directory upgradeDir exist in root container
758-
if (!(await self.k8.containers().readByRef(containerRef).hasDir(upgradeDir))) {
758+
if (!(await self.K0014.containers().readByRef(containerRef).hasDir(upgradeDir))) {
759759
continue;
760760
}
761-
const files = await self.k8.containers().readByRef(containerRef).listDir(upgradeDir);
761+
const files = await self.K0014.containers().readByRef(containerRef).listDir(upgradeDir);
762762
// iterate all files and copy them to the staging directory
763763
for (const file of files) {
764764
if (file.name.endsWith('.mf')) {
@@ -870,7 +870,7 @@ export class NodeCommandTasks {
870870
const podRef = ctx.config.podRefs[nodeAlias];
871871
const containerRef = ContainerRef.of(podRef, constants.ROOT_CONTAINER);
872872
self.logger.debug(`Uploading state files to pod ${podRef.name}`);
873-
await self.k8.containers().readByRef(containerRef).copyTo(zipFile, `${constants.HEDERA_HAPI_PATH}/data`);
873+
await self.K0014.containers().readByRef(containerRef).copyTo(zipFile, `${constants.HEDERA_HAPI_PATH}/data`);
874874

875875
self.logger.info(
876876
`Deleting the previous state files in pod ${podRef.name} directory ${constants.HEDERA_HAPI_PATH}/data/saved`,

src/core/config/remote/remote_config_manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ export class RemoteConfigManager {
225225
argv: AnyObject,
226226
) {
227227
const self = this;
228-
self.k8.contexts().updateCurrent(context);
228+
self.K0014.contexts().updateCurrent(context);
229229

230-
if (!(await self.k8.namespaces().has(NamespaceName.of(namespace)))) {
231-
await self.k8.namespaces().create(NamespaceName.of(namespace));
230+
if (!(await self.K0014.namespaces().has(NamespaceName.of(namespace)))) {
231+
await self.K0014.namespaces().create(NamespaceName.of(namespace));
232232
}
233233

234234
const localConfigExists = this.localConfig.configFileExists();

test/unit/commands/network.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ describe('NetworkCommand unit tests', () => {
6161
opts.configManager.update(argv);
6262

6363
opts.K0011 = sinon.stub() as unknown as K0010;
64-
opts.k8.namespaces = sinon.stub().returns({
64+
opts.K0014.namespaces = sinon.stub().returns({
6565
has: sinon.stub().returns(true),
6666
});
67-
opts.k8.configMaps = sinon.stub() as unknown as K8ClientConfigMaps;
68-
opts.k8.configMaps.read = sinon.stub();
69-
opts.k8.pods = sinon.stub().returns({
67+
opts.K0014.configMaps = sinon.stub() as unknown as K8ClientConfigMaps;
68+
opts.K0014.configMaps.read = sinon.stub();
69+
opts.K0014.pods = sinon.stub().returns({
7070
waitForRunningPhase: sinon.stub(),
7171
waitForReadyStatus: sinon.stub(),
7272
});
73-
opts.k8.leases = sinon.stub().returns({
73+
opts.K0014.leases = sinon.stub().returns({
7474
read: sinon.stub(),
7575
});
7676
const clusterChecksStub = sinon.stub() as unknown as ClusterChecks;
@@ -79,7 +79,7 @@ describe('NetworkCommand unit tests', () => {
7979
clusterChecksStub.isCertManagerInstalled = sinon.stub();
8080
container.registerInstance(InjectTokens.ClusterChecks, clusterChecksStub);
8181

82-
opts.k8.logger = opts.logger;
82+
opts.K0014.logger = opts.logger;
8383
container.registerInstance(InjectTokens.K0001, opts.K0012);
8484

8585
opts.depManager = sinon.stub() as unknown as DependencyManager;

0 commit comments

Comments
 (0)