@intentius/chant-lexicon-k8s 0.41.17 → 0.41.19
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/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "33f334c5e62c1afb85d92d215862e87c92e454a204b6cb979978c99806da3a3e",
|
|
5
5
|
"meta.json": "c0b141b882c51483c1d1aead748a0eb171aceca7432edd2a0404b062bf6d7831",
|
|
6
6
|
"types/index.d.ts": "3be2af7494aca94adfa16269cb9c4e7a155529872207a3d70b0c4d39914f9eec",
|
|
7
7
|
"rules/argo-appset-single-project.ts": "afa9f310753aa2d475f35012b13135b2dfaebed2a35d44edbe185ebc07673674",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"skills/chant-k8s-aks.md": "e18f0e2b055f72cd7a37deaf258d7027c2d4d3e286e8fd4975b27a1f981a3ad9",
|
|
51
51
|
"skills/chant-k8s-argo.md": "b1a0b826559d8c5033a479c5781efaf650320f0aee4419d8841170bd3393cea5"
|
|
52
52
|
},
|
|
53
|
-
"composite": "
|
|
53
|
+
"composite": "f6735e62a85a052fe7dffe5c38147933df2bcd8254009f5d747a6a1410409f5f"
|
|
54
54
|
}
|
package/dist/manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kubectl.d.ts","sourceRoot":"","sources":["../../../src/op/activities/kubectl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAaH,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI3E;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD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AkC,GAC1C,OAAO,CAAC,mBAAmB,CAAC,CAkE9B;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,gBAAgB,EACtB,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,GAAE,YAAkC,GAC1C,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-k8s",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.19",
|
|
4
4
|
"description": "Kubernetes lexicon for chant — declarative IaC in TypeScript",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"zod": "^4.3.6",
|
|
87
|
-
"@intentius/chant": "^0.41.
|
|
87
|
+
"@intentius/chant": "^0.41.19",
|
|
88
88
|
"typescript": "^5.9.3"
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -205,6 +205,39 @@ describe("kubectlApply", () => {
|
|
|
205
205
|
expect(requests.map((r) => r.query.force)).toEqual(["false", "true", "false", "true"]);
|
|
206
206
|
});
|
|
207
207
|
|
|
208
|
+
test("a controller echoing chant's marker label is retaken too — chant owns its reserved channel", async () => {
|
|
209
|
+
// An operator that reconciles whole objects becomes SSA owner of labels it
|
|
210
|
+
// merely echoed (observed live: kubemicrovm's microvmimagereconciler
|
|
211
|
+
// owning .metadata.labels.chant.intentius.io/stack). It never chose that
|
|
212
|
+
// value; the marker namespace is chant's.
|
|
213
|
+
const file = join(dir, "k8s.yaml");
|
|
214
|
+
writeFileSync(file, deploymentYaml);
|
|
215
|
+
const cluster = fakeCluster({
|
|
216
|
+
respond: (req) => {
|
|
217
|
+
if (req.method !== "PATCH") return undefined;
|
|
218
|
+
if (req.query.force === "true") return { body: JSON.parse(String(req.body)) };
|
|
219
|
+
return {
|
|
220
|
+
status: 409,
|
|
221
|
+
body: {
|
|
222
|
+
...statusBody(409, "Conflict", 'Apply failed with 1 conflict: conflict with "microvmimagereconciler"'),
|
|
223
|
+
details: {
|
|
224
|
+
causes: [
|
|
225
|
+
{
|
|
226
|
+
type: "FieldManagerConflict",
|
|
227
|
+
message: 'conflict with "microvmimagereconciler"',
|
|
228
|
+
field: ".metadata.labels.chant.intentius.io/stack",
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
const result = await applyManifest({ manifest: file, stack: "kmv-workload" }, undefined, cluster.connector);
|
|
238
|
+
expect(result.applied).toHaveLength(2);
|
|
239
|
+
});
|
|
240
|
+
|
|
208
241
|
test("a conflict involving any FOREIGN manager still refuses — self-retake never widens", async () => {
|
|
209
242
|
const file = join(dir, "k8s.yaml");
|
|
210
243
|
writeFileSync(file, deploymentYaml);
|
|
@@ -200,20 +200,38 @@ async function resolveApplyIdentity(
|
|
|
200
200
|
*/
|
|
201
201
|
interface ConflictErrorLike {
|
|
202
202
|
name: string;
|
|
203
|
-
conflicts?: Array<{ manager?: unknown }>;
|
|
203
|
+
conflicts?: Array<{ manager?: unknown; field?: unknown }>;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
/** chant's reserved label channel — the `chant.intentius.io/*` keys the
|
|
207
|
+
* ownership marker lives under, as a conflict-cause field-path prefix. */
|
|
208
|
+
const MARKER_FIELD_PREFIX = `.metadata.labels.${LABEL_OWNERSHIP_KEYS.stack.split("/")[0]}/`;
|
|
209
|
+
|
|
206
210
|
/**
|
|
207
|
-
* Is
|
|
208
|
-
*
|
|
209
|
-
*
|
|
211
|
+
* Is this conflict one chant may retake without a human? Two shapes qualify,
|
|
212
|
+
* per contested field:
|
|
213
|
+
*
|
|
214
|
+
* - the owning manager is chant itself (`chant` bare or `chant:<stack>`) —
|
|
215
|
+
* the ownership-stack → unit-stack migration, or a renamed deploy unit; or
|
|
216
|
+
* - the field lives in chant's OWN reserved label channel
|
|
217
|
+
* (`chant.intentius.io/*`). A controller that reconciles whole objects
|
|
218
|
+
* echoes existing labels and becomes their SSA owner as a side effect
|
|
219
|
+
* (observed live: kubemicrovm's `microvmimagereconciler` owning
|
|
220
|
+
* `.metadata.labels.chant.intentius.io/stack`) — it never chose that value,
|
|
221
|
+
* and chant is the authority for its marker namespace no matter who last
|
|
222
|
+
* echoed it.
|
|
223
|
+
*
|
|
224
|
+
* Any contested field outside both shapes — a spec field, an app label —
|
|
225
|
+
* keeps the presented refusal: that IS a dispute with another tool.
|
|
210
226
|
*/
|
|
211
227
|
function isChantSelfConflict(err: unknown): boolean {
|
|
212
228
|
const e = err as ConflictErrorLike;
|
|
213
229
|
if (!e || e.name !== "FieldManagerConflictError" || !Array.isArray(e.conflicts) || e.conflicts.length === 0) return false;
|
|
214
|
-
return e.conflicts.every(
|
|
215
|
-
|
|
216
|
-
|
|
230
|
+
return e.conflicts.every((c) => {
|
|
231
|
+
const chantManager = typeof c.manager === "string" && (c.manager === "chant" || c.manager.startsWith("chant:"));
|
|
232
|
+
const markerField = typeof c.field === "string" && c.field.startsWith(MARKER_FIELD_PREFIX);
|
|
233
|
+
return chantManager || markerField;
|
|
234
|
+
});
|
|
217
235
|
}
|
|
218
236
|
|
|
219
237
|
/**
|