typekro 0.34.0 → 0.36.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/.tsbuildinfo +1 -1
- package/dist/alchemy/clickhouse-schema/executor.d.ts +25 -0
- package/dist/alchemy/clickhouse-schema/executor.d.ts.map +1 -0
- package/dist/alchemy/clickhouse-schema/executor.js +144 -0
- package/dist/alchemy/clickhouse-schema/executor.js.map +1 -0
- package/dist/alchemy/clickhouse-schema/index.d.ts +12 -0
- package/dist/alchemy/clickhouse-schema/index.d.ts.map +1 -0
- package/dist/alchemy/clickhouse-schema/index.js +11 -0
- package/dist/alchemy/clickhouse-schema/index.js.map +1 -0
- package/dist/alchemy/clickhouse-schema/resource.d.ts +54 -0
- package/dist/alchemy/clickhouse-schema/resource.d.ts.map +1 -0
- package/dist/alchemy/clickhouse-schema/resource.js +158 -0
- package/dist/alchemy/clickhouse-schema/resource.js.map +1 -0
- package/dist/alchemy/clickhouse-schema/runner.d.ts +154 -0
- package/dist/alchemy/clickhouse-schema/runner.d.ts.map +1 -0
- package/dist/alchemy/clickhouse-schema/runner.js +613 -0
- package/dist/alchemy/clickhouse-schema/runner.js.map +1 -0
- package/dist/alchemy/clickhouse-schema/sql.d.ts +109 -0
- package/dist/alchemy/clickhouse-schema/sql.d.ts.map +1 -0
- package/dist/alchemy/clickhouse-schema/sql.js +368 -0
- package/dist/alchemy/clickhouse-schema/sql.js.map +1 -0
- package/dist/alchemy/clickhouse-schema/types.d.ts +394 -0
- package/dist/alchemy/clickhouse-schema/types.d.ts.map +1 -0
- package/dist/alchemy/clickhouse-schema/types.js +370 -0
- package/dist/alchemy/clickhouse-schema/types.js.map +1 -0
- package/dist/alchemy/index.d.ts +1 -0
- package/dist/alchemy/index.d.ts.map +1 -1
- package/dist/alchemy/index.js +2 -0
- package/dist/alchemy/index.js.map +1 -1
- package/dist/alchemy/kro-delete.d.ts +7 -0
- package/dist/alchemy/kro-delete.d.ts.map +1 -1
- package/dist/alchemy/kro-delete.js +28 -4
- package/dist/alchemy/kro-delete.js.map +1 -1
- package/dist/alchemy/resource-registration.d.ts +9 -2
- package/dist/alchemy/resource-registration.d.ts.map +1 -1
- package/dist/alchemy/resource-registration.js +117 -33
- package/dist/alchemy/resource-registration.js.map +1 -1
- package/dist/core/deployment/k8s-helpers.d.ts +77 -1
- package/dist/core/deployment/k8s-helpers.d.ts.map +1 -1
- package/dist/core/deployment/k8s-helpers.js +298 -17
- package/dist/core/deployment/k8s-helpers.js.map +1 -1
- package/dist/core/deployment/kro-artifact-binding-migration.d.ts +17 -6
- package/dist/core/deployment/kro-artifact-binding-migration.d.ts.map +1 -1
- package/dist/core/deployment/kro-artifact-binding-migration.js +16 -2
- package/dist/core/deployment/kro-artifact-binding-migration.js.map +1 -1
- package/dist/core/deployment/kro-namespace-teardown.d.ts +15 -1
- package/dist/core/deployment/kro-namespace-teardown.d.ts.map +1 -1
- package/dist/core/deployment/kro-namespace-teardown.js +34 -9
- package/dist/core/deployment/kro-namespace-teardown.js.map +1 -1
- package/dist/core/deployment/kro-readiness.d.ts +35 -0
- package/dist/core/deployment/kro-readiness.d.ts.map +1 -1
- package/dist/core/deployment/kro-readiness.js +201 -25
- package/dist/core/deployment/kro-readiness.js.map +1 -1
- package/dist/core/deployment/poll-timeout.d.ts +80 -2
- package/dist/core/deployment/poll-timeout.d.ts.map +1 -1
- package/dist/core/deployment/poll-timeout.js +164 -4
- package/dist/core/deployment/poll-timeout.js.map +1 -1
- package/dist/core/kubernetes/bun-http-library.d.ts +24 -0
- package/dist/core/kubernetes/bun-http-library.d.ts.map +1 -1
- package/dist/core/kubernetes/bun-http-library.js +146 -19
- package/dist/core/kubernetes/bun-http-library.js.map +1 -1
- package/dist/core/kubernetes/errors.d.ts +9 -0
- package/dist/core/kubernetes/errors.d.ts.map +1 -1
- package/dist/core/kubernetes/errors.js +7 -3
- package/dist/core/kubernetes/errors.js.map +1 -1
- package/dist/factories/clickhouse/compositions/clickhouse-cluster.d.ts +24 -2
- package/dist/factories/clickhouse/compositions/clickhouse-cluster.d.ts.map +1 -1
- package/dist/factories/clickhouse/compositions/clickhouse-cluster.js +24 -2
- package/dist/factories/clickhouse/compositions/clickhouse-cluster.js.map +1 -1
- package/dist/factories/clickhouse/resources/keeper.d.ts +61 -0
- package/dist/factories/clickhouse/resources/keeper.d.ts.map +1 -1
- package/dist/factories/clickhouse/resources/keeper.js +216 -2
- package/dist/factories/clickhouse/resources/keeper.js.map +1 -1
- package/dist/factories/clickhouse/resources/s3-backup.d.ts.map +1 -1
- package/dist/factories/clickhouse/resources/s3-backup.js +4 -3
- package/dist/factories/clickhouse/resources/s3-backup.js.map +1 -1
- package/dist/factories/clickhouse/types.d.ts +3 -2
- package/dist/factories/clickhouse/types.d.ts.map +1 -1
- package/dist/factories/clickhouse/types.js +28 -1
- package/dist/factories/clickhouse/types.js.map +1 -1
- package/dist/factories/clickhouse/utils/validation.d.ts +133 -10
- package/dist/factories/clickhouse/utils/validation.d.ts.map +1 -1
- package/dist/factories/clickhouse/utils/validation.js +165 -18
- package/dist/factories/clickhouse/utils/validation.js.map +1 -1
- package/dist/factories/clickstack/compositions/clickstack-bootstrap.d.ts +15 -1
- package/dist/factories/clickstack/compositions/clickstack-bootstrap.d.ts.map +1 -1
- package/dist/factories/clickstack/compositions/clickstack-bootstrap.js +15 -1
- package/dist/factories/clickstack/compositions/clickstack-bootstrap.js.map +1 -1
- package/dist/factories/rook/types.d.ts +16 -16
- package/package.json +1 -1
|
@@ -31,12 +31,78 @@ export declare function isConflictError(error: unknown): boolean;
|
|
|
31
31
|
* `unserved` / `unknown` split on.
|
|
32
32
|
*/
|
|
33
33
|
export type ApiReadFailure = 'notFound' | 'forbidden' | 'timeout' | 'unreachable' | 'other';
|
|
34
|
+
/**
|
|
35
|
+
* Certificate verification failures: one end refused the other's certificate.
|
|
36
|
+
*
|
|
37
|
+
* This is the COMPLETE set of certificate-verification codes Node documents under "OpenSSL error
|
|
38
|
+
* codes" in https://nodejs.org/api/errors.html — every subsection of it (Time Validity, Trust or
|
|
39
|
+
* Chain Related, Basic Extension, Name Related, Usage and Policy, Formatting) — rather than the
|
|
40
|
+
* handful a reader happens to have seen. Completeness is the point: a code missing from this set
|
|
41
|
+
* falls through to {@link isRetryableError}, whose last rule retries ANY `TypeError` mentioning
|
|
42
|
+
* `fetch`, and Node's `fetch()` spells every one of these as exactly that. One omission therefore
|
|
43
|
+
* does not degrade gracefully — it polls a revoked certificate until the deadline and reports a
|
|
44
|
+
* timeout instead of the cause, which is the bug this classification exists to prevent.
|
|
45
|
+
*
|
|
46
|
+
* The one code in that doc section deliberately LEFT OUT is `OUT_OF_MEM`, which lives there because
|
|
47
|
+
* OpenSSL can raise it during verification but describes a resource shortage, not a verdict on the
|
|
48
|
+
* certificate — the only member of the section that can read differently on a later attempt.
|
|
49
|
+
*
|
|
50
|
+
* `ERR_TLS_CERT_ALTNAME_INVALID` is Node's own (it checks the hostname against the certificate's
|
|
51
|
+
* subjectAltNames itself, outside OpenSSL's verifier) and is the same kind of deterministic fact.
|
|
52
|
+
*
|
|
53
|
+
* Also included, and NOT from that doc page: the fatal TLS certificate alerts a PEER sends when it
|
|
54
|
+
* rejects OUR certificate — the mTLS direction a kubeconfig client cert takes. OpenSSL surfaces an
|
|
55
|
+
* incoming alert as its reason string, which Node exposes as `ERR_SSL_` + the uppercased reason, so
|
|
56
|
+
* a server that rejects a stale kubeconfig certificate arrives as `ERR_SSL_TLSV1_ALERT_UNKNOWN_CA`
|
|
57
|
+
* rather than any `CERT_*` code. The alert names are those of RFC 5246 §7.2.2 / RFC 8446 §6.2, and
|
|
58
|
+
* each listed one is a verdict on a certificate that will be reached identically next time.
|
|
59
|
+
*
|
|
60
|
+
* @internal Exported only so the unit tests can assert the membership itself — the prefix fallback
|
|
61
|
+
* in {@link isTlsConfigurationCode} would otherwise let a code silently drop out of this list
|
|
62
|
+
* without a single test noticing. Not re-exported from the package index.
|
|
63
|
+
*/
|
|
64
|
+
export declare const TLS_CERTIFICATE_CODES: ReadonlySet<string>;
|
|
65
|
+
/**
|
|
66
|
+
* Handshake failures that are not about a certificate: the two ends cannot agree on a protocol.
|
|
67
|
+
*
|
|
68
|
+
* Every member is a persistent mismatch between two configurations, so each is listed with the
|
|
69
|
+
* reason it qualifies rather than swept in by an `ERR_SSL_*` prefix — most `ERR_SSL_*` codes are
|
|
70
|
+
* pass-throughs of arbitrary OpenSSL reasons, and some (an allocation failure, a decrypt error on a
|
|
71
|
+
* corrupted record) genuinely can differ on the next attempt.
|
|
72
|
+
*
|
|
73
|
+
* - `EPROTO` — libuv's errno for a handshake OpenSSL aborted. The two ends could not complete a
|
|
74
|
+
* handshake at all; nothing about asking again changes what they support.
|
|
75
|
+
* - `ERR_SSL_WRONG_VERSION_NUMBER` — the bytes on the wire are not a TLS record. Classically an
|
|
76
|
+
* `https://` URL pointing at a plain-HTTP listener: an address/scheme fact, fixed in config.
|
|
77
|
+
* - `ERR_SSL_UNKNOWN_PROTOCOL` — the same situation as reported by OpenSSL's older reason string.
|
|
78
|
+
* - `ERR_SSL_UNSUPPORTED_PROTOCOL` — the peer's protocol version is not enabled on this side.
|
|
79
|
+
* - `ERR_SSL_VERSION_TOO_LOW` / `ERR_SSL_VERSION_TOO_HIGH` — the version the peer offers falls
|
|
80
|
+
* outside this side's configured `minVersion`/`maxVersion` window.
|
|
81
|
+
* - `ERR_SSL_NO_PROTOCOLS_AVAILABLE` — this side's own TLS context has every version disabled, a
|
|
82
|
+
* purely local configuration error that cannot resolve itself.
|
|
83
|
+
* - `ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION` — the peer's fatal alert (RFC 5246 §7.2.2) stating that
|
|
84
|
+
* the version we offered is unacceptable to it.
|
|
85
|
+
*
|
|
86
|
+
* Note what is NOT here: generic handshake alerts such as `ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE`,
|
|
87
|
+
* which OpenSSL emits for several unrelated conditions and which therefore cannot be called a
|
|
88
|
+
* persistent mismatch on the strength of the code alone.
|
|
89
|
+
*
|
|
90
|
+
* @internal Exported for the same reason as {@link TLS_CERTIFICATE_CODES}.
|
|
91
|
+
*/
|
|
92
|
+
export declare const TLS_PROTOCOL_CONFIGURATION_CODES: ReadonlySet<string>;
|
|
34
93
|
/**
|
|
35
94
|
* Classify why a read against the API server failed.
|
|
36
95
|
*
|
|
37
96
|
* Deliberately conservative: anything not positively recognised is `other`,
|
|
38
97
|
* which callers treat the same as `unreachable` — "we did not learn the answer"
|
|
39
98
|
* — rather than as a negative answer.
|
|
99
|
+
*
|
|
100
|
+
* Ordered on the same invariant as {@link classifyReadError}: an HTTP status means the server
|
|
101
|
+
* ANSWERED, so it outranks every transport heuristic below it. That matters more here than
|
|
102
|
+
* anywhere, because this taxonomy's whole subject is whether the server was reached: calling a
|
|
103
|
+
* 422 that happens to carry a stale `ECONNRESET` code `unreachable` would state, in a log line
|
|
104
|
+
* about the cluster, the opposite of what the status proves. A status the list below does not
|
|
105
|
+
* name is `other` — the server answered, just not in a way this taxonomy has a word for.
|
|
40
106
|
*/
|
|
41
107
|
export declare function classifyApiReadError(error: unknown): ApiReadFailure;
|
|
42
108
|
/** Short human phrase for an {@link ApiReadFailure}, for a log line or a reason string. */
|
|
@@ -65,6 +131,8 @@ export type ReadErrorClassification =
|
|
|
65
131
|
| 'permission-denied'
|
|
66
132
|
/** 400/405/422 and other client errors — the request itself is malformed or rejected. */
|
|
67
133
|
| 'invalid-request'
|
|
134
|
+
/** The TLS handshake failed on trust, identity or protocol — a client/cluster misconfiguration. */
|
|
135
|
+
| 'tls-configuration-error'
|
|
68
136
|
/** A programming error with no Kubernetes API shape at all. */
|
|
69
137
|
| 'not-a-kubernetes-error';
|
|
70
138
|
/** A classified read failure, with the pieces an error message needs. */
|
|
@@ -83,7 +151,15 @@ export interface ReadErrorAssessment {
|
|
|
83
151
|
*
|
|
84
152
|
* Built on the shared predicates in `../kubernetes/errors.js` — {@link getErrorStatusCode} for the
|
|
85
153
|
* status across every client-version error shape, and {@link isRetryableError} for the transient
|
|
86
|
-
* set — so this adds a retry policy rather than a second error taxonomy.
|
|
154
|
+
* set — so this adds a retry policy rather than a second error taxonomy. It additionally recognises
|
|
155
|
+
* the transport shapes those predicates miss: {@link isRequestTimeoutError} and Node's socket/DNS
|
|
156
|
+
* `code`s make "the request never got an answer" `transient` however it was spelled, while a TLS
|
|
157
|
+
* trust/protocol `code` — including one buried in a `fetch failed` `cause` — is separated out as
|
|
158
|
+
* the permanent misconfiguration it is.
|
|
159
|
+
*
|
|
160
|
+
* Shared with the engine's external-reference resolver, whose policy is that a permanent failure
|
|
161
|
+
* fails immediately, so a classification is only `retryable` when asking again could plausibly
|
|
162
|
+
* succeed with nothing else changing.
|
|
87
163
|
*/
|
|
88
164
|
export declare function classifyReadError(error: unknown): ReadErrorAssessment;
|
|
89
165
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"k8s-helpers.d.ts","sourceRoot":"","sources":["../../../src/core/deployment/k8s-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,GAAG,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"k8s-helpers.d.ts","sourceRoot":"","sources":["../../../src/core/deployment/k8s-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,GAAG,MAAM,yBAAyB,CAAC;AAcpD;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAmBvD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAYvD;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,OAAO,CAAC;AA8D5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,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E;AAED;;;GAGG;AACH,wBAAsB,mCAAmC,CACvD,MAAM,EAAE,GAAG,CAAC,mBAAmB,EAC/B,QAAQ,EAAE,GAAG,CAAC,gBAAgB,EAC9B,SAAS,GAAE,OAAO,GAAG,WAAqB,GACzC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAwB/B;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE;IACR,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,UAAU,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACzF,CAAC;IACF,QAAQ,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D,EACD,IAAI,EAAE,MAAM,GACX,OAAO,QAAQ,CA+BjB"}
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Extracted from engine.ts. Contains error classification, media type handling,
|
|
5
5
|
* and resource patching utilities.
|
|
6
6
|
*/
|
|
7
|
-
import { formatKubernetesError, getErrorDetails, getErrorStatusCode, isRetryableError, } from '../kubernetes/errors.js';
|
|
7
|
+
import { formatKubernetesError, getErrorDetails, getErrorStatusCode, isRetryableError, RETRYABLE_STATUS_CODES, } from '../kubernetes/errors.js';
|
|
8
8
|
import { getComponentLogger } from '../logging/index.js';
|
|
9
|
+
import { isRequestTimeoutError } from './poll-timeout.js';
|
|
9
10
|
const logger = getComponentLogger('k8s-helpers');
|
|
10
11
|
/**
|
|
11
12
|
* Check if an error is a "not found" error (HTTP 404)
|
|
@@ -84,21 +85,208 @@ const UNREACHABLE_CODES = new Set([
|
|
|
84
85
|
'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
|
|
85
86
|
'ERR_TLS_CERT_ALTNAME_INVALID',
|
|
86
87
|
]);
|
|
88
|
+
/**
|
|
89
|
+
* Transport `code`s that describe a connection which may come up on a later attempt: a refused or
|
|
90
|
+
* reset socket, an unreachable route, a DNS blip, a connect timeout.
|
|
91
|
+
*
|
|
92
|
+
* Deliberately NOT {@link UNREACHABLE_CODES}. That set answers a different question — "did the
|
|
93
|
+
* server ever answer?" — and so it also lists the TLS trust codes, which answer "did the transport
|
|
94
|
+
* come up?" with a permanent no. Retrying those for a multi-minute readiness budget only hides a
|
|
95
|
+
* misconfiguration behind a timeout, so the retry policy keeps its own, narrower set.
|
|
96
|
+
*/
|
|
97
|
+
const RETRYABLE_SYSTEM_CODES = new Set([
|
|
98
|
+
'ECONNREFUSED',
|
|
99
|
+
'ECONNRESET',
|
|
100
|
+
'EHOSTUNREACH',
|
|
101
|
+
'ENETUNREACH',
|
|
102
|
+
'ENOTFOUND',
|
|
103
|
+
'EAI_AGAIN',
|
|
104
|
+
'EPIPE',
|
|
105
|
+
'ETIMEDOUT',
|
|
106
|
+
'ESOCKETTIMEDOUT',
|
|
107
|
+
'UND_ERR_CONNECT_TIMEOUT',
|
|
108
|
+
]);
|
|
109
|
+
/**
|
|
110
|
+
* Certificate verification failures: one end refused the other's certificate.
|
|
111
|
+
*
|
|
112
|
+
* This is the COMPLETE set of certificate-verification codes Node documents under "OpenSSL error
|
|
113
|
+
* codes" in https://nodejs.org/api/errors.html — every subsection of it (Time Validity, Trust or
|
|
114
|
+
* Chain Related, Basic Extension, Name Related, Usage and Policy, Formatting) — rather than the
|
|
115
|
+
* handful a reader happens to have seen. Completeness is the point: a code missing from this set
|
|
116
|
+
* falls through to {@link isRetryableError}, whose last rule retries ANY `TypeError` mentioning
|
|
117
|
+
* `fetch`, and Node's `fetch()` spells every one of these as exactly that. One omission therefore
|
|
118
|
+
* does not degrade gracefully — it polls a revoked certificate until the deadline and reports a
|
|
119
|
+
* timeout instead of the cause, which is the bug this classification exists to prevent.
|
|
120
|
+
*
|
|
121
|
+
* The one code in that doc section deliberately LEFT OUT is `OUT_OF_MEM`, which lives there because
|
|
122
|
+
* OpenSSL can raise it during verification but describes a resource shortage, not a verdict on the
|
|
123
|
+
* certificate — the only member of the section that can read differently on a later attempt.
|
|
124
|
+
*
|
|
125
|
+
* `ERR_TLS_CERT_ALTNAME_INVALID` is Node's own (it checks the hostname against the certificate's
|
|
126
|
+
* subjectAltNames itself, outside OpenSSL's verifier) and is the same kind of deterministic fact.
|
|
127
|
+
*
|
|
128
|
+
* Also included, and NOT from that doc page: the fatal TLS certificate alerts a PEER sends when it
|
|
129
|
+
* rejects OUR certificate — the mTLS direction a kubeconfig client cert takes. OpenSSL surfaces an
|
|
130
|
+
* incoming alert as its reason string, which Node exposes as `ERR_SSL_` + the uppercased reason, so
|
|
131
|
+
* a server that rejects a stale kubeconfig certificate arrives as `ERR_SSL_TLSV1_ALERT_UNKNOWN_CA`
|
|
132
|
+
* rather than any `CERT_*` code. The alert names are those of RFC 5246 §7.2.2 / RFC 8446 §6.2, and
|
|
133
|
+
* each listed one is a verdict on a certificate that will be reached identically next time.
|
|
134
|
+
*
|
|
135
|
+
* @internal Exported only so the unit tests can assert the membership itself — the prefix fallback
|
|
136
|
+
* in {@link isTlsConfigurationCode} would otherwise let a code silently drop out of this list
|
|
137
|
+
* without a single test noticing. Not re-exported from the package index.
|
|
138
|
+
*/
|
|
139
|
+
export const TLS_CERTIFICATE_CODES = new Set([
|
|
140
|
+
// --- Node, "OpenSSL error codes": Time Validity Errors -----------------------
|
|
141
|
+
'CERT_NOT_YET_VALID',
|
|
142
|
+
'CERT_HAS_EXPIRED',
|
|
143
|
+
'CRL_NOT_YET_VALID',
|
|
144
|
+
'CRL_HAS_EXPIRED',
|
|
145
|
+
'CERT_REVOKED',
|
|
146
|
+
// --- Trust or Chain Related Errors -------------------------------------------
|
|
147
|
+
'UNABLE_TO_GET_ISSUER_CERT',
|
|
148
|
+
'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
|
|
149
|
+
'DEPTH_ZERO_SELF_SIGNED_CERT',
|
|
150
|
+
'SELF_SIGNED_CERT_IN_CHAIN',
|
|
151
|
+
'CERT_CHAIN_TOO_LONG',
|
|
152
|
+
'UNABLE_TO_GET_CRL',
|
|
153
|
+
'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
|
|
154
|
+
'CERT_UNTRUSTED',
|
|
155
|
+
// --- Basic Extension Errors ---------------------------------------------------
|
|
156
|
+
'INVALID_CA',
|
|
157
|
+
'PATH_LENGTH_EXCEEDED',
|
|
158
|
+
// --- Name Related Errors ------------------------------------------------------
|
|
159
|
+
'HOSTNAME_MISMATCH',
|
|
160
|
+
// --- Usage and Policy Errors --------------------------------------------------
|
|
161
|
+
'INVALID_PURPOSE',
|
|
162
|
+
'CERT_REJECTED',
|
|
163
|
+
// --- Formatting Errors --------------------------------------------------------
|
|
164
|
+
'CERT_SIGNATURE_FAILURE',
|
|
165
|
+
'CRL_SIGNATURE_FAILURE',
|
|
166
|
+
'ERROR_IN_CERT_NOT_BEFORE_FIELD',
|
|
167
|
+
'ERROR_IN_CERT_NOT_AFTER_FIELD',
|
|
168
|
+
'ERROR_IN_CRL_LAST_UPDATE_FIELD',
|
|
169
|
+
'ERROR_IN_CRL_NEXT_UPDATE_FIELD',
|
|
170
|
+
'UNABLE_TO_DECRYPT_CERT_SIGNATURE',
|
|
171
|
+
'UNABLE_TO_DECRYPT_CRL_SIGNATURE',
|
|
172
|
+
'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY',
|
|
173
|
+
// (`OUT_OF_MEM` is the one member of that section NOT listed — see the note above.)
|
|
174
|
+
// --- Node's own hostname check ------------------------------------------------
|
|
175
|
+
'ERR_TLS_CERT_ALTNAME_INVALID',
|
|
176
|
+
// --- Fatal certificate alerts received FROM the peer (our client cert refused) --
|
|
177
|
+
'ERR_SSL_SSLV3_ALERT_BAD_CERTIFICATE',
|
|
178
|
+
'ERR_SSL_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE',
|
|
179
|
+
'ERR_SSL_SSLV3_ALERT_CERTIFICATE_REVOKED',
|
|
180
|
+
'ERR_SSL_SSLV3_ALERT_CERTIFICATE_EXPIRED',
|
|
181
|
+
'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN',
|
|
182
|
+
'ERR_SSL_TLSV1_ALERT_UNKNOWN_CA',
|
|
183
|
+
'ERR_SSL_TLSV13_ALERT_CERTIFICATE_REQUIRED',
|
|
184
|
+
]);
|
|
185
|
+
/**
|
|
186
|
+
* Handshake failures that are not about a certificate: the two ends cannot agree on a protocol.
|
|
187
|
+
*
|
|
188
|
+
* Every member is a persistent mismatch between two configurations, so each is listed with the
|
|
189
|
+
* reason it qualifies rather than swept in by an `ERR_SSL_*` prefix — most `ERR_SSL_*` codes are
|
|
190
|
+
* pass-throughs of arbitrary OpenSSL reasons, and some (an allocation failure, a decrypt error on a
|
|
191
|
+
* corrupted record) genuinely can differ on the next attempt.
|
|
192
|
+
*
|
|
193
|
+
* - `EPROTO` — libuv's errno for a handshake OpenSSL aborted. The two ends could not complete a
|
|
194
|
+
* handshake at all; nothing about asking again changes what they support.
|
|
195
|
+
* - `ERR_SSL_WRONG_VERSION_NUMBER` — the bytes on the wire are not a TLS record. Classically an
|
|
196
|
+
* `https://` URL pointing at a plain-HTTP listener: an address/scheme fact, fixed in config.
|
|
197
|
+
* - `ERR_SSL_UNKNOWN_PROTOCOL` — the same situation as reported by OpenSSL's older reason string.
|
|
198
|
+
* - `ERR_SSL_UNSUPPORTED_PROTOCOL` — the peer's protocol version is not enabled on this side.
|
|
199
|
+
* - `ERR_SSL_VERSION_TOO_LOW` / `ERR_SSL_VERSION_TOO_HIGH` — the version the peer offers falls
|
|
200
|
+
* outside this side's configured `minVersion`/`maxVersion` window.
|
|
201
|
+
* - `ERR_SSL_NO_PROTOCOLS_AVAILABLE` — this side's own TLS context has every version disabled, a
|
|
202
|
+
* purely local configuration error that cannot resolve itself.
|
|
203
|
+
* - `ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION` — the peer's fatal alert (RFC 5246 §7.2.2) stating that
|
|
204
|
+
* the version we offered is unacceptable to it.
|
|
205
|
+
*
|
|
206
|
+
* Note what is NOT here: generic handshake alerts such as `ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE`,
|
|
207
|
+
* which OpenSSL emits for several unrelated conditions and which therefore cannot be called a
|
|
208
|
+
* persistent mismatch on the strength of the code alone.
|
|
209
|
+
*
|
|
210
|
+
* @internal Exported for the same reason as {@link TLS_CERTIFICATE_CODES}.
|
|
211
|
+
*/
|
|
212
|
+
export const TLS_PROTOCOL_CONFIGURATION_CODES = new Set([
|
|
213
|
+
'EPROTO',
|
|
214
|
+
'ERR_SSL_WRONG_VERSION_NUMBER',
|
|
215
|
+
'ERR_SSL_UNKNOWN_PROTOCOL',
|
|
216
|
+
'ERR_SSL_UNSUPPORTED_PROTOCOL',
|
|
217
|
+
'ERR_SSL_VERSION_TOO_LOW',
|
|
218
|
+
'ERR_SSL_VERSION_TOO_HIGH',
|
|
219
|
+
'ERR_SSL_NO_PROTOCOLS_AVAILABLE',
|
|
220
|
+
'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION',
|
|
221
|
+
]);
|
|
222
|
+
/**
|
|
223
|
+
* Whether a transport `code` names a TLS failure that will recur identically on every attempt.
|
|
224
|
+
*
|
|
225
|
+
* The union of {@link TLS_CERTIFICATE_CODES} and {@link TLS_PROTOCOL_CONFIGURATION_CODES}, plus one
|
|
226
|
+
* deliberate catch-all: an UNRECOGNISED code beginning `CERT_` is also treated as a certificate
|
|
227
|
+
* verdict. Every `CERT_*` code OpenSSL defines is a verification result — a statement about the
|
|
228
|
+
* certificate presented, not about the network — so a code this list has not caught up with (a
|
|
229
|
+
* newer OpenSSL, a reason Node has not documented) is far better failed fast and named in the
|
|
230
|
+
* message than polled for a 25-minute budget and then reported as a timeout. The explicit list is
|
|
231
|
+
* kept rather than replaced by the prefix, both because most of the codes above do not start with
|
|
232
|
+
* `CERT_` and so the prefix could never stand alone, and so the tests keep asserting the real
|
|
233
|
+
* membership instead of a pattern that would pass for any invented string.
|
|
234
|
+
*/
|
|
235
|
+
function isTlsConfigurationCode(code) {
|
|
236
|
+
return (TLS_CERTIFICATE_CODES.has(code) ||
|
|
237
|
+
TLS_PROTOCOL_CONFIGURATION_CODES.has(code) ||
|
|
238
|
+
code.startsWith('CERT_') ||
|
|
239
|
+
// Node's own `ERR_TLS_*` family (https://nodejs.org/api/errors.html) is configuration, security-state
|
|
240
|
+
// and programming errors: `ERR_TLS_DH_PARAM_SIZE` (the peer offered too small a Diffie-Hellman
|
|
241
|
+
// parameter), `ERR_TLS_INVALID_PROTOCOL_VERSION`, `ERR_TLS_PROTOCOL_VERSION_CONFLICT`,
|
|
242
|
+
// `ERR_TLS_INVALID_CONTEXT`, renegotiation policy, … — none of which a retry a second later can
|
|
243
|
+
// change. The one member that IS a passing condition, `ERR_TLS_HANDSHAKE_TIMEOUT`, is carved out
|
|
244
|
+
// by the caller before this predicate runs.
|
|
245
|
+
(code.startsWith('ERR_TLS_') && code !== TLS_HANDSHAKE_TIMEOUT_CODE));
|
|
246
|
+
}
|
|
247
|
+
/** Node's one transient `ERR_TLS_*` code: the handshake did not finish in time — ask again. */
|
|
248
|
+
const TLS_HANDSHAKE_TIMEOUT_CODE = 'ERR_TLS_HANDSHAKE_TIMEOUT';
|
|
249
|
+
/**
|
|
250
|
+
* The transport `code`, following one level of `cause`.
|
|
251
|
+
*
|
|
252
|
+
* Node's `fetch()` — what the 1.x client uses — reports every transport failure as the same opaque
|
|
253
|
+
* `TypeError: fetch failed` and hangs the real error off `cause`. Reading only the top-level `code`
|
|
254
|
+
* therefore sees nothing at all on the shape that matters most, and the failure falls through to
|
|
255
|
+
* the message sniff in {@link isRetryableError}, which retries any `TypeError` mentioning `fetch`.
|
|
256
|
+
*/
|
|
257
|
+
function transportErrorCode(error) {
|
|
258
|
+
const own = systemErrorCode(error);
|
|
259
|
+
if (own)
|
|
260
|
+
return own;
|
|
261
|
+
if (!error || typeof error !== 'object')
|
|
262
|
+
return undefined;
|
|
263
|
+
return systemErrorCode(error.cause);
|
|
264
|
+
}
|
|
87
265
|
/**
|
|
88
266
|
* Classify why a read against the API server failed.
|
|
89
267
|
*
|
|
90
268
|
* Deliberately conservative: anything not positively recognised is `other`,
|
|
91
269
|
* which callers treat the same as `unreachable` — "we did not learn the answer"
|
|
92
270
|
* — rather than as a negative answer.
|
|
271
|
+
*
|
|
272
|
+
* Ordered on the same invariant as {@link classifyReadError}: an HTTP status means the server
|
|
273
|
+
* ANSWERED, so it outranks every transport heuristic below it. That matters more here than
|
|
274
|
+
* anywhere, because this taxonomy's whole subject is whether the server was reached: calling a
|
|
275
|
+
* 422 that happens to carry a stale `ECONNRESET` code `unreachable` would state, in a log line
|
|
276
|
+
* about the cluster, the opposite of what the status proves. A status the list below does not
|
|
277
|
+
* name is `other` — the server answered, just not in a way this taxonomy has a word for.
|
|
93
278
|
*/
|
|
94
279
|
export function classifyApiReadError(error) {
|
|
95
280
|
if (isNotFoundError(error))
|
|
96
281
|
return 'notFound';
|
|
97
282
|
const status = apiErrorStatus(error);
|
|
98
|
-
if (status
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
283
|
+
if (status !== undefined) {
|
|
284
|
+
if (status === 401 || status === 403)
|
|
285
|
+
return 'forbidden';
|
|
286
|
+
if (status === 408 || status === 504)
|
|
287
|
+
return 'timeout';
|
|
288
|
+
return 'other';
|
|
289
|
+
}
|
|
102
290
|
const code = systemErrorCode(error);
|
|
103
291
|
if (code && TIMEOUT_CODES.has(code))
|
|
104
292
|
return 'timeout';
|
|
@@ -154,6 +342,7 @@ const READ_ERROR_SUMMARIES = {
|
|
|
154
342
|
'unknown-resource-type': 'unknown resource type',
|
|
155
343
|
'permission-denied': 'permission denied',
|
|
156
344
|
'invalid-request': 'invalid request',
|
|
345
|
+
'tls-configuration-error': 'TLS configuration error',
|
|
157
346
|
'not-a-kubernetes-error': 'not a Kubernetes API error',
|
|
158
347
|
};
|
|
159
348
|
const RETRYABLE_READ_CLASSIFICATIONS = new Set(['object-not-found', 'transient']);
|
|
@@ -191,41 +380,133 @@ function isUnknownResourceTypeError(error, statusCode) {
|
|
|
191
380
|
!details.name &&
|
|
192
381
|
!details.kind);
|
|
193
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* The classification, split at the one question that orders everything else: did the API server
|
|
385
|
+
* ANSWER?
|
|
386
|
+
*
|
|
387
|
+
* An HTTP status is proof that it did — the request reached the server, the server formed a
|
|
388
|
+
* verdict, and it sent one back. That verdict therefore OUTRANKS every piece of evidence that the
|
|
389
|
+
* transport failed, because a transport that failed could not have carried a status. The two kinds
|
|
390
|
+
* of evidence do co-occur: a client can attach a system `code` to a status-bearing error (a socket
|
|
391
|
+
* reset while draining an error body, a `code` copied from an earlier attempt), and Node's
|
|
392
|
+
* `fetch()` spells its failures as a `TypeError` whose message `isRetryableError` sniffs for the
|
|
393
|
+
* word `fetch` — which a status-bearing `TypeError` matches just as well. Deciding on the transport
|
|
394
|
+
* evidence first therefore turned a 422 into `transient` and polled a request the server had
|
|
395
|
+
* already rejected until the readiness budget expired.
|
|
396
|
+
*
|
|
397
|
+
* So: while a status exists, only the status is consulted, and no message or `code` heuristic runs
|
|
398
|
+
* at all. Only once there is no status does the "the request never produced an HTTP response"
|
|
399
|
+
* ladder below run — TLS verdict, this repo's own request-timeout types, Node's socket/DNS codes,
|
|
400
|
+
* then the shared retryable predicate's message sniffs.
|
|
401
|
+
*/
|
|
194
402
|
function classifyReadErrorKind(error, statusCode) {
|
|
403
|
+
// First regardless: the API resource itself not being served is recognised both from a 404 whose
|
|
404
|
+
// Status body names no object and, with no status at all, from the client's own discovery miss.
|
|
195
405
|
if (isUnknownResourceTypeError(error, statusCode))
|
|
196
406
|
return 'unknown-resource-type';
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
407
|
+
// ---- The server answered. Its answer decides, and nothing else is consulted. ----
|
|
408
|
+
if (statusCode !== undefined) {
|
|
409
|
+
if (statusCode === 401 || statusCode === 403)
|
|
410
|
+
return 'permission-denied';
|
|
411
|
+
if (statusCode === 404)
|
|
412
|
+
return 'object-not-found';
|
|
413
|
+
if (RETRYABLE_STATUS_CODES.has(statusCode))
|
|
414
|
+
return 'transient';
|
|
415
|
+
if (statusCode >= 400 && statusCode < 500)
|
|
416
|
+
return 'invalid-request';
|
|
417
|
+
// Any other status the server produced — a 5xx outside the retryable list, or anything the
|
|
418
|
+
// client turned into an error without a 4xx/5xx code. The server is up and talking, so the
|
|
419
|
+
// conservative reading is "ask again", not "this is permanently broken".
|
|
420
|
+
return 'transient';
|
|
421
|
+
}
|
|
422
|
+
// ---- No status: the request never produced an HTTP response. ----
|
|
423
|
+
// The transport `code` is read BEFORE `isRetryableError`, and a permanent TLS failure is
|
|
424
|
+
// recognised before any retryable shape, because that predicate's last resort is a message sniff:
|
|
425
|
+
// it retries ANY `TypeError` whose message mentions `fetch`. Node's `fetch()` reports a rejected
|
|
426
|
+
// server certificate as exactly that — `TypeError: fetch failed` with the real code on `cause` —
|
|
427
|
+
// so consulting the code first is the whole of what keeps a misconfigured CA bundle out of the
|
|
428
|
+
// retry loop instead of burning the readiness budget on it.
|
|
429
|
+
const transportCode = transportErrorCode(error);
|
|
430
|
+
// A handshake that merely ran out of time is the one TLS-namespaced failure that is transient.
|
|
431
|
+
if (transportCode === TLS_HANDSHAKE_TIMEOUT_CODE) {
|
|
432
|
+
return 'transient';
|
|
433
|
+
}
|
|
434
|
+
if (transportCode && isTlsConfigurationCode(transportCode)) {
|
|
435
|
+
return 'tls-configuration-error';
|
|
436
|
+
}
|
|
437
|
+
// The two "the request never got an answer" shapes `isRetryableError` does not recognise, both of
|
|
438
|
+
// which are as transient as the 408 it does recognise — ask again and the server may well answer:
|
|
439
|
+
// 1. This repo's own timing layers. A bare `RequestTimeoutError` (the Bun HTTP library's socket
|
|
440
|
+
// timer) and its subclasses `PollTimeoutError` / `PrematureCloseError` carry no HTTP status,
|
|
441
|
+
// so without this they land in `not-a-kubernetes-error` and a retry loop gives up on a blip.
|
|
442
|
+
// 2. Node's socket/DNS `code`s. `isRetryableError` only sniffs MESSAGES, so `ECONNRESET` whose
|
|
443
|
+
// message is the bare `read ECONNRESET` is missed.
|
|
444
|
+
if (isRequestTimeoutError(error))
|
|
445
|
+
return 'transient';
|
|
446
|
+
if (transportCode && RETRYABLE_SYSTEM_CODES.has(transportCode))
|
|
447
|
+
return 'transient';
|
|
448
|
+
// Connection resets, DNS failures and fetch-level TypeErrors, recognised by message.
|
|
202
449
|
if (isRetryableError(error))
|
|
203
450
|
return 'transient';
|
|
204
|
-
|
|
205
|
-
return 'not-a-kubernetes-error';
|
|
206
|
-
if (statusCode >= 400 && statusCode < 500)
|
|
207
|
-
return 'invalid-request';
|
|
208
|
-
return 'transient';
|
|
451
|
+
return 'not-a-kubernetes-error';
|
|
209
452
|
}
|
|
210
453
|
/**
|
|
211
454
|
* Classify a failed Kubernetes read as worth retrying or permanently broken.
|
|
212
455
|
*
|
|
213
456
|
* Built on the shared predicates in `../kubernetes/errors.js` — {@link getErrorStatusCode} for the
|
|
214
457
|
* status across every client-version error shape, and {@link isRetryableError} for the transient
|
|
215
|
-
* set — so this adds a retry policy rather than a second error taxonomy.
|
|
458
|
+
* set — so this adds a retry policy rather than a second error taxonomy. It additionally recognises
|
|
459
|
+
* the transport shapes those predicates miss: {@link isRequestTimeoutError} and Node's socket/DNS
|
|
460
|
+
* `code`s make "the request never got an answer" `transient` however it was spelled, while a TLS
|
|
461
|
+
* trust/protocol `code` — including one buried in a `fetch failed` `cause` — is separated out as
|
|
462
|
+
* the permanent misconfiguration it is.
|
|
463
|
+
*
|
|
464
|
+
* Shared with the engine's external-reference resolver, whose policy is that a permanent failure
|
|
465
|
+
* fails immediately, so a classification is only `retryable` when asking again could plausibly
|
|
466
|
+
* succeed with nothing else changing.
|
|
216
467
|
*/
|
|
217
468
|
export function classifyReadError(error) {
|
|
218
469
|
const statusCode = getErrorStatusCode(error);
|
|
219
470
|
const classification = classifyReadErrorKind(error, statusCode);
|
|
220
471
|
const label = READ_ERROR_SUMMARIES[classification];
|
|
472
|
+
const detail = describeReadError(error);
|
|
473
|
+
// `TypeError: fetch failed` says nothing an operator can act on, so a TLS failure names the code
|
|
474
|
+
// and what to look at. Everything else already carries its own message.
|
|
475
|
+
const tlsCode = classification === 'tls-configuration-error' ? transportErrorCode(error) : undefined;
|
|
221
476
|
return {
|
|
222
477
|
classification,
|
|
223
478
|
retryable: RETRYABLE_READ_CLASSIFICATIONS.has(classification),
|
|
224
479
|
summary: statusCode === undefined ? label : `${label} (HTTP ${statusCode})`,
|
|
225
|
-
detail:
|
|
480
|
+
detail: tlsCode ? `${detail} (${tlsCode}: ${tlsDiagnosticHint(tlsCode)})` : detail,
|
|
226
481
|
statusCode,
|
|
227
482
|
};
|
|
228
483
|
}
|
|
484
|
+
/**
|
|
485
|
+
* Where to send the operator for a given TLS failure code.
|
|
486
|
+
*
|
|
487
|
+
* The three groups {@link isTlsConfigurationCode} accepts fail for different reasons and are fixed
|
|
488
|
+
* in different places, so each gets its own hint rather than one catch-all:
|
|
489
|
+
*
|
|
490
|
+
* - A certificate VERDICT — a member of {@link TLS_CERTIFICATE_CODES}, or an unrecognised `CERT_`
|
|
491
|
+
* code — is about the trust material: the CA bundle in the kubeconfig, or the certificate the
|
|
492
|
+
* API server presents.
|
|
493
|
+
* - A PROTOCOL mismatch — a member of {@link TLS_PROTOCOL_CONFIGURATION_CODES} — is about what is
|
|
494
|
+
* at the other end of the address and which TLS versions each side allows.
|
|
495
|
+
* - Anything else here reached the classification through the generic `ERR_TLS_` prefix rule:
|
|
496
|
+
* `ERR_TLS_DH_PARAM_SIZE`, `ERR_TLS_INVALID_CONTEXT`, `ERR_TLS_PROTOCOL_VERSION_CONFLICT` and
|
|
497
|
+
* the rest of Node's own namespace. These say nothing about a certificate, so pointing at the CA
|
|
498
|
+
* bundle would send the operator to the one thing that is not wrong; the honest hint is the TLS
|
|
499
|
+
* configuration on either side, which is what those codes actually describe.
|
|
500
|
+
*/
|
|
501
|
+
function tlsDiagnosticHint(code) {
|
|
502
|
+
if (TLS_CERTIFICATE_CODES.has(code) || code.startsWith('CERT_')) {
|
|
503
|
+
return 'check the cluster CA / server certificate';
|
|
504
|
+
}
|
|
505
|
+
if (TLS_PROTOCOL_CONFIGURATION_CODES.has(code)) {
|
|
506
|
+
return 'check the server URL scheme / port and the TLS version settings';
|
|
507
|
+
}
|
|
508
|
+
return 'check the client/server TLS configuration';
|
|
509
|
+
}
|
|
229
510
|
/**
|
|
230
511
|
* Best available human-readable description of a read failure.
|
|
231
512
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"k8s-helpers.js","sourceRoot":"","sources":["../../../src/core/deployment/k8s-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,MAAM,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,yEAAyE;QACzE,yEAAyE;QACzE,2EAA2E;QAC3E,2EAA2E;QAC3E,2EAA2E;QAC3E,0EAA0E;QAC1E,MAAM,QAAQ,GAAG,KAA+C,CAAC;QACjE,OAAO,CACL,QAAQ,CAAC,UAAU,KAAK,GAAG;YAC3B,QAAQ,CAAC,QAAQ,EAAE,UAAU,KAAK,GAAG;YACrC,QAAQ,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG;YAC3B,QAAQ,CAAC,IAAI,KAAK,GAAG;YACrB,QAAQ,CAAC,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G,QAAQ,CAAC,QAAQ,EAAE,UAAU,IAAI,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;QAE7F,IACE,eAAe;YACf,gBAAgB;YAChB,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,EAC7D,CAAC;YACD,OAAO;gBACL,GAAG,QAAQ;gBACX,MAAM,EAAE;oBACN,GAAG,QAAQ,CAAC,MAAM;oBAClB,UAAU,EAAE;wBACV,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,IAAI,EAAE,CAAC;wBACtC;4BACE,IAAI,EAAE,OAAO;4BACb,MAAM,EAAE,MAAM;4BACd,OAAO,EAAE,8BAA8B;4BACvC,MAAM,EAAE,wBAAwB;yBACjC;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import type { KubeConfig, KubernetesObject } from '@kubernetes/client-node';
|
|
2
2
|
import { createBunCompatibleKubernetesObjectApi } from '../kubernetes/index.js';
|
|
3
|
+
import { type CallDeadlineBudget } from './poll-timeout.js';
|
|
3
4
|
type MigrationApi = Pick<ReturnType<typeof createBunCompatibleKubernetesObjectApi>, 'read' | 'list' | 'replace'>;
|
|
5
|
+
/**
|
|
6
|
+
* Injectable seams shared by both cluster operations in this module.
|
|
7
|
+
*
|
|
8
|
+
* `requestBudget` / `abortSignal` bound every request the operation issues. Without a bound, a
|
|
9
|
+
* wedged Kubernetes call here never settles: the caller (the Alchemy reconcile handler) then never
|
|
10
|
+
* returns and never throws, emits no further log line, and the converge only dies on its outer
|
|
11
|
+
* timeout. See {@link withCallDeadline}.
|
|
12
|
+
*/
|
|
13
|
+
interface MigrationDependencies {
|
|
14
|
+
readonly api?: MigrationApi;
|
|
15
|
+
/** Per-verb request budget. Defaults to the repo's HTTP read/write/delete timeouts. */
|
|
16
|
+
readonly requestBudget?: CallDeadlineBudget;
|
|
17
|
+
readonly abortSignal?: AbortSignal;
|
|
18
|
+
}
|
|
4
19
|
/**
|
|
5
20
|
* Repairs KRO's retained-CRD adoption edge after an RGD is recreated.
|
|
6
21
|
*
|
|
@@ -11,9 +26,7 @@ type MigrationApi = Pick<ReturnType<typeof createBunCompatibleKubernetesObjectAp
|
|
|
11
26
|
* finalizer indefinitely. TypeKro deliberately retains generated CRDs for safe
|
|
12
27
|
* reuse, so it must close that adoption gap until KRO does so itself.
|
|
13
28
|
*/
|
|
14
|
-
export declare function repairRetainedKroGeneratedCrdOwnership(kubeConfig: KubeConfig, desiredResource: KubernetesObject, dependencies?:
|
|
15
|
-
readonly api?: MigrationApi;
|
|
16
|
-
}): Promise<void>;
|
|
29
|
+
export declare function repairRetainedKroGeneratedCrdOwnership(kubeConfig: KubeConfig, desiredResource: KubernetesObject, dependencies?: MigrationDependencies): Promise<void>;
|
|
17
30
|
/**
|
|
18
31
|
* Broadens the generated CRD's released v0.32 artifact-binding schema before
|
|
19
32
|
* KRO sees the topology-independent RGD. KRO rejects a direct fixed-object →
|
|
@@ -21,8 +34,6 @@ export declare function repairRetainedKroGeneratedCrdOwnership(kubeConfig: KubeC
|
|
|
21
34
|
* valid under the map. Updating the CRD first is non-destructive: it only
|
|
22
35
|
* broadens validation and preserves the persisted nested key/value shape.
|
|
23
36
|
*/
|
|
24
|
-
export declare function migrateLegacyKroArtifactBindingCrd(kubeConfig: KubeConfig, desiredResource: KubernetesObject, dependencies?:
|
|
25
|
-
readonly api?: MigrationApi;
|
|
26
|
-
}): Promise<void>;
|
|
37
|
+
export declare function migrateLegacyKroArtifactBindingCrd(kubeConfig: KubeConfig, desiredResource: KubernetesObject, dependencies?: MigrationDependencies): Promise<void>;
|
|
27
38
|
export {};
|
|
28
39
|
//# sourceMappingURL=kro-artifact-binding-migration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kro-artifact-binding-migration.d.ts","sourceRoot":"","sources":["../../../src/core/deployment/kro-artifact-binding-migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,EACL,sCAAsC,EAEvC,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"kro-artifact-binding-migration.d.ts","sourceRoot":"","sources":["../../../src/core/deployment/kro-artifact-binding-migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,EACL,sCAAsC,EAEvC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,kBAAkB,EAAwC,MAAM,mBAAmB,CAAC;AAOlG,KAAK,YAAY,GAAG,IAAI,CACtB,UAAU,CAAC,OAAO,sCAAsC,CAAC,EACzD,MAAM,GAAG,MAAM,GAAG,SAAS,CAC5B,CAAC;AAEF;;;;;;;GAOG;AACH,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC;IAC5B,uFAAuF;IACvF,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAC5C,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;CACpC;AAkOD;;;;;;;;;GASG;AACH,wBAAsB,sCAAsC,CAC1D,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,gBAAgB,EACjC,YAAY,GAAE,qBAA0B,GACvC,OAAO,CAAC,IAAI,CAAC,CAmEf;AAED;;;;;;GAMG;AACH,wBAAsB,kCAAkC,CACtD,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,gBAAgB,EACjC,YAAY,GAAE,qBAA0B,GACvC,OAAO,CAAC,IAAI,CAAC,CA4Gf"}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { ensureError } from '../errors.js';
|
|
2
2
|
import { createBunCompatibleKubernetesObjectApi, getErrorStatusCode, } from '../kubernetes/index.js';
|
|
3
3
|
import { KRO_ARTIFACT_BINDINGS_SPEC_FIELD } from '../planning/values.js';
|
|
4
|
+
import { callDeadlineBudget, withCallDeadline } from './poll-timeout.js';
|
|
4
5
|
const STABLE_BINDING_SCHEMA = 'map[string]map[string]string';
|
|
5
6
|
const MAX_CRD_PATCH_ATTEMPTS = 5;
|
|
6
7
|
const KRO_OWNED_LABEL = 'kro.run/owned';
|
|
7
8
|
const KRO_RGD_ID_LABEL = 'kro.run/resource-graph-definition-id';
|
|
8
9
|
const KRO_RGD_NAME_LABEL = 'kro.run/resource-graph-definition-name';
|
|
10
|
+
/**
|
|
11
|
+
* The bounded client for one RGD operation: the caller's injected API or a fresh one, wrapped so
|
|
12
|
+
* every request rejects — naming the ResourceGraphDefinition — instead of hanging forever. The
|
|
13
|
+
* injected API is wrapped too: a test that supplies a wedged client must see the bound, not a hang.
|
|
14
|
+
*/
|
|
15
|
+
function migrationApi(kubeConfig, rgdName, reason, dependencies) {
|
|
16
|
+
const api = dependencies.api ?? createBunCompatibleKubernetesObjectApi(kubeConfig);
|
|
17
|
+
return withCallDeadline(api, {
|
|
18
|
+
budget: dependencies.requestBudget ?? callDeadlineBudget(undefined),
|
|
19
|
+
label: `ResourceGraphDefinition ${rgdName} (${reason})`,
|
|
20
|
+
...(dependencies.abortSignal ? { abortSignal: dependencies.abortSignal } : {}),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
9
23
|
async function findGeneratedCrd(api, group, kind) {
|
|
10
24
|
const listed = (await api.list('apiextensions.k8s.io/v1', 'CustomResourceDefinition'));
|
|
11
25
|
return listed.items?.find((candidate) => candidate.spec?.group === group && candidate.spec?.names?.kind === kind);
|
|
@@ -148,7 +162,7 @@ export async function repairRetainedKroGeneratedCrdOwnership(kubeConfig, desired
|
|
|
148
162
|
const kind = desiredRgd.spec?.schema?.kind;
|
|
149
163
|
if (!rgdName || !apiVersion || !kind)
|
|
150
164
|
return;
|
|
151
|
-
const api =
|
|
165
|
+
const api = migrationApi(kubeConfig, rgdName, 'retained-crd-adoption', dependencies);
|
|
152
166
|
const liveRgd = (await api.read({
|
|
153
167
|
apiVersion: 'kro.run/v1alpha1',
|
|
154
168
|
kind: 'ResourceGraphDefinition',
|
|
@@ -216,7 +230,7 @@ export async function migrateLegacyKroArtifactBindingCrd(kubeConfig, desiredReso
|
|
|
216
230
|
const kind = desiredRgd.spec.schema.kind;
|
|
217
231
|
if (!rgdName || !apiVersion || !kind)
|
|
218
232
|
return;
|
|
219
|
-
const api =
|
|
233
|
+
const api = migrationApi(kubeConfig, rgdName, 'artifact-binding-migration', dependencies);
|
|
220
234
|
let liveRgd;
|
|
221
235
|
try {
|
|
222
236
|
liveRgd = (await api.read({
|