@intentius/chant-lexicon-k8s 0.124.96 → 0.124.98
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.
- package/dist/application-paths.d.ts +4 -0
- package/dist/application-paths.d.ts.map +1 -0
- package/dist/application-paths.js +95 -0
- package/dist/application-set.d.ts +46 -0
- package/dist/application-set.d.ts.map +1 -0
- package/dist/application-set.js +303 -0
- package/dist/cluster-secret.d.ts +36 -0
- package/dist/cluster-secret.d.ts.map +1 -0
- package/dist/cluster-secret.js +55 -0
- package/dist/components/kustomize-apply.d.ts +6 -0
- package/dist/components/kustomize-apply.d.ts.map +1 -1
- package/dist/components/kustomize-apply.js +1 -1
- package/dist/config-schema.d.ts +8 -0
- package/dist/config-schema.d.ts.map +1 -1
- package/dist/config-schema.js +6 -2
- package/dist/config.d.ts +26 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/helm-references.d.ts +113 -0
- package/dist/helm-references.d.ts.map +1 -0
- package/dist/helm-references.js +389 -0
- package/dist/import/generator.d.ts +11 -2
- package/dist/import/generator.d.ts.map +1 -1
- package/dist/import/generator.js +37 -55
- package/dist/import/parser.d.ts.map +1 -1
- package/dist/import/parser.js +34 -5
- package/dist/import/typed-classes.d.ts +57 -0
- package/dist/import/typed-classes.d.ts.map +1 -0
- package/dist/import/typed-classes.js +126 -0
- package/dist/integrity.json +41 -41
- package/dist/kustomize/render.d.ts +41 -2
- package/dist/kustomize/render.d.ts.map +1 -1
- package/dist/kustomize/render.js +114 -7
- package/dist/kustomize/root.d.ts +3 -3
- package/dist/kustomize/root.d.ts.map +1 -1
- package/dist/kustomize/root.js +6 -1
- package/dist/lint/post-synth/argo-helpers.d.ts +3 -0
- package/dist/lint/post-synth/argo-helpers.d.ts.map +1 -1
- package/dist/lint/post-synth/argo-helpers.js +8 -2
- package/dist/lint/post-synth/argo002.d.ts.map +1 -1
- package/dist/lint/post-synth/argo002.js +2 -1
- package/dist/lint/post-synth/argo003.d.ts.map +1 -1
- package/dist/lint/post-synth/argo003.js +2 -1
- package/dist/lint/post-synth/argo005.d.ts.map +1 -1
- package/dist/lint/post-synth/argo005.js +36 -9
- package/dist/lint/post-synth/crd-schema-helpers.d.ts +1 -1
- package/dist/lint/post-synth/crd-schema-helpers.d.ts.map +1 -1
- package/dist/lint/post-synth/crd-schema-helpers.js +3 -3
- package/dist/lint/post-synth/flux002.d.ts.map +1 -1
- package/dist/lint/post-synth/flux002.js +2 -1
- package/dist/lint/post-synth/flux003.d.ts.map +1 -1
- package/dist/lint/post-synth/flux003.js +2 -1
- package/dist/lint/post-synth/k8s-helpers.d.ts +32 -0
- package/dist/lint/post-synth/k8s-helpers.d.ts.map +1 -1
- package/dist/lint/post-synth/k8s-helpers.js +57 -10
- package/dist/lint/post-synth/wk8005.d.ts +9 -0
- package/dist/lint/post-synth/wk8005.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8005.js +53 -3
- package/dist/lint/post-synth/wk8006.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8006.js +4 -2
- package/dist/lint/post-synth/wk8041.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8041.js +3 -2
- package/dist/lint/post-synth/wk8042.js +2 -2
- package/dist/lint/post-synth/wk8101.js +2 -2
- package/dist/lint/post-synth/wk8102.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8102.js +7 -3
- package/dist/lint/post-synth/wk8103.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8103.js +3 -2
- package/dist/lint/post-synth/wk8104.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8104.js +3 -2
- package/dist/lint/post-synth/wk8105.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8105.js +3 -2
- package/dist/lint/post-synth/wk8201.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8201.js +3 -2
- package/dist/lint/post-synth/wk8202.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8202.js +3 -2
- package/dist/lint/post-synth/wk8203.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8203.js +3 -2
- package/dist/lint/post-synth/wk8204.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8204.js +5 -2
- package/dist/lint/post-synth/wk8205.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8205.js +3 -2
- package/dist/lint/post-synth/wk8207.js +2 -2
- package/dist/lint/post-synth/wk8208.js +2 -2
- package/dist/lint/post-synth/wk8209.js +2 -2
- package/dist/lint/post-synth/wk8301.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8301.js +3 -2
- package/dist/lint/post-synth/wk8302.js +2 -2
- package/dist/lint/post-synth/wk8303.js +2 -2
- package/dist/lint/post-synth/wk8304.js +2 -2
- package/dist/lint/post-synth/wk8305.js +2 -2
- package/dist/lint/post-synth/wk8306.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8306.js +3 -2
- package/dist/lint/post-synth/wk8401.js +2 -2
- package/dist/lint/post-synth/wk8402.js +2 -2
- package/dist/lint/post-synth/wk8403.js +2 -2
- package/dist/lint/post-synth/wk8404.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8404.js +2 -2
- package/dist/lint/post-synth/wk8405.js +2 -2
- package/dist/lint/post-synth/wk8406.d.ts.map +1 -1
- package/dist/lint/post-synth/wk8406.js +3 -2
- package/dist/lint/post-synth/wk8407.js +2 -2
- package/dist/lint/post-synth/wk8503.js +2 -2
- package/dist/manifest.json +1 -1
- package/dist/reference-catalog.d.ts +3 -1
- package/dist/reference-catalog.d.ts.map +1 -1
- package/dist/reference-catalog.js +283 -15
- package/dist/rules/argo-helpers.ts +9 -2
- package/dist/rules/argo002.ts +2 -1
- package/dist/rules/argo003.ts +2 -1
- package/dist/rules/argo005.ts +36 -10
- package/dist/rules/crd-schema-helpers.ts +3 -3
- package/dist/rules/flux002.ts +2 -1
- package/dist/rules/flux003.ts +2 -1
- package/dist/rules/k8s-helpers.ts +56 -11
- package/dist/rules/wk8005.ts +56 -3
- package/dist/rules/wk8006.ts +4 -2
- package/dist/rules/wk8041.ts +3 -2
- package/dist/rules/wk8042.ts +2 -2
- package/dist/rules/wk8101.ts +2 -2
- package/dist/rules/wk8102.ts +7 -3
- package/dist/rules/wk8103.ts +3 -2
- package/dist/rules/wk8104.ts +3 -2
- package/dist/rules/wk8105.ts +3 -2
- package/dist/rules/wk8201.ts +3 -2
- package/dist/rules/wk8202.ts +3 -2
- package/dist/rules/wk8203.ts +3 -2
- package/dist/rules/wk8204.ts +5 -2
- package/dist/rules/wk8205.ts +3 -2
- package/dist/rules/wk8207.ts +2 -2
- package/dist/rules/wk8208.ts +2 -2
- package/dist/rules/wk8209.ts +2 -2
- package/dist/rules/wk8301.ts +3 -2
- package/dist/rules/wk8302.ts +2 -2
- package/dist/rules/wk8303.ts +2 -2
- package/dist/rules/wk8304.ts +2 -2
- package/dist/rules/wk8305.ts +2 -2
- package/dist/rules/wk8306.ts +3 -2
- package/dist/rules/wk8401.ts +2 -2
- package/dist/rules/wk8402.ts +2 -2
- package/dist/rules/wk8403.ts +2 -2
- package/dist/rules/wk8404.ts +2 -1
- package/dist/rules/wk8405.ts +2 -2
- package/dist/rules/wk8406.ts +3 -2
- package/dist/rules/wk8407.ts +2 -2
- package/dist/rules/wk8503.ts +2 -2
- package/dist/workspace-member.d.ts +15 -3
- package/dist/workspace-member.d.ts.map +1 -1
- package/dist/workspace-member.js +151 -21
- package/package.json +5 -5
- package/src/application-paths.ts +96 -0
- package/src/application-set.test.ts +130 -0
- package/src/application-set.ts +336 -0
- package/src/cluster-secret.test.ts +117 -0
- package/src/cluster-secret.ts +76 -0
- package/src/components/kustomize-apply.ts +7 -1
- package/src/config-schema.ts +6 -2
- package/src/config.ts +24 -4
- package/src/helm-references.test.ts +149 -0
- package/src/helm-references.ts +425 -0
- package/src/import/generator.test.ts +57 -0
- package/src/import/generator.ts +35 -61
- package/src/import/parser.test.ts +59 -0
- package/src/import/parser.ts +38 -5
- package/src/import/roundtrip-build.test.ts +91 -0
- package/src/import/typed-classes.ts +168 -0
- package/src/kustomize/helm.test.ts +183 -0
- package/src/kustomize/render.ts +142 -6
- package/src/kustomize/root.ts +8 -3
- package/src/lint/post-synth/argo-helpers.ts +9 -2
- package/src/lint/post-synth/argo002.ts +2 -1
- package/src/lint/post-synth/argo003.ts +2 -1
- package/src/lint/post-synth/argo005.ts +36 -10
- package/src/lint/post-synth/audit-identity.test.ts +65 -0
- package/src/lint/post-synth/crd-schema-helpers.ts +3 -3
- package/src/lint/post-synth/flux002.ts +2 -1
- package/src/lint/post-synth/flux003.ts +2 -1
- package/src/lint/post-synth/k8s-helpers.ts +56 -11
- package/src/lint/post-synth/post-synth.test.ts +144 -0
- package/src/lint/post-synth/wk8005.ts +56 -3
- package/src/lint/post-synth/wk8006.ts +4 -2
- package/src/lint/post-synth/wk8041.ts +3 -2
- package/src/lint/post-synth/wk8042.ts +2 -2
- package/src/lint/post-synth/wk8101.ts +2 -2
- package/src/lint/post-synth/wk8102.ts +7 -3
- package/src/lint/post-synth/wk8103.ts +3 -2
- package/src/lint/post-synth/wk8104.ts +3 -2
- package/src/lint/post-synth/wk8105.ts +3 -2
- package/src/lint/post-synth/wk8201.ts +3 -2
- package/src/lint/post-synth/wk8202.ts +3 -2
- package/src/lint/post-synth/wk8203.ts +3 -2
- package/src/lint/post-synth/wk8204.ts +5 -2
- package/src/lint/post-synth/wk8205.ts +3 -2
- package/src/lint/post-synth/wk8207.ts +2 -2
- package/src/lint/post-synth/wk8208.ts +2 -2
- package/src/lint/post-synth/wk8209.ts +2 -2
- package/src/lint/post-synth/wk8301.ts +3 -2
- package/src/lint/post-synth/wk8302.ts +2 -2
- package/src/lint/post-synth/wk8303.ts +2 -2
- package/src/lint/post-synth/wk8304.ts +2 -2
- package/src/lint/post-synth/wk8305.ts +2 -2
- package/src/lint/post-synth/wk8306.ts +3 -2
- package/src/lint/post-synth/wk8401.ts +2 -2
- package/src/lint/post-synth/wk8402.ts +2 -2
- package/src/lint/post-synth/wk8403.ts +2 -2
- package/src/lint/post-synth/wk8404.ts +2 -1
- package/src/lint/post-synth/wk8405.ts +2 -2
- package/src/lint/post-synth/wk8406.ts +3 -2
- package/src/lint/post-synth/wk8407.ts +2 -2
- package/src/lint/post-synth/wk8503.ts +2 -2
- package/src/reference-catalog.test.ts +78 -0
- package/src/reference-catalog.ts +297 -16
- package/src/testdata/helm-chart-missing/kustomization.yaml +8 -0
- package/src/testdata/helm-chart-root/charts/webchart/Chart.yaml +3 -0
- package/src/testdata/helm-chart-root/charts/webchart/templates/configmap.yaml +6 -0
- package/src/testdata/helm-chart-root/charts/webchart/values.yaml +1 -0
- package/src/testdata/helm-chart-root/kustomization.yaml +9 -0
- package/src/testdata/helm-chart-root/values.yaml +1 -0
- package/src/testdata/workspace-members/argo-clusters/clusters.yaml +34 -0
- package/src/testdata/workspace-members/argo-set/all.yaml +43 -0
- package/src/testdata/workspace-members/plain/deploy.yaml +27 -0
- package/src/testdata/workspace-members/plain/es.yaml +15 -0
- package/src/testdata/workspace-members/templated/block.yaml +6 -0
- package/src/testdata/workspace-members/templated/chart-cm.yaml +4 -0
- package/src/testdata/workspace-members/templated/cm.yaml +6 -0
- package/src/workspace-kinds.test.ts +9 -1
- package/src/workspace-member.test.ts +69 -3
- package/src/workspace-member.ts +165 -24
- package/workspace-kinds.json +45 -6
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
10
|
-
import { docsToManifests, extractContainers, WORKLOAD_KINDS } from "./k8s-helpers";
|
|
10
|
+
import { docsToManifests, extractContainers, containerLocator, WORKLOAD_KINDS, nameOf } from "./k8s-helpers";
|
|
11
11
|
|
|
12
12
|
export const wk8203: PostSynthCheck = {
|
|
13
13
|
id: "WK8203",
|
|
@@ -20,7 +20,7 @@ export const wk8203: PostSynthCheck = {
|
|
|
20
20
|
if (!manifest.kind || !WORKLOAD_KINDS.has(manifest.kind)) continue;
|
|
21
21
|
|
|
22
22
|
const containers = extractContainers(manifest);
|
|
23
|
-
const resourceName = manifest
|
|
23
|
+
const resourceName = nameOf(manifest, manifest.kind);
|
|
24
24
|
|
|
25
25
|
for (const container of containers) {
|
|
26
26
|
const secCtx = container.securityContext;
|
|
@@ -30,6 +30,7 @@ export const wk8203: PostSynthCheck = {
|
|
|
30
30
|
severity: "warning",
|
|
31
31
|
message: `Container "${container.name ?? "(unnamed)"}" in ${manifest.kind} "${resourceName}" does not set readOnlyRootFilesystem: true — set it to reduce the attack surface`,
|
|
32
32
|
entity: resourceName,
|
|
33
|
+
locator: containerLocator(manifest, container),
|
|
33
34
|
lexicon: "k8s",
|
|
34
35
|
});
|
|
35
36
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
14
|
-
import { docsToManifests, extractContainers, extractPodSpec, WORKLOAD_KINDS } from "./k8s-helpers";
|
|
14
|
+
import { docsToManifests, extractContainers, containerLocator, extractPodSpec, WORKLOAD_KINDS, nameOf } from "./k8s-helpers";
|
|
15
15
|
|
|
16
16
|
export const wk8204: PostSynthCheck = {
|
|
17
17
|
id: "WK8204",
|
|
@@ -23,7 +23,7 @@ export const wk8204: PostSynthCheck = {
|
|
|
23
23
|
for (const manifest of docsToManifests(ctx)) {
|
|
24
24
|
if (!manifest.kind || !WORKLOAD_KINDS.has(manifest.kind)) continue;
|
|
25
25
|
|
|
26
|
-
const resourceName = manifest
|
|
26
|
+
const resourceName = nameOf(manifest, manifest.kind);
|
|
27
27
|
const podSpec = extractPodSpec(manifest);
|
|
28
28
|
if (!podSpec) continue;
|
|
29
29
|
|
|
@@ -46,6 +46,7 @@ export const wk8204: PostSynthCheck = {
|
|
|
46
46
|
severity: "warning",
|
|
47
47
|
message: `Container "${container.name ?? "(unnamed)"}" in ${manifest.kind} "${resourceName}" does not set runAsNonRoot: true — set it at container or pod level`,
|
|
48
48
|
entity: resourceName,
|
|
49
|
+
locator: containerLocator(manifest, container),
|
|
49
50
|
lexicon: "k8s",
|
|
50
51
|
});
|
|
51
52
|
continue;
|
|
@@ -61,6 +62,7 @@ export const wk8204: PostSynthCheck = {
|
|
|
61
62
|
severity: "warning",
|
|
62
63
|
message: `Container "${container.name ?? "(unnamed)"}" in ${manifest.kind} "${resourceName}" has runAsNonRoot: true but runAsUser: 0 — these settings are contradictory and the container will fail to start`,
|
|
63
64
|
entity: resourceName,
|
|
65
|
+
locator: containerLocator(manifest, container),
|
|
64
66
|
lexicon: "k8s",
|
|
65
67
|
});
|
|
66
68
|
} else if (effectiveRunAsUser === undefined || effectiveRunAsUser === null) {
|
|
@@ -70,6 +72,7 @@ export const wk8204: PostSynthCheck = {
|
|
|
70
72
|
severity: "warning",
|
|
71
73
|
message: `Container "${container.name ?? "(unnamed)"}" in ${manifest.kind} "${resourceName}" has runAsNonRoot: true but no explicit runAsUser — set a numeric UID to ensure the container doesn't run as root`,
|
|
72
74
|
entity: resourceName,
|
|
75
|
+
locator: containerLocator(manifest, container),
|
|
73
76
|
lexicon: "k8s",
|
|
74
77
|
});
|
|
75
78
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
10
|
-
import { docsToManifests, extractContainers, WORKLOAD_KINDS } from "./k8s-helpers";
|
|
10
|
+
import { docsToManifests, extractContainers, containerLocator, WORKLOAD_KINDS, nameOf } from "./k8s-helpers";
|
|
11
11
|
|
|
12
12
|
export const wk8205: PostSynthCheck = {
|
|
13
13
|
id: "WK8205",
|
|
@@ -20,7 +20,7 @@ export const wk8205: PostSynthCheck = {
|
|
|
20
20
|
if (!manifest.kind || !WORKLOAD_KINDS.has(manifest.kind)) continue;
|
|
21
21
|
|
|
22
22
|
const containers = extractContainers(manifest);
|
|
23
|
-
const resourceName = manifest
|
|
23
|
+
const resourceName = nameOf(manifest, manifest.kind);
|
|
24
24
|
|
|
25
25
|
for (const container of containers) {
|
|
26
26
|
const secCtx = container.securityContext;
|
|
@@ -40,6 +40,7 @@ export const wk8205: PostSynthCheck = {
|
|
|
40
40
|
severity: "warning",
|
|
41
41
|
message: `Container "${container.name ?? "(unnamed)"}" in ${manifest.kind} "${resourceName}" does not drop ALL capabilities — add securityContext.capabilities.drop: ["ALL"]`,
|
|
42
42
|
entity: resourceName,
|
|
43
|
+
locator: containerLocator(manifest, container),
|
|
43
44
|
lexicon: "k8s",
|
|
44
45
|
});
|
|
45
46
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
10
|
-
import { docsToManifests, extractPodSpec, WORKLOAD_KINDS } from "./k8s-helpers";
|
|
10
|
+
import { docsToManifests, extractPodSpec, WORKLOAD_KINDS, nameOf } from "./k8s-helpers";
|
|
11
11
|
|
|
12
12
|
export const wk8207: PostSynthCheck = {
|
|
13
13
|
id: "WK8207",
|
|
@@ -22,7 +22,7 @@ export const wk8207: PostSynthCheck = {
|
|
|
22
22
|
const podSpec = extractPodSpec(manifest);
|
|
23
23
|
if (!podSpec) continue;
|
|
24
24
|
|
|
25
|
-
const resourceName = manifest
|
|
25
|
+
const resourceName = nameOf(manifest, manifest.kind);
|
|
26
26
|
|
|
27
27
|
if (podSpec.hostNetwork === true) {
|
|
28
28
|
diagnostics.push({
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
10
|
-
import { docsToManifests, extractPodSpec, WORKLOAD_KINDS } from "./k8s-helpers";
|
|
10
|
+
import { docsToManifests, extractPodSpec, WORKLOAD_KINDS, nameOf } from "./k8s-helpers";
|
|
11
11
|
|
|
12
12
|
export const wk8208: PostSynthCheck = {
|
|
13
13
|
id: "WK8208",
|
|
@@ -22,7 +22,7 @@ export const wk8208: PostSynthCheck = {
|
|
|
22
22
|
const podSpec = extractPodSpec(manifest);
|
|
23
23
|
if (!podSpec) continue;
|
|
24
24
|
|
|
25
|
-
const resourceName = manifest
|
|
25
|
+
const resourceName = nameOf(manifest, manifest.kind);
|
|
26
26
|
|
|
27
27
|
if (podSpec.hostPID === true) {
|
|
28
28
|
diagnostics.push({
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
10
|
-
import { docsToManifests, extractPodSpec, WORKLOAD_KINDS } from "./k8s-helpers";
|
|
10
|
+
import { docsToManifests, extractPodSpec, WORKLOAD_KINDS, nameOf } from "./k8s-helpers";
|
|
11
11
|
|
|
12
12
|
export const wk8209: PostSynthCheck = {
|
|
13
13
|
id: "WK8209",
|
|
@@ -22,7 +22,7 @@ export const wk8209: PostSynthCheck = {
|
|
|
22
22
|
const podSpec = extractPodSpec(manifest);
|
|
23
23
|
if (!podSpec) continue;
|
|
24
24
|
|
|
25
|
-
const resourceName = manifest
|
|
25
|
+
const resourceName = nameOf(manifest, manifest.kind);
|
|
26
26
|
|
|
27
27
|
if (podSpec.hostIPC === true) {
|
|
28
28
|
diagnostics.push({
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
15
|
-
import { docsToManifests, extractContainers, WORKLOAD_KINDS } from "./k8s-helpers";
|
|
15
|
+
import { docsToManifests, extractContainers, containerLocator, WORKLOAD_KINDS, nameOf } from "./k8s-helpers";
|
|
16
16
|
|
|
17
17
|
export const wk8301: PostSynthCheck = {
|
|
18
18
|
id: "WK8301",
|
|
@@ -27,7 +27,7 @@ export const wk8301: PostSynthCheck = {
|
|
|
27
27
|
if (manifest.kind === "Job" || manifest.kind === "CronJob") continue;
|
|
28
28
|
|
|
29
29
|
const containers = extractContainers(manifest);
|
|
30
|
-
const resourceName = manifest
|
|
30
|
+
const resourceName = nameOf(manifest, manifest.kind);
|
|
31
31
|
|
|
32
32
|
for (const container of containers) {
|
|
33
33
|
// No declared port → no inbound traffic → nothing to HTTP-probe.
|
|
@@ -43,6 +43,7 @@ export const wk8301: PostSynthCheck = {
|
|
|
43
43
|
severity: "warning",
|
|
44
44
|
message: `Container "${container.name ?? "(unnamed)"}" in ${manifest.kind} "${resourceName}" is missing ${missing.join(" and ")}`,
|
|
45
45
|
entity: resourceName,
|
|
46
|
+
locator: containerLocator(manifest, container),
|
|
46
47
|
lexicon: "k8s",
|
|
47
48
|
});
|
|
48
49
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
9
|
-
import { docsToManifests } from "./k8s-helpers";
|
|
9
|
+
import { docsToManifests, nameOf } from "./k8s-helpers";
|
|
10
10
|
|
|
11
11
|
export const wk8302: PostSynthCheck = {
|
|
12
12
|
id: "WK8302",
|
|
@@ -18,7 +18,7 @@ export const wk8302: PostSynthCheck = {
|
|
|
18
18
|
for (const manifest of docsToManifests(ctx)) {
|
|
19
19
|
if (manifest.kind !== "Deployment") continue;
|
|
20
20
|
|
|
21
|
-
const resourceName = manifest
|
|
21
|
+
const resourceName = nameOf(manifest, "Deployment");
|
|
22
22
|
const spec = manifest.spec;
|
|
23
23
|
if (!spec) continue;
|
|
24
24
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
10
|
-
import { docsToManifests } from "./k8s-helpers";
|
|
10
|
+
import { docsToManifests, nameOf } from "./k8s-helpers";
|
|
11
11
|
import type { K8sManifest } from "./k8s-helpers";
|
|
12
12
|
|
|
13
13
|
export const wk8303: PostSynthCheck = {
|
|
@@ -32,7 +32,7 @@ export const wk8303: PostSynthCheck = {
|
|
|
32
32
|
// Only check HA deployments (replicas >= 2)
|
|
33
33
|
if (typeof replicas !== "number" || replicas < 2) continue;
|
|
34
34
|
|
|
35
|
-
const resourceName = manifest
|
|
35
|
+
const resourceName = nameOf(manifest, "Deployment");
|
|
36
36
|
|
|
37
37
|
// Check if any PDB targets this Deployment's labels
|
|
38
38
|
const selector = spec.selector as Record<string, unknown> | undefined;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
10
|
-
import { docsToManifests } from "./k8s-helpers";
|
|
10
|
+
import { docsToManifests, nameOf } from "./k8s-helpers";
|
|
11
11
|
|
|
12
12
|
export const wk8304: PostSynthCheck = {
|
|
13
13
|
id: "WK8304",
|
|
@@ -25,7 +25,7 @@ export const wk8304: PostSynthCheck = {
|
|
|
25
25
|
const sslRedirect = annotations["alb.ingress.kubernetes.io/ssl-redirect"];
|
|
26
26
|
if (!sslRedirect) continue;
|
|
27
27
|
|
|
28
|
-
const resourceName = manifest
|
|
28
|
+
const resourceName = nameOf(manifest, "Ingress");
|
|
29
29
|
const certArn = annotations["alb.ingress.kubernetes.io/certificate-arn"];
|
|
30
30
|
|
|
31
31
|
if (!certArn) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
9
|
-
import { docsToManifests } from "./k8s-helpers";
|
|
9
|
+
import { docsToManifests, nameOf } from "./k8s-helpers";
|
|
10
10
|
import type { K8sManifest } from "./k8s-helpers";
|
|
11
11
|
|
|
12
12
|
export const wk8305: PostSynthCheck = {
|
|
@@ -24,7 +24,7 @@ export const wk8305: PostSynthCheck = {
|
|
|
24
24
|
for (const manifest of manifests) {
|
|
25
25
|
if (manifest.kind !== "Ingress") continue;
|
|
26
26
|
|
|
27
|
-
const ingressName = manifest
|
|
27
|
+
const ingressName = nameOf(manifest, "Ingress");
|
|
28
28
|
const ingressNamespace = manifest.metadata?.namespace ?? "default";
|
|
29
29
|
const spec = manifest.spec;
|
|
30
30
|
if (!spec) continue;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
11
|
-
import { docsToManifests, extractContainers, WORKLOAD_KINDS } from "./k8s-helpers";
|
|
11
|
+
import { docsToManifests, extractContainers, containerLocator, WORKLOAD_KINDS, nameOf } from "./k8s-helpers";
|
|
12
12
|
|
|
13
13
|
export const wk8306: PostSynthCheck = {
|
|
14
14
|
id: "WK8306",
|
|
@@ -20,7 +20,7 @@ export const wk8306: PostSynthCheck = {
|
|
|
20
20
|
for (const manifest of docsToManifests(ctx)) {
|
|
21
21
|
if (!manifest.kind || !WORKLOAD_KINDS.has(manifest.kind)) continue;
|
|
22
22
|
|
|
23
|
-
const resourceName = manifest
|
|
23
|
+
const resourceName = nameOf(manifest, manifest.kind);
|
|
24
24
|
const containers = extractContainers(manifest);
|
|
25
25
|
|
|
26
26
|
for (const container of containers) {
|
|
@@ -34,6 +34,7 @@ export const wk8306: PostSynthCheck = {
|
|
|
34
34
|
severity: "error",
|
|
35
35
|
message: `Container "${container.name ?? "(unnamed)"}" in ${manifest.kind} "${resourceName}" has command[0]="${firstArg}" which starts with a flag — the first element should be the binary, flags belong in args`,
|
|
36
36
|
entity: resourceName,
|
|
37
|
+
locator: containerLocator(manifest, container),
|
|
37
38
|
lexicon: "k8s",
|
|
38
39
|
});
|
|
39
40
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
11
|
-
import { docsToManifests, parseMemoryBytes } from "./k8s-helpers";
|
|
11
|
+
import { docsToManifests, parseMemoryBytes, nameOf } from "./k8s-helpers";
|
|
12
12
|
|
|
13
13
|
export const wk8401: PostSynthCheck = {
|
|
14
14
|
id: "WK8401",
|
|
@@ -20,7 +20,7 @@ export const wk8401: PostSynthCheck = {
|
|
|
20
20
|
for (const manifest of docsToManifests(ctx)) {
|
|
21
21
|
if (manifest.kind !== "RayCluster") continue;
|
|
22
22
|
|
|
23
|
-
const clusterName = manifest
|
|
23
|
+
const clusterName = nameOf(manifest, "RayCluster");
|
|
24
24
|
const spec = manifest.spec as Record<string, unknown> | undefined;
|
|
25
25
|
if (!spec) continue;
|
|
26
26
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
10
|
-
import { docsToManifests } from "./k8s-helpers";
|
|
10
|
+
import { docsToManifests, nameOf } from "./k8s-helpers";
|
|
11
11
|
|
|
12
12
|
export const wk8402: PostSynthCheck = {
|
|
13
13
|
id: "WK8402",
|
|
@@ -19,7 +19,7 @@ export const wk8402: PostSynthCheck = {
|
|
|
19
19
|
for (const manifest of docsToManifests(ctx)) {
|
|
20
20
|
if (manifest.kind !== "RayCluster") continue;
|
|
21
21
|
|
|
22
|
-
const name = manifest
|
|
22
|
+
const name = nameOf(manifest, "RayCluster");
|
|
23
23
|
const rayVersion = (manifest.spec as Record<string, unknown> | undefined)?.rayVersion;
|
|
24
24
|
|
|
25
25
|
if (!rayVersion) {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
10
|
-
import { docsToManifests, extractRayVersion } from "./k8s-helpers";
|
|
10
|
+
import { docsToManifests, extractRayVersion, nameOf } from "./k8s-helpers";
|
|
11
11
|
|
|
12
12
|
export const wk8403: PostSynthCheck = {
|
|
13
13
|
id: "WK8403",
|
|
@@ -19,7 +19,7 @@ export const wk8403: PostSynthCheck = {
|
|
|
19
19
|
for (const manifest of docsToManifests(ctx)) {
|
|
20
20
|
if (manifest.kind !== "RayCluster") continue;
|
|
21
21
|
|
|
22
|
-
const clusterName = manifest
|
|
22
|
+
const clusterName = nameOf(manifest, "RayCluster");
|
|
23
23
|
const spec = manifest.spec as Record<string, unknown> | undefined;
|
|
24
24
|
if (!spec) continue;
|
|
25
25
|
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
requestsGpu,
|
|
17
17
|
toleratesGpu,
|
|
18
18
|
GPU_POD_KINDS,
|
|
19
|
+
nameOf,
|
|
19
20
|
} from "./k8s-helpers";
|
|
20
21
|
|
|
21
22
|
export const wk8404: PostSynthCheck = {
|
|
@@ -34,7 +35,7 @@ export const wk8404: PostSynthCheck = {
|
|
|
34
35
|
const podSpec = extractPodSpec(manifest);
|
|
35
36
|
if (toleratesGpu(podSpec?.tolerations)) continue;
|
|
36
37
|
|
|
37
|
-
const resourceName = manifest
|
|
38
|
+
const resourceName = nameOf(manifest, manifest.kind);
|
|
38
39
|
diagnostics.push({
|
|
39
40
|
checkId: "WK8404",
|
|
40
41
|
severity: "error",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
13
|
-
import { docsToManifests } from "./k8s-helpers";
|
|
13
|
+
import { docsToManifests, nameOf } from "./k8s-helpers";
|
|
14
14
|
import type { K8sManifest } from "./k8s-helpers";
|
|
15
15
|
|
|
16
16
|
/** `app.kubernetes.io/component` values this lexicon's composites use for serving workloads. */
|
|
@@ -38,7 +38,7 @@ export const wk8405: PostSynthCheck = {
|
|
|
38
38
|
if (!isServingWorkload(manifest)) continue;
|
|
39
39
|
|
|
40
40
|
const labels = manifest.metadata?.labels;
|
|
41
|
-
const resourceName = manifest
|
|
41
|
+
const resourceName = nameOf(manifest, manifest.kind ?? "workload");
|
|
42
42
|
|
|
43
43
|
if (!labels || !hasCoveringPdb(labels, pdbSelectors)) {
|
|
44
44
|
diagnostics.push({
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
12
|
-
import { docsToManifests, extractContainers, GPU_POD_KINDS, NVIDIA_GPU_RESOURCE } from "./k8s-helpers";
|
|
12
|
+
import { docsToManifests, extractContainers, containerLocator, GPU_POD_KINDS, NVIDIA_GPU_RESOURCE, nameOf } from "./k8s-helpers";
|
|
13
13
|
|
|
14
14
|
export const wk8406: PostSynthCheck = {
|
|
15
15
|
id: "WK8406",
|
|
@@ -22,7 +22,7 @@ export const wk8406: PostSynthCheck = {
|
|
|
22
22
|
if (!manifest.kind || !GPU_POD_KINDS.has(manifest.kind)) continue;
|
|
23
23
|
|
|
24
24
|
const containers = extractContainers(manifest);
|
|
25
|
-
const resourceName = manifest
|
|
25
|
+
const resourceName = nameOf(manifest, manifest.kind);
|
|
26
26
|
|
|
27
27
|
for (const container of containers) {
|
|
28
28
|
const requests = container.resources?.requests as Record<string, unknown> | undefined;
|
|
@@ -44,6 +44,7 @@ export const wk8406: PostSynthCheck = {
|
|
|
44
44
|
severity: "warning",
|
|
45
45
|
message: `GPU container "${container.name ?? "(unnamed)"}" in ${manifest.kind} "${resourceName}" is missing resource limits for ${missing.join(", ")} — a GPU pod without cpu/memory limits can starve its (scarce, expensive) node`,
|
|
46
46
|
entity: resourceName,
|
|
47
|
+
locator: containerLocator(manifest, container),
|
|
47
48
|
lexicon: "k8s",
|
|
48
49
|
});
|
|
49
50
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
15
|
-
import { docsToManifests } from "./k8s-helpers";
|
|
15
|
+
import { docsToManifests, nameOf } from "./k8s-helpers";
|
|
16
16
|
|
|
17
17
|
/** Trailing path segments that mean "no explicit version" even though present. */
|
|
18
18
|
const FLOATING_TAGS = new Set(["latest", "main", "master", "head"]);
|
|
@@ -50,7 +50,7 @@ export const wk8407: PostSynthCheck = {
|
|
|
50
50
|
if (!storageUri) continue;
|
|
51
51
|
|
|
52
52
|
if (!isPinnedStorageUri(storageUri)) {
|
|
53
|
-
const resourceName = manifest
|
|
53
|
+
const resourceName = nameOf(manifest, "InferenceService");
|
|
54
54
|
diagnostics.push({
|
|
55
55
|
checkId: "WK8407",
|
|
56
56
|
severity: "warning",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
*/
|
|
37
37
|
import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
38
38
|
import { collectSecretDeclarations } from "@intentius/chant/secret-provenance";
|
|
39
|
-
import { extractPodSpec, type K8sManifest } from "./k8s-helpers";
|
|
39
|
+
import { extractPodSpec, type K8sManifest, nameOf } from "./k8s-helpers";
|
|
40
40
|
import { allManifests } from "./argo-helpers";
|
|
41
41
|
import { resolveEncryptedSecretClaims } from "./sops-helpers";
|
|
42
42
|
|
|
@@ -192,7 +192,7 @@ export const wk8503: PostSynthCheck = {
|
|
|
192
192
|
for (const manifest of manifests) {
|
|
193
193
|
const podSpec = extractPodSpec(manifest);
|
|
194
194
|
if (!podSpec) continue;
|
|
195
|
-
const workload = manifest
|
|
195
|
+
const workload = nameOf(manifest, manifest.kind ?? "workload");
|
|
196
196
|
const namespace = manifest.metadata?.namespace;
|
|
197
197
|
|
|
198
198
|
const reported = new Set<string>();
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import { describe, expect, it } from "vitest";
|
|
8
8
|
import type { IRNode } from "@intentius/chant/graph-ir";
|
|
9
9
|
import { reconstructIndexedEdges, refRuleId, type ReferenceCatalog } from "@intentius/chant/graph-refs";
|
|
10
|
+
import type { ComposedNode, WorkspaceGraph } from "@intentius/chant/workspace/compose-graph";
|
|
11
|
+
import { placeCatalogPass, runCatalogPass } from "@intentius/chant/workspace/catalog-edges";
|
|
10
12
|
import { k8sReferenceCatalog } from "./reference-catalog";
|
|
11
13
|
import { k8sPlugin } from "./plugin";
|
|
12
14
|
|
|
@@ -55,7 +57,9 @@ describe("k8s reference catalog", () => {
|
|
|
55
57
|
});
|
|
56
58
|
|
|
57
59
|
describe("each rule draws its edge", () => {
|
|
60
|
+
// A rule with a `join` spans two nodes and has its own fixtures (./external-secret-catalog.test.ts).
|
|
58
61
|
for (const [i, rule] of k8sReferenceCatalog.refs.entries()) {
|
|
62
|
+
if (rule.join) continue;
|
|
59
63
|
const to = rule.targetKind ?? rule.indexedTargetKind!;
|
|
60
64
|
it(`${rule.from} ${rule.path} -> ${to}`, () => {
|
|
61
65
|
const value = `target-name-${i}`;
|
|
@@ -171,3 +175,77 @@ describe("k8s reference catalog", () => {
|
|
|
171
175
|
});
|
|
172
176
|
});
|
|
173
177
|
});
|
|
178
|
+
|
|
179
|
+
describe("on a composed workspace graph (#5097)", () => {
|
|
180
|
+
const RULE = "k8s:K8s::Apps::Deployment:spec.template.spec.serviceAccountName";
|
|
181
|
+
const composed = (member: string, id: string, kind: string, attrs: Record<string, unknown>): ComposedNode => ({ id: `${member}/${id}`, kind, lexicon: LEXICON, attrs, member });
|
|
182
|
+
const deployment = (sa: string, namespace: string | null = "shop") =>
|
|
183
|
+
composed("app", "web", "K8s::Apps::Deployment", { metadata: { name: "web", ...(namespace ? { namespace } : {}) }, spec: { template: { spec: { serviceAccountName: sa } } } });
|
|
184
|
+
const account = (member: string, namespace: string | null = "shop") =>
|
|
185
|
+
composed(member, "runner", "K8s::Core::ServiceAccount", { metadata: { name: "runner", ...(namespace ? { namespace } : {}) } });
|
|
186
|
+
const pass = (nodes: ComposedNode[]) => runCatalogPass(nodes, [{ lexicon: LEXICON, catalog: k8sReferenceCatalog }]);
|
|
187
|
+
const graphOf = (nodes: ComposedNode[]): WorkspaceGraph => ({
|
|
188
|
+
version: 1,
|
|
189
|
+
workspace: { name: "w", root: "." },
|
|
190
|
+
members: [],
|
|
191
|
+
nodes,
|
|
192
|
+
edges: [],
|
|
193
|
+
groups: { byMember: {} },
|
|
194
|
+
exports: [],
|
|
195
|
+
imports: [],
|
|
196
|
+
links: [],
|
|
197
|
+
collectors: [],
|
|
198
|
+
records: [],
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it("joins a Deployment in one member to the ServiceAccount another member holds in the same namespace", () => {
|
|
202
|
+
const out = pass([deployment("runner"), account("rbac")]);
|
|
203
|
+
expect(out.edges).toEqual([
|
|
204
|
+
expect.objectContaining({ from: "app/web", to: "rbac/runner", rule: RULE, origin: "derived", relation: "reference", member: "app" }),
|
|
205
|
+
]);
|
|
206
|
+
expect(out.dangling.filter((d) => d.rule === RULE)).toEqual([]);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it("lists a name no node holds in dangling with its rule", () => {
|
|
210
|
+
const out = pass([deployment("missing"), account("rbac")]);
|
|
211
|
+
expect(out.edges.filter((e) => e.rule === RULE)).toEqual([]);
|
|
212
|
+
expect(out.dangling.filter((d) => d.rule === RULE)).toEqual([
|
|
213
|
+
{ from: "app/web", kind: "ref", path: "spec.template.spec.serviceAccountName", value: "missing", member: "app", rule: RULE, targetKind: "K8s::Core::ServiceAccount" },
|
|
214
|
+
]);
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it("draws no edge when two members hold the name there, and records both candidates", () => {
|
|
218
|
+
const out = pass([deployment("runner"), account("rbac"), account("rbac2")]);
|
|
219
|
+
expect(out.edges.filter((e) => e.rule === RULE)).toEqual([]);
|
|
220
|
+
expect(out.ambiguous).toEqual([
|
|
221
|
+
{ from: "app/web", member: "app", rule: RULE, path: "spec.template.spec.serviceAccountName", value: "runner", candidates: ["rbac/runner", "rbac2/runner"] },
|
|
222
|
+
]);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it("keeps a name inside its namespace, and a namespace-less object inside its member", () => {
|
|
226
|
+
const missing = (nodes: ComposedNode[]) => pass(nodes).dangling.filter((d) => d.rule === RULE).map((d) => d.value);
|
|
227
|
+
expect(missing([deployment("runner"), account("rbac", "other")])).toEqual(["runner"]);
|
|
228
|
+
expect(missing([deployment("runner", null), account("rbac", null)])).toEqual(["runner"]);
|
|
229
|
+
const same = [deployment("runner", null), { ...account("app", null), id: "app/runner" }];
|
|
230
|
+
expect(pass(same).edges.map((e) => e.to)).toEqual(["app/runner"]);
|
|
231
|
+
// The namespace is a node too: a Namespace any member declares contains the objects in it.
|
|
232
|
+
const ns = composed("base", "shop", "K8s::Core::Namespace", { metadata: { name: "shop" } });
|
|
233
|
+
expect(pass([deployment("runner"), account("rbac"), ns]).edges.filter((e) => e.relation === "containment").map((e) => `${e.from}>${e.to}`)).toEqual(["app/web>base/shop", "rbac/runner>base/shop"]);
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it("places the pass on the document's nodes at --detail 0, and names the rule", () => {
|
|
237
|
+
const graph = graphOf([]);
|
|
238
|
+
placeCatalogPass(graph, pass([deployment("runner"), account("rbac")]), new Map([["app/web", "app/k8s"], ["rbac/runner", "rbac/k8s"]]));
|
|
239
|
+
expect(graph.edges).toEqual([expect.objectContaining({ from: "app/k8s", to: "rbac/k8s", rule: RULE, member: "app" })]);
|
|
240
|
+
expect(graph.catalog?.rules[RULE]).toEqual({ lexicon: LEXICON, from: "K8s::Apps::Deployment", path: "spec.template.spec.serviceAccountName", relation: "reference", targetKinds: ["K8s::Core::ServiceAccount"], label: "runs as" });
|
|
241
|
+
expect(graph.catalog?.lexicons).toEqual([LEXICON]);
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it("gives a pair the declared graph already joins no second edge", () => {
|
|
245
|
+
const graph = graphOf([]);
|
|
246
|
+
graph.edges = [{ from: "app/web", to: "rbac/runner", kind: "ref", member: "app" }];
|
|
247
|
+
placeCatalogPass(graph, pass([deployment("runner"), account("rbac")]));
|
|
248
|
+
expect(graph.edges).toHaveLength(1);
|
|
249
|
+
expect(graph.edges[0].origin).toBeUndefined();
|
|
250
|
+
});
|
|
251
|
+
});
|