pepr 0.18.1 → 20.0.0
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/README.md +1 -1
- package/dist/cli.js +169 -26
- package/dist/controller.js +1 -1
- package/dist/lib/assets/index.d.ts +2 -0
- package/dist/lib/assets/index.d.ts.map +1 -1
- package/dist/lib/assets/networking.d.ts.map +1 -1
- package/dist/lib/assets/pods.d.ts +5 -4
- package/dist/lib/assets/pods.d.ts.map +1 -1
- package/dist/lib/controller/index.d.ts.map +1 -1
- package/dist/lib/helpers.d.ts +6 -0
- package/dist/lib/helpers.d.ts.map +1 -1
- package/dist/lib/logger.d.ts +1 -8
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/module-helpers.d.ts +5 -0
- package/dist/lib/module-helpers.d.ts.map +1 -0
- package/dist/lib/module.d.ts +2 -0
- package/dist/lib/module.d.ts.map +1 -1
- package/dist/lib/types.d.ts +10 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib.d.ts +2 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +34 -10
- package/dist/lib.js.map +4 -4
- package/package.json +4 -4
- package/src/cli.ts +2 -0
- package/src/lib/assets/index.ts +10 -1
- package/src/lib/assets/networking.ts +8 -0
- package/src/lib/assets/pods.ts +26 -9
- package/src/lib/assets/webhooks.ts +1 -1
- package/src/lib/controller/index.ts +20 -13
- package/src/lib/controller/store.ts +1 -1
- package/src/lib/helpers.ts +69 -0
- package/src/lib/module-helpers.ts +27 -0
- package/src/lib/module.ts +2 -0
- package/src/lib/types.ts +10 -0
- package/src/lib.ts +2 -0
- package/website/assets/img/Pepr.Horizontal.white.svg +144 -0
- package/website/assets/scss/_styles_project.scss +4 -0
- package/website/content/en/docs/cli.md +16 -0
- package/website/content/en/docs/metrics.md +39 -0
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Pepr is on a mission to save Kubernetes from the tyranny of YAML, intimidating g
|
|
|
27
27
|
- Entire NPM ecosystem available for advanced operations
|
|
28
28
|
- Realtime K8s debugging system for testing/reacting to cluster changes
|
|
29
29
|
- Controller network isolation and tamper-resistent module execution
|
|
30
|
-
-
|
|
30
|
+
- Least-privilege [RBAC](https://github.com/defenseunicorns/pepr/blob/main/docs/rbac.md) generation
|
|
31
31
|
- AMD64 and ARM64 support
|
|
32
32
|
|
|
33
33
|
## Example Pepr Action
|
package/dist/cli.js
CHANGED
|
@@ -244,11 +244,15 @@ function service(name2) {
|
|
|
244
244
|
kind: "Service",
|
|
245
245
|
metadata: {
|
|
246
246
|
name: name2,
|
|
247
|
-
namespace: "pepr-system"
|
|
247
|
+
namespace: "pepr-system",
|
|
248
|
+
labels: {
|
|
249
|
+
"pepr.dev/controller": "admission"
|
|
250
|
+
}
|
|
248
251
|
},
|
|
249
252
|
spec: {
|
|
250
253
|
selector: {
|
|
251
|
-
app: name2
|
|
254
|
+
app: name2,
|
|
255
|
+
"pepr.dev/controller": "admission"
|
|
252
256
|
},
|
|
253
257
|
ports: [
|
|
254
258
|
{
|
|
@@ -265,11 +269,15 @@ function watcherService(name2) {
|
|
|
265
269
|
kind: "Service",
|
|
266
270
|
metadata: {
|
|
267
271
|
name: `${name2}-watcher`,
|
|
268
|
-
namespace: "pepr-system"
|
|
272
|
+
namespace: "pepr-system",
|
|
273
|
+
labels: {
|
|
274
|
+
"pepr.dev/controller": "watcher"
|
|
275
|
+
}
|
|
269
276
|
},
|
|
270
277
|
spec: {
|
|
271
278
|
selector: {
|
|
272
|
-
app: `${name2}-watcher
|
|
279
|
+
app: `${name2}-watcher`,
|
|
280
|
+
"pepr.dev/controller": "watcher"
|
|
273
281
|
},
|
|
274
282
|
ports: [
|
|
275
283
|
{
|
|
@@ -310,7 +318,8 @@ function watcher(assets, hash) {
|
|
|
310
318
|
name: app,
|
|
311
319
|
namespace: "pepr-system",
|
|
312
320
|
labels: {
|
|
313
|
-
app
|
|
321
|
+
app,
|
|
322
|
+
"pepr.dev/controller": "watcher"
|
|
314
323
|
}
|
|
315
324
|
},
|
|
316
325
|
spec: {
|
|
@@ -320,13 +329,15 @@ function watcher(assets, hash) {
|
|
|
320
329
|
},
|
|
321
330
|
selector: {
|
|
322
331
|
matchLabels: {
|
|
323
|
-
app
|
|
332
|
+
app,
|
|
333
|
+
"pepr.dev/controller": "watcher"
|
|
324
334
|
}
|
|
325
335
|
},
|
|
326
336
|
template: {
|
|
327
337
|
metadata: {
|
|
328
338
|
labels: {
|
|
329
|
-
app
|
|
339
|
+
app,
|
|
340
|
+
"pepr.dev/controller": "watcher"
|
|
330
341
|
}
|
|
331
342
|
},
|
|
332
343
|
spec: {
|
|
@@ -378,11 +389,7 @@ function watcher(assets, hash) {
|
|
|
378
389
|
readOnly: true
|
|
379
390
|
}
|
|
380
391
|
],
|
|
381
|
-
env:
|
|
382
|
-
{ name: "PEPR_WATCH_MODE", value: "true" },
|
|
383
|
-
{ name: "PEPR_PRETTY_LOG", value: "false" },
|
|
384
|
-
{ name: "LOG_LEVEL", value: config.logLevel || "debug" }
|
|
385
|
-
]
|
|
392
|
+
env: genEnv(config, true)
|
|
386
393
|
}
|
|
387
394
|
],
|
|
388
395
|
volumes: [
|
|
@@ -414,20 +421,23 @@ function deployment(assets, hash) {
|
|
|
414
421
|
name: name2,
|
|
415
422
|
namespace: "pepr-system",
|
|
416
423
|
labels: {
|
|
417
|
-
app
|
|
424
|
+
app,
|
|
425
|
+
"pepr.dev/controller": "admission"
|
|
418
426
|
}
|
|
419
427
|
},
|
|
420
428
|
spec: {
|
|
421
429
|
replicas: 2,
|
|
422
430
|
selector: {
|
|
423
431
|
matchLabels: {
|
|
424
|
-
app
|
|
432
|
+
app,
|
|
433
|
+
"pepr.dev/controller": "admission"
|
|
425
434
|
}
|
|
426
435
|
},
|
|
427
436
|
template: {
|
|
428
437
|
metadata: {
|
|
429
438
|
labels: {
|
|
430
|
-
app
|
|
439
|
+
app,
|
|
440
|
+
"pepr.dev/controller": "admission"
|
|
431
441
|
}
|
|
432
442
|
},
|
|
433
443
|
spec: {
|
|
@@ -468,10 +478,7 @@ function deployment(assets, hash) {
|
|
|
468
478
|
cpu: "500m"
|
|
469
479
|
}
|
|
470
480
|
},
|
|
471
|
-
env:
|
|
472
|
-
{ name: "PEPR_PRETTY_LOG", value: "false" },
|
|
473
|
-
{ name: "LOG_LEVEL", value: config.logLevel || "debug" }
|
|
474
|
-
],
|
|
481
|
+
env: genEnv(config),
|
|
475
482
|
volumeMounts: [
|
|
476
483
|
{
|
|
477
484
|
name: "tls-certs",
|
|
@@ -532,6 +539,19 @@ function moduleSecret(name2, data, hash) {
|
|
|
532
539
|
}
|
|
533
540
|
};
|
|
534
541
|
}
|
|
542
|
+
function genEnv(config, watchMode = false) {
|
|
543
|
+
const env = [
|
|
544
|
+
{ name: "PEPR_WATCH_MODE", value: watchMode ? "true" : "false" },
|
|
545
|
+
{ name: "PEPR_PRETTY_LOG", value: "false" },
|
|
546
|
+
{ name: "LOG_LEVEL", value: config.logLevel || "debug" }
|
|
547
|
+
];
|
|
548
|
+
if (config.env) {
|
|
549
|
+
for (const [name2, value] of Object.entries(config.env)) {
|
|
550
|
+
env.push({ name: name2, value });
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
return env;
|
|
554
|
+
}
|
|
535
555
|
|
|
536
556
|
// src/lib/helpers.ts
|
|
537
557
|
var import_fs2 = require("fs");
|
|
@@ -564,6 +584,55 @@ async function createDirectoryIfNotExists(path) {
|
|
|
564
584
|
}
|
|
565
585
|
}
|
|
566
586
|
}
|
|
587
|
+
function hasEveryOverlap(array1, array2) {
|
|
588
|
+
if (!Array.isArray(array1) || !Array.isArray(array2)) {
|
|
589
|
+
return false;
|
|
590
|
+
}
|
|
591
|
+
return array1.every((element) => array2.includes(element));
|
|
592
|
+
}
|
|
593
|
+
function hasAnyOverlap(array1, array2) {
|
|
594
|
+
if (!Array.isArray(array1) || !Array.isArray(array2)) {
|
|
595
|
+
return false;
|
|
596
|
+
}
|
|
597
|
+
return array1.some((element) => array2.includes(element));
|
|
598
|
+
}
|
|
599
|
+
function ignoredNamespaceConflict(ignoreNamespaces, bindingNamespaces) {
|
|
600
|
+
return hasAnyOverlap(bindingNamespaces, ignoreNamespaces);
|
|
601
|
+
}
|
|
602
|
+
function bindingAndCapabilityNSConflict(bindingNamespaces, capabilityNamespaces) {
|
|
603
|
+
if (!capabilityNamespaces) {
|
|
604
|
+
return false;
|
|
605
|
+
}
|
|
606
|
+
return capabilityNamespaces.length !== 0 && !hasEveryOverlap(bindingNamespaces, capabilityNamespaces);
|
|
607
|
+
}
|
|
608
|
+
function generateWatchNamespaceError(ignoredNamespaces, bindingNamespaces, capabilityNamespaces) {
|
|
609
|
+
let err = "";
|
|
610
|
+
if (ignoredNamespaceConflict(ignoredNamespaces, bindingNamespaces)) {
|
|
611
|
+
err += `Binding uses a Pepr ignored namespace: ignoredNamespaces: [${ignoredNamespaces.join(
|
|
612
|
+
", "
|
|
613
|
+
)}] bindingNamespaces: [${bindingNamespaces.join(", ")}].`;
|
|
614
|
+
}
|
|
615
|
+
if (bindingAndCapabilityNSConflict(bindingNamespaces, capabilityNamespaces)) {
|
|
616
|
+
err += `Binding uses namespace not governed by capability: bindingNamespaces: [${bindingNamespaces.join(
|
|
617
|
+
", "
|
|
618
|
+
)}] capabilityNamespaces:$[${capabilityNamespaces.join(", ")}].`;
|
|
619
|
+
}
|
|
620
|
+
return err.replace(/\.([^ ])/g, ". $1");
|
|
621
|
+
}
|
|
622
|
+
function namespaceComplianceValidator(capability, ignoredNamespaces) {
|
|
623
|
+
const { namespaces: capabilityNamespaces, bindings, name: name2 } = capability;
|
|
624
|
+
const bindingNamespaces = bindings.flatMap((binding) => binding.filters.namespaces);
|
|
625
|
+
const namespaceError = generateWatchNamespaceError(
|
|
626
|
+
ignoredNamespaces ? ignoredNamespaces : [],
|
|
627
|
+
bindingNamespaces,
|
|
628
|
+
capabilityNamespaces ? capabilityNamespaces : []
|
|
629
|
+
);
|
|
630
|
+
if (namespaceError !== "") {
|
|
631
|
+
throw new Error(
|
|
632
|
+
`Error in ${name2} capability. A binding violates namespace rules. Please check ignoredNamespaces and capability namespaces: ${namespaceError}`
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
567
636
|
|
|
568
637
|
// src/lib/assets/rbac.ts
|
|
569
638
|
function clusterRole(name2, capabilities, rbacMode = "") {
|
|
@@ -725,7 +794,7 @@ async function generateWebhookRules(assets, isMutateWebhook) {
|
|
|
725
794
|
for (const capability of capabilities) {
|
|
726
795
|
console.info(`Module ${config.uuid} has capability: ${capability.name}`);
|
|
727
796
|
for (const binding of capability.bindings) {
|
|
728
|
-
const { event, kind:
|
|
797
|
+
const { event, kind: kind4, isMutate, isValidate } = binding;
|
|
729
798
|
if (isMutateWebhook && !isMutate) {
|
|
730
799
|
continue;
|
|
731
800
|
}
|
|
@@ -738,10 +807,10 @@ async function generateWebhookRules(assets, isMutateWebhook) {
|
|
|
738
807
|
} else {
|
|
739
808
|
operations.push(event);
|
|
740
809
|
}
|
|
741
|
-
const resource =
|
|
810
|
+
const resource = kind4.plural || `${kind4.kind.toLowerCase()}s`;
|
|
742
811
|
const ruleObject = {
|
|
743
|
-
apiGroups: [
|
|
744
|
-
apiVersions: [
|
|
812
|
+
apiGroups: [kind4.group],
|
|
813
|
+
apiVersions: [kind4.version || "*"],
|
|
745
814
|
operations,
|
|
746
815
|
resources: [resource]
|
|
747
816
|
};
|
|
@@ -791,7 +860,7 @@ async function webhookConfig(assets, mutateOrValidate, timeoutSeconds = 10) {
|
|
|
791
860
|
name: `${name2}.pepr.dev`,
|
|
792
861
|
admissionReviewVersions: ["v1", "v1beta1"],
|
|
793
862
|
clientConfig,
|
|
794
|
-
failurePolicy: "Ignore",
|
|
863
|
+
failurePolicy: config.onError === "reject" ? "Fail" : "Ignore",
|
|
795
864
|
matchPolicy: "Equivalent",
|
|
796
865
|
timeoutSeconds,
|
|
797
866
|
namespaceSelector: {
|
|
@@ -985,6 +1054,7 @@ var Assets = class {
|
|
|
985
1054
|
this.path = path;
|
|
986
1055
|
this.host = host;
|
|
987
1056
|
this.name = `pepr-${config.uuid}`;
|
|
1057
|
+
this.alwaysIgnore = config.alwaysIgnore;
|
|
988
1058
|
this.image = `ghcr.io/defenseunicorns/pepr/controller:v${config.peprVersion}`;
|
|
989
1059
|
this.tls = genTLS(this.host || `${this.name}.pepr-system.svc`);
|
|
990
1060
|
this.apiToken = import_crypto3.default.randomBytes(32).toString("hex");
|
|
@@ -992,6 +1062,7 @@ var Assets = class {
|
|
|
992
1062
|
name;
|
|
993
1063
|
tls;
|
|
994
1064
|
apiToken;
|
|
1065
|
+
alwaysIgnore;
|
|
995
1066
|
capabilities;
|
|
996
1067
|
image;
|
|
997
1068
|
deploy = async (webhookTimeout) => {
|
|
@@ -1001,6 +1072,9 @@ var Assets = class {
|
|
|
1001
1072
|
zarfYaml = (path) => zarfYaml(this, path);
|
|
1002
1073
|
allYaml = async (rbacMode) => {
|
|
1003
1074
|
this.capabilities = await loadCapabilities(this.path);
|
|
1075
|
+
for (const capability of this.capabilities) {
|
|
1076
|
+
namespaceComplianceValidator(capability, this.alwaysIgnore.namespaces);
|
|
1077
|
+
}
|
|
1004
1078
|
return allYaml(this, rbacMode);
|
|
1005
1079
|
};
|
|
1006
1080
|
};
|
|
@@ -1212,7 +1286,7 @@ var gitIgnore = "# Ignore node_modules and Pepr build artifacts\nnode_modules\nd
|
|
|
1212
1286
|
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';
|
|
1213
1287
|
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';
|
|
1214
1288
|
var helloPeprTS = 'import {\n Capability,\n K8s,\n Log,\n PeprMutateRequest,\n RegisterKind,\n a,\n fetch,\n fetchStatus,\n kind,\n} from "pepr";\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\n .SetLabel("pepr", "was-here")\n .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>) {\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)\n .IsCreated()\n .InNamespace("pepr-demo-2")\n .WithName("example-4a")\n .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://api.chucknorris.io/jokes/random?category=dev");\n * const joke = await fetch("https://api.chucknorris.io/jokes/random?category=dev") as TheChuckNorrisJoke;\n * ```\n *\n * Alternatively, you can drop the type completely:\n *\n * ```ts\n * fetch("https://api.chucknorris.io/jokes/random?category=dev")\n * ```\n */\ninterface TheChuckNorrisJoke {\n icon_url: string;\n id: string;\n url: string;\n value: string;\n}\n\nWhen(a.ConfigMap)\n .IsCreated()\n .WithLabel("chuck-norris")\n .Mutate(async change => {\n // Try/catch is not needed as a response object will always be returned\n const response = await fetch<TheChuckNorrisJoke>(\n "https://api.chucknorris.io/jokes/random?category=dev",\n );\n\n // Instead, check the `response.ok` field\n if (response.ok) {\n // Add the Chuck Norris joke to the configmap\n change.Raw.data["chuck-says"] = response.data.value;\n return;\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';
|
|
1215
|
-
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" }, version: "0.
|
|
1289
|
+
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" }, version: "20.0.0", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", build: "tsc && node build.mjs", test: "npm run test:unit && npm run test:journey", "test:unit": "npm run gen-data-json && jest src --coverage --detectOpenHandles", "test:journey": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run", "test:journey-wasm": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run-wasm", "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:build": "npm run build && npm pack", "test:journey:image": "docker buildx build --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "test:journey:run": "jest --detectOpenHandles journey/entrypoint.test.ts", "test:journey:run-wasm": "jest --detectOpenHandles journey/entrypoint-wasm.test.ts", "format:check": "eslint src && prettier src --check", "format:fix": "eslint src --fix && prettier src --write" }, dependencies: { "@types/ramda": "0.29.9", express: "4.18.2", "fast-json-patch": "3.1.1", "kubernetes-fluent-client": "1.9.0", pino: "8.17.1", "pino-pretty": "10.3.0", "prom-client": "15.0.0", ramda: "0.29.1" }, devDependencies: { "@commitlint/cli": "18.4.3", "@commitlint/config-conventional": "18.4.3", "@jest/globals": "29.7.0", "@types/eslint": "8.44.9", "@types/express": "4.17.21", "@types/node": "18.x.x", "@types/node-forge": "1.3.10", "@types/prompts": "2.4.9", "@types/uuid": "9.0.7", jest: "29.7.0", nock: "13.4.0", "ts-jest": "29.1.1" }, peerDependencies: { "@typescript-eslint/eslint-plugin": "6.7.3", "@typescript-eslint/parser": "6.7.3", commander: "11.0.0", esbuild: "0.19.4", eslint: "8.50.0", "node-forge": "1.3.1", prettier: "3.0.3", prompts: "2.4.2", typescript: "5.2.2", uuid: "9.0.1" } };
|
|
1216
1290
|
|
|
1217
1291
|
// src/templates/pepr.code-snippets.json
|
|
1218
1292
|
var pepr_code_snippets_default = {
|
|
@@ -1301,6 +1375,10 @@ function genPkgJSON(opts, pgkVerOverride) {
|
|
|
1301
1375
|
const uuid = (0, import_uuid.v5)(opts.name, (0, import_uuid.v4)());
|
|
1302
1376
|
const name2 = sanitizeName(opts.name);
|
|
1303
1377
|
const { typescript } = peerDependencies;
|
|
1378
|
+
const testEnv = {
|
|
1379
|
+
MY_CUSTOM_VAR: "example-value",
|
|
1380
|
+
ZARF_VAR: "###ZARF_VAR_THING###"
|
|
1381
|
+
};
|
|
1304
1382
|
const data = {
|
|
1305
1383
|
name: name2,
|
|
1306
1384
|
version: "0.0.1",
|
|
@@ -1317,7 +1395,8 @@ function genPkgJSON(opts, pgkVerOverride) {
|
|
|
1317
1395
|
namespaces: [],
|
|
1318
1396
|
labels: []
|
|
1319
1397
|
},
|
|
1320
|
-
includedFiles: []
|
|
1398
|
+
includedFiles: [],
|
|
1399
|
+
env: pgkVerOverride ? testEnv : {}
|
|
1321
1400
|
},
|
|
1322
1401
|
scripts: {
|
|
1323
1402
|
"k3d-setup": scripts["test:journey:k3d"]
|
|
@@ -1714,6 +1793,69 @@ function dev_default(program2) {
|
|
|
1714
1793
|
});
|
|
1715
1794
|
}
|
|
1716
1795
|
|
|
1796
|
+
// src/cli/monitor.ts
|
|
1797
|
+
var import_client_node3 = require("@kubernetes/client-node");
|
|
1798
|
+
var import_kubernetes_fluent_client3 = require("kubernetes-fluent-client");
|
|
1799
|
+
var import_stream = __toESM(require("stream"));
|
|
1800
|
+
function monitor_default(program2) {
|
|
1801
|
+
program2.command("monitor <module-uuid>").description("Monitor a Pepr Module").action(async (uuid) => {
|
|
1802
|
+
if (!uuid) {
|
|
1803
|
+
console.error("Module UUID is required");
|
|
1804
|
+
process.exit(1);
|
|
1805
|
+
}
|
|
1806
|
+
const pods = await (0, import_kubernetes_fluent_client3.K8s)(import_kubernetes_fluent_client3.kind.Pod).InNamespace("pepr-system").WithLabel("app", `pepr-${uuid}`).Get();
|
|
1807
|
+
const podNames = pods.items.flatMap((pod) => pod.metadata.name);
|
|
1808
|
+
if (podNames.length < 1) {
|
|
1809
|
+
console.error(`No pods found for module ${uuid}`);
|
|
1810
|
+
process.exit(1);
|
|
1811
|
+
}
|
|
1812
|
+
const kc = new import_client_node3.KubeConfig();
|
|
1813
|
+
kc.loadFromDefault();
|
|
1814
|
+
const log = new import_client_node3.Log(kc);
|
|
1815
|
+
const logStream = new import_stream.default.PassThrough();
|
|
1816
|
+
logStream.on("data", (chunk) => {
|
|
1817
|
+
const respMsg = `"msg":"Check response"`;
|
|
1818
|
+
const lines = chunk.toString().split("\n");
|
|
1819
|
+
for (const line of lines) {
|
|
1820
|
+
if (line.includes(respMsg)) {
|
|
1821
|
+
try {
|
|
1822
|
+
const payload = JSON.parse(line);
|
|
1823
|
+
const isMutate = payload.res.patchType || payload.res.warnings;
|
|
1824
|
+
const name2 = `${payload.namespace}${payload.name}`;
|
|
1825
|
+
const uid = payload.uid;
|
|
1826
|
+
if (isMutate) {
|
|
1827
|
+
const allowOrDeny = payload.res.allowed ? "\u2705" : "\u274C";
|
|
1828
|
+
console.log(`
|
|
1829
|
+
${allowOrDeny} MUTATE ${name2} (${uid})`);
|
|
1830
|
+
} else {
|
|
1831
|
+
const failures = Array.isArray(payload.res) ? payload.res : [payload.res];
|
|
1832
|
+
const filteredFailures = failures.filter((r) => !r.allowed).map((r) => r.status.message);
|
|
1833
|
+
if (filteredFailures.length > 0) {
|
|
1834
|
+
console.log(`
|
|
1835
|
+
\u274C VALIDATE ${name2} (${uid})`);
|
|
1836
|
+
console.debug(filteredFailures);
|
|
1837
|
+
} else {
|
|
1838
|
+
console.log(`
|
|
1839
|
+
\u2705 VALIDATE ${name2} (${uid})`);
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
} catch {
|
|
1843
|
+
console.warn(`
|
|
1844
|
+
IGNORED - Unable to parse line: ${line}.`);
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
});
|
|
1849
|
+
for (const podName of podNames) {
|
|
1850
|
+
await log.log("pepr-system", podName, "server", logStream, {
|
|
1851
|
+
follow: true,
|
|
1852
|
+
pretty: false,
|
|
1853
|
+
timestamps: false
|
|
1854
|
+
});
|
|
1855
|
+
}
|
|
1856
|
+
});
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1717
1859
|
// src/cli/init/index.ts
|
|
1718
1860
|
var import_child_process4 = require("child_process");
|
|
1719
1861
|
var import_path2 = require("path");
|
|
@@ -1953,4 +2095,5 @@ deploy_default(program);
|
|
|
1953
2095
|
dev_default(program);
|
|
1954
2096
|
update_default(program);
|
|
1955
2097
|
format_default(program);
|
|
2098
|
+
monitor_default(program);
|
|
1956
2099
|
program.parse();
|
package/dist/controller.js
CHANGED
|
@@ -48,7 +48,7 @@ if (process.env.LOG_LEVEL) {
|
|
|
48
48
|
var logger_default = Log;
|
|
49
49
|
|
|
50
50
|
// src/templates/data.json
|
|
51
|
-
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" }, version: "0.
|
|
51
|
+
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" }, version: "20.0.0", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", build: "tsc && node build.mjs", test: "npm run test:unit && npm run test:journey", "test:unit": "npm run gen-data-json && jest src --coverage --detectOpenHandles", "test:journey": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run", "test:journey-wasm": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run-wasm", "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:build": "npm run build && npm pack", "test:journey:image": "docker buildx build --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "test:journey:run": "jest --detectOpenHandles journey/entrypoint.test.ts", "test:journey:run-wasm": "jest --detectOpenHandles journey/entrypoint-wasm.test.ts", "format:check": "eslint src && prettier src --check", "format:fix": "eslint src --fix && prettier src --write" }, dependencies: { "@types/ramda": "0.29.9", express: "4.18.2", "fast-json-patch": "3.1.1", "kubernetes-fluent-client": "1.9.0", pino: "8.17.1", "pino-pretty": "10.3.0", "prom-client": "15.0.0", ramda: "0.29.1" }, devDependencies: { "@commitlint/cli": "18.4.3", "@commitlint/config-conventional": "18.4.3", "@jest/globals": "29.7.0", "@types/eslint": "8.44.9", "@types/express": "4.17.21", "@types/node": "18.x.x", "@types/node-forge": "1.3.10", "@types/prompts": "2.4.9", "@types/uuid": "9.0.7", jest: "29.7.0", nock: "13.4.0", "ts-jest": "29.1.1" }, peerDependencies: { "@typescript-eslint/eslint-plugin": "6.7.3", "@typescript-eslint/parser": "6.7.3", commander: "11.0.0", esbuild: "0.19.4", eslint: "8.50.0", "node-forge": "1.3.1", prettier: "3.0.3", prompts: "2.4.2", typescript: "5.2.2", uuid: "9.0.1" } };
|
|
52
52
|
|
|
53
53
|
// src/runtime/controller.ts
|
|
54
54
|
var { version } = packageJSON;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ModuleConfig } from "../module";
|
|
2
2
|
import { TLSOut } from "../tls";
|
|
3
3
|
import { CapabilityExport } from "../types";
|
|
4
|
+
import { WebhookIgnore } from "../k8s";
|
|
4
5
|
export declare class Assets {
|
|
5
6
|
readonly config: ModuleConfig;
|
|
6
7
|
readonly path: string;
|
|
@@ -8,6 +9,7 @@ export declare class Assets {
|
|
|
8
9
|
readonly name: string;
|
|
9
10
|
readonly tls: TLSOut;
|
|
10
11
|
readonly apiToken: string;
|
|
12
|
+
readonly alwaysIgnore: WebhookIgnore;
|
|
11
13
|
capabilities: CapabilityExport[];
|
|
12
14
|
image: string;
|
|
13
15
|
constructor(config: ModuleConfig, path: string, host?: string | undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAMvC,qBAAa,MAAM;IAUf,QAAQ,CAAC,MAAM,EAAE,YAAY;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,IAAI,CAAC;IAXhB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAG,aAAa,CAAC;IACtC,YAAY,EAAG,gBAAgB,EAAE,CAAC;IAElC,KAAK,EAAE,MAAM,CAAC;gBAGH,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,oBAAQ;IAaxB,MAAM,oBAA2B,MAAM,mBAGrC;IAEF,QAAQ,SAAU,MAAM,YAA0B;IAElD,OAAO,aAAoB,MAAM,qBAQ/B;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"networking.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/networking.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAa1E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAchE;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"networking.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/networking.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAa1E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAchE;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,CAwBlD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,CAwBzD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { V1EnvVar } from "@kubernetes/client-node";
|
|
2
3
|
import { kind } from "kubernetes-fluent-client";
|
|
3
4
|
import { Assets } from ".";
|
|
4
5
|
/** Generate the pepr-system namespace */
|
|
@@ -11,6 +12,7 @@ export declare function watcher(assets: Assets, hash: string): {
|
|
|
11
12
|
namespace: string;
|
|
12
13
|
labels: {
|
|
13
14
|
app: string;
|
|
15
|
+
"pepr.dev/controller": string;
|
|
14
16
|
};
|
|
15
17
|
};
|
|
16
18
|
spec: {
|
|
@@ -21,12 +23,14 @@ export declare function watcher(assets: Assets, hash: string): {
|
|
|
21
23
|
selector: {
|
|
22
24
|
matchLabels: {
|
|
23
25
|
app: string;
|
|
26
|
+
"pepr.dev/controller": string;
|
|
24
27
|
};
|
|
25
28
|
};
|
|
26
29
|
template: {
|
|
27
30
|
metadata: {
|
|
28
31
|
labels: {
|
|
29
32
|
app: string;
|
|
33
|
+
"pepr.dev/controller": string;
|
|
30
34
|
};
|
|
31
35
|
};
|
|
32
36
|
spec: {
|
|
@@ -68,10 +72,7 @@ export declare function watcher(assets: Assets, hash: string): {
|
|
|
68
72
|
mountPath: string;
|
|
69
73
|
readOnly: boolean;
|
|
70
74
|
}[];
|
|
71
|
-
env:
|
|
72
|
-
name: string;
|
|
73
|
-
value: string;
|
|
74
|
-
}[];
|
|
75
|
+
env: V1EnvVar[];
|
|
75
76
|
}[];
|
|
76
77
|
volumes: {
|
|
77
78
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pods.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/pods.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"pods.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/pods.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAI3B,yCAAyC;AACzC,eAAO,MAAM,SAAS,EAAE,IAAI,CAAC,SAI5B,CAAC;AAEF,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA0HnD;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,UAAU,CAgHxE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAgBlF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/controller/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAoB,MAAM,QAAQ,CAAC;AAG5E,OAAO,EAAE,YAAY,EAAe,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/controller/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAoB,MAAM,QAAQ,CAAC;AAG5E,OAAO,EAAE,YAAY,EAAe,MAAM,WAAW,CAAC;AAMtD,qBAAa,UAAU;;gBAoBnB,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,UAAU,EAAE,EAC1B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,EAC5C,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,EACzC,OAAO,CAAC,EAAE,MAAM,IAAI;IAiCtB,+BAA+B;IAC/B,WAAW,SAAU,MAAM,UAqDzB;CA8LH"}
|
package/dist/lib/helpers.d.ts
CHANGED
|
@@ -8,5 +8,11 @@ type RBACMap = {
|
|
|
8
8
|
export declare const addVerbIfNotExists: (verbs: string[], verb: string) => void;
|
|
9
9
|
export declare const createRBACMap: (capabilities: CapabilityExport[]) => RBACMap;
|
|
10
10
|
export declare function createDirectoryIfNotExists(path: string): Promise<void>;
|
|
11
|
+
export declare function hasEveryOverlap<T>(array1: T[], array2: T[]): boolean;
|
|
12
|
+
export declare function hasAnyOverlap<T>(array1: T[], array2: T[]): boolean;
|
|
13
|
+
export declare function ignoredNamespaceConflict(ignoreNamespaces: string[], bindingNamespaces: string[]): boolean;
|
|
14
|
+
export declare function bindingAndCapabilityNSConflict(bindingNamespaces: string[], capabilityNamespaces: string[]): boolean;
|
|
15
|
+
export declare function generateWatchNamespaceError(ignoredNamespaces: string[], bindingNamespaces: string[], capabilityNamespaces: string[]): string;
|
|
16
|
+
export declare function namespaceComplianceValidator(capability: CapabilityExport, ignoredNamespaces?: string[]): void;
|
|
11
17
|
export {};
|
|
12
18
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","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,8BAA8B,CAAC,iBAAiB,EAAE,MAAM,EAAE,EAAE,oBAAoB,EAAE,MAAM,EAAE,WAKzG;AAED,wBAAgB,2BAA2B,CACzC,iBAAiB,EAAE,MAAM,EAAE,EAC3B,iBAAiB,EAAE,MAAM,EAAE,EAC3B,oBAAoB,EAAE,MAAM,EAAE,UAoB/B;AAGD,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,QActG"}
|
package/dist/lib/logger.d.ts
CHANGED
package/dist/lib/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAgBA,QAAA,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAgBA,QAAA,MAAM,GAAG,8BAEP,CAAC;AAMH,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PeprValidateRequest } from "./validate-request";
|
|
2
|
+
import { PeprMutateRequest } from "./mutate-request";
|
|
3
|
+
import { a } from "../lib";
|
|
4
|
+
export declare function containers(request: PeprValidateRequest<a.Pod> | PeprMutateRequest<a.Pod>, containerType?: "containers" | "initContainers" | "ephemeralContainers"): import("@kubernetes/client-node").V1Container[];
|
|
5
|
+
//# sourceMappingURL=module-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-helpers.d.ts","sourceRoot":"","sources":["../../src/lib/module-helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,wBAAgB,UAAU,CACxB,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,EAC9D,aAAa,CAAC,EAAE,YAAY,GAAG,gBAAgB,GAAG,qBAAqB,mDAgBxE"}
|
package/dist/lib/module.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export type ModuleConfig = {
|
|
|
18
18
|
alwaysIgnore: WebhookIgnore;
|
|
19
19
|
/** Define the log level for the in-cluster controllers */
|
|
20
20
|
logLevel?: string;
|
|
21
|
+
/** Propagate env variables to in-cluster controllers */
|
|
22
|
+
env?: Record<string, string>;
|
|
21
23
|
};
|
|
22
24
|
export type PackageJSON = {
|
|
23
25
|
description: string;
|
package/dist/lib/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/lib/module.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI1F,iDAAiD;AACjD,MAAM,MAAM,YAAY,GAAG;IACzB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,YAAY,EAAE,aAAa,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/lib/module.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU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UAAU,EAAO,EAAE,IAAI,GAAE,iBAAsB;IAiD7G;;;;;OAKG;IACH,KAAK,0BAEH;CACH"}
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -2,6 +2,16 @@ import { GenericClass, GroupVersionKind, KubernetesObject } from "kubernetes-flu
|
|
|
2
2
|
import { WatchAction } from "kubernetes-fluent-client/dist/fluent/types";
|
|
3
3
|
import { PeprMutateRequest } from "./mutate-request";
|
|
4
4
|
import { PeprValidateRequest } from "./validate-request";
|
|
5
|
+
/**
|
|
6
|
+
* Specifically for parsing logs in monitor mode
|
|
7
|
+
*/
|
|
8
|
+
export interface ResponseItem {
|
|
9
|
+
uid?: string;
|
|
10
|
+
allowed: boolean;
|
|
11
|
+
status: {
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
5
15
|
/**
|
|
6
16
|
* Recursively make all properties in T optional.
|
|
7
17
|
*/
|
package/dist/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC;AAEF;;GAEG;AACH,oBAAY,KAAK;IACf,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,M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AAC,SAAS,YAAY,EAAE,CAAC,SAAS,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,CAC/F,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,KACtB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAEjF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,CACjG,GAAG,EAAE,mBAAmB,CAAC,CAAC,CAAC,KACxB,OAAO,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
|
package/dist/lib.d.ts
CHANGED
|
@@ -6,5 +6,6 @@ import { PeprModule } from "./lib/module";
|
|
|
6
6
|
import { PeprMutateRequest } from "./lib/mutate-request";
|
|
7
7
|
import * as PeprUtils from "./lib/utils";
|
|
8
8
|
import { PeprValidateRequest } from "./lib/validate-request";
|
|
9
|
-
|
|
9
|
+
import { containers } from "./lib/module-helpers";
|
|
10
|
+
export { Capability, K8s, Log, PeprModule, PeprMutateRequest, PeprUtils, PeprValidateRequest, R, RegisterKind, a, fetch, fetchStatus, kind, containers, };
|
|
10
11
|
//# sourceMappingURL=lib.d.ts.map
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAA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