From 8448c88acbe8e97673ce00567f10370e54d58734 Mon Sep 17 00:00:00 2001 From: Flosch62 Date: Sun, 7 Sep 2025 15:44:58 +0200 Subject: [PATCH] add NodeProfile and manifest to k8s --- src/clients/kubernetesClient.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/clients/kubernetesClient.ts b/src/clients/kubernetesClient.ts index d312d30..55e3faf 100644 --- a/src/clients/kubernetesClient.ts +++ b/src/clients/kubernetesClient.ts @@ -56,6 +56,8 @@ export class KubernetesClient { private secretsCache: Map = new Map(); private artifactsCache: Map = new Map(); private engineconfigsCache: Map = new Map(); + private nodeprofilesCache: Map = new Map(); + private manifestsCache: Map = new Map(); private crdCache: any[] = []; @@ -84,6 +86,8 @@ export class KubernetesClient { // core.eda.nokia.com/v1 { name: 'engineconfigs', group: 'core.eda.nokia.com', version: 'v1', plural: 'engineconfigs', namespaced: true }, + { name: 'nodeprofiles', group: 'core.eda.nokia.com', version: 'v1', plural: 'nodeprofiles', namespaced: true }, + { name: 'manifests', group: 'core.eda.nokia.com', version: 'v1', plural: 'manifests', namespaced: true }, // apps/v1 { name: 'deployments', group: 'apps', version: 'v1', plural: 'deployments', namespaced: true }, @@ -529,6 +533,14 @@ export class KubernetesClient { return this.engineconfigsCache.get(ns) || []; } + public getCachedNodeprofiles(ns: string): any[] { + return this.nodeprofilesCache.get(ns) || []; + } + + public getCachedManifests(ns: string): any[] { + return this.manifestsCache.get(ns) || []; + } + public async getCustomResourceYaml( group: string, @@ -563,6 +575,26 @@ export class KubernetesClient { ); } + public async getNodeprofileYaml(name: string, namespace: string): Promise { + return this.getCustomResourceYaml( + 'core.eda.nokia.com', + 'v1', + 'nodeprofiles', + name, + namespace + ); + } + + public async getManifestYaml(name: string, namespace: string): Promise { + return this.getCustomResourceYaml( + 'core.eda.nokia.com', + 'v1', + 'manifests', + name, + namespace + ); + } + /** * Fetch any Kubernetes resource as YAML using the API */