@intentius/chant-lexicon-helm 0.41.15 → 0.41.17

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "766768bc6aa169949f35586951500a29359181d52b1642a088a38f79042a49d6",
4
+ "manifest.json": "4795ae6492987795afb538d5f6c76842cef76bd36ce90d6aa19303077d896875",
5
5
  "meta.json": "14243c5730a07c6a6edc35ddd351438547d58df5cf345f2233a355b0c7611ccc",
6
6
  "types/index.d.ts": "5377696ca8698cd2999e4680feb8e8e4b54a7b49fb603a87b2f27356114d1794",
7
7
  "rules/chart-metadata.ts": "8f3377e893d5e2828460b7fe5924fca098334245a9a2fdb90f6b67e490eaf091",
@@ -34,5 +34,5 @@
34
34
  "skills/chant-helm-patterns.md": "9e79e6a46391da46709d8aa57e2825a7cd9eb981cd923f02ad60836c49b2561e",
35
35
  "skills/chant-helm-security.md": "bfc367eabceed2e84f1cf94501b407df78aeed963cec104f24a321d0962063c9"
36
36
  },
37
- "composite": "c0ecf2a700fe6a16a4528cae154a2c5fd5f6efc92a56bd2eba2dc4b28dde3747"
37
+ "composite": "dca545fb2eb6977dfdcda4f2db213a744e2928b18b8e0c36c5da21a795929831"
38
38
  }
@@ -12,7 +12,7 @@
12
12
  * lexicons' snapshots aren't blocked.
13
13
  */
14
14
  import type { ArtifactMetadata } from "@intentius/chant/lexicon";
15
- export declare function listArtifacts(_options: {
15
+ export declare function listArtifacts(options: {
16
16
  environment: string;
17
17
  entities: Map<string, {
18
18
  entityType: string;
@@ -1 +1 @@
1
- {"version":3,"file":"list-artifacts.d.ts","sourceRoot":"","sources":["../src/list-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAsBjE,wBAAsB,aAAa,CAAC,QAAQ,EAAE;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CAC/E,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAqC5C"}
1
+ {"version":3,"file":"list-artifacts.d.ts","sourceRoot":"","sources":["../src/list-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAwBjE,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CAC/E,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAoD5C"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "helm",
3
- "version": "0.41.15",
3
+ "version": "0.41.17",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Helm",
6
6
  "intrinsics": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-helm",
3
- "version": "0.41.15",
3
+ "version": "0.41.17",
4
4
  "description": "Helm chart lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -81,7 +81,7 @@
81
81
  "@types/js-yaml": "^4.0.9"
82
82
  },
83
83
  "peerDependencies": {
84
- "@intentius/chant": "^0.41.15",
84
+ "@intentius/chant": "^0.41.17",
85
85
  "typescript": "^5.9.3"
86
86
  }
87
87
  }
@@ -15,6 +15,8 @@
15
15
  import { exec } from "node:child_process";
16
16
  import { promisify } from "node:util";
17
17
  import type { ArtifactMetadata } from "@intentius/chant/lexicon";
18
+ import { loadChantConfigUpward } from "@intentius/chant/config";
19
+ import { resolveClusterTarget } from "@intentius/chant/kubectl-context";
18
20
 
19
21
  const execAsync = promisify(exec);
20
22
 
@@ -36,15 +38,30 @@ function pruneUndefined<T extends Record<string, unknown>>(obj: T): Record<strin
36
38
  return out;
37
39
  }
38
40
 
39
- export async function listArtifacts(_options: {
41
+ export async function listArtifacts(options: {
40
42
  environment: string;
41
43
  entities: Map<string, { entityType: string; props: Record<string, unknown> }>;
42
44
  }): Promise<Record<string, ArtifactMetadata>> {
43
45
  const result: Record<string, ArtifactMetadata> = {};
44
46
 
47
+ // The same cluster binding every other helm read resolves (chant#1488 —
48
+ // `k8s.profiles.<env>.context`, shared with the k8s lexicon). Listing on
49
+ // the AMBIENT context read whichever cluster the operator's shell last
50
+ // pointed at: verified live on kubemicrovm-ops, whose releases came back
51
+ // `{}` because the shell's current-context was an unrelated EKS cluster.
52
+ // Unresolvable → ambient, which is chant's own fallback when no profile is
53
+ // declared.
54
+ let context: string | undefined;
55
+ try {
56
+ const { config } = await loadChantConfigUpward(process.cwd());
57
+ context = (await resolveClusterTarget(config as Record<string, unknown>, options.environment, "helm")).context;
58
+ } catch {
59
+ context = undefined;
60
+ }
61
+
45
62
  let stdout: string;
46
63
  try {
47
- ({ stdout } = await execAsync("helm list -A -o json"));
64
+ ({ stdout } = await execAsync(`helm list -A -o json${context ? ` --kube-context '${context.replace(/'/g, "'\\''")}'` : ""}`));
48
65
  } catch {
49
66
  // Binary not installed, no kubeconfig, or some other error — return
50
67
  // empty rather than blocking the whole snapshot.