@codiac.io/codiac-cli 1.2.223 → 1.2.225

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +1 -1
  2. package/dist/apis/codiac-api/common/api-client-base.js +28 -1
  3. package/dist/apis/codiac-api/common/api-client-base.js.map +1 -1
  4. package/dist/apis/codiac-api/gen/client.d.ts +717 -1
  5. package/dist/apis/codiac-api/gen/client.js +9265 -1490
  6. package/dist/apis/codiac-api/gen/client.js.map +1 -1
  7. package/dist/apis/codiac-api/gen/contracts.d.ts +480 -149
  8. package/dist/apis/codiac-api/gen/contracts.js +104 -27
  9. package/dist/apis/codiac-api/gen/contracts.js.map +1 -1
  10. package/dist/command-base-enterprise.d.ts +1 -2
  11. package/dist/command-base-enterprise.js +0 -12
  12. package/dist/command-base-enterprise.js.map +1 -1
  13. package/dist/commands/asset/create.d.ts +3 -2
  14. package/dist/commands/asset/create.js +10 -3
  15. package/dist/commands/asset/create.js.map +1 -1
  16. package/dist/commands/asset/destroy.d.ts +2 -0
  17. package/dist/commands/asset/destroy.js +36 -11
  18. package/dist/commands/asset/destroy.js.map +1 -1
  19. package/dist/commands/asset/helm.js +3 -1
  20. package/dist/commands/asset/helm.js.map +1 -1
  21. package/dist/commands/asset/list.d.ts +1 -1
  22. package/dist/commands/asset/list.js +2 -1
  23. package/dist/commands/asset/list.js.map +1 -1
  24. package/dist/commands/asset/probe/create.d.ts +5 -0
  25. package/dist/commands/asset/probe/create.js +77 -21
  26. package/dist/commands/asset/probe/create.js.map +1 -1
  27. package/dist/commands/asset/view.d.ts +8 -11
  28. package/dist/commands/asset/view.js +169 -137
  29. package/dist/commands/asset/view.js.map +1 -1
  30. package/dist/commands/config/add.d.ts +11 -2
  31. package/dist/commands/config/add.js +53 -6
  32. package/dist/commands/config/add.js.map +1 -1
  33. package/dist/commands/config/delete.js +1 -1
  34. package/dist/commands/config/delete.js.map +1 -1
  35. package/dist/commands/config/settings/get.js +1 -1
  36. package/dist/commands/config/settings/get.js.map +1 -1
  37. package/dist/commands/config/view.d.ts +5 -0
  38. package/dist/commands/config/view.js +41 -13
  39. package/dist/commands/config/view.js.map +1 -1
  40. package/dist/commands/deploy.js +7 -2
  41. package/dist/commands/deploy.js.map +1 -1
  42. package/dist/relay/relay-container.js +1 -1
  43. package/dist/uilogic/config-ui-utils.d.ts +24 -1
  44. package/dist/uilogic/config-ui-utils.js +91 -0
  45. package/dist/uilogic/config-ui-utils.js.map +1 -1
  46. package/dist/uilogic/enterprise-contextualizer.d.ts +7 -1
  47. package/dist/uilogic/enterprise-contextualizer.js +49 -2
  48. package/dist/uilogic/enterprise-contextualizer.js.map +1 -1
  49. package/oclif.manifest.json +113 -17
  50. package/package.json +2 -2
@@ -10,7 +10,6 @@ const SplitCmd = require('split-cmd');
10
10
  const request = require("request");
11
11
  const semver = require("semver");
12
12
  const k8s = require("@kubernetes/client-node");
13
- const codiac_relay_contracts_1 = require("@codiac.io/codiac-relay-contracts");
14
13
  const command_base_enterprise_1 = require("../../command-base-enterprise");
15
14
  const CodiacConstants = require("../../codiac-constants");
16
15
  const render = require("../../uilogic/render-methods");
@@ -29,6 +28,7 @@ const codiac_ops_common_1 = require("@codiac.io/codiac-ops-common");
29
28
  // const logUpdate = require("log-update");
30
29
  const log_update_wrapper_1 = require("../../log-update-wrapper");
31
30
  const codiac_constants_1 = require("../../codiac-constants");
31
+ const config_ui_utils_1 = require("../../uilogic/config-ui-utils");
32
32
  // const { selectFiles, COMPLETED, CANCELLED } = require('select-files-cli'); // gd js wo ts...
33
33
  // const { selectFiles, COMPLETED, CANCELLED } = require('../../uilogic/file-selector'); // gd js wo ts...
34
34
  /** The value provided as input that indicates
@@ -78,9 +78,19 @@ class AssetView extends command_base_enterprise_1.CommandBaseEnterprise {
78
78
  }
79
79
  return this._uiCloudPvd_backer;
80
80
  }
81
+ // --------------------------------------------------------------------
82
+ // Lazy-loaded properties
83
+ get configUtils() {
84
+ if (this._configUtils_backer === undefined) {
85
+ this._configUtils_backer = this.ioc.get(config_ui_utils_1.ConfigUiUtils);
86
+ }
87
+ return this._configUtils_backer;
88
+ }
89
+ // --------------------------------------------------------------------
81
90
  bootstrap() {
82
91
  super.bootstrap();
83
92
  cloud_provider_contextualizer_1.CloudProviderContextualizer.bootstrap(this.ioc); // (idempotent) this is a dependency of the configurators
93
+ this.ioc.bind(config_ui_utils_1.ConfigUiUtils).toSelf();
84
94
  }
85
95
  run() {
86
96
  var _a, _b, _c;
@@ -213,8 +223,8 @@ class AssetView extends command_base_enterprise_1.CommandBaseEnterprise {
213
223
  }
214
224
  // Retrieve the list of replicas for the given cabinet.
215
225
  let rootMap = yield this.getRootMap(partialReq.enterprise);
216
- let env = this.deriveEnvironmentFrom(partialReq.enterprise, partialReq.cabinet, rootMap); // this is fkng stupid. Put this value into the cab value
217
- let cabObj = this.getCabinetInfrx(partialReq.enterprise, env.name, partialReq.cabinet, rootMap);
226
+ let env = this.configUtils.deriveEnvironmentFrom(partialReq.enterprise, partialReq.cabinet, rootMap); // this is fkng stupid. Put this value into the cab value
227
+ let cabObj = this.configUtils.getCabinetInfrx(partialReq.enterprise, env.name, partialReq.cabinet, rootMap);
218
228
  if (cabObj.infrx == undefined || _.isEmpty(cabObj.infrx))
219
229
  throw new Error(`Cannot connect to cabinet ${cabObj.name}: it has no infrastructure record.`);
220
230
  let k8sObj = { namespace: cabObj.infrx.namespace };
@@ -283,9 +293,9 @@ class AssetView extends command_base_enterprise_1.CommandBaseEnterprise {
283
293
  // 1. Select Asset
284
294
  partialReq.asset = yield this.promptForAsset(enterprise.assets, partialReq.asset);
285
295
  // 2. Cabinet
286
- let cabObj = yield this.promptForCabinet(partialReq.enterprise, rootMap, partialReq.cabinet);
296
+ let [cabObj, enviro] = yield this.configUtils.promptForCabinet(partialReq.enterprise, rootMap, partialReq.cabinet);
287
297
  partialReq.cabinet = cabObj.name;
288
- partialReq.environment = this.deriveEnvironmentFrom(partialReq.enterprise, partialReq.cabinet, rootMap).name;
298
+ partialReq.environment = enviro; // this.deriveEnvironmentFrom(partialReq.enterprise, partialReq.cabinet, rootMap).name;
289
299
  let cluster = this.deriveClusterFrom(partialReq.enterprise, partialReq.environment, partialReq.cabinet, rootMap);
290
300
  // partialReq.cabinet = await this.establishCabinetContext(partialReq.cabinet);
291
301
  if (cabObj.infrx == undefined || _.isEmpty(cabObj.infrx))
@@ -380,9 +390,17 @@ class AssetView extends command_base_enterprise_1.CommandBaseEnterprise {
380
390
  return [execArgs, cmdArgs];
381
391
  case AssetContentType.config:
382
392
  this.enterpriseContextor.takeDefaults = this.takeDefaults;
383
- let rootPathName = (yield this.enterpriseContextor.promptForTargetFile(context.enterprise, context.asset, defaults === null || defaults === void 0 ? void 0 : defaults.rootPathName));
393
+ // let rootPathName = (await this.enterpriseContextor.promptForTargetFile(context.enterprise, context.asset, (<ConfigFileArgs | undefined>defaults)?.rootPathName))!;
394
+ let rootPathName = defaults === null || defaults === void 0 ? void 0 : defaults.rootPathName;
395
+ let configType = defaults === null || defaults === void 0 ? void 0 : defaults.configType;
396
+ let typeFileChanged;
397
+ let existingSettings;
398
+ [configType, rootPathName, existingSettings, typeFileChanged] = yield this.configUtils.promptForTypeAndFile(context.enterprise, context.asset, configType, rootPathName, undefined, true, false);
384
399
  let cfgArgs = { rootPathName: rootPathName };
385
- cmdArgs.push("-F", rootPathName);
400
+ if (rootPathName)
401
+ cmdArgs.push("-F", rootPathName);
402
+ if (configType)
403
+ cmdArgs.push("-T", configType);
386
404
  return [cfgArgs, cmdArgs];
387
405
  case AssetContentType.term:
388
406
  let termArgs = yield this.promptForTerminalOptions(defaults);
@@ -505,74 +523,67 @@ class AssetView extends command_base_enterprise_1.CommandBaseEnterprise {
505
523
  }
506
524
  });
507
525
  }
508
- promptForCabinet(enterprise, rootMap, defaultValue) {
509
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
510
- try {
511
- let output;
512
- // render cab tree with all lines selectable
513
- let cabTree = this.buildCabinetTree(rootMap);
514
- let choices = this.buildSelectChoicesFrom(cabTree);
515
- // ISSUES:
516
- // 0. Remove the freaking lines from the selected value.
517
- // 1. Remember the last cabinet (user's enterprise context).
518
- // 2. We should only render the cabinets that actually contain a deployment of the asset (or dim the others and loop back if selected)
519
- // 3. The picklist should render the cluster (provider, name, location)
520
- // 4. PERHAPS? The version of the asset running in the selected cabinet should get rendered (either in the picklist or after the cab is selected)
521
- /** If we changed the input they provided, we need their confirmation (whether or not they said takeDefaults) */
522
- const CAB_PREFIX = "cabinet|";
523
- let cabChoices = choices.filter(c => c.value.startsWith(CAB_PREFIX));
524
- let changedUserInput = false;
525
- if (cabChoices.length === 1) {
526
- if (defaultValue != cabChoices[0].value.slice(CAB_PREFIX.length)) {
527
- changedUserInput = !_.isEmpty(defaultValue);
528
- defaultValue = cabChoices[0].value.slice(CAB_PREFIX.length);
529
- }
530
- }
531
- let keep = this.takeDefaults;
532
- if (defaultValue && Boolean(choices.find(x => x.value === `${CAB_PREFIX}${defaultValue}`)) && (changedUserInput || !this.takeDefaults)) {
533
- keep = yield this._ui.promptConfirm("keepCabinet", `Cabinet: ${this._styler.hilite(defaultValue)} `);
534
- }
535
- if (keep && defaultValue !== undefined) {
536
- output = defaultValue;
537
- }
538
- else {
539
- let scope;
540
- let target;
541
- do {
542
- if (scope === "environment") {
543
- // we could just filter it down from here...
544
- }
545
- let selection = (yield this._ui.promptSelect("cabinet", "Cabinet: ", choices, false, false));
546
- let parts = selection.split("|");
547
- scope = parts[0];
548
- target = parts[1];
549
- } while (scope !== "cabinet"); // ensure they select a cabinet
550
- output = target;
551
- }
552
- let env = this.deriveEnvironmentFrom(enterprise, output, rootMap); // this is fkng stupid. Put this value into the cab value
553
- let cabObj = this.getCabinetInfrx(enterprise, env.name, output, rootMap);
554
- // return output;
555
- return cabObj;
556
- }
557
- catch (err) {
558
- throw (err);
559
- }
560
- });
561
- }
562
- deriveEnvironmentFrom(enterprise, cabinet, rootMap) {
563
- try {
564
- let ent = rootMap.enterprises.find(e => e.name === enterprise);
565
- if (ent === undefined)
566
- throw new Error(`Cannot find environment: did not recognize enterprise [${enterprise}]`);
567
- let enviro = ent.environments.find(x => x.cabinets.find(c => c.name === cabinet));
568
- if (enviro === undefined)
569
- throw new Error(`Cannot find environment: did not recognize cabinet [${cabinet}]`);
570
- return enviro;
571
- }
572
- catch (err) {
573
- throw err;
574
- }
575
- }
526
+ // private async promptForCabinet(enterprise: string, rootMap: RootMap, defaultValue?: string | undefined): Promise<CabinetClusterRoot> {
527
+ // try {
528
+ // let output: string;
529
+ // // render cab tree with all lines selectable
530
+ // let cabTree = this.buildCabinetTree(rootMap);
531
+ // let choices = this.buildSelectChoicesFrom(cabTree);
532
+ // // ISSUES:
533
+ // // 0. Remove the freaking lines from the selected value.
534
+ // // 1. Remember the last cabinet (user's enterprise context).
535
+ // // 2. We should only render the cabinets that actually contain a deployment of the asset (or dim the others and loop back if selected)
536
+ // // 3. The picklist should render the cluster (provider, name, location)
537
+ // // 4. PERHAPS? The version of the asset running in the selected cabinet should get rendered (either in the picklist or after the cab is selected)
538
+ // /** If we changed the input they provided, we need their confirmation (whether or not they said takeDefaults) */
539
+ // const CAB_PREFIX = "cabinet|";
540
+ // let cabChoices = choices.filter(c => c.value.startsWith(CAB_PREFIX));
541
+ // let changedUserInput = false;
542
+ // if (cabChoices.length === 1) {
543
+ // if (defaultValue != cabChoices[0].value.slice(CAB_PREFIX.length)) {
544
+ // changedUserInput = !_.isEmpty(defaultValue);
545
+ // defaultValue = cabChoices[0].value.slice(CAB_PREFIX.length);
546
+ // }
547
+ // }
548
+ // let keep = this.takeDefaults;
549
+ // if (defaultValue && Boolean(choices.find(x => x.value === `${CAB_PREFIX}${defaultValue}`)) && (changedUserInput || !this.takeDefaults)) {
550
+ // keep = await this._ui.promptConfirm("keepCabinet", `Cabinet: ${this._styler.hilite(defaultValue)} `);
551
+ // }
552
+ // if (keep && defaultValue !== undefined) {
553
+ // output = defaultValue;
554
+ // } else {
555
+ // let scope: string | undefined;
556
+ // let target: string | undefined;
557
+ // do {
558
+ // if (scope === "environment") {
559
+ // // we could just filter it down from here...
560
+ // }
561
+ // let selection = (await this._ui.promptSelect("cabinet", "Cabinet: ", choices, false, false))!;
562
+ // let parts = selection.split("|");
563
+ // scope = parts[0];
564
+ // target = parts[1];
565
+ // } while (scope !== "cabinet") // ensure they select a cabinet
566
+ // output = target;
567
+ // }
568
+ // let env = this.deriveEnvironmentFrom(enterprise, output, rootMap); // this is fkng stupid. Put this value into the cab value
569
+ // let cabObj = this.getCabinetInfrx(enterprise, env.name, output, rootMap);
570
+ // // return output;
571
+ // return cabObj;
572
+ // } catch (err) {
573
+ // throw (err);
574
+ // }
575
+ // }
576
+ // protected deriveEnvironmentFrom(enterprise: string, cabinet: string, rootMap: RootMap): EnvironmentRoot {
577
+ // try {
578
+ // let ent = rootMap.enterprises.find(e => e.name === enterprise);
579
+ // if (ent === undefined) throw new Error(`Cannot find environment: did not recognize enterprise [${enterprise}]`);
580
+ // let enviro = ent.environments.find(x => x.cabinets.find(c => c.name === cabinet));
581
+ // if (enviro === undefined) throw new Error(`Cannot find environment: did not recognize cabinet [${cabinet}]`);
582
+ // return enviro;
583
+ // } catch (err) {
584
+ // throw err;
585
+ // }
586
+ // }
576
587
  deriveClusterFrom(enterprise, environment, cabinet, rootMap) {
577
588
  try {
578
589
  let ent = rootMap.enterprises.find(e => e.name === enterprise);
@@ -617,62 +628,67 @@ class AssetView extends command_base_enterprise_1.CommandBaseEnterprise {
617
628
  throw err;
618
629
  }
619
630
  }
620
- /** sets each value to "scope|target".
621
- *
622
- * This is MOSTLY a COPY-PASTE from the CabinetList command!!! This view is prob gonna be pretty common - consider promoting it to a shared utility. */
623
- buildCabinetTree(rootMap, existings) {
624
- var _a, _b, _c, _d;
625
- let tree = [];
626
- for (let ent of rootMap.enterprises) {
627
- let entBranch = { text: `${ent.name} enterprise:`, value: `${codiac_relay_contracts_1.ScopeLevel.enterprise}|${ent.name}` };
628
- let entSetting = existings === null || existings === void 0 ? void 0 : existings.find(s => s.scope === codiac_relay_contracts_1.ScopeLevel.enterprise && s.target === ent.name);
629
- if (entSetting !== undefined) {
630
- let valueSuffix = this.ellipsis(35, (_a = entSetting.value) !== null && _a !== void 0 ? _a : "[set to undefined]");
631
- valueSuffix = `(${valueSuffix})`;
632
- entBranch.text = entBranch.text.concat(" ", this._styler.dim(valueSuffix));
633
- }
634
- for (let env of _.sortBy(ent.environments, e => e.sequence, e => e.name)) {
635
- let envBranch = { text: `${env.name}`, value: `${codiac_relay_contracts_1.ScopeLevel.environment}|${env.name}` };
636
- let envSetting = existings === null || existings === void 0 ? void 0 : existings.find(s => s.scope === codiac_relay_contracts_1.ScopeLevel.environment && s.target === env.name);
637
- if (envSetting !== undefined) {
638
- let valueSuffix = this.ellipsis(35, (_b = envSetting.value) !== null && _b !== void 0 ? _b : "[set to undefined]");
639
- valueSuffix = `(${valueSuffix})`;
640
- envBranch.text = envBranch.text.concat(" ", this._styler.dim(valueSuffix));
641
- }
642
- for (let cab of env.cabinets) {
643
- // let cwg = rootMap.clusters.find(c => c.name === cab.cluster);
644
- // let clusterDesc = cwg ? ` (${cab.cluster}, ${cwg.provider} ${cwg.locationName})` : "";
645
- let cabBranch = {
646
- text: `${cab.name}`,
647
- value: `${codiac_relay_contracts_1.ScopeLevel.cabinet}|${cab.name}`
648
- };
649
- let cabSetting = existings === null || existings === void 0 ? void 0 : existings.find(s => s.scope === codiac_relay_contracts_1.ScopeLevel.cabinet && s.target === cab.name);
650
- if (cabSetting !== undefined) {
651
- let valueSuffix = this.ellipsis(35, (_c = cabSetting.value) !== null && _c !== void 0 ? _c : "[set to undefined]");
652
- valueSuffix = `(${valueSuffix})`;
653
- cabBranch.text = cabBranch.text.concat(" ", this._styler.dim(valueSuffix));
654
- }
655
- if (envBranch.children === undefined)
656
- envBranch.children = [];
657
- (_d = envBranch.children) === null || _d === void 0 ? void 0 : _d.push(cabBranch);
658
- }
659
- if (entBranch.children === undefined)
660
- entBranch.children = [];
661
- entBranch.children.push(envBranch);
662
- }
663
- tree.push(entBranch);
664
- }
665
- return tree;
666
- }
667
- /** Truncates the string to the given length with an ellipses as suffix */
668
- ellipsis(maxLength, value) {
669
- let output = value;
670
- if (output.length > maxLength) {
671
- let ellipsis = "..."; // Rather use the ellipsis character but String.fromCharCode(133) is returning a problematic character.
672
- output = output.slice(0, maxLength - 1 - ellipsis.length).concat(ellipsis);
673
- }
674
- return output;
675
- }
631
+ // Commented out bc now using ConfigUiUtils
632
+ // /** sets each value to "scope|target".
633
+ // *
634
+ // * This is MOSTLY a COPY-PASTE from the CabinetList command!!! This view is prob gonna be pretty common - consider promoting it to a shared utility. */
635
+ // private buildCabinetTree(rootMap: RootMap, existings?: ScopedSetting[]): TextValueParent[] {
636
+ // let tree: TextValueParent[] = [];
637
+ //
638
+ // for (let ent of rootMap.enterprises) {
639
+ // let entBranch: TextValueParent = { text: `${ent.name} enterprise:`, value: `${ScopeLevel.enterprise}|${ent.name}` };
640
+ // let entSetting = existings?.find(s => s.scope === ScopeLevel.enterprise && s.target === ent.name);
641
+ // if (entSetting !== undefined) {
642
+ // let valueSuffix = this.ellipsis(35, entSetting.value ?? "[set to undefined]");
643
+ // valueSuffix = `(${valueSuffix})`;
644
+ // entBranch.text = entBranch.text.concat(" ", this._styler.dim(valueSuffix));
645
+ // }
646
+ //
647
+ // for (let env of _.sortBy(ent.environments, e => e.sequence, e => e.name)) {
648
+ // let envBranch: TextValueParent = { text: `${env.name}`, value: `${ScopeLevel.environment}|${env.name}` }
649
+ // let envSetting = existings?.find(s => s.scope === ScopeLevel.environment && s.target === env.name);
650
+ // if (envSetting !== undefined) {
651
+ // let valueSuffix = this.ellipsis(35, envSetting.value ?? "[set to undefined]");
652
+ // valueSuffix = `(${valueSuffix})`;
653
+ // envBranch.text = envBranch.text.concat(" ", this._styler.dim(valueSuffix));
654
+ // }
655
+ //
656
+ // for (let cab of env.cabinets) {
657
+ // // let cwg = rootMap.clusters.find(c => c.name === cab.cluster);
658
+ // // let clusterDesc = cwg ? ` (${cab.cluster}, ${cwg.provider} ${cwg.locationName})` : "";
659
+ // let cabBranch: TextValueParent = {
660
+ // text: `${cab.name}`,
661
+ // value: `${ScopeLevel.cabinet}|${cab.name}`
662
+ // }
663
+ // let cabSetting = existings?.find(s => s.scope === ScopeLevel.cabinet && s.target === cab.name);
664
+ // if (cabSetting !== undefined) {
665
+ // let valueSuffix = this.ellipsis(35, cabSetting.value ?? "[set to undefined]");
666
+ // valueSuffix = `(${valueSuffix})`;
667
+ // cabBranch.text = cabBranch.text.concat(" ", this._styler.dim(valueSuffix));
668
+ // }
669
+ //
670
+ // if (envBranch.children === undefined) envBranch.children = [];
671
+ // envBranch.children?.push(cabBranch)
672
+ // }
673
+ //
674
+ // if (entBranch.children === undefined) entBranch.children = [];
675
+ // entBranch.children.push(envBranch);
676
+ // }
677
+ //
678
+ // tree.push(entBranch);
679
+ // }
680
+ //
681
+ // return tree;
682
+ // }
683
+ // /** Truncates the string to the given length with an ellipses as suffix */
684
+ // private ellipsis(maxLength: number, value: string): string {
685
+ // let output: string = value;
686
+ // if (output.length > maxLength) {
687
+ // let ellipsis = "..."; // Rather use the ellipsis character but String.fromCharCode(133) is returning a problematic character.
688
+ // output = output.slice(0, maxLength - 1 - ellipsis.length).concat(ellipsis);
689
+ // }
690
+ // return output;
691
+ // }
676
692
  /**
677
693
  *
678
694
  * @param enterprise
@@ -753,7 +769,7 @@ class AssetView extends command_base_enterprise_1.CommandBaseEnterprise {
753
769
  });
754
770
  }
755
771
  renderSelectedContent(context, contentType, k8sEntities, contentOptions, replicas) {
756
- var _a;
772
+ var _a, _b;
757
773
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
758
774
  try {
759
775
  switch (contentType) {
@@ -787,10 +803,24 @@ class AssetView extends command_base_enterprise_1.CommandBaseEnterprise {
787
803
  if (k8sEntities.pod == undefined || k8sEntities.container == undefined)
788
804
  throw new Error("No replica selected.");
789
805
  let cfgInput = contentOptions;
790
- if (!cfgInput.rootPathName.startsWith("/"))
791
- cfgInput.rootPathName = "/".concat(cfgInput.rootPathName);
792
- let cfgExec = { tty: false, command: ["cat", cfgInput.rootPathName] };
793
- yield this.runExec(context, cfgExec, k8sEntities);
806
+ if (cfgInput.rootPathName != undefined) {
807
+ if (!cfgInput.rootPathName.startsWith("/"))
808
+ cfgInput.rootPathName = "/".concat(cfgInput.rootPathName);
809
+ let cfgExec = { tty: false, command: ["cat", cfgInput.rootPathName] };
810
+ yield this.runExec(context, cfgExec, k8sEntities);
811
+ }
812
+ else {
813
+ // These configs arent retrievable as files from the image;
814
+ // each type is unique and will need its own retrieval logic
815
+ // eg:
816
+ // filestore --> writes a volume to the k8s deployment/podspec
817
+ // footprint --> writes reslurces to the k8s deployment/podspec
818
+ // probing --> writes probe specs to the k8s deployment/podspec
819
+ // label --> writes meta labels to the k8s deployment/podspec
820
+ // annotation --> writes meta annotations to the k8s deployment/podspec
821
+ // helm --> writes chart config to a k8s configmap (I think...)
822
+ this._ui.userMessage(`Viewing runtime configs of type: [${(_b = cfgInput.configType) !== null && _b !== void 0 ? _b : "(unspecified)"}] not supported yet.`);
823
+ }
794
824
  break;
795
825
  case (AssetContentType.env):
796
826
  if (context.replica == undefined)
@@ -1313,6 +1343,7 @@ AssetView.flags = {
1313
1343
  logsFollow: core_1.Flags.boolean({ char: 'f', default: false, description: '(requires type=logs) Follow (aka watch, tail, stream) the output.' }),
1314
1344
  logsTail: core_1.Flags.integer({ char: 'l', default: 10, description: '(requires type=logs) Lines of recent logs to include in the output. Enter -1 to include the entire log history stored in the container.' }),
1315
1345
  configFile: core_1.Flags.string({ char: 'F', description: '(requires type=config) The root pathname to the config file to fetch.' }),
1346
+ configType: core_1.Flags.string({ char: 'T', exclusive: ["file"], options: Object.keys(config_ui_utils_1.SpecialConfigTypes), description: 'Filters for the settings types that do not land in a config file (such as... env: OS environment variables, footprint: container footprint specs, helm: helm chart settings, label: container meta labels, annotation: container platform key-value pairs).' }),
1316
1347
  silent: core_1.Flags.boolean({ exclusive: ["echo", "toscript"], description: 'Non-Interactive mode; executes without any user interaction and fails on any missing or invalid arguments.' }),
1317
1348
  echo: core_1.Flags.boolean({ exclusive: ["toscript", "silent"], description: 'Echo interaction mode; renders the equivalent non-interactive cli command for future use before final execution.' }),
1318
1349
  toscript: core_1.Flags.boolean({ exclusive: ["echo", "silent"], description: 'Toscript interaction mode; renders the equivalent non-interactive cli command WITHOUT any execution.' }),
@@ -1331,8 +1362,9 @@ class ExecArgs {
1331
1362
  }
1332
1363
  exports.ExecArgs = ExecArgs;
1333
1364
  class ConfigFileArgs {
1334
- constructor(rootPathName) {
1365
+ constructor(rootPathName, configType) {
1335
1366
  this.rootPathName = rootPathName;
1367
+ this.configType = configType;
1336
1368
  }
1337
1369
  }
1338
1370
  exports.ConfigFileArgs = ConfigFileArgs;