@codiac.io/codiac-cli 1.3.229 → 1.3.230

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.
@@ -0,0 +1,74 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class ImportCluster extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ "run-in-cluster": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ enterprise: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
+ cluster: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
+ "generate-cabinet": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ "generate-secret-store": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ "generate-pvcs": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ "generate-volume-mounts": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ "include-default": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ "keyvault-name": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
16
+ };
17
+ /** Accumulates unique secret store names discovered during the scan. */
18
+ private discoveredStores;
19
+ /** Accumulates enterprise-scoped `codiac pvc create` lines keyed by their prefixed FileStoreDef name (`<namespace>-<pvc>`).
20
+ * Map preserves insertion order; the prefix guarantees cross-namespace uniqueness so no dedupe logic is needed beyond key collision. */
21
+ private discoveredPvcs;
22
+ /** Count of `# TODO:` comment lines emitted across all generated commands; surfaced as a summary banner at top of output. */
23
+ private todoCount;
24
+ /** Codiac registry codes that must already exist in the tenant for the generated `cod asset create` lines to succeed.
25
+ * Keyed by code, value is the cloud provider hint used to render the `cod imageRegistry capture` suggestion in the banner.
26
+ * `DockerHub|official` is intentionally excluded to keep the banner focused on registries the user must capture themselves. */
27
+ private discoveredRegistries;
28
+ run(): Promise<void>;
29
+ private listUserNamespaces;
30
+ private scanNamespace;
31
+ private scanNamespacePvcs;
32
+ /** Resolves a PVC's FileStoreType using the cluster-wide StorageClass map, falling back to the PV's CSI driver
33
+ * for statically-bound PVCs (storageClassName empty / spec.volumeName set). Returns undefined when no path resolves. */
34
+ private resolveFileStoreType;
35
+ private buildCabinetCreateCommand;
36
+ private buildAssetCreateCommand;
37
+ /** Maps a container-image hostname to the Codiac `ImageRegistry.code` recognised by `cod asset create --registry`.
38
+ * Returns `undefined` when the hostname can't be resolved so the caller can emit a TODO comment instead of
39
+ * producing a broken command line. Provider hint is paired with the code so the discovered-registries banner
40
+ * can render an accurate `cod imageRegistry capture --provider <p> --name <code>` suggestion. */
41
+ private toRegistryCode;
42
+ private buildConfigCommands;
43
+ private buildConfigCommand;
44
+ /** Builds a standard codiac config add for a direct env value. */
45
+ private buildConfigAddEnvCommand;
46
+ /** Builds the base portion of a codiac config add command (without --value). */
47
+ private buildConfigAddEnvBase;
48
+ /** Builds a codiac config add with #REF|azKeyVault|... for a secretKeyRef env var. */
49
+ private buildSecretRefCommand;
50
+ /** Builds a codiac config set with -t k8spatch for a fieldRef (Downward API) env var. */
51
+ private buildFieldRefPatchCommand;
52
+ /** Builds a codiac secretStore:capture command. */
53
+ private buildSecretStoreCaptureCommand;
54
+ private outputCommands;
55
+ private findServicesForDeployment;
56
+ private findIngressesForServices;
57
+ private parseContainerImage;
58
+ private describeEnvVarReference;
59
+ /** Maps a CSI driver name (or legacy in-tree provisioner) to the Codiac FileStoreType
60
+ * recognised by `cod pvc create`. Returns undefined when the driver is unknown so the
61
+ * caller can emit a TODO comment instead of guessing. */
62
+ private csiDriverToFileStoreType;
63
+ /** Walks a deployment's pod template to find every container volumeMount backed by a PVC
64
+ * in `pvcsInNs`. Returns one entry per matched (volume, container) pair. */
65
+ private findPvcMountsForDeployment;
66
+ /** Builds the enterprise-scoped `codiac pvc create` line. When the FileStoreType could not
67
+ * be inferred, prepends a TODO comment line so the user is forced to set `--type` manually. */
68
+ private buildPvcCreateCommand;
69
+ /** Builds the asset-scoped `codiac asset volume create` line. The mountPath is a positional arg. */
70
+ private buildAssetVolumeCreateCommand;
71
+ /** Builds the cabinet-scoped `codiac config add -t filestore` line that binds an asset's reserved
72
+ * folder (declared by `asset volume create`) to the FileStoreDef (created by `pvc create`). */
73
+ private buildFilestoreBindCommand;
74
+ }