pepr 0.42.2 → 0.43.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/dist/cli/build.d.ts +25 -11
- package/dist/cli/build.d.ts.map +1 -1
- package/dist/cli/build.helpers.d.ts +1 -8
- package/dist/cli/build.helpers.d.ts.map +1 -1
- package/dist/cli/deploy.d.ts.map +1 -1
- package/dist/cli/dev.d.ts.map +1 -1
- package/dist/cli/init/templates.d.ts +3 -0
- package/dist/cli/init/templates.d.ts.map +1 -1
- package/dist/cli.js +1292 -1247
- package/dist/controller.js +1 -1
- package/dist/fixtures/loader.d.ts.map +1 -1
- package/dist/lib/assets/assets.d.ts +30 -0
- package/dist/lib/assets/assets.d.ts.map +1 -0
- package/dist/lib/assets/deploy.d.ts +2 -2
- package/dist/lib/assets/deploy.d.ts.map +1 -1
- package/dist/lib/assets/helm.d.ts.map +1 -1
- package/dist/lib/assets/index.d.ts +4 -23
- package/dist/lib/assets/index.d.ts.map +1 -1
- package/dist/lib/assets/pods.d.ts +1 -1
- package/dist/lib/assets/pods.d.ts.map +1 -1
- package/dist/lib/assets/webhooks.d.ts +5 -2
- package/dist/lib/assets/webhooks.d.ts.map +1 -1
- package/dist/lib/assets/yaml/generateAllYaml.d.ts +9 -0
- package/dist/lib/assets/yaml/generateAllYaml.d.ts.map +1 -0
- package/dist/lib/assets/yaml/generateZarfYaml.d.ts +5 -0
- package/dist/lib/assets/yaml/generateZarfYaml.d.ts.map +1 -0
- package/dist/lib/assets/yaml/overridesFile.d.ts +15 -0
- package/dist/lib/assets/yaml/overridesFile.d.ts.map +1 -0
- package/dist/lib/core/module.d.ts.map +1 -1
- package/dist/lib/enums.d.ts +4 -0
- package/dist/lib/enums.d.ts.map +1 -1
- package/dist/lib/processors/mutate-processor.d.ts.map +1 -1
- package/dist/lib/processors/validate-processor.d.ts.map +1 -1
- package/dist/lib.js +37 -18
- package/dist/lib.js.map +4 -4
- package/package.json +5 -2
- package/src/cli/build.helpers.ts +8 -23
- package/src/cli/build.ts +73 -17
- package/src/cli/deploy.ts +8 -7
- package/src/cli/dev.ts +8 -7
- package/src/fixtures/loader.ts +2 -2
- package/src/lib/assets/assets.ts +189 -0
- package/src/lib/assets/deploy.ts +33 -31
- package/src/lib/assets/helm.ts +22 -4
- package/src/lib/assets/index.ts +40 -150
- package/src/lib/assets/pods.ts +3 -3
- package/src/lib/assets/webhooks.ts +23 -17
- package/src/lib/assets/yaml/generateAllYaml.ts +50 -0
- package/src/lib/assets/yaml/generateZarfYaml.ts +38 -0
- package/src/lib/assets/{yaml.ts → yaml/overridesFile.ts} +19 -109
- package/src/lib/core/module.ts +2 -1
- package/src/lib/enums.ts +6 -0
- package/src/lib/processors/mutate-processor.ts +2 -1
- package/src/lib/processors/validate-processor.ts +7 -1
- package/dist/lib/assets/yaml.d.ts +0 -6
- package/dist/lib/assets/yaml.d.ts.map +0 -1
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", "!dist/**/*.test.d.ts*"], version: "0.
|
|
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", "!dist/**/*.test.d.ts*"], version: "0.43.0", 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", version: "node scripts/set-version.js", build: "tsc && node build.mjs && npm pack", "build:image": "npm run build && docker buildx build --output type=docker --tag pepr:dev .", test: "npm run test:unit && npm run test:journey", "test:unit": "npm run gen-data-json && jest src --coverage --detectOpenHandles --coverageDirectory=./coverage --testPathIgnorePatterns='cosign.e2e.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:prep": "if [ ! -d ./pepr-upgrade-test ]; then git clone https://github.com/defenseunicorns/pepr-upgrade-test.git ; fi", "test:journey-wasm": "npm run test:journey:k3d && npm run 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:image": "docker buildx build --output type=docker --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "test:journey:run": "jest --detectOpenHandles journey/entrypoint.test.ts && npm run test:journey:prep && npm run test:journey:upgrade", "test:journey:run-wasm": "jest --detectOpenHandles journey/entrypoint-wasm.test.ts", "test:journey:upgrade": "npm run test:journey:k3d && npm run test:journey:image && jest --detectOpenHandles journey/pepr-upgrade.test.ts", "format:check": "eslint src && prettier src --check", "format:fix": "eslint src --fix && prettier src --write", prepare: `if [ "$NODE_ENV" != 'production' ]; then husky; fi` }, dependencies: { "@types/ramda": "0.30.2", express: "4.21.2", "fast-json-patch": "3.1.1", "follow-redirects": "1.15.9", "http-status-codes": "^2.3.0", "json-pointer": "^0.6.2", "kubernetes-fluent-client": "3.3.8", pino: "9.6.0", "pino-pretty": "13.0.0", "prom-client": "15.1.3", ramda: "0.30.1", sigstore: "3.0.0" }, devDependencies: { "@commitlint/cli": "19.6.1", "@commitlint/config-conventional": "19.6.0", "@fast-check/jest": "^2.0.1", "@jest/globals": "29.7.0", "@types/eslint": "9.6.1", "@types/express": "5.0.0", "@types/follow-redirects": "1.14.4", "@types/json-pointer": "^1.0.34", "@types/node": "22.x.x", "@types/node-forge": "1.3.11", "@types/uuid": "10.0.0", "fast-check": "^3.19.0", husky: "^9.1.6", jest: "29.7.0", "js-yaml": "^4.1.0", "ts-jest": "29.2.5", undici: "^7.0.1" }, peerDependencies: { "@typescript-eslint/eslint-plugin": "7.18.0", "@typescript-eslint/parser": "7.18.0", "@types/prompts": "2.4.9", eslint: "8.57.0", commander: "12.1.0", esbuild: "0.24.0", "node-forge": "1.3.1", prettier: "3.4.2", prompts: "2.4.2", typescript: "^5.3.3", uuid: "11.0.3" } };
|
|
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":"loader.d.ts","sourceRoot":"","sources":["../../src/fixtures/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMhD,wBAAgB,gCAAgC,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/fixtures/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMhD,wBAAgB,gCAAgC,IAAI,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAEpF;AAED,wBAAgB,yBAAyB,IAAI,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAEtE;AAED,wBAAgB,yBAAyB,IAAI,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAEtE;AAED,wBAAgB,iCAAiC,IAAI,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAEtF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CapabilityExport } from "../types";
|
|
2
|
+
import { ModuleConfig } from "../core/module";
|
|
3
|
+
import { TLSOut } from "../tls";
|
|
4
|
+
import { WebhookIgnore } from "../k8s";
|
|
5
|
+
import { V1Deployment, V1MutatingWebhookConfiguration, V1ValidatingWebhookConfiguration } from "@kubernetes/client-node/dist/gen";
|
|
6
|
+
import { WebhookType } from "../enums";
|
|
7
|
+
export declare class Assets {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly tls: TLSOut;
|
|
10
|
+
readonly apiToken: string;
|
|
11
|
+
readonly config: ModuleConfig;
|
|
12
|
+
readonly path: string;
|
|
13
|
+
readonly alwaysIgnore: WebhookIgnore;
|
|
14
|
+
readonly imagePullSecrets: string[];
|
|
15
|
+
capabilities: CapabilityExport[];
|
|
16
|
+
image: string;
|
|
17
|
+
buildTimestamp: string;
|
|
18
|
+
readonly host?: string;
|
|
19
|
+
constructor(config: ModuleConfig, path: string, imagePullSecrets: string[], host?: string);
|
|
20
|
+
deploy(deployFunction: (assets: Assets, force: boolean, webhookTimeout: number) => Promise<void>, force: boolean, webhookTimeout?: number): Promise<void>;
|
|
21
|
+
zarfYaml: (zarfYamlGenerator: (assets: Assets, path: string, type: "manifests" | "charts") => string, path: string) => string;
|
|
22
|
+
zarfYamlChart: (zarfYamlGenerator: (assets: Assets, path: string, type: "manifests" | "charts") => string, path: string) => string;
|
|
23
|
+
allYaml: (yamlGenerationFunction: (assyts: Assets, deployments: {
|
|
24
|
+
default: V1Deployment;
|
|
25
|
+
watch: V1Deployment | null;
|
|
26
|
+
}) => Promise<string>, imagePullSecret?: string) => Promise<string>;
|
|
27
|
+
writeWebhookFiles: (validateWebhook: V1MutatingWebhookConfiguration | V1ValidatingWebhookConfiguration | null, mutateWebhook: V1MutatingWebhookConfiguration | V1ValidatingWebhookConfiguration | null, helm: Record<string, Record<string, string>>) => Promise<void>;
|
|
28
|
+
generateHelmChart: (webhookGeneratorFunction: (assets: Assets, mutateOrValidate: WebhookType, timeoutSeconds: number | undefined) => Promise<V1MutatingWebhookConfiguration | V1ValidatingWebhookConfiguration | null>, basePath: string) => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/assets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AASvC,OAAO,EACL,YAAY,EACZ,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,kCAAkC,CAAC;AAU1C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,qBAAa,MAAM;IACjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAG,aAAa,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IACpC,YAAY,EAAG,gBAAgB,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAEX,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM;IAiBnF,MAAM,CACV,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACzF,KAAK,EAAE,OAAO,EACd,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAQhB,QAAQ,sBACa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,QAAQ,KAAK,MAAM,QACnF,MAAM,KACX,MAAM,CAA+C;IAExD,aAAa,sBACQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,QAAQ,KAAK,MAAM,QACnF,MAAM,KACX,MAAM,CAA4C;IAErD,OAAO,2BACmB,CACtB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE;QAAE,OAAO,EAAE,YAAY,CAAC;QAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAA;KAAE,KAC/D,OAAO,CAAC,MAAM,CAAC,oBACF,MAAM,KACvB,OAAO,CAAC,MAAM,CAAC,CAiBhB;IAEF,iBAAiB,oBACE,8BAA8B,GAAG,gCAAgC,GAAG,IAAI,iBAC1E,8BAA8B,GAAG,gCAAgC,GAAG,IAAI,QACjF,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAC3C,OAAO,CAAC,IAAI,CAAC,CAad;IAEF,iBAAiB,6BACW,CACxB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,WAAW,EAC7B,cAAc,EAAE,MAAM,GAAG,SAAS,KAC/B,OAAO,CAAC,8BAA8B,GAAG,gCAAgC,GAAG,IAAI,CAAC,YAC5E,MAAM,KACf,OAAO,CAAC,IAAI,CAAC,CAuDd;CACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Assets } from "
|
|
1
|
+
import { Assets } from "./assets";
|
|
2
2
|
import { ImagePullSecret } from "../types";
|
|
3
3
|
export declare function deployImagePullSecret(imagePullSecret: ImagePullSecret, name: string): Promise<void>;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function deployWebhook(assets: Assets, force: boolean, webhookTimeout: number): Promise<void>;
|
|
5
5
|
//# sourceMappingURL=deploy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/deploy.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/deploy.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC,OAAO,EAAoB,eAAe,EAAE,MAAM,UAAU,CAAC;AAG7D,wBAAsB,qBAAqB,CAAC,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BzG;AAwBD,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBzG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helm.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/helm.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,IAAI,MAAM,CAY5C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAe1C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CA2BpE;AAED,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"helm.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/helm.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,IAAI,MAAM,CAY5C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAe1C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CA2BpE;AAED,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAwFpE;AAED,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CA6FtE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAyB3D"}
|
|
@@ -1,25 +1,6 @@
|
|
|
1
|
+
import { kind } from "kubernetes-fluent-client";
|
|
1
2
|
import { ModuleConfig } from "../core/module";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare class Assets {
|
|
6
|
-
readonly config: ModuleConfig;
|
|
7
|
-
readonly path: string;
|
|
8
|
-
readonly host?: string | undefined;
|
|
9
|
-
readonly name: string;
|
|
10
|
-
readonly tls: TLSOut;
|
|
11
|
-
readonly apiToken: string;
|
|
12
|
-
readonly alwaysIgnore: WebhookIgnore;
|
|
13
|
-
capabilities: CapabilityExport[];
|
|
14
|
-
image: string;
|
|
15
|
-
buildTimestamp: string;
|
|
16
|
-
hash: string;
|
|
17
|
-
constructor(config: ModuleConfig, path: string, host?: string | undefined);
|
|
18
|
-
setHash: (hash: string) => void;
|
|
19
|
-
deploy: (force: boolean, webhookTimeout?: number) => Promise<void>;
|
|
20
|
-
zarfYaml: (path: string) => string;
|
|
21
|
-
zarfYamlChart: (path: string) => string;
|
|
22
|
-
allYaml: (imagePullSecret?: string) => Promise<string>;
|
|
23
|
-
generateHelmChart: (basePath: string) => Promise<void>;
|
|
24
|
-
}
|
|
3
|
+
export declare function toYaml(obj: any): string;
|
|
4
|
+
export declare function createWebhookYaml(name: string, config: ModuleConfig, webhookConfiguration: kind.MutatingWebhookConfiguration | kind.ValidatingWebhookConfiguration): string;
|
|
5
|
+
export declare function helmLayout(basePath: string, unique: string): Record<string, Record<string, string>>;
|
|
25
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,wBAAgB,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAEvC;AAGD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,YAAY,EACpB,oBAAoB,EAAE,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,8BAA8B,GAC5F,MAAM,CAkCR;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAsCnG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KubernetesObject, V1EnvVar } from "@kubernetes/client-node";
|
|
2
2
|
import { kind } from "kubernetes-fluent-client";
|
|
3
|
-
import { Assets } from "
|
|
3
|
+
import { Assets } from "./assets";
|
|
4
4
|
import { ModuleConfig } from "../core/module";
|
|
5
5
|
/** Generate the pepr-system namespace */
|
|
6
6
|
export declare function getNamespace(namespaceLabels?: Record<string, string>): KubernetesObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pods.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/pods.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"pods.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/pods.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,yCAAyC;AACzC,wBAAgB,YAAY,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,gBAAgB,CAmBvF;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,eAAe,CAAC,EAAE,MAAM,GACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAyJxB;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,eAAe,CAAC,EAAE,MAAM,GACvB,IAAI,CAAC,UAAU,CA+IjB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAuBrF;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,UAAQ,EAAE,eAAe,UAAQ,GAAG,QAAQ,EAAE,CAkBnG"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { V1RuleWithOperations } from "@kubernetes/client-node";
|
|
2
2
|
import { kind } from "kubernetes-fluent-client";
|
|
3
|
-
import { Assets } from "
|
|
3
|
+
import { Assets } from "./assets";
|
|
4
|
+
import { WebhookType } from "../enums";
|
|
5
|
+
export declare const peprIgnoreNamespaces: string[];
|
|
6
|
+
export declare function resolveIgnoreNamespaces(ignoredNSConfig?: string[]): string[];
|
|
4
7
|
export declare function generateWebhookRules(assets: Assets, isMutateWebhook: boolean): Promise<V1RuleWithOperations[]>;
|
|
5
|
-
export declare function
|
|
8
|
+
export declare function webhookConfigGenerator(assets: Assets, mutateOrValidate: WebhookType, timeoutSeconds?: number): Promise<kind.MutatingWebhookConfiguration | kind.ValidatingWebhookConfiguration | null>;
|
|
6
9
|
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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;AAG9C,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAAmC,CAAC;AA0B7E,wBAAgB,uBAAuB,CAAC,eAAe,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAahF;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAYpH;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,CA+DzF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Assets } from "../assets";
|
|
2
|
+
import { V1Deployment } from "@kubernetes/client-node";
|
|
3
|
+
type deployments = {
|
|
4
|
+
default: V1Deployment;
|
|
5
|
+
watch: V1Deployment | null;
|
|
6
|
+
};
|
|
7
|
+
export declare function generateAllYaml(assets: Assets, deployments: deployments): Promise<string>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=generateAllYaml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateAllYaml.d.ts","sourceRoot":"","sources":["../../../../src/lib/assets/yaml/generateAllYaml.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC,OAAO,EAAY,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAKjE,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAA;CAAE,CAAC;AAEzE,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAkC/F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateZarfYaml.d.ts","sourceRoot":"","sources":["../../../../src/lib/assets/yaml/generateZarfYaml.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,KAAK,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEzC,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAgC9F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModuleConfig } from "../../core/module";
|
|
2
|
+
import { CapabilityExport } from "../../types";
|
|
3
|
+
type CommonOverrideValues = {
|
|
4
|
+
apiToken: string;
|
|
5
|
+
capabilities: CapabilityExport[];
|
|
6
|
+
config: ModuleConfig;
|
|
7
|
+
hash: string;
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
type ChartOverrides = CommonOverrideValues & {
|
|
11
|
+
image: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function overridesFile({ hash, name, image, config, apiToken, capabilities }: ChartOverrides, path: string, imagePullSecrets: string[]): Promise<void>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=overridesFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overridesFile.d.ts","sourceRoot":"","sources":["../../../../src/lib/assets/yaml/overridesFile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAK/C,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,cAAc,GAAG,oBAAoB,GAAG;IAC3C,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAsB,aAAa,CACjC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,cAAc,EACrE,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CA2Jf"}
|
|
@@ -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;AAG1C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAoB,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG9D,OAAO,EAAE,YAAY,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/lib/core/module.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAoB,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG9D,OAAO,EAAE,YAAY,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrE,0CAA0C;AAC1C,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AACD,iDAAiD;AACjD,MAAM,MAAM,YAAY,GAAG;IACzB,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,yBAAyB;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,YAAY,EAAE,aAAa,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,2CAA2C;IAC3C,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,wBAAwB;IACxB,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC;IACpB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,qHAAqH;IACrH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAE7C,6GAA6G;IAC7G,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,GAAG,gBAAgB,KAAK,IAAI,CAAC;CAC9D,CAAC;AAGF,eAAO,MAAM,WAAW,QAAO,OAAiD,CAAC;AAGjF,eAAO,MAAM,WAAW,QAAO,OAA4C,CAAC;AAE5E,eAAO,MAAM,SAAS,QAAO,OAA0C,CAAC;AAExE,qBAAa,UAAU;;IAGrB;;;;;;OAMG;gBACS,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,YAAY,GAAE,UAAU,EAAO,EAAE,IAAI,GAAE,iBAAsB;IAsD7G;;;;;OAKG;IACH,KAAK,qBAAkB,IAAI,CAEzB;CACH"}
|
package/dist/lib/enums.d.ts
CHANGED
package/dist/lib/enums.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/lib/enums.ts"],"names":[],"mappings":"AAIA,oBAAY,SAAS;IACnB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,KAAK;IACf,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,gBAAgB,mBAAmB;IACnC,GAAG,MAAM;CACV"}
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/lib/enums.ts"],"names":[],"mappings":"AAIA,oBAAY,SAAS;IACnB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,KAAK;IACf,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,gBAAgB,mBAAmB;IACnC,GAAG,MAAM;CACV;AAGD,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutate-processor.d.ts","sourceRoot":"","sources":["../../../src/lib/processors/mutate-processor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAQ,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"mutate-processor.d.ts","sourceRoot":"","sources":["../../../src/lib/processors/mutate-processor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAQ,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAKtD,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,gBAAgB,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAC7C,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAID,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,EAC5C,MAAM,EAAE,MAAM,GACb,iBAAiB,CAAC,gBAAgB,CAAC,CAQrC;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,CAUtD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,GAAG;IACxE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CAC9C,CAUA;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAU9G;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,EAC5C,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,CAwCjB;AAGD,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,UAAU,EAAE,EAC1B,GAAG,EAAE,gBAAgB,EACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC,OAAO,CAAC,cAAc,CAAC,CAqFzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-processor.d.ts","sourceRoot":"","sources":["../../../src/lib/processors/validate-processor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"validate-processor.d.ts","sourceRoot":"","sources":["../../../src/lib/processors/validate-processor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,mBAAmB,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,GACzD,OAAO,CAAC,gBAAgB,CAAC,CAkC3B;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,UAAU,EAAE,EAC1B,GAAG,EAAE,gBAAgB,EACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAuC7B"}
|
package/dist/lib.js
CHANGED
|
@@ -51,7 +51,7 @@ var R = __toESM(require("ramda"));
|
|
|
51
51
|
|
|
52
52
|
// src/lib/core/capability.ts
|
|
53
53
|
var import_kubernetes_fluent_client6 = require("kubernetes-fluent-client");
|
|
54
|
-
var
|
|
54
|
+
var import_ramda9 = require("ramda");
|
|
55
55
|
|
|
56
56
|
// src/lib/telemetry/logger.ts
|
|
57
57
|
var import_pino = require("pino");
|
|
@@ -102,7 +102,7 @@ function redactedPatch(patch = {}) {
|
|
|
102
102
|
var logger_default = Log;
|
|
103
103
|
|
|
104
104
|
// src/lib/core/module.ts
|
|
105
|
-
var
|
|
105
|
+
var import_ramda7 = require("ramda");
|
|
106
106
|
|
|
107
107
|
// src/lib/controller/index.ts
|
|
108
108
|
var import_express = __toESM(require("express"));
|
|
@@ -240,7 +240,7 @@ var metricsCollector = new MetricsCollector("pepr");
|
|
|
240
240
|
|
|
241
241
|
// src/lib/processors/mutate-processor.ts
|
|
242
242
|
var import_fast_json_patch = __toESM(require("fast-json-patch"));
|
|
243
|
-
var
|
|
243
|
+
var import_ramda4 = require("ramda");
|
|
244
244
|
|
|
245
245
|
// src/lib/filter/adjudicators/adjudicators.ts
|
|
246
246
|
var import_ramda = require("ramda");
|
|
@@ -671,6 +671,20 @@ var OnError = /* @__PURE__ */ ((OnError2) => {
|
|
|
671
671
|
return OnError2;
|
|
672
672
|
})(OnError || {});
|
|
673
673
|
|
|
674
|
+
// src/lib/assets/webhooks.ts
|
|
675
|
+
var import_ramda3 = require("ramda");
|
|
676
|
+
function resolveIgnoreNamespaces(ignoredNSConfig = []) {
|
|
677
|
+
const ignoredNSEnv = process.env.PEPR_ADDITIONAL_IGNORED_NAMESPACES;
|
|
678
|
+
if (!ignoredNSEnv) {
|
|
679
|
+
return ignoredNSConfig;
|
|
680
|
+
}
|
|
681
|
+
const namespaces = ignoredNSEnv.split(",").map((ns) => ns.trim());
|
|
682
|
+
if (ignoredNSConfig) {
|
|
683
|
+
namespaces.push(...ignoredNSConfig);
|
|
684
|
+
}
|
|
685
|
+
return namespaces.filter((ns) => ns.length > 0);
|
|
686
|
+
}
|
|
687
|
+
|
|
674
688
|
// src/lib/processors/mutate-processor.ts
|
|
675
689
|
function updateStatus(config, name2, wrapped, status) {
|
|
676
690
|
if (wrapped.Request.operation === "DELETE") {
|
|
@@ -699,7 +713,7 @@ function decodeData(wrapped) {
|
|
|
699
713
|
return { skipped, wrapped };
|
|
700
714
|
}
|
|
701
715
|
function reencodeData(wrapped, skipped) {
|
|
702
|
-
const transformed = (0,
|
|
716
|
+
const transformed = (0, import_ramda4.clone)(wrapped.Raw);
|
|
703
717
|
const isSecret = wrapped.Request.kind.version === "v1" && wrapped.Request.kind.kind === "Secret";
|
|
704
718
|
if (isSecret) {
|
|
705
719
|
convertToBase64Map(transformed, skipped);
|
|
@@ -760,7 +774,7 @@ async function mutateProcessor(config, capabilities, req, reqMetadata) {
|
|
|
760
774
|
bind.binding,
|
|
761
775
|
bind.req,
|
|
762
776
|
bind.namespaces,
|
|
763
|
-
bind.config?.alwaysIgnore?.namespaces
|
|
777
|
+
resolveIgnoreNamespaces(bind.config?.alwaysIgnore?.namespaces)
|
|
764
778
|
);
|
|
765
779
|
if (shouldSkip !== "") {
|
|
766
780
|
logger_default.debug(shouldSkip);
|
|
@@ -796,7 +810,7 @@ async function mutateProcessor(config, capabilities, req, reqMetadata) {
|
|
|
796
810
|
}
|
|
797
811
|
|
|
798
812
|
// src/lib/validate-request.ts
|
|
799
|
-
var
|
|
813
|
+
var import_ramda5 = require("ramda");
|
|
800
814
|
var PeprValidateRequest = class {
|
|
801
815
|
Raw;
|
|
802
816
|
#input;
|
|
@@ -821,9 +835,9 @@ var PeprValidateRequest = class {
|
|
|
821
835
|
constructor(input) {
|
|
822
836
|
this.#input = input;
|
|
823
837
|
if (input.operation.toUpperCase() === "DELETE" /* DELETE */) {
|
|
824
|
-
this.Raw = (0,
|
|
838
|
+
this.Raw = (0, import_ramda5.clone)(input.oldObject);
|
|
825
839
|
} else {
|
|
826
|
-
this.Raw = (0,
|
|
840
|
+
this.Raw = (0, import_ramda5.clone)(input.object);
|
|
827
841
|
}
|
|
828
842
|
if (!this.Raw) {
|
|
829
843
|
throw new Error("unable to load the request object into PeprRequest.Raw");
|
|
@@ -917,7 +931,12 @@ async function validateProcessor(config, capabilities, req, reqMetadata) {
|
|
|
917
931
|
if (!binding.validateCallback) {
|
|
918
932
|
continue;
|
|
919
933
|
}
|
|
920
|
-
const shouldSkip = shouldSkipRequest(
|
|
934
|
+
const shouldSkip = shouldSkipRequest(
|
|
935
|
+
binding,
|
|
936
|
+
req,
|
|
937
|
+
namespaces,
|
|
938
|
+
resolveIgnoreNamespaces(config?.alwaysIgnore?.namespaces)
|
|
939
|
+
);
|
|
921
940
|
if (shouldSkip !== "") {
|
|
922
941
|
logger_default.debug(shouldSkip);
|
|
923
942
|
continue;
|
|
@@ -931,7 +950,7 @@ async function validateProcessor(config, capabilities, req, reqMetadata) {
|
|
|
931
950
|
|
|
932
951
|
// src/lib/controller/store.ts
|
|
933
952
|
var import_kubernetes_fluent_client3 = require("kubernetes-fluent-client");
|
|
934
|
-
var
|
|
953
|
+
var import_ramda6 = require("ramda");
|
|
935
954
|
|
|
936
955
|
// src/lib/k8s.ts
|
|
937
956
|
var import_kubernetes_fluent_client = require("kubernetes-fluent-client");
|
|
@@ -1045,7 +1064,7 @@ var StoreController = class {
|
|
|
1045
1064
|
for (const name2 of Object.keys(this.#stores)) {
|
|
1046
1065
|
const offset = `${name2}-`.length;
|
|
1047
1066
|
for (const key of Object.keys(data)) {
|
|
1048
|
-
if ((0,
|
|
1067
|
+
if ((0, import_ramda6.startsWith)(name2, key) && !(0, import_ramda6.startsWith)(`${name2}-v2`, key)) {
|
|
1049
1068
|
storeCache = fillStoreCache(storeCache, name2, "remove", {
|
|
1050
1069
|
key: [key.slice(offset)],
|
|
1051
1070
|
value: data[key]
|
|
@@ -1069,7 +1088,7 @@ var StoreController = class {
|
|
|
1069
1088
|
const offset = `${name2}-`.length;
|
|
1070
1089
|
const filtered = {};
|
|
1071
1090
|
for (const key of Object.keys(data)) {
|
|
1072
|
-
if ((0,
|
|
1091
|
+
if ((0, import_ramda6.startsWith)(name2, key)) {
|
|
1073
1092
|
filtered[key.slice(offset)] = data[key];
|
|
1074
1093
|
}
|
|
1075
1094
|
}
|
|
@@ -1638,7 +1657,7 @@ var PeprModule = class {
|
|
|
1638
1657
|
* @param opts Options for the Pepr runtime
|
|
1639
1658
|
*/
|
|
1640
1659
|
constructor({ description, pepr }, capabilities = [], opts = {}) {
|
|
1641
|
-
const config = (0,
|
|
1660
|
+
const config = (0, import_ramda7.clone)(pepr);
|
|
1642
1661
|
config.description = description;
|
|
1643
1662
|
ValidateError(config.onError);
|
|
1644
1663
|
if (isBuildMode()) {
|
|
@@ -1661,7 +1680,7 @@ var PeprModule = class {
|
|
|
1661
1680
|
this.#controller = new Controller(config, capabilities, opts.beforeHook, opts.afterHook, () => {
|
|
1662
1681
|
if (isWatchMode() || isDevMode()) {
|
|
1663
1682
|
try {
|
|
1664
|
-
setupWatch(capabilities, pepr?.alwaysIgnore?.namespaces);
|
|
1683
|
+
setupWatch(capabilities, resolveIgnoreNamespaces(pepr?.alwaysIgnore?.namespaces));
|
|
1665
1684
|
} catch (e) {
|
|
1666
1685
|
logger_default.error(e, "Error setting up watch");
|
|
1667
1686
|
process.exit(1);
|
|
@@ -1685,7 +1704,7 @@ var PeprModule = class {
|
|
|
1685
1704
|
};
|
|
1686
1705
|
|
|
1687
1706
|
// src/lib/core/storage.ts
|
|
1688
|
-
var
|
|
1707
|
+
var import_ramda8 = require("ramda");
|
|
1689
1708
|
var import_json_pointer = __toESM(require("json-pointer"));
|
|
1690
1709
|
var MAX_WAIT_TIME = 15e3;
|
|
1691
1710
|
var STORE_VERSION_PREFIX = "v2";
|
|
@@ -1708,7 +1727,7 @@ var Storage = class {
|
|
|
1708
1727
|
this.#store = data || {};
|
|
1709
1728
|
this.#onReady();
|
|
1710
1729
|
for (const idx in this.#subscribers) {
|
|
1711
|
-
this.#subscribers[idx]((0,
|
|
1730
|
+
this.#subscribers[idx]((0, import_ramda8.clone)(this.#store));
|
|
1712
1731
|
}
|
|
1713
1732
|
};
|
|
1714
1733
|
getItem = (key) => {
|
|
@@ -1796,7 +1815,7 @@ var Storage = class {
|
|
|
1796
1815
|
};
|
|
1797
1816
|
#onReady = () => {
|
|
1798
1817
|
for (const handler of this.#readyHandlers) {
|
|
1799
|
-
handler((0,
|
|
1818
|
+
handler((0, import_ramda8.clone)(this.#store));
|
|
1800
1819
|
}
|
|
1801
1820
|
this.#onReady = () => {
|
|
1802
1821
|
};
|
|
@@ -2091,7 +2110,7 @@ var Capability = class {
|
|
|
2091
2110
|
const commonChain = { WithLabel, WithAnnotation, WithDeletionTimestamp, Mutate, Validate, Watch, Reconcile, Alias };
|
|
2092
2111
|
const isNotEmpty = (value) => Object.keys(value).length > 0;
|
|
2093
2112
|
const log = (message, cbString) => {
|
|
2094
|
-
const filteredObj = (0,
|
|
2113
|
+
const filteredObj = (0, import_ramda9.pickBy)(isNotEmpty, binding.filters);
|
|
2095
2114
|
logger_default.info(`${message} configured for ${binding.event}`, prefix);
|
|
2096
2115
|
logger_default.info(filteredObj, prefix);
|
|
2097
2116
|
logger_default.debug(cbString, prefix);
|