Merge pull request #13966 from namco1992/pod-metrics-error-handling

[K8s plugin] Handle the error when fetching pod metrics
This commit is contained in:
Johan Haals
2022-10-19 10:55:47 +02:00
committed by GitHub
10 changed files with 712 additions and 468 deletions
+12 -1
View File
@@ -5,6 +5,7 @@
```ts
import { Entity } from '@backstage/catalog-model';
import type { JsonObject } from '@backstage/types';
import { PodStatus } from '@kubernetes/client-node';
import { V1ConfigMap } from '@kubernetes/client-node';
import { V1CronJob } from '@kubernetes/client-node';
import { V1DaemonSet } from '@kubernetes/client-node';
@@ -147,7 +148,8 @@ export type FetchResponse =
| IngressesFetchResponse
| CustomResourceFetchResponse
| StatefulSetsFetchResponse
| DaemonSetsFetchResponse;
| DaemonSetsFetchResponse
| PodStatusFetchResponse;
// @public (undocumented)
export interface HorizontalPodAutoscalersFetchResponse {
@@ -177,6 +179,7 @@ export interface JobsFetchResponse {
export type KubernetesErrorTypes =
| 'BAD_REQUEST'
| 'UNAUTHORIZED_ERROR'
| 'NOT_FOUND'
| 'SYSTEM_ERROR'
| 'UNKNOWN_ERROR';
@@ -230,6 +233,14 @@ export interface PodFetchResponse {
type: 'pods';
}
// @public (undocumented)
export interface PodStatusFetchResponse {
// (undocumented)
resources: Array<PodStatus>;
// (undocumented)
type: 'podstatus';
}
// @public (undocumented)
export interface ReplicaSetsFetchResponse {
// (undocumented)
+10 -1
View File
@@ -16,6 +16,7 @@
import type { JsonObject } from '@backstage/types';
import {
PodStatus,
V1ConfigMap,
V1CronJob,
V1DaemonSet,
@@ -134,7 +135,8 @@ export type FetchResponse =
| IngressesFetchResponse
| CustomResourceFetchResponse
| StatefulSetsFetchResponse
| DaemonSetsFetchResponse;
| DaemonSetsFetchResponse
| PodStatusFetchResponse;
/** @public */
export interface PodFetchResponse {
@@ -214,6 +216,12 @@ export interface DaemonSetsFetchResponse {
resources: Array<V1DaemonSet>;
}
/** @public */
export interface PodStatusFetchResponse {
type: 'podstatus';
resources: Array<PodStatus>;
}
/** @public */
export interface KubernetesFetchError {
errorType: KubernetesErrorTypes;
@@ -225,6 +233,7 @@ export interface KubernetesFetchError {
export type KubernetesErrorTypes =
| 'BAD_REQUEST'
| 'UNAUTHORIZED_ERROR'
| 'NOT_FOUND'
| 'SYSTEM_ERROR'
| 'UNKNOWN_ERROR';