@backstage/plugin-kubernetes 0.7.10-next.2 → 0.8.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 +46 -0
- package/dist/index.d.ts +77 -31
- package/dist/index.esm.js +273 -225
- package/dist/index.esm.js.map +1 -1
- package/package.json +13 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @backstage/plugin-kubernetes
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 754be7c5106: refactor kubernetes error detection to make way for proposed solutions
|
|
8
|
+
|
|
9
|
+
**BREAKING**: `DetectedError` now appears once per Kubernetes resource per error instead of for all resources which have that error, `namespace` and `name` fields are now in `sourceRef` object `message` is now a `string` instead of a `string[]`. `ErrorDetectableKind` has been removed.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 8e00acb28db: Small tweaks to remove warnings in the console during development (mainly focusing on techdocs)
|
|
14
|
+
- e7fb0117485: fixes a bug where an empty authorization header was provided to the proxy endpoint when a cluster had a server-side auth provider
|
|
15
|
+
- c159ab64a60: `KubernetesBackendClient` now requires a `kubernetesAuthProvidersApi` value to be provided. `KubernetesApi` interface now has a proxy method requirement.
|
|
16
|
+
- e0c6e8b9c3c: Update peer dependencies
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @backstage/core-components@0.13.0
|
|
19
|
+
- @backstage/plugin-catalog-react@1.5.0
|
|
20
|
+
- @backstage/theme@0.2.19
|
|
21
|
+
- @backstage/core-plugin-api@1.5.1
|
|
22
|
+
- @backstage/catalog-model@1.3.0
|
|
23
|
+
- @backstage/plugin-kubernetes-common@0.6.2
|
|
24
|
+
- @backstage/config@1.0.7
|
|
25
|
+
- @backstage/errors@1.1.5
|
|
26
|
+
|
|
27
|
+
## 0.8.0-next.3
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- 754be7c5106: refactor kubernetes error detection to make way for proposed solutions
|
|
32
|
+
|
|
33
|
+
**BREAKING**: `DetectedError` now appears once per Kubernetes resource per error instead of for all resources which have that error, `namespace` and `name` fields are now in `sourceRef` object `message` is now a `string` instead of a `string[]`. `ErrorDetectableKind` has been removed.
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- e7fb0117485: fixes a bug where an empty authorization header was provided to the proxy endpoint when a cluster had a server-side auth provider
|
|
38
|
+
- c159ab64a60: `KubernetesBackendClient` now requires a `kubernetesAuthProvidersApi` value to be provided. `KubernetesApi` interface now has a proxy method requirement.
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
- @backstage/plugin-catalog-react@1.5.0-next.3
|
|
41
|
+
- @backstage/catalog-model@1.3.0-next.0
|
|
42
|
+
- @backstage/core-components@0.13.0-next.3
|
|
43
|
+
- @backstage/config@1.0.7
|
|
44
|
+
- @backstage/core-plugin-api@1.5.1-next.1
|
|
45
|
+
- @backstage/errors@1.1.5
|
|
46
|
+
- @backstage/theme@0.2.19-next.0
|
|
47
|
+
- @backstage/plugin-kubernetes-common@0.6.2-next.2
|
|
48
|
+
|
|
3
49
|
## 0.7.10-next.2
|
|
4
50
|
|
|
5
51
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
3
|
-
import {
|
|
3
|
+
import { OAuthApi, OpenIdConnectApi, DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
|
|
4
4
|
import { Entity } from '@backstage/catalog-model';
|
|
5
5
|
import { KubernetesRequestBody, ObjectsByEntityResponse, WorkloadsByEntityRequest, CustomObjectsByEntityRequest, ClusterObjects, CustomResourceMatcher, ClientPodStatus, ClusterAttributes } from '@backstage/plugin-kubernetes-common';
|
|
6
6
|
import { JsonObject } from '@backstage/types';
|
|
@@ -38,32 +38,25 @@ interface KubernetesApi {
|
|
|
38
38
|
}[]>;
|
|
39
39
|
getWorkloadsByEntity(request: WorkloadsByEntityRequest): Promise<ObjectsByEntityResponse>;
|
|
40
40
|
getCustomObjectsByEntity(request: CustomObjectsByEntityRequest): Promise<ObjectsByEntityResponse>;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
constructor(options: {
|
|
47
|
-
discoveryApi: DiscoveryApi;
|
|
48
|
-
identityApi: IdentityApi;
|
|
49
|
-
});
|
|
50
|
-
private handleResponse;
|
|
51
|
-
private postRequired;
|
|
52
|
-
getObjectsByEntity(requestBody: KubernetesRequestBody): Promise<ObjectsByEntityResponse>;
|
|
53
|
-
getWorkloadsByEntity(request: WorkloadsByEntityRequest): Promise<ObjectsByEntityResponse>;
|
|
54
|
-
getCustomObjectsByEntity(request: CustomObjectsByEntityRequest): Promise<ObjectsByEntityResponse>;
|
|
55
|
-
getClusters(): Promise<{
|
|
56
|
-
name: string;
|
|
57
|
-
authProvider: string;
|
|
58
|
-
}[]>;
|
|
41
|
+
proxy(options: {
|
|
42
|
+
clusterName: string;
|
|
43
|
+
path: string;
|
|
44
|
+
init?: RequestInit;
|
|
45
|
+
}): Promise<Response>;
|
|
59
46
|
}
|
|
60
47
|
|
|
61
48
|
interface KubernetesAuthProvider {
|
|
62
49
|
decorateRequestBodyForAuth(requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
|
|
50
|
+
getCredentials(): Promise<{
|
|
51
|
+
token?: string;
|
|
52
|
+
}>;
|
|
63
53
|
}
|
|
64
54
|
declare const kubernetesAuthProvidersApiRef: _backstage_core_plugin_api.ApiRef<KubernetesAuthProvidersApi>;
|
|
65
55
|
interface KubernetesAuthProvidersApi {
|
|
66
56
|
decorateRequestBodyForAuth(authProvider: string, requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
|
|
57
|
+
getCredentials(authProvider: string): Promise<{
|
|
58
|
+
token?: string;
|
|
59
|
+
}>;
|
|
67
60
|
}
|
|
68
61
|
|
|
69
62
|
declare class KubernetesAuthProviders implements KubernetesAuthProvidersApi {
|
|
@@ -75,12 +68,18 @@ declare class KubernetesAuthProviders implements KubernetesAuthProvidersApi {
|
|
|
75
68
|
};
|
|
76
69
|
});
|
|
77
70
|
decorateRequestBodyForAuth(authProvider: string, requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
|
|
71
|
+
getCredentials(authProvider: string): Promise<{
|
|
72
|
+
token?: string;
|
|
73
|
+
}>;
|
|
78
74
|
}
|
|
79
75
|
|
|
80
76
|
declare class GoogleKubernetesAuthProvider implements KubernetesAuthProvider {
|
|
81
77
|
authProvider: OAuthApi;
|
|
82
78
|
constructor(authProvider: OAuthApi);
|
|
83
79
|
decorateRequestBodyForAuth(requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
|
|
80
|
+
getCredentials(): Promise<{
|
|
81
|
+
token: string;
|
|
82
|
+
}>;
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
/**
|
|
@@ -90,6 +89,34 @@ declare class GoogleKubernetesAuthProvider implements KubernetesAuthProvider {
|
|
|
90
89
|
*/
|
|
91
90
|
declare class ServerSideKubernetesAuthProvider implements KubernetesAuthProvider {
|
|
92
91
|
decorateRequestBodyForAuth(requestBody: KubernetesRequestBody): Promise<KubernetesRequestBody>;
|
|
92
|
+
getCredentials(): Promise<{}>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare class KubernetesBackendClient implements KubernetesApi {
|
|
96
|
+
private readonly discoveryApi;
|
|
97
|
+
private readonly identityApi;
|
|
98
|
+
private readonly kubernetesAuthProvidersApi;
|
|
99
|
+
constructor(options: {
|
|
100
|
+
discoveryApi: DiscoveryApi;
|
|
101
|
+
identityApi: IdentityApi;
|
|
102
|
+
kubernetesAuthProvidersApi: KubernetesAuthProvidersApi;
|
|
103
|
+
});
|
|
104
|
+
private handleResponse;
|
|
105
|
+
private postRequired;
|
|
106
|
+
private getCluster;
|
|
107
|
+
private getCredentials;
|
|
108
|
+
getObjectsByEntity(requestBody: KubernetesRequestBody): Promise<ObjectsByEntityResponse>;
|
|
109
|
+
getWorkloadsByEntity(request: WorkloadsByEntityRequest): Promise<ObjectsByEntityResponse>;
|
|
110
|
+
getCustomObjectsByEntity(request: CustomObjectsByEntityRequest): Promise<ObjectsByEntityResponse>;
|
|
111
|
+
getClusters(): Promise<{
|
|
112
|
+
name: string;
|
|
113
|
+
authProvider: string;
|
|
114
|
+
}[]>;
|
|
115
|
+
proxy(options: {
|
|
116
|
+
clusterName: string;
|
|
117
|
+
path: string;
|
|
118
|
+
init?: RequestInit;
|
|
119
|
+
}): Promise<Response>;
|
|
93
120
|
}
|
|
94
121
|
|
|
95
122
|
type FormatClusterLinkOptions = {
|
|
@@ -157,30 +184,49 @@ declare const ErrorPanel: ({ entityName, errorMessage, clustersWithErrors, }: Er
|
|
|
157
184
|
* @public
|
|
158
185
|
*/
|
|
159
186
|
type ErrorSeverity = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
160
|
-
/**
|
|
161
|
-
* Kubernetes kinds that errors might be reported by the plugin
|
|
162
|
-
*
|
|
163
|
-
* @public
|
|
164
|
-
*/
|
|
165
|
-
type ErrorDetectableKind = 'Pod' | 'Deployment' | 'HorizontalPodAutoscaler';
|
|
166
187
|
/**
|
|
167
188
|
* A list of errors keyed by Cluster name
|
|
168
189
|
*
|
|
169
190
|
* @public
|
|
170
191
|
*/
|
|
171
192
|
type DetectedErrorsByCluster = Map<string, DetectedError[]>;
|
|
193
|
+
interface ResourceRef {
|
|
194
|
+
name: string;
|
|
195
|
+
namespace: string;
|
|
196
|
+
kind: string;
|
|
197
|
+
apiGroup: string;
|
|
198
|
+
}
|
|
172
199
|
/**
|
|
173
200
|
* Represents an error found on a Kubernetes object
|
|
174
201
|
*
|
|
175
202
|
* @public
|
|
176
203
|
*/
|
|
177
204
|
interface DetectedError {
|
|
205
|
+
type: string;
|
|
178
206
|
severity: ErrorSeverity;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
207
|
+
message: string;
|
|
208
|
+
proposedFix: ProposedFix[];
|
|
209
|
+
sourceRef: ResourceRef;
|
|
210
|
+
occuranceCount: number;
|
|
211
|
+
}
|
|
212
|
+
type ProposedFix = LogSolution | DocsSolution | EventsSolution;
|
|
213
|
+
interface ProposedFixBase {
|
|
214
|
+
errorType: string;
|
|
215
|
+
rootCauseExplanation: string;
|
|
216
|
+
possibleFixes: string[];
|
|
217
|
+
}
|
|
218
|
+
interface LogSolution extends ProposedFixBase {
|
|
219
|
+
type: 'logs';
|
|
220
|
+
container: string;
|
|
221
|
+
}
|
|
222
|
+
interface DocsSolution extends ProposedFixBase {
|
|
223
|
+
type: 'docs';
|
|
224
|
+
docsLink: string;
|
|
225
|
+
}
|
|
226
|
+
interface EventsSolution extends ProposedFixBase {
|
|
227
|
+
type: 'events';
|
|
228
|
+
docsLink: string;
|
|
229
|
+
podName: string;
|
|
184
230
|
}
|
|
185
231
|
|
|
186
232
|
/**
|
|
@@ -271,4 +317,4 @@ declare const GroupedResponsesContext: React.Context<GroupedResponses>;
|
|
|
271
317
|
|
|
272
318
|
declare const ClusterContext: React.Context<ClusterAttributes>;
|
|
273
319
|
|
|
274
|
-
export { Cluster, ClusterContext, ClusterLinksFormatter, ClusterLinksFormatterOptions, CronJobsAccordions, CustomResources, DeploymentResources, DetectedError, DetectedErrorsByCluster, EntityKubernetesContent, EntityKubernetesContentProps,
|
|
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 };
|