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:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user