@reyemtech/nimbus 2.12.5 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/cjs/backup/index.d.ts.map +1 -1
- package/dist/cjs/backup/index.js +6 -1
- package/dist/cjs/backup/index.js.map +1 -1
- package/dist/cjs/cli/migrate-cnpg-ownership.d.ts +43 -0
- package/dist/cjs/cli/migrate-cnpg-ownership.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-cnpg-ownership.js +67 -0
- package/dist/cjs/cli/migrate-cnpg-ownership.js.map +1 -0
- package/dist/cjs/cli/migrate-cnpg-roles.d.ts +92 -0
- package/dist/cjs/cli/migrate-cnpg-roles.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-cnpg-roles.js +337 -0
- package/dist/cjs/cli/migrate-cnpg-roles.js.map +1 -0
- package/dist/cjs/cli/migrate-cnpg.d.ts +38 -0
- package/dist/cjs/cli/migrate-cnpg.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-cnpg.js +258 -0
- package/dist/cjs/cli/migrate-cnpg.js.map +1 -0
- package/dist/cjs/cli/migrate-exec.d.ts +45 -0
- package/dist/cjs/cli/migrate-exec.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-exec.js +104 -0
- package/dist/cjs/cli/migrate-exec.js.map +1 -0
- package/dist/cjs/cli/migrate-psql.d.ts +125 -0
- package/dist/cjs/cli/migrate-psql.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-psql.js +213 -0
- package/dist/cjs/cli/migrate-psql.js.map +1 -0
- package/dist/cjs/cli/migrate-report.d.ts +27 -0
- package/dist/cjs/cli/migrate-report.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-report.js +29 -0
- package/dist/cjs/cli/migrate-report.js.map +1 -0
- package/dist/cjs/cli/migrate-superuser.d.ts +22 -0
- package/dist/cjs/cli/migrate-superuser.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-superuser.js +73 -0
- package/dist/cjs/cli/migrate-superuser.js.map +1 -0
- package/dist/cjs/cli/migrate.d.ts +37 -0
- package/dist/cjs/cli/migrate.d.ts.map +1 -0
- package/dist/cjs/cli/migrate.js +67 -0
- package/dist/cjs/cli/migrate.js.map +1 -0
- package/dist/cjs/cli.d.ts +1 -0
- package/dist/cjs/cli.d.ts.map +1 -1
- package/dist/cjs/cli.js +6 -0
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/operator/cnpg-common.d.ts +56 -0
- package/dist/cjs/operator/cnpg-common.d.ts.map +1 -0
- package/dist/cjs/operator/cnpg-common.js +82 -0
- package/dist/cjs/operator/cnpg-common.js.map +1 -0
- package/dist/cjs/operator/cnpg-database.d.ts +66 -0
- package/dist/cjs/operator/cnpg-database.d.ts.map +1 -0
- package/dist/cjs/operator/cnpg-database.js +296 -0
- package/dist/cjs/operator/cnpg-database.js.map +1 -0
- package/dist/cjs/operator/cnpg-roles.d.ts +173 -0
- package/dist/cjs/operator/cnpg-roles.d.ts.map +1 -0
- package/dist/cjs/operator/cnpg-roles.js +225 -0
- package/dist/cjs/operator/cnpg-roles.js.map +1 -0
- package/dist/cjs/operator/cnpg.d.ts.map +1 -1
- package/dist/cjs/operator/cnpg.js +50 -162
- package/dist/cjs/operator/cnpg.js.map +1 -1
- package/dist/cjs/operator/connection-uri.d.ts +44 -0
- package/dist/cjs/operator/connection-uri.d.ts.map +1 -0
- package/dist/cjs/operator/connection-uri.js +49 -0
- package/dist/cjs/operator/connection-uri.js.map +1 -0
- package/dist/cjs/operator/credentials.d.ts +76 -0
- package/dist/cjs/operator/credentials.d.ts.map +1 -0
- package/dist/cjs/operator/credentials.js +106 -0
- package/dist/cjs/operator/credentials.js.map +1 -0
- package/dist/cjs/operator/database-options.d.ts +121 -0
- package/dist/cjs/operator/database-options.d.ts.map +1 -0
- package/dist/cjs/operator/database-options.js +131 -0
- package/dist/cjs/operator/database-options.js.map +1 -0
- package/dist/cjs/operator/grants/postgres-job.d.ts +109 -0
- package/dist/cjs/operator/grants/postgres-job.d.ts.map +1 -0
- package/dist/cjs/operator/grants/postgres-job.js +232 -0
- package/dist/cjs/operator/grants/postgres-job.js.map +1 -0
- package/dist/cjs/operator/grants/postgres-sql.d.ts +130 -0
- package/dist/cjs/operator/grants/postgres-sql.d.ts.map +1 -0
- package/dist/cjs/operator/grants/postgres-sql.js +305 -0
- package/dist/cjs/operator/grants/postgres-sql.js.map +1 -0
- package/dist/cjs/operator/grants/privileges.d.ts +24 -0
- package/dist/cjs/operator/grants/privileges.d.ts.map +1 -0
- package/dist/cjs/operator/grants/privileges.js +35 -0
- package/dist/cjs/operator/grants/privileges.js.map +1 -0
- package/dist/cjs/operator/grants/role-config.d.ts +80 -0
- package/dist/cjs/operator/grants/role-config.d.ts.map +1 -0
- package/dist/cjs/operator/grants/role-config.js +134 -0
- package/dist/cjs/operator/grants/role-config.js.map +1 -0
- package/dist/cjs/operator/index.d.ts +1 -1
- package/dist/cjs/operator/index.d.ts.map +1 -1
- package/dist/cjs/operator/index.js.map +1 -1
- package/dist/cjs/operator/interfaces.d.ts +223 -1
- package/dist/cjs/operator/interfaces.d.ts.map +1 -1
- package/dist/cjs/operator/interfaces.js.map +1 -1
- package/dist/cjs/operator/mariadb-common.d.ts +99 -0
- package/dist/cjs/operator/mariadb-common.d.ts.map +1 -0
- package/dist/cjs/operator/mariadb-common.js +141 -0
- package/dist/cjs/operator/mariadb-common.js.map +1 -0
- package/dist/cjs/operator/mariadb-database.d.ts +65 -0
- package/dist/cjs/operator/mariadb-database.d.ts.map +1 -0
- package/dist/cjs/operator/mariadb-database.js +285 -0
- package/dist/cjs/operator/mariadb-database.js.map +1 -0
- package/dist/cjs/operator/mariadb-roles.d.ts +264 -0
- package/dist/cjs/operator/mariadb-roles.d.ts.map +1 -0
- package/dist/cjs/operator/mariadb-roles.js +366 -0
- package/dist/cjs/operator/mariadb-roles.js.map +1 -0
- package/dist/cjs/operator/mariadb.d.ts.map +1 -1
- package/dist/cjs/operator/mariadb.js +35 -147
- package/dist/cjs/operator/mariadb.js.map +1 -1
- package/dist/cjs/operator/neo4j-common.d.ts +62 -0
- package/dist/cjs/operator/neo4j-common.d.ts.map +1 -0
- package/dist/cjs/operator/neo4j-common.js +89 -0
- package/dist/cjs/operator/neo4j-common.js.map +1 -0
- package/dist/cjs/operator/neo4j-database.d.ts +88 -0
- package/dist/cjs/operator/neo4j-database.d.ts.map +1 -0
- package/dist/cjs/operator/neo4j-database.js +274 -0
- package/dist/cjs/operator/neo4j-database.js.map +1 -0
- package/dist/cjs/operator/neo4j-roles.d.ts +203 -0
- package/dist/cjs/operator/neo4j-roles.d.ts.map +1 -0
- package/dist/cjs/operator/neo4j-roles.js +298 -0
- package/dist/cjs/operator/neo4j-roles.js.map +1 -0
- package/dist/cjs/operator/neo4j.d.ts.map +1 -1
- package/dist/cjs/operator/neo4j.js +32 -132
- package/dist/cjs/operator/neo4j.js.map +1 -1
- package/dist/cjs/operator/resource-identity.d.ts +170 -0
- package/dist/cjs/operator/resource-identity.d.ts.map +1 -0
- package/dist/cjs/operator/resource-identity.js +231 -0
- package/dist/cjs/operator/resource-identity.js.map +1 -0
- package/dist/cjs/operator/role-registry.d.ts +85 -0
- package/dist/cjs/operator/role-registry.d.ts.map +1 -0
- package/dist/cjs/operator/role-registry.js +72 -0
- package/dist/cjs/operator/role-registry.js.map +1 -0
- package/dist/cjs/platform/components/image-pruner.d.ts +3 -1
- package/dist/cjs/platform/components/image-pruner.d.ts.map +1 -1
- package/dist/cjs/platform/components/image-pruner.js +38 -19
- package/dist/cjs/platform/components/image-pruner.js.map +1 -1
- package/dist/cjs/types/errors.d.ts +3 -0
- package/dist/cjs/types/errors.d.ts.map +1 -1
- package/dist/cjs/types/errors.js +3 -0
- package/dist/cjs/types/errors.js.map +1 -1
- package/dist/esm/backup/index.d.ts.map +1 -1
- package/dist/esm/backup/index.js +6 -1
- package/dist/esm/backup/index.js.map +1 -1
- package/dist/esm/cli/migrate-cnpg-ownership.d.ts +43 -0
- package/dist/esm/cli/migrate-cnpg-ownership.d.ts.map +1 -0
- package/dist/esm/cli/migrate-cnpg-ownership.js +67 -0
- package/dist/esm/cli/migrate-cnpg-ownership.js.map +1 -0
- package/dist/esm/cli/migrate-cnpg-roles.d.ts +92 -0
- package/dist/esm/cli/migrate-cnpg-roles.d.ts.map +1 -0
- package/dist/esm/cli/migrate-cnpg-roles.js +337 -0
- package/dist/esm/cli/migrate-cnpg-roles.js.map +1 -0
- package/dist/esm/cli/migrate-cnpg.d.ts +38 -0
- package/dist/esm/cli/migrate-cnpg.d.ts.map +1 -0
- package/dist/esm/cli/migrate-cnpg.js +258 -0
- package/dist/esm/cli/migrate-cnpg.js.map +1 -0
- package/dist/esm/cli/migrate-exec.d.ts +45 -0
- package/dist/esm/cli/migrate-exec.d.ts.map +1 -0
- package/dist/esm/cli/migrate-exec.js +104 -0
- package/dist/esm/cli/migrate-exec.js.map +1 -0
- package/dist/esm/cli/migrate-psql.d.ts +125 -0
- package/dist/esm/cli/migrate-psql.d.ts.map +1 -0
- package/dist/esm/cli/migrate-psql.js +213 -0
- package/dist/esm/cli/migrate-psql.js.map +1 -0
- package/dist/esm/cli/migrate-report.d.ts +27 -0
- package/dist/esm/cli/migrate-report.d.ts.map +1 -0
- package/dist/esm/cli/migrate-report.js +29 -0
- package/dist/esm/cli/migrate-report.js.map +1 -0
- package/dist/esm/cli/migrate-superuser.d.ts +22 -0
- package/dist/esm/cli/migrate-superuser.d.ts.map +1 -0
- package/dist/esm/cli/migrate-superuser.js +73 -0
- package/dist/esm/cli/migrate-superuser.js.map +1 -0
- package/dist/esm/cli/migrate.d.ts +37 -0
- package/dist/esm/cli/migrate.d.ts.map +1 -0
- package/dist/esm/cli/migrate.js +67 -0
- package/dist/esm/cli/migrate.js.map +1 -0
- package/dist/esm/cli.d.ts +1 -0
- package/dist/esm/cli.d.ts.map +1 -1
- package/dist/esm/cli.js +6 -0
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/operator/cnpg-common.d.ts +56 -0
- package/dist/esm/operator/cnpg-common.d.ts.map +1 -0
- package/dist/esm/operator/cnpg-common.js +82 -0
- package/dist/esm/operator/cnpg-common.js.map +1 -0
- package/dist/esm/operator/cnpg-database.d.ts +66 -0
- package/dist/esm/operator/cnpg-database.d.ts.map +1 -0
- package/dist/esm/operator/cnpg-database.js +296 -0
- package/dist/esm/operator/cnpg-database.js.map +1 -0
- package/dist/esm/operator/cnpg-roles.d.ts +173 -0
- package/dist/esm/operator/cnpg-roles.d.ts.map +1 -0
- package/dist/esm/operator/cnpg-roles.js +225 -0
- package/dist/esm/operator/cnpg-roles.js.map +1 -0
- package/dist/esm/operator/cnpg.d.ts.map +1 -1
- package/dist/esm/operator/cnpg.js +50 -162
- package/dist/esm/operator/cnpg.js.map +1 -1
- package/dist/esm/operator/connection-uri.d.ts +44 -0
- package/dist/esm/operator/connection-uri.d.ts.map +1 -0
- package/dist/esm/operator/connection-uri.js +49 -0
- package/dist/esm/operator/connection-uri.js.map +1 -0
- package/dist/esm/operator/credentials.d.ts +76 -0
- package/dist/esm/operator/credentials.d.ts.map +1 -0
- package/dist/esm/operator/credentials.js +106 -0
- package/dist/esm/operator/credentials.js.map +1 -0
- package/dist/esm/operator/database-options.d.ts +121 -0
- package/dist/esm/operator/database-options.d.ts.map +1 -0
- package/dist/esm/operator/database-options.js +131 -0
- package/dist/esm/operator/database-options.js.map +1 -0
- package/dist/esm/operator/grants/postgres-job.d.ts +109 -0
- package/dist/esm/operator/grants/postgres-job.d.ts.map +1 -0
- package/dist/esm/operator/grants/postgres-job.js +232 -0
- package/dist/esm/operator/grants/postgres-job.js.map +1 -0
- package/dist/esm/operator/grants/postgres-sql.d.ts +130 -0
- package/dist/esm/operator/grants/postgres-sql.d.ts.map +1 -0
- package/dist/esm/operator/grants/postgres-sql.js +305 -0
- package/dist/esm/operator/grants/postgres-sql.js.map +1 -0
- package/dist/esm/operator/grants/privileges.d.ts +24 -0
- package/dist/esm/operator/grants/privileges.d.ts.map +1 -0
- package/dist/esm/operator/grants/privileges.js +35 -0
- package/dist/esm/operator/grants/privileges.js.map +1 -0
- package/dist/esm/operator/grants/role-config.d.ts +80 -0
- package/dist/esm/operator/grants/role-config.d.ts.map +1 -0
- package/dist/esm/operator/grants/role-config.js +134 -0
- package/dist/esm/operator/grants/role-config.js.map +1 -0
- package/dist/esm/operator/index.d.ts +1 -1
- package/dist/esm/operator/index.d.ts.map +1 -1
- package/dist/esm/operator/index.js.map +1 -1
- package/dist/esm/operator/interfaces.d.ts +223 -1
- package/dist/esm/operator/interfaces.d.ts.map +1 -1
- package/dist/esm/operator/interfaces.js.map +1 -1
- package/dist/esm/operator/mariadb-common.d.ts +99 -0
- package/dist/esm/operator/mariadb-common.d.ts.map +1 -0
- package/dist/esm/operator/mariadb-common.js +141 -0
- package/dist/esm/operator/mariadb-common.js.map +1 -0
- package/dist/esm/operator/mariadb-database.d.ts +65 -0
- package/dist/esm/operator/mariadb-database.d.ts.map +1 -0
- package/dist/esm/operator/mariadb-database.js +285 -0
- package/dist/esm/operator/mariadb-database.js.map +1 -0
- package/dist/esm/operator/mariadb-roles.d.ts +264 -0
- package/dist/esm/operator/mariadb-roles.d.ts.map +1 -0
- package/dist/esm/operator/mariadb-roles.js +366 -0
- package/dist/esm/operator/mariadb-roles.js.map +1 -0
- package/dist/esm/operator/mariadb.d.ts.map +1 -1
- package/dist/esm/operator/mariadb.js +35 -147
- package/dist/esm/operator/mariadb.js.map +1 -1
- package/dist/esm/operator/neo4j-common.d.ts +62 -0
- package/dist/esm/operator/neo4j-common.d.ts.map +1 -0
- package/dist/esm/operator/neo4j-common.js +89 -0
- package/dist/esm/operator/neo4j-common.js.map +1 -0
- package/dist/esm/operator/neo4j-database.d.ts +88 -0
- package/dist/esm/operator/neo4j-database.d.ts.map +1 -0
- package/dist/esm/operator/neo4j-database.js +274 -0
- package/dist/esm/operator/neo4j-database.js.map +1 -0
- package/dist/esm/operator/neo4j-roles.d.ts +203 -0
- package/dist/esm/operator/neo4j-roles.d.ts.map +1 -0
- package/dist/esm/operator/neo4j-roles.js +298 -0
- package/dist/esm/operator/neo4j-roles.js.map +1 -0
- package/dist/esm/operator/neo4j.d.ts.map +1 -1
- package/dist/esm/operator/neo4j.js +32 -132
- package/dist/esm/operator/neo4j.js.map +1 -1
- package/dist/esm/operator/resource-identity.d.ts +170 -0
- package/dist/esm/operator/resource-identity.d.ts.map +1 -0
- package/dist/esm/operator/resource-identity.js +231 -0
- package/dist/esm/operator/resource-identity.js.map +1 -0
- package/dist/esm/operator/role-registry.d.ts +85 -0
- package/dist/esm/operator/role-registry.d.ts.map +1 -0
- package/dist/esm/operator/role-registry.js +72 -0
- package/dist/esm/operator/role-registry.js.map +1 -0
- package/dist/esm/platform/components/image-pruner.d.ts +3 -1
- package/dist/esm/platform/components/image-pruner.d.ts.map +1 -1
- package/dist/esm/platform/components/image-pruner.js +38 -19
- package/dist/esm/platform/components/image-pruner.js.map +1 -1
- package/dist/esm/types/errors.d.ts +3 -0
- package/dist/esm/types/errors.d.ts.map +1 -1
- package/dist/esm/types/errors.js +3 -0
- package/dist/esm/types/errors.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Deriving Pulumi logical names and Kubernetes object names from raw database
|
|
4
|
+
* identifiers.
|
|
5
|
+
*
|
|
6
|
+
* A role name, or a table name, is a caller-controlled string in the engine's
|
|
7
|
+
* own identifier space, which is far wider than the DNS-1123 space Kubernetes
|
|
8
|
+
* object names live in. Narrowing one into the other is lossy — `Read_Only` and
|
|
9
|
+
* `read_only` are two distinct, simultaneously valid PostgreSQL roles that both
|
|
10
|
+
* narrow to `read-only` — and a lossy name is not merely untidy here: Pulumi
|
|
11
|
+
* identifies a resource by its logical name, so two resources deriving the same
|
|
12
|
+
* one abort the whole preview with a duplicate-URN error. Nothing is
|
|
13
|
+
* provisioned, including the resources that had nothing to do with the clash.
|
|
14
|
+
*
|
|
15
|
+
* {@link toIdentitySegment} closes that by appending a short hash of the raw
|
|
16
|
+
* value to **every** segment it derives, not only to the ones sanitizing
|
|
17
|
+
* changed. Hashing only the lossy ones leaves two namespaces sharing one output
|
|
18
|
+
* space: `Read_Only` encodes to `read-only-7b1060cf`, and the perfectly valid
|
|
19
|
+
* role name `read-only-7b1060cf` — which needs no sanitizing — would pass
|
|
20
|
+
* through unchanged onto that same string. The two roles' Secrets then collide
|
|
21
|
+
* on one Pulumi logical name and abort the preview, which is the exact failure
|
|
22
|
+
* the hash exists to prevent. Hashing unconditionally makes the mapping
|
|
23
|
+
* injective by construction: the hash covers the raw value, so distinct raw
|
|
24
|
+
* inputs cannot meet. The cost is an opaque suffix on every name, which is a
|
|
25
|
+
* fair price for a rule with no exceptions to reason about.
|
|
26
|
+
*
|
|
27
|
+
* **These helpers are for `addRole()`-path names only.** The names
|
|
28
|
+
* `createDatabase()` emits for a database owner are already live in released
|
|
29
|
+
* stacks and are pinned byte-for-byte by each backend's `ownerRoleNaming`;
|
|
30
|
+
* re-deriving one through here would rename it, and Pulumi reads a rename as
|
|
31
|
+
* delete-and-recreate — which for a credential Secret regenerates the password
|
|
32
|
+
* and breaks every application already reading it.
|
|
33
|
+
*
|
|
34
|
+
* @module operator/resource-identity
|
|
35
|
+
*/
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.DNS_1123_SUBDOMAIN_MAX_LENGTH = exports.DNS_1123_LABEL_MAX_LENGTH = void 0;
|
|
38
|
+
exports.toDnsSegment = toDnsSegment;
|
|
39
|
+
exports.toIdentitySegment = toIdentitySegment;
|
|
40
|
+
exports.toCompositeIdentitySegment = toCompositeIdentitySegment;
|
|
41
|
+
exports.toBoundedName = toBoundedName;
|
|
42
|
+
exports.toLabelValue = toLabelValue;
|
|
43
|
+
const node_crypto_1 = require("node:crypto");
|
|
44
|
+
/** Digest the short hash is truncated from. */
|
|
45
|
+
const HASH_ALGORITHM = "sha256";
|
|
46
|
+
/**
|
|
47
|
+
* Hex characters of the digest kept as a disambiguating suffix.
|
|
48
|
+
*
|
|
49
|
+
* Eight hex characters is 32 bits. The suffix does not carry the security
|
|
50
|
+
* burden a full digest would — it separates a handful of role names within one
|
|
51
|
+
* database, not arbitrary attacker-chosen preimages — so the length is chosen
|
|
52
|
+
* for readability at a collision probability that is negligible at this scale.
|
|
53
|
+
*/
|
|
54
|
+
const SHORT_HASH_LENGTH = 8;
|
|
55
|
+
/**
|
|
56
|
+
* Longest DNS-1123 *label*: the cap on a label value and on a Job's name.
|
|
57
|
+
*
|
|
58
|
+
* Kubernetes enforces it on every label value, and `batch` validation enforces
|
|
59
|
+
* it on a Job's `metadata.name` — a Job stamps its own name onto the `job-name`
|
|
60
|
+
* label of every Pod it creates, so a longer name could not be labelled.
|
|
61
|
+
*/
|
|
62
|
+
exports.DNS_1123_LABEL_MAX_LENGTH = 63;
|
|
63
|
+
/**
|
|
64
|
+
* Longest DNS-1123 *subdomain*: the cap on `metadata.name` for a Secret,
|
|
65
|
+
* ConfigMap, or custom resource.
|
|
66
|
+
*
|
|
67
|
+
* Deliberately not collapsed into {@link DNS_1123_LABEL_MAX_LENGTH}. Bounding
|
|
68
|
+
* every name by the strictest limit would be one rule instead of two, but a
|
|
69
|
+
* perfectly ordinary `Grant` CR name already runs past 63 characters, and
|
|
70
|
+
* truncating it would replace a name an operator can read with an opaque hash
|
|
71
|
+
* for no gain — the API accepts it. Each name is bounded by the limit that
|
|
72
|
+
* actually applies to the object it names.
|
|
73
|
+
*/
|
|
74
|
+
exports.DNS_1123_SUBDOMAIN_MAX_LENGTH = 253;
|
|
75
|
+
/** Characters a DNS-1123 subdomain may not contain, once lowercased. */
|
|
76
|
+
const DISALLOWED_CHARS = /[^a-z0-9-]/g;
|
|
77
|
+
/** Runs of separators left behind by {@link DISALLOWED_CHARS} replacement. */
|
|
78
|
+
const REPEATED_SEPARATORS = /-+/g;
|
|
79
|
+
/** Leading and trailing separators, which a DNS-1123 name may not have. */
|
|
80
|
+
const EDGE_SEPARATORS = /^-|-$/g;
|
|
81
|
+
/**
|
|
82
|
+
* Normalize a string into a DNS-1123 subdomain usable as `metadata.name`.
|
|
83
|
+
*
|
|
84
|
+
* Lossy by construction: every character outside `[a-z0-9-]` becomes `-`, so
|
|
85
|
+
* distinct inputs can produce one output. Use {@link toIdentitySegment} instead
|
|
86
|
+
* wherever the result identifies a resource.
|
|
87
|
+
*
|
|
88
|
+
* @param value - Raw name
|
|
89
|
+
* @returns A lowercase, `-`-separated name safe for `metadata.name`, possibly empty
|
|
90
|
+
*/
|
|
91
|
+
function toDnsSegment(value) {
|
|
92
|
+
return value
|
|
93
|
+
.toLowerCase()
|
|
94
|
+
.replace(DISALLOWED_CHARS, "-")
|
|
95
|
+
.replace(REPEATED_SEPARATORS, "-")
|
|
96
|
+
.replace(EDGE_SEPARATORS, "");
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* A short, deterministic hash of a raw identifier.
|
|
100
|
+
*
|
|
101
|
+
* @param value - Raw identifier, hashed exactly as given
|
|
102
|
+
* @returns The first {@link SHORT_HASH_LENGTH} hex characters of its digest
|
|
103
|
+
*/
|
|
104
|
+
function shortHash(value) {
|
|
105
|
+
return (0, node_crypto_1.createHash)(HASH_ALGORITHM).update(value, "utf8").digest("hex").slice(0, SHORT_HASH_LENGTH);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Derive a resource-name segment that survives sanitization without collisions.
|
|
109
|
+
*
|
|
110
|
+
* The sanitized value is kept as a readable head and the raw value's hash is
|
|
111
|
+
* always appended. Appending it only where sanitizing was lossy would leave the
|
|
112
|
+
* encoded and the pass-through forms sharing one output space — see this
|
|
113
|
+
* module's note — so the suffix is unconditional and the mapping from raw value
|
|
114
|
+
* to segment is injective by construction.
|
|
115
|
+
*
|
|
116
|
+
* The result is a pure function of `value`: a role called `reader` derives
|
|
117
|
+
* `reader-3d094196` on every call, in every process, forever. That matters more
|
|
118
|
+
* than readability here, because Pulumi reads a changed logical name as
|
|
119
|
+
* delete-and-recreate.
|
|
120
|
+
*
|
|
121
|
+
* @param value - Raw identifier as it exists in the database engine
|
|
122
|
+
* @returns A DNS-1123-safe segment, distinct for every distinct raw value
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* toIdentitySegment("reader"); // "reader-3d094196"
|
|
127
|
+
* toIdentitySegment("Read_Only"); // "read-only-7b1060cf"
|
|
128
|
+
* toIdentitySegment("read_only"); // "read-only-9c586a9b" — a different role
|
|
129
|
+
* toIdentitySegment("read-only-7b1060cf"); // "read-only-7b1060cf-707a9bc6"
|
|
130
|
+
* toIdentitySegment("@@"); // "3330e5ba" — nothing survives sanitizing
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
function toIdentitySegment(value) {
|
|
134
|
+
const sanitized = toDnsSegment(value);
|
|
135
|
+
// Sanitizing can erase the value entirely (`"@@"`, or the empty string), and
|
|
136
|
+
// a bare `-`-prefixed hash is not a valid DNS-1123 name — so the hash stands
|
|
137
|
+
// alone rather than being suffixed onto nothing.
|
|
138
|
+
return sanitized === "" ? shortHash(value) : `${sanitized}-${shortHash(value)}`;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Derive a resource-name segment for an identity made of more than one part.
|
|
142
|
+
*
|
|
143
|
+
* Not every engine identifies an account by its name alone: a MariaDB account is
|
|
144
|
+
* the `username`@`host` pair, and `reader`@`%` and `reader`@`10.0.0.1` are two
|
|
145
|
+
* accounts that exist at once with their own passwords and their own grants.
|
|
146
|
+
* Deriving names from the username alone made the second of them register under
|
|
147
|
+
* the first's Pulumi logical names, which aborts the preview with a duplicate
|
|
148
|
+
* URN — so the second account could never be created at all.
|
|
149
|
+
*
|
|
150
|
+
* The head stays readable by sanitizing the **first** part only, which is the
|
|
151
|
+
* one a human recognises the resource by; every part is folded into the hash, so
|
|
152
|
+
* the mapping stays injective the way {@link toIdentitySegment}'s is. The hash
|
|
153
|
+
* covers `JSON.stringify(parts)` rather than the parts joined by a separator,
|
|
154
|
+
* because a part may itself contain any separator: `["a@b", "c"]` and
|
|
155
|
+
* `["a", "b@c"]` are different identities and must not serialize alike.
|
|
156
|
+
*
|
|
157
|
+
* @param parts - The identity's raw parts, most identifying first
|
|
158
|
+
* @returns A DNS-1123-safe segment, distinct for every distinct identity
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```typescript
|
|
162
|
+
* toCompositeIdentitySegment(["reader", "%"]); // "reader-8b6a1a09"
|
|
163
|
+
* toCompositeIdentitySegment(["reader", "10.0.0.1"]); // "reader-…" — another account
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
function toCompositeIdentitySegment(parts) {
|
|
167
|
+
const sanitized = toDnsSegment(parts[0]);
|
|
168
|
+
const hash = shortHash(JSON.stringify(parts));
|
|
169
|
+
return sanitized === "" ? hash : `${sanitized}-${hash}`;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Bound an already-derived name to a length limit without losing its identity.
|
|
173
|
+
*
|
|
174
|
+
* Cluster, database, role and table names are all caller-controlled and
|
|
175
|
+
* unbounded, so a name composed from them is unbounded too — and an over-long
|
|
176
|
+
* one is not a cosmetic problem. Kubernetes rejects a Job whose `metadata.name`
|
|
177
|
+
* exceeds {@link DNS_1123_LABEL_MAX_LENGTH} outright, which happens at apply
|
|
178
|
+
* time: preview passes, then the object the account depends on is refused and
|
|
179
|
+
* the account is never created.
|
|
180
|
+
*
|
|
181
|
+
* Truncation is lossy in exactly the way sanitizing is — two names agreeing on
|
|
182
|
+
* their first characters cut down to one string — so it is disambiguated the
|
|
183
|
+
* same way: keep a readable head, and append a hash of the **whole** name. Two
|
|
184
|
+
* distinct inputs therefore stay distinct, and a name that already fits is
|
|
185
|
+
* returned untouched so short names keep their readable form.
|
|
186
|
+
*
|
|
187
|
+
* @param name - Derived name, already sanitized into the target character set
|
|
188
|
+
* @param maxLength - The limit that applies to the object this names — see
|
|
189
|
+
* {@link DNS_1123_LABEL_MAX_LENGTH} and {@link DNS_1123_SUBDOMAIN_MAX_LENGTH}.
|
|
190
|
+
* Must leave room for the hash suffix (at least {@link SHORT_HASH_LENGTH} + 1
|
|
191
|
+
* characters). Default: {@link DNS_1123_LABEL_MAX_LENGTH}
|
|
192
|
+
* @returns The name unchanged when it fits, otherwise a truncated,
|
|
193
|
+
* hash-suffixed form of at most `maxLength` characters
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* toBoundedName("cnpg-grants-analytics"); // unchanged — it already fits
|
|
198
|
+
* toBoundedName("a".repeat(80)); // "aaa…a-3e2f1c7d" — 63 characters
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
function toBoundedName(name, maxLength = exports.DNS_1123_LABEL_MAX_LENGTH) {
|
|
202
|
+
if (name.length <= maxLength) {
|
|
203
|
+
return name;
|
|
204
|
+
}
|
|
205
|
+
const head = name.slice(0, maxLength - SHORT_HASH_LENGTH - 1).replace(EDGE_SEPARATORS, "");
|
|
206
|
+
// A budget small enough to erase the head still has to produce a valid
|
|
207
|
+
// DNS-1123 name, and a bare `-`-prefixed hash is not one.
|
|
208
|
+
return head === "" ? shortHash(name) : `${head}-${shortHash(name)}`;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Derive a Kubernetes label *value* from a raw identifier.
|
|
212
|
+
*
|
|
213
|
+
* Label values are far more restricted than the identifiers engines accept: the
|
|
214
|
+
* shared role-name validator deliberately permits `reporting@corp`, and `@` is
|
|
215
|
+
* not a legal label character, so the raw name would be rejected by the
|
|
216
|
+
* Kubernetes API when the object carrying the label is applied — after preview
|
|
217
|
+
* has passed and, for a Job, before it can ever run. Values are additionally
|
|
218
|
+
* capped at {@link DNS_1123_LABEL_MAX_LENGTH} characters, which is what
|
|
219
|
+
* {@link toBoundedName} enforces here.
|
|
220
|
+
*
|
|
221
|
+
* The raw identifier must still be used everywhere it has to be exact: the SQL
|
|
222
|
+
* or Cypher statement that creates the account, and the Secret payload
|
|
223
|
+
* applications authenticate with. This is for labels only.
|
|
224
|
+
*
|
|
225
|
+
* @param value - Raw identifier as it exists in the database engine
|
|
226
|
+
* @returns A valid label value, truncated with a hash suffix when over-long
|
|
227
|
+
*/
|
|
228
|
+
function toLabelValue(value) {
|
|
229
|
+
return toBoundedName(toIdentitySegment(value));
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=resource-identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-identity.js","sourceRoot":"","sources":["../../../src/operator/resource-identity.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;AA0DH,oCAMC;AAsCD,8CAMC;AA4BD,gEAIC;AAgCD,sCAQC;AAoBD,oCAEC;AAxMD,6CAAyC;AAEzC,+CAA+C;AAC/C,MAAM,cAAc,GAAG,QAAQ,CAAC;AAEhC;;;;;;;GAOG;AACH,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B;;;;;;GAMG;AACU,QAAA,yBAAyB,GAAG,EAAE,CAAC;AAE5C;;;;;;;;;;GAUG;AACU,QAAA,6BAA6B,GAAG,GAAG,CAAC;AAEjD,wEAAwE;AACxE,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,8EAA8E;AAC9E,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAElC,2EAA2E;AAC3E,MAAM,eAAe,GAAG,QAAQ,CAAC;AAEjC;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAAC,KAAa;IACxC,OAAO,KAAK;SACT,WAAW,EAAE;SACb,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC;SAC9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,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,iBAAiB,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IAC3F,uEAAuE;IACvE,0DAA0D;IAC1D,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;AACtE,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,YAAY,CAAC,KAAa;IACxC,OAAO,aAAa,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cluster-scoped bookkeeping of the role identities a stack has claimed.
|
|
3
|
+
*
|
|
4
|
+
* Every engine nimbus supports keeps login identities at the *server* level, not
|
|
5
|
+
* inside the database: a PostgreSQL role and a MariaDB account both exist once
|
|
6
|
+
* per cluster and are merely granted privileges on individual databases. nimbus'
|
|
7
|
+
* `addRole()` is scoped to a database, so nothing in the shape of the API stops
|
|
8
|
+
* two databases on one cluster from each asking for a role called `reader`.
|
|
9
|
+
*
|
|
10
|
+
* That is not a duplicate resource Pulumi can catch. Each database derives its
|
|
11
|
+
* own Pulumi logical names, so `pulumi preview` sees two unrelated resources and
|
|
12
|
+
* reports no conflict — while on the cluster both reconcile the *same* account
|
|
13
|
+
* against *different* generated password Secrets, rewriting its password against
|
|
14
|
+
* each other forever. At least one database's replicated connection Secrets then
|
|
15
|
+
* holds a credential that no longer authenticates, and nothing in the diff says
|
|
16
|
+
* why.
|
|
17
|
+
*
|
|
18
|
+
* A registry lives for the lifetime of one cluster object and refuses the second
|
|
19
|
+
* claim, so the collision surfaces at preview instead of in production. The
|
|
20
|
+
* alternative — silently renaming the second role, say by prefixing it with the
|
|
21
|
+
* database name — is worse: it would hand back an account that is not the one
|
|
22
|
+
* the caller asked for.
|
|
23
|
+
*
|
|
24
|
+
* @module operator/role-registry
|
|
25
|
+
*/
|
|
26
|
+
/** Wording a registry uses to describe the scope its identities are global to. */
|
|
27
|
+
export interface IRoleRegistryOptions {
|
|
28
|
+
/** Cluster or instance the registry covers, named in the error message. */
|
|
29
|
+
readonly clusterName: string;
|
|
30
|
+
/** What that thing is called for this engine, e.g. `"cluster"`, `"instance"`. */
|
|
31
|
+
readonly scopeNoun: string;
|
|
32
|
+
/** Sentences explaining why identities are scope-global and what a clash breaks. */
|
|
33
|
+
readonly scopeExplanation: string;
|
|
34
|
+
}
|
|
35
|
+
/** One request to claim a role identity. */
|
|
36
|
+
export interface IRoleClaim {
|
|
37
|
+
/**
|
|
38
|
+
* The value two roles must not share.
|
|
39
|
+
*
|
|
40
|
+
* This is the engine's own notion of account identity, which is not always
|
|
41
|
+
* just the name — MariaDB accounts are identified by username *and* host, so
|
|
42
|
+
* two roles named `reader` on genuinely different hosts are distinct accounts
|
|
43
|
+
* and must both be allowed.
|
|
44
|
+
*/
|
|
45
|
+
readonly identity: string;
|
|
46
|
+
/** How the identity is rendered in the error message, e.g. `"reader"@"%"`. */
|
|
47
|
+
readonly label: string;
|
|
48
|
+
/** Database whose configuration is making the claim. */
|
|
49
|
+
readonly databaseName: string;
|
|
50
|
+
}
|
|
51
|
+
/** Records which role identities a cluster has already handed out. */
|
|
52
|
+
export interface IRoleRegistry {
|
|
53
|
+
/**
|
|
54
|
+
* Claim an identity for a database, or fail because something else holds it.
|
|
55
|
+
*
|
|
56
|
+
* @param claim - Identity to claim, its display form, and the claiming database
|
|
57
|
+
* @throws {AnyCloudError} code `UNSUPPORTED_ROLE_OPTION` when the identity was
|
|
58
|
+
* already claimed on this cluster, by any database
|
|
59
|
+
*/
|
|
60
|
+
claim(claim: IRoleClaim): void;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Create an empty registry for one cluster.
|
|
64
|
+
*
|
|
65
|
+
* Callers hold exactly one per cluster and thread it through every database
|
|
66
|
+
* created on it — both the owner created by `createDatabase()` and every role
|
|
67
|
+
* added by `addRole()` must claim, or the guard has a hole.
|
|
68
|
+
*
|
|
69
|
+
* @param options - Cluster name and the engine's wording for scope and consequence
|
|
70
|
+
* @returns A registry with no identities claimed yet
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const registry = createRoleRegistry({
|
|
75
|
+
* clusterName: "pgsql-main",
|
|
76
|
+
* scopeNoun: "cluster",
|
|
77
|
+
* scopeExplanation: "PostgreSQL roles are cluster-global.",
|
|
78
|
+
* });
|
|
79
|
+
* registry.claim({ identity: "reader", label: '"reader"', databaseName: "billing" });
|
|
80
|
+
* // Throws: "reader" is already claimed by database "billing".
|
|
81
|
+
* registry.claim({ identity: "reader", label: '"reader"', databaseName: "analytics" });
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export declare function createRoleRegistry(options: IRoleRegistryOptions): IRoleRegistry;
|
|
85
|
+
//# sourceMappingURL=role-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role-registry.d.ts","sourceRoot":"","sources":["../../../src/operator/role-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,kFAAkF;AAClF,MAAM,WAAW,oBAAoB;IACnC,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oFAAoF;IACpF,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAED,4CAA4C;AAC5C,MAAM,WAAW,UAAU;IACzB;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,sEAAsE;AACtE,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAwB/E"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cluster-scoped bookkeeping of the role identities a stack has claimed.
|
|
4
|
+
*
|
|
5
|
+
* Every engine nimbus supports keeps login identities at the *server* level, not
|
|
6
|
+
* inside the database: a PostgreSQL role and a MariaDB account both exist once
|
|
7
|
+
* per cluster and are merely granted privileges on individual databases. nimbus'
|
|
8
|
+
* `addRole()` is scoped to a database, so nothing in the shape of the API stops
|
|
9
|
+
* two databases on one cluster from each asking for a role called `reader`.
|
|
10
|
+
*
|
|
11
|
+
* That is not a duplicate resource Pulumi can catch. Each database derives its
|
|
12
|
+
* own Pulumi logical names, so `pulumi preview` sees two unrelated resources and
|
|
13
|
+
* reports no conflict — while on the cluster both reconcile the *same* account
|
|
14
|
+
* against *different* generated password Secrets, rewriting its password against
|
|
15
|
+
* each other forever. At least one database's replicated connection Secrets then
|
|
16
|
+
* holds a credential that no longer authenticates, and nothing in the diff says
|
|
17
|
+
* why.
|
|
18
|
+
*
|
|
19
|
+
* A registry lives for the lifetime of one cluster object and refuses the second
|
|
20
|
+
* claim, so the collision surfaces at preview instead of in production. The
|
|
21
|
+
* alternative — silently renaming the second role, say by prefixing it with the
|
|
22
|
+
* database name — is worse: it would hand back an account that is not the one
|
|
23
|
+
* the caller asked for.
|
|
24
|
+
*
|
|
25
|
+
* @module operator/role-registry
|
|
26
|
+
*/
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.createRoleRegistry = createRoleRegistry;
|
|
29
|
+
const errors_js_1 = require("../types/errors.js");
|
|
30
|
+
/**
|
|
31
|
+
* Create an empty registry for one cluster.
|
|
32
|
+
*
|
|
33
|
+
* Callers hold exactly one per cluster and thread it through every database
|
|
34
|
+
* created on it — both the owner created by `createDatabase()` and every role
|
|
35
|
+
* added by `addRole()` must claim, or the guard has a hole.
|
|
36
|
+
*
|
|
37
|
+
* @param options - Cluster name and the engine's wording for scope and consequence
|
|
38
|
+
* @returns A registry with no identities claimed yet
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const registry = createRoleRegistry({
|
|
43
|
+
* clusterName: "pgsql-main",
|
|
44
|
+
* scopeNoun: "cluster",
|
|
45
|
+
* scopeExplanation: "PostgreSQL roles are cluster-global.",
|
|
46
|
+
* });
|
|
47
|
+
* registry.claim({ identity: "reader", label: '"reader"', databaseName: "billing" });
|
|
48
|
+
* // Throws: "reader" is already claimed by database "billing".
|
|
49
|
+
* registry.claim({ identity: "reader", label: '"reader"', databaseName: "analytics" });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
function createRoleRegistry(options) {
|
|
53
|
+
/** identity → the database that claimed it first. */
|
|
54
|
+
const claimedBy = new Map();
|
|
55
|
+
return {
|
|
56
|
+
claim({ identity, label, databaseName }) {
|
|
57
|
+
const holder = claimedBy.get(identity);
|
|
58
|
+
if (holder !== undefined) {
|
|
59
|
+
const scope = `${options.scopeNoun} "${options.clusterName}"`;
|
|
60
|
+
const where = holder === databaseName
|
|
61
|
+
? `already claimed by database "${holder}"`
|
|
62
|
+
: `already claimed by database "${holder}" and cannot be claimed again by ` +
|
|
63
|
+
`database "${databaseName}"`;
|
|
64
|
+
throw new errors_js_1.AnyCloudError(`Role ${label} is ${where} on ${scope}. ${options.scopeExplanation} ` +
|
|
65
|
+
`Give one of them a different name — nimbus will not silently rename it for ` +
|
|
66
|
+
`you, because the role you would get back is not the one you asked for.`, errors_js_1.ERROR_CODES.UNSUPPORTED_ROLE_OPTION);
|
|
67
|
+
}
|
|
68
|
+
claimedBy.set(identity, databaseName);
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=role-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role-registry.js","sourceRoot":"","sources":["../../../src/operator/role-registry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;AAiEH,gDAwBC;AAvFD,kDAAgE;AAyChE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,kBAAkB,CAAC,OAA6B;IAC9D,qDAAqD;IACrD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE5C,OAAO;QACL,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAc;YACjD,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACvC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,MAAM,KAAK,GAAG,GAAG,OAAO,CAAC,SAAS,KAAK,OAAO,CAAC,WAAW,GAAG,CAAC;gBAC9D,MAAM,KAAK,GACT,MAAM,KAAK,YAAY;oBACrB,CAAC,CAAC,gCAAgC,MAAM,GAAG;oBAC3C,CAAC,CAAC,gCAAgC,MAAM,mCAAmC;wBACzE,aAAa,YAAY,GAAG,CAAC;gBACnC,MAAM,IAAI,yBAAa,CACrB,QAAQ,KAAK,OAAO,KAAK,OAAO,KAAK,KAAK,OAAO,CAAC,gBAAgB,GAAG;oBACnE,6EAA6E;oBAC7E,wEAAwE,EAC1E,uBAAW,CAAC,uBAAuB,CACpC,CAAC;YACJ,CAAC;YACD,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACxC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Runs well below kubelet's imageGC (85%) and eviction (90%) thresholds
|
|
10
10
|
* to prevent DiskPressure cascades on small root disks (e.g. 38Gi).
|
|
11
|
-
* Defaults: trigger at
|
|
11
|
+
* Defaults: trigger at 75%, target 60% — low enough to prevent eviction,
|
|
12
|
+
* high enough to stay above the floor of in-use images (which alone can
|
|
13
|
+
* exceed 50% of a 41Gi disk and can never be pruned).
|
|
12
14
|
*
|
|
13
15
|
* @module platform/components/image-pruner
|
|
14
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-pruner.d.ts","sourceRoot":"","sources":["../../../../src/platform/components/image-pruner.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"image-pruner.d.ts","sourceRoot":"","sources":["../../../../src/platform/components/image-pruner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AASxD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,GAAG,CAAC,QAAQ,GACrB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,GAAG,IAAI,CAmJ9B"}
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Runs well below kubelet's imageGC (85%) and eviction (90%) thresholds
|
|
11
11
|
* to prevent DiskPressure cascades on small root disks (e.g. 38Gi).
|
|
12
|
-
* Defaults: trigger at
|
|
12
|
+
* Defaults: trigger at 75%, target 60% — low enough to prevent eviction,
|
|
13
|
+
* high enough to stay above the floor of in-use images (which alone can
|
|
14
|
+
* exceed 50% of a 41Gi disk and can never be pruned).
|
|
13
15
|
*
|
|
14
16
|
* @module platform/components/image-pruner
|
|
15
17
|
*/
|
|
@@ -52,8 +54,8 @@ const k8s = __importStar(require("@pulumi/kubernetes"));
|
|
|
52
54
|
const CRICTL_VERSION = "v1.30.0";
|
|
53
55
|
const DEFAULT_IMAGE = "alpine:3.20";
|
|
54
56
|
const DEFAULT_INTERVAL = 300; // 5 minutes
|
|
55
|
-
const DEFAULT_HIGH_THRESHOLD =
|
|
56
|
-
const DEFAULT_LOW_THRESHOLD =
|
|
57
|
+
const DEFAULT_HIGH_THRESHOLD = 75; // prune when disk >= 75%
|
|
58
|
+
const DEFAULT_LOW_THRESHOLD = 60; // prune until disk <= 60%
|
|
57
59
|
const DEFAULT_NAMESPACE = "kube-system";
|
|
58
60
|
function createImagePruner(name, config, provider) {
|
|
59
61
|
if (config.enabled === false) {
|
|
@@ -64,7 +66,11 @@ function createImagePruner(name, config, provider) {
|
|
|
64
66
|
const lowPct = config.lowThresholdPercent ?? DEFAULT_LOW_THRESHOLD;
|
|
65
67
|
const image = config.image ?? DEFAULT_IMAGE;
|
|
66
68
|
const namespace = config.namespace ?? DEFAULT_NAMESPACE;
|
|
67
|
-
|
|
69
|
+
// NOTE: no `set -e` — the removal loop's failing tests would kill the
|
|
70
|
+
// shell (a `[ ... ] && break` list that evaluates false is a nonzero exit),
|
|
71
|
+
// which previously caused a permanent CrashLoopBackOff. Errors are handled
|
|
72
|
+
// explicitly instead.
|
|
73
|
+
const script = `set -u
|
|
68
74
|
ARCH=$(uname -m)
|
|
69
75
|
case "$ARCH" in
|
|
70
76
|
x86_64) ARCH=amd64 ;;
|
|
@@ -81,40 +87,53 @@ CRI="--runtime-endpoint unix:///run/containerd/containerd.sock"
|
|
|
81
87
|
HIGH=${highPct}
|
|
82
88
|
LOW=${lowPct}
|
|
83
89
|
|
|
90
|
+
# The container rootfs lives on the same node disk as the containerd image
|
|
91
|
+
# store, so df of / tracks the disk the kubelet watches.
|
|
84
92
|
get_disk_pct() {
|
|
85
|
-
df /
|
|
93
|
+
df / | awk 'NR==2 {gsub(/%/,""); print $5}'
|
|
86
94
|
}
|
|
87
95
|
|
|
88
96
|
while true; do
|
|
89
97
|
PCT=$(get_disk_pct)
|
|
98
|
+
PCT=\${PCT:-0}
|
|
90
99
|
if [ "$PCT" -ge "$HIGH" ]; then
|
|
91
100
|
echo "[$(date -Iseconds)] disk at \${PCT}% (>= \${HIGH}%), pruning..."
|
|
92
101
|
|
|
93
102
|
# 1. Remove stopped containers first — frees image references
|
|
94
103
|
STOPPED=$(crictl $CRI ps -a --state exited -q 2>/dev/null || true)
|
|
95
104
|
if [ -n "$STOPPED" ]; then
|
|
96
|
-
echo "$STOPPED" | xargs -r crictl $CRI rm
|
|
105
|
+
echo "$STOPPED" | xargs -r crictl $CRI rm >/dev/null 2>&1 || true
|
|
97
106
|
echo "[$(date -Iseconds)] cleaned stopped containers"
|
|
98
107
|
fi
|
|
99
108
|
|
|
100
|
-
#
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
# 2. Prune unreferenced images (skip our own)
|
|
104
|
-
crictl $CRI rmi --prune 2>/dev/null || true
|
|
109
|
+
# 2. Prune unreferenced images
|
|
110
|
+
crictl $CRI rmi --prune >/dev/null 2>&1 || true
|
|
105
111
|
PCT=$(get_disk_pct)
|
|
106
112
|
echo "[$(date -Iseconds)] after prune: \${PCT}%"
|
|
107
113
|
|
|
108
|
-
# 3. If still above low threshold, remove
|
|
114
|
+
# 3. If still above low threshold, remove unused images one by one.
|
|
115
|
+
# Skip our own base image and the pod-sandbox (pause) image by repo —
|
|
116
|
+
# an ID-equality self-guard proved unreliable and once deleted both.
|
|
109
117
|
if [ "$PCT" -ge "$LOW" ]; then
|
|
110
|
-
|
|
111
|
-
crictl $CRI images -
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
118
|
+
REMOVED=0
|
|
119
|
+
IMAGE_TABLE=$(crictl $CRI images --no-trunc 2>/dev/null || true)
|
|
120
|
+
for IMG_ID in $(crictl $CRI images -q 2>/dev/null); do
|
|
121
|
+
REPOS=$(echo "$IMAGE_TABLE" | awk -v id="$IMG_ID" '$3 == id {print $1}')
|
|
122
|
+
case "$REPOS" in
|
|
123
|
+
*${image.split(":")[0]}*|*pause*) continue ;;
|
|
124
|
+
esac
|
|
125
|
+
if crictl $CRI rmi "$IMG_ID" >/dev/null 2>&1; then
|
|
126
|
+
REMOVED=$((REMOVED + 1))
|
|
127
|
+
PCT=$(get_disk_pct)
|
|
128
|
+
echo "[$(date -Iseconds)] removed $IMG_ID, now \${PCT}%"
|
|
129
|
+
if [ "$PCT" -lt "$LOW" ]; then
|
|
130
|
+
break
|
|
131
|
+
fi
|
|
132
|
+
fi
|
|
117
133
|
done
|
|
134
|
+
if [ "$REMOVED" -eq 0 ]; then
|
|
135
|
+
echo "[$(date -Iseconds)] nothing removable; remaining usage is in-use images or non-image data"
|
|
136
|
+
fi
|
|
118
137
|
fi
|
|
119
138
|
|
|
120
139
|
PCT=$(get_disk_pct)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-pruner.js","sourceRoot":"","sources":["../../../../src/platform/components/image-pruner.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"image-pruner.js","sourceRoot":"","sources":["../../../../src/platform/components/image-pruner.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYH,8CAuJC;AAjKD,wDAA0C;AAG1C,MAAM,cAAc,GAAG,SAAS,CAAC;AACjC,MAAM,aAAa,GAAG,aAAa,CAAC;AACpC,MAAM,gBAAgB,GAAG,GAAG,CAAC,CAAC,YAAY;AAC1C,MAAM,sBAAsB,GAAG,EAAE,CAAC,CAAC,yBAAyB;AAC5D,MAAM,qBAAqB,GAAG,EAAE,CAAC,CAAC,0BAA0B;AAC5D,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAExC,SAAgB,iBAAiB,CAC/B,IAAY,EACZ,MAA0B,EAC1B,QAAsB;IAEtB,IAAI,MAAM,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IA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I,CAAC;4BAC1B,IAAI,EAAE,CAAC,MAAM,CAAC;4BACd,eAAe,EAAE;gCACf,UAAU,EAAE,IAAI;gCAChB,SAAS,EAAE,CAAC;6BACb;4BACD,SAAS,EAAE;gCACT,QAAQ,EAAE;oCACR,GAAG,EAAE,KAAK;oCACV,MAAM,EAAE,MAAM;oCACd,mBAAmB,EAAE,OAAO;iCAC7B;gCACD,MAAM,EAAE;oCACN,GAAG,EAAE,MAAM;oCACX,MAAM,EAAE,OAAO;oCACf,mBAAmB,EAAE,OAAO;iCAC7B;6BACF;4BACD,YAAY,EAAE;gCACZ;oCACE,IAAI,EAAE,iBAAiB;oCACvB,SAAS,EAAE,iCAAiC;iCAC7C;6BACF;yBACF;qBACF;oBACD,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,iBAAiB;4BACvB,QAAQ,EAAE;gCACR,IAAI,EAAE,iCAAiC;gCACvC,IAAI,EAAE,QAAQ;6BACf;yBACF;qBACF;iBACF;aACF;SACF;KACF,EACD,EAAE,QAAQ,EAAE,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -16,6 +16,9 @@ export declare const ERROR_CODES: {
|
|
|
16
16
|
readonly CONFIG_INVALID: "CONFIG_INVALID";
|
|
17
17
|
readonly SECRET_NOT_FOUND: "SECRET_NOT_FOUND";
|
|
18
18
|
readonly PROVIDER_MISMATCH: "PROVIDER_MISMATCH";
|
|
19
|
+
readonly INVALID_GRANT: "INVALID_GRANT";
|
|
20
|
+
readonly UNSUPPORTED_PRIVILEGE: "UNSUPPORTED_PRIVILEGE";
|
|
21
|
+
readonly UNSUPPORTED_ROLE_OPTION: "UNSUPPORTED_ROLE_OPTION";
|
|
19
22
|
};
|
|
20
23
|
export type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];
|
|
21
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/types/errors.ts"],"names":[],"mappings":"AAAA;;;;;;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,KAAK,GAAG,KAAK,CAE/C"}
|
package/dist/esm/types/errors.js
CHANGED
|
@@ -20,6 +20,9 @@ exports.ERROR_CODES = {
|
|
|
20
20
|
CONFIG_INVALID: "CONFIG_INVALID",
|
|
21
21
|
SECRET_NOT_FOUND: "SECRET_NOT_FOUND",
|
|
22
22
|
PROVIDER_MISMATCH: "PROVIDER_MISMATCH",
|
|
23
|
+
INVALID_GRANT: "INVALID_GRANT",
|
|
24
|
+
UNSUPPORTED_PRIVILEGE: "UNSUPPORTED_PRIVILEGE",
|
|
25
|
+
UNSUPPORTED_ROLE_OPTION: "UNSUPPORTED_ROLE_OPTION",
|
|
23
26
|
};
|
|
24
27
|
/**
|
|
25
28
|
* Base error for all nimbus errors.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/types/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/types/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAkIH,kCAEC;AAlID,yCAAyC;AAC5B,QAAA,WAAW,GAAG;IACzB,gBAAgB,EAAE,kBAAkB;IACpC,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,mBAAmB,EAAE,qBAAqB;IAC1C,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,iBAAiB,EAAE,mBAAmB;IACtC,aAAa,EAAE,eAAe;IAC9B,qBAAqB,EAAE,uBAAuB;IAC9C,uBAAuB,EAAE,yBAAyB;CAC1C,CAAC;AAIX;;;;;;;;;;;;;GAaG;AACH,MAAa,aAAc,SAAQ,KAAK;IAC7B,IAAI,CAAY;IAEzB,YAAY,OAAe,EAAE,IAAe;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QA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