Skip to content

Commit

Permalink
frontend: KubeObject: Set apiVersion in constructor
Browse files Browse the repository at this point in the history
This change sets the apiVersion in the KubeObject constructor to ensure
that valid row actions for the given KubeObject are visible.

Fixes: #2633

Signed-off-by: Evangelos Skopelitis <eskopelitis@microsoft.com>
  • Loading branch information
skoeva committed Dec 10, 2024
1 parent 7344b4c commit e7e9a0c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/lib/k8s/KubeObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export class KubeObject<T extends KubeObjectInterface | KubeEvent = any> {
}

constructor(json: T, cluster?: string) {
this.jsonData = json;
this.jsonData = {
...json,
apiVersion: json?.apiVersion ?? (this.constructor as typeof KubeObject).apiVersion,
};
this._clusterName = cluster || getCluster() || '';
}

Expand Down

0 comments on commit e7e9a0c

Please sign in to comment.