pepr 0.42.3 → 0.44.0-nightly.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 +13 -14
- 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 +7 -5
- package/dist/cli/init/templates.d.ts.map +1 -1
- package/dist/cli.js +786 -739
- package/dist/controller.js +1 -1
- package/dist/fixtures/loader.d.ts.map +1 -1
- package/dist/lib/assets/assets.d.ts +15 -12
- package/dist/lib/assets/assets.d.ts.map +1 -1
- package/dist/lib/assets/deploy.d.ts +1 -1
- 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.map +1 -1
- package/dist/lib/assets/webhooks.d.ts +4 -1
- 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 +23 -20
- 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 +2 -0
- 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/telemetry/timeUtils.d.ts +2 -0
- package/dist/lib/telemetry/timeUtils.d.ts.map +1 -0
- package/dist/lib/telemetry/webhookTimeouts.d.ts +9 -0
- package/dist/lib/telemetry/webhookTimeouts.d.ts.map +1 -0
- package/dist/lib.js +79 -22
- package/dist/lib.js.map +4 -4
- package/package.json +7 -4
- package/src/cli/build.helpers.ts +35 -35
- package/src/cli/build.ts +126 -70
- package/src/cli/deploy.ts +7 -6
- package/src/cli/dev.ts +9 -6
- package/src/cli/init/templates.ts +6 -5
- package/src/fixtures/loader.ts +2 -2
- package/src/lib/assets/assets.ts +66 -53
- package/src/lib/assets/deploy.ts +32 -30
- package/src/lib/assets/helm.ts +22 -4
- package/src/lib/assets/index.ts +33 -9
- package/src/lib/assets/pods.ts +2 -2
- package/src/lib/assets/webhooks.ts +21 -6
- 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} +8 -120
- package/src/lib/core/module.ts +26 -21
- package/src/lib/enums.ts +6 -0
- package/src/lib/processors/mutate-processor.ts +15 -7
- package/src/lib/processors/validate-processor.ts +13 -4
- package/src/lib/telemetry/timeUtils.ts +1 -0
- package/src/lib/telemetry/webhookTimeouts.ts +34 -0
- package/dist/lib/assets/yaml.d.ts +0 -32
- package/dist/lib/assets/yaml.d.ts.map +0 -1
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
V1Deployment,
|
|
7
|
-
V1MutatingWebhookConfiguration,
|
|
8
|
-
V1ValidatingWebhookConfiguration,
|
|
9
|
-
} from "@kubernetes/client-node";
|
|
1
|
+
import { genEnv } from "../pods";
|
|
2
|
+
import { ModuleConfig } from "../../core/module";
|
|
3
|
+
import { CapabilityExport } from "../../types";
|
|
4
|
+
import { dumpYaml } from "@kubernetes/client-node";
|
|
5
|
+
import { clusterRole } from "../rbac";
|
|
10
6
|
import { promises as fs } from "fs";
|
|
11
|
-
import { apiTokenSecret, service, tlsSecret, watcherService } from "./networking";
|
|
12
|
-
import { getModuleSecret, getNamespace } from "./pods";
|
|
13
|
-
import { clusterRole, clusterRoleBinding, serviceAccount, storeRole, storeRoleBinding } from "./rbac";
|
|
14
|
-
import { genEnv } from "./pods";
|
|
15
|
-
import { ModuleConfig } from "../core/module";
|
|
16
|
-
import { CapabilityExport } from "../types";
|
|
17
|
-
import { TLSOut } from "../tls";
|
|
18
7
|
|
|
19
8
|
type CommonOverrideValues = {
|
|
20
9
|
apiToken: string;
|
|
@@ -27,20 +16,17 @@ type CommonOverrideValues = {
|
|
|
27
16
|
type ChartOverrides = CommonOverrideValues & {
|
|
28
17
|
image: string;
|
|
29
18
|
};
|
|
30
|
-
|
|
31
|
-
type ResourceOverrides = CommonOverrideValues & {
|
|
32
|
-
path: string;
|
|
33
|
-
tls: TLSOut;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
19
|
// Helm Chart overrides file (values.yaml) generated from assets
|
|
37
20
|
export async function overridesFile(
|
|
38
21
|
{ hash, name, image, config, apiToken, capabilities }: ChartOverrides,
|
|
39
22
|
path: string,
|
|
23
|
+
imagePullSecrets: string[],
|
|
40
24
|
): Promise<void> {
|
|
41
25
|
const rbacOverrides = clusterRole(name, capabilities, config.rbacMode, config.rbac).rules;
|
|
42
26
|
|
|
43
27
|
const overrides = {
|
|
28
|
+
imagePullSecrets,
|
|
29
|
+
additionalIgnoredNamespaces: [],
|
|
44
30
|
rbac: rbacOverrides,
|
|
45
31
|
secrets: {
|
|
46
32
|
apiToken: Buffer.from(apiToken).toString("base64"),
|
|
@@ -191,101 +177,3 @@ export async function overridesFile(
|
|
|
191
177
|
|
|
192
178
|
await fs.writeFile(path, dumpYaml(overrides, { noRefs: true, forceQuotes: true }));
|
|
193
179
|
}
|
|
194
|
-
export function generateZarfYaml(name: string, image: string, config: ModuleConfig, path: string): string {
|
|
195
|
-
const zarfCfg = {
|
|
196
|
-
kind: "ZarfPackageConfig",
|
|
197
|
-
metadata: {
|
|
198
|
-
name,
|
|
199
|
-
description: `Pepr Module: ${config.description}`,
|
|
200
|
-
url: "https://github.com/defenseunicorns/pepr",
|
|
201
|
-
version: `${config.appVersion || "0.0.1"}`,
|
|
202
|
-
},
|
|
203
|
-
components: [
|
|
204
|
-
{
|
|
205
|
-
name: "module",
|
|
206
|
-
required: true,
|
|
207
|
-
manifests: [
|
|
208
|
-
{
|
|
209
|
-
name: "module",
|
|
210
|
-
namespace: "pepr-system",
|
|
211
|
-
files: [path],
|
|
212
|
-
},
|
|
213
|
-
],
|
|
214
|
-
images: [image],
|
|
215
|
-
},
|
|
216
|
-
],
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
return dumpYaml(zarfCfg, { noRefs: true });
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export function generateZarfYamlChart(name: string, image: string, config: ModuleConfig, path: string): string {
|
|
223
|
-
const zarfCfg = {
|
|
224
|
-
kind: "ZarfPackageConfig",
|
|
225
|
-
metadata: {
|
|
226
|
-
name,
|
|
227
|
-
description: `Pepr Module: ${config.description}`,
|
|
228
|
-
url: "https://github.com/defenseunicorns/pepr",
|
|
229
|
-
version: `${config.appVersion || "0.0.1"}`,
|
|
230
|
-
},
|
|
231
|
-
components: [
|
|
232
|
-
{
|
|
233
|
-
name: "module",
|
|
234
|
-
required: true,
|
|
235
|
-
charts: [
|
|
236
|
-
{
|
|
237
|
-
name: "module",
|
|
238
|
-
namespace: "pepr-system",
|
|
239
|
-
version: `${config.appVersion || "0.0.1"}`,
|
|
240
|
-
localPath: path,
|
|
241
|
-
},
|
|
242
|
-
],
|
|
243
|
-
images: [image],
|
|
244
|
-
},
|
|
245
|
-
],
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
return dumpYaml(zarfCfg, { noRefs: true });
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
type webhooks = { validate: V1ValidatingWebhookConfiguration | null; mutate: V1MutatingWebhookConfiguration | null };
|
|
252
|
-
type deployments = { default: V1Deployment; watch: V1Deployment | null };
|
|
253
|
-
|
|
254
|
-
export async function generateAllYaml(
|
|
255
|
-
webhooks: webhooks,
|
|
256
|
-
deployments: deployments,
|
|
257
|
-
assets: ResourceOverrides,
|
|
258
|
-
): Promise<string> {
|
|
259
|
-
const { name, tls, hash, apiToken, path, config } = assets;
|
|
260
|
-
const code = await fs.readFile(path);
|
|
261
|
-
|
|
262
|
-
const resources = [
|
|
263
|
-
getNamespace(assets.config.customLabels?.namespace),
|
|
264
|
-
clusterRole(name, assets.capabilities, config.rbacMode, config.rbac),
|
|
265
|
-
clusterRoleBinding(name),
|
|
266
|
-
serviceAccount(name),
|
|
267
|
-
apiTokenSecret(name, apiToken),
|
|
268
|
-
tlsSecret(name, tls),
|
|
269
|
-
deployments.default,
|
|
270
|
-
service(name),
|
|
271
|
-
watcherService(name),
|
|
272
|
-
getModuleSecret(name, code, hash),
|
|
273
|
-
storeRole(name),
|
|
274
|
-
storeRoleBinding(name),
|
|
275
|
-
];
|
|
276
|
-
|
|
277
|
-
if (webhooks.mutate) {
|
|
278
|
-
resources.push(webhooks.mutate);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
if (webhooks.validate) {
|
|
282
|
-
resources.push(webhooks.validate);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
if (deployments.watch) {
|
|
286
|
-
resources.push(deployments.watch);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// Convert the resources to a single YAML string
|
|
290
|
-
return resources.map(r => dumpYaml(r, { noRefs: true })).join("---\n");
|
|
291
|
-
}
|
package/src/lib/core/module.ts
CHANGED
|
@@ -9,39 +9,44 @@ import { CapabilityExport, AdmissionRequest } from "../types";
|
|
|
9
9
|
import { setupWatch } from "../processors/watch-processor";
|
|
10
10
|
import { Log } from "../../lib";
|
|
11
11
|
import { V1PolicyRule as PolicyRule } from "@kubernetes/client-node";
|
|
12
|
+
import { resolveIgnoreNamespaces } from "../assets/webhooks";
|
|
12
13
|
|
|
13
14
|
/** Custom Labels Type for package.json */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
export type
|
|
15
|
+
|
|
16
|
+
export type CustomLabels = { namespace: Record<string, string> } | Record<string, never>;
|
|
17
|
+
|
|
18
|
+
/** Configuration that MAY be set a Pepr module's package.json. */
|
|
19
|
+
export type ModuleConfigOptions = {
|
|
19
20
|
/** The Pepr version this module uses */
|
|
20
|
-
peprVersion
|
|
21
|
+
peprVersion: string;
|
|
21
22
|
/** The user-defined version of the module */
|
|
22
|
-
appVersion
|
|
23
|
-
/** A unique identifier for this Pepr module. This is automatically generated by Pepr. */
|
|
24
|
-
uuid: string;
|
|
23
|
+
appVersion: string;
|
|
25
24
|
/** A description of the Pepr module and what it does. */
|
|
26
|
-
description
|
|
25
|
+
description: string;
|
|
27
26
|
/** The webhookTimeout */
|
|
28
|
-
webhookTimeout
|
|
27
|
+
webhookTimeout: number;
|
|
29
28
|
/** Reject K8s resource AdmissionRequests on error. */
|
|
30
|
-
onError
|
|
31
|
-
/** Configure global exclusions that will never be processed by Pepr. */
|
|
32
|
-
alwaysIgnore: WebhookIgnore;
|
|
29
|
+
onError: string;
|
|
33
30
|
/** Define the log level for the in-cluster controllers */
|
|
34
|
-
logLevel
|
|
31
|
+
logLevel: string;
|
|
35
32
|
/** Propagate env variables to in-cluster controllers */
|
|
36
|
-
env
|
|
37
|
-
/** Custom Labels for Kubernetes Objects */
|
|
38
|
-
customLabels?: CustomLabels;
|
|
33
|
+
env: Record<string, string>;
|
|
39
34
|
/** Custom RBAC rules */
|
|
40
|
-
rbac
|
|
35
|
+
rbac: PolicyRule[];
|
|
41
36
|
/** The RBAC mode; if "scoped", generates scoped rules, otherwise uses wildcard rules. */
|
|
42
|
-
rbacMode
|
|
37
|
+
rbacMode: string;
|
|
38
|
+
/** Custom Labels for Kubernetes Objects */
|
|
39
|
+
customLabels: CustomLabels;
|
|
43
40
|
};
|
|
44
41
|
|
|
42
|
+
/** Global configuration for the Pepr runtime. */
|
|
43
|
+
export type ModuleConfig = {
|
|
44
|
+
/** A unique identifier for this Pepr module. This is automatically generated by Pepr. */
|
|
45
|
+
uuid: string;
|
|
46
|
+
/** Configure global exclusions that will never be processed by Pepr. */
|
|
47
|
+
alwaysIgnore: WebhookIgnore;
|
|
48
|
+
} & Partial<ModuleConfigOptions>;
|
|
49
|
+
|
|
45
50
|
export type PackageJSON = {
|
|
46
51
|
description: string;
|
|
47
52
|
pepr: ModuleConfig;
|
|
@@ -113,7 +118,7 @@ export class PeprModule {
|
|
|
113
118
|
// Wait for the controller to be ready before setting up watches
|
|
114
119
|
if (isWatchMode() || isDevMode()) {
|
|
115
120
|
try {
|
|
116
|
-
setupWatch(capabilities, pepr?.alwaysIgnore?.namespaces);
|
|
121
|
+
setupWatch(capabilities, resolveIgnoreNamespaces(pepr?.alwaysIgnore?.namespaces));
|
|
117
122
|
} catch (e) {
|
|
118
123
|
Log.error(e, "Error setting up watch");
|
|
119
124
|
process.exit(1);
|
package/src/lib/enums.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import jsonPatch from "fast-json-patch";
|
|
5
5
|
import { kind, KubernetesObject } from "kubernetes-fluent-client";
|
|
6
6
|
import { clone } from "ramda";
|
|
7
|
-
|
|
7
|
+
import { MeasureWebhookTimeout } from "../telemetry/webhookTimeouts";
|
|
8
8
|
import { Capability } from "../core/capability";
|
|
9
9
|
import { shouldSkipRequest } from "../filter/filter";
|
|
10
10
|
import { MutateResponse } from "../k8s";
|
|
@@ -14,7 +14,9 @@ import { ModuleConfig } from "../core/module";
|
|
|
14
14
|
import { PeprMutateRequest } from "../mutate-request";
|
|
15
15
|
import { base64Encode, convertFromBase64Map, convertToBase64Map } from "../utils";
|
|
16
16
|
import { OnError } from "../../cli/init/enums";
|
|
17
|
-
|
|
17
|
+
import { resolveIgnoreNamespaces } from "../assets/webhooks";
|
|
18
|
+
import { Operation } from "fast-json-patch";
|
|
19
|
+
import { WebhookType } from "../enums";
|
|
18
20
|
export interface Bindable {
|
|
19
21
|
req: AdmissionRequest;
|
|
20
22
|
config: ModuleConfig;
|
|
@@ -138,6 +140,8 @@ export async function mutateProcessor(
|
|
|
138
140
|
req: AdmissionRequest,
|
|
139
141
|
reqMetadata: Record<string, string>,
|
|
140
142
|
): Promise<MutateResponse> {
|
|
143
|
+
const webhookTimer = new MeasureWebhookTimeout(WebhookType.MUTATE);
|
|
144
|
+
webhookTimer.start(config.webhookTimeout);
|
|
141
145
|
let response: MutateResponse = {
|
|
142
146
|
uid: req.uid,
|
|
143
147
|
warnings: [],
|
|
@@ -169,7 +173,7 @@ export async function mutateProcessor(
|
|
|
169
173
|
bind.binding,
|
|
170
174
|
bind.req,
|
|
171
175
|
bind.namespaces,
|
|
172
|
-
bind.config?.alwaysIgnore?.namespaces,
|
|
176
|
+
resolveIgnoreNamespaces(bind.config?.alwaysIgnore?.namespaces),
|
|
173
177
|
);
|
|
174
178
|
if (shouldSkip !== "") {
|
|
175
179
|
Log.debug(shouldSkip);
|
|
@@ -206,6 +210,14 @@ export async function mutateProcessor(
|
|
|
206
210
|
// Compare the original request to the modified request to get the patches
|
|
207
211
|
const patches = jsonPatch.compare(req.object, transformed);
|
|
208
212
|
|
|
213
|
+
updateResponsePatchAndWarnings(patches, response);
|
|
214
|
+
|
|
215
|
+
Log.debug({ ...reqMetadata, patches }, `Patches generated`);
|
|
216
|
+
webhookTimer.stop();
|
|
217
|
+
return response;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export function updateResponsePatchAndWarnings(patches: Operation[], response: MutateResponse): void {
|
|
209
221
|
// Only add the patch if there are patches to apply
|
|
210
222
|
if (patches.length > 0) {
|
|
211
223
|
response.patchType = "JSONPatch";
|
|
@@ -218,8 +230,4 @@ export async function mutateProcessor(
|
|
|
218
230
|
if (response.warnings && response.warnings.length < 1) {
|
|
219
231
|
delete response.warnings;
|
|
220
232
|
}
|
|
221
|
-
|
|
222
|
-
Log.debug({ ...reqMetadata, patches }, `Patches generated`);
|
|
223
|
-
|
|
224
|
-
return response;
|
|
225
233
|
}
|
|
@@ -10,6 +10,9 @@ import Log from "../telemetry/logger";
|
|
|
10
10
|
import { convertFromBase64Map } from "../utils";
|
|
11
11
|
import { PeprValidateRequest } from "../validate-request";
|
|
12
12
|
import { ModuleConfig } from "../core/module";
|
|
13
|
+
import { resolveIgnoreNamespaces } from "../assets/webhooks";
|
|
14
|
+
import { MeasureWebhookTimeout } from "../telemetry/webhookTimeouts";
|
|
15
|
+
import { WebhookType } from "../enums";
|
|
13
16
|
|
|
14
17
|
export async function processRequest(
|
|
15
18
|
binding: Binding,
|
|
@@ -57,12 +60,13 @@ export async function validateProcessor(
|
|
|
57
60
|
req: AdmissionRequest,
|
|
58
61
|
reqMetadata: Record<string, string>,
|
|
59
62
|
): Promise<ValidateResponse[]> {
|
|
63
|
+
const webhookTimer = new MeasureWebhookTimeout(WebhookType.VALIDATE);
|
|
64
|
+
webhookTimer.start(config.webhookTimeout);
|
|
60
65
|
const wrapped = new PeprValidateRequest(req);
|
|
61
66
|
const response: ValidateResponse[] = [];
|
|
62
67
|
|
|
63
68
|
// If the resource is a secret, decode the data
|
|
64
|
-
|
|
65
|
-
if (isSecret) {
|
|
69
|
+
if (req.kind.version === "v1" && req.kind.kind === "Secret") {
|
|
66
70
|
convertFromBase64Map(wrapped.Raw as unknown as kind.Secret);
|
|
67
71
|
}
|
|
68
72
|
|
|
@@ -78,7 +82,12 @@ export async function validateProcessor(
|
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
// Continue to the next action without doing anything if this one should be skipped
|
|
81
|
-
const shouldSkip = shouldSkipRequest(
|
|
85
|
+
const shouldSkip = shouldSkipRequest(
|
|
86
|
+
binding,
|
|
87
|
+
req,
|
|
88
|
+
namespaces,
|
|
89
|
+
resolveIgnoreNamespaces(config?.alwaysIgnore?.namespaces),
|
|
90
|
+
);
|
|
82
91
|
if (shouldSkip !== "") {
|
|
83
92
|
Log.debug(shouldSkip);
|
|
84
93
|
continue;
|
|
@@ -88,6 +97,6 @@ export async function validateProcessor(
|
|
|
88
97
|
response.push(resp);
|
|
89
98
|
}
|
|
90
99
|
}
|
|
91
|
-
|
|
100
|
+
webhookTimer.stop();
|
|
92
101
|
return response;
|
|
93
102
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const getNow = (): number => performance.now();
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { metricsCollector } from "./metrics";
|
|
2
|
+
import { getNow } from "./timeUtils";
|
|
3
|
+
import Log from "./logger";
|
|
4
|
+
import { WebhookType } from "../enums";
|
|
5
|
+
export class MeasureWebhookTimeout {
|
|
6
|
+
#startTime: number | null = null;
|
|
7
|
+
#webhookType: string;
|
|
8
|
+
timeout: number = 0;
|
|
9
|
+
|
|
10
|
+
constructor(webhookType: WebhookType) {
|
|
11
|
+
this.#webhookType = webhookType;
|
|
12
|
+
metricsCollector.addCounter(`${webhookType}_timeouts`, `Number of ${webhookType} webhook timeouts`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
start(timeout: number = 10): void {
|
|
16
|
+
this.#startTime = getNow();
|
|
17
|
+
this.timeout = timeout;
|
|
18
|
+
Log.info(`Starting timer at ${this.#startTime}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
stop(): void {
|
|
22
|
+
if (this.#startTime === null) {
|
|
23
|
+
throw new Error("Timer was not started before calling stop.");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const elapsedTime = getNow() - this.#startTime;
|
|
27
|
+
Log.info(`Webhook ${this.#startTime} took ${elapsedTime}ms`);
|
|
28
|
+
this.#startTime = null;
|
|
29
|
+
|
|
30
|
+
if (elapsedTime > this.timeout) {
|
|
31
|
+
metricsCollector.incCounter(`${this.#webhookType}_timeouts`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { V1Deployment, V1MutatingWebhookConfiguration, V1ValidatingWebhookConfiguration } from "@kubernetes/client-node";
|
|
2
|
-
import { ModuleConfig } from "../core/module";
|
|
3
|
-
import { CapabilityExport } from "../types";
|
|
4
|
-
import { TLSOut } from "../tls";
|
|
5
|
-
type CommonOverrideValues = {
|
|
6
|
-
apiToken: string;
|
|
7
|
-
capabilities: CapabilityExport[];
|
|
8
|
-
config: ModuleConfig;
|
|
9
|
-
hash: string;
|
|
10
|
-
name: string;
|
|
11
|
-
};
|
|
12
|
-
type ChartOverrides = CommonOverrideValues & {
|
|
13
|
-
image: string;
|
|
14
|
-
};
|
|
15
|
-
type ResourceOverrides = CommonOverrideValues & {
|
|
16
|
-
path: string;
|
|
17
|
-
tls: TLSOut;
|
|
18
|
-
};
|
|
19
|
-
export declare function overridesFile({ hash, name, image, config, apiToken, capabilities }: ChartOverrides, path: string): Promise<void>;
|
|
20
|
-
export declare function generateZarfYaml(name: string, image: string, config: ModuleConfig, path: string): string;
|
|
21
|
-
export declare function generateZarfYamlChart(name: string, image: string, config: ModuleConfig, path: string): string;
|
|
22
|
-
type webhooks = {
|
|
23
|
-
validate: V1ValidatingWebhookConfiguration | null;
|
|
24
|
-
mutate: V1MutatingWebhookConfiguration | null;
|
|
25
|
-
};
|
|
26
|
-
type deployments = {
|
|
27
|
-
default: V1Deployment;
|
|
28
|
-
watch: V1Deployment | null;
|
|
29
|
-
};
|
|
30
|
-
export declare function generateAllYaml(webhooks: webhooks, deployments: deployments, assets: ResourceOverrides): Promise<string>;
|
|
31
|
-
export {};
|
|
32
|
-
//# sourceMappingURL=yaml.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/yaml.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,YAAY,EACZ,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,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,KAAK,iBAAiB,GAAG,oBAAoB,GAAG;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAGF,wBAAsB,aAAa,CACjC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,cAAc,EACrE,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAyJf;AACD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CA0BxG;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CA2B7G;AAED,KAAK,QAAQ,GAAG;IAAE,QAAQ,EAAE,gCAAgC,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,8BAA8B,GAAG,IAAI,CAAA;CAAE,CAAC;AACrH,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAA;CAAE,CAAC;AAEzE,wBAAsB,eAAe,CACnC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,MAAM,CAAC,CAiCjB"}
|