@backstage/plugin-kubernetes 0.6.4-next.0 → 0.6.4

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,42 @@
1
1
  # @backstage/plugin-kubernetes
2
2
 
3
+ ## 0.6.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 82e2ae6ff6: build(deps): bump `cronstrue` from 1.125.0 to 2.2.0
8
+ - 7c7919777e: build(deps-dev): bump `@testing-library/react-hooks` from 7.0.2 to 8.0.0
9
+ - 24254fd433: build(deps): bump `@testing-library/user-event` from 13.5.0 to 14.0.0
10
+ - 1023ee6353: export kubernetes components
11
+ - 230ad0826f: Bump to using `@types/node` v16
12
+ - f616d99f6f: Fix division by zero in currentToDeclaredResourceToPerc when pod resources weren't set
13
+ - Updated dependencies
14
+ - @backstage/plugin-catalog-react@1.0.1
15
+ - @backstage/catalog-model@1.0.1
16
+ - @backstage/core-components@0.9.3
17
+ - @backstage/core-plugin-api@1.0.1
18
+ - @backstage/plugin-kubernetes-common@0.2.9
19
+
20
+ ## 0.6.4-next.2
21
+
22
+ ### Patch Changes
23
+
24
+ - 82e2ae6ff6: build(deps): bump `cronstrue` from 1.125.0 to 2.2.0
25
+ - 24254fd433: build(deps): bump `@testing-library/user-event` from 13.5.0 to 14.0.0
26
+ - 230ad0826f: Bump to using `@types/node` v16
27
+ - Updated dependencies
28
+ - @backstage/core-components@0.9.3-next.2
29
+ - @backstage/core-plugin-api@1.0.1-next.0
30
+ - @backstage/plugin-catalog-react@1.0.1-next.3
31
+
32
+ ## 0.6.4-next.1
33
+
34
+ ### Patch Changes
35
+
36
+ - 1023ee6353: export kubernetes components
37
+ - Updated dependencies
38
+ - @backstage/plugin-catalog-react@1.0.1-next.1
39
+
3
40
  ## 0.6.4-next.0
4
41
 
5
42
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -2,8 +2,10 @@
2
2
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
3
3
  import { DiscoveryApi, IdentityApi, OAuthApi } from '@backstage/core-plugin-api';
4
4
  import { Entity } from '@backstage/catalog-model';
5
- import { KubernetesRequestBody, ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-common';
5
+ import { KubernetesRequestBody, ObjectsByEntityResponse, ClusterObjects, ClientPodStatus, ClusterAttributes } from '@backstage/plugin-kubernetes-common';
6
6
  import { JsonObject } from '@backstage/types';
7
+ import { V1Pod, V1ReplicaSet, V1Deployment, V1HorizontalPodAutoscaler, V1Service, V1ConfigMap, V1Ingress, V1Job, V1CronJob, V1ObjectMeta } from '@kubernetes/client-node';
8
+ import React from 'react';
7
9
 
8
10
  declare const kubernetesPlugin: _backstage_core_plugin_api.BackstagePlugin<{
9
11
  entityContent: _backstage_core_plugin_api.RouteRef<undefined>;
@@ -39,6 +41,9 @@ declare class KubernetesBackendClient implements KubernetesApi {
39
41
  }[]>;
40
42
  }
41
43
 
44
+ interface KubernetesAuthProvider {
45
+ decorateRequestBodyForAuth(requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
46
+ }
42
47
  declare const kubernetesAuthProvidersApiRef: _backstage_core_plugin_api.ApiRef<KubernetesAuthProvidersApi>;
43
48
  interface KubernetesAuthProvidersApi {
44
49
  decorateRequestBodyForAuth(authProvider: string, requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
@@ -52,6 +57,24 @@ declare class KubernetesAuthProviders implements KubernetesAuthProvidersApi {
52
57
  decorateRequestBodyForAuth(authProvider: string, requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
53
58
  }
54
59
 
60
+ declare class AwsKubernetesAuthProvider implements KubernetesAuthProvider {
61
+ decorateRequestBodyForAuth(requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
62
+ }
63
+
64
+ declare class GoogleKubernetesAuthProvider implements KubernetesAuthProvider {
65
+ authProvider: OAuthApi;
66
+ constructor(authProvider: OAuthApi);
67
+ decorateRequestBodyForAuth(requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
68
+ }
69
+
70
+ declare class GoogleServiceAccountAuthProvider implements KubernetesAuthProvider {
71
+ decorateRequestBodyForAuth(requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
72
+ }
73
+
74
+ declare class ServiceAccountKubernetesAuthProvider implements KubernetesAuthProvider {
75
+ decorateRequestBodyForAuth(requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
76
+ }
77
+
55
78
  declare type FormatClusterLinkOptions = {
56
79
  dashboardUrl?: string;
57
80
  dashboardApp?: string;
@@ -61,6 +84,20 @@ declare type FormatClusterLinkOptions = {
61
84
  };
62
85
  declare function formatClusterLink(options: FormatClusterLinkOptions): string | undefined;
63
86
 
87
+ interface DeploymentResources {
88
+ pods: V1Pod[];
89
+ replicaSets: V1ReplicaSet[];
90
+ deployments: V1Deployment[];
91
+ horizontalPodAutoscalers: V1HorizontalPodAutoscaler[];
92
+ }
93
+ interface GroupedResponses extends DeploymentResources {
94
+ services: V1Service[];
95
+ configMaps: V1ConfigMap[];
96
+ ingresses: V1Ingress[];
97
+ jobs: V1Job[];
98
+ cronJobs: V1CronJob[];
99
+ customResources: any[];
100
+ }
64
101
  interface ClusterLinksFormatterOptions {
65
102
  dashboardUrl?: URL;
66
103
  dashboardParameters?: JsonObject;
@@ -71,4 +108,109 @@ declare type ClusterLinksFormatter = (options: ClusterLinksFormatterOptions) =>
71
108
 
72
109
  declare const clusterLinksFormatters: Record<string, ClusterLinksFormatter>;
73
110
 
74
- export { EntityKubernetesContent, KubernetesApi, KubernetesAuthProviders, KubernetesAuthProvidersApi, KubernetesBackendClient, Router, clusterLinksFormatters, formatClusterLink, isKubernetesAvailable, kubernetesApiRef, kubernetesAuthProvidersApiRef, kubernetesPlugin, kubernetesPlugin as plugin };
111
+ declare type ClusterProps = {
112
+ clusterObjects: ClusterObjects;
113
+ podsWithErrors: Set<string>;
114
+ children?: React.ReactNode;
115
+ };
116
+ declare const Cluster: ({ clusterObjects, podsWithErrors }: ClusterProps) => JSX.Element;
117
+
118
+ declare type CronJobsAccordionsProps = {
119
+ children?: React.ReactNode;
120
+ };
121
+ declare const CronJobsAccordions: ({}: CronJobsAccordionsProps) => JSX.Element;
122
+
123
+ interface CustomResourcesProps {
124
+ children?: React.ReactNode;
125
+ }
126
+ declare const CustomResources: ({}: CustomResourcesProps) => JSX.Element;
127
+
128
+ declare type ErrorPanelProps = {
129
+ entityName: string;
130
+ errorMessage?: string;
131
+ clustersWithErrors?: ClusterObjects[];
132
+ children?: React.ReactNode;
133
+ };
134
+ declare const ErrorPanel: ({ entityName, errorMessage, clustersWithErrors, }: ErrorPanelProps) => JSX.Element;
135
+
136
+ declare type ErrorSeverity = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
137
+ declare type ErrorDetectableKind = 'Pod' | 'Deployment' | 'HorizontalPodAutoscaler';
138
+ declare type DetectedErrorsByCluster = Map<string, DetectedError[]>;
139
+ interface DetectedError {
140
+ severity: ErrorSeverity;
141
+ cluster: string;
142
+ kind: ErrorDetectableKind;
143
+ names: string[];
144
+ message: string[];
145
+ }
146
+
147
+ declare type ErrorReportingProps = {
148
+ detectedErrors: DetectedErrorsByCluster;
149
+ };
150
+ declare const ErrorReporting: ({ detectedErrors }: ErrorReportingProps) => JSX.Element;
151
+
152
+ declare const HorizontalPodAutoscalerDrawer: ({ hpa, expanded, children, }: {
153
+ hpa: V1HorizontalPodAutoscaler;
154
+ expanded?: boolean | undefined;
155
+ children?: React.ReactNode;
156
+ }) => JSX.Element;
157
+
158
+ declare type IngressesAccordionsProps = {};
159
+ declare const IngressesAccordions: ({}: IngressesAccordionsProps) => JSX.Element;
160
+
161
+ declare type JobsAccordionsProps = {
162
+ jobs: V1Job[];
163
+ children?: React.ReactNode;
164
+ };
165
+ declare const JobsAccordions: ({ jobs }: JobsAccordionsProps) => JSX.Element;
166
+
167
+ interface KubernetesDrawerable {
168
+ metadata?: V1ObjectMeta;
169
+ }
170
+ interface KubernetesDrawerProps<T extends KubernetesDrawerable> {
171
+ object: T;
172
+ renderObject: (obj: T) => object;
173
+ buttonVariant?: 'h5' | 'subtitle2';
174
+ kind: string;
175
+ expanded?: boolean;
176
+ children?: React.ReactNode;
177
+ }
178
+ declare const KubernetesDrawer: <T extends KubernetesDrawerable>({ object, renderObject, kind, buttonVariant, expanded, children, }: KubernetesDrawerProps<T>) => JSX.Element;
179
+
180
+ declare const PodDrawer: ({ pod, expanded, }: {
181
+ pod: V1Pod;
182
+ expanded?: boolean | undefined;
183
+ }) => JSX.Element;
184
+
185
+ declare type PodColumns = 'READY' | 'RESOURCE';
186
+ declare type PodsTablesProps = {
187
+ pods: V1Pod[];
188
+ extraColumns?: PodColumns[];
189
+ children?: React.ReactNode;
190
+ };
191
+ declare const PodsTable: ({ pods, extraColumns }: PodsTablesProps) => JSX.Element;
192
+
193
+ declare type ServicesAccordionsProps = {};
194
+ declare const ServicesAccordions: ({}: ServicesAccordionsProps) => JSX.Element;
195
+
196
+ declare type KubernetesContentProps = {
197
+ entity: Entity;
198
+ children?: React.ReactNode;
199
+ };
200
+ declare const KubernetesContent: ({ entity }: KubernetesContentProps) => JSX.Element;
201
+
202
+ interface KubernetesObjects {
203
+ kubernetesObjects: ObjectsByEntityResponse | undefined;
204
+ error: string | undefined;
205
+ }
206
+ declare const useKubernetesObjects: (entity: Entity, intervalMs?: number) => KubernetesObjects;
207
+
208
+ declare const PodNamesWithErrorsContext: React.Context<Set<string>>;
209
+
210
+ declare const PodNamesWithMetricsContext: React.Context<Map<string, ClientPodStatus>>;
211
+
212
+ declare const GroupedResponsesContext: React.Context<GroupedResponses>;
213
+
214
+ declare const ClusterContext: React.Context<ClusterAttributes>;
215
+
216
+ export { AwsKubernetesAuthProvider, Cluster, ClusterContext, ClusterLinksFormatter, ClusterLinksFormatterOptions, CronJobsAccordions, CustomResources, DeploymentResources, EntityKubernetesContent, ErrorPanel, ErrorReporting, GoogleKubernetesAuthProvider, GoogleServiceAccountAuthProvider, GroupedResponses, GroupedResponsesContext, HorizontalPodAutoscalerDrawer, IngressesAccordions, JobsAccordions, KubernetesApi, KubernetesAuthProviders, KubernetesAuthProvidersApi, KubernetesBackendClient, KubernetesContent, KubernetesDrawer, KubernetesObjects, PodDrawer, PodNamesWithErrorsContext, PodNamesWithMetricsContext, PodsTable, Router, ServiceAccountKubernetesAuthProvider, ServicesAccordions, clusterLinksFormatters, formatClusterLink, isKubernetesAvailable, kubernetesApiRef, kubernetesAuthProvidersApiRef, kubernetesPlugin, kubernetesPlugin as plugin, useKubernetesObjects };
package/dist/index.esm.js CHANGED
@@ -4,7 +4,7 @@ import React__default, { Fragment, useState, useEffect, useContext } from 'react
4
4
  import { useEntity } from '@backstage/plugin-catalog-react';
5
5
  import { Routes, Route } from 'react-router-dom';
6
6
  import { Typography, Chip, Grid, makeStyles, createStyles, Button, Drawer, IconButton, FormControlLabel, Switch, Accordion, AccordionSummary, AccordionDetails, Divider, Stepper, Step, StepLabel } from '@material-ui/core';
7
- import { WarningPanel, InfoCard, Table, StatusOK, SubvalueCell, StatusError, StatusAborted, Button as Button$1, CodeSnippet, StructuredMetadataTable, StatusPending, Page, Content, Progress, MissingAnnotationEmptyState } from '@backstage/core-components';
7
+ import { WarningPanel, InfoCard, Table, SubvalueCell, StatusOK, StatusError, StatusAborted, Button as Button$1, CodeSnippet, StructuredMetadataTable, StatusPending, Page, Content, Progress, MissingAnnotationEmptyState } from '@backstage/core-components';
8
8
  import EmptyStateImage from './assets/emptystate.svg';
9
9
  import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
10
10
  import Close from '@material-ui/icons/Close';
@@ -616,6 +616,8 @@ const useKubernetesObjects = (entity, intervalMs = 1e4) => {
616
616
 
617
617
  const PodNamesWithErrorsContext = React__default.createContext(/* @__PURE__ */ new Set());
618
618
 
619
+ const PodNamesWithMetricsContext = React__default.createContext(/* @__PURE__ */ new Map());
620
+
619
621
  const GroupedResponsesContext = React__default.createContext({
620
622
  pods: [],
621
623
  replicaSets: [],
@@ -1005,8 +1007,6 @@ const PodDrawer = ({
1005
1007
  });
1006
1008
  };
1007
1009
 
1008
- const PodNamesWithMetricsContext = React__default.createContext(/* @__PURE__ */ new Map());
1009
-
1010
1010
  const READY_COLUMNS = "READY";
1011
1011
  const RESOURCE_COLUMNS = "RESOURCE";
1012
1012
  const DEFAULT_COLUMNS = [
@@ -2217,5 +2217,5 @@ var Router$1 = /*#__PURE__*/Object.freeze({
2217
2217
  Router: Router
2218
2218
  });
2219
2219
 
2220
- export { EntityKubernetesContent, KubernetesAuthProviders, KubernetesBackendClient, Router, clusterLinksFormatters, formatClusterLink, isKubernetesAvailable, kubernetesApiRef, kubernetesAuthProvidersApiRef, kubernetesPlugin, kubernetesPlugin as plugin };
2220
+ export { AwsKubernetesAuthProvider, Cluster, ClusterContext, CronJobsAccordions, CustomResources, EntityKubernetesContent, ErrorPanel$1 as ErrorPanel, ErrorReporting, GoogleKubernetesAuthProvider, GoogleServiceAccountAuthProvider, GroupedResponsesContext, HorizontalPodAutoscalerDrawer, IngressesAccordions, JobsAccordions, KubernetesAuthProviders, KubernetesBackendClient, KubernetesContent, KubernetesDrawer, PodDrawer, PodNamesWithErrorsContext, PodNamesWithMetricsContext, PodsTable, Router, ServiceAccountKubernetesAuthProvider, ServicesAccordions, clusterLinksFormatters, formatClusterLink, isKubernetesAvailable, kubernetesApiRef, kubernetesAuthProvidersApiRef, kubernetesPlugin, kubernetesPlugin as plugin, useKubernetesObjects };
2221
2221
  //# sourceMappingURL=index.esm.js.map