From e7e9a0c39cdace88bd36b8150bc95e8c76dc6974 Mon Sep 17 00:00:00 2001 From: Evangelos Skopelitis Date: Tue, 10 Dec 2024 10:32:32 -0500 Subject: [PATCH] frontend: KubeObject: Set apiVersion in constructor 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 --- frontend/src/lib/k8s/KubeObject.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/k8s/KubeObject.ts b/frontend/src/lib/k8s/KubeObject.ts index 4d457e2e7d..5322cfd19f 100644 --- a/frontend/src/lib/k8s/KubeObject.ts +++ b/frontend/src/lib/k8s/KubeObject.ts @@ -74,7 +74,10 @@ export class KubeObject { } constructor(json: T, cluster?: string) { - this.jsonData = json; + this.jsonData = { + ...json, + apiVersion: json?.apiVersion ?? (this.constructor as typeof KubeObject).apiVersion, + }; this._clusterName = cluster || getCluster() || ''; }