Skip to content

Commit 6dffa08

Browse files
authored
v0.7.0: update client dependency + all APIs (#24)
* v0.7.0: update client dependency + all APIs * Update tunnel clients for newer client library New API changes the tunnel stream setup process to avoid awaiting each new tunnel and focus on WebSocket-based transports. SPDY metadata is still in place but there are currently no SPDY client transports offered, with hopes that Kubernetes will improve its offering for PodPortForward over WebSocket and we can stop talking about SPDY. * Flesh out lifecycle management of tunnel client Since tunnel setup is more synchronous, we are actually establishing the streams before the WebSocket handshake completes (because if we wait, we'll receive the initial packets before we have destinations for them) So things like conditional behavior off the handshaked protocol version must be done lazily, while port forward setup must be done immediately for websockets (and only websockets). Not really looking forward to reconciling this code for whenever Kubernetes introduces a better way to do port forwards over WebSocket.
1 parent af6f28b commit 6dffa08

File tree

15 files changed

+302
-166
lines changed

15 files changed

+302
-166
lines changed

.devcontainer/devcontainer.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
3+
{
4+
"name": "Debian",
5+
"image": "mcr.microsoft.com/devcontainers/base:bookworm",
6+
"features": {
7+
"ghcr.io/prulloac/devcontainer-features/deno:1": {},
8+
"ghcr.io/devcontainers/features/git-lfs:1": {},
9+
"ghcr.io/devcontainers-extra/features/fish-apt-get:1": {}
10+
},
11+
"customizations": {
12+
"vscode": {
13+
"extensions": [
14+
"denoland.vscode-deno"
15+
],
16+
"settings": {
17+
"deno.enable": true
18+
}
19+
}
20+
}
21+
}

deno.lock

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generation/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"imports": {
3-
"@cloudydeno/kubernetes-client": "jsr:@cloudydeno/kubernetes-client@^0.7",
3+
"@cloudydeno/kubernetes-client": "jsr:@cloudydeno/kubernetes-client@^0.8",
44
"@std/path": "jsr:@std/path@^1",
55
"@std/yaml": "jsr:@std/yaml@^1"
66
}

generation/generate-all.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
#!/bin/sh -eux
22

33
# https://github.com/kubernetes/kubernetes/releases
4-
./generation/sources/builtin.sh v1.34.1
4+
./generation/sources/builtin.sh v1.34.2
55

66
# https://github.com/argoproj/argo-cd/releases
7-
./generation/sources/argo-cd.sh v3.1.6
7+
./generation/sources/argo-cd.sh v3.2.1
88

99
# https://github.com/cert-manager/cert-manager/releases
10-
./generation/sources/cert-manager.sh v1.18.2
10+
./generation/sources/cert-manager.sh v1.19.1
1111

1212
# https://github.com/kubernetes-sigs/external-dns/releases
13-
./generation/sources/external-dns.sh v0.19.0
13+
./generation/sources/external-dns.sh v0.20.0
1414

1515
# https://github.com/fluxcd/flux2/releases
1616
#./generation/sources/flux-cd.sh v2.6.4
1717

1818
# https://github.com/kubernetes/autoscaler/releases?q=vertical
19-
./generation/sources/vpa.sh 1.4.1
19+
./generation/sources/vpa.sh 1.5.1

generation/sources/cert-manager.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ then {
1111
echo 'mkdir '"$specdir"
1212
echo 'cd '"$specdir"
1313
wget -O - "$gitapi/repos/$upstream/contents/$crdpath?ref=$1" \
14-
| jq -r '.[] | select(.name | startswith("crd-")) | "wget \(.download_url)"'
14+
| jq -r '.[] | select(.name | endswith(".yaml")) | "wget \(.download_url)"'
1515
} | sh -eux
1616
fi
1717

lib/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ for more information.
4444

4545
## Changelog
4646

47+
* `v0.7.0` on `2025-12-04`:
48+
* Update `@cloudydeno/kubernetes-client` dependency to latest (`v0.8.0`)
49+
* Breaking Change! Because tunnels were reimplemented, the client's type signature
50+
changed and aren't compatible between `v0.7` and `v0.8`.
51+
In this case you must update these libraries together for Typescript to be happy.
52+
* Tunnel APIs (Pod Exec, Attach, PortForward) now work normally when using Deno 2.5.2 or later.
53+
* Because the new client uses WebSockets instead of SPDY, PortForward has increased setup latency when tunnelling multiple sockets.
54+
* Regenerate APIs from latest upstream CRDs.
55+
* Only includes a couple new fields in `argo-cd` and `cert-manager` CRDs.
56+
4757
* `v0.6.0` on `2025-09-20`:
4858
* Includes 'builtin' APIs generated from K8s `v1.34.1`.
4959
* New APIs:

lib/argo-cd/argoproj.io@v1alpha1/structs.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export interface Application {
277277
maxDuration?: string | null;
278278
} | null;
279279
limit?: number | null;
280+
refresh?: boolean | null;
280281
} | null;
281282
sync?: {
282283
autoHealAttemptsCount?: number | null;
@@ -359,6 +360,7 @@ export interface Application {
359360
maxDuration?: string | null;
360361
} | null;
361362
limit?: number | null;
363+
refresh?: boolean | null;
362364
} | null;
363365
syncOptions?: Array<string> | null;
364366
} | null;
@@ -408,6 +410,7 @@ export interface Application {
408410
maxDuration?: string | null;
409411
} | null;
410412
limit?: number | null;
413+
refresh?: boolean | null;
411414
} | null;
412415
sync?: {
413416
autoHealAttemptsCount?: number | null;
@@ -699,6 +702,7 @@ function toApplication_operation_retry(input: c.JSONValue) {
699702
return {
700703
backoff: c.readOpt(obj["backoff"], toApplication_operation_retry_backoff),
701704
limit: c.readOpt(obj["limit"], c.checkNum),
705+
refresh: c.readOpt(obj["refresh"], c.checkBool),
702706
}}
703707
function toApplication_operation_sync(input: c.JSONValue) {
704708
const obj = c.checkObj(input);
@@ -884,6 +888,7 @@ function toApplication_spec_syncPolicy_retry(input: c.JSONValue) {
884888
return {
885889
backoff: c.readOpt(obj["backoff"], toApplication_spec_syncPolicy_retry_backoff),
886890
limit: c.readOpt(obj["limit"], c.checkNum),
891+
refresh: c.readOpt(obj["refresh"], c.checkBool),
887892
}}
888893
function toApplication_status_history_initiatedBy(input: c.JSONValue) {
889894
const obj = c.checkObj(input);
@@ -976,6 +981,7 @@ function toApplication_status_operationState_operation_retry(input: c.JSONValue)
976981
return {
977982
backoff: c.readOpt(obj["backoff"], toApplication_status_operationState_operation_retry_backoff),
978983
limit: c.readOpt(obj["limit"], c.checkNum),
984+
refresh: c.readOpt(obj["refresh"], c.checkBool),
979985
}}
980986
function toApplication_status_operationState_operation_sync(input: c.JSONValue) {
981987
const obj = c.checkObj(input);
@@ -1234,9 +1240,11 @@ export interface ApplicationSetGenerator {
12341240
project: string;
12351241
repo: string;
12361242
} | null;
1243+
continueOnRepoNotFoundError?: boolean | null;
12371244
filters?: Array<{
12381245
branchMatch?: string | null;
12391246
targetBranchMatch?: string | null;
1247+
titleMatch?: string | null;
12401248
}> | null;
12411249
gitea?: {
12421250
api: string;
@@ -1506,6 +1514,7 @@ function toApplicationSetGenerator_pullRequest(input: c.JSONValue) {
15061514
azuredevops: c.readOpt(obj["azuredevops"], toApplicationSetGenerator_pullRequest_azuredevops),
15071515
bitbucket: c.readOpt(obj["bitbucket"], toApplicationSetGenerator_pullRequest_bitbucket),
15081516
bitbucketServer: c.readOpt(obj["bitbucketServer"], toApplicationSetGenerator_pullRequest_bitbucketServer),
1517+
continueOnRepoNotFoundError: c.readOpt(obj["continueOnRepoNotFoundError"], c.checkBool),
15091518
filters: c.readOpt(obj["filters"], x => c.readList(x, toApplicationSetGenerator_pullRequest_filters)),
15101519
gitea: c.readOpt(obj["gitea"], toApplicationSetGenerator_pullRequest_gitea),
15111520
github: c.readOpt(obj["github"], toApplicationSetGenerator_pullRequest_github),
@@ -1587,6 +1596,7 @@ function toApplicationSetGenerator_pullRequest_filters(input: c.JSONValue) {
15871596
return {
15881597
branchMatch: c.readOpt(obj["branchMatch"], c.checkStr),
15891598
targetBranchMatch: c.readOpt(obj["targetBranchMatch"], c.checkStr),
1599+
titleMatch: c.readOpt(obj["titleMatch"], c.checkStr),
15901600
}}
15911601
function toApplicationSetGenerator_pullRequest_gitea(input: c.JSONValue) {
15921602
const obj = c.checkObj(input);
@@ -1912,6 +1922,7 @@ export interface ApplicationTemplate {
19121922
maxDuration?: string | null;
19131923
} | null;
19141924
limit?: number | null;
1925+
refresh?: boolean | null;
19151926
} | null;
19161927
syncOptions?: Array<string> | null;
19171928
} | null;
@@ -2030,6 +2041,7 @@ function toApplicationTemplate_spec_syncPolicy_retry(input: c.JSONValue) {
20302041
return {
20312042
backoff: c.readOpt(obj["backoff"], toApplicationTemplate_spec_syncPolicy_retry_backoff),
20322043
limit: c.readOpt(obj["limit"], c.checkNum),
2044+
refresh: c.readOpt(obj["refresh"], c.checkBool),
20332045
}}
20342046
function toApplicationTemplate_spec_syncPolicy_retry_backoff(input: c.JSONValue) {
20352047
const obj = c.checkObj(input);
@@ -2058,6 +2070,7 @@ export interface ApplicationSet {
20582070
labels?: Array<string> | null;
20592071
} | null;
20602072
strategy?: {
2073+
deletionOrder?: string | null;
20612074
rollingSync?: {
20622075
steps?: Array<{
20632076
matchExpressions?: Array<{
@@ -2110,6 +2123,7 @@ export interface ApplicationSet {
21102123
syncWave?: number | null;
21112124
version?: string | null;
21122125
}> | null;
2126+
resourcesCount?: number | null;
21132127
} | null;
21142128
}
21152129
export function toApplicationSet(input: c.JSONValue): ApplicationSet & c.ApiKind {
@@ -2169,6 +2183,7 @@ function toApplicationSet_status(input: c.JSONValue) {
21692183
applicationStatus: c.readOpt(obj["applicationStatus"], x => c.readList(x, toApplicationSet_status_applicationStatus)),
21702184
conditions: c.readOpt(obj["conditions"], x => c.readList(x, toApplicationSet_status_conditions)),
21712185
resources: c.readOpt(obj["resources"], x => c.readList(x, toApplicationSet_status_resources)),
2186+
resourcesCount: c.readOpt(obj["resourcesCount"], c.checkNum),
21722187
}}
21732188
function toApplicationSet_spec_ignoreApplicationDifferences(input: c.JSONValue) {
21742189
const obj = c.checkObj(input);
@@ -2186,6 +2201,7 @@ function toApplicationSet_spec_preservedFields(input: c.JSONValue) {
21862201
function toApplicationSet_spec_strategy(input: c.JSONValue) {
21872202
const obj = c.checkObj(input);
21882203
return {
2204+
deletionOrder: c.readOpt(obj["deletionOrder"], c.checkStr),
21892205
rollingSync: c.readOpt(obj["rollingSync"], toApplicationSet_spec_strategy_rollingSync),
21902206
type: c.readOpt(obj["type"], c.checkStr),
21912207
}}

lib/cert-manager/cert-manager.io@v1/structs.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ export interface SolverSpec {
714714
} | null;
715715
rfc2136?: {
716716
nameserver: string;
717+
protocol?: "TCP" | "UDP" | c.UnexpectedEnumValue | null;
717718
tsigAlgorithm?: string | null;
718719
tsigKeyName?: string | null;
719720
tsigSecretSecretRef?: SecretRef | null;
@@ -763,6 +764,10 @@ export interface SolverSpec {
763764
}> | null;
764765
nodeSelector?: Record<string,string> | null;
765766
priorityClassName?: string | null;
767+
resources?: {
768+
limits?: Record<string,c.IntOrString> | null;
769+
requests?: Record<string,c.IntOrString> | null;
770+
} | null;
766771
securityContext?: {
767772
fsGroup?: number | null;
768773
fsGroupChangePolicy?: string | null;
@@ -819,6 +824,10 @@ export interface SolverSpec {
819824
}> | null;
820825
nodeSelector?: Record<string,string> | null;
821826
priorityClassName?: string | null;
827+
resources?: {
828+
limits?: Record<string,c.IntOrString> | null;
829+
requests?: Record<string,c.IntOrString> | null;
830+
} | null;
822831
securityContext?: {
823832
fsGroup?: number | null;
824833
fsGroupChangePolicy?: string | null;
@@ -1009,6 +1018,7 @@ function toSolverSpec_dns01_rfc2136(input: c.JSONValue) {
10091018
const obj = c.checkObj(input);
10101019
return {
10111020
nameserver: c.checkStr(obj["nameserver"]),
1021+
protocol: c.readOpt(obj["protocol"], (x => c.readEnum<"TCP" | "UDP" | c.UnexpectedEnumValue>(x))),
10121022
tsigAlgorithm: c.readOpt(obj["tsigAlgorithm"], c.checkStr),
10131023
tsigKeyName: c.readOpt(obj["tsigKeyName"], c.checkStr),
10141024
tsigSecretSecretRef: c.readOpt(obj["tsigSecretSecretRef"], toSecretRef),
@@ -1106,6 +1116,7 @@ function toSolverSpec_http01_gatewayHTTPRoute_podTemplate_spec(input: c.JSONValu
11061116
imagePullSecrets: c.readOpt(obj["imagePullSecrets"], x => c.readList(x, toSolverSpec_http01_gatewayHTTPRoute_podTemplate_spec_imagePullSecrets)),
11071117
nodeSelector: c.readOpt(obj["nodeSelector"], x => c.readMap(x, c.checkStr)),
11081118
priorityClassName: c.readOpt(obj["priorityClassName"], c.checkStr),
1119+
resources: c.readOpt(obj["resources"], toSolverSpec_http01_gatewayHTTPRoute_podTemplate_spec_resources),
11091120
securityContext: c.readOpt(obj["securityContext"], toSolverSpec_http01_gatewayHTTPRoute_podTemplate_spec_securityContext),
11101121
serviceAccountName: c.readOpt(obj["serviceAccountName"], c.checkStr),
11111122
tolerations: c.readOpt(obj["tolerations"], x => c.readList(x, toSolverSpec_http01_gatewayHTTPRoute_podTemplate_spec_tolerations)),
@@ -1129,6 +1140,7 @@ function toSolverSpec_http01_ingress_podTemplate_spec(input: c.JSONValue) {
11291140
imagePullSecrets: c.readOpt(obj["imagePullSecrets"], x => c.readList(x, toSolverSpec_http01_ingress_podTemplate_spec_imagePullSecrets)),
11301141
nodeSelector: c.readOpt(obj["nodeSelector"], x => c.readMap(x, c.checkStr)),
11311142
priorityClassName: c.readOpt(obj["priorityClassName"], c.checkStr),
1143+
resources: c.readOpt(obj["resources"], toSolverSpec_http01_ingress_podTemplate_spec_resources),
11321144
securityContext: c.readOpt(obj["securityContext"], toSolverSpec_http01_ingress_podTemplate_spec_securityContext),
11331145
serviceAccountName: c.readOpt(obj["serviceAccountName"], c.checkStr),
11341146
tolerations: c.readOpt(obj["tolerations"], x => c.readList(x, toSolverSpec_http01_ingress_podTemplate_spec_tolerations)),
@@ -1144,6 +1156,12 @@ function toSolverSpec_http01_gatewayHTTPRoute_podTemplate_spec_imagePullSecrets(
11441156
return {
11451157
name: c.readOpt(obj["name"], c.checkStr),
11461158
}}
1159+
function toSolverSpec_http01_gatewayHTTPRoute_podTemplate_spec_resources(input: c.JSONValue) {
1160+
const obj = c.checkObj(input);
1161+
return {
1162+
limits: c.readOpt(obj["limits"], x => c.readMap(x, c.toIntOrString)),
1163+
requests: c.readOpt(obj["requests"], x => c.readMap(x, c.toIntOrString)),
1164+
}}
11471165
function toSolverSpec_http01_gatewayHTTPRoute_podTemplate_spec_securityContext(input: c.JSONValue) {
11481166
const obj = c.checkObj(input);
11491167
return {
@@ -1171,6 +1189,12 @@ function toSolverSpec_http01_ingress_podTemplate_spec_imagePullSecrets(input: c.
11711189
return {
11721190
name: c.readOpt(obj["name"], c.checkStr),
11731191
}}
1192+
function toSolverSpec_http01_ingress_podTemplate_spec_resources(input: c.JSONValue) {
1193+
const obj = c.checkObj(input);
1194+
return {
1195+
limits: c.readOpt(obj["limits"], x => c.readMap(x, c.toIntOrString)),
1196+
requests: c.readOpt(obj["requests"], x => c.readMap(x, c.toIntOrString)),
1197+
}}
11741198
function toSolverSpec_http01_ingress_podTemplate_spec_securityContext(input: c.JSONValue) {
11751199
const obj = c.checkObj(input);
11761200
return {

lib/deno.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@cloudydeno/kubernetes-apis",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"imports": {
5-
"@cloudydeno/kubernetes-client": "jsr:@cloudydeno/kubernetes-client@^0.7"
5+
"@cloudydeno/kubernetes-client": "jsr:@cloudydeno/kubernetes-client@^0.8"
66
},
77
"exports": {
88

@@ -61,7 +61,6 @@
6161
"publish": {
6262
"exclude": [
6363
"examples",
64-
"deps_https.ts"
6564
]
6665
}
6766
}

lib/deps.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// so this is provided an optional utility.
44

55
export * from "@cloudydeno/kubernetes-client";
6-
export * as tunnelBeta from "@cloudydeno/kubernetes-client/tunnel-beta/via-websocket.ts";
76

87
export * from "@cloudydeno/kubernetes-client/lib/contract.ts";
98
export {

0 commit comments

Comments
 (0)