feat(kubernetes): Add custom resource fetch hook (#13736)

* feat(kubernetes): wip crd hook

Signed-off-by: Matthew Clarke <mclarke@spotify.com>

* refactor hooks

Signed-off-by: Matthew Clarke <mclarke@spotify.com>

* fix tests

Signed-off-by: Matthew Clarke <mclarke@spotify.com>

* changeset

Signed-off-by: Matthew Clarke <mclarke@spotify.com>

* api reports

Signed-off-by: Matthew Clarke <mclarke@spotify.com>

* typo

Signed-off-by: Matthew Clarke <mclarke@spotify.com>

Signed-off-by: Matthew Clarke <mclarke@spotify.com>
This commit is contained in:
Matthew Clarke
2022-09-21 14:05:05 -04:00
committed by GitHub
parent 410759679a
commit 51af8361de
11 changed files with 628 additions and 216 deletions
+20 -2
View File
@@ -64,12 +64,30 @@ class MockKubernetesClient implements KubernetesApi {
async getWorkloadsByEntity(
_request: WorkloadsByEntityRequest,
): Promise<ObjectsByEntityResponse> {
throw new Error('Method not implemented.');
return {
items: [
{
cluster: { name: 'mock-cluster' },
resources: this.resources,
podMetrics: [],
errors: [],
},
],
};
}
async getCustomObjectsByEntity(
_request: CustomObjectsByEntityRequest,
): Promise<ObjectsByEntityResponse> {
throw new Error('Method not implemented.');
return {
items: [
{
cluster: { name: 'mock-cluster' },
resources: this.resources,
podMetrics: [],
errors: [],
},
],
};
}
async getObjectsByEntity(): Promise<ObjectsByEntityResponse> {