pepr 2.0.0 → 2.0.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/README.md +5 -4
- package/dist/cli/build/applyCompatibilityPatches.d.ts +2 -0
- package/dist/cli/build/applyCompatibilityPatches.d.ts.map +1 -0
- package/dist/cli/build/buildModule.d.ts.map +1 -1
- package/dist/cli/build/index.d.ts.map +1 -1
- package/dist/cli/deploy/buildAndDeploy.d.ts.map +1 -1
- package/dist/cli/dev.d.ts.map +1 -1
- package/dist/cli/init/index.d.ts.map +1 -1
- package/dist/cli/init/templates.d.ts +2 -0
- package/dist/cli/init/templates.d.ts.map +1 -1
- package/dist/cli/rbacModeWarning.d.ts +3 -0
- package/dist/cli/rbacModeWarning.d.ts.map +1 -0
- package/dist/cli.js +78 -34
- package/dist/controller.js +15 -13
- package/dist/lib/assets/assets.d.ts +1 -0
- package/dist/lib/assets/assets.d.ts.map +1 -1
- package/dist/lib/assets/yaml/generateZarfYaml.d.ts.map +1 -1
- package/dist/lib/core/queue.d.ts +1 -1
- package/dist/lib/core/queue.d.ts.map +1 -1
- package/dist/lib/processors/watch-processor.d.ts +1 -3
- package/dist/lib/processors/watch-processor.d.ts.map +1 -1
- package/dist/lib/types.d.ts +1 -2
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib.js +5 -6
- package/dist/lib.js.map +2 -2
- package/package.json +15 -13
- package/src/cli/build/applyCompatibilityPatches.ts +25 -0
- package/src/cli/build/buildModule.ts +11 -5
- package/src/cli/build/index.ts +2 -0
- package/src/cli/deploy/buildAndDeploy.ts +2 -0
- package/src/cli/dev.ts +6 -0
- package/src/cli/init/index.ts +2 -6
- package/src/cli/rbacModeWarning.ts +15 -0
- package/src/lib/assets/assets.ts +24 -18
- package/src/lib/assets/yaml/generateZarfYaml.ts +2 -0
- package/src/lib/core/queue.ts +1 -1
- package/src/lib/processors/watch-processor.ts +4 -4
- package/src/lib/types.ts +6 -2
package/package.json
CHANGED
|
@@ -16,17 +16,18 @@
|
|
|
16
16
|
"!src/fixtures/**",
|
|
17
17
|
"!dist/**/*.test.d.ts*"
|
|
18
18
|
],
|
|
19
|
-
"version": "2.0.
|
|
19
|
+
"version": "2.0.3",
|
|
20
20
|
"main": "dist/lib.js",
|
|
21
21
|
"types": "dist/lib.d.ts",
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsc -p config/tsconfig.root.json && node build.mjs && npm pack",
|
|
24
24
|
"build:image": "npm run build && docker buildx build --output type=docker --tag pepr:dev .",
|
|
25
|
-
"build:image:unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev
|
|
25
|
+
"build:image:unicorn": "npm run build && docker buildx build --file config/Dockerfile --output type=docker --tag pepr/private:dev .",
|
|
26
26
|
"ci": "npm ci",
|
|
27
27
|
"cluster:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system",
|
|
28
28
|
"cluster:k3d:import-upstream": "npm run build && docker buildx build --output type=docker --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev",
|
|
29
|
-
"cluster:k3d:import-unicorn": "npm run build && docker buildx build --output type=docker --tag pepr/private:dev
|
|
29
|
+
"cluster:k3d:import-unicorn": "npm run build && docker buildx build --file config/Dockerfile --output type=docker --tag pepr/private:dev . && k3d image import pepr/private:dev -c pepr-dev",
|
|
30
|
+
"check:container-image-equality": "tsx scripts/check-chainguard-image-equality.ts",
|
|
30
31
|
"format:check": "npm run format:src && npm run format:tests && npm run format:markdown && npm run format:integration && npm run format:prettier -- --check",
|
|
31
32
|
"format:fix": "npm run format:src -- --fix && npm run format:markdown -- --fix && npm run format:integration -- --fix && npm run format:prettier -- --write",
|
|
32
33
|
"format:integration": "eslint --config config/eslint.integration.config.mjs integration/cli integration/helpers",
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"format:src": "eslint --config config/eslint.root.config.mjs 'src/**/*.ts' '.github/workflows/scripts/**/*.ts' --ignore-pattern '**/*.test.ts' --ignore-pattern 'src/templates/**'",
|
|
36
37
|
"format:tests": "eslint --config config/eslint.test.config.mjs 'src/**/*.test.ts'",
|
|
37
38
|
"gen-data-json": "node hack/build-template-data.mjs",
|
|
38
|
-
"prebuild": "rm -fr dist/* && npm run gen-data-json",
|
|
39
|
+
"prebuild": "node patches/apply-patches.mjs && rm -fr dist/* && npm run gen-data-json",
|
|
39
40
|
"prepare": "if [ \"$NODE_ENV\" != 'production' ]; then husky; fi",
|
|
40
41
|
"set-version": "bash -lc 'ver=${PEPR_VERSION:-}; if [ -z \"$ver\" ]; then git fetch --tags --force; ver=$(git describe --tags --abbrev=0); fi; ver=${ver#v}; echo Using version $ver; node ./scripts/set-version.js \"$ver\"'",
|
|
41
42
|
"test": "npm run test:unit && npm run test:integration",
|
|
@@ -50,16 +51,16 @@
|
|
|
50
51
|
},
|
|
51
52
|
"dependencies": {
|
|
52
53
|
"@types/ramda": "0.32.0",
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
54
|
-
"@typescript-eslint/parser": "8.
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "8.70.0",
|
|
55
|
+
"@typescript-eslint/parser": "8.70.0",
|
|
55
56
|
"commander": "15.0.0",
|
|
56
57
|
"eslint": "^10.8.0",
|
|
57
58
|
"express": "5.2.1",
|
|
58
59
|
"fast-json-patch": "3.1.1",
|
|
59
|
-
"globals": "17.
|
|
60
|
+
"globals": "17.12.0",
|
|
60
61
|
"http-status-codes": "^2.3.0",
|
|
61
62
|
"json-pointer": "^0.6.2",
|
|
62
|
-
"kubernetes-fluent-client": "3.
|
|
63
|
+
"kubernetes-fluent-client": "3.12.3",
|
|
63
64
|
"pino": "10.3.1",
|
|
64
65
|
"pino-pretty": "13.1.3",
|
|
65
66
|
"prom-client": "15.1.3",
|
|
@@ -67,8 +68,8 @@
|
|
|
67
68
|
"ramda": "0.32.0"
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
|
-
"@commitlint/cli": "21.2.
|
|
71
|
-
"@commitlint/config-conventional": "21.2.
|
|
71
|
+
"@commitlint/cli": "21.2.2",
|
|
72
|
+
"@commitlint/config-conventional": "21.2.2",
|
|
72
73
|
"@eslint/eslintrc": "^3.3.6",
|
|
73
74
|
"@eslint/js": "^10.0.1",
|
|
74
75
|
"@types/command-line-args": "^5.2.3",
|
|
@@ -76,7 +77,7 @@
|
|
|
76
77
|
"@types/json-pointer": "^1.0.34",
|
|
77
78
|
"@types/json-schema": "^7.0.15",
|
|
78
79
|
"@types/ms": "^2.1.0",
|
|
79
|
-
"@types/node": "^
|
|
80
|
+
"@types/node": "^26.2.0",
|
|
80
81
|
"@types/node-forge": "1.3.14",
|
|
81
82
|
"@types/readable-stream": "^4.0.21",
|
|
82
83
|
"@types/urijs": "^1.19.25",
|
|
@@ -86,18 +87,19 @@
|
|
|
86
87
|
"husky": "^9.1.6",
|
|
87
88
|
"js-yaml": "^5.2.1",
|
|
88
89
|
"ms": "^2.1.3",
|
|
90
|
+
"patch-package": "^8.0.1",
|
|
89
91
|
"prettier": "^3.6.2",
|
|
90
92
|
"selfsigned": "^5.5.0",
|
|
91
93
|
"shellcheck": "^4.1.0",
|
|
92
94
|
"tsx": "^4.20.3",
|
|
93
|
-
"undici": "8.10.
|
|
95
|
+
"undici": "8.10.2",
|
|
94
96
|
"vitest": "^4.0.4"
|
|
95
97
|
},
|
|
96
98
|
"overrides": {
|
|
97
99
|
"brace-expansion": "^5.0.9",
|
|
98
100
|
"ip-address": "^10.5.0",
|
|
99
101
|
"tar": "^7.5.16",
|
|
100
|
-
"fast-uri": "^3.1.
|
|
102
|
+
"fast-uri": "^3.1.7"
|
|
101
103
|
},
|
|
102
104
|
"peerDependencies": {
|
|
103
105
|
"@types/prompts": "^2.4.9",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// SPDX-FileCopyrightText: 2023-Present The Pepr Authors
|
|
3
|
+
|
|
4
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
|
|
7
|
+
const THREAD_STREAM_TYPES = ["thread-stream", "index.d.ts"];
|
|
8
|
+
const TRANSFER_LIST_ITEM = "workerThreads.TransferListItem[]";
|
|
9
|
+
const TRANSFERABLE = "workerThreads.Transferable[]";
|
|
10
|
+
|
|
11
|
+
export function applyBuildCompatibilityPatches(npmRoot: string): void {
|
|
12
|
+
const threadStreamTypes = join(npmRoot, ...THREAD_STREAM_TYPES);
|
|
13
|
+
|
|
14
|
+
if (!existsSync(threadStreamTypes)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const currentTypes = readFileSync(threadStreamTypes, "utf8");
|
|
19
|
+
|
|
20
|
+
if (!currentTypes.includes(TRANSFER_LIST_ITEM) || currentTypes.includes(TRANSFERABLE)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
writeFileSync(threadStreamTypes, currentTypes.replace(TRANSFER_LIST_ITEM, TRANSFERABLE));
|
|
25
|
+
}
|
|
@@ -9,6 +9,7 @@ import { watchForChanges } from "./build.helpers";
|
|
|
9
9
|
import { PeprConfig, Reloader } from "../types";
|
|
10
10
|
import { BuildContext } from "esbuild";
|
|
11
11
|
import { loadModule } from "./loadModule";
|
|
12
|
+
import { applyBuildCompatibilityPatches } from "./applyCompatibilityPatches";
|
|
12
13
|
|
|
13
14
|
export type BuildModuleReturn = {
|
|
14
15
|
ctx: BuildContext<BuildOptions>;
|
|
@@ -71,6 +72,7 @@ export async function buildModule(
|
|
|
71
72
|
|
|
72
73
|
// Resolve node_modules folder (in support of npm workspaces!) and run tsc
|
|
73
74
|
const npmRoot = execFileSync("npm", ["root"]).toString().trim();
|
|
75
|
+
applyBuildCompatibilityPatches(npmRoot);
|
|
74
76
|
execFileSync(`${npmRoot}/.bin/tsc`, [
|
|
75
77
|
"--project",
|
|
76
78
|
`${modulePath}/tsconfig.json`,
|
|
@@ -142,18 +144,20 @@ export async function buildModule(
|
|
|
142
144
|
}
|
|
143
145
|
}
|
|
144
146
|
|
|
145
|
-
interface
|
|
147
|
+
interface BuildModuleError extends Error {
|
|
146
148
|
stdout?: Buffer;
|
|
147
|
-
stderr
|
|
149
|
+
stderr?: Buffer;
|
|
148
150
|
}
|
|
149
151
|
|
|
150
|
-
function handleModuleBuildError(e:
|
|
152
|
+
function handleModuleBuildError(e: BuildModuleError): never {
|
|
151
153
|
console.error(`Error building module:`, e);
|
|
152
154
|
|
|
153
|
-
if (!e.stdout)
|
|
155
|
+
if (!e.stdout) {
|
|
156
|
+
throw e;
|
|
157
|
+
}
|
|
154
158
|
|
|
155
159
|
const out = e.stdout.toString() as string;
|
|
156
|
-
const err = e.stderr
|
|
160
|
+
const err = e.stderr?.toString() ?? "";
|
|
157
161
|
|
|
158
162
|
console.info(out);
|
|
159
163
|
console.error(err);
|
|
@@ -183,4 +187,6 @@ function handleModuleBuildError(e: BuildModuleResult): void {
|
|
|
183
187
|
);
|
|
184
188
|
});
|
|
185
189
|
}
|
|
190
|
+
|
|
191
|
+
throw e;
|
|
186
192
|
}
|
package/src/cli/build/index.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import { buildModule, BuildModuleReturn } from "./buildModule";
|
|
20
20
|
import Log from "../../lib/telemetry/logger";
|
|
21
21
|
import { resolve } from "path";
|
|
22
|
+
import { warnIfAdminRbac } from "../rbacModeWarning";
|
|
22
23
|
|
|
23
24
|
interface BuildOpts {
|
|
24
25
|
customName?: string;
|
|
@@ -172,6 +173,7 @@ export default function (program: Command): void {
|
|
|
172
173
|
return;
|
|
173
174
|
}
|
|
174
175
|
|
|
176
|
+
warnIfAdminRbac(determineRbacMode(opts, buildModuleResult.cfg));
|
|
175
177
|
await generateDeploymentAssets(buildModuleResult, opts, outputDir);
|
|
176
178
|
});
|
|
177
179
|
}
|
|
@@ -5,6 +5,7 @@ import { namespaceDeploymentsReady } from "../../lib/deploymentChecks";
|
|
|
5
5
|
import { namespaceComplianceValidator, validateCapabilityNames } from "../../lib/helpers";
|
|
6
6
|
import { CapabilityExport } from "../../lib/types";
|
|
7
7
|
import { buildModule } from "../build/buildModule";
|
|
8
|
+
import { warnIfAdminRbac } from "../rbacModeWarning";
|
|
8
9
|
|
|
9
10
|
export async function buildAndDeployModule(image: string, force: boolean): Promise<void> {
|
|
10
11
|
const builtModule = await buildModule("dist", {});
|
|
@@ -24,6 +25,7 @@ export async function buildAndDeployModule(image: string, force: boolean): Promi
|
|
|
24
25
|
validateNamespaces(capability, webhook);
|
|
25
26
|
}
|
|
26
27
|
try {
|
|
28
|
+
warnIfAdminRbac(builtModule.cfg.pepr.rbacMode);
|
|
27
29
|
await webhook.deploy(deployWebhook, force, builtModule.cfg.pepr.webhookTimeout ?? 10);
|
|
28
30
|
|
|
29
31
|
// wait for capabilities to be loaded and test names
|
package/src/cli/dev.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { deployWebhook } from "../lib/assets/deploy";
|
|
|
13
13
|
import { promises as fs } from "fs";
|
|
14
14
|
import { validateCapabilityNames } from "../lib/helpers";
|
|
15
15
|
import Log from "../lib/telemetry/logger";
|
|
16
|
+
import { warnIfAdminRbac } from "./rbacModeWarning";
|
|
16
17
|
|
|
17
18
|
export default function (program: Command): void {
|
|
18
19
|
program
|
|
@@ -56,6 +57,7 @@ export default function (program: Command): void {
|
|
|
56
57
|
|
|
57
58
|
try {
|
|
58
59
|
let program: ChildProcess;
|
|
60
|
+
let hasWarnedAboutAdminRbac = false;
|
|
59
61
|
const name = `pepr-${cfg.pepr.uuid}`;
|
|
60
62
|
const scheduleStore = `pepr-${cfg.pepr.uuid}-schedule`;
|
|
61
63
|
const store = `pepr-${cfg.pepr.uuid}-store`;
|
|
@@ -65,6 +67,10 @@ export default function (program: Command): void {
|
|
|
65
67
|
Log.info(`Running module ${path}`);
|
|
66
68
|
|
|
67
69
|
// Deploy the webhook with a 30 second timeout for debugging, don't force
|
|
70
|
+
if (!hasWarnedAboutAdminRbac) {
|
|
71
|
+
warnIfAdminRbac(cfg.pepr.rbacMode);
|
|
72
|
+
hasWarnedAboutAdminRbac = true;
|
|
73
|
+
}
|
|
68
74
|
await webhook.deploy(deployWebhook, false, 30);
|
|
69
75
|
|
|
70
76
|
try {
|
package/src/cli/init/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { createProjectFiles } from "./createProjectFiles";
|
|
|
14
14
|
import { v4 as uuidv4 } from "uuid";
|
|
15
15
|
import Log from "../../lib/telemetry/logger";
|
|
16
16
|
import { sanitizeResourceName } from "../../sdk/sdk";
|
|
17
|
+
import { warnIfAdminRbac } from "../rbacModeWarning";
|
|
17
18
|
|
|
18
19
|
export default function (): Command {
|
|
19
20
|
let response = {} as PromptOptions;
|
|
@@ -71,12 +72,7 @@ export default function (): Command {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
Log.info(`New Pepr module created at ${dirName}`);
|
|
74
|
-
|
|
75
|
-
`The default RBAC mode (admin) generates a ClusterRole with cluster-admin level ` +
|
|
76
|
-
`permissions for the hello-pepr capability. This is intended for demo/POC purposes only ` +
|
|
77
|
-
`and should NOT be used in production.` +
|
|
78
|
-
`See https://docs.pepr.dev/user-guide/rbac/ for more details.`,
|
|
79
|
-
);
|
|
75
|
+
warnIfAdminRbac(packageJSON.data.pepr.rbacMode);
|
|
80
76
|
Log.info(`Open VSCode or your editor of choice in ${dirName} to get started!`);
|
|
81
77
|
} catch (error) {
|
|
82
78
|
throw new Error(`Error creating Pepr module:`, { cause: error });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// SPDX-FileCopyrightText: 2023-Present The Pepr Authors
|
|
3
|
+
|
|
4
|
+
import Log from "../lib/telemetry/logger";
|
|
5
|
+
|
|
6
|
+
export const ADMIN_RBAC_WARNING =
|
|
7
|
+
"Admin RBAC mode grants broad cluster-wide permissions. It is intended for demo/POC purposes " +
|
|
8
|
+
"only and should NOT be used in production. Use scoped RBAC mode for production workloads. " +
|
|
9
|
+
"See https://docs.pepr.dev/user-guide/rbac/ for more details.";
|
|
10
|
+
|
|
11
|
+
export function warnIfAdminRbac(rbacMode?: string): void {
|
|
12
|
+
if (rbacMode !== "scoped") {
|
|
13
|
+
Log.warn(ADMIN_RBAC_WARNING);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/lib/assets/assets.ts
CHANGED
|
@@ -182,24 +182,6 @@ export class Assets {
|
|
|
182
182
|
mutateWebhook: V1MutatingWebhookConfiguration | V1ValidatingWebhookConfiguration | null,
|
|
183
183
|
helm: Record<string, Record<string, string>>,
|
|
184
184
|
): Promise<void> => {
|
|
185
|
-
if (validateWebhook || mutateWebhook) {
|
|
186
|
-
await fs.writeFile(
|
|
187
|
-
helm.files.admissionDeploymentYaml,
|
|
188
|
-
dedent(admissionDeployTemplate(this.buildTimestamp, "admission")),
|
|
189
|
-
);
|
|
190
|
-
await fs.writeFile(
|
|
191
|
-
helm.files.admissionServiceMonitorYaml,
|
|
192
|
-
dedent(
|
|
193
|
-
serviceMonitorTemplate(
|
|
194
|
-
process.env.PEPR_CUSTOM_BUILD_NAME
|
|
195
|
-
? `admission-${process.env.PEPR_CUSTOM_BUILD_NAME}`
|
|
196
|
-
: "admission",
|
|
197
|
-
`admission`,
|
|
198
|
-
),
|
|
199
|
-
),
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
185
|
if (mutateWebhook) {
|
|
204
186
|
await fs.writeFile(
|
|
205
187
|
helm.files.mutationWebhookYaml,
|
|
@@ -215,6 +197,26 @@ export class Assets {
|
|
|
215
197
|
}
|
|
216
198
|
};
|
|
217
199
|
|
|
200
|
+
writeAdmissionControllerFiles = async (
|
|
201
|
+
helm: Record<string, Record<string, string>>,
|
|
202
|
+
): Promise<void> => {
|
|
203
|
+
await fs.writeFile(
|
|
204
|
+
helm.files.admissionDeploymentYaml,
|
|
205
|
+
dedent(admissionDeployTemplate(this.buildTimestamp, "admission")),
|
|
206
|
+
);
|
|
207
|
+
await fs.writeFile(
|
|
208
|
+
helm.files.admissionServiceMonitorYaml,
|
|
209
|
+
dedent(
|
|
210
|
+
serviceMonitorTemplate(
|
|
211
|
+
process.env.PEPR_CUSTOM_BUILD_NAME
|
|
212
|
+
? `admission-${process.env.PEPR_CUSTOM_BUILD_NAME}`
|
|
213
|
+
: "admission",
|
|
214
|
+
`admission`,
|
|
215
|
+
),
|
|
216
|
+
),
|
|
217
|
+
);
|
|
218
|
+
};
|
|
219
|
+
|
|
218
220
|
generateHelmChart = async (
|
|
219
221
|
webhookGeneratorFunction: (
|
|
220
222
|
assets: Assets,
|
|
@@ -299,6 +301,10 @@ export class Assets {
|
|
|
299
301
|
),
|
|
300
302
|
};
|
|
301
303
|
|
|
304
|
+
if (isAdmission(this.capabilities) || norWatchOrAdmission(this.capabilities)) {
|
|
305
|
+
await this.writeAdmissionControllerFiles(helm);
|
|
306
|
+
}
|
|
307
|
+
|
|
302
308
|
await this.writeWebhookFiles(webhooks.validate, webhooks.mutate, helm);
|
|
303
309
|
|
|
304
310
|
const watchDeployment = getWatcherFunction(this, moduleHash, this.buildTimestamp);
|
|
@@ -5,6 +5,7 @@ type ConfigType = "manifests" | "charts";
|
|
|
5
5
|
|
|
6
6
|
export function generateZarfYamlGeneric(assets: Assets, path: string, type: ConfigType): string {
|
|
7
7
|
const zarfComponentName = process.env.PEPR_CUSTOM_BUILD_NAME ?? "module";
|
|
8
|
+
const helmReleaseName = process.env.PEPR_CUSTOM_BUILD_NAME ?? assets.name;
|
|
8
9
|
const manifestSettings = {
|
|
9
10
|
name: zarfComponentName,
|
|
10
11
|
namespace: "pepr-system",
|
|
@@ -15,6 +16,7 @@ export function generateZarfYamlGeneric(assets: Assets, path: string, type: Conf
|
|
|
15
16
|
namespace: "pepr-system",
|
|
16
17
|
version: `${assets.config.appVersion || "0.0.1"}`,
|
|
17
18
|
localPath: path,
|
|
19
|
+
releaseName: helmReleaseName,
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
const component = {
|
package/src/lib/core/queue.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// SPDX-FileCopyrightText: 2023-Present The Pepr Authors
|
|
3
3
|
import { KubernetesObject } from "@kubernetes/client-node";
|
|
4
|
-
import { WatchPhase } from "kubernetes-fluent-client
|
|
4
|
+
import { WatchPhase } from "kubernetes-fluent-client";
|
|
5
5
|
import { randomBytes } from "node:crypto";
|
|
6
6
|
import Log from "../telemetry/logger";
|
|
7
7
|
|
|
@@ -5,16 +5,16 @@ import { Binding } from "../types";
|
|
|
5
5
|
import { Capability } from "../core/capability";
|
|
6
6
|
import { Event } from "../enums";
|
|
7
7
|
import {
|
|
8
|
+
GenericClass,
|
|
8
9
|
K8s,
|
|
10
|
+
KubernetesListObject,
|
|
9
11
|
KubernetesObject,
|
|
10
12
|
WatchCfg,
|
|
11
13
|
WatchEvent,
|
|
12
|
-
|
|
14
|
+
WatcherType,
|
|
15
|
+
WatchPhase,
|
|
13
16
|
} from "kubernetes-fluent-client";
|
|
14
17
|
import { Queue } from "../core/queue";
|
|
15
|
-
import { WatcherType } from "kubernetes-fluent-client/dist/fluent/types";
|
|
16
|
-
import { WatchPhase } from "kubernetes-fluent-client/dist/fluent/shared-types";
|
|
17
|
-
import { KubernetesListObject } from "kubernetes-fluent-client/dist/types";
|
|
18
18
|
import { filterNoMatchReason } from "../filter/filter";
|
|
19
19
|
import { metricsCollector, MetricsCollectorInstance } from "../telemetry/metrics";
|
|
20
20
|
import { removeFinalizer } from "../finalizer";
|
package/src/lib/types.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// SPDX-FileCopyrightText: 2023-Present The Pepr Authors
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
GenericClass,
|
|
6
|
+
GroupVersionKind,
|
|
7
|
+
KubernetesObject,
|
|
8
|
+
WatchPhase,
|
|
9
|
+
} from "kubernetes-fluent-client";
|
|
5
10
|
import { Event } from "./enums";
|
|
6
|
-
import { WatchPhase } from "kubernetes-fluent-client/dist/fluent/shared-types";
|
|
7
11
|
import { Logger } from "pino";
|
|
8
12
|
import { PeprMutateRequest } from "./mutate-request";
|
|
9
13
|
import { PeprValidateRequest } from "./validate-request";
|