@backstage/plugin-kubernetes-common 0.4.3 → 0.4.4-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @backstage/plugin-kubernetes-common
2
2
 
3
+ ## 0.4.4-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - cbf5d11fdf: The Kubernetes errors when fetching pod metrics are now captured and returned to the frontend.
8
+
9
+ - **BREAKING** The method `fetchPodMetricsByNamespace` in the interface `KubernetesFetcher` is changed to `fetchPodMetricsByNamespaces`. It now accepts a set of namespace strings and returns `Promise<FetchResponseWrapper>`.
10
+ - Add the `PodStatusFetchResponse` to the `FetchResponse` union type.
11
+ - Add `NOT_FOUND` to the `KubernetesErrorTypes` union type, the HTTP error with status code 404 will be mapped to this error.
12
+
13
+ - Updated dependencies
14
+ - @backstage/catalog-model@1.1.3-next.0
15
+
3
16
  ## 0.4.3
4
17
 
5
18
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { JsonObject } from '@backstage/types';
2
- import { V1Pod, V1Service, V1ConfigMap, V1Deployment, V1ReplicaSet, V1LimitRange, V1HorizontalPodAutoscaler, V1Job, V1CronJob, V1Ingress, V1StatefulSet, V1DaemonSet } from '@kubernetes/client-node';
2
+ import { V1Pod, V1Service, V1ConfigMap, V1Deployment, V1ReplicaSet, V1LimitRange, V1HorizontalPodAutoscaler, V1Job, V1CronJob, V1Ingress, V1StatefulSet, V1DaemonSet, PodStatus } from '@kubernetes/client-node';
3
3
  import { Entity } from '@backstage/catalog-model';
4
4
 
5
5
  /** @public */
@@ -83,7 +83,7 @@ interface ObjectsByEntityResponse {
83
83
  /** @public */
84
84
  declare type AuthProviderType = 'google' | 'serviceAccount' | 'aws' | 'azure';
85
85
  /** @public */
86
- declare type FetchResponse = PodFetchResponse | ServiceFetchResponse | ConfigMapFetchResponse | DeploymentFetchResponse | LimitRangeFetchReponse | ReplicaSetsFetchResponse | HorizontalPodAutoscalersFetchResponse | JobsFetchResponse | CronJobsFetchResponse | IngressesFetchResponse | CustomResourceFetchResponse | StatefulSetsFetchResponse | DaemonSetsFetchResponse;
86
+ declare type FetchResponse = PodFetchResponse | ServiceFetchResponse | ConfigMapFetchResponse | DeploymentFetchResponse | LimitRangeFetchReponse | ReplicaSetsFetchResponse | HorizontalPodAutoscalersFetchResponse | JobsFetchResponse | CronJobsFetchResponse | IngressesFetchResponse | CustomResourceFetchResponse | StatefulSetsFetchResponse | DaemonSetsFetchResponse | PodStatusFetchResponse;
87
87
  /** @public */
88
88
  interface PodFetchResponse {
89
89
  type: 'pods';
@@ -150,13 +150,18 @@ interface DaemonSetsFetchResponse {
150
150
  resources: Array<V1DaemonSet>;
151
151
  }
152
152
  /** @public */
153
+ interface PodStatusFetchResponse {
154
+ type: 'podstatus';
155
+ resources: Array<PodStatus>;
156
+ }
157
+ /** @public */
153
158
  interface KubernetesFetchError {
154
159
  errorType: KubernetesErrorTypes;
155
160
  statusCode?: number;
156
161
  resourcePath?: string;
157
162
  }
158
163
  /** @public */
159
- declare type KubernetesErrorTypes = 'BAD_REQUEST' | 'UNAUTHORIZED_ERROR' | 'SYSTEM_ERROR' | 'UNKNOWN_ERROR';
164
+ declare type KubernetesErrorTypes = 'BAD_REQUEST' | 'UNAUTHORIZED_ERROR' | 'NOT_FOUND' | 'SYSTEM_ERROR' | 'UNKNOWN_ERROR';
160
165
  /** @public */
161
166
  interface ClientCurrentResourceUsage {
162
167
  currentUsage: number | string;
@@ -177,4 +182,4 @@ interface ClientPodStatus {
177
182
  containers: ClientContainerStatus[];
178
183
  }
179
184
 
180
- export { AuthProviderType, ClientContainerStatus, ClientCurrentResourceUsage, ClientPodStatus, ClusterAttributes, ClusterObjects, ConfigMapFetchResponse, CronJobsFetchResponse, CustomObjectsByEntityRequest, CustomResourceFetchResponse, CustomResourceMatcher, DaemonSetsFetchResponse, DeploymentFetchResponse, FetchResponse, HorizontalPodAutoscalersFetchResponse, IngressesFetchResponse, JobsFetchResponse, KubernetesErrorTypes, KubernetesFetchError, KubernetesRequestAuth, KubernetesRequestBody, LimitRangeFetchReponse, ObjectsByEntityResponse, PodFetchResponse, ReplicaSetsFetchResponse, ServiceFetchResponse, StatefulSetsFetchResponse, WorkloadsByEntityRequest };
185
+ export { AuthProviderType, ClientContainerStatus, ClientCurrentResourceUsage, ClientPodStatus, ClusterAttributes, ClusterObjects, ConfigMapFetchResponse, CronJobsFetchResponse, CustomObjectsByEntityRequest, CustomResourceFetchResponse, CustomResourceMatcher, DaemonSetsFetchResponse, DeploymentFetchResponse, FetchResponse, HorizontalPodAutoscalersFetchResponse, IngressesFetchResponse, JobsFetchResponse, KubernetesErrorTypes, KubernetesFetchError, KubernetesRequestAuth, KubernetesRequestBody, LimitRangeFetchReponse, ObjectsByEntityResponse, PodFetchResponse, PodStatusFetchResponse, ReplicaSetsFetchResponse, ServiceFetchResponse, StatefulSetsFetchResponse, WorkloadsByEntityRequest };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-kubernetes-common",
3
3
  "description": "Common functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend plugin",
4
- "version": "0.4.3",
4
+ "version": "0.4.4-next.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -38,11 +38,11 @@
38
38
  "url": "https://github.com/backstage/backstage/issues"
39
39
  },
40
40
  "dependencies": {
41
- "@backstage/catalog-model": "^1.1.2",
41
+ "@backstage/catalog-model": "^1.1.3-next.0",
42
42
  "@kubernetes/client-node": "^0.17.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@backstage/cli": "^0.20.0"
45
+ "@backstage/cli": "^0.21.0-next.0"
46
46
  },
47
47
  "jest": {
48
48
  "roots": [