From ffa83bc138f64ab0aa933b23645b640023c82632 Mon Sep 17 00:00:00 2001 From: Daniel Lamando Date: Sat, 14 Feb 2026 10:25:25 +0100 Subject: [PATCH 1/2] Update generated APIs as of Kubernetes 1.35.1 --- generation/generate-all.sh | 8 +- lib/argo-cd/argoproj.io@v1alpha1/structs.ts | 900 ++++++++++++++++++ .../apiextensions.k8s.io@v1/structs.ts | 4 + lib/builtin/autoscaling@v2/structs.ts | 2 +- lib/builtin/batch@v1/structs.ts | 4 +- .../certificates.k8s.io@v1alpha1/mod.ts | 209 ---- .../certificates.k8s.io@v1alpha1/structs.ts | 98 -- .../certificates.k8s.io@v1beta1/mod.ts | 209 ++++ .../certificates.k8s.io@v1beta1/structs.ts | 100 ++ lib/builtin/core@v1/structs.ts | 31 + lib/builtin/meta@v1/structs.ts | 16 + lib/builtin/resource.k8s.io@v1/structs.ts | 2 +- lib/builtin/resource.k8s.io@v1alpha3/mod.ts | 47 + .../resource.k8s.io@v1alpha3/structs.ts | 52 +- .../resource.k8s.io@v1beta1/structs.ts | 2 +- .../resource.k8s.io@v1beta2/structs.ts | 2 +- lib/builtin/scheduling.k8s.io@v1alpha1/mod.ts | 178 ++++ .../scheduling.k8s.io@v1alpha1/structs.ts | 140 +++ lib/builtin/storage.k8s.io@v1/structs.ts | 2 + lib/builtin/storage.k8s.io@v1alpha1/mod.ts | 133 --- .../storage.k8s.io@v1alpha1/structs.ts | 44 - .../mod.ts | 72 +- .../structs.ts | 67 +- lib/deno.json | 4 +- lib/vpa/autoscaling.k8s.io@v1/structs.ts | 4 + 25 files changed, 1709 insertions(+), 621 deletions(-) create mode 100644 lib/builtin/scheduling.k8s.io@v1alpha1/mod.ts create mode 100644 lib/builtin/scheduling.k8s.io@v1alpha1/structs.ts delete mode 100644 lib/builtin/storage.k8s.io@v1alpha1/mod.ts delete mode 100644 lib/builtin/storage.k8s.io@v1alpha1/structs.ts rename lib/builtin/{storagemigration.k8s.io@v1alpha1 => storagemigration.k8s.io@v1beta1}/mod.ts (63%) rename lib/builtin/{storagemigration.k8s.io@v1alpha1 => storagemigration.k8s.io@v1beta1}/structs.ts (57%) diff --git a/generation/generate-all.sh b/generation/generate-all.sh index df61d06..242d887 100755 --- a/generation/generate-all.sh +++ b/generation/generate-all.sh @@ -1,13 +1,13 @@ #!/bin/sh -eux # https://github.com/kubernetes/kubernetes/releases -./generation/sources/builtin.sh v1.34.2 +./generation/sources/builtin.sh v1.35.1 # https://github.com/argoproj/argo-cd/releases -./generation/sources/argo-cd.sh v3.2.1 +./generation/sources/argo-cd.sh v3.3.0 # https://github.com/cert-manager/cert-manager/releases -./generation/sources/cert-manager.sh v1.19.1 +./generation/sources/cert-manager.sh v1.19.3 # https://github.com/kubernetes-sigs/external-dns/releases ./generation/sources/external-dns.sh v0.20.0 @@ -16,4 +16,4 @@ #./generation/sources/flux-cd.sh v2.6.4 # https://github.com/kubernetes/autoscaler/releases?q=vertical -./generation/sources/vpa.sh 1.5.1 +./generation/sources/vpa.sh 1.6.0 diff --git a/lib/argo-cd/argoproj.io@v1alpha1/structs.ts b/lib/argo-cd/argoproj.io@v1alpha1/structs.ts index d31391b..b420864 100644 --- a/lib/argo-cd/argoproj.io@v1alpha1/structs.ts +++ b/lib/argo-cd/argoproj.io@v1alpha1/structs.ts @@ -329,7 +329,98 @@ export interface Application { source?: ApplicationSource | null; sourceHydrator?: { drySource: { + directory?: { + exclude?: string | null; + include?: string | null; + jsonnet?: { + extVars?: Array<{ + code?: boolean | null; + name: string; + value: string; + }> | null; + libs?: Array | null; + tlas?: Array<{ + code?: boolean | null; + name: string; + value: string; + }> | null; + } | null; + recurse?: boolean | null; + } | null; + helm?: { + apiVersions?: Array | null; + fileParameters?: Array<{ + name?: string | null; + path?: string | null; + }> | null; + ignoreMissingValueFiles?: boolean | null; + kubeVersion?: string | null; + namespace?: string | null; + parameters?: Array<{ + forceString?: boolean | null; + name?: string | null; + value?: string | null; + }> | null; + passCredentials?: boolean | null; + releaseName?: string | null; + skipCrds?: boolean | null; + skipSchemaValidation?: boolean | null; + skipTests?: boolean | null; + valueFiles?: Array | null; + values?: string | null; + valuesObject?: c.JSONValue | null; + version?: string | null; + } | null; + kustomize?: { + apiVersions?: Array | null; + commonAnnotations?: Record | null; + commonAnnotationsEnvsubst?: boolean | null; + commonLabels?: Record | null; + components?: Array | null; + forceCommonAnnotations?: boolean | null; + forceCommonLabels?: boolean | null; + ignoreMissingComponents?: boolean | null; + images?: Array | null; + kubeVersion?: string | null; + labelIncludeTemplates?: boolean | null; + labelWithoutSelector?: boolean | null; + namePrefix?: string | null; + nameSuffix?: string | null; + namespace?: string | null; + patches?: Array<{ + options?: Record | null; + patch?: string | null; + path?: string | null; + target?: { + annotationSelector?: string | null; + group?: string | null; + kind?: string | null; + labelSelector?: string | null; + name?: string | null; + namespace?: string | null; + version?: string | null; + } | null; + }> | null; + replicas?: Array<{ + count: c.IntOrString; + name: string; + }> | null; + version?: string | null; + } | null; path: string; + plugin?: { + env?: Array<{ + name: string; + value: string; + }> | null; + name?: string | null; + parameters?: Array<{ + array?: Array | null; + map?: Record | null; + name?: string | null; + string?: string | null; + }> | null; + } | null; repoURL: string; targetRevision: string; }; @@ -493,7 +584,98 @@ export interface Application { phase: "Hydrating" | "Failed" | "Hydrated" | c.UnexpectedEnumValue; sourceHydrator?: { drySource: { + directory?: { + exclude?: string | null; + include?: string | null; + jsonnet?: { + extVars?: Array<{ + code?: boolean | null; + name: string; + value: string; + }> | null; + libs?: Array | null; + tlas?: Array<{ + code?: boolean | null; + name: string; + value: string; + }> | null; + } | null; + recurse?: boolean | null; + } | null; + helm?: { + apiVersions?: Array | null; + fileParameters?: Array<{ + name?: string | null; + path?: string | null; + }> | null; + ignoreMissingValueFiles?: boolean | null; + kubeVersion?: string | null; + namespace?: string | null; + parameters?: Array<{ + forceString?: boolean | null; + name?: string | null; + value?: string | null; + }> | null; + passCredentials?: boolean | null; + releaseName?: string | null; + skipCrds?: boolean | null; + skipSchemaValidation?: boolean | null; + skipTests?: boolean | null; + valueFiles?: Array | null; + values?: string | null; + valuesObject?: c.JSONValue | null; + version?: string | null; + } | null; + kustomize?: { + apiVersions?: Array | null; + commonAnnotations?: Record | null; + commonAnnotationsEnvsubst?: boolean | null; + commonLabels?: Record | null; + components?: Array | null; + forceCommonAnnotations?: boolean | null; + forceCommonLabels?: boolean | null; + ignoreMissingComponents?: boolean | null; + images?: Array | null; + kubeVersion?: string | null; + labelIncludeTemplates?: boolean | null; + labelWithoutSelector?: boolean | null; + namePrefix?: string | null; + nameSuffix?: string | null; + namespace?: string | null; + patches?: Array<{ + options?: Record | null; + patch?: string | null; + path?: string | null; + target?: { + annotationSelector?: string | null; + group?: string | null; + kind?: string | null; + labelSelector?: string | null; + name?: string | null; + namespace?: string | null; + version?: string | null; + } | null; + }> | null; + replicas?: Array<{ + count: c.IntOrString; + name: string; + }> | null; + version?: string | null; + } | null; path: string; + plugin?: { + env?: Array<{ + name: string; + value: string; + }> | null; + name?: string | null; + parameters?: Array<{ + array?: Array | null; + map?: Record | null; + name?: string | null; + string?: string | null; + }> | null; + } | null; repoURL: string; targetRevision: string; }; @@ -512,7 +694,98 @@ export interface Application { hydratedSHA?: string | null; sourceHydrator?: { drySource: { + directory?: { + exclude?: string | null; + include?: string | null; + jsonnet?: { + extVars?: Array<{ + code?: boolean | null; + name: string; + value: string; + }> | null; + libs?: Array | null; + tlas?: Array<{ + code?: boolean | null; + name: string; + value: string; + }> | null; + } | null; + recurse?: boolean | null; + } | null; + helm?: { + apiVersions?: Array | null; + fileParameters?: Array<{ + name?: string | null; + path?: string | null; + }> | null; + ignoreMissingValueFiles?: boolean | null; + kubeVersion?: string | null; + namespace?: string | null; + parameters?: Array<{ + forceString?: boolean | null; + name?: string | null; + value?: string | null; + }> | null; + passCredentials?: boolean | null; + releaseName?: string | null; + skipCrds?: boolean | null; + skipSchemaValidation?: boolean | null; + skipTests?: boolean | null; + valueFiles?: Array | null; + values?: string | null; + valuesObject?: c.JSONValue | null; + version?: string | null; + } | null; + kustomize?: { + apiVersions?: Array | null; + commonAnnotations?: Record | null; + commonAnnotationsEnvsubst?: boolean | null; + commonLabels?: Record | null; + components?: Array | null; + forceCommonAnnotations?: boolean | null; + forceCommonLabels?: boolean | null; + ignoreMissingComponents?: boolean | null; + images?: Array | null; + kubeVersion?: string | null; + labelIncludeTemplates?: boolean | null; + labelWithoutSelector?: boolean | null; + namePrefix?: string | null; + nameSuffix?: string | null; + namespace?: string | null; + patches?: Array<{ + options?: Record | null; + patch?: string | null; + path?: string | null; + target?: { + annotationSelector?: string | null; + group?: string | null; + kind?: string | null; + labelSelector?: string | null; + name?: string | null; + namespace?: string | null; + version?: string | null; + } | null; + }> | null; + replicas?: Array<{ + count: c.IntOrString; + name: string; + }> | null; + version?: string | null; + } | null; path: string; + plugin?: { + env?: Array<{ + name: string; + value: string; + }> | null; + name?: string | null; + parameters?: Array<{ + array?: Array | null; + map?: Record | null; + name?: string | null; + string?: string | null; + }> | null; + } | null; repoURL: string; targetRevision: string; }; @@ -854,7 +1127,11 @@ function toApplication_operation_sync_syncStrategy(input: c.JSONValue) { function toApplication_spec_sourceHydrator_drySource(input: c.JSONValue) { const obj = c.checkObj(input); return { + directory: c.readOpt(obj["directory"], toApplication_spec_sourceHydrator_drySource_directory), + helm: c.readOpt(obj["helm"], toApplication_spec_sourceHydrator_drySource_helm), + kustomize: c.readOpt(obj["kustomize"], toApplication_spec_sourceHydrator_drySource_kustomize), path: c.checkStr(obj["path"]), + plugin: c.readOpt(obj["plugin"], toApplication_spec_sourceHydrator_drySource_plugin), repoURL: c.checkStr(obj["repoURL"]), targetRevision: c.checkStr(obj["targetRevision"]), }} @@ -957,6 +1234,62 @@ function toApplication_operation_sync_syncStrategy_hook(input: c.JSONValue) { return { force: c.readOpt(obj["force"], c.checkBool), }} +function toApplication_spec_sourceHydrator_drySource_directory(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + exclude: c.readOpt(obj["exclude"], c.checkStr), + include: c.readOpt(obj["include"], c.checkStr), + jsonnet: c.readOpt(obj["jsonnet"], toApplication_spec_sourceHydrator_drySource_directory_jsonnet), + recurse: c.readOpt(obj["recurse"], c.checkBool), + }} +function toApplication_spec_sourceHydrator_drySource_helm(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + apiVersions: c.readOpt(obj["apiVersions"], x => c.readList(x, c.checkStr)), + fileParameters: c.readOpt(obj["fileParameters"], x => c.readList(x, toApplication_spec_sourceHydrator_drySource_helm_fileParameters)), + ignoreMissingValueFiles: c.readOpt(obj["ignoreMissingValueFiles"], c.checkBool), + kubeVersion: c.readOpt(obj["kubeVersion"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + parameters: c.readOpt(obj["parameters"], x => c.readList(x, toApplication_spec_sourceHydrator_drySource_helm_parameters)), + passCredentials: c.readOpt(obj["passCredentials"], c.checkBool), + releaseName: c.readOpt(obj["releaseName"], c.checkStr), + skipCrds: c.readOpt(obj["skipCrds"], c.checkBool), + skipSchemaValidation: c.readOpt(obj["skipSchemaValidation"], c.checkBool), + skipTests: c.readOpt(obj["skipTests"], c.checkBool), + valueFiles: c.readOpt(obj["valueFiles"], x => c.readList(x, c.checkStr)), + values: c.readOpt(obj["values"], c.checkStr), + valuesObject: c.readOpt(obj["valuesObject"], c.identity), + version: c.readOpt(obj["version"], c.checkStr), + }} +function toApplication_spec_sourceHydrator_drySource_kustomize(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + apiVersions: c.readOpt(obj["apiVersions"], x => c.readList(x, c.checkStr)), + commonAnnotations: c.readOpt(obj["commonAnnotations"], x => c.readMap(x, c.checkStr)), + commonAnnotationsEnvsubst: c.readOpt(obj["commonAnnotationsEnvsubst"], c.checkBool), + commonLabels: c.readOpt(obj["commonLabels"], x => c.readMap(x, c.checkStr)), + components: c.readOpt(obj["components"], x => c.readList(x, c.checkStr)), + forceCommonAnnotations: c.readOpt(obj["forceCommonAnnotations"], c.checkBool), + forceCommonLabels: c.readOpt(obj["forceCommonLabels"], c.checkBool), + ignoreMissingComponents: c.readOpt(obj["ignoreMissingComponents"], c.checkBool), + images: c.readOpt(obj["images"], x => c.readList(x, c.checkStr)), + kubeVersion: c.readOpt(obj["kubeVersion"], c.checkStr), + labelIncludeTemplates: c.readOpt(obj["labelIncludeTemplates"], c.checkBool), + labelWithoutSelector: c.readOpt(obj["labelWithoutSelector"], c.checkBool), + namePrefix: c.readOpt(obj["namePrefix"], c.checkStr), + nameSuffix: c.readOpt(obj["nameSuffix"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + patches: c.readOpt(obj["patches"], x => c.readList(x, toApplication_spec_sourceHydrator_drySource_kustomize_patches)), + replicas: c.readOpt(obj["replicas"], x => c.readList(x, toApplication_spec_sourceHydrator_drySource_kustomize_replicas)), + version: c.readOpt(obj["version"], c.checkStr), + }} +function toApplication_spec_sourceHydrator_drySource_plugin(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + env: c.readOpt(obj["env"], x => c.readList(x, toApplication_spec_sourceHydrator_drySource_plugin_env)), + name: c.readOpt(obj["name"], c.checkStr), + parameters: c.readOpt(obj["parameters"], x => c.readList(x, toApplication_spec_sourceHydrator_drySource_plugin_parameters)), + }} function toApplication_spec_syncPolicy_retry_backoff(input: c.JSONValue) { const obj = c.checkObj(input); return { @@ -1051,6 +1384,54 @@ function toApplication_status_sync_comparedTo_ignoreDifferences(input: c.JSONVal name: c.readOpt(obj["name"], c.checkStr), namespace: c.readOpt(obj["namespace"], c.checkStr), }} +function toApplication_spec_sourceHydrator_drySource_directory_jsonnet(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + extVars: c.readOpt(obj["extVars"], x => c.readList(x, toApplication_spec_sourceHydrator_drySource_directory_jsonnet_extVars)), + libs: c.readOpt(obj["libs"], x => c.readList(x, c.checkStr)), + tlas: c.readOpt(obj["tlas"], x => c.readList(x, toApplication_spec_sourceHydrator_drySource_directory_jsonnet_tlas)), + }} +function toApplication_spec_sourceHydrator_drySource_helm_fileParameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + name: c.readOpt(obj["name"], c.checkStr), + path: c.readOpt(obj["path"], c.checkStr), + }} +function toApplication_spec_sourceHydrator_drySource_helm_parameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + forceString: c.readOpt(obj["forceString"], c.checkBool), + name: c.readOpt(obj["name"], c.checkStr), + value: c.readOpt(obj["value"], c.checkStr), + }} +function toApplication_spec_sourceHydrator_drySource_kustomize_patches(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + options: c.readOpt(obj["options"], x => c.readMap(x, c.checkBool)), + patch: c.readOpt(obj["patch"], c.checkStr), + path: c.readOpt(obj["path"], c.checkStr), + target: c.readOpt(obj["target"], toApplication_spec_sourceHydrator_drySource_kustomize_patches_target), + }} +function toApplication_spec_sourceHydrator_drySource_kustomize_replicas(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + count: c.toIntOrString(obj["count"]), + name: c.checkStr(obj["name"]), + }} +function toApplication_spec_sourceHydrator_drySource_plugin_env(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplication_spec_sourceHydrator_drySource_plugin_parameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + array: c.readOpt(obj["array"], x => c.readList(x, c.checkStr)), + map: c.readOpt(obj["map"], x => c.readMap(x, c.checkStr)), + name: c.readOpt(obj["name"], c.checkStr), + string: c.readOpt(obj["string"], c.checkStr), + }} function toApplication_status_operationState_operation_retry_backoff(input: c.JSONValue) { const obj = c.checkObj(input); return { @@ -1075,7 +1456,11 @@ function toApplication_status_operationState_operation_sync_syncStrategy(input: function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource(input: c.JSONValue) { const obj = c.checkObj(input); return { + directory: c.readOpt(obj["directory"], toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_directory), + helm: c.readOpt(obj["helm"], toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_helm), + kustomize: c.readOpt(obj["kustomize"], toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_kustomize), path: c.checkStr(obj["path"]), + plugin: c.readOpt(obj["plugin"], toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_plugin), repoURL: c.checkStr(obj["repoURL"]), targetRevision: c.checkStr(obj["targetRevision"]), }} @@ -1093,7 +1478,11 @@ function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_syn function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource(input: c.JSONValue) { const obj = c.checkObj(input); return { + directory: c.readOpt(obj["directory"], toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_directory), + helm: c.readOpt(obj["helm"], toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_helm), + kustomize: c.readOpt(obj["kustomize"], toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_kustomize), path: c.checkStr(obj["path"]), + plugin: c.readOpt(obj["plugin"], toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_plugin), repoURL: c.checkStr(obj["repoURL"]), targetRevision: c.checkStr(obj["targetRevision"]), }} @@ -1108,6 +1497,31 @@ function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydra path: c.checkStr(obj["path"]), targetBranch: c.checkStr(obj["targetBranch"]), }} +function toApplication_spec_sourceHydrator_drySource_directory_jsonnet_extVars(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + code: c.readOpt(obj["code"], c.checkBool), + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplication_spec_sourceHydrator_drySource_directory_jsonnet_tlas(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + code: c.readOpt(obj["code"], c.checkBool), + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplication_spec_sourceHydrator_drySource_kustomize_patches_target(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + annotationSelector: c.readOpt(obj["annotationSelector"], c.checkStr), + group: c.readOpt(obj["group"], c.checkStr), + kind: c.readOpt(obj["kind"], c.checkStr), + labelSelector: c.readOpt(obj["labelSelector"], c.checkStr), + name: c.readOpt(obj["name"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + version: c.readOpt(obj["version"], c.checkStr), + }} function toApplication_status_operationState_operation_sync_syncStrategy_apply(input: c.JSONValue) { const obj = c.checkObj(input); return { @@ -1118,6 +1532,264 @@ function toApplication_status_operationState_operation_sync_syncStrategy_hook(in return { force: c.readOpt(obj["force"], c.checkBool), }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_directory(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + exclude: c.readOpt(obj["exclude"], c.checkStr), + include: c.readOpt(obj["include"], c.checkStr), + jsonnet: c.readOpt(obj["jsonnet"], toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_directory_jsonnet), + recurse: c.readOpt(obj["recurse"], c.checkBool), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_helm(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + apiVersions: c.readOpt(obj["apiVersions"], x => c.readList(x, c.checkStr)), + fileParameters: c.readOpt(obj["fileParameters"], x => c.readList(x, toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_helm_fileParameters)), + ignoreMissingValueFiles: c.readOpt(obj["ignoreMissingValueFiles"], c.checkBool), + kubeVersion: c.readOpt(obj["kubeVersion"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + parameters: c.readOpt(obj["parameters"], x => c.readList(x, toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_helm_parameters)), + passCredentials: c.readOpt(obj["passCredentials"], c.checkBool), + releaseName: c.readOpt(obj["releaseName"], c.checkStr), + skipCrds: c.readOpt(obj["skipCrds"], c.checkBool), + skipSchemaValidation: c.readOpt(obj["skipSchemaValidation"], c.checkBool), + skipTests: c.readOpt(obj["skipTests"], c.checkBool), + valueFiles: c.readOpt(obj["valueFiles"], x => c.readList(x, c.checkStr)), + values: c.readOpt(obj["values"], c.checkStr), + valuesObject: c.readOpt(obj["valuesObject"], c.identity), + version: c.readOpt(obj["version"], c.checkStr), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_kustomize(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + apiVersions: c.readOpt(obj["apiVersions"], x => c.readList(x, c.checkStr)), + commonAnnotations: c.readOpt(obj["commonAnnotations"], x => c.readMap(x, c.checkStr)), + commonAnnotationsEnvsubst: c.readOpt(obj["commonAnnotationsEnvsubst"], c.checkBool), + commonLabels: c.readOpt(obj["commonLabels"], x => c.readMap(x, c.checkStr)), + components: c.readOpt(obj["components"], x => c.readList(x, c.checkStr)), + forceCommonAnnotations: c.readOpt(obj["forceCommonAnnotations"], c.checkBool), + forceCommonLabels: c.readOpt(obj["forceCommonLabels"], c.checkBool), + ignoreMissingComponents: c.readOpt(obj["ignoreMissingComponents"], c.checkBool), + images: c.readOpt(obj["images"], x => c.readList(x, c.checkStr)), + kubeVersion: c.readOpt(obj["kubeVersion"], c.checkStr), + labelIncludeTemplates: c.readOpt(obj["labelIncludeTemplates"], c.checkBool), + labelWithoutSelector: c.readOpt(obj["labelWithoutSelector"], c.checkBool), + namePrefix: c.readOpt(obj["namePrefix"], c.checkStr), + nameSuffix: c.readOpt(obj["nameSuffix"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + patches: c.readOpt(obj["patches"], x => c.readList(x, toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_kustomize_patches)), + replicas: c.readOpt(obj["replicas"], x => c.readList(x, toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_kustomize_replicas)), + version: c.readOpt(obj["version"], c.checkStr), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_plugin(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + env: c.readOpt(obj["env"], x => c.readList(x, toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_plugin_env)), + name: c.readOpt(obj["name"], c.checkStr), + parameters: c.readOpt(obj["parameters"], x => c.readList(x, toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_plugin_parameters)), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_directory(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + exclude: c.readOpt(obj["exclude"], c.checkStr), + include: c.readOpt(obj["include"], c.checkStr), + jsonnet: c.readOpt(obj["jsonnet"], toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_directory_jsonnet), + recurse: c.readOpt(obj["recurse"], c.checkBool), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_helm(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + apiVersions: c.readOpt(obj["apiVersions"], x => c.readList(x, c.checkStr)), + fileParameters: c.readOpt(obj["fileParameters"], x => c.readList(x, toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_helm_fileParameters)), + ignoreMissingValueFiles: c.readOpt(obj["ignoreMissingValueFiles"], c.checkBool), + kubeVersion: c.readOpt(obj["kubeVersion"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + parameters: c.readOpt(obj["parameters"], x => c.readList(x, toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_helm_parameters)), + passCredentials: c.readOpt(obj["passCredentials"], c.checkBool), + releaseName: c.readOpt(obj["releaseName"], c.checkStr), + skipCrds: c.readOpt(obj["skipCrds"], c.checkBool), + skipSchemaValidation: c.readOpt(obj["skipSchemaValidation"], c.checkBool), + skipTests: c.readOpt(obj["skipTests"], c.checkBool), + valueFiles: c.readOpt(obj["valueFiles"], x => c.readList(x, c.checkStr)), + values: c.readOpt(obj["values"], c.checkStr), + valuesObject: c.readOpt(obj["valuesObject"], c.identity), + version: c.readOpt(obj["version"], c.checkStr), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_kustomize(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + apiVersions: c.readOpt(obj["apiVersions"], x => c.readList(x, c.checkStr)), + commonAnnotations: c.readOpt(obj["commonAnnotations"], x => c.readMap(x, c.checkStr)), + commonAnnotationsEnvsubst: c.readOpt(obj["commonAnnotationsEnvsubst"], c.checkBool), + commonLabels: c.readOpt(obj["commonLabels"], x => c.readMap(x, c.checkStr)), + components: c.readOpt(obj["components"], x => c.readList(x, c.checkStr)), + forceCommonAnnotations: c.readOpt(obj["forceCommonAnnotations"], c.checkBool), + forceCommonLabels: c.readOpt(obj["forceCommonLabels"], c.checkBool), + ignoreMissingComponents: c.readOpt(obj["ignoreMissingComponents"], c.checkBool), + images: c.readOpt(obj["images"], x => c.readList(x, c.checkStr)), + kubeVersion: c.readOpt(obj["kubeVersion"], c.checkStr), + labelIncludeTemplates: c.readOpt(obj["labelIncludeTemplates"], c.checkBool), + labelWithoutSelector: c.readOpt(obj["labelWithoutSelector"], c.checkBool), + namePrefix: c.readOpt(obj["namePrefix"], c.checkStr), + nameSuffix: c.readOpt(obj["nameSuffix"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + patches: c.readOpt(obj["patches"], x => c.readList(x, toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_kustomize_patches)), + replicas: c.readOpt(obj["replicas"], x => c.readList(x, toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_kustomize_replicas)), + version: c.readOpt(obj["version"], c.checkStr), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_plugin(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + env: c.readOpt(obj["env"], x => c.readList(x, toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_plugin_env)), + name: c.readOpt(obj["name"], c.checkStr), + parameters: c.readOpt(obj["parameters"], x => c.readList(x, toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_plugin_parameters)), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_directory_jsonnet(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + extVars: c.readOpt(obj["extVars"], x => c.readList(x, toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_directory_jsonnet_extVars)), + libs: c.readOpt(obj["libs"], x => c.readList(x, c.checkStr)), + tlas: c.readOpt(obj["tlas"], x => c.readList(x, toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_directory_jsonnet_tlas)), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_helm_fileParameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + name: c.readOpt(obj["name"], c.checkStr), + path: c.readOpt(obj["path"], c.checkStr), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_helm_parameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + forceString: c.readOpt(obj["forceString"], c.checkBool), + name: c.readOpt(obj["name"], c.checkStr), + value: c.readOpt(obj["value"], c.checkStr), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_kustomize_patches(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + options: c.readOpt(obj["options"], x => c.readMap(x, c.checkBool)), + patch: c.readOpt(obj["patch"], c.checkStr), + path: c.readOpt(obj["path"], c.checkStr), + target: c.readOpt(obj["target"], toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_kustomize_patches_target), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_kustomize_replicas(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + count: c.toIntOrString(obj["count"]), + name: c.checkStr(obj["name"]), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_plugin_env(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_plugin_parameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + array: c.readOpt(obj["array"], x => c.readList(x, c.checkStr)), + map: c.readOpt(obj["map"], x => c.readMap(x, c.checkStr)), + name: c.readOpt(obj["name"], c.checkStr), + string: c.readOpt(obj["string"], c.checkStr), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_directory_jsonnet(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + extVars: c.readOpt(obj["extVars"], x => c.readList(x, toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_directory_jsonnet_extVars)), + libs: c.readOpt(obj["libs"], x => c.readList(x, c.checkStr)), + tlas: c.readOpt(obj["tlas"], x => c.readList(x, toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_directory_jsonnet_tlas)), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_helm_fileParameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + name: c.readOpt(obj["name"], c.checkStr), + path: c.readOpt(obj["path"], c.checkStr), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_helm_parameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + forceString: c.readOpt(obj["forceString"], c.checkBool), + name: c.readOpt(obj["name"], c.checkStr), + value: c.readOpt(obj["value"], c.checkStr), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_kustomize_patches(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + options: c.readOpt(obj["options"], x => c.readMap(x, c.checkBool)), + patch: c.readOpt(obj["patch"], c.checkStr), + path: c.readOpt(obj["path"], c.checkStr), + target: c.readOpt(obj["target"], toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_kustomize_patches_target), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_kustomize_replicas(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + count: c.toIntOrString(obj["count"]), + name: c.checkStr(obj["name"]), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_plugin_env(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_plugin_parameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + array: c.readOpt(obj["array"], x => c.readList(x, c.checkStr)), + map: c.readOpt(obj["map"], x => c.readMap(x, c.checkStr)), + name: c.readOpt(obj["name"], c.checkStr), + string: c.readOpt(obj["string"], c.checkStr), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_directory_jsonnet_extVars(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + code: c.readOpt(obj["code"], c.checkBool), + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_directory_jsonnet_tlas(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + code: c.readOpt(obj["code"], c.checkBool), + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplication_status_sourceHydrator_currentOperation_sourceHydrator_drySource_kustomize_patches_target(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + annotationSelector: c.readOpt(obj["annotationSelector"], c.checkStr), + group: c.readOpt(obj["group"], c.checkStr), + kind: c.readOpt(obj["kind"], c.checkStr), + labelSelector: c.readOpt(obj["labelSelector"], c.checkStr), + name: c.readOpt(obj["name"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + version: c.readOpt(obj["version"], c.checkStr), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_directory_jsonnet_extVars(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + code: c.readOpt(obj["code"], c.checkBool), + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_directory_jsonnet_tlas(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + code: c.readOpt(obj["code"], c.checkBool), + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplication_status_sourceHydrator_lastSuccessfulOperation_sourceHydrator_drySource_kustomize_patches_target(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + annotationSelector: c.readOpt(obj["annotationSelector"], c.checkStr), + group: c.readOpt(obj["group"], c.checkStr), + kind: c.readOpt(obj["kind"], c.checkStr), + labelSelector: c.readOpt(obj["labelSelector"], c.checkStr), + name: c.readOpt(obj["name"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + version: c.readOpt(obj["version"], c.checkStr), + }} export interface ApplicationList extends ListOf { apiVersion?: "argoproj.io/v1alpha1"; @@ -1891,7 +2563,98 @@ export interface ApplicationTemplate { source?: ApplicationSource | null; sourceHydrator?: { drySource: { + directory?: { + exclude?: string | null; + include?: string | null; + jsonnet?: { + extVars?: Array<{ + code?: boolean | null; + name: string; + value: string; + }> | null; + libs?: Array | null; + tlas?: Array<{ + code?: boolean | null; + name: string; + value: string; + }> | null; + } | null; + recurse?: boolean | null; + } | null; + helm?: { + apiVersions?: Array | null; + fileParameters?: Array<{ + name?: string | null; + path?: string | null; + }> | null; + ignoreMissingValueFiles?: boolean | null; + kubeVersion?: string | null; + namespace?: string | null; + parameters?: Array<{ + forceString?: boolean | null; + name?: string | null; + value?: string | null; + }> | null; + passCredentials?: boolean | null; + releaseName?: string | null; + skipCrds?: boolean | null; + skipSchemaValidation?: boolean | null; + skipTests?: boolean | null; + valueFiles?: Array | null; + values?: string | null; + valuesObject?: c.JSONValue | null; + version?: string | null; + } | null; + kustomize?: { + apiVersions?: Array | null; + commonAnnotations?: Record | null; + commonAnnotationsEnvsubst?: boolean | null; + commonLabels?: Record | null; + components?: Array | null; + forceCommonAnnotations?: boolean | null; + forceCommonLabels?: boolean | null; + ignoreMissingComponents?: boolean | null; + images?: Array | null; + kubeVersion?: string | null; + labelIncludeTemplates?: boolean | null; + labelWithoutSelector?: boolean | null; + namePrefix?: string | null; + nameSuffix?: string | null; + namespace?: string | null; + patches?: Array<{ + options?: Record | null; + patch?: string | null; + path?: string | null; + target?: { + annotationSelector?: string | null; + group?: string | null; + kind?: string | null; + labelSelector?: string | null; + name?: string | null; + namespace?: string | null; + version?: string | null; + } | null; + }> | null; + replicas?: Array<{ + count: c.IntOrString; + name: string; + }> | null; + version?: string | null; + } | null; path: string; + plugin?: { + env?: Array<{ + name: string; + value: string; + }> | null; + name?: string | null; + parameters?: Array<{ + array?: Array | null; + map?: Record | null; + name?: string | null; + string?: string | null; + }> | null; + } | null; repoURL: string; targetRevision: string; }; @@ -2007,7 +2770,11 @@ function toApplicationTemplate_spec_syncPolicy(input: c.JSONValue) { function toApplicationTemplate_spec_sourceHydrator_drySource(input: c.JSONValue) { const obj = c.checkObj(input); return { + directory: c.readOpt(obj["directory"], toApplicationTemplate_spec_sourceHydrator_drySource_directory), + helm: c.readOpt(obj["helm"], toApplicationTemplate_spec_sourceHydrator_drySource_helm), + kustomize: c.readOpt(obj["kustomize"], toApplicationTemplate_spec_sourceHydrator_drySource_kustomize), path: c.checkStr(obj["path"]), + plugin: c.readOpt(obj["plugin"], toApplicationTemplate_spec_sourceHydrator_drySource_plugin), repoURL: c.checkStr(obj["repoURL"]), targetRevision: c.checkStr(obj["targetRevision"]), }} @@ -2043,6 +2810,62 @@ function toApplicationTemplate_spec_syncPolicy_retry(input: c.JSONValue) { limit: c.readOpt(obj["limit"], c.checkNum), refresh: c.readOpt(obj["refresh"], c.checkBool), }} +function toApplicationTemplate_spec_sourceHydrator_drySource_directory(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + exclude: c.readOpt(obj["exclude"], c.checkStr), + include: c.readOpt(obj["include"], c.checkStr), + jsonnet: c.readOpt(obj["jsonnet"], toApplicationTemplate_spec_sourceHydrator_drySource_directory_jsonnet), + recurse: c.readOpt(obj["recurse"], c.checkBool), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_helm(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + apiVersions: c.readOpt(obj["apiVersions"], x => c.readList(x, c.checkStr)), + fileParameters: c.readOpt(obj["fileParameters"], x => c.readList(x, toApplicationTemplate_spec_sourceHydrator_drySource_helm_fileParameters)), + ignoreMissingValueFiles: c.readOpt(obj["ignoreMissingValueFiles"], c.checkBool), + kubeVersion: c.readOpt(obj["kubeVersion"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + parameters: c.readOpt(obj["parameters"], x => c.readList(x, toApplicationTemplate_spec_sourceHydrator_drySource_helm_parameters)), + passCredentials: c.readOpt(obj["passCredentials"], c.checkBool), + releaseName: c.readOpt(obj["releaseName"], c.checkStr), + skipCrds: c.readOpt(obj["skipCrds"], c.checkBool), + skipSchemaValidation: c.readOpt(obj["skipSchemaValidation"], c.checkBool), + skipTests: c.readOpt(obj["skipTests"], c.checkBool), + valueFiles: c.readOpt(obj["valueFiles"], x => c.readList(x, c.checkStr)), + values: c.readOpt(obj["values"], c.checkStr), + valuesObject: c.readOpt(obj["valuesObject"], c.identity), + version: c.readOpt(obj["version"], c.checkStr), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_kustomize(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + apiVersions: c.readOpt(obj["apiVersions"], x => c.readList(x, c.checkStr)), + commonAnnotations: c.readOpt(obj["commonAnnotations"], x => c.readMap(x, c.checkStr)), + commonAnnotationsEnvsubst: c.readOpt(obj["commonAnnotationsEnvsubst"], c.checkBool), + commonLabels: c.readOpt(obj["commonLabels"], x => c.readMap(x, c.checkStr)), + components: c.readOpt(obj["components"], x => c.readList(x, c.checkStr)), + forceCommonAnnotations: c.readOpt(obj["forceCommonAnnotations"], c.checkBool), + forceCommonLabels: c.readOpt(obj["forceCommonLabels"], c.checkBool), + ignoreMissingComponents: c.readOpt(obj["ignoreMissingComponents"], c.checkBool), + images: c.readOpt(obj["images"], x => c.readList(x, c.checkStr)), + kubeVersion: c.readOpt(obj["kubeVersion"], c.checkStr), + labelIncludeTemplates: c.readOpt(obj["labelIncludeTemplates"], c.checkBool), + labelWithoutSelector: c.readOpt(obj["labelWithoutSelector"], c.checkBool), + namePrefix: c.readOpt(obj["namePrefix"], c.checkStr), + nameSuffix: c.readOpt(obj["nameSuffix"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + patches: c.readOpt(obj["patches"], x => c.readList(x, toApplicationTemplate_spec_sourceHydrator_drySource_kustomize_patches)), + replicas: c.readOpt(obj["replicas"], x => c.readList(x, toApplicationTemplate_spec_sourceHydrator_drySource_kustomize_replicas)), + version: c.readOpt(obj["version"], c.checkStr), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_plugin(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + env: c.readOpt(obj["env"], x => c.readList(x, toApplicationTemplate_spec_sourceHydrator_drySource_plugin_env)), + name: c.readOpt(obj["name"], c.checkStr), + parameters: c.readOpt(obj["parameters"], x => c.readList(x, toApplicationTemplate_spec_sourceHydrator_drySource_plugin_parameters)), + }} function toApplicationTemplate_spec_syncPolicy_retry_backoff(input: c.JSONValue) { const obj = c.checkObj(input); return { @@ -2050,6 +2873,79 @@ function toApplicationTemplate_spec_syncPolicy_retry_backoff(input: c.JSONValue) factor: c.readOpt(obj["factor"], c.checkNum), maxDuration: c.readOpt(obj["maxDuration"], c.checkStr), }} +function toApplicationTemplate_spec_sourceHydrator_drySource_directory_jsonnet(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + extVars: c.readOpt(obj["extVars"], x => c.readList(x, toApplicationTemplate_spec_sourceHydrator_drySource_directory_jsonnet_extVars)), + libs: c.readOpt(obj["libs"], x => c.readList(x, c.checkStr)), + tlas: c.readOpt(obj["tlas"], x => c.readList(x, toApplicationTemplate_spec_sourceHydrator_drySource_directory_jsonnet_tlas)), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_helm_fileParameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + name: c.readOpt(obj["name"], c.checkStr), + path: c.readOpt(obj["path"], c.checkStr), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_helm_parameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + forceString: c.readOpt(obj["forceString"], c.checkBool), + name: c.readOpt(obj["name"], c.checkStr), + value: c.readOpt(obj["value"], c.checkStr), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_kustomize_patches(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + options: c.readOpt(obj["options"], x => c.readMap(x, c.checkBool)), + patch: c.readOpt(obj["patch"], c.checkStr), + path: c.readOpt(obj["path"], c.checkStr), + target: c.readOpt(obj["target"], toApplicationTemplate_spec_sourceHydrator_drySource_kustomize_patches_target), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_kustomize_replicas(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + count: c.toIntOrString(obj["count"]), + name: c.checkStr(obj["name"]), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_plugin_env(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_plugin_parameters(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + array: c.readOpt(obj["array"], x => c.readList(x, c.checkStr)), + map: c.readOpt(obj["map"], x => c.readMap(x, c.checkStr)), + name: c.readOpt(obj["name"], c.checkStr), + string: c.readOpt(obj["string"], c.checkStr), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_directory_jsonnet_extVars(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + code: c.readOpt(obj["code"], c.checkBool), + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_directory_jsonnet_tlas(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + code: c.readOpt(obj["code"], c.checkBool), + name: c.checkStr(obj["name"]), + value: c.checkStr(obj["value"]), + }} +function toApplicationTemplate_spec_sourceHydrator_drySource_kustomize_patches_target(input: c.JSONValue) { + const obj = c.checkObj(input); + return { + annotationSelector: c.readOpt(obj["annotationSelector"], c.checkStr), + group: c.readOpt(obj["group"], c.checkStr), + kind: c.readOpt(obj["kind"], c.checkStr), + labelSelector: c.readOpt(obj["labelSelector"], c.checkStr), + name: c.readOpt(obj["name"], c.checkStr), + namespace: c.readOpt(obj["namespace"], c.checkStr), + version: c.readOpt(obj["version"], c.checkStr), + }} export interface ApplicationSet { apiVersion?: "argoproj.io/v1alpha1"; @@ -2297,10 +3193,12 @@ export interface AppProject { clusterResourceBlacklist?: Array<{ group: string; kind: string; + name?: string | null; }> | null; clusterResourceWhitelist?: Array<{ group: string; kind: string; + name?: string | null; }> | null; description?: string | null; destinationServiceAccounts?: Array<{ @@ -2411,12 +3309,14 @@ function toAppProject_spec_clusterResourceBlacklist(input: c.JSONValue) { return { group: c.checkStr(obj["group"]), kind: c.checkStr(obj["kind"]), + name: c.readOpt(obj["name"], c.checkStr), }} function toAppProject_spec_clusterResourceWhitelist(input: c.JSONValue) { const obj = c.checkObj(input); return { group: c.checkStr(obj["group"]), kind: c.checkStr(obj["kind"]), + name: c.readOpt(obj["name"], c.checkStr), }} function toAppProject_spec_destinationServiceAccounts(input: c.JSONValue) { const obj = c.checkObj(input); diff --git a/lib/builtin/apiextensions.k8s.io@v1/structs.ts b/lib/builtin/apiextensions.k8s.io@v1/structs.ts index c82e346..90f38be 100644 --- a/lib/builtin/apiextensions.k8s.io@v1/structs.ts +++ b/lib/builtin/apiextensions.k8s.io@v1/structs.ts @@ -456,6 +456,7 @@ export function fromCustomResourceSubresourceStatus(input: CustomResourceSubreso export interface CustomResourceDefinitionStatus { acceptedNames?: CustomResourceDefinitionNames | null; conditions?: Array | null; + observedGeneration?: number | null; storedVersions?: Array | null; } export function toCustomResourceDefinitionStatus(input: c.JSONValue): CustomResourceDefinitionStatus { @@ -463,6 +464,7 @@ export function toCustomResourceDefinitionStatus(input: c.JSONValue): CustomReso return { acceptedNames: c.readOpt(obj["acceptedNames"], toCustomResourceDefinitionNames), conditions: c.readOpt(obj["conditions"], x => c.readList(x, toCustomResourceDefinitionCondition)), + observedGeneration: c.readOpt(obj["observedGeneration"], c.checkNum), storedVersions: c.readOpt(obj["storedVersions"], x => c.readList(x, c.checkStr)), }} export function fromCustomResourceDefinitionStatus(input: CustomResourceDefinitionStatus): c.JSONValue { @@ -476,6 +478,7 @@ export function fromCustomResourceDefinitionStatus(input: CustomResourceDefiniti export interface CustomResourceDefinitionCondition { lastTransitionTime?: c.Time | null; message?: string | null; + observedGeneration?: number | null; reason?: string | null; status: string; type: string; @@ -485,6 +488,7 @@ export function toCustomResourceDefinitionCondition(input: c.JSONValue): CustomR return { lastTransitionTime: c.readOpt(obj["lastTransitionTime"], c.toTime), message: c.readOpt(obj["message"], c.checkStr), + observedGeneration: c.readOpt(obj["observedGeneration"], c.checkNum), reason: c.readOpt(obj["reason"], c.checkStr), status: c.checkStr(obj["status"]), type: c.checkStr(obj["type"]), diff --git a/lib/builtin/autoscaling@v2/structs.ts b/lib/builtin/autoscaling@v2/structs.ts index 8d29dcd..10da9da 100644 --- a/lib/builtin/autoscaling@v2/structs.ts +++ b/lib/builtin/autoscaling@v2/structs.ts @@ -180,7 +180,7 @@ export function fromHPAScalingPolicy(input: HPAScalingPolicy): c.JSONValue { Scaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen. -The tolerance is applied to the metric values and prevents scaling too eagerly for small metric variations. (Note that setting a tolerance requires enabling the alpha HPAConfigurableTolerance feature gate.) */ +The tolerance is applied to the metric values and prevents scaling too eagerly for small metric variations. (Note that setting a tolerance requires the beta HPAConfigurableTolerance feature gate to be enabled.) */ export interface HPAScalingRules { policies?: Array | null; selectPolicy?: string | null; diff --git a/lib/builtin/batch@v1/structs.ts b/lib/builtin/batch@v1/structs.ts index 0587e4b..058112c 100644 --- a/lib/builtin/batch@v1/structs.ts +++ b/lib/builtin/batch@v1/structs.ts @@ -183,13 +183,13 @@ export function fromPodFailurePolicyOnExitCodesRequirement(input: PodFailurePoli /** PodFailurePolicyOnPodConditionsPattern describes a pattern for matching an actual pod condition type. */ export interface PodFailurePolicyOnPodConditionsPattern { - status: string; + status?: string | null; type: string; } export function toPodFailurePolicyOnPodConditionsPattern(input: c.JSONValue): PodFailurePolicyOnPodConditionsPattern { const obj = c.checkObj(input); return { - status: c.checkStr(obj["status"]), + status: c.readOpt(obj["status"], c.checkStr), type: c.checkStr(obj["type"]), }} export function fromPodFailurePolicyOnPodConditionsPattern(input: PodFailurePolicyOnPodConditionsPattern): c.JSONValue { diff --git a/lib/builtin/certificates.k8s.io@v1alpha1/mod.ts b/lib/builtin/certificates.k8s.io@v1alpha1/mod.ts index a3fd6c2..c56746c 100644 --- a/lib/builtin/certificates.k8s.io@v1alpha1/mod.ts +++ b/lib/builtin/certificates.k8s.io@v1alpha1/mod.ts @@ -13,14 +13,6 @@ export class CertificatesV1alpha1Api { this.#client = client; } - namespace(name: string): CertificatesV1alpha1NamespacedApi { - return new CertificatesV1alpha1NamespacedApi(this.#client, name); - } - myNamespace(): CertificatesV1alpha1NamespacedApi { - if (!this.#client.defaultNamespace) throw new Error("No current namespace is set"); - return new CertificatesV1alpha1NamespacedApi(this.#client, this.#client.defaultNamespace); - } - async getClusterTrustBundleList( opts: operations.GetListOpts = {}, ): Promise { @@ -138,205 +130,4 @@ export class CertificatesV1alpha1Api { return CertificatesV1alpha1.toClusterTrustBundle(resp); } - async getPodCertificateRequestListForAllNamespaces( - opts: operations.GetListOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "GET", - path: `${this.#root}podcertificaterequests`, - expectJson: true, - querystring: operations.formatGetListOpts(opts), - abortSignal: opts.abortSignal, - }); - return CertificatesV1alpha1.toPodCertificateRequestList(resp); - } - - async watchPodCertificateRequestListForAllNamespaces( - opts: operations.WatchListOpts = {}, - ): Promise> { - const resp = await this.#client.performRequest({ - method: "GET", - path: `${this.#root}podcertificaterequests`, - expectJson: true, - expectStream: true, - querystring: operations.formatWatchListOpts(opts), - abortSignal: opts.abortSignal, - }); - return resp.pipeThrough(new c.WatchEventTransformer(CertificatesV1alpha1.toPodCertificateRequest, MetaV1.toStatus)); - } - -} - -export class CertificatesV1alpha1NamespacedApi { - #client: c.RestClient - #root: string - constructor(client: c.RestClient, namespace: string) { - this.#client = client; - this.#root = `/apis/certificates.k8s.io/v1alpha1/namespaces/${namespace}/`; - } - - async getPodCertificateRequestList( - opts: operations.GetListOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "GET", - path: `${this.#root}podcertificaterequests`, - expectJson: true, - querystring: operations.formatGetListOpts(opts), - abortSignal: opts.abortSignal, - }); - return CertificatesV1alpha1.toPodCertificateRequestList(resp); - } - - async watchPodCertificateRequestList( - opts: operations.WatchListOpts = {}, - ): Promise> { - const resp = await this.#client.performRequest({ - method: "GET", - path: `${this.#root}podcertificaterequests`, - expectJson: true, - expectStream: true, - querystring: operations.formatWatchListOpts(opts), - abortSignal: opts.abortSignal, - }); - return resp.pipeThrough(new c.WatchEventTransformer(CertificatesV1alpha1.toPodCertificateRequest, MetaV1.toStatus)); - } - - async createPodCertificateRequest( - body: CertificatesV1alpha1.PodCertificateRequest, - opts: operations.PutOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "POST", - path: `${this.#root}podcertificaterequests`, - expectJson: true, - querystring: operations.formatPutOpts(opts), - bodyJson: CertificatesV1alpha1.fromPodCertificateRequest(body), - abortSignal: opts.abortSignal, - }); - return CertificatesV1alpha1.toPodCertificateRequest(resp); - } - - async deletePodCertificateRequestList( - opts: operations.DeleteListOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "DELETE", - path: `${this.#root}podcertificaterequests`, - expectJson: true, - querystring: operations.formatDeleteListOpts(opts), - abortSignal: opts.abortSignal, - }); - return CertificatesV1alpha1.toPodCertificateRequestList(resp); - } - - async getPodCertificateRequest( - name: string, - opts: operations.NoOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "GET", - path: `${this.#root}podcertificaterequests/${name}`, - expectJson: true, - abortSignal: opts.abortSignal, - }); - return CertificatesV1alpha1.toPodCertificateRequest(resp); - } - - async deletePodCertificateRequest( - name: string, - opts: operations.DeleteOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "DELETE", - path: `${this.#root}podcertificaterequests/${name}`, - expectJson: true, - querystring: operations.formatDeleteOpts(opts), - abortSignal: opts.abortSignal, - }); - if (c.isStatusKind(resp)) return MetaV1.toStatus(resp); - return CertificatesV1alpha1.toPodCertificateRequest(resp); - } - - async replacePodCertificateRequest( - name: string, - body: CertificatesV1alpha1.PodCertificateRequest, - opts: operations.PutOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "PUT", - path: `${this.#root}podcertificaterequests/${name}`, - expectJson: true, - querystring: operations.formatPutOpts(opts), - bodyJson: CertificatesV1alpha1.fromPodCertificateRequest(body), - abortSignal: opts.abortSignal, - }); - return CertificatesV1alpha1.toPodCertificateRequest(resp); - } - - async patchPodCertificateRequest( - name: string, - type: c.PatchType, - body: CertificatesV1alpha1.PodCertificateRequest | c.JsonPatch, - opts: operations.PatchOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "PATCH", - path: `${this.#root}podcertificaterequests/${name}`, - expectJson: true, - querystring: operations.formatPatchOpts(opts), - contentType: c.getPatchContentType(type), - bodyJson: Array.isArray(body) ? body : CertificatesV1alpha1.fromPodCertificateRequest(body), - abortSignal: opts.abortSignal, - }); - return CertificatesV1alpha1.toPodCertificateRequest(resp); - } - - async getPodCertificateRequestStatus( - name: string, - opts: operations.NoOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "GET", - path: `${this.#root}podcertificaterequests/${name}/status`, - expectJson: true, - abortSignal: opts.abortSignal, - }); - return CertificatesV1alpha1.toPodCertificateRequest(resp); - } - - async replacePodCertificateRequestStatus( - name: string, - body: CertificatesV1alpha1.PodCertificateRequest, - opts: operations.PutOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "PUT", - path: `${this.#root}podcertificaterequests/${name}/status`, - expectJson: true, - querystring: operations.formatPutOpts(opts), - bodyJson: CertificatesV1alpha1.fromPodCertificateRequest(body), - abortSignal: opts.abortSignal, - }); - return CertificatesV1alpha1.toPodCertificateRequest(resp); - } - - async patchPodCertificateRequestStatus( - name: string, - type: c.PatchType, - body: CertificatesV1alpha1.PodCertificateRequest | c.JsonPatch, - opts: operations.PatchOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "PATCH", - path: `${this.#root}podcertificaterequests/${name}/status`, - expectJson: true, - querystring: operations.formatPatchOpts(opts), - contentType: c.getPatchContentType(type), - bodyJson: Array.isArray(body) ? body : CertificatesV1alpha1.fromPodCertificateRequest(body), - abortSignal: opts.abortSignal, - }); - return CertificatesV1alpha1.toPodCertificateRequest(resp); - } - } diff --git a/lib/builtin/certificates.k8s.io@v1alpha1/structs.ts b/lib/builtin/certificates.k8s.io@v1alpha1/structs.ts index f0c7f6f..8e6792d 100644 --- a/lib/builtin/certificates.k8s.io@v1alpha1/structs.ts +++ b/lib/builtin/certificates.k8s.io@v1alpha1/structs.ts @@ -61,101 +61,3 @@ export function toClusterTrustBundleList(input: c.JSONValue): ClusterTrustBundle metadata: MetaV1.toListMeta(obj.metadata), items: c.readList(obj.items, toClusterTrustBundle), }} - -/** PodCertificateRequest encodes a pod requesting a certificate from a given signer. - -Kubelets use this API to implement podCertificate projected volumes */ -export interface PodCertificateRequest { - apiVersion?: "certificates.k8s.io/v1alpha1"; - kind?: "PodCertificateRequest"; - metadata?: MetaV1.ObjectMeta | null; - spec: PodCertificateRequestSpec; - status?: PodCertificateRequestStatus | null; -} -export function toPodCertificateRequest(input: c.JSONValue): PodCertificateRequest & c.ApiKind { - const obj = c.checkObj(input); - return { - ...c.assertOrAddApiVersionAndKind(obj, "certificates.k8s.io/v1alpha1", "PodCertificateRequest"), - metadata: c.readOpt(obj["metadata"], MetaV1.toObjectMeta), - spec: toPodCertificateRequestSpec(obj["spec"]), - status: c.readOpt(obj["status"], toPodCertificateRequestStatus), - }} -export function fromPodCertificateRequest(input: PodCertificateRequest): c.JSONValue { - return { - ...c.assertOrAddApiVersionAndKind(input, "certificates.k8s.io/v1alpha1", "PodCertificateRequest"), - ...input, - metadata: input.metadata != null ? MetaV1.fromObjectMeta(input.metadata) : undefined, - spec: input.spec != null ? fromPodCertificateRequestSpec(input.spec) : undefined, - status: input.status != null ? fromPodCertificateRequestStatus(input.status) : undefined, - }} - -/** PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation. */ -export interface PodCertificateRequestSpec { - maxExpirationSeconds?: number | null; - nodeName: string; - nodeUID: string; - pkixPublicKey: string; - podName: string; - podUID: string; - proofOfPossession: string; - serviceAccountName: string; - serviceAccountUID: string; - signerName: string; -} -export function toPodCertificateRequestSpec(input: c.JSONValue): PodCertificateRequestSpec { - const obj = c.checkObj(input); - return { - maxExpirationSeconds: c.readOpt(obj["maxExpirationSeconds"], c.checkNum), - nodeName: c.checkStr(obj["nodeName"]), - nodeUID: c.checkStr(obj["nodeUID"]), - pkixPublicKey: c.checkStr(obj["pkixPublicKey"]), - podName: c.checkStr(obj["podName"]), - podUID: c.checkStr(obj["podUID"]), - proofOfPossession: c.checkStr(obj["proofOfPossession"]), - serviceAccountName: c.checkStr(obj["serviceAccountName"]), - serviceAccountUID: c.checkStr(obj["serviceAccountUID"]), - signerName: c.checkStr(obj["signerName"]), - }} -export function fromPodCertificateRequestSpec(input: PodCertificateRequestSpec): c.JSONValue { - return { - ...input, - }} - -/** PodCertificateRequestStatus describes the status of the request, and holds the certificate data if the request is issued. */ -export interface PodCertificateRequestStatus { - beginRefreshAt?: c.Time | null; - certificateChain?: string | null; - conditions?: Array | null; - notAfter?: c.Time | null; - notBefore?: c.Time | null; -} -export function toPodCertificateRequestStatus(input: c.JSONValue): PodCertificateRequestStatus { - const obj = c.checkObj(input); - return { - beginRefreshAt: c.readOpt(obj["beginRefreshAt"], c.toTime), - certificateChain: c.readOpt(obj["certificateChain"], c.checkStr), - conditions: c.readOpt(obj["conditions"], x => c.readList(x, MetaV1.toCondition)), - notAfter: c.readOpt(obj["notAfter"], c.toTime), - notBefore: c.readOpt(obj["notBefore"], c.toTime), - }} -export function fromPodCertificateRequestStatus(input: PodCertificateRequestStatus): c.JSONValue { - return { - ...input, - beginRefreshAt: input.beginRefreshAt != null ? c.fromTime(input.beginRefreshAt) : undefined, - conditions: input.conditions?.map(MetaV1.fromCondition), - notAfter: input.notAfter != null ? c.fromTime(input.notAfter) : undefined, - notBefore: input.notBefore != null ? c.fromTime(input.notBefore) : undefined, - }} - -/** PodCertificateRequestList is a collection of PodCertificateRequest objects */ -export interface PodCertificateRequestList extends ListOf { - apiVersion?: "certificates.k8s.io/v1alpha1"; - kind?: "PodCertificateRequestList"; -}; -export function toPodCertificateRequestList(input: c.JSONValue): PodCertificateRequestList & c.ApiKind { - const obj = c.checkObj(input); - return { - ...c.assertOrAddApiVersionAndKind(obj, "certificates.k8s.io/v1alpha1", "PodCertificateRequestList"), - metadata: MetaV1.toListMeta(obj.metadata), - items: c.readList(obj.items, toPodCertificateRequest), - }} diff --git a/lib/builtin/certificates.k8s.io@v1beta1/mod.ts b/lib/builtin/certificates.k8s.io@v1beta1/mod.ts index ec39ddb..0505b84 100644 --- a/lib/builtin/certificates.k8s.io@v1beta1/mod.ts +++ b/lib/builtin/certificates.k8s.io@v1beta1/mod.ts @@ -13,6 +13,14 @@ export class CertificatesV1beta1Api { this.#client = client; } + namespace(name: string): CertificatesV1beta1NamespacedApi { + return new CertificatesV1beta1NamespacedApi(this.#client, name); + } + myNamespace(): CertificatesV1beta1NamespacedApi { + if (!this.#client.defaultNamespace) throw new Error("No current namespace is set"); + return new CertificatesV1beta1NamespacedApi(this.#client, this.#client.defaultNamespace); + } + async getClusterTrustBundleList( opts: operations.GetListOpts = {}, ): Promise { @@ -130,4 +138,205 @@ export class CertificatesV1beta1Api { return CertificatesV1beta1.toClusterTrustBundle(resp); } + async getPodCertificateRequestListForAllNamespaces( + opts: operations.GetListOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}podcertificaterequests`, + expectJson: true, + querystring: operations.formatGetListOpts(opts), + abortSignal: opts.abortSignal, + }); + return CertificatesV1beta1.toPodCertificateRequestList(resp); + } + + async watchPodCertificateRequestListForAllNamespaces( + opts: operations.WatchListOpts = {}, + ): Promise> { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}podcertificaterequests`, + expectJson: true, + expectStream: true, + querystring: operations.formatWatchListOpts(opts), + abortSignal: opts.abortSignal, + }); + return resp.pipeThrough(new c.WatchEventTransformer(CertificatesV1beta1.toPodCertificateRequest, MetaV1.toStatus)); + } + +} + +export class CertificatesV1beta1NamespacedApi { + #client: c.RestClient + #root: string + constructor(client: c.RestClient, namespace: string) { + this.#client = client; + this.#root = `/apis/certificates.k8s.io/v1beta1/namespaces/${namespace}/`; + } + + async getPodCertificateRequestList( + opts: operations.GetListOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}podcertificaterequests`, + expectJson: true, + querystring: operations.formatGetListOpts(opts), + abortSignal: opts.abortSignal, + }); + return CertificatesV1beta1.toPodCertificateRequestList(resp); + } + + async watchPodCertificateRequestList( + opts: operations.WatchListOpts = {}, + ): Promise> { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}podcertificaterequests`, + expectJson: true, + expectStream: true, + querystring: operations.formatWatchListOpts(opts), + abortSignal: opts.abortSignal, + }); + return resp.pipeThrough(new c.WatchEventTransformer(CertificatesV1beta1.toPodCertificateRequest, MetaV1.toStatus)); + } + + async createPodCertificateRequest( + body: CertificatesV1beta1.PodCertificateRequest, + opts: operations.PutOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "POST", + path: `${this.#root}podcertificaterequests`, + expectJson: true, + querystring: operations.formatPutOpts(opts), + bodyJson: CertificatesV1beta1.fromPodCertificateRequest(body), + abortSignal: opts.abortSignal, + }); + return CertificatesV1beta1.toPodCertificateRequest(resp); + } + + async deletePodCertificateRequestList( + opts: operations.DeleteListOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "DELETE", + path: `${this.#root}podcertificaterequests`, + expectJson: true, + querystring: operations.formatDeleteListOpts(opts), + abortSignal: opts.abortSignal, + }); + return CertificatesV1beta1.toPodCertificateRequestList(resp); + } + + async getPodCertificateRequest( + name: string, + opts: operations.NoOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}podcertificaterequests/${name}`, + expectJson: true, + abortSignal: opts.abortSignal, + }); + return CertificatesV1beta1.toPodCertificateRequest(resp); + } + + async deletePodCertificateRequest( + name: string, + opts: operations.DeleteOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "DELETE", + path: `${this.#root}podcertificaterequests/${name}`, + expectJson: true, + querystring: operations.formatDeleteOpts(opts), + abortSignal: opts.abortSignal, + }); + if (c.isStatusKind(resp)) return MetaV1.toStatus(resp); + return CertificatesV1beta1.toPodCertificateRequest(resp); + } + + async replacePodCertificateRequest( + name: string, + body: CertificatesV1beta1.PodCertificateRequest, + opts: operations.PutOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "PUT", + path: `${this.#root}podcertificaterequests/${name}`, + expectJson: true, + querystring: operations.formatPutOpts(opts), + bodyJson: CertificatesV1beta1.fromPodCertificateRequest(body), + abortSignal: opts.abortSignal, + }); + return CertificatesV1beta1.toPodCertificateRequest(resp); + } + + async patchPodCertificateRequest( + name: string, + type: c.PatchType, + body: CertificatesV1beta1.PodCertificateRequest | c.JsonPatch, + opts: operations.PatchOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "PATCH", + path: `${this.#root}podcertificaterequests/${name}`, + expectJson: true, + querystring: operations.formatPatchOpts(opts), + contentType: c.getPatchContentType(type), + bodyJson: Array.isArray(body) ? body : CertificatesV1beta1.fromPodCertificateRequest(body), + abortSignal: opts.abortSignal, + }); + return CertificatesV1beta1.toPodCertificateRequest(resp); + } + + async getPodCertificateRequestStatus( + name: string, + opts: operations.NoOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}podcertificaterequests/${name}/status`, + expectJson: true, + abortSignal: opts.abortSignal, + }); + return CertificatesV1beta1.toPodCertificateRequest(resp); + } + + async replacePodCertificateRequestStatus( + name: string, + body: CertificatesV1beta1.PodCertificateRequest, + opts: operations.PutOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "PUT", + path: `${this.#root}podcertificaterequests/${name}/status`, + expectJson: true, + querystring: operations.formatPutOpts(opts), + bodyJson: CertificatesV1beta1.fromPodCertificateRequest(body), + abortSignal: opts.abortSignal, + }); + return CertificatesV1beta1.toPodCertificateRequest(resp); + } + + async patchPodCertificateRequestStatus( + name: string, + type: c.PatchType, + body: CertificatesV1beta1.PodCertificateRequest | c.JsonPatch, + opts: operations.PatchOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "PATCH", + path: `${this.#root}podcertificaterequests/${name}/status`, + expectJson: true, + querystring: operations.formatPatchOpts(opts), + contentType: c.getPatchContentType(type), + bodyJson: Array.isArray(body) ? body : CertificatesV1beta1.fromPodCertificateRequest(body), + abortSignal: opts.abortSignal, + }); + return CertificatesV1beta1.toPodCertificateRequest(resp); + } + } diff --git a/lib/builtin/certificates.k8s.io@v1beta1/structs.ts b/lib/builtin/certificates.k8s.io@v1beta1/structs.ts index ddf0f89..19a9805 100644 --- a/lib/builtin/certificates.k8s.io@v1beta1/structs.ts +++ b/lib/builtin/certificates.k8s.io@v1beta1/structs.ts @@ -61,3 +61,103 @@ export function toClusterTrustBundleList(input: c.JSONValue): ClusterTrustBundle metadata: MetaV1.toListMeta(obj.metadata), items: c.readList(obj.items, toClusterTrustBundle), }} + +/** PodCertificateRequest encodes a pod requesting a certificate from a given signer. + +Kubelets use this API to implement podCertificate projected volumes */ +export interface PodCertificateRequest { + apiVersion?: "certificates.k8s.io/v1beta1"; + kind?: "PodCertificateRequest"; + metadata?: MetaV1.ObjectMeta | null; + spec: PodCertificateRequestSpec; + status?: PodCertificateRequestStatus | null; +} +export function toPodCertificateRequest(input: c.JSONValue): PodCertificateRequest & c.ApiKind { + const obj = c.checkObj(input); + return { + ...c.assertOrAddApiVersionAndKind(obj, "certificates.k8s.io/v1beta1", "PodCertificateRequest"), + metadata: c.readOpt(obj["metadata"], MetaV1.toObjectMeta), + spec: toPodCertificateRequestSpec(obj["spec"]), + status: c.readOpt(obj["status"], toPodCertificateRequestStatus), + }} +export function fromPodCertificateRequest(input: PodCertificateRequest): c.JSONValue { + return { + ...c.assertOrAddApiVersionAndKind(input, "certificates.k8s.io/v1beta1", "PodCertificateRequest"), + ...input, + metadata: input.metadata != null ? MetaV1.fromObjectMeta(input.metadata) : undefined, + spec: input.spec != null ? fromPodCertificateRequestSpec(input.spec) : undefined, + status: input.status != null ? fromPodCertificateRequestStatus(input.status) : undefined, + }} + +/** PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation. */ +export interface PodCertificateRequestSpec { + maxExpirationSeconds?: number | null; + nodeName: string; + nodeUID: string; + pkixPublicKey: string; + podName: string; + podUID: string; + proofOfPossession: string; + serviceAccountName: string; + serviceAccountUID: string; + signerName: string; + unverifiedUserAnnotations?: Record | null; +} +export function toPodCertificateRequestSpec(input: c.JSONValue): PodCertificateRequestSpec { + const obj = c.checkObj(input); + return { + maxExpirationSeconds: c.readOpt(obj["maxExpirationSeconds"], c.checkNum), + nodeName: c.checkStr(obj["nodeName"]), + nodeUID: c.checkStr(obj["nodeUID"]), + pkixPublicKey: c.checkStr(obj["pkixPublicKey"]), + podName: c.checkStr(obj["podName"]), + podUID: c.checkStr(obj["podUID"]), + proofOfPossession: c.checkStr(obj["proofOfPossession"]), + serviceAccountName: c.checkStr(obj["serviceAccountName"]), + serviceAccountUID: c.checkStr(obj["serviceAccountUID"]), + signerName: c.checkStr(obj["signerName"]), + unverifiedUserAnnotations: c.readOpt(obj["unverifiedUserAnnotations"], x => c.readMap(x, c.checkStr)), + }} +export function fromPodCertificateRequestSpec(input: PodCertificateRequestSpec): c.JSONValue { + return { + ...input, + }} + +/** PodCertificateRequestStatus describes the status of the request, and holds the certificate data if the request is issued. */ +export interface PodCertificateRequestStatus { + beginRefreshAt?: c.Time | null; + certificateChain?: string | null; + conditions?: Array | null; + notAfter?: c.Time | null; + notBefore?: c.Time | null; +} +export function toPodCertificateRequestStatus(input: c.JSONValue): PodCertificateRequestStatus { + const obj = c.checkObj(input); + return { + beginRefreshAt: c.readOpt(obj["beginRefreshAt"], c.toTime), + certificateChain: c.readOpt(obj["certificateChain"], c.checkStr), + conditions: c.readOpt(obj["conditions"], x => c.readList(x, MetaV1.toCondition)), + notAfter: c.readOpt(obj["notAfter"], c.toTime), + notBefore: c.readOpt(obj["notBefore"], c.toTime), + }} +export function fromPodCertificateRequestStatus(input: PodCertificateRequestStatus): c.JSONValue { + return { + ...input, + beginRefreshAt: input.beginRefreshAt != null ? c.fromTime(input.beginRefreshAt) : undefined, + conditions: input.conditions?.map(MetaV1.fromCondition), + notAfter: input.notAfter != null ? c.fromTime(input.notAfter) : undefined, + notBefore: input.notBefore != null ? c.fromTime(input.notBefore) : undefined, + }} + +/** PodCertificateRequestList is a collection of PodCertificateRequest objects */ +export interface PodCertificateRequestList extends ListOf { + apiVersion?: "certificates.k8s.io/v1beta1"; + kind?: "PodCertificateRequestList"; +}; +export function toPodCertificateRequestList(input: c.JSONValue): PodCertificateRequestList & c.ApiKind { + const obj = c.checkObj(input); + return { + ...c.assertOrAddApiVersionAndKind(obj, "certificates.k8s.io/v1beta1", "PodCertificateRequestList"), + metadata: MetaV1.toListMeta(obj.metadata), + items: c.readList(obj.items, toPodCertificateRequest), + }} diff --git a/lib/builtin/core@v1/structs.ts b/lib/builtin/core@v1/structs.ts index 30d20a8..d687edf 100644 --- a/lib/builtin/core@v1/structs.ts +++ b/lib/builtin/core@v1/structs.ts @@ -2892,6 +2892,7 @@ export interface NodeStatus { conditions?: Array | null; config?: NodeConfigStatus | null; daemonEndpoints?: NodeDaemonEndpoints | null; + declaredFeatures?: Array | null; features?: NodeFeatures | null; images?: Array | null; nodeInfo?: NodeSystemInfo | null; @@ -2909,6 +2910,7 @@ export function toNodeStatus(input: c.JSONValue): NodeStatus { conditions: c.readOpt(obj["conditions"], x => c.readList(x, toNodeCondition)), config: c.readOpt(obj["config"], toNodeConfigStatus), daemonEndpoints: c.readOpt(obj["daemonEndpoints"], toNodeDaemonEndpoints), + declaredFeatures: c.readOpt(obj["declaredFeatures"], x => c.readList(x, c.checkStr)), features: c.readOpt(obj["features"], toNodeFeatures), images: c.readOpt(obj["images"], x => c.readList(x, toContainerImage)), nodeInfo: c.readOpt(obj["nodeInfo"], toNodeSystemInfo), @@ -3638,6 +3640,7 @@ export interface PodSpec { tolerations?: Array | null; topologySpreadConstraints?: Array | null; volumes?: Array | null; + workloadRef?: WorkloadReference | null; } export function toPodSpec(input: c.JSONValue): PodSpec { const obj = c.checkObj(input); @@ -3683,6 +3686,7 @@ export function toPodSpec(input: c.JSONValue): PodSpec { tolerations: c.readOpt(obj["tolerations"], x => c.readList(x, toToleration)), topologySpreadConstraints: c.readOpt(obj["topologySpreadConstraints"], x => c.readList(x, toTopologySpreadConstraint)), volumes: c.readOpt(obj["volumes"], x => c.readList(x, toVolume)), + workloadRef: c.readOpt(obj["workloadRef"], toWorkloadReference), }} export function fromPodSpec(input: PodSpec): c.JSONValue { return { @@ -3704,6 +3708,7 @@ export function fromPodSpec(input: PodSpec): c.JSONValue { tolerations: input.tolerations?.map(fromToleration), topologySpreadConstraints: input.topologySpreadConstraints?.map(fromTopologySpreadConstraint), volumes: input.volumes?.map(fromVolume), + workloadRef: input.workloadRef != null ? fromWorkloadReference(input.workloadRef) : undefined, }} /** PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy. */ @@ -4072,6 +4077,7 @@ export interface PodCertificateProjection { keyType: string; maxExpirationSeconds?: number | null; signerName: string; + userAnnotations?: Record | null; } export function toPodCertificateProjection(input: c.JSONValue): PodCertificateProjection { const obj = c.checkObj(input); @@ -4082,6 +4088,7 @@ export function toPodCertificateProjection(input: c.JSONValue): PodCertificatePr keyType: c.checkStr(obj["keyType"]), maxExpirationSeconds: c.readOpt(obj["maxExpirationSeconds"], c.checkNum), signerName: c.checkStr(obj["signerName"]), + userAnnotations: c.readOpt(obj["userAnnotations"], x => c.readMap(x, c.checkStr)), }} export function fromPodCertificateProjection(input: PodCertificateProjection): c.JSONValue { return { @@ -4235,8 +4242,27 @@ export function fromStorageOSVolumeSource(input: StorageOSVolumeSource): c.JSONV secretRef: input.secretRef != null ? fromLocalObjectReference(input.secretRef) : undefined, }} +/** WorkloadReference identifies the Workload object and PodGroup membership that a Pod belongs to. The scheduler uses this information to apply workload-aware scheduling semantics. */ +export interface WorkloadReference { + name: string; + podGroup: string; + podGroupReplicaKey?: string | null; +} +export function toWorkloadReference(input: c.JSONValue): WorkloadReference { + const obj = c.checkObj(input); + return { + name: c.checkStr(obj["name"]), + podGroup: c.checkStr(obj["podGroup"]), + podGroupReplicaKey: c.readOpt(obj["podGroupReplicaKey"], c.checkStr), + }} +export function fromWorkloadReference(input: WorkloadReference): c.JSONValue { + return { + ...input, + }} + /** PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane. */ export interface PodStatus { + allocatedResources?: Record | null; conditions?: Array | null; containerStatuses?: Array | null; ephemeralContainerStatuses?: Array | null; @@ -4254,11 +4280,13 @@ export interface PodStatus { reason?: string | null; resize?: string | null; resourceClaimStatuses?: Array | null; + resources?: ResourceRequirements | null; startTime?: c.Time | null; } export function toPodStatus(input: c.JSONValue): PodStatus { const obj = c.checkObj(input); return { + allocatedResources: c.readOpt(obj["allocatedResources"], x => c.readMap(x, c.toQuantity)), conditions: c.readOpt(obj["conditions"], x => c.readList(x, toPodCondition)), containerStatuses: c.readOpt(obj["containerStatuses"], x => c.readList(x, toContainerStatus)), ephemeralContainerStatuses: c.readOpt(obj["ephemeralContainerStatuses"], x => c.readList(x, toContainerStatus)), @@ -4276,11 +4304,13 @@ export function toPodStatus(input: c.JSONValue): PodStatus { reason: c.readOpt(obj["reason"], c.checkStr), resize: c.readOpt(obj["resize"], c.checkStr), resourceClaimStatuses: c.readOpt(obj["resourceClaimStatuses"], x => c.readList(x, toPodResourceClaimStatus)), + resources: c.readOpt(obj["resources"], toResourceRequirements), startTime: c.readOpt(obj["startTime"], c.toTime), }} export function fromPodStatus(input: PodStatus): c.JSONValue { return { ...input, + allocatedResources: c.writeMap(input.allocatedResources, c.fromQuantity), conditions: input.conditions?.map(fromPodCondition), containerStatuses: input.containerStatuses?.map(fromContainerStatus), ephemeralContainerStatuses: input.ephemeralContainerStatuses?.map(fromContainerStatus), @@ -4289,6 +4319,7 @@ export function fromPodStatus(input: PodStatus): c.JSONValue { initContainerStatuses: input.initContainerStatuses?.map(fromContainerStatus), podIPs: input.podIPs?.map(fromPodIP), resourceClaimStatuses: input.resourceClaimStatuses?.map(fromPodResourceClaimStatus), + resources: input.resources != null ? fromResourceRequirements(input.resources) : undefined, startTime: input.startTime != null ? c.fromTime(input.startTime) : undefined, }} diff --git a/lib/builtin/meta@v1/structs.ts b/lib/builtin/meta@v1/structs.ts index ddaf6e8..246c6f3 100644 --- a/lib/builtin/meta@v1/structs.ts +++ b/lib/builtin/meta@v1/structs.ts @@ -246,6 +246,22 @@ Each key is either a '.' representing the field itself, and will always map to a The exact format is defined in sigs.k8s.io/structured-merge-diff */ export type FieldsV1 = c.JSONValue; +/** GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types */ +export interface GroupResource { + group: string; + resource: string; +} +export function toGroupResource(input: c.JSONValue): GroupResource { + const obj = c.checkObj(input); + return { + group: c.checkStr(obj["group"]), + resource: c.checkStr(obj["resource"]), + }} +export function fromGroupResource(input: GroupResource): c.JSONValue { + return { + ...input, + }} + /** A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. */ export interface LabelSelector { matchExpressions?: Array | null; diff --git a/lib/builtin/resource.k8s.io@v1/structs.ts b/lib/builtin/resource.k8s.io@v1/structs.ts index 7dd88ab..eadc143 100644 --- a/lib/builtin/resource.k8s.io@v1/structs.ts +++ b/lib/builtin/resource.k8s.io@v1/structs.ts @@ -281,7 +281,7 @@ export function fromCounter(input: Counter): c.JSONValue { value: input.value != null ? c.fromQuantity(input.value) : undefined, }} -/** CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice. +/** CounterSet defines a named set of counters that are available to be used by devices defined in the ResourcePool. The counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices. */ export interface CounterSet { diff --git a/lib/builtin/resource.k8s.io@v1alpha3/mod.ts b/lib/builtin/resource.k8s.io@v1alpha3/mod.ts index 9a8878b..123559c 100644 --- a/lib/builtin/resource.k8s.io@v1alpha3/mod.ts +++ b/lib/builtin/resource.k8s.io@v1alpha3/mod.ts @@ -130,4 +130,51 @@ export class ResourceV1alpha3Api { return ResourceV1alpha3.toDeviceTaintRule(resp); } + async getDeviceTaintRuleStatus( + name: string, + opts: operations.NoOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}devicetaintrules/${name}/status`, + expectJson: true, + abortSignal: opts.abortSignal, + }); + return ResourceV1alpha3.toDeviceTaintRule(resp); + } + + async replaceDeviceTaintRuleStatus( + name: string, + body: ResourceV1alpha3.DeviceTaintRule, + opts: operations.PutOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "PUT", + path: `${this.#root}devicetaintrules/${name}/status`, + expectJson: true, + querystring: operations.formatPutOpts(opts), + bodyJson: ResourceV1alpha3.fromDeviceTaintRule(body), + abortSignal: opts.abortSignal, + }); + return ResourceV1alpha3.toDeviceTaintRule(resp); + } + + async patchDeviceTaintRuleStatus( + name: string, + type: c.PatchType, + body: ResourceV1alpha3.DeviceTaintRule | c.JsonPatch, + opts: operations.PatchOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "PATCH", + path: `${this.#root}devicetaintrules/${name}/status`, + expectJson: true, + querystring: operations.formatPatchOpts(opts), + contentType: c.getPatchContentType(type), + bodyJson: Array.isArray(body) ? body : ResourceV1alpha3.fromDeviceTaintRule(body), + abortSignal: opts.abortSignal, + }); + return ResourceV1alpha3.toDeviceTaintRule(resp); + } + } diff --git a/lib/builtin/resource.k8s.io@v1alpha3/structs.ts b/lib/builtin/resource.k8s.io@v1alpha3/structs.ts index b9bbb4c..131a3e6 100644 --- a/lib/builtin/resource.k8s.io@v1alpha3/structs.ts +++ b/lib/builtin/resource.k8s.io@v1alpha3/structs.ts @@ -7,35 +7,6 @@ type ListOf = { items: Array; }; -/** CELDeviceSelector contains a CEL expression for selecting a device. */ -export interface CELDeviceSelector { - expression: string; -} -export function toCELDeviceSelector(input: c.JSONValue): CELDeviceSelector { - const obj = c.checkObj(input); - return { - expression: c.checkStr(obj["expression"]), - }} -export function fromCELDeviceSelector(input: CELDeviceSelector): c.JSONValue { - return { - ...input, - }} - -/** DeviceSelector must have exactly one field set. */ -export interface DeviceSelector { - cel?: CELDeviceSelector | null; -} -export function toDeviceSelector(input: c.JSONValue): DeviceSelector { - const obj = c.checkObj(input); - return { - cel: c.readOpt(obj["cel"], toCELDeviceSelector), - }} -export function fromDeviceSelector(input: DeviceSelector): c.JSONValue { - return { - ...input, - cel: input.cel != null ? fromCELDeviceSelector(input.cel) : undefined, - }} - /** The device this taint is attached to has the "effect" on any claim which does not tolerate the taint and, through the claim, to pods using the claim. */ export interface DeviceTaint { effect: string; @@ -63,6 +34,7 @@ export interface DeviceTaintRule { kind?: "DeviceTaintRule"; metadata?: MetaV1.ObjectMeta | null; spec: DeviceTaintRuleSpec; + status?: DeviceTaintRuleStatus | null; } export function toDeviceTaintRule(input: c.JSONValue): DeviceTaintRule & c.ApiKind { const obj = c.checkObj(input); @@ -70,6 +42,7 @@ export function toDeviceTaintRule(input: c.JSONValue): DeviceTaintRule & c.ApiKi ...c.assertOrAddApiVersionAndKind(obj, "resource.k8s.io/v1alpha3", "DeviceTaintRule"), metadata: c.readOpt(obj["metadata"], MetaV1.toObjectMeta), spec: toDeviceTaintRuleSpec(obj["spec"]), + status: c.readOpt(obj["status"], toDeviceTaintRuleStatus), }} export function fromDeviceTaintRule(input: DeviceTaintRule): c.JSONValue { return { @@ -77,6 +50,7 @@ export function fromDeviceTaintRule(input: DeviceTaintRule): c.JSONValue { ...input, metadata: input.metadata != null ? MetaV1.fromObjectMeta(input.metadata) : undefined, spec: input.spec != null ? fromDeviceTaintRuleSpec(input.spec) : undefined, + status: input.status != null ? fromDeviceTaintRuleStatus(input.status) : undefined, }} /** DeviceTaintRuleSpec specifies the selector and one taint. */ @@ -100,24 +74,34 @@ export function fromDeviceTaintRuleSpec(input: DeviceTaintRuleSpec): c.JSONValue /** DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to. The empty selector matches all devices. Without a selector, no devices are matched. */ export interface DeviceTaintSelector { device?: string | null; - deviceClassName?: string | null; driver?: string | null; pool?: string | null; - selectors?: Array | null; } export function toDeviceTaintSelector(input: c.JSONValue): DeviceTaintSelector { const obj = c.checkObj(input); return { device: c.readOpt(obj["device"], c.checkStr), - deviceClassName: c.readOpt(obj["deviceClassName"], c.checkStr), driver: c.readOpt(obj["driver"], c.checkStr), pool: c.readOpt(obj["pool"], c.checkStr), - selectors: c.readOpt(obj["selectors"], x => c.readList(x, toDeviceSelector)), }} export function fromDeviceTaintSelector(input: DeviceTaintSelector): c.JSONValue { return { ...input, - selectors: input.selectors?.map(fromDeviceSelector), + }} + +/** DeviceTaintRuleStatus provides information about an on-going pod eviction. */ +export interface DeviceTaintRuleStatus { + conditions?: Array | null; +} +export function toDeviceTaintRuleStatus(input: c.JSONValue): DeviceTaintRuleStatus { + const obj = c.checkObj(input); + return { + conditions: c.readOpt(obj["conditions"], x => c.readList(x, MetaV1.toCondition)), + }} +export function fromDeviceTaintRuleStatus(input: DeviceTaintRuleStatus): c.JSONValue { + return { + ...input, + conditions: input.conditions?.map(MetaV1.fromCondition), }} /** DeviceTaintRuleList is a collection of DeviceTaintRules. */ diff --git a/lib/builtin/resource.k8s.io@v1beta1/structs.ts b/lib/builtin/resource.k8s.io@v1beta1/structs.ts index a53d6a8..7caa276 100644 --- a/lib/builtin/resource.k8s.io@v1beta1/structs.ts +++ b/lib/builtin/resource.k8s.io@v1beta1/structs.ts @@ -396,7 +396,7 @@ export function fromCapacityRequirements(input: CapacityRequirements): c.JSONVal requests: c.writeMap(input.requests, c.fromQuantity), }} -/** CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice. +/** CounterSet defines a named set of counters that are available to be used by devices defined in the ResourcePool. The counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices. */ export interface CounterSet { diff --git a/lib/builtin/resource.k8s.io@v1beta2/structs.ts b/lib/builtin/resource.k8s.io@v1beta2/structs.ts index 59ca59d..a9a4635 100644 --- a/lib/builtin/resource.k8s.io@v1beta2/structs.ts +++ b/lib/builtin/resource.k8s.io@v1beta2/structs.ts @@ -281,7 +281,7 @@ export function fromCounter(input: Counter): c.JSONValue { value: input.value != null ? c.fromQuantity(input.value) : undefined, }} -/** CounterSet defines a named set of counters that are available to be used by devices defined in the ResourceSlice. +/** CounterSet defines a named set of counters that are available to be used by devices defined in the ResourcePool. The counters are not allocatable by themselves, but can be referenced by devices. When a device is allocated, the portion of counters it uses will no longer be available for use by other devices. */ export interface CounterSet { diff --git a/lib/builtin/scheduling.k8s.io@v1alpha1/mod.ts b/lib/builtin/scheduling.k8s.io@v1alpha1/mod.ts new file mode 100644 index 0000000..f2ed45a --- /dev/null +++ b/lib/builtin/scheduling.k8s.io@v1alpha1/mod.ts @@ -0,0 +1,178 @@ +export * from "./structs.ts"; + +// Autogenerated API file for SchedulingV1alpha1 +import * as c from "../../common.ts"; +import * as operations from "../../operations.ts"; +import * as MetaV1 from "../meta@v1/structs.ts"; +import * as SchedulingV1alpha1 from "./structs.ts"; + +export class SchedulingV1alpha1Api { + #client: c.RestClient; + #root = "/apis/scheduling.k8s.io/v1alpha1/"; + constructor(client: c.RestClient) { + this.#client = client; + } + + namespace(name: string): SchedulingV1alpha1NamespacedApi { + return new SchedulingV1alpha1NamespacedApi(this.#client, name); + } + myNamespace(): SchedulingV1alpha1NamespacedApi { + if (!this.#client.defaultNamespace) throw new Error("No current namespace is set"); + return new SchedulingV1alpha1NamespacedApi(this.#client, this.#client.defaultNamespace); + } + + async getWorkloadListForAllNamespaces( + opts: operations.GetListOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}workloads`, + expectJson: true, + querystring: operations.formatGetListOpts(opts), + abortSignal: opts.abortSignal, + }); + return SchedulingV1alpha1.toWorkloadList(resp); + } + + async watchWorkloadListForAllNamespaces( + opts: operations.WatchListOpts = {}, + ): Promise> { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}workloads`, + expectJson: true, + expectStream: true, + querystring: operations.formatWatchListOpts(opts), + abortSignal: opts.abortSignal, + }); + return resp.pipeThrough(new c.WatchEventTransformer(SchedulingV1alpha1.toWorkload, MetaV1.toStatus)); + } + +} + +export class SchedulingV1alpha1NamespacedApi { + #client: c.RestClient + #root: string + constructor(client: c.RestClient, namespace: string) { + this.#client = client; + this.#root = `/apis/scheduling.k8s.io/v1alpha1/namespaces/${namespace}/`; + } + + async getWorkloadList( + opts: operations.GetListOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}workloads`, + expectJson: true, + querystring: operations.formatGetListOpts(opts), + abortSignal: opts.abortSignal, + }); + return SchedulingV1alpha1.toWorkloadList(resp); + } + + async watchWorkloadList( + opts: operations.WatchListOpts = {}, + ): Promise> { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}workloads`, + expectJson: true, + expectStream: true, + querystring: operations.formatWatchListOpts(opts), + abortSignal: opts.abortSignal, + }); + return resp.pipeThrough(new c.WatchEventTransformer(SchedulingV1alpha1.toWorkload, MetaV1.toStatus)); + } + + async createWorkload( + body: SchedulingV1alpha1.Workload, + opts: operations.PutOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "POST", + path: `${this.#root}workloads`, + expectJson: true, + querystring: operations.formatPutOpts(opts), + bodyJson: SchedulingV1alpha1.fromWorkload(body), + abortSignal: opts.abortSignal, + }); + return SchedulingV1alpha1.toWorkload(resp); + } + + async deleteWorkloadList( + opts: operations.DeleteListOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "DELETE", + path: `${this.#root}workloads`, + expectJson: true, + querystring: operations.formatDeleteListOpts(opts), + abortSignal: opts.abortSignal, + }); + return SchedulingV1alpha1.toWorkloadList(resp); + } + + async getWorkload( + name: string, + opts: operations.NoOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "GET", + path: `${this.#root}workloads/${name}`, + expectJson: true, + abortSignal: opts.abortSignal, + }); + return SchedulingV1alpha1.toWorkload(resp); + } + + async deleteWorkload( + name: string, + opts: operations.DeleteOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "DELETE", + path: `${this.#root}workloads/${name}`, + expectJson: true, + querystring: operations.formatDeleteOpts(opts), + abortSignal: opts.abortSignal, + }); + if (c.isStatusKind(resp)) return MetaV1.toStatus(resp); + return SchedulingV1alpha1.toWorkload(resp); + } + + async replaceWorkload( + name: string, + body: SchedulingV1alpha1.Workload, + opts: operations.PutOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "PUT", + path: `${this.#root}workloads/${name}`, + expectJson: true, + querystring: operations.formatPutOpts(opts), + bodyJson: SchedulingV1alpha1.fromWorkload(body), + abortSignal: opts.abortSignal, + }); + return SchedulingV1alpha1.toWorkload(resp); + } + + async patchWorkload( + name: string, + type: c.PatchType, + body: SchedulingV1alpha1.Workload | c.JsonPatch, + opts: operations.PatchOpts = {}, + ): Promise { + const resp = await this.#client.performRequest({ + method: "PATCH", + path: `${this.#root}workloads/${name}`, + expectJson: true, + querystring: operations.formatPatchOpts(opts), + contentType: c.getPatchContentType(type), + bodyJson: Array.isArray(body) ? body : SchedulingV1alpha1.fromWorkload(body), + abortSignal: opts.abortSignal, + }); + return SchedulingV1alpha1.toWorkload(resp); + } + +} diff --git a/lib/builtin/scheduling.k8s.io@v1alpha1/structs.ts b/lib/builtin/scheduling.k8s.io@v1alpha1/structs.ts new file mode 100644 index 0000000..ca5a56b --- /dev/null +++ b/lib/builtin/scheduling.k8s.io@v1alpha1/structs.ts @@ -0,0 +1,140 @@ +// Autogenerated Schema file for SchedulingV1alpha1 +import * as c from "../../common.ts"; + +import * as MetaV1 from "../meta@v1/structs.ts"; +type ListOf = { + metadata: MetaV1.ListMeta; + items: Array; +}; + +/** BasicSchedulingPolicy indicates that standard Kubernetes scheduling behavior should be used. */ +export interface BasicSchedulingPolicy { +} +export function toBasicSchedulingPolicy(input: c.JSONValue): BasicSchedulingPolicy { + const obj = c.checkObj(input); + return { + }} +export function fromBasicSchedulingPolicy(input: BasicSchedulingPolicy): c.JSONValue { + return { + ...input, + }} + +/** GangSchedulingPolicy defines the parameters for gang scheduling. */ +export interface GangSchedulingPolicy { + minCount: number; +} +export function toGangSchedulingPolicy(input: c.JSONValue): GangSchedulingPolicy { + const obj = c.checkObj(input); + return { + minCount: c.checkNum(obj["minCount"]), + }} +export function fromGangSchedulingPolicy(input: GangSchedulingPolicy): c.JSONValue { + return { + ...input, + }} + +/** PodGroup represents a set of pods with a common scheduling policy. */ +export interface PodGroup { + name: string; + policy: PodGroupPolicy; +} +export function toPodGroup(input: c.JSONValue): PodGroup { + const obj = c.checkObj(input); + return { + name: c.checkStr(obj["name"]), + policy: toPodGroupPolicy(obj["policy"]), + }} +export function fromPodGroup(input: PodGroup): c.JSONValue { + return { + ...input, + policy: input.policy != null ? fromPodGroupPolicy(input.policy) : undefined, + }} + +/** PodGroupPolicy defines the scheduling configuration for a PodGroup. */ +export interface PodGroupPolicy { + basic?: BasicSchedulingPolicy | null; + gang?: GangSchedulingPolicy | null; +} +export function toPodGroupPolicy(input: c.JSONValue): PodGroupPolicy { + const obj = c.checkObj(input); + return { + basic: c.readOpt(obj["basic"], toBasicSchedulingPolicy), + gang: c.readOpt(obj["gang"], toGangSchedulingPolicy), + }} +export function fromPodGroupPolicy(input: PodGroupPolicy): c.JSONValue { + return { + ...input, + basic: input.basic != null ? fromBasicSchedulingPolicy(input.basic) : undefined, + gang: input.gang != null ? fromGangSchedulingPolicy(input.gang) : undefined, + }} + +/** TypedLocalObjectReference allows to reference typed object inside the same namespace. */ +export interface TypedLocalObjectReference { + apiGroup?: string | null; + kind: string; + name: string; +} +export function toTypedLocalObjectReference(input: c.JSONValue): TypedLocalObjectReference { + const obj = c.checkObj(input); + return { + apiGroup: c.readOpt(obj["apiGroup"], c.checkStr), + kind: c.checkStr(obj["kind"]), + name: c.checkStr(obj["name"]), + }} +export function fromTypedLocalObjectReference(input: TypedLocalObjectReference): c.JSONValue { + return { + ...input, + }} + +/** Workload allows for expressing scheduling constraints that should be used when managing lifecycle of workloads from scheduling perspective, including scheduling, preemption, eviction and other phases. */ +export interface Workload { + apiVersion?: "scheduling.k8s.io/v1alpha1"; + kind?: "Workload"; + metadata?: MetaV1.ObjectMeta | null; + spec: WorkloadSpec; +} +export function toWorkload(input: c.JSONValue): Workload & c.ApiKind { + const obj = c.checkObj(input); + return { + ...c.assertOrAddApiVersionAndKind(obj, "scheduling.k8s.io/v1alpha1", "Workload"), + metadata: c.readOpt(obj["metadata"], MetaV1.toObjectMeta), + spec: toWorkloadSpec(obj["spec"]), + }} +export function fromWorkload(input: Workload): c.JSONValue { + return { + ...c.assertOrAddApiVersionAndKind(input, "scheduling.k8s.io/v1alpha1", "Workload"), + ...input, + metadata: input.metadata != null ? MetaV1.fromObjectMeta(input.metadata) : undefined, + spec: input.spec != null ? fromWorkloadSpec(input.spec) : undefined, + }} + +/** WorkloadSpec defines the desired state of a Workload. */ +export interface WorkloadSpec { + controllerRef?: TypedLocalObjectReference | null; + podGroups: Array; +} +export function toWorkloadSpec(input: c.JSONValue): WorkloadSpec { + const obj = c.checkObj(input); + return { + controllerRef: c.readOpt(obj["controllerRef"], toTypedLocalObjectReference), + podGroups: c.readList(obj["podGroups"], toPodGroup), + }} +export function fromWorkloadSpec(input: WorkloadSpec): c.JSONValue { + return { + ...input, + controllerRef: input.controllerRef != null ? fromTypedLocalObjectReference(input.controllerRef) : undefined, + podGroups: input.podGroups?.map(fromPodGroup), + }} + +/** WorkloadList contains a list of Workload resources. */ +export interface WorkloadList extends ListOf { + apiVersion?: "scheduling.k8s.io/v1alpha1"; + kind?: "WorkloadList"; +}; +export function toWorkloadList(input: c.JSONValue): WorkloadList & c.ApiKind { + const obj = c.checkObj(input); + return { + ...c.assertOrAddApiVersionAndKind(obj, "scheduling.k8s.io/v1alpha1", "WorkloadList"), + metadata: MetaV1.toListMeta(obj.metadata), + items: c.readList(obj.items, toWorkload), + }} diff --git a/lib/builtin/storage.k8s.io@v1/structs.ts b/lib/builtin/storage.k8s.io@v1/structs.ts index 3dffe79..6cd0e08 100644 --- a/lib/builtin/storage.k8s.io@v1/structs.ts +++ b/lib/builtin/storage.k8s.io@v1/structs.ts @@ -38,6 +38,7 @@ export interface CSIDriverSpec { podInfoOnMount?: boolean | null; requiresRepublish?: boolean | null; seLinuxMount?: boolean | null; + serviceAccountTokenInSecrets?: boolean | null; storageCapacity?: boolean | null; tokenRequests?: Array | null; volumeLifecycleModes?: Array | null; @@ -51,6 +52,7 @@ export function toCSIDriverSpec(input: c.JSONValue): CSIDriverSpec { podInfoOnMount: c.readOpt(obj["podInfoOnMount"], c.checkBool), requiresRepublish: c.readOpt(obj["requiresRepublish"], c.checkBool), seLinuxMount: c.readOpt(obj["seLinuxMount"], c.checkBool), + serviceAccountTokenInSecrets: c.readOpt(obj["serviceAccountTokenInSecrets"], c.checkBool), storageCapacity: c.readOpt(obj["storageCapacity"], c.checkBool), tokenRequests: c.readOpt(obj["tokenRequests"], x => c.readList(x, toTokenRequest)), volumeLifecycleModes: c.readOpt(obj["volumeLifecycleModes"], x => c.readList(x, c.checkStr)), diff --git a/lib/builtin/storage.k8s.io@v1alpha1/mod.ts b/lib/builtin/storage.k8s.io@v1alpha1/mod.ts deleted file mode 100644 index 9d0b5f2..0000000 --- a/lib/builtin/storage.k8s.io@v1alpha1/mod.ts +++ /dev/null @@ -1,133 +0,0 @@ -export * from "./structs.ts"; - -// Autogenerated API file for StorageV1alpha1 -import * as c from "../../common.ts"; -import * as operations from "../../operations.ts"; -import * as MetaV1 from "../meta@v1/structs.ts"; -import * as StorageV1alpha1 from "./structs.ts"; - -export class StorageV1alpha1Api { - #client: c.RestClient; - #root = "/apis/storage.k8s.io/v1alpha1/"; - constructor(client: c.RestClient) { - this.#client = client; - } - - async getVolumeAttributesClassList( - opts: operations.GetListOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "GET", - path: `${this.#root}volumeattributesclasses`, - expectJson: true, - querystring: operations.formatGetListOpts(opts), - abortSignal: opts.abortSignal, - }); - return StorageV1alpha1.toVolumeAttributesClassList(resp); - } - - async watchVolumeAttributesClassList( - opts: operations.WatchListOpts = {}, - ): Promise> { - const resp = await this.#client.performRequest({ - method: "GET", - path: `${this.#root}volumeattributesclasses`, - expectJson: true, - expectStream: true, - querystring: operations.formatWatchListOpts(opts), - abortSignal: opts.abortSignal, - }); - return resp.pipeThrough(new c.WatchEventTransformer(StorageV1alpha1.toVolumeAttributesClass, MetaV1.toStatus)); - } - - async createVolumeAttributesClass( - body: StorageV1alpha1.VolumeAttributesClass, - opts: operations.PutOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "POST", - path: `${this.#root}volumeattributesclasses`, - expectJson: true, - querystring: operations.formatPutOpts(opts), - bodyJson: StorageV1alpha1.fromVolumeAttributesClass(body), - abortSignal: opts.abortSignal, - }); - return StorageV1alpha1.toVolumeAttributesClass(resp); - } - - async deleteVolumeAttributesClassList( - opts: operations.DeleteListOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "DELETE", - path: `${this.#root}volumeattributesclasses`, - expectJson: true, - querystring: operations.formatDeleteListOpts(opts), - abortSignal: opts.abortSignal, - }); - return StorageV1alpha1.toVolumeAttributesClassList(resp); - } - - async getVolumeAttributesClass( - name: string, - opts: operations.NoOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "GET", - path: `${this.#root}volumeattributesclasses/${name}`, - expectJson: true, - abortSignal: opts.abortSignal, - }); - return StorageV1alpha1.toVolumeAttributesClass(resp); - } - - async deleteVolumeAttributesClass( - name: string, - opts: operations.DeleteOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "DELETE", - path: `${this.#root}volumeattributesclasses/${name}`, - expectJson: true, - querystring: operations.formatDeleteOpts(opts), - abortSignal: opts.abortSignal, - }); - if (c.isStatusKind(resp)) return MetaV1.toStatus(resp); - return StorageV1alpha1.toVolumeAttributesClass(resp); - } - - async replaceVolumeAttributesClass( - name: string, - body: StorageV1alpha1.VolumeAttributesClass, - opts: operations.PutOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "PUT", - path: `${this.#root}volumeattributesclasses/${name}`, - expectJson: true, - querystring: operations.formatPutOpts(opts), - bodyJson: StorageV1alpha1.fromVolumeAttributesClass(body), - abortSignal: opts.abortSignal, - }); - return StorageV1alpha1.toVolumeAttributesClass(resp); - } - - async patchVolumeAttributesClass( - name: string, - type: c.PatchType, - body: StorageV1alpha1.VolumeAttributesClass | c.JsonPatch, - opts: operations.PatchOpts = {}, - ): Promise { - const resp = await this.#client.performRequest({ - method: "PATCH", - path: `${this.#root}volumeattributesclasses/${name}`, - expectJson: true, - querystring: operations.formatPatchOpts(opts), - contentType: c.getPatchContentType(type), - bodyJson: Array.isArray(body) ? body : StorageV1alpha1.fromVolumeAttributesClass(body), - abortSignal: opts.abortSignal, - }); - return StorageV1alpha1.toVolumeAttributesClass(resp); - } - -} diff --git a/lib/builtin/storage.k8s.io@v1alpha1/structs.ts b/lib/builtin/storage.k8s.io@v1alpha1/structs.ts deleted file mode 100644 index 7f3b9e8..0000000 --- a/lib/builtin/storage.k8s.io@v1alpha1/structs.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Autogenerated Schema file for StorageV1alpha1 -import * as c from "../../common.ts"; - -import * as MetaV1 from "../meta@v1/structs.ts"; -type ListOf = { - metadata: MetaV1.ListMeta; - items: Array; -}; - -/** VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. */ -export interface VolumeAttributesClass { - apiVersion?: "storage.k8s.io/v1alpha1"; - kind?: "VolumeAttributesClass"; - driverName: string; - metadata?: MetaV1.ObjectMeta | null; - parameters?: Record | null; -} -export function toVolumeAttributesClass(input: c.JSONValue): VolumeAttributesClass & c.ApiKind { - const obj = c.checkObj(input); - return { - ...c.assertOrAddApiVersionAndKind(obj, "storage.k8s.io/v1alpha1", "VolumeAttributesClass"), - driverName: c.checkStr(obj["driverName"]), - metadata: c.readOpt(obj["metadata"], MetaV1.toObjectMeta), - parameters: c.readOpt(obj["parameters"], x => c.readMap(x, c.checkStr)), - }} -export function fromVolumeAttributesClass(input: VolumeAttributesClass): c.JSONValue { - return { - ...c.assertOrAddApiVersionAndKind(input, "storage.k8s.io/v1alpha1", "VolumeAttributesClass"), - ...input, - metadata: input.metadata != null ? MetaV1.fromObjectMeta(input.metadata) : undefined, - }} - -/** VolumeAttributesClassList is a collection of VolumeAttributesClass objects. */ -export interface VolumeAttributesClassList extends ListOf { - apiVersion?: "storage.k8s.io/v1alpha1"; - kind?: "VolumeAttributesClassList"; -}; -export function toVolumeAttributesClassList(input: c.JSONValue): VolumeAttributesClassList & c.ApiKind { - const obj = c.checkObj(input); - return { - ...c.assertOrAddApiVersionAndKind(obj, "storage.k8s.io/v1alpha1", "VolumeAttributesClassList"), - metadata: MetaV1.toListMeta(obj.metadata), - items: c.readList(obj.items, toVolumeAttributesClass), - }} diff --git a/lib/builtin/storagemigration.k8s.io@v1alpha1/mod.ts b/lib/builtin/storagemigration.k8s.io@v1beta1/mod.ts similarity index 63% rename from lib/builtin/storagemigration.k8s.io@v1alpha1/mod.ts rename to lib/builtin/storagemigration.k8s.io@v1beta1/mod.ts index e0aa13e..4428d73 100644 --- a/lib/builtin/storagemigration.k8s.io@v1alpha1/mod.ts +++ b/lib/builtin/storagemigration.k8s.io@v1beta1/mod.ts @@ -1,21 +1,21 @@ export * from "./structs.ts"; -// Autogenerated API file for StoragemigrationV1alpha1 +// Autogenerated API file for StoragemigrationV1beta1 import * as c from "../../common.ts"; import * as operations from "../../operations.ts"; import * as MetaV1 from "../meta@v1/structs.ts"; -import * as StoragemigrationV1alpha1 from "./structs.ts"; +import * as StoragemigrationV1beta1 from "./structs.ts"; -export class StoragemigrationV1alpha1Api { +export class StoragemigrationV1beta1Api { #client: c.RestClient; - #root = "/apis/storagemigration.k8s.io/v1alpha1/"; + #root = "/apis/storagemigration.k8s.io/v1beta1/"; constructor(client: c.RestClient) { this.#client = client; } async getStorageVersionMigrationList( opts: operations.GetListOpts = {}, - ): Promise { + ): Promise { const resp = await this.#client.performRequest({ method: "GET", path: `${this.#root}storageversionmigrations`, @@ -23,12 +23,12 @@ export class StoragemigrationV1alpha1Api { querystring: operations.formatGetListOpts(opts), abortSignal: opts.abortSignal, }); - return StoragemigrationV1alpha1.toStorageVersionMigrationList(resp); + return StoragemigrationV1beta1.toStorageVersionMigrationList(resp); } async watchStorageVersionMigrationList( opts: operations.WatchListOpts = {}, - ): Promise> { + ): Promise> { const resp = await this.#client.performRequest({ method: "GET", path: `${this.#root}storageversionmigrations`, @@ -37,27 +37,27 @@ export class StoragemigrationV1alpha1Api { querystring: operations.formatWatchListOpts(opts), abortSignal: opts.abortSignal, }); - return resp.pipeThrough(new c.WatchEventTransformer(StoragemigrationV1alpha1.toStorageVersionMigration, MetaV1.toStatus)); + return resp.pipeThrough(new c.WatchEventTransformer(StoragemigrationV1beta1.toStorageVersionMigration, MetaV1.toStatus)); } async createStorageVersionMigration( - body: StoragemigrationV1alpha1.StorageVersionMigration, + body: StoragemigrationV1beta1.StorageVersionMigration, opts: operations.PutOpts = {}, - ): Promise { + ): Promise { const resp = await this.#client.performRequest({ method: "POST", path: `${this.#root}storageversionmigrations`, expectJson: true, querystring: operations.formatPutOpts(opts), - bodyJson: StoragemigrationV1alpha1.fromStorageVersionMigration(body), + bodyJson: StoragemigrationV1beta1.fromStorageVersionMigration(body), abortSignal: opts.abortSignal, }); - return StoragemigrationV1alpha1.toStorageVersionMigration(resp); + return StoragemigrationV1beta1.toStorageVersionMigration(resp); } async deleteStorageVersionMigrationList( opts: operations.DeleteListOpts = {}, - ): Promise { + ): Promise { const resp = await this.#client.performRequest({ method: "DELETE", path: `${this.#root}storageversionmigrations`, @@ -65,26 +65,26 @@ export class StoragemigrationV1alpha1Api { querystring: operations.formatDeleteListOpts(opts), abortSignal: opts.abortSignal, }); - return StoragemigrationV1alpha1.toStorageVersionMigrationList(resp); + return StoragemigrationV1beta1.toStorageVersionMigrationList(resp); } async getStorageVersionMigration( name: string, opts: operations.NoOpts = {}, - ): Promise { + ): Promise { const resp = await this.#client.performRequest({ method: "GET", path: `${this.#root}storageversionmigrations/${name}`, expectJson: true, abortSignal: opts.abortSignal, }); - return StoragemigrationV1alpha1.toStorageVersionMigration(resp); + return StoragemigrationV1beta1.toStorageVersionMigration(resp); } async deleteStorageVersionMigration( name: string, opts: operations.DeleteOpts = {}, - ): Promise { + ): Promise { const resp = await this.#client.performRequest({ method: "DELETE", path: `${this.#root}storageversionmigrations/${name}`, @@ -93,88 +93,88 @@ export class StoragemigrationV1alpha1Api { abortSignal: opts.abortSignal, }); if (c.isStatusKind(resp)) return MetaV1.toStatus(resp); - return StoragemigrationV1alpha1.toStorageVersionMigration(resp); + return StoragemigrationV1beta1.toStorageVersionMigration(resp); } async replaceStorageVersionMigration( name: string, - body: StoragemigrationV1alpha1.StorageVersionMigration, + body: StoragemigrationV1beta1.StorageVersionMigration, opts: operations.PutOpts = {}, - ): Promise { + ): Promise { const resp = await this.#client.performRequest({ method: "PUT", path: `${this.#root}storageversionmigrations/${name}`, expectJson: true, querystring: operations.formatPutOpts(opts), - bodyJson: StoragemigrationV1alpha1.fromStorageVersionMigration(body), + bodyJson: StoragemigrationV1beta1.fromStorageVersionMigration(body), abortSignal: opts.abortSignal, }); - return StoragemigrationV1alpha1.toStorageVersionMigration(resp); + return StoragemigrationV1beta1.toStorageVersionMigration(resp); } async patchStorageVersionMigration( name: string, type: c.PatchType, - body: StoragemigrationV1alpha1.StorageVersionMigration | c.JsonPatch, + body: StoragemigrationV1beta1.StorageVersionMigration | c.JsonPatch, opts: operations.PatchOpts = {}, - ): Promise { + ): Promise { const resp = await this.#client.performRequest({ method: "PATCH", path: `${this.#root}storageversionmigrations/${name}`, expectJson: true, querystring: operations.formatPatchOpts(opts), contentType: c.getPatchContentType(type), - bodyJson: Array.isArray(body) ? body : StoragemigrationV1alpha1.fromStorageVersionMigration(body), + bodyJson: Array.isArray(body) ? body : StoragemigrationV1beta1.fromStorageVersionMigration(body), abortSignal: opts.abortSignal, }); - return StoragemigrationV1alpha1.toStorageVersionMigration(resp); + return StoragemigrationV1beta1.toStorageVersionMigration(resp); } async getStorageVersionMigrationStatus( name: string, opts: operations.NoOpts = {}, - ): Promise { + ): Promise { const resp = await this.#client.performRequest({ method: "GET", path: `${this.#root}storageversionmigrations/${name}/status`, expectJson: true, abortSignal: opts.abortSignal, }); - return StoragemigrationV1alpha1.toStorageVersionMigration(resp); + return StoragemigrationV1beta1.toStorageVersionMigration(resp); } async replaceStorageVersionMigrationStatus( name: string, - body: StoragemigrationV1alpha1.StorageVersionMigration, + body: StoragemigrationV1beta1.StorageVersionMigration, opts: operations.PutOpts = {}, - ): Promise { + ): Promise { const resp = await this.#client.performRequest({ method: "PUT", path: `${this.#root}storageversionmigrations/${name}/status`, expectJson: true, querystring: operations.formatPutOpts(opts), - bodyJson: StoragemigrationV1alpha1.fromStorageVersionMigration(body), + bodyJson: StoragemigrationV1beta1.fromStorageVersionMigration(body), abortSignal: opts.abortSignal, }); - return StoragemigrationV1alpha1.toStorageVersionMigration(resp); + return StoragemigrationV1beta1.toStorageVersionMigration(resp); } async patchStorageVersionMigrationStatus( name: string, type: c.PatchType, - body: StoragemigrationV1alpha1.StorageVersionMigration | c.JsonPatch, + body: StoragemigrationV1beta1.StorageVersionMigration | c.JsonPatch, opts: operations.PatchOpts = {}, - ): Promise { + ): Promise { const resp = await this.#client.performRequest({ method: "PATCH", path: `${this.#root}storageversionmigrations/${name}/status`, expectJson: true, querystring: operations.formatPatchOpts(opts), contentType: c.getPatchContentType(type), - bodyJson: Array.isArray(body) ? body : StoragemigrationV1alpha1.fromStorageVersionMigration(body), + bodyJson: Array.isArray(body) ? body : StoragemigrationV1beta1.fromStorageVersionMigration(body), abortSignal: opts.abortSignal, }); - return StoragemigrationV1alpha1.toStorageVersionMigration(resp); + return StoragemigrationV1beta1.toStorageVersionMigration(resp); } } diff --git a/lib/builtin/storagemigration.k8s.io@v1alpha1/structs.ts b/lib/builtin/storagemigration.k8s.io@v1beta1/structs.ts similarity index 57% rename from lib/builtin/storagemigration.k8s.io@v1alpha1/structs.ts rename to lib/builtin/storagemigration.k8s.io@v1beta1/structs.ts index ecd54b0..b701d8b 100644 --- a/lib/builtin/storagemigration.k8s.io@v1alpha1/structs.ts +++ b/lib/builtin/storagemigration.k8s.io@v1beta1/structs.ts @@ -1,4 +1,4 @@ -// Autogenerated Schema file for StoragemigrationV1alpha1 +// Autogenerated Schema file for StoragemigrationV1beta1 import * as c from "../../common.ts"; import * as MetaV1 from "../meta@v1/structs.ts"; @@ -7,50 +7,9 @@ type ListOf = { items: Array; }; -/** The names of the group, the version, and the resource. */ -export interface GroupVersionResource { - group?: string | null; - resource?: string | null; - version?: string | null; -} -export function toGroupVersionResource(input: c.JSONValue): GroupVersionResource { - const obj = c.checkObj(input); - return { - group: c.readOpt(obj["group"], c.checkStr), - resource: c.readOpt(obj["resource"], c.checkStr), - version: c.readOpt(obj["version"], c.checkStr), - }} -export function fromGroupVersionResource(input: GroupVersionResource): c.JSONValue { - return { - ...input, - }} - -/** Describes the state of a migration at a certain point. */ -export interface MigrationCondition { - lastUpdateTime?: c.Time | null; - message?: string | null; - reason?: string | null; - status: string; - type: string; -} -export function toMigrationCondition(input: c.JSONValue): MigrationCondition { - const obj = c.checkObj(input); - return { - lastUpdateTime: c.readOpt(obj["lastUpdateTime"], c.toTime), - message: c.readOpt(obj["message"], c.checkStr), - reason: c.readOpt(obj["reason"], c.checkStr), - status: c.checkStr(obj["status"]), - type: c.checkStr(obj["type"]), - }} -export function fromMigrationCondition(input: MigrationCondition): c.JSONValue { - return { - ...input, - lastUpdateTime: input.lastUpdateTime != null ? c.fromTime(input.lastUpdateTime) : undefined, - }} - /** StorageVersionMigration represents a migration of stored data to the latest storage version. */ export interface StorageVersionMigration { - apiVersion?: "storagemigration.k8s.io/v1alpha1"; + apiVersion?: "storagemigration.k8s.io/v1beta1"; kind?: "StorageVersionMigration"; metadata?: MetaV1.ObjectMeta | null; spec?: StorageVersionMigrationSpec | null; @@ -59,14 +18,14 @@ export interface StorageVersionMigration { export function toStorageVersionMigration(input: c.JSONValue): StorageVersionMigration & c.ApiKind { const obj = c.checkObj(input); return { - ...c.assertOrAddApiVersionAndKind(obj, "storagemigration.k8s.io/v1alpha1", "StorageVersionMigration"), + ...c.assertOrAddApiVersionAndKind(obj, "storagemigration.k8s.io/v1beta1", "StorageVersionMigration"), metadata: c.readOpt(obj["metadata"], MetaV1.toObjectMeta), spec: c.readOpt(obj["spec"], toStorageVersionMigrationSpec), status: c.readOpt(obj["status"], toStorageVersionMigrationStatus), }} export function fromStorageVersionMigration(input: StorageVersionMigration): c.JSONValue { return { - ...c.assertOrAddApiVersionAndKind(input, "storagemigration.k8s.io/v1alpha1", "StorageVersionMigration"), + ...c.assertOrAddApiVersionAndKind(input, "storagemigration.k8s.io/v1beta1", "StorageVersionMigration"), ...input, metadata: input.metadata != null ? MetaV1.fromObjectMeta(input.metadata) : undefined, spec: input.spec != null ? fromStorageVersionMigrationSpec(input.spec) : undefined, @@ -75,47 +34,45 @@ export function fromStorageVersionMigration(input: StorageVersionMigration): c.J /** Spec of the storage version migration. */ export interface StorageVersionMigrationSpec { - continueToken?: string | null; - resource: GroupVersionResource; + resource: MetaV1.GroupResource; } export function toStorageVersionMigrationSpec(input: c.JSONValue): StorageVersionMigrationSpec { const obj = c.checkObj(input); return { - continueToken: c.readOpt(obj["continueToken"], c.checkStr), - resource: toGroupVersionResource(obj["resource"]), + resource: MetaV1.toGroupResource(obj["resource"]), }} export function fromStorageVersionMigrationSpec(input: StorageVersionMigrationSpec): c.JSONValue { return { ...input, - resource: input.resource != null ? fromGroupVersionResource(input.resource) : undefined, + resource: input.resource != null ? MetaV1.fromGroupResource(input.resource) : undefined, }} /** Status of the storage version migration. */ export interface StorageVersionMigrationStatus { - conditions?: Array | null; + conditions?: Array | null; resourceVersion?: string | null; } export function toStorageVersionMigrationStatus(input: c.JSONValue): StorageVersionMigrationStatus { const obj = c.checkObj(input); return { - conditions: c.readOpt(obj["conditions"], x => c.readList(x, toMigrationCondition)), + conditions: c.readOpt(obj["conditions"], x => c.readList(x, MetaV1.toCondition)), resourceVersion: c.readOpt(obj["resourceVersion"], c.checkStr), }} export function fromStorageVersionMigrationStatus(input: StorageVersionMigrationStatus): c.JSONValue { return { ...input, - conditions: input.conditions?.map(fromMigrationCondition), + conditions: input.conditions?.map(MetaV1.fromCondition), }} /** StorageVersionMigrationList is a collection of storage version migrations. */ export interface StorageVersionMigrationList extends ListOf { - apiVersion?: "storagemigration.k8s.io/v1alpha1"; + apiVersion?: "storagemigration.k8s.io/v1beta1"; kind?: "StorageVersionMigrationList"; }; export function toStorageVersionMigrationList(input: c.JSONValue): StorageVersionMigrationList & c.ApiKind { const obj = c.checkObj(input); return { - ...c.assertOrAddApiVersionAndKind(obj, "storagemigration.k8s.io/v1alpha1", "StorageVersionMigrationList"), + ...c.assertOrAddApiVersionAndKind(obj, "storagemigration.k8s.io/v1beta1", "StorageVersionMigrationList"), metadata: MetaV1.toListMeta(obj.metadata), items: c.readList(obj.items, toStorageVersionMigration), }} diff --git a/lib/deno.json b/lib/deno.json index 1cd21e6..f95c9e8 100644 --- a/lib/deno.json +++ b/lib/deno.json @@ -39,10 +39,10 @@ "./resource.k8s.io/v1beta1": "./builtin/resource.k8s.io@v1beta1/mod.ts", "./resource.k8s.io/v1beta2": "./builtin/resource.k8s.io@v1beta2/mod.ts", "./scheduling.k8s.io/v1": "./builtin/scheduling.k8s.io@v1/mod.ts", + "./scheduling.k8s.io/v1alpha1": "./builtin/scheduling.k8s.io@v1alpha1/mod.ts", "./storage.k8s.io/v1": "./builtin/storage.k8s.io@v1/mod.ts", - "./storage.k8s.io/v1alpha1": "./builtin/storage.k8s.io@v1alpha1/mod.ts", "./storage.k8s.io/v1beta1": "./builtin/storage.k8s.io@v1beta1/mod.ts", - "./storagemigration.k8s.io/v1alpha1": "./builtin/storagemigration.k8s.io@v1alpha1/mod.ts", + "./storagemigration.k8s.io/v1beta1": "./builtin/storagemigration.k8s.io@v1beta1/mod.ts", "./argoproj.io/v1alpha1": "./argo-cd/argoproj.io@v1alpha1/mod.ts", diff --git a/lib/vpa/autoscaling.k8s.io@v1/structs.ts b/lib/vpa/autoscaling.k8s.io@v1/structs.ts index 3273ab6..f65bb93 100644 --- a/lib/vpa/autoscaling.k8s.io@v1/structs.ts +++ b/lib/vpa/autoscaling.k8s.io@v1/structs.ts @@ -126,6 +126,8 @@ export interface VerticalPodAutoscaler { maxAllowed?: Record | null; minAllowed?: Record | null; mode?: "Auto" | "Off" | c.UnexpectedEnumValue | null; + oomBumpUpRatio?: c.IntOrString | null; + oomMinBumpUp?: c.IntOrString | null; }> | null; } | null; targetRef: { @@ -243,6 +245,8 @@ function toVerticalPodAutoscaler_spec_resourcePolicy_containerPolicies(input: c. maxAllowed: c.readOpt(obj["maxAllowed"], x => c.readMap(x, c.toIntOrString)), minAllowed: c.readOpt(obj["minAllowed"], x => c.readMap(x, c.toIntOrString)), mode: c.readOpt(obj["mode"], (x => c.readEnum<"Auto" | "Off" | c.UnexpectedEnumValue>(x))), + oomBumpUpRatio: c.readOpt(obj["oomBumpUpRatio"], c.toIntOrString), + oomMinBumpUp: c.readOpt(obj["oomMinBumpUp"], c.toIntOrString), }} function toVerticalPodAutoscaler_spec_updatePolicy_evictionRequirements(input: c.JSONValue) { const obj = c.checkObj(input); From 29445a5a67b4a70ed429c506eb0176146d1ce952 Mon Sep 17 00:00:00 2001 From: Daniel Lamando Date: Mon, 16 Feb 2026 10:17:44 +0100 Subject: [PATCH 2/2] Update README.md --- lib/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/README.md b/lib/README.md index f258ef7..eba8b1d 100644 --- a/lib/README.md +++ b/lib/README.md @@ -44,6 +44,16 @@ for more information. ## Changelog +* `v0.7.1` on `2026.02.16`: + * Includes 'builtin' APIs generated from K8s `v1.35.1`. + * New APIs: + * `scheduling.k8s.io/v1alpha1` with kind `Workload` + * A new `GroupResource` struct is added to `meta/v1` for other APIs to reference + * `resource.k8s.io/v1alpha3 DeviceTaintRule` has a Status field now + * Removed API versions: (BREAKING) + * `PodCertificateRequest` in `certificates.k8s.io/v1alpha1` ⚠ migrate to `certificates.k8s.io/v1beta1` + * `argo-cd` and `vpa` CRDs have been updated to latest, adding several fields. + * `v0.7.0` on `2025-12-04`: * Update `@cloudydeno/kubernetes-client` dependency to latest (`v0.8.0`) * Breaking Change! Because tunnels were reimplemented, the client's type signature