mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
update KubeObject class type definition
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
6addce21fb
commit
456490cca0
@ -87,14 +87,14 @@ export class KubeStatus {
|
|||||||
|
|
||||||
export type IKubeMetaField = keyof IKubeObjectMetadata;
|
export type IKubeMetaField = keyof IKubeObjectMetadata;
|
||||||
|
|
||||||
export class KubeObject implements ItemObject {
|
export class KubeObject<Metadata extends IKubeObjectMetadata = IKubeObjectMetadata, Status = any> implements ItemObject {
|
||||||
static readonly kind: string;
|
static readonly kind: string;
|
||||||
static readonly namespaced: boolean;
|
static readonly namespaced: boolean;
|
||||||
|
|
||||||
apiVersion: string;
|
apiVersion: string;
|
||||||
kind: string;
|
kind: string;
|
||||||
metadata: IKubeObjectMetadata;
|
metadata: Metadata;
|
||||||
status?: any;
|
status?: Status;
|
||||||
spec?: any = {};
|
spec?: any = {};
|
||||||
|
|
||||||
static create(data: any) {
|
static create(data: any) {
|
||||||
@ -266,7 +266,7 @@ export class KubeObject implements ItemObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// use unified resource-applier api for updating all k8s objects
|
// use unified resource-applier api for updating all k8s objects
|
||||||
async update<T extends KubeObject>(data: Partial<T>) {
|
async update<T extends KubeObject>(data: Partial<T>): Promise<T> {
|
||||||
return resourceApplierApi.update<T>({
|
return resourceApplierApi.update<T>({
|
||||||
...this.toPlainObject(),
|
...this.toPlainObject(),
|
||||||
...data,
|
...data,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user