pepr 0.32.1 → 0.32.3
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.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2849 -0
- package/dist/controller.js +164 -0
- package/dist/lib/assets/deploy.d.ts +3 -0
- package/dist/lib/assets/deploy.d.ts.map +1 -0
- package/dist/lib/assets/destroy.d.ts +2 -0
- package/dist/lib/assets/destroy.d.ts.map +1 -0
- package/dist/lib/assets/helm.d.ts +5 -0
- package/dist/lib/assets/helm.d.ts.map +1 -0
- package/dist/lib/assets/index.d.ts +25 -0
- package/dist/lib/assets/index.d.ts.map +1 -0
- package/dist/lib/assets/loader.d.ts +8 -0
- package/dist/lib/assets/loader.d.ts.map +1 -0
- package/dist/lib/assets/networking.d.ts +7 -0
- package/dist/lib/assets/networking.d.ts.map +1 -0
- package/dist/lib/assets/pods.d.ts +126 -0
- package/dist/lib/assets/pods.d.ts.map +1 -0
- package/dist/lib/assets/rbac.d.ts +14 -0
- package/dist/lib/assets/rbac.d.ts.map +1 -0
- package/dist/lib/assets/store.d.ts +7 -0
- package/dist/lib/assets/store.d.ts.map +1 -0
- package/dist/lib/assets/webhooks.d.ts +6 -0
- package/dist/lib/assets/webhooks.d.ts.map +1 -0
- package/dist/lib/assets/yaml.d.ts +6 -0
- package/dist/lib/assets/yaml.d.ts.map +1 -0
- package/dist/lib/capability.d.ts +66 -0
- package/dist/lib/capability.d.ts.map +1 -0
- package/dist/lib/controller/index.d.ts +10 -0
- package/dist/lib/controller/index.d.ts.map +1 -0
- package/dist/lib/controller/store.d.ts +7 -0
- package/dist/lib/controller/store.d.ts.map +1 -0
- package/dist/lib/errors.d.ts +12 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/filter.d.ts +11 -0
- package/dist/lib/filter.d.ts.map +1 -0
- package/dist/lib/helpers.d.ts +34 -0
- package/dist/lib/helpers.d.ts.map +1 -0
- package/dist/lib/included-files.d.ts +2 -0
- package/dist/lib/included-files.d.ts.map +1 -0
- package/dist/lib/k8s.d.ts +132 -0
- package/dist/lib/k8s.d.ts.map +1 -0
- package/dist/lib/logger.d.ts +3 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/metrics.d.ts +39 -0
- package/dist/lib/metrics.d.ts.map +1 -0
- package/dist/lib/module.d.ts +62 -0
- package/dist/lib/module.d.ts.map +1 -0
- package/dist/lib/mutate-processor.d.ts +5 -0
- package/dist/lib/mutate-processor.d.ts.map +1 -0
- package/dist/lib/mutate-request.d.ts +79 -0
- package/dist/lib/mutate-request.d.ts.map +1 -0
- package/dist/lib/queue.d.ts +19 -0
- package/dist/lib/queue.d.ts.map +1 -0
- package/dist/lib/schedule.d.ts +76 -0
- package/dist/lib/schedule.d.ts.map +1 -0
- package/dist/lib/storage.d.ts +83 -0
- package/dist/lib/storage.d.ts.map +1 -0
- package/dist/lib/tls.d.ts +18 -0
- package/dist/lib/tls.d.ts.map +1 -0
- package/dist/lib/types.d.ts +192 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +23 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/validate-processor.d.ts +4 -0
- package/dist/lib/validate-processor.d.ts.map +1 -0
- package/dist/lib/validate-request.d.ts +55 -0
- package/dist/lib/validate-request.d.ts.map +1 -0
- package/dist/lib/watch-processor.d.ts +10 -0
- package/dist/lib/watch-processor.d.ts.map +1 -0
- package/dist/lib.d.ts +11 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/lib.js +1808 -0
- package/dist/lib.js.map +7 -0
- package/dist/runtime/controller.d.ts +3 -0
- package/dist/runtime/controller.d.ts.map +1 -0
- package/dist/sdk/sdk.d.ts +38 -0
- package/dist/sdk/sdk.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/templates/capabilities/hello-pepr.ts +12 -8
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
|
|
26
|
+
// src/runtime/controller.ts
|
|
27
|
+
var import_child_process = require("child_process");
|
|
28
|
+
var import_crypto = __toESM(require("crypto"));
|
|
29
|
+
var import_fs = __toESM(require("fs"));
|
|
30
|
+
var import_zlib = require("zlib");
|
|
31
|
+
var import_kubernetes_fluent_client4 = require("kubernetes-fluent-client");
|
|
32
|
+
|
|
33
|
+
// src/lib/logger.ts
|
|
34
|
+
var import_pino = require("pino");
|
|
35
|
+
var isPrettyLog = process.env.PEPR_PRETTY_LOGS === "true";
|
|
36
|
+
var pretty = {
|
|
37
|
+
target: "pino-pretty",
|
|
38
|
+
options: {
|
|
39
|
+
colorize: true
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var transport = isPrettyLog ? pretty : void 0;
|
|
43
|
+
var pinoTimeFunction = process.env.PINO_TIME_STAMP === "iso" ? () => import_pino.stdTimeFunctions.isoTime() : () => import_pino.stdTimeFunctions.epochTime();
|
|
44
|
+
var Log = (0, import_pino.pino)({
|
|
45
|
+
transport,
|
|
46
|
+
timestamp: pinoTimeFunction
|
|
47
|
+
});
|
|
48
|
+
if (process.env.LOG_LEVEL) {
|
|
49
|
+
Log.level = process.env.LOG_LEVEL;
|
|
50
|
+
}
|
|
51
|
+
var logger_default = Log;
|
|
52
|
+
|
|
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" }, version: "0.32.3", 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", "build:image": "npm run build && docker buildx build --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", "test:journey": "npm run test:journey:k3d && npm run test:journey: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 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 && 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" }, dependencies: { "@types/ramda": "0.30.0", express: "4.19.2", "fast-json-patch": "3.1.1", "kubernetes-fluent-client": "2.6.2", pino: "9.2.0", "pino-pretty": "11.2.1", "prom-client": "15.1.2", ramda: "0.30.1" }, devDependencies: { "@commitlint/cli": "19.3.0", "@commitlint/config-conventional": "19.2.2", "@jest/globals": "29.7.0", "@types/eslint": "8.56.10", "@types/express": "4.17.21", "@types/node": "18.x.x", "@types/node-forge": "1.3.11", "@types/prompts": "2.4.9", "@types/uuid": "9.0.8", jest: "29.7.0", nock: "13.5.4", "ts-jest": "29.1.5" }, peerDependencies: { "@typescript-eslint/eslint-plugin": "6.15.0", "@typescript-eslint/parser": "6.15.0", commander: "11.1.0", esbuild: "0.19.10", eslint: "8.56.0", "node-forge": "1.3.1", prettier: "3.1.1", prompts: "2.4.2", typescript: "5.3.3", uuid: "9.0.1" } };
|
|
55
|
+
|
|
56
|
+
// src/lib/k8s.ts
|
|
57
|
+
var import_kubernetes_fluent_client = require("kubernetes-fluent-client");
|
|
58
|
+
var PeprStore = class extends import_kubernetes_fluent_client.GenericKind {
|
|
59
|
+
};
|
|
60
|
+
var peprStoreGVK = {
|
|
61
|
+
kind: "PeprStore",
|
|
62
|
+
version: "v1",
|
|
63
|
+
group: "pepr.dev"
|
|
64
|
+
};
|
|
65
|
+
(0, import_kubernetes_fluent_client.RegisterKind)(PeprStore, peprStoreGVK);
|
|
66
|
+
|
|
67
|
+
// src/lib/assets/store.ts
|
|
68
|
+
var { group, version, kind } = peprStoreGVK;
|
|
69
|
+
var singular = kind.toLocaleLowerCase();
|
|
70
|
+
var plural = `${singular}s`;
|
|
71
|
+
var name = `${plural}.${group}`;
|
|
72
|
+
var peprStoreCRD = {
|
|
73
|
+
apiVersion: "apiextensions.k8s.io/v1",
|
|
74
|
+
kind: "CustomResourceDefinition",
|
|
75
|
+
metadata: {
|
|
76
|
+
name
|
|
77
|
+
},
|
|
78
|
+
spec: {
|
|
79
|
+
group,
|
|
80
|
+
versions: [
|
|
81
|
+
{
|
|
82
|
+
// typescript doesn't know this is really already set, which is kind of annoying
|
|
83
|
+
name: version || "v1",
|
|
84
|
+
served: true,
|
|
85
|
+
storage: true,
|
|
86
|
+
schema: {
|
|
87
|
+
openAPIV3Schema: {
|
|
88
|
+
type: "object",
|
|
89
|
+
properties: {
|
|
90
|
+
data: {
|
|
91
|
+
type: "object",
|
|
92
|
+
additionalProperties: {
|
|
93
|
+
type: "string"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
scope: "Namespaced",
|
|
102
|
+
names: {
|
|
103
|
+
plural,
|
|
104
|
+
singular,
|
|
105
|
+
kind
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// src/lib/helpers.ts
|
|
111
|
+
var import_kubernetes_fluent_client3 = require("kubernetes-fluent-client");
|
|
112
|
+
|
|
113
|
+
// src/sdk/sdk.ts
|
|
114
|
+
var import_kubernetes_fluent_client2 = require("kubernetes-fluent-client");
|
|
115
|
+
|
|
116
|
+
// src/lib/helpers.ts
|
|
117
|
+
var ValidationError = class extends Error {
|
|
118
|
+
};
|
|
119
|
+
function validateHash(expectedHash) {
|
|
120
|
+
const sha256Regex = /^[a-f0-9]{64}$/i;
|
|
121
|
+
if (!expectedHash || !sha256Regex.test(expectedHash)) {
|
|
122
|
+
logger_default.error(`Invalid hash. Expected a valid SHA-256 hash, got ${expectedHash}`);
|
|
123
|
+
throw new ValidationError("Invalid hash");
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// src/runtime/controller.ts
|
|
128
|
+
var { version: version2 } = packageJSON;
|
|
129
|
+
function runModule(expectedHash) {
|
|
130
|
+
const gzPath = `/app/load/module-${expectedHash}.js.gz`;
|
|
131
|
+
const jsPath = `/app/module-${expectedHash}.js`;
|
|
132
|
+
logger_default.level = "info";
|
|
133
|
+
if (!import_fs.default.existsSync(gzPath)) {
|
|
134
|
+
throw new Error(`File not found: ${gzPath}`);
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
logger_default.info(`Loading module ${gzPath}`);
|
|
138
|
+
const codeGZ = import_fs.default.readFileSync(gzPath);
|
|
139
|
+
const code = (0, import_zlib.gunzipSync)(codeGZ);
|
|
140
|
+
const actualHash = import_crypto.default.createHash("sha256").update(code).digest("hex");
|
|
141
|
+
if (!import_crypto.default.timingSafeEqual(Buffer.from(expectedHash, "hex"), Buffer.from(actualHash, "hex"))) {
|
|
142
|
+
throw new Error(`File hash does not match, expected ${expectedHash} but got ${actualHash}`);
|
|
143
|
+
}
|
|
144
|
+
logger_default.info(`File hash matches, running module`);
|
|
145
|
+
import_fs.default.writeFileSync(jsPath, code);
|
|
146
|
+
(0, import_child_process.fork)(jsPath);
|
|
147
|
+
} catch (e) {
|
|
148
|
+
throw new Error(`Failed to decompress module: ${e}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
logger_default.info(`Pepr Controller (v${version2})`);
|
|
152
|
+
var hash = process.argv[2];
|
|
153
|
+
var startup = async () => {
|
|
154
|
+
try {
|
|
155
|
+
logger_default.info("Applying the Pepr Store CRD if it doesn't exist");
|
|
156
|
+
await (0, import_kubernetes_fluent_client4.K8s)(import_kubernetes_fluent_client4.kind.CustomResourceDefinition).Apply(peprStoreCRD, { force: true });
|
|
157
|
+
validateHash(hash);
|
|
158
|
+
runModule(hash);
|
|
159
|
+
} catch (err) {
|
|
160
|
+
logger_default.error(err, `Error starting Pepr Store CRD`);
|
|
161
|
+
process.exit(1);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
startup().catch((err) => logger_default.error(err, `Error starting Pepr Controller`));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/deploy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAS3B,wBAAsB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,MAAM,iBA8CnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destroy.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/destroy.ts"],"names":[],"mappings":"AAQA,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,iBAwB/C"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function nsTemplate(): string;
|
|
2
|
+
export declare function chartYaml(name: string, description?: string): string;
|
|
3
|
+
export declare function watcherDeployTemplate(buildTimestamp: string): string;
|
|
4
|
+
export declare function admissionDeployTemplate(buildTimestamp: string): string;
|
|
5
|
+
//# sourceMappingURL=helm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helm.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/helm.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,WAezB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,UA2B3D;AAED,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,UAiF3D;AAED,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,UAsF7D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ModuleConfig } from "../module";
|
|
2
|
+
import { TLSOut } from "../tls";
|
|
3
|
+
import { CapabilityExport } from "../types";
|
|
4
|
+
import { WebhookIgnore } from "../k8s";
|
|
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: (rbacMode: string) => Promise<string>;
|
|
23
|
+
generateHelmChart: (basePath: string) => Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAcvC,qBAAa,MAAM;IAYf,QAAQ,CAAC,MAAM,EAAE,YAAY;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,IAAI,CAAC;IAbhB,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;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;gBAGF,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,oBAAQ;IAcxB,OAAO,SAAU,MAAM,UAErB;IAEF,MAAM,UAAiB,OAAO,mBAAmB,MAAM,mBAGrD;IAEF,QAAQ,SAAU,MAAM,YAA0B;IAElD,aAAa,SAAU,MAAM,YAA+B;IAE5D,OAAO,aAAoB,MAAM,qBAQ/B;IAEF,iBAAiB,aAAoB,MAAM,mBAoGzC;CACH"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CapabilityExport } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Read the capabilities from the module by running it in build mode
|
|
4
|
+
* @param path
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadCapabilities(path: string): Promise<CapabilityExport[]>;
|
|
8
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/loader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA4B1E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { kind } from "kubernetes-fluent-client";
|
|
2
|
+
import { TLSOut } from "../tls";
|
|
3
|
+
export declare function apiTokenSecret(name: string, apiToken: string): kind.Secret;
|
|
4
|
+
export declare function tlsSecret(name: string, tls: TLSOut): kind.Secret;
|
|
5
|
+
export declare function service(name: string): kind.Service;
|
|
6
|
+
export declare function watcherService(name: string): kind.Service;
|
|
7
|
+
//# sourceMappingURL=networking.d.ts.map
|
|
@@ -0,0 +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,CAwBlD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,CAwBzD"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { V1EnvVar } from "@kubernetes/client-node";
|
|
3
|
+
import { kind } from "kubernetes-fluent-client";
|
|
4
|
+
import { Assets } from ".";
|
|
5
|
+
/** Generate the pepr-system namespace */
|
|
6
|
+
export declare function namespace(namespaceLabels?: Record<string, string>): {
|
|
7
|
+
apiVersion: string;
|
|
8
|
+
kind: string;
|
|
9
|
+
metadata: {
|
|
10
|
+
name: string;
|
|
11
|
+
labels: Record<string, string>;
|
|
12
|
+
};
|
|
13
|
+
} | {
|
|
14
|
+
apiVersion: string;
|
|
15
|
+
kind: string;
|
|
16
|
+
metadata: {
|
|
17
|
+
name: string;
|
|
18
|
+
labels?: undefined;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare function watcher(assets: Assets, hash: string, buildTimestamp: string): {
|
|
22
|
+
apiVersion: string;
|
|
23
|
+
kind: string;
|
|
24
|
+
metadata: {
|
|
25
|
+
name: string;
|
|
26
|
+
namespace: string;
|
|
27
|
+
annotations: {
|
|
28
|
+
"pepr.dev/description": string;
|
|
29
|
+
};
|
|
30
|
+
labels: {
|
|
31
|
+
app: string;
|
|
32
|
+
"pepr.dev/controller": string;
|
|
33
|
+
"pepr.dev/uuid": string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
spec: {
|
|
37
|
+
replicas: number;
|
|
38
|
+
strategy: {
|
|
39
|
+
type: string;
|
|
40
|
+
};
|
|
41
|
+
selector: {
|
|
42
|
+
matchLabels: {
|
|
43
|
+
app: string;
|
|
44
|
+
"pepr.dev/controller": string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
template: {
|
|
48
|
+
metadata: {
|
|
49
|
+
annotations: {
|
|
50
|
+
buildTimestamp: string;
|
|
51
|
+
};
|
|
52
|
+
labels: {
|
|
53
|
+
app: string;
|
|
54
|
+
"pepr.dev/controller": string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
spec: {
|
|
58
|
+
terminationGracePeriodSeconds: number;
|
|
59
|
+
serviceAccountName: string;
|
|
60
|
+
securityContext: {
|
|
61
|
+
runAsUser: number;
|
|
62
|
+
runAsGroup: number;
|
|
63
|
+
runAsNonRoot: boolean;
|
|
64
|
+
fsGroup: number;
|
|
65
|
+
};
|
|
66
|
+
containers: {
|
|
67
|
+
name: string;
|
|
68
|
+
image: string;
|
|
69
|
+
imagePullPolicy: string;
|
|
70
|
+
command: string[];
|
|
71
|
+
readinessProbe: {
|
|
72
|
+
httpGet: {
|
|
73
|
+
path: string;
|
|
74
|
+
port: number;
|
|
75
|
+
scheme: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
livenessProbe: {
|
|
79
|
+
httpGet: {
|
|
80
|
+
path: string;
|
|
81
|
+
port: number;
|
|
82
|
+
scheme: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
ports: {
|
|
86
|
+
containerPort: number;
|
|
87
|
+
}[];
|
|
88
|
+
resources: {
|
|
89
|
+
requests: {
|
|
90
|
+
memory: string;
|
|
91
|
+
cpu: string;
|
|
92
|
+
};
|
|
93
|
+
limits: {
|
|
94
|
+
memory: string;
|
|
95
|
+
cpu: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
securityContext: {
|
|
99
|
+
runAsUser: number;
|
|
100
|
+
runAsGroup: number;
|
|
101
|
+
runAsNonRoot: boolean;
|
|
102
|
+
allowPrivilegeEscalation: boolean;
|
|
103
|
+
capabilities: {
|
|
104
|
+
drop: string[];
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
volumeMounts: {
|
|
108
|
+
name: string;
|
|
109
|
+
mountPath: string;
|
|
110
|
+
readOnly: boolean;
|
|
111
|
+
}[];
|
|
112
|
+
env: V1EnvVar[];
|
|
113
|
+
}[];
|
|
114
|
+
volumes: {
|
|
115
|
+
name: string;
|
|
116
|
+
secret: {
|
|
117
|
+
secretName: string;
|
|
118
|
+
};
|
|
119
|
+
}[];
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
} | null;
|
|
124
|
+
export declare function deployment(assets: Assets, hash: string, buildTimestamp: string): kind.Deployment;
|
|
125
|
+
export declare function moduleSecret(name: string, data: Buffer, hash: string): kind.Secret;
|
|
126
|
+
//# sourceMappingURL=pods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,wBAAgB,SAAS,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;;;;;;;;;;;;;EAmBjE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAiJ3E;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC,UAAU,CAuIhG;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAuBlF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { kind } from "kubernetes-fluent-client";
|
|
2
|
+
import { CapabilityExport } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Grants the controller access to cluster resources beyond the mutating webhook.
|
|
5
|
+
*
|
|
6
|
+
* @todo: should dynamically generate this based on resources used by the module. will also need to explore how this should work for multiple modules.
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function clusterRole(name: string, capabilities: CapabilityExport[], rbacMode?: string): kind.ClusterRole;
|
|
10
|
+
export declare function clusterRoleBinding(name: string): kind.ClusterRoleBinding;
|
|
11
|
+
export declare function serviceAccount(name: string): kind.ServiceAccount;
|
|
12
|
+
export declare function storeRole(name: string): kind.Role;
|
|
13
|
+
export declare function storeRoleBinding(name: string): kind.RoleBinding;
|
|
14
|
+
//# sourceMappingURL=rbac.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rbac.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/rbac.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,EAAE,QAAQ,GAAE,MAAW,GAAG,IAAI,CAAC,WAAW,CA6BnH;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAkBxE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,cAAc,CAShE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,IAAI,CAejD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,WAAW,CAmB/D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { kind as k } from "kubernetes-fluent-client";
|
|
2
|
+
export declare const group: string, version: string, kind: string;
|
|
3
|
+
export declare const singular: string;
|
|
4
|
+
export declare const plural: string;
|
|
5
|
+
export declare const name: string;
|
|
6
|
+
export declare const peprStoreCRD: k.CustomResourceDefinition;
|
|
7
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,IAAI,CAAC,EAAE,MAAM,0BAA0B,CAAC;AAIrD,eAAO,MAAQ,KAAK,UAAE,OAAO,UAAE,IAAI,QAAiB,CAAC;AACrD,eAAO,MAAM,QAAQ,QAA2B,CAAC;AACjD,eAAO,MAAM,MAAM,QAAiB,CAAC;AACrC,eAAO,MAAM,IAAI,QAAuB,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,wBAoC5B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { V1RuleWithOperations } from "@kubernetes/client-node";
|
|
2
|
+
import { kind } from "kubernetes-fluent-client";
|
|
3
|
+
import { Assets } from ".";
|
|
4
|
+
export declare function generateWebhookRules(assets: Assets, isMutateWebhook: boolean): Promise<V1RuleWithOperations[]>;
|
|
5
|
+
export declare function webhookConfig(assets: Assets, mutateOrValidate: "mutate" | "validate", timeoutSeconds?: number): Promise<kind.MutatingWebhookConfiguration | kind.ValidatingWebhookConfiguration | null>;
|
|
6
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +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,GAAG,CAAC;AAW3B,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,mCAoDlF;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,QAAQ,GAAG,UAAU,EACvC,cAAc,SAAK,GAClB,OAAO,CAAC,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,8BAA8B,GAAG,IAAI,CAAC,CAkEzF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Assets } from ".";
|
|
2
|
+
export declare function overridesFile({ hash, name, image, config, apiToken }: Assets, path: string): Promise<void>;
|
|
3
|
+
export declare function zarfYaml({ name, image, config }: Assets, path: string): string;
|
|
4
|
+
export declare function zarfYamlChart({ name, image, config }: Assets, path: string): string;
|
|
5
|
+
export declare function allYaml(assets: Assets, rbacMode: string): Promise<string>;
|
|
6
|
+
//# sourceMappingURL=yaml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/yaml.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAO3B,wBAAsB,aAAa,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAwHhG;AACD,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UA0BrE;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UA2B1E;AAED,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,mBAyC7D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { GenericClass, GroupVersionKind } from "kubernetes-fluent-client";
|
|
2
|
+
import { PeprStore, Storage } from "./storage";
|
|
3
|
+
import { Schedule } from "./schedule";
|
|
4
|
+
import { Binding, CapabilityCfg, CapabilityExport, WhenSelector } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* A capability is a unit of functionality that can be registered with the Pepr runtime.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Capability implements CapabilityExport {
|
|
9
|
+
#private;
|
|
10
|
+
hasSchedule: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Run code on a schedule with the capability.
|
|
13
|
+
*
|
|
14
|
+
* @param schedule The schedule to run the code on
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
OnSchedule: (schedule: Schedule) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Store is a key-value data store that can be used to persist data that should be shared
|
|
20
|
+
* between requests. Each capability has its own store, and the data is persisted in Kubernetes
|
|
21
|
+
* in the `pepr-system` namespace.
|
|
22
|
+
*
|
|
23
|
+
* Note: You should only access the store from within an action.
|
|
24
|
+
*/
|
|
25
|
+
Store: PeprStore;
|
|
26
|
+
/**
|
|
27
|
+
* ScheduleStore is a key-value data store used to persist schedule data that should be shared
|
|
28
|
+
* between intervals. Each Schedule shares store, and the data is persisted in Kubernetes
|
|
29
|
+
* in the `pepr-system` namespace.
|
|
30
|
+
*
|
|
31
|
+
* Note: There is no direct access to schedule store
|
|
32
|
+
*/
|
|
33
|
+
ScheduleStore: PeprStore;
|
|
34
|
+
get bindings(): Binding[];
|
|
35
|
+
get name(): string;
|
|
36
|
+
get description(): string;
|
|
37
|
+
get namespaces(): string[];
|
|
38
|
+
constructor(cfg: CapabilityCfg);
|
|
39
|
+
/**
|
|
40
|
+
* Register the store with the capability. This is called automatically by the Pepr controller.
|
|
41
|
+
*
|
|
42
|
+
* @param store
|
|
43
|
+
*/
|
|
44
|
+
registerScheduleStore: () => {
|
|
45
|
+
scheduleStore: Storage;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Register the store with the capability. This is called automatically by the Pepr controller.
|
|
49
|
+
*
|
|
50
|
+
* @param store
|
|
51
|
+
*/
|
|
52
|
+
registerStore: () => {
|
|
53
|
+
store: Storage;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* The When method is used to register a action to be executed when a Kubernetes resource is
|
|
57
|
+
* processed by Pepr. The action will be executed if the resource matches the specified kind and any
|
|
58
|
+
* filters that are applied.
|
|
59
|
+
*
|
|
60
|
+
* @param model the KubernetesObject model to match
|
|
61
|
+
* @param kind if using a custom KubernetesObject not available in `a.*`, specify the GroupVersionKind
|
|
62
|
+
* @returns
|
|
63
|
+
*/
|
|
64
|
+
When: <T extends GenericClass>(model: T, kind?: GroupVersionKind) => WhenSelector<T>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=capability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../src/lib/capability.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAA2B,MAAM,0BAA0B,CAAC;AAMnG,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAc,QAAQ,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EACL,OAAO,EAGP,aAAa,EACb,gBAAgB,EAMhB,YAAY,EACb,MAAM,SAAS,CAAC;AAKjB;;GAEG;AACH,qBAAa,UAAW,YAAW,gBAAgB;;IASjD,WAAW,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAqBtC;IAEF;;;;;;OAMG;IACH,KAAK,EAAE,SAAS,CASd;IAEF;;;;;;OAMG;IACH,aAAa,EAAE,SAAS,CAStB;IAEF,IAAI,QAAQ,cAEX;IAED,IAAI,IAAI,WAEP;IAED,IAAI,WAAW,WAEd;IAED,IAAI,UAAU,aAEb;gBAEW,GAAG,EAAE,aAAa;IAU9B;;;;OAIG;IACH,qBAAqB;;MAanB;IAEF;;;;OAIG;IACH,aAAa;;MAaX;IAEF;;;;;;;;OAQG;IACH,IAAI,4CAA6C,gBAAgB,qBAkI/D;CACH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Capability } from "../capability";
|
|
2
|
+
import { MutateResponse, AdmissionRequest, ValidateResponse } from "../k8s";
|
|
3
|
+
import { ModuleConfig } from "../module";
|
|
4
|
+
export declare class Controller {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(config: ModuleConfig, capabilities: Capability[], beforeHook?: (req: AdmissionRequest) => void, afterHook?: (res: MutateResponse | ValidateResponse) => void, onReady?: () => void);
|
|
7
|
+
/** Start the webhook server */
|
|
8
|
+
startServer: (port: number) => void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,EAAE,gBAAgB,EAAE,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,GAAG,gBAAgB,KAAK,IAAI,EAC5D,OAAO,CAAC,EAAE,MAAM,IAAI;IAiCtB,+BAA+B;IAC/B,WAAW,SAAU,MAAM,UAqDzB;CAqMH"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Capability } from "../capability";
|
|
2
|
+
export declare const debounceBackoff = 5000;
|
|
3
|
+
export declare class PeprControllerStore {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(capabilities: Capability[], name: string, onReady?: () => void);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/lib/controller/store.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,qBAAa,mBAAmB;;gBAMlB,YAAY,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,IAAI;CAqM3E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const Errors: {
|
|
2
|
+
audit: string;
|
|
3
|
+
ignore: string;
|
|
4
|
+
reject: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const ErrorList: string[];
|
|
7
|
+
/**
|
|
8
|
+
* Validate the error or throw an error
|
|
9
|
+
* @param error
|
|
10
|
+
*/
|
|
11
|
+
export declare function ValidateError(error?: string): void;
|
|
12
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM;;;;CAIlB,CAAC;AAEF,eAAO,MAAM,SAAS,UAAwB,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,SAAK,QAIvC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AdmissionRequest } from "./k8s";
|
|
2
|
+
import { Binding } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* shouldSkipRequest determines if a request should be skipped based on the binding filters.
|
|
5
|
+
*
|
|
6
|
+
* @param binding the action binding
|
|
7
|
+
* @param req the incoming request
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function shouldSkipRequest(binding: Binding, req: AdmissionRequest, capabilityNamespaces: string[]): boolean;
|
|
11
|
+
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/lib/filter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAa,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAS,MAAM,SAAS,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,EAAE,WA+FxG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { KubernetesObject } from "kubernetes-fluent-client";
|
|
2
|
+
import { Binding, CapabilityExport } from "./types";
|
|
3
|
+
export declare class ValidationError extends Error {
|
|
4
|
+
}
|
|
5
|
+
export declare function validateCapabilityNames(capabilities: CapabilityExport[] | undefined): void;
|
|
6
|
+
export declare function validateHash(expectedHash: string): void;
|
|
7
|
+
type RBACMap = {
|
|
8
|
+
[key: string]: {
|
|
9
|
+
verbs: string[];
|
|
10
|
+
plural: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare function checkOverlap(bindingFilters: Record<string, string>, objectFilters: Record<string, string>): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Decide to run callback after the event comes back from API Server
|
|
16
|
+
**/
|
|
17
|
+
export declare function filterNoMatchReason(binding: Partial<Binding>, obj: Partial<KubernetesObject>, capabilityNamespaces: string[]): string;
|
|
18
|
+
export declare function addVerbIfNotExists(verbs: string[], verb: string): void;
|
|
19
|
+
export declare function createRBACMap(capabilities: CapabilityExport[]): RBACMap;
|
|
20
|
+
export declare function createDirectoryIfNotExists(path: string): Promise<void>;
|
|
21
|
+
export declare function hasEveryOverlap<T>(array1: T[], array2: T[]): boolean;
|
|
22
|
+
export declare function hasAnyOverlap<T>(array1: T[], array2: T[]): boolean;
|
|
23
|
+
export declare function ignoredNamespaceConflict(ignoreNamespaces: string[], bindingNamespaces: string[]): boolean;
|
|
24
|
+
export declare function bindingAndCapabilityNSConflict(bindingNamespaces: string[], capabilityNamespaces: string[]): boolean;
|
|
25
|
+
export declare function generateWatchNamespaceError(ignoredNamespaces: string[], bindingNamespaces: string[], capabilityNamespaces: string[]): string;
|
|
26
|
+
export declare function namespaceComplianceValidator(capability: CapabilityExport, ignoredNamespaces?: string[]): void;
|
|
27
|
+
export declare function checkDeploymentStatus(namespace: string): Promise<boolean>;
|
|
28
|
+
export declare function namespaceDeploymentsReady(namespace?: string): Promise<true | undefined>;
|
|
29
|
+
export declare function secretOverLimit(str: string): boolean;
|
|
30
|
+
export declare const parseTimeout: (value: string, previous: unknown) => number;
|
|
31
|
+
export declare function dedent(file: string): string;
|
|
32
|
+
export declare function replaceString(str: string, stringA: string, stringB: string): string;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/lib/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAO,gBAAgB,EAAQ,MAAM,0BAA0B,CAAC;AAEvE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGpD,qBAAa,eAAgB,SAAQ,KAAK;CAAG;AAE7C,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,gBAAgB,EAAE,GAAG,SAAS,GAAG,IAAI,CAQ1F;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAOvD;AAED,KAAK,OAAO,GAAG;IACb,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAGF,wBAAgB,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CA2BnH;AAED;;IAEI;AACJ,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EACzB,GAAG,EAAE,OAAO,CAAC,gBAAgB,CAAC,EAC9B,oBAAoB,EAAE,MAAM,EAAE,GAC7B,MAAM,CAiER;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,QAI/D;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAyBvE;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,MAAM,iBAU5D;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,CAMpE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,CAMlE;AAED,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,WAE/F;AAED,wBAAgB,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;AAID,wBAAsB,qBAAqB,CAAC,SAAS,EAAE,MAAM,oBAsB5D;AAGD,wBAAsB,yBAAyB,CAAC,SAAS,GAAE,MAAsB,6BAWhF;AAGD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMpD;AAGD,eAAO,MAAM,YAAY,UAAW,MAAM,YAAY,OAAO,KAAG,MAW/D,CAAC;AAGF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,UAelC;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAK1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"included-files.d.ts","sourceRoot":"","sources":["../../src/lib/included-files.ts"],"names":[],"mappings":"AAKA,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,iBAanG"}
|