pepr 0.50.0-nightly.0 → 0.50.0-nightly.10
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/cli/crd/create.d.ts.map +1 -1
- package/dist/cli/deploy.d.ts +3 -0
- package/dist/cli/deploy.d.ts.map +1 -1
- package/dist/cli/docs/cli.helper.d.ts.map +1 -1
- package/dist/cli/docs/markdown.helper.d.ts.map +1 -1
- package/dist/cli/update/index.d.ts.map +1 -1
- package/dist/cli.js +56 -66
- package/dist/controller.js +1 -1
- package/dist/lib/assets/assets.d.ts.map +1 -1
- package/dist/lib/assets/defaultTestObjects.d.ts.map +1 -1
- package/dist/lib/assets/webhooks.d.ts.map +1 -1
- package/dist/lib/controller/index.d.ts.map +1 -1
- package/dist/lib/controller/storeCache.d.ts.map +1 -1
- package/dist/lib/core/capability.d.ts.map +1 -1
- package/dist/lib/core/module.d.ts.map +1 -1
- package/dist/lib/core/storage.d.ts.map +1 -1
- package/dist/lib/deploymentChecks.d.ts +9 -0
- package/dist/lib/deploymentChecks.d.ts.map +1 -1
- package/dist/lib/filter/adjudicators/binding.d.ts.map +1 -1
- package/dist/lib/helpers.d.ts.map +1 -1
- package/dist/lib/mutate-request.d.ts.map +1 -1
- package/dist/lib/telemetry/metrics.d.ts.map +1 -1
- package/dist/lib/validate-request.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/cli/deploy.ts +12 -8
- package/src/cli/update/index.ts +0 -27
- package/src/lib/deploymentChecks.ts +21 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/cli/crd/create.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,QAAA,MAAM,MAAM,SAyBR,CAAC;AAEL,eAAe,MAAM,CAAC;AAEtB,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/cli/crd/create.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,QAAA,MAAM,MAAM,SAyBR,CAAC;AAEL,eAAe,MAAM,CAAC;AAEtB,eAAO,MAAM,mBAAmB,GAC9B,OAAO,MAAM,EACb,SAAS,MAAM,EACf,MAAM,MAAM,EACZ,MAAM;IACJ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,KACA,MA8EF,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAKrE"}
|
package/dist/cli/deploy.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CapabilityExport } from "../lib/types";
|
|
2
|
+
import { Assets } from "../lib/assets/assets";
|
|
1
3
|
import { RootCmd } from "./root";
|
|
2
4
|
export interface ImagePullSecretDetails {
|
|
3
5
|
pullSecret?: string;
|
|
@@ -15,4 +17,5 @@ export declare function getUserConfirmation(opts: {
|
|
|
15
17
|
confirm: boolean;
|
|
16
18
|
}): Promise<boolean>;
|
|
17
19
|
export default function (program: RootCmd): void;
|
|
20
|
+
export declare function validateNamespaces(capability: CapabilityExport, webhook: Assets): void;
|
|
18
21
|
//# sourceMappingURL=deploy.d.ts.map
|
package/dist/cli/deploy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/cli/deploy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/cli/deploy.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAQjC,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,sBAAsB,GAAG;IAC/E,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAmCA;AAED,MAAM,MAAM,+BAA+B,GAAG,QAAQ,CAAC,sBAAsB,CAAC,CAAC;AAkB/E,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAatF;AAkCD,MAAM,CAAC,OAAO,WAAW,OAAO,EAAE,OAAO,GAAG,IAAI,CA8B/C;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAQtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.helper.d.ts","sourceRoot":"","sources":["../../../src/cli/docs/cli.helper.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"cli.helper.d.ts","sourceRoot":"","sources":["../../../src/cli/docs/cli.helper.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,KAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CASzF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAI,QAAQ,MAAM,KAAG,MAW1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.helper.d.ts","sourceRoot":"","sources":["../../../src/cli/docs/markdown.helper.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"markdown.helper.d.ts","sourceRoot":"","sources":["../../../src/cli/docs/markdown.helper.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAK,MAAW,KAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAoB3F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/update/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,CAAC,OAAO,WAAW,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/update/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,CAAC,OAAO,WAAW,OAAO,EAAE,OAAO,GAAG,IAAI,CA2E/C"}
|
package/dist/cli.js
CHANGED
|
@@ -450,8 +450,7 @@ var require_anchors = __commonJS({
|
|
|
450
450
|
return {
|
|
451
451
|
onAnchor: (source) => {
|
|
452
452
|
aliasObjects.push(source);
|
|
453
|
-
|
|
454
|
-
prevAnchors = anchorNames(doc);
|
|
453
|
+
prevAnchors ?? (prevAnchors = anchorNames(doc));
|
|
455
454
|
const anchor = findNewAnchor(prefix, prevAnchors);
|
|
456
455
|
prevAnchors.add(anchor);
|
|
457
456
|
return anchor;
|
|
@@ -627,23 +626,35 @@ var require_Alias = __commonJS({
|
|
|
627
626
|
* Resolve the value of this alias within `doc`, finding the last
|
|
628
627
|
* instance of the `source` anchor before this node.
|
|
629
628
|
*/
|
|
630
|
-
resolve(doc) {
|
|
629
|
+
resolve(doc, ctx) {
|
|
630
|
+
let nodes;
|
|
631
|
+
if (ctx?.aliasResolveCache) {
|
|
632
|
+
nodes = ctx.aliasResolveCache;
|
|
633
|
+
} else {
|
|
634
|
+
nodes = [];
|
|
635
|
+
visit.visit(doc, {
|
|
636
|
+
Node: (_key, node) => {
|
|
637
|
+
if (identity.isAlias(node) || identity.hasAnchor(node))
|
|
638
|
+
nodes.push(node);
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
if (ctx)
|
|
642
|
+
ctx.aliasResolveCache = nodes;
|
|
643
|
+
}
|
|
631
644
|
let found = void 0;
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
}
|
|
639
|
-
});
|
|
645
|
+
for (const node of nodes) {
|
|
646
|
+
if (node === this)
|
|
647
|
+
break;
|
|
648
|
+
if (node.anchor === this.source)
|
|
649
|
+
found = node;
|
|
650
|
+
}
|
|
640
651
|
return found;
|
|
641
652
|
}
|
|
642
653
|
toJSON(_arg, ctx) {
|
|
643
654
|
if (!ctx)
|
|
644
655
|
return { source: this.source };
|
|
645
656
|
const { anchors: anchors2, doc, maxAliasCount } = ctx;
|
|
646
|
-
const source = this.resolve(doc);
|
|
657
|
+
const source = this.resolve(doc, ctx);
|
|
647
658
|
if (!source) {
|
|
648
659
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
649
660
|
throw new ReferenceError(msg);
|
|
@@ -772,8 +783,7 @@ var require_createNode = __commonJS({
|
|
|
772
783
|
if (aliasDuplicateObjects && value && typeof value === "object") {
|
|
773
784
|
ref = sourceObjects.get(value);
|
|
774
785
|
if (ref) {
|
|
775
|
-
|
|
776
|
-
ref.anchor = onAnchor(value);
|
|
786
|
+
ref.anchor ?? (ref.anchor = onAnchor(value));
|
|
777
787
|
return new Alias.Alias(ref.anchor);
|
|
778
788
|
} else {
|
|
779
789
|
ref = { anchor: null, node: null };
|
|
@@ -1330,7 +1340,7 @@ ${indent}${start}${value}${end}`;
|
|
|
1330
1340
|
if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) {
|
|
1331
1341
|
return quotedString(value, ctx);
|
|
1332
1342
|
}
|
|
1333
|
-
if (
|
|
1343
|
+
if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
1334
1344
|
return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);
|
|
1335
1345
|
}
|
|
1336
1346
|
if (!implicitKey && !inFlow && type !== Scalar.Scalar.PLAIN && value.includes("\n")) {
|
|
@@ -1462,7 +1472,7 @@ var require_stringify = __commonJS({
|
|
|
1462
1472
|
tagObj = tags.find((t) => t.nodeClass && obj instanceof t.nodeClass);
|
|
1463
1473
|
}
|
|
1464
1474
|
if (!tagObj) {
|
|
1465
|
-
const name2 = obj?.constructor?.name ?? typeof obj;
|
|
1475
|
+
const name2 = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj);
|
|
1466
1476
|
throw new Error(`Tag not resolved for ${name2} value`);
|
|
1467
1477
|
}
|
|
1468
1478
|
return tagObj;
|
|
@@ -1476,7 +1486,7 @@ var require_stringify = __commonJS({
|
|
|
1476
1486
|
anchors$1.add(anchor);
|
|
1477
1487
|
props.push(`&${anchor}`);
|
|
1478
1488
|
}
|
|
1479
|
-
const tag = node.tag
|
|
1489
|
+
const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);
|
|
1480
1490
|
if (tag)
|
|
1481
1491
|
props.push(doc.directives.tagString(tag));
|
|
1482
1492
|
return props.join(" ");
|
|
@@ -1499,8 +1509,7 @@ var require_stringify = __commonJS({
|
|
|
1499
1509
|
}
|
|
1500
1510
|
let tagObj = void 0;
|
|
1501
1511
|
const node = identity.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o });
|
|
1502
|
-
|
|
1503
|
-
tagObj = getTagObject(ctx.doc.schema.tags, node);
|
|
1512
|
+
tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
|
|
1504
1513
|
const props = stringifyProps(node, tagObj, ctx);
|
|
1505
1514
|
if (props.length > 0)
|
|
1506
1515
|
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
@@ -1652,7 +1661,7 @@ ${ctx.indent}`;
|
|
|
1652
1661
|
var require_log = __commonJS({
|
|
1653
1662
|
"node_modules/yaml/dist/log.js"(exports2) {
|
|
1654
1663
|
"use strict";
|
|
1655
|
-
var node_process = require("
|
|
1664
|
+
var node_process = require("process");
|
|
1656
1665
|
function debug(logLevel, ...messages) {
|
|
1657
1666
|
if (logLevel === "debug")
|
|
1658
1667
|
console.log(...messages);
|
|
@@ -2557,7 +2566,7 @@ var require_schema2 = __commonJS({
|
|
|
2557
2566
|
var require_binary = __commonJS({
|
|
2558
2567
|
"node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports2) {
|
|
2559
2568
|
"use strict";
|
|
2560
|
-
var node_buffer = require("
|
|
2569
|
+
var node_buffer = require("buffer");
|
|
2561
2570
|
var Scalar = require_Scalar();
|
|
2562
2571
|
var stringifyString = require_stringifyString();
|
|
2563
2572
|
var binary = {
|
|
@@ -2602,8 +2611,7 @@ var require_binary = __commonJS({
|
|
|
2602
2611
|
} else {
|
|
2603
2612
|
throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
|
|
2604
2613
|
}
|
|
2605
|
-
|
|
2606
|
-
type = Scalar.Scalar.BLOCK_LITERAL;
|
|
2614
|
+
type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
|
|
2607
2615
|
if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
|
|
2608
2616
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
2609
2617
|
const n = Math.ceil(str.length / lineWidth);
|
|
@@ -3807,8 +3815,7 @@ var require_resolve_props = __commonJS({
|
|
|
3807
3815
|
if (token.source.endsWith(":"))
|
|
3808
3816
|
onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true);
|
|
3809
3817
|
anchor = token;
|
|
3810
|
-
|
|
3811
|
-
start = token.offset;
|
|
3818
|
+
start ?? (start = token.offset);
|
|
3812
3819
|
atNewline = false;
|
|
3813
3820
|
hasSpace = false;
|
|
3814
3821
|
reqSpace = true;
|
|
@@ -3817,8 +3824,7 @@ var require_resolve_props = __commonJS({
|
|
|
3817
3824
|
if (tag)
|
|
3818
3825
|
onError(token, "MULTIPLE_TAGS", "A node can have at most one tag");
|
|
3819
3826
|
tag = token;
|
|
3820
|
-
|
|
3821
|
-
start = token.offset;
|
|
3827
|
+
start ?? (start = token.offset);
|
|
3822
3828
|
atNewline = false;
|
|
3823
3829
|
hasSpace = false;
|
|
3824
3830
|
reqSpace = true;
|
|
@@ -4899,8 +4905,7 @@ var require_util_empty_scalar_position = __commonJS({
|
|
|
4899
4905
|
"use strict";
|
|
4900
4906
|
function emptyScalarPosition(offset, before, pos) {
|
|
4901
4907
|
if (before) {
|
|
4902
|
-
|
|
4903
|
-
pos = before.length;
|
|
4908
|
+
pos ?? (pos = before.length);
|
|
4904
4909
|
for (let i = pos - 1; i >= 0; --i) {
|
|
4905
4910
|
let st = before[i];
|
|
4906
4911
|
switch (st.type) {
|
|
@@ -5072,7 +5077,7 @@ var require_compose_doc = __commonJS({
|
|
|
5072
5077
|
var require_composer = __commonJS({
|
|
5073
5078
|
"node_modules/yaml/dist/compose/composer.js"(exports2) {
|
|
5074
5079
|
"use strict";
|
|
5075
|
-
var node_process = require("
|
|
5080
|
+
var node_process = require("process");
|
|
5076
5081
|
var directives = require_directives();
|
|
5077
5082
|
var Document = require_Document();
|
|
5078
5083
|
var errors = require_errors();
|
|
@@ -6298,7 +6303,7 @@ var require_line_counter = __commonJS({
|
|
|
6298
6303
|
var require_parser = __commonJS({
|
|
6299
6304
|
"node_modules/yaml/dist/parse/parser.js"(exports2) {
|
|
6300
6305
|
"use strict";
|
|
6301
|
-
var node_process = require("
|
|
6306
|
+
var node_process = require("process");
|
|
6302
6307
|
var cst = require_cst();
|
|
6303
6308
|
var lexer = require_lexer();
|
|
6304
6309
|
function includesToken(list, type) {
|
|
@@ -8836,7 +8841,7 @@ var gitIgnore = "# Ignore node_modules and Pepr build artifacts\nnode_modules\nd
|
|
|
8836
8841
|
var readmeMd = '# Pepr Module\n\nThis is a Pepr Module. [Pepr](https://github.com/defenseunicorns/pepr) is a type-safe Kubernetes middleware system.\n\nThe `capabilities` directory contains all the capabilities for this module. By default,\na capability is a single typescript file in the format of `capability-name.ts` that is\nimported in the root `pepr.ts` file as `import { HelloPepr } from "./capabilities/hello-pepr";`.\nBecause this is typescript, you can organize this however you choose, e.g. creating a sub-folder\nper-capability or common logic in shared files or folders.\n\nExample Structure:\n\n```\nModule Root\n\u251C\u2500\u2500 package.json\n\u251C\u2500\u2500 pepr.ts\n\u2514\u2500\u2500 capabilities\n \u251C\u2500\u2500 example-one.ts\n \u251C\u2500\u2500 example-three.ts\n \u2514\u2500\u2500 example-two.ts\n```\n';
|
|
8837
8842
|
var peprTS = 'import { PeprModule } from "pepr";\n// cfg loads your pepr configuration from package.json\nimport cfg from "./package.json";\n\n// HelloPepr is a demo capability that is included with Pepr. Comment or delete the line below to remove it.\nimport { HelloPepr } from "./capabilities/hello-pepr";\n\n/**\n * This is the main entrypoint for this Pepr module. It is run when the module is started.\n * This is where you register your Pepr configurations and capabilities.\n */\nnew PeprModule(cfg, [\n // "HelloPepr" is a demo capability that is included with Pepr. Comment or delete the line below to remove it.\n HelloPepr,\n\n // Your additional capabilities go here\n]);\n';
|
|
8838
8843
|
var helloPeprTS = 'import {\n Capability,\n K8s,\n Log,\n PeprMutateRequest,\n RegisterKind,\n a,\n fetch,\n fetchStatus,\n kind,\n} from "pepr";\nimport { MockAgent, setGlobalDispatcher } from "undici";\n\n/**\n * The HelloPepr Capability is an example capability to demonstrate some general concepts of Pepr.\n * To test this capability you run `pepr dev`and then run the following command:\n * `kubectl apply -f capabilities/hello-pepr.samples.yaml`\n */\nexport const HelloPepr = new Capability({\n name: "hello-pepr",\n description: "A simple example capability to show how things work.",\n namespaces: ["pepr-demo", "pepr-demo-2"],\n});\n\n// Use the \'When\' function to create a new action, use \'Store\' to persist data\nconst { When, Store } = HelloPepr;\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Namespace) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action removes the label `remove-me` when a Namespace is created.\n * Note we don\'t need to specify the namespace here, because we\'ve already specified\n * it in the Capability definition above.\n */\nWhen(a.Namespace)\n .IsCreated()\n .Mutate(ns => ns.RemoveLabel("remove-me"));\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Watch Action with K8s SSA (Namespace) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action watches for the `pepr-demo-2` namespace to be created, then creates a ConfigMap with\n * the name `pepr-ssa-demo` and adds the namespace UID to the ConfigMap data. Because Pepr uses\n * server-side apply for this operation, the ConfigMap will be created or updated if it already exists.\n */\nWhen(a.Namespace)\n .IsCreated()\n .WithName("pepr-demo-2")\n .Watch(async ns => {\n Log.info("Namespace pepr-demo-2 was created.");\n\n try {\n // Apply the ConfigMap using K8s server-side apply\n await K8s(kind.ConfigMap).Apply({\n metadata: {\n name: "pepr-ssa-demo",\n namespace: "pepr-demo-2",\n },\n data: {\n "ns-uid": ns.metadata.uid,\n },\n });\n } catch (error) {\n // You can use the Log object to log messages to the Pepr controller pod\n Log.error(error, "Failed to apply ConfigMap using server-side apply.");\n }\n\n // You can share data between actions using the Store, including between different types of actions\n Store.setItem("watch-data", "This data was stored by a Watch Action.");\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 1) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This is a single action. They can be in the same file or put imported from other files.\n * In this example, when a ConfigMap is created with the name `example-1`, then add a label and annotation.\n *\n * Equivalent to manually running:\n * `kubectl label configmap example-1 pepr=was-here`\n * `kubectl annotate configmap example-1 pepr.dev=annotations-work-too`\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .WithName("example-1")\n .Mutate(request => {\n request.SetLabel("pepr", "was-here").SetAnnotation("pepr.dev", "annotations-work-too");\n\n // Use the Store to persist data between requests and Pepr controller pods\n Store.setItem("example-1", "was-here");\n\n // This data is written asynchronously and can be read back via `Store.getItem()` or `Store.subscribe()`\n Store.setItem("example-1-data", JSON.stringify(request.Raw.data));\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate & Validate Actions (CM Example 2) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This combines 3 different types of actions: \'Mutate\', \'Validate\', and \'Watch\'. The order\n * of the actions is required, but each action is optional. In this example, when a ConfigMap is created\n * with the name `example-2`, then add a label and annotation, validate that the ConfigMap has the label\n * `pepr`, and log the request.\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .WithName("example-2")\n .Mutate(request => {\n // This Mutate Action will mutate the request before it is persisted to the cluster\n\n // Use `request.Merge()` to merge the new data with the existing data\n request.Merge({\n metadata: {\n labels: {\n pepr: "was-here",\n },\n annotations: {\n "pepr.dev": "annotations-work-too",\n },\n },\n });\n })\n .Validate(request => {\n // This Validate Action will validate the request before it is persisted to the cluster\n\n // Approve the request if the ConfigMap has the label \'pepr\'\n if (request.HasLabel("pepr")) {\n return request.Approve();\n }\n\n // Otherwise, deny the request with an error message (optional)\n return request.Deny("ConfigMap must have label \'pepr\'");\n })\n .Watch((cm, phase) => {\n // This Watch Action will watch the ConfigMap after it has been persisted to the cluster\n Log.info(cm, `ConfigMap was ${phase} with the name example-2`);\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 2a) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action shows a simple validation that will deny any ConfigMap that has the\n * annotation `evil`. Note that the `Deny()` function takes an optional second parameter that is a\n * user-defined status code to return.\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .Validate(request => {\n if (request.HasAnnotation("evil")) {\n return request.Deny("No evil CM annotations allowed.", 400);\n }\n\n return request.Approve();\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 3) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action combines different styles. Unlike the previous actions, this one will look\n * for any ConfigMap in the `pepr-demo` namespace that has the label `change=by-label` during either\n * CREATE or UPDATE. Note that all conditions added such as `WithName()`, `WithLabel()`, `InNamespace()`,\n * are ANDs so all conditions must be true for the request to be processed.\n */\nWhen(a.ConfigMap)\n .IsCreatedOrUpdated()\n .WithLabel("change", "by-label")\n .Mutate(request => {\n // The K8s object e are going to mutate\n const cm = request.Raw;\n\n // Get the username and uid of the K8s request\n const { username, uid } = request.Request.userInfo;\n\n // Store some data about the request in the configmap\n cm.data["username"] = username;\n cm.data["uid"] = uid;\n\n // You can still mix other ways of making changes too\n request.SetAnnotation("pepr.dev", "making-waves");\n });\n\n// This action validates the label `change=by-label` is deleted\nWhen(a.ConfigMap)\n .IsDeleted()\n .WithLabel("change", "by-label")\n .Validate(request => {\n // Log and then always approve the request\n Log.info("CM with label \'change=by-label\' was deleted.");\n return request.Approve();\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 4) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action show how you can use the `Mutate()` function without an inline function.\n * This is useful if you want to keep your actions small and focused on a single task,\n * or if you want to reuse the same function in multiple actions.\n */\nWhen(a.ConfigMap).IsCreated().WithName("example-4").Mutate(example4Cb);\n\n// This function uses the complete type definition, but is not required.\nfunction example4Cb(cm: PeprMutateRequest<a.ConfigMap>): void {\n cm.SetLabel("pepr.dev/first", "true");\n cm.SetLabel("pepr.dev/second", "true");\n cm.SetLabel("pepr.dev/third", "true");\n}\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 4a) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This is the same as Example 4, except this only operates on a CM in the `pepr-demo-2` namespace.\n * Note because the Capability defines namespaces, the namespace specified here must be one of those.\n * Alternatively, you can remove the namespace from the Capability definition and specify it here.\n */\nWhen(a.ConfigMap).IsCreated().InNamespace("pepr-demo-2").WithName("example-4a").Mutate(example4Cb);\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 5) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action is a bit more complex. It will look for any ConfigMap in the `pepr-demo`\n * namespace that has the label `chuck-norris` during CREATE. When it finds one, it will fetch a\n * random Chuck Norris joke from the API and add it to the ConfigMap. This is a great example of how\n * you can use Pepr to make changes to your K8s objects based on external data.\n *\n * Note the use of the `async` keyword. This is required for any action that uses `await` or `fetch()`.\n *\n * Also note we are passing a type to the `fetch()` function. This is optional, but it will help you\n * avoid mistakes when working with the data returned from the API. You can also use the `as` keyword to\n * cast the data returned from the API.\n *\n * These are equivalent:\n * ```ts\n * const joke = await fetch<TheChuckNorrisJoke>("https://icanhazdadjoke.com/");\n * const joke = await fetch("https://icanhazdadjoke.com/") as TheChuckNorrisJoke;\n * ```\n *\n * Alternatively, you can drop the type completely:\n *\n * ```ts\n * fetch("https://icanhazdadjoke.com")\n * ```\n */\ninterface TheChuckNorrisJoke {\n id: string;\n joke: string;\n status: number;\n}\n\nWhen(a.ConfigMap)\n .IsCreatedOrUpdated()\n .WithLabel("chuck-norris")\n .Mutate(cm => cm.SetLabel("got-jokes", "true"))\n .Watch(async cm => {\n const jokeURL = "https://icanhazdadjoke.com";\n\n const mockAgent: MockAgent = new MockAgent();\n setGlobalDispatcher(mockAgent);\n const mockClient = mockAgent.get(jokeURL);\n mockClient.intercept({ path: "/", method: "GET" }).reply(\n 200,\n {\n id: "R7UfaahVfFd",\n joke: "Funny joke goes here.",\n status: 200,\n },\n {\n headers: {\n "Content-Type": "application/json; charset=utf-8",\n },\n },\n );\n\n // Try/catch is not needed as a response object will always be returned\n const response = await fetch<TheChuckNorrisJoke>(jokeURL, {\n headers: {\n Accept: "application/json",\n },\n });\n\n // Instead, check the `response.ok` field\n if (response.ok) {\n const { joke } = response.data;\n // Add Joke to the Store\n await Store.setItemAndWait(jokeURL, joke);\n // Add the Chuck Norris joke to the configmap\n try {\n await K8s(kind.ConfigMap).Apply({\n metadata: {\n name: cm.metadata.name,\n namespace: cm.metadata.namespace,\n },\n data: {\n "chuck-says": Store.getItem(jokeURL),\n },\n });\n } catch (error) {\n Log.error(error, "Failed to apply ConfigMap using server-side apply.", {\n cm,\n });\n }\n }\n\n // You can also assert on different HTTP response codes\n if (response.status === fetchStatus.NOT_FOUND) {\n // Do something else\n return;\n }\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Secret Base64 Handling) *\n * ---------------------------------------------------------------------------------------------------\n *\n * The K8s JS client provides incomplete support for base64 encoding/decoding handling for secrets,\n * unlike the GO client. To make this less painful, Pepr automatically handles base64 encoding/decoding\n * secret data before and after the action is executed.\n */\nWhen(a.Secret)\n .IsCreated()\n .WithName("secret-1")\n .Mutate(request => {\n const secret = request.Raw;\n\n // This will be encoded at the end of all processing back to base64: "Y2hhbmdlLXdpdGhvdXQtZW5jb2Rpbmc="\n secret.data.magic = "change-without-encoding";\n\n // You can modify the data directly, and it will be encoded at the end of all processing\n secret.data.example += " - modified by Pepr";\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Untyped Custom Resource) *\n * ---------------------------------------------------------------------------------------------------\n *\n * Out of the box, Pepr supports all the standard Kubernetes objects. However, you can also create\n * your own types. This is useful if you are working with an Operator that creates custom resources.\n * There are two ways to do this, the first is to use the `When()` function with a `GenericKind`,\n * the second is to create a new class that extends `GenericKind` and use the `RegisterKind()` function.\n *\n * This example shows how to use the `When()` function with a `GenericKind`. Note that you\n * must specify the `group`, `version`, and `kind` of the object (if applicable). This is how Pepr knows\n * if the action should be triggered or not. Since we are using a `GenericKind`,\n * Pepr will not be able to provide any intellisense for the object, so you will need to refer to the\n * Kubernetes API documentation for the object you are working with.\n *\n * You will need to wait for the CRD in `hello-pepr.samples.yaml` to be created, then you can apply\n *\n * ```yaml\n * apiVersion: pepr.dev/v1\n * kind: Unicorn\n * metadata:\n * name: example-1\n * namespace: pepr-demo\n * spec:\n * message: replace-me\n * counter: 0\n * ```\n */\nWhen(a.GenericKind, {\n group: "pepr.dev",\n version: "v1",\n kind: "Unicorn",\n})\n .IsCreated()\n .WithName("example-1")\n .Mutate(request => {\n request.Merge({\n spec: {\n message: "Hello Pepr without type data!",\n counter: Math.random(),\n },\n });\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Typed Custom Resource) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This example shows how to use the `RegisterKind()` function to create a new type. This is useful\n * if you are working with an Operator that creates custom resources and you want to have intellisense\n * for the object. Note that you must specify the `group`, `version`, and `kind` of the object (if applicable)\n * as this is how Pepr knows if the action should be triggered or not.\n *\n * Once you register a new Kind with Pepr, you can use the `When()` function with the new Kind. Ideally,\n * you should register custom Kinds at the top of your Capability file or Pepr Module so they are available\n * to all actions, but we are putting it here for demonstration purposes.\n *\n * You will need to wait for the CRD in `hello-pepr.samples.yaml` to be created, then you can apply\n *\n * ```yaml\n * apiVersion: pepr.dev/v1\n * kind: Unicorn\n * metadata:\n * name: example-2\n * namespace: pepr-demo\n * spec:\n * message: replace-me\n * counter: 0\n * ```*\n */\nclass UnicornKind extends a.GenericKind {\n spec: {\n /**\n * JSDoc comments can be added to explain more details about the field.\n *\n * @example\n * ```ts\n * request.Raw.spec.message = "Hello Pepr!";\n * ```\n * */\n message: string;\n counter: number;\n };\n}\n\nRegisterKind(UnicornKind, {\n group: "pepr.dev",\n version: "v1",\n kind: "Unicorn",\n});\n\nWhen(UnicornKind)\n .IsCreated()\n .WithName("example-2")\n .Mutate(request => {\n request.Merge({\n spec: {\n message: "Hello Pepr with type data!",\n counter: Math.random(),\n },\n });\n });\n\n/**\n * A callback function that is called once the Pepr Store is fully loaded.\n */\nStore.onReady(data => {\n Log.info(data, "Pepr Store Ready");\n});\n';
|
|
8839
|
-
var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=18.0.0" }, files: ["/dist", "/src", "!src/**/*.test.ts", "!src/fixtures/**", "!dist/**/*.test.d.ts*", "!src/cli/docs/**"], version: "0.50.0-nightly.
|
|
8844
|
+
var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=18.0.0" }, files: ["/dist", "/src", "!src/**/*.test.ts", "!src/fixtures/**", "!dist/**/*.test.d.ts*", "!src/cli/docs/**"], version: "0.50.0-nightly.10", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { ci: "npm ci", "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", build: "tsc && node build.mjs && npm pack", "build:image": "npm run build && docker buildx build --output type=docker --tag pepr:dev .", "build:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr:dev $(node scripts/read-unicorn-build-args.mjs) .", "set:version": "node scripts/set-version.js", test: "npm run test:unit && npm run test:journey && npm run test:journey-wasm", "test:artifacts": "npm run build && jest src/build-artifact.test.ts", "test:docs": "jest --verbose src/cli/docs/*.test.ts", "test:integration": "npm run test:integration:prep && npm run test:integration:run", "test:integration:prep": "./integration/prep.sh", "test:integration:run": "jest --maxWorkers=4 integration", "test:journey": "npm run test:journey:k3d && npm run build && npm run test:journey:image && npm run test:journey:run", "test:journey-wasm": "npm run test:journey:k3d && npm run build && npm run test:journey:image && npm run test:journey:run-wasm", "test:journey-wasm:unicorn": "npm run test:journey:k3d && npm run build && npm run test:journey:image:unicorn && npm run test:journey:run-wasm", "test:journey:image": "docker buildx build --output type=docker --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "test:journey:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr:dev $(node scripts/read-unicorn-build-args.mjs) . && k3d image import pepr:dev -c pepr-dev", "test:journey:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system", "test:journey:run": "jest --detectOpenHandles journey/entrypoint.test.ts && npm run test:journey:upgrade", "test:journey:run-wasm": "jest --detectOpenHandles journey/entrypoint-wasm.test.ts", "test:journey:unicorn": "npm run test:journey:k3d && npm run test:journey:image:unicorn && npm run test:journey:run", "test:journey:upgrade": "npm run test:journey:k3d && npm run test:journey:image && jest --detectOpenHandles journey/pepr-upgrade.test.ts", "test:unit": 'npm run gen-data-json && jest src --coverage --detectOpenHandles --coverageDirectory=./coverage --testPathIgnorePatterns="build-artifact.test.ts|src/cli/docs/.*\\.test\\.ts"', "format:check": "eslint --ignore-pattern src/templates/eslint.config.mjs src && prettier --config .prettierrc src --check", "format:fix": "eslint --fix --ignore-pattern src/templates/eslint.config.mjs src && prettier --config .prettierrc src --write", prepare: `if [ "$NODE_ENV" != 'production' ]; then husky; fi` }, dependencies: { "@types/ramda": "0.30.2", express: "5.1.0", "fast-json-patch": "3.1.1", heredoc: "^1.3.1", "http-status-codes": "^2.3.0", "json-pointer": "^0.6.2", "kubernetes-fluent-client": "3.5.4", pino: "9.6.0", "pino-pretty": "13.0.0", "prom-client": "15.1.3", ramda: "0.30.1", sigstore: "3.1.0", "ts-morph": "^25.0.1" }, devDependencies: { "@commitlint/cli": "19.8.1", "@commitlint/config-conventional": "19.8.1", "@fast-check/jest": "^2.0.1", "@jest/globals": "29.7.0", "@types/eslint": "9.6.1", "@types/express": "5.0.1", "@types/json-pointer": "^1.0.34", "@types/node": "22.x.x", "@types/node-forge": "1.3.11", "@types/uuid": "10.0.0", "fast-check": "^4.0.0", globals: "^16.0.0", husky: "^9.1.6", jest: "29.7.0", "js-yaml": "^4.1.0", shellcheck: "^3.0.0", "ts-jest": "29.3.4", undici: "^7.0.1" }, overrides: { glob: "^9.0.0" }, peerDependencies: { "@types/prompts": "2.4.9", "@typescript-eslint/eslint-plugin": "8.32.1", "@typescript-eslint/parser": "8.32.1", commander: "13.1.0", esbuild: "0.25.0", eslint: "^9.26.0", "node-forge": "1.3.1", prettier: "3.5.3", prompts: "2.4.2", typescript: "5.8.3", uuid: "11.1.0" } };
|
|
8840
8845
|
|
|
8841
8846
|
// src/cli/init/utils.ts
|
|
8842
8847
|
var import_fs4 = require("fs");
|
|
@@ -10049,25 +10054,23 @@ async function setupWatcher(assets, hash, force) {
|
|
|
10049
10054
|
var import_kubernetes_fluent_client4 = require("kubernetes-fluent-client");
|
|
10050
10055
|
async function checkDeploymentStatus(namespace) {
|
|
10051
10056
|
const deployments = await (0, import_kubernetes_fluent_client4.K8s)(import_kubernetes_fluent_client4.kind.Deployment).InNamespace(namespace).Get();
|
|
10052
|
-
let
|
|
10053
|
-
let readyCount = 0;
|
|
10057
|
+
let allReady = true;
|
|
10054
10058
|
for (const deployment of deployments.items) {
|
|
10055
|
-
const
|
|
10056
|
-
|
|
10059
|
+
const name2 = deployment.metadata?.name ?? "unknown";
|
|
10060
|
+
const specReplicas = deployment.spec?.replicas ?? 0;
|
|
10061
|
+
const readyReplicas = deployment.status?.readyReplicas ?? 0;
|
|
10062
|
+
if (readyReplicas !== specReplicas) {
|
|
10057
10063
|
logger_default.info(
|
|
10058
|
-
`Waiting for deployment ${
|
|
10064
|
+
`Waiting for deployment ${name2} rollout to finish: ${readyReplicas} of ${specReplicas} replicas are available`
|
|
10059
10065
|
);
|
|
10066
|
+
allReady = false;
|
|
10060
10067
|
} else {
|
|
10061
10068
|
logger_default.info(
|
|
10062
|
-
`Deployment ${
|
|
10069
|
+
`Deployment ${name2} rolled out: ${readyReplicas} of ${specReplicas} replicas are available`
|
|
10063
10070
|
);
|
|
10064
|
-
readyCount++;
|
|
10065
10071
|
}
|
|
10066
10072
|
}
|
|
10067
|
-
|
|
10068
|
-
status = true;
|
|
10069
|
-
}
|
|
10070
|
-
return status;
|
|
10073
|
+
return allReady;
|
|
10071
10074
|
}
|
|
10072
10075
|
async function namespaceDeploymentsReady(namespace = "pepr-system") {
|
|
10073
10076
|
logger_default.info(`Checking ${namespace} deployments status...`);
|
|
@@ -10153,13 +10156,7 @@ async function buildAndDeployModule(image, force) {
|
|
|
10153
10156
|
webhook.image = image ?? webhook.image;
|
|
10154
10157
|
const capabilities = await loadCapabilities(webhook.path);
|
|
10155
10158
|
for (const capability of capabilities) {
|
|
10156
|
-
|
|
10157
|
-
namespaceComplianceValidator(
|
|
10158
|
-
capability,
|
|
10159
|
-
webhook.config.admission?.alwaysIgnore?.namespaces,
|
|
10160
|
-
false
|
|
10161
|
-
);
|
|
10162
|
-
namespaceComplianceValidator(capability, webhook.config.watch?.alwaysIgnore?.namespaces, true);
|
|
10159
|
+
validateNamespaces(capability, webhook);
|
|
10163
10160
|
}
|
|
10164
10161
|
try {
|
|
10165
10162
|
await webhook.deploy(deployWebhook, force, builtModule.cfg.pepr.webhookTimeout ?? 10);
|
|
@@ -10188,6 +10185,15 @@ function deploy_default(program2) {
|
|
|
10188
10185
|
await buildAndDeployModule(opts.image, opts.force);
|
|
10189
10186
|
});
|
|
10190
10187
|
}
|
|
10188
|
+
function validateNamespaces(capability, webhook) {
|
|
10189
|
+
namespaceComplianceValidator(capability, webhook.alwaysIgnore?.namespaces);
|
|
10190
|
+
namespaceComplianceValidator(
|
|
10191
|
+
capability,
|
|
10192
|
+
webhook.config.admission?.alwaysIgnore?.namespaces,
|
|
10193
|
+
false
|
|
10194
|
+
);
|
|
10195
|
+
namespaceComplianceValidator(capability, webhook.config.watch?.alwaysIgnore?.namespaces, true);
|
|
10196
|
+
}
|
|
10191
10197
|
|
|
10192
10198
|
// src/cli/dev.ts
|
|
10193
10199
|
var import_prompts2 = __toESM(require("prompts"));
|
|
@@ -10660,22 +10666,6 @@ function update_default(program2) {
|
|
|
10660
10666
|
}
|
|
10661
10667
|
console.log("Updating the Pepr module...");
|
|
10662
10668
|
try {
|
|
10663
|
-
let packageLockContent = "";
|
|
10664
|
-
let foundPackageLock = false;
|
|
10665
|
-
try {
|
|
10666
|
-
if (import_fs14.default.existsSync("./package-lock.json")) {
|
|
10667
|
-
packageLockContent = import_fs14.default.readFileSync("./package-lock.json", "utf-8");
|
|
10668
|
-
foundPackageLock = true;
|
|
10669
|
-
}
|
|
10670
|
-
} catch {
|
|
10671
|
-
}
|
|
10672
|
-
if (foundPackageLock && packageLockContent) {
|
|
10673
|
-
if (packageLockContent.indexOf('"eslint":') >= 0 && packageLockContent.match(/"eslint":\s*"[~^]?8\.[0-9]+\.[0-9]+"/)) {
|
|
10674
|
-
console.warn(
|
|
10675
|
-
"\nWarning: This Pepr module uses ESLint v8. Pepr will be upgraded to use v9 in a future release.\nSee eslint@9.0.0 release notes for more details: https://eslint.org/blog/2024/04/eslint-v9.0.0-released/"
|
|
10676
|
-
);
|
|
10677
|
-
}
|
|
10678
|
-
}
|
|
10679
10669
|
(0, import_child_process6.execSync)("npm install pepr@latest", {
|
|
10680
10670
|
stdio: "inherit"
|
|
10681
10671
|
});
|
package/dist/controller.js
CHANGED
|
@@ -51,7 +51,7 @@ if (process.env.LOG_LEVEL) {
|
|
|
51
51
|
var logger_default = Log;
|
|
52
52
|
|
|
53
53
|
// src/templates/data.json
|
|
54
|
-
var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=18.0.0" }, files: ["/dist", "/src", "!src/**/*.test.ts", "!src/fixtures/**", "!dist/**/*.test.d.ts*", "!src/cli/docs/**"], version: "0.50.0-nightly.
|
|
54
|
+
var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=18.0.0" }, files: ["/dist", "/src", "!src/**/*.test.ts", "!src/fixtures/**", "!dist/**/*.test.d.ts*", "!src/cli/docs/**"], version: "0.50.0-nightly.10", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { ci: "npm ci", "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", build: "tsc && node build.mjs && npm pack", "build:image": "npm run build && docker buildx build --output type=docker --tag pepr:dev .", "build:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr:dev $(node scripts/read-unicorn-build-args.mjs) .", "set:version": "node scripts/set-version.js", test: "npm run test:unit && npm run test:journey && npm run test:journey-wasm", "test:artifacts": "npm run build && jest src/build-artifact.test.ts", "test:docs": "jest --verbose src/cli/docs/*.test.ts", "test:integration": "npm run test:integration:prep && npm run test:integration:run", "test:integration:prep": "./integration/prep.sh", "test:integration:run": "jest --maxWorkers=4 integration", "test:journey": "npm run test:journey:k3d && npm run build && npm run test:journey:image && npm run test:journey:run", "test:journey-wasm": "npm run test:journey:k3d && npm run build && npm run test:journey:image && npm run test:journey:run-wasm", "test:journey-wasm:unicorn": "npm run test:journey:k3d && npm run build && npm run test:journey:image:unicorn && npm run test:journey:run-wasm", "test:journey:image": "docker buildx build --output type=docker --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "test:journey:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr:dev $(node scripts/read-unicorn-build-args.mjs) . && k3d image import pepr:dev -c pepr-dev", "test:journey:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system", "test:journey:run": "jest --detectOpenHandles journey/entrypoint.test.ts && npm run test:journey:upgrade", "test:journey:run-wasm": "jest --detectOpenHandles journey/entrypoint-wasm.test.ts", "test:journey:unicorn": "npm run test:journey:k3d && npm run test:journey:image:unicorn && npm run test:journey:run", "test:journey:upgrade": "npm run test:journey:k3d && npm run test:journey:image && jest --detectOpenHandles journey/pepr-upgrade.test.ts", "test:unit": 'npm run gen-data-json && jest src --coverage --detectOpenHandles --coverageDirectory=./coverage --testPathIgnorePatterns="build-artifact.test.ts|src/cli/docs/.*\\.test\\.ts"', "format:check": "eslint --ignore-pattern src/templates/eslint.config.mjs src && prettier --config .prettierrc src --check", "format:fix": "eslint --fix --ignore-pattern src/templates/eslint.config.mjs src && prettier --config .prettierrc src --write", prepare: `if [ "$NODE_ENV" != 'production' ]; then husky; fi` }, dependencies: { "@types/ramda": "0.30.2", express: "5.1.0", "fast-json-patch": "3.1.1", heredoc: "^1.3.1", "http-status-codes": "^2.3.0", "json-pointer": "^0.6.2", "kubernetes-fluent-client": "3.5.4", pino: "9.6.0", "pino-pretty": "13.0.0", "prom-client": "15.1.3", ramda: "0.30.1", sigstore: "3.1.0", "ts-morph": "^25.0.1" }, devDependencies: { "@commitlint/cli": "19.8.1", "@commitlint/config-conventional": "19.8.1", "@fast-check/jest": "^2.0.1", "@jest/globals": "29.7.0", "@types/eslint": "9.6.1", "@types/express": "5.0.1", "@types/json-pointer": "^1.0.34", "@types/node": "22.x.x", "@types/node-forge": "1.3.11", "@types/uuid": "10.0.0", "fast-check": "^4.0.0", globals: "^16.0.0", husky: "^9.1.6", jest: "29.7.0", "js-yaml": "^4.1.0", shellcheck: "^3.0.0", "ts-jest": "29.3.4", undici: "^7.0.1" }, overrides: { glob: "^9.0.0" }, peerDependencies: { "@types/prompts": "2.4.9", "@typescript-eslint/eslint-plugin": "8.32.1", "@typescript-eslint/parser": "8.32.1", commander: "13.1.0", esbuild: "0.25.0", eslint: "^9.26.0", "node-forge": "1.3.1", prettier: "3.5.3", prompts: "2.4.2", typescript: "5.8.3", uuid: "11.1.0" } };
|
|
55
55
|
|
|
56
56
|
// src/lib/k8s.ts
|
|
57
57
|
var import_kubernetes_fluent_client = require("kubernetes-fluent-client");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sour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AG,SAAS,KAC/B,OAAO,CAAC,8BAA8B,GAAG,gCAAgC,GAAG,IAAI,CAAC,EACtF,oBAAoB,CAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,eAAe,CAAC,EAAE,MAAM,KACrB,IAAI,CAAC,UAAU,GAAG,IAAI,EAC3B,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,MAAM,EAClF,UAAU,MAAM,KACf,OAAO,CAAC,IAAI,CAAC,CAqFd;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultTestObjects.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/defaultTestObjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,YAAY,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"defaultTestObjects.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/defaultTestObjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,YAAY,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,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B,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAS,WAAW,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAAmC,CAAC;AAE7E,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/webhooks.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAS,WAAW,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAAmC,CAAC;AAE7E,eAAO,MAAM,YAAY,GACvB,SAAS,OAAO,EAChB,iBAAiB,OAAO,KACvB,oBAAoB,GAAG,SAsBzB,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,OAAO,GACvB,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAYjC;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,WAAW,EAC7B,cAAc,SAAK,GAClB,OAAO,CAAC,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,8BAA8B,GAAG,IAAI,CAAC,CAsEzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/controller/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,M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I,CAwDhC;CA8KH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storeCache.d.ts","sourceRoot":"","sources":["../../../src/lib/controller/storeCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKzC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"storeCache.d.ts","sourceRoot":"","sources":["../../../src/lib/controller/storeCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKzC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,wBAAwB,GACnC,OAAO,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAChC,WAAW,MAAM,EACjB,MAAM,MAAM,KACX,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAqBnC,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,OAAO,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAChC,gBAAgB,MAAM,EACtB,IAAI,MAAM,EACV,WAAW,SAAS,KACnB,MAAM,CAAC,MAAM,EAAE,SAAS,CAqB1B,CAAC;AAEF,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAO/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../../src/lib/core/capability.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAA2B,MAAM,0BAA0B,CAAC;AAInG,OAAO,EAAE,SAAS,EAAE,O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AC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAqBtC;IAEK,gBAAgB,IAAI,OAAO;IAIlC;;;;;;OAMG;IACH,KAAK,EAAE,SAAS,CASd;IAEF;;;;;;OAMG;IACH,aAAa,EAAE,SAAS,CAStB;IAEF,IAAI,QAAQ,IAAI,OAAO,EAAE,CAExB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,UAAU,IAAI,MAAM,EAAE,CAEzB;gBAEW,GAAG,EAAE,aAAa;IAU9B;;OAEG;IACH,qBAAqB,QAAO,OAAO,CAWjC;IAEF;;;;OAIG;IACH,aAAa,QAAO,OAAO,CAWzB;IAEF;;;;;;;;OAQG;IACH,IAAI,GAAI,CAAC,SAAS,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,gBAAgB,KAAG,YAAY,CAAC,CAAC,CAAC,CAoQjF;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/lib/core/module.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AAGxE,qBAAa,UAAU;;IAGrB;;;;;;OAMG;gBAED,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,WAAW,EAClC,YAAY,GAAE,UAAU,EAAO,EAC/B,IAAI,GAAE,iBAAsB;IAqD9B;;;;;OAKG;IACH,KAAK,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/lib/core/module.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AAGxE,qBAAa,UAAU;;IAGrB;;;;;;OAMG;gBAED,EAAE,WAAW,EAAE,I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+
* A deployment is considered ready when the number of `readyReplicas` equals the desired `replicas`.
|
|
5
|
+
* Logs the rollout status of each deployment.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} namespace - The Kubernetes namespace to check.
|
|
8
|
+
* @returns {Promise<boolean>} - `true` if all deployments are ready, otherwise `false`.
|
|
9
|
+
*/
|
|
1
10
|
export declare function checkDeploymentStatus(namespace: string): Promise<boolean>;
|
|
2
11
|
export declare function namespaceDeploymentsReady(namespace?: string): Promise<true | undefined>;
|
|
3
12
|
//# sourceMappingURL=deploymentChecks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploymentChecks.d.ts","sourceRoot":"","sources":["../../src/lib/deploymentChecks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploymentChecks.d.ts","sourceRoot":"","sources":["../../src/lib/deploymentChecks.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAuB/E;AAGD,wBAAsB,yBAAyB,CAC7C,SAAS,GAAE,MAAsB,GAChC,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAW3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../../../../src/lib/filter/adjudicators/binding.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEpG,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,eAAO,MAAM,wBAAwB,+BAGpC,CAAC;AACF,eAAO,MAAM,wBAAwB,+BAAuC,CAAC;AAE7E,eAAO,MAAM,WAAW,8BAEP,CAAC;AAClB,eAAO,MAAM,WAAW,+BAAqC,CAAC;AAC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,EAAE,MAAM,EAAE,EAC5B,KAAK,CAAC,EAAE,OAAO,GACd,IAAI,CAiCN;AA8CD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMpD;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,MAW5C,CAAC;AAGF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAe3C;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAKnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutate-request.d.ts","sourceRoot":"","sources":["../../src/lib/mutate-request.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,qBAAa,iBAAiB,CAAC,CAAC,SAAS,gBAAgB;;IACvD,GAAG,EAAE,CAAC,CAAC;IAGP,IAAI,iBAAiB,IAAI,OAAO,CAE/B;IAED,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAElC;IAED,IAAI,WAAW,IAAI,gBAAgB,GAAG,SAAS,CAE9C;IAED,IAAI,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAEhD;gBAEW,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAetC,KAAK,
|
|
1
|
+
{"version":3,"file":"mutate-request.d.ts","sourceRoot":"","sources":["../../src/lib/mutate-request.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,qBAAa,iBAAiB,CAAC,CAAC,SAAS,gBAAgB;;IACvD,GAAG,EAAE,CAAC,CAAC;IAGP,IAAI,iBAAiB,IAAI,OAAO,CAE/B;IAED,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAElC;IAED,IAAI,WAAW,IAAI,gBAAgB,GAAG,SAAS,CAE9C;IAED,IAAI,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAEhD;gBAEW,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAetC,KAAK,GAAI,KAAK,WAAW,CAAC,CAAC,CAAC,KAAG,IAAI,CAEjC;IAEF,QAAQ,GAAI,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,IAAI,CAM3C;IAEF,aAAa,GAAI,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,IAAI,CAMhD;IAEF,WAAW,GAAI,KAAK,MAAM,KAAG,IAAI,CAK/B;IAEF,gBAAgB,GAAI,KAAK,MAAM,KAAG,IAAI,CAKpC;IAEF,QAAQ,GAAI,KAAK,MAAM,KAAG,OAAO,CAE/B;IAEF,aAAa,GAAI,KAAK,MAAM,KAAG,OAAO,CAEpC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/lib/telemetry/metrics.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAiB7E;;GAEG;AACH,qBAAa,gBAAgB;;IAiB3B;;;OAGG;gBACS,MAAM,SAAS;IAmC3B,UAAU,
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/lib/telemetry/metrics.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAiB7E;;GAEG;AACH,qBAAa,gBAAgB;;IAiB3B;;;OAGG;gBACS,MAAM,SAAS;IAmC3B,UAA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CAAC;IAIP;;;OAGG;IACH,IAAI,WAAW,IAAI,gBAAgB,GAAG,SAAS,CAE9C;IAED;;;OAGG;IACH,IAAI,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAEhD;IAED;;;OAGG;gBACS,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAgBtC;;;;;OAKG;IACH,QAAQ,
|
|
1
|
+
{"version":3,"file":"validate-request.d.ts","sourceRoot":"","sources":["../../src/lib/validate-request.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAG1E;;;GAGG;AACH,qBAAa,mBAAmB,CAAC,CAAC,SAAS,gBAAgB;;IACzD,GAAG,EAAE,CAAC,CAAC;IAIP;;;OAGG;IACH,IAAI,WAAW,IAAI,gBAAgB,GAAG,SAAS,CAE9C;IAED;;;OAGG;IACH,IAAI,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAEhD;IAED;;;OAGG;gBACS,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAgBtC;;;;;OAKG;IACH,QAAQ,GAAI,KAAK,MAAM,KAAG,OAAO,CAE/B;IAEF;;;;;OAKG;IACH,aAAa,GAAI,KAAK,MAAM,KAAG,OAAO,CAEpC;IAEF;;;;OAIG;IACH,OAAO,GAAI,WAAW,MAAM,EAAE,KAAG,sBAAsB,CAKrD;IAEF;;;;;;OAMG;IACH,IAAI,GACF,gBAAgB,MAAM,EACtB,aAAa,MAAM,EACnB,WAAW,MAAM,EAAE,KAClB,sBAAsB,CAOvB;CACH"}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"!dist/**/*.test.d.ts*",
|
|
18
18
|
"!src/cli/docs/**"
|
|
19
19
|
],
|
|
20
|
-
"version": "0.50.0-nightly.
|
|
20
|
+
"version": "0.50.0-nightly.10",
|
|
21
21
|
"main": "dist/lib.js",
|
|
22
22
|
"types": "dist/lib.d.ts",
|
|
23
23
|
"scripts": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"heredoc": "^1.3.1",
|
|
57
57
|
"http-status-codes": "^2.3.0",
|
|
58
58
|
"json-pointer": "^0.6.2",
|
|
59
|
-
"kubernetes-fluent-client": "3.5.
|
|
59
|
+
"kubernetes-fluent-client": "3.5.4",
|
|
60
60
|
"pino": "9.6.0",
|
|
61
61
|
"pino-pretty": "13.0.0",
|
|
62
62
|
"prom-client": "15.1.3",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"jest": "29.7.0",
|
|
82
82
|
"js-yaml": "^4.1.0",
|
|
83
83
|
"shellcheck": "^3.0.0",
|
|
84
|
-
"ts-jest": "29.3.
|
|
84
|
+
"ts-jest": "29.3.4",
|
|
85
85
|
"undici": "^7.0.1"
|
|
86
86
|
},
|
|
87
87
|
"overrides": {
|
|
@@ -89,15 +89,15 @@
|
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"@types/prompts": "2.4.9",
|
|
92
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
93
|
-
"@typescript-eslint/parser": "8.
|
|
92
|
+
"@typescript-eslint/eslint-plugin": "8.32.1",
|
|
93
|
+
"@typescript-eslint/parser": "8.32.1",
|
|
94
94
|
"commander": "13.1.0",
|
|
95
95
|
"esbuild": "0.25.0",
|
|
96
96
|
"eslint": "^9.26.0",
|
|
97
97
|
"node-forge": "1.3.1",
|
|
98
|
-
"prettier": "3.
|
|
98
|
+
"prettier": "3.5.3",
|
|
99
99
|
"prompts": "2.4.2",
|
|
100
|
-
"typescript": "5.
|
|
101
|
-
"uuid": "11.0
|
|
100
|
+
"typescript": "5.8.3",
|
|
101
|
+
"uuid": "11.1.0"
|
|
102
102
|
}
|
|
103
103
|
}
|
package/src/cli/deploy.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-FileCopyrightText: 2023-Present The Pepr Authors
|
|
3
3
|
|
|
4
4
|
import prompt from "prompts";
|
|
5
|
-
|
|
5
|
+
import { CapabilityExport } from "../lib/types";
|
|
6
6
|
import { Assets } from "../lib/assets/assets";
|
|
7
7
|
import { ImagePullSecret } from "../lib/types";
|
|
8
8
|
import { RootCmd } from "./root";
|
|
@@ -109,13 +109,7 @@ async function buildAndDeployModule(image: string, force: boolean): Promise<void
|
|
|
109
109
|
webhook.image = image ?? webhook.image;
|
|
110
110
|
const capabilities = await loadCapabilities(webhook.path);
|
|
111
111
|
for (const capability of capabilities) {
|
|
112
|
-
|
|
113
|
-
namespaceComplianceValidator(
|
|
114
|
-
capability,
|
|
115
|
-
webhook.config.admission?.alwaysIgnore?.namespaces,
|
|
116
|
-
false,
|
|
117
|
-
);
|
|
118
|
-
namespaceComplianceValidator(capability, webhook.config.watch?.alwaysIgnore?.namespaces, true);
|
|
112
|
+
validateNamespaces(capability, webhook);
|
|
119
113
|
}
|
|
120
114
|
try {
|
|
121
115
|
await webhook.deploy(deployWebhook, force, builtModule.cfg.pepr.webhookTimeout ?? 10);
|
|
@@ -163,3 +157,13 @@ export default function (program: RootCmd): void {
|
|
|
163
157
|
await buildAndDeployModule(opts.image, opts.force);
|
|
164
158
|
});
|
|
165
159
|
}
|
|
160
|
+
|
|
161
|
+
export function validateNamespaces(capability: CapabilityExport, webhook: Assets): void {
|
|
162
|
+
namespaceComplianceValidator(capability, webhook.alwaysIgnore?.namespaces);
|
|
163
|
+
namespaceComplianceValidator(
|
|
164
|
+
capability,
|
|
165
|
+
webhook.config.admission?.alwaysIgnore?.namespaces,
|
|
166
|
+
false,
|
|
167
|
+
);
|
|
168
|
+
namespaceComplianceValidator(capability, webhook.config.watch?.alwaysIgnore?.namespaces, true);
|
|
169
|
+
}
|
package/src/cli/update/index.ts
CHANGED
|
@@ -41,33 +41,6 @@ export default function (program: RootCmd): void {
|
|
|
41
41
|
console.log("Updating the Pepr module...");
|
|
42
42
|
|
|
43
43
|
try {
|
|
44
|
-
// Check if eslint v8 is a project dependency and warn about future upgrade
|
|
45
|
-
let packageLockContent = "";
|
|
46
|
-
let foundPackageLock = false;
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
// Try to find package-lock.json in the current directory
|
|
50
|
-
if (fs.existsSync("./package-lock.json")) {
|
|
51
|
-
packageLockContent = fs.readFileSync("./package-lock.json", "utf-8");
|
|
52
|
-
foundPackageLock = true;
|
|
53
|
-
}
|
|
54
|
-
} catch {
|
|
55
|
-
// Ignore errors and continue with installation
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// If we found the package-lock.json and could read it, check for eslint v8
|
|
59
|
-
if (foundPackageLock && packageLockContent) {
|
|
60
|
-
// Look for eslint version 8.x.x pattern in the file content
|
|
61
|
-
if (
|
|
62
|
-
packageLockContent.indexOf('"eslint":') >= 0 &&
|
|
63
|
-
packageLockContent.match(/"eslint":\s*"[~^]?8\.[0-9]+\.[0-9]+"/)
|
|
64
|
-
) {
|
|
65
|
-
console.warn(
|
|
66
|
-
"\nWarning: This Pepr module uses ESLint v8. Pepr will be upgraded to use v9 in a future release.\nSee eslint@9.0.0 release notes for more details: https://eslint.org/blog/2024/04/eslint-v9.0.0-released/",
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
44
|
// Update Pepr for the module
|
|
72
45
|
execSync("npm install pepr@latest", {
|
|
73
46
|
stdio: "inherit",
|
|
@@ -3,29 +3,38 @@
|
|
|
3
3
|
import { K8s, kind } from "kubernetes-fluent-client";
|
|
4
4
|
import Log from "./telemetry/logger";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Checks whether all deployments in the specified Kubernetes namespace are fully rolled out.
|
|
8
|
+
*
|
|
9
|
+
* A deployment is considered ready when the number of `readyReplicas` equals the desired `replicas`.
|
|
10
|
+
* Logs the rollout status of each deployment.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} namespace - The Kubernetes namespace to check.
|
|
13
|
+
* @returns {Promise<boolean>} - `true` if all deployments are ready, otherwise `false`.
|
|
14
|
+
*/
|
|
7
15
|
export async function checkDeploymentStatus(namespace: string): Promise<boolean> {
|
|
8
16
|
const deployments = await K8s(kind.Deployment).InNamespace(namespace).Get();
|
|
9
|
-
|
|
10
|
-
let
|
|
17
|
+
|
|
18
|
+
let allReady = true;
|
|
11
19
|
|
|
12
20
|
for (const deployment of deployments.items) {
|
|
13
|
-
const
|
|
14
|
-
|
|
21
|
+
const name = deployment.metadata?.name ?? "unknown";
|
|
22
|
+
const specReplicas = deployment.spec?.replicas ?? 0;
|
|
23
|
+
const readyReplicas = deployment.status?.readyReplicas ?? 0;
|
|
24
|
+
|
|
25
|
+
if (readyReplicas !== specReplicas) {
|
|
15
26
|
Log.info(
|
|
16
|
-
`Waiting for deployment ${
|
|
27
|
+
`Waiting for deployment ${name} rollout to finish: ${readyReplicas} of ${specReplicas} replicas are available`,
|
|
17
28
|
);
|
|
29
|
+
allReady = false;
|
|
18
30
|
} else {
|
|
19
31
|
Log.info(
|
|
20
|
-
`Deployment ${
|
|
32
|
+
`Deployment ${name} rolled out: ${readyReplicas} of ${specReplicas} replicas are available`,
|
|
21
33
|
);
|
|
22
|
-
readyCount++;
|
|
23
34
|
}
|
|
24
35
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
return status;
|
|
36
|
+
|
|
37
|
+
return allReady;
|
|
29
38
|
}
|
|
30
39
|
|
|
31
40
|
// wait for all deployments in the pepr-system namespace to be ready
|