Skip to content

Commit

Permalink
Fix type definition for KubernetesObjectApi.read()
Browse files Browse the repository at this point in the history
  • Loading branch information
jportner committed Dec 29, 2024
1 parent 4739cd0 commit 85007ed
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ import { PatchStrategy } from './patch.js';
/** Kubernetes API verbs. */
type KubernetesApiAction = 'create' | 'delete' | 'patch' | 'read' | 'list' | 'replace';

type KubernetesObjectHeader<T extends KubernetesObject | KubernetesObject> = Pick<
T,
'apiVersion' | 'kind'
> & {
metadata: {
name: string;
namespace?: string;
};
};

interface GroupVersion {
group: string;
version: string;
Expand Down Expand Up @@ -278,7 +288,7 @@ export class KubernetesObjectApi {
* @return Promise containing the request response and [[KubernetesObject]].
*/
public async read<T extends KubernetesObject | KubernetesObject>(
spec: T,
spec: KubernetesObjectHeader<T>,
pretty?: string,
exact?: boolean,
exportt?: boolean,
Expand Down

0 comments on commit 85007ed

Please sign in to comment.