Skip to content

Commit 22217e9

Browse files
authored
Merge pull request #76 from FloSch62/adding_k8s_rsc [skip ci]
add NodeProfile and manifest to k8s
2 parents 6e7e0b9 + 8448c88 commit 22217e9

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/clients/kubernetesClient.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export class KubernetesClient {
5656
private secretsCache: Map<string, any[]> = new Map();
5757
private artifactsCache: Map<string, any[]> = new Map();
5858
private engineconfigsCache: Map<string, any[]> = new Map();
59+
private nodeprofilesCache: Map<string, any[]> = new Map();
60+
private manifestsCache: Map<string, any[]> = new Map();
5961
private crdCache: any[] = [];
6062

6163

@@ -84,6 +86,8 @@ export class KubernetesClient {
8486

8587
// core.eda.nokia.com/v1
8688
{ name: 'engineconfigs', group: 'core.eda.nokia.com', version: 'v1', plural: 'engineconfigs', namespaced: true },
89+
{ name: 'nodeprofiles', group: 'core.eda.nokia.com', version: 'v1', plural: 'nodeprofiles', namespaced: true },
90+
{ name: 'manifests', group: 'core.eda.nokia.com', version: 'v1', plural: 'manifests', namespaced: true },
8791

8892
// apps/v1
8993
{ name: 'deployments', group: 'apps', version: 'v1', plural: 'deployments', namespaced: true },
@@ -529,6 +533,14 @@ export class KubernetesClient {
529533
return this.engineconfigsCache.get(ns) || [];
530534
}
531535

536+
public getCachedNodeprofiles(ns: string): any[] {
537+
return this.nodeprofilesCache.get(ns) || [];
538+
}
539+
540+
public getCachedManifests(ns: string): any[] {
541+
return this.manifestsCache.get(ns) || [];
542+
}
543+
532544

533545
public async getCustomResourceYaml(
534546
group: string,
@@ -563,6 +575,26 @@ export class KubernetesClient {
563575
);
564576
}
565577

578+
public async getNodeprofileYaml(name: string, namespace: string): Promise<string> {
579+
return this.getCustomResourceYaml(
580+
'core.eda.nokia.com',
581+
'v1',
582+
'nodeprofiles',
583+
name,
584+
namespace
585+
);
586+
}
587+
588+
public async getManifestYaml(name: string, namespace: string): Promise<string> {
589+
return this.getCustomResourceYaml(
590+
'core.eda.nokia.com',
591+
'v1',
592+
'manifests',
593+
name,
594+
namespace
595+
);
596+
}
597+
566598
/**
567599
* Fetch any Kubernetes resource as YAML using the API
568600
*/

0 commit comments

Comments
 (0)