File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,16 @@ import { PatchStrategy } from './patch.js';
19
19
/** Kubernetes API verbs. */
20
20
type KubernetesApiAction = 'create' | 'delete' | 'patch' | 'read' | 'list' | 'replace' ;
21
21
22
+ type KubernetesObjectHeader < T extends KubernetesObject | KubernetesObject > = Pick <
23
+ T ,
24
+ 'apiVersion' | 'kind'
25
+ > & {
26
+ metadata : {
27
+ name : string ;
28
+ namespace ?: string ;
29
+ } ;
30
+ } ;
31
+
22
32
interface GroupVersion {
23
33
group : string ;
24
34
version : string ;
@@ -278,7 +288,7 @@ export class KubernetesObjectApi {
278
288
* @return Promise containing the request response and [[KubernetesObject]].
279
289
*/
280
290
public async read < T extends KubernetesObject | KubernetesObject > (
281
- spec : T ,
291
+ spec : KubernetesObjectHeader < T > ,
282
292
pretty ?: string ,
283
293
exact ?: boolean ,
284
294
exportt ?: boolean ,
Original file line number Diff line number Diff line change @@ -1725,7 +1725,7 @@ describe('KubernetesObject', () => {
1725
1725
1726
1726
it ( 'should read a custom resource' , async ( ) => {
1727
1727
interface CustomTestResource extends KubernetesObject {
1728
- spec ? : {
1728
+ spec : {
1729
1729
key : string ;
1730
1730
} ;
1731
1731
}
You can’t perform that action at this time.
0 commit comments