@backstage/plugin-kubernetes 0.8.1-next.0 → 0.9.0-next.2

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,63 @@
1
1
  # @backstage/plugin-kubernetes
2
2
 
3
+ ## 0.9.0-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - c7bad1005ba: The Kubernetes plugin now requests AKS access tokens from Azure when retrieving
8
+ objects from clusters configured with `authProvider: aks` and sets `auth.aks` in
9
+ its request bodies appropriately.
10
+ - Updated dependencies
11
+ - @backstage/theme@0.3.0-next.0
12
+ - @backstage/core-components@0.13.1-next.1
13
+ - @backstage/plugin-kubernetes-common@0.6.3-next.0
14
+ - @backstage/plugin-catalog-react@1.6.0-next.2
15
+ - @backstage/config@1.0.7
16
+ - @backstage/core-plugin-api@1.5.1
17
+
18
+ ## 0.9.0-next.1
19
+
20
+ ### Minor Changes
21
+
22
+ - 280ec10c18e: Added Pod logs components for Kubernetes plugin
23
+
24
+ **BREAKING**: `kubernetesProxyApi` for custom plugins built with components from the Kubernetes plugin apis, `kubernetesProxyApi` should be added to the plugin's API list.
25
+
26
+ ```
27
+ ...
28
+ export const kubernetesPlugin = createPlugin({
29
+ id: 'kubernetes',
30
+ apis: [
31
+ ...
32
+ createApiFactory({
33
+ api: kubernetesProxyApiRef,
34
+ deps: {
35
+ kubernetesApi: kubernetesApiRef,
36
+ },
37
+ factory: ({ kubernetesApi }) =>
38
+ new KubernetesProxyClient({
39
+ kubernetesApi,
40
+ }),
41
+ }),
42
+ ```
43
+
44
+ **BREAKING**: `KubernetesDrawer` is now called `KubernetesStructuredMetadataTableDrawer` so that we can do more than just show `StructuredMetadataTable`
45
+
46
+ `import { KubernetesDrawer } from "@backstage/plugin-kubernetes"`
47
+
48
+ should now be:
49
+
50
+ `import { KubernetesStructuredMetadataTableDrawer } from "@backstage/plugin-kubernetes"`
51
+
52
+ ### Patch Changes
53
+
54
+ - a160e02c3d7: Omit managed fields in the Kubernetes resource YAML display.
55
+ - Updated dependencies
56
+ - @backstage/core-components@0.13.1-next.0
57
+ - @backstage/core-plugin-api@1.5.1
58
+ - @backstage/plugin-catalog-react@1.6.0-next.1
59
+ - @backstage/config@1.0.7
60
+
3
61
  ## 0.8.1-next.0
4
62
 
5
63
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -2,10 +2,12 @@
2
2
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
3
3
  import { OAuthApi, OpenIdConnectApi, DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
4
4
  import { Entity } from '@backstage/catalog-model';
5
- import { KubernetesRequestBody, ObjectsByEntityResponse, WorkloadsByEntityRequest, CustomObjectsByEntityRequest, ClusterObjects, CustomResourceMatcher, ClientPodStatus, ClusterAttributes } from '@backstage/plugin-kubernetes-common';
5
+ import { KubernetesRequestBody, ObjectsByEntityResponse, WorkloadsByEntityRequest, CustomObjectsByEntityRequest, ClusterObjects, ClusterAttributes, CustomResourceMatcher, ClientPodStatus } from '@backstage/plugin-kubernetes-common';
6
6
  import { JsonObject } from '@backstage/types';
7
7
  import { V1Pod, V1ReplicaSet, V1Deployment, V1HorizontalPodAutoscaler, V1Service, V1ConfigMap, V1Ingress, V1Job, V1CronJob, V1StatefulSet, V1ObjectMeta } from '@kubernetes/client-node';
8
8
  import React from 'react';
9
+ import { IObjectMeta } from '@kubernetes-models/apimachinery/apis/meta/v1/ObjectMeta';
10
+ import { Pod } from 'kubernetes-models/v1';
9
11
 
10
12
  declare const kubernetesPlugin: _backstage_core_plugin_api.BackstagePlugin<{
11
13
  entityContent: _backstage_core_plugin_api.RouteRef<undefined>;
@@ -29,6 +31,7 @@ declare const Router: (props: {
29
31
  }) => JSX.Element;
30
32
 
31
33
  declare const kubernetesApiRef: _backstage_core_plugin_api.ApiRef<KubernetesApi>;
34
+ declare const kubernetesProxyApiRef: _backstage_core_plugin_api.ApiRef<KubernetesProxyApi>;
32
35
  interface KubernetesApi {
33
36
  getObjectsByEntity(requestBody: KubernetesRequestBody): Promise<ObjectsByEntityResponse>;
34
37
  getClusters(): Promise<{
@@ -44,6 +47,16 @@ interface KubernetesApi {
44
47
  init?: RequestInit;
45
48
  }): Promise<Response>;
46
49
  }
50
+ interface KubernetesProxyApi {
51
+ getPodLogs(request: {
52
+ podName: string;
53
+ namespace: string;
54
+ clusterName: string;
55
+ containerName: string;
56
+ }): Promise<{
57
+ text: string;
58
+ }>;
59
+ }
47
60
 
48
61
  interface KubernetesAuthProvider {
49
62
  decorateRequestBodyForAuth(requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
@@ -62,6 +75,7 @@ interface KubernetesAuthProvidersApi {
62
75
  declare class KubernetesAuthProviders implements KubernetesAuthProvidersApi {
63
76
  private readonly kubernetesAuthProviderMap;
64
77
  constructor(options: {
78
+ microsoftAuthApi: OAuthApi;
65
79
  googleAuthApi: OAuthApi;
66
80
  oidcProviders?: {
67
81
  [key: string]: OpenIdConnectApi;
@@ -119,6 +133,27 @@ declare class KubernetesBackendClient implements KubernetesApi {
119
133
  }): Promise<Response>;
120
134
  }
121
135
 
136
+ /**
137
+ * A client for common requests through the proxy endpoint of the kubernetes backend plugin.
138
+ *
139
+ * @public
140
+ */
141
+ declare class KubernetesProxyClient {
142
+ private readonly kubernetesApi;
143
+ constructor(options: {
144
+ kubernetesApi: KubernetesApi;
145
+ });
146
+ private handleText;
147
+ getPodLogs({ podName, namespace, clusterName, containerName, }: {
148
+ podName: string;
149
+ namespace: string;
150
+ clusterName: string;
151
+ containerName: string;
152
+ }): Promise<{
153
+ text: string;
154
+ }>;
155
+ }
156
+
122
157
  type FormatClusterLinkOptions = {
123
158
  dashboardUrl?: string;
124
159
  dashboardApp?: string;
@@ -170,13 +205,13 @@ interface CustomResourcesProps {
170
205
  }
171
206
  declare const CustomResources: ({}: CustomResourcesProps) => JSX.Element;
172
207
 
173
- type ErrorPanelProps = {
208
+ type ErrorPanelProps$1 = {
174
209
  entityName: string;
175
210
  errorMessage?: string;
176
211
  clustersWithErrors?: ClusterObjects[];
177
212
  children?: React.ReactNode;
178
213
  };
179
- declare const ErrorPanel: ({ entityName, errorMessage, clustersWithErrors, }: ErrorPanelProps) => JSX.Element;
214
+ declare const ErrorPanel: ({ entityName, errorMessage, clustersWithErrors, }: ErrorPanelProps$1) => JSX.Element;
180
215
 
181
216
  /**
182
217
  * Severity of the error, where 10 is critical and 0 is very low.
@@ -258,10 +293,16 @@ type JobsAccordionsProps = {
258
293
  };
259
294
  declare const JobsAccordions: ({ jobs }: JobsAccordionsProps) => JSX.Element;
260
295
 
296
+ type ErrorPanelProps = {
297
+ cluster: ClusterAttributes;
298
+ errorMessage?: string;
299
+ children?: React.ReactNode;
300
+ };
301
+ declare const LinkErrorPanel: ({ cluster, errorMessage }: ErrorPanelProps) => JSX.Element;
261
302
  interface KubernetesDrawerable {
262
303
  metadata?: V1ObjectMeta;
263
304
  }
264
- interface KubernetesDrawerProps<T extends KubernetesDrawerable> {
305
+ interface KubernetesStructuredMetadataTableDrawerProps<T extends KubernetesDrawerable> {
265
306
  object: T;
266
307
  renderObject: (obj: T) => object;
267
308
  buttonVariant?: 'h5' | 'subtitle2';
@@ -269,13 +310,39 @@ interface KubernetesDrawerProps<T extends KubernetesDrawerable> {
269
310
  expanded?: boolean;
270
311
  children?: React.ReactNode;
271
312
  }
272
- declare const KubernetesDrawer: <T extends KubernetesDrawerable>({ object, renderObject, kind, buttonVariant, expanded, children, }: KubernetesDrawerProps<T>) => JSX.Element;
313
+ declare const KubernetesStructuredMetadataTableDrawer: <T extends KubernetesDrawerable>({ object, renderObject, kind, buttonVariant, expanded, children, }: KubernetesStructuredMetadataTableDrawerProps<T>) => JSX.Element;
273
314
 
274
- /** @public */
275
- declare const PodDrawer: (props: {
276
- pod: V1Pod;
277
- expanded?: boolean;
278
- }) => JSX.Element;
315
+ interface KubernetesObject {
316
+ kind: string;
317
+ metadata?: IObjectMeta;
318
+ }
319
+ interface KubernetesDrawerContentProps {
320
+ close: () => void;
321
+ kubernetesObject: KubernetesObject;
322
+ header?: React.ReactNode;
323
+ children?: React.ReactNode;
324
+ }
325
+ declare const KubernetesDrawerContent: ({ children, header, kubernetesObject, close, }: KubernetesDrawerContentProps) => JSX.Element;
326
+ interface KubernetesDrawerProps {
327
+ open?: boolean;
328
+ kubernetesObject: KubernetesObject;
329
+ label: React.ReactNode;
330
+ drawerContentsHeader?: React.ReactNode;
331
+ children?: React.ReactNode;
332
+ }
333
+ declare const KubernetesDrawer: ({ open, label, drawerContentsHeader, kubernetesObject, children, }: KubernetesDrawerProps) => JSX.Element;
334
+
335
+ interface PodAndErrors {
336
+ clusterName: string;
337
+ pod: Pod;
338
+ errors: any[];
339
+ }
340
+
341
+ interface PodDrawerProps {
342
+ open?: boolean;
343
+ podAndErrors: PodAndErrors;
344
+ }
345
+ declare const PodDrawer: ({ podAndErrors, open }: PodDrawerProps) => JSX.Element;
279
346
 
280
347
  type PodColumns = 'READY' | 'RESOURCE';
281
348
  type PodsTablesProps = {
@@ -317,4 +384,4 @@ declare const GroupedResponsesContext: React.Context<GroupedResponses>;
317
384
 
318
385
  declare const ClusterContext: React.Context<ClusterAttributes>;
319
386
 
320
- export { Cluster, ClusterContext, ClusterLinksFormatter, ClusterLinksFormatterOptions, CronJobsAccordions, CustomResources, DeploymentResources, DetectedError, DetectedErrorsByCluster, EntityKubernetesContent, EntityKubernetesContentProps, ErrorPanel, ErrorReporting, ErrorSeverity, GoogleKubernetesAuthProvider, GroupedResponses, GroupedResponsesContext, HorizontalPodAutoscalerDrawer, IngressesAccordions, JobsAccordions, KubernetesApi, KubernetesAuthProviders, KubernetesAuthProvidersApi, KubernetesBackendClient, KubernetesContent, KubernetesDrawer, KubernetesObjects, PodDrawer, PodNamesWithErrorsContext, PodNamesWithMetricsContext, PodsTable, Router, ServerSideKubernetesAuthProvider, ServicesAccordions, clusterLinksFormatters, detectErrors, formatClusterLink, isKubernetesAvailable, kubernetesApiRef, kubernetesAuthProvidersApiRef, kubernetesPlugin, kubernetesPlugin as plugin, useCustomResources, useKubernetesObjects };
387
+ export { Cluster, ClusterContext, ClusterLinksFormatter, ClusterLinksFormatterOptions, CronJobsAccordions, CustomResources, DeploymentResources, DetectedError, DetectedErrorsByCluster, EntityKubernetesContent, EntityKubernetesContentProps, ErrorPanel, ErrorReporting, ErrorSeverity, GoogleKubernetesAuthProvider, GroupedResponses, GroupedResponsesContext, HorizontalPodAutoscalerDrawer, IngressesAccordions, JobsAccordions, KubernetesApi, KubernetesAuthProviders, KubernetesAuthProvidersApi, KubernetesBackendClient, KubernetesContent, KubernetesDrawer, KubernetesDrawerContent, KubernetesObjects, KubernetesProxyApi, KubernetesProxyClient, KubernetesStructuredMetadataTableDrawer, LinkErrorPanel, PodDrawer, PodNamesWithErrorsContext, PodNamesWithMetricsContext, PodsTable, Router, ServerSideKubernetesAuthProvider, ServicesAccordions, clusterLinksFormatters, detectErrors, formatClusterLink, isKubernetesAvailable, kubernetesApiRef, kubernetesAuthProvidersApiRef, kubernetesPlugin, kubernetesProxyApiRef, kubernetesPlugin as plugin, useCustomResources, useKubernetesObjects };