@backstage/plugin-kubernetes 0.11.10-next.2 → 0.11.11-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,28 @@
|
|
|
1
1
|
# @backstage/plugin-kubernetes
|
|
2
2
|
|
|
3
|
+
## 0.11.11-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/core-components@0.14.8-next.0
|
|
9
|
+
- @backstage/catalog-model@1.5.0
|
|
10
|
+
- @backstage/core-plugin-api@1.9.2
|
|
11
|
+
- @backstage/plugin-catalog-react@1.12.1-next.0
|
|
12
|
+
- @backstage/plugin-kubernetes-common@0.7.6
|
|
13
|
+
- @backstage/plugin-kubernetes-react@0.3.6-next.0
|
|
14
|
+
|
|
15
|
+
## 0.11.10
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
- @backstage/core-components@0.14.7
|
|
21
|
+
- @backstage/catalog-model@1.5.0
|
|
22
|
+
- @backstage/plugin-catalog-react@1.12.0
|
|
23
|
+
- @backstage/plugin-kubernetes-react@0.3.5
|
|
24
|
+
- @backstage/plugin-kubernetes-common@0.7.6
|
|
25
|
+
|
|
3
26
|
## 0.11.10-next.2
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -9,13 +9,12 @@ const KubernetesContent = ({
|
|
|
9
9
|
entity,
|
|
10
10
|
refreshIntervalMs
|
|
11
11
|
}) => {
|
|
12
|
-
var _a, _b;
|
|
13
12
|
const { kubernetesObjects, error } = useKubernetesObjects(
|
|
14
13
|
entity,
|
|
15
14
|
refreshIntervalMs
|
|
16
15
|
);
|
|
17
|
-
const clusters =
|
|
18
|
-
const clustersWithErrors =
|
|
16
|
+
const clusters = kubernetesObjects?.items.map((item) => item.cluster) ?? [];
|
|
17
|
+
const clustersWithErrors = kubernetesObjects?.items.filter((r) => r.errors.length > 0) ?? [];
|
|
19
18
|
const detectedErrors = kubernetesObjects !== void 0 ? detectErrors(kubernetesObjects) : /* @__PURE__ */ new Map();
|
|
20
19
|
return /* @__PURE__ */ React.createElement(DetectedErrorsContext.Provider, { value: [...detectedErrors.values()].flat() }, /* @__PURE__ */ React.createElement(Page, { themeId: "tool" }, /* @__PURE__ */ React.createElement(Content, null, kubernetesObjects === void 0 && error === void 0 && /* @__PURE__ */ React.createElement(Progress, null), clustersWithErrors.length > 0 && /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(
|
|
21
20
|
ErrorPanel,
|
|
@@ -35,7 +34,7 @@ const KubernetesContent = ({
|
|
|
35
34
|
detectedErrors,
|
|
36
35
|
clusters
|
|
37
36
|
}
|
|
38
|
-
)), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Typography, { variant: "h3" }, "Your Clusters")), /* @__PURE__ */ React.createElement(Grid, { item: true, container: true },
|
|
37
|
+
)), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Typography, { variant: "h3" }, "Your Clusters")), /* @__PURE__ */ React.createElement(Grid, { item: true, container: true }, kubernetesObjects?.items.length <= 0 && /* @__PURE__ */ React.createElement(
|
|
39
38
|
Grid,
|
|
40
39
|
{
|
|
41
40
|
container: true,
|
|
@@ -52,10 +51,9 @@ const KubernetesContent = ({
|
|
|
52
51
|
description: `No resources on any known clusters for ${entity.metadata.name}`
|
|
53
52
|
}
|
|
54
53
|
))
|
|
55
|
-
),
|
|
56
|
-
var _a2;
|
|
54
|
+
), kubernetesObjects?.items.length > 0 && kubernetesObjects?.items.map((item, i) => {
|
|
57
55
|
const podsWithErrors = new Set(
|
|
58
|
-
|
|
56
|
+
detectedErrors.get(item.cluster.name)?.filter((de) => de.sourceRef.kind === "Pod").map((de) => de.sourceRef.name)
|
|
59
57
|
);
|
|
60
58
|
return /* @__PURE__ */ React.createElement(Grid, { item: true, key: i, xs: 12 }, /* @__PURE__ */ React.createElement(
|
|
61
59
|
Cluster,
|
|
@@ -64,7 +62,7 @@ const KubernetesContent = ({
|
|
|
64
62
|
podsWithErrors
|
|
65
63
|
}
|
|
66
64
|
));
|
|
67
|
-
}))))))
|
|
65
|
+
}))))));
|
|
68
66
|
};
|
|
69
67
|
|
|
70
68
|
export { KubernetesContent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KubernetesContent.esm.js","sources":["../src/KubernetesContent.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n ErrorPanel,\n ErrorReporting,\n Cluster,\n useKubernetesObjects,\n DetectedErrorsContext,\n} from '@backstage/plugin-kubernetes-react';\nimport {\n DetectedError,\n detectErrors,\n} from '@backstage/plugin-kubernetes-common';\nimport {\n Content,\n EmptyState,\n Page,\n Progress,\n} from '@backstage/core-components';\n\ntype KubernetesContentProps = {\n entity: Entity;\n refreshIntervalMs?: number;\n children?: React.ReactNode;\n};\n\nexport const KubernetesContent = ({\n entity,\n refreshIntervalMs,\n}: KubernetesContentProps) => {\n const { kubernetesObjects, error } = useKubernetesObjects(\n entity,\n refreshIntervalMs,\n );\n\n const clusters = kubernetesObjects?.items.map(item => item.cluster) ?? [];\n\n const clustersWithErrors =\n kubernetesObjects?.items.filter(r => r.errors.length > 0) ?? [];\n\n const detectedErrors =\n kubernetesObjects !== undefined\n ? detectErrors(kubernetesObjects)\n : new Map<string, DetectedError[]>();\n\n return (\n <DetectedErrorsContext.Provider value={[...detectedErrors.values()].flat()}>\n <Page themeId=\"tool\">\n <Content>\n {kubernetesObjects === undefined && error === undefined && (\n <Progress />\n )}\n\n {/* errors retrieved from the kubernetes clusters */}\n {clustersWithErrors.length > 0 && (\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <ErrorPanel\n entityName={entity.metadata.name}\n clustersWithErrors={clustersWithErrors}\n />\n </Grid>\n </Grid>\n )}\n\n {/* other errors */}\n {error !== undefined && (\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <ErrorPanel\n entityName={entity.metadata.name}\n errorMessage={error}\n />\n </Grid>\n </Grid>\n )}\n\n {kubernetesObjects && (\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <ErrorReporting\n detectedErrors={detectedErrors}\n clusters={clusters}\n />\n </Grid>\n <Grid item>\n <Typography variant=\"h3\">Your Clusters</Typography>\n </Grid>\n <Grid item container>\n {kubernetesObjects?.items.length <= 0 && (\n <Grid\n container\n justifyContent=\"space-around\"\n direction=\"row\"\n alignItems=\"center\"\n spacing={2}\n >\n <Grid item xs={8}>\n <EmptyState\n missing=\"data\"\n title=\"No Kubernetes resources\"\n description={`No resources on any known clusters for ${entity.metadata.name}`}\n />\n </Grid>\n </Grid>\n )}\n {kubernetesObjects?.items.length > 0 &&\n kubernetesObjects?.items.map((item, i) => {\n const podsWithErrors = new Set<string>(\n detectedErrors\n .get(item.cluster.name)\n ?.filter(de => de.sourceRef.kind === 'Pod')\n .map(de => de.sourceRef.name),\n );\n\n return (\n <Grid item key={i} xs={12}>\n <Cluster\n clusterObjects={item}\n podsWithErrors={podsWithErrors}\n />\n </Grid>\n );\n })}\n </Grid>\n </Grid>\n )}\n </Content>\n </Page>\n </DetectedErrorsContext.Provider>\n );\n};\n"],"names":[
|
|
1
|
+
{"version":3,"file":"KubernetesContent.esm.js","sources":["../src/KubernetesContent.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n ErrorPanel,\n ErrorReporting,\n Cluster,\n useKubernetesObjects,\n DetectedErrorsContext,\n} from '@backstage/plugin-kubernetes-react';\nimport {\n DetectedError,\n detectErrors,\n} from '@backstage/plugin-kubernetes-common';\nimport {\n Content,\n EmptyState,\n Page,\n Progress,\n} from '@backstage/core-components';\n\ntype KubernetesContentProps = {\n entity: Entity;\n refreshIntervalMs?: number;\n children?: React.ReactNode;\n};\n\nexport const KubernetesContent = ({\n entity,\n refreshIntervalMs,\n}: KubernetesContentProps) => {\n const { kubernetesObjects, error } = useKubernetesObjects(\n entity,\n refreshIntervalMs,\n );\n\n const clusters = kubernetesObjects?.items.map(item => item.cluster) ?? [];\n\n const clustersWithErrors =\n kubernetesObjects?.items.filter(r => r.errors.length > 0) ?? [];\n\n const detectedErrors =\n kubernetesObjects !== undefined\n ? detectErrors(kubernetesObjects)\n : new Map<string, DetectedError[]>();\n\n return (\n <DetectedErrorsContext.Provider value={[...detectedErrors.values()].flat()}>\n <Page themeId=\"tool\">\n <Content>\n {kubernetesObjects === undefined && error === undefined && (\n <Progress />\n )}\n\n {/* errors retrieved from the kubernetes clusters */}\n {clustersWithErrors.length > 0 && (\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <ErrorPanel\n entityName={entity.metadata.name}\n clustersWithErrors={clustersWithErrors}\n />\n </Grid>\n </Grid>\n )}\n\n {/* other errors */}\n {error !== undefined && (\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <ErrorPanel\n entityName={entity.metadata.name}\n errorMessage={error}\n />\n </Grid>\n </Grid>\n )}\n\n {kubernetesObjects && (\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <ErrorReporting\n detectedErrors={detectedErrors}\n clusters={clusters}\n />\n </Grid>\n <Grid item>\n <Typography variant=\"h3\">Your Clusters</Typography>\n </Grid>\n <Grid item container>\n {kubernetesObjects?.items.length <= 0 && (\n <Grid\n container\n justifyContent=\"space-around\"\n direction=\"row\"\n alignItems=\"center\"\n spacing={2}\n >\n <Grid item xs={8}>\n <EmptyState\n missing=\"data\"\n title=\"No Kubernetes resources\"\n description={`No resources on any known clusters for ${entity.metadata.name}`}\n />\n </Grid>\n </Grid>\n )}\n {kubernetesObjects?.items.length > 0 &&\n kubernetesObjects?.items.map((item, i) => {\n const podsWithErrors = new Set<string>(\n detectedErrors\n .get(item.cluster.name)\n ?.filter(de => de.sourceRef.kind === 'Pod')\n .map(de => de.sourceRef.name),\n );\n\n return (\n <Grid item key={i} xs={12}>\n <Cluster\n clusterObjects={item}\n podsWithErrors={podsWithErrors}\n />\n </Grid>\n );\n })}\n </Grid>\n </Grid>\n )}\n </Content>\n </Page>\n </DetectedErrorsContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA4CO,MAAM,oBAAoB,CAAC;AAAA,EAChC,MAAA;AAAA,EACA,iBAAA;AACF,CAA8B,KAAA;AAC5B,EAAM,MAAA,EAAE,iBAAmB,EAAA,KAAA,EAAU,GAAA,oBAAA;AAAA,IACnC,MAAA;AAAA,IACA,iBAAA;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,QAAA,GAAW,mBAAmB,KAAM,CAAA,GAAA,CAAI,UAAQ,IAAK,CAAA,OAAO,KAAK,EAAC,CAAA;AAExE,EAAM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KAAM,CAAA,GAAA,CAAI,CAAC,IAAA,EAAM,CAAM,KAAA;AACxC,IAAA,MAAM,iBAAiB,IAAI,GAAA;AAAA,MACzB,eACG,GAAI,CAAA,IAAA,CAAK,OAAQ,CAAA,IAAI,GACpB,MAAO,CAAA,CAAA,EAAA,KAAM,EAAG,CAAA,SAAA,CAAU,SAAS,KAAK,CAAA,CACzC,IAAI,CAAM,EAAA,KAAA,EAAA,CAAG,UAAU,IAAI,CAAA;AAAA,KAChC,CAAA;AAEA,IAAA,2CACG,IAAK,EAAA,EAAA,IAAA,EAAI,MAAC,GAAK,EAAA,CAAA,EAAG,IAAI,EACrB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,cAAgB,EAAA,IAAA;AAAA,QAChB,cAAA;AAAA,OAAA;AAAA,KAEJ,CAAA,CAAA;AAAA,GAEH,CACL,CACF,CAEJ,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
package/dist/Router.esm.js
CHANGED
|
@@ -6,17 +6,13 @@ import Button from '@material-ui/core/Button';
|
|
|
6
6
|
|
|
7
7
|
const KUBERNETES_ANNOTATION = "backstage.io/kubernetes-id";
|
|
8
8
|
const KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION = "backstage.io/kubernetes-label-selector";
|
|
9
|
-
const isKubernetesAvailable = (entity) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
(_b = entity.metadata.annotations) == null ? void 0 : _b[KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION]
|
|
13
|
-
);
|
|
14
|
-
};
|
|
9
|
+
const isKubernetesAvailable = (entity) => Boolean(entity.metadata.annotations?.[KUBERNETES_ANNOTATION]) || Boolean(
|
|
10
|
+
entity.metadata.annotations?.[KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION]
|
|
11
|
+
);
|
|
15
12
|
const Router = (props) => {
|
|
16
|
-
var _a, _b;
|
|
17
13
|
const { entity } = useEntity();
|
|
18
|
-
const kubernetesAnnotationValue =
|
|
19
|
-
const kubernetesLabelSelectorQueryAnnotationValue =
|
|
14
|
+
const kubernetesAnnotationValue = entity.metadata.annotations?.[KUBERNETES_ANNOTATION];
|
|
15
|
+
const kubernetesLabelSelectorQueryAnnotationValue = entity.metadata.annotations?.[KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION];
|
|
20
16
|
if (kubernetesAnnotationValue || kubernetesLabelSelectorQueryAnnotationValue) {
|
|
21
17
|
return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(
|
|
22
18
|
Route,
|
package/dist/Router.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.esm.js","sources":["../src/Router.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport { Route, Routes } from 'react-router-dom';\nimport { KubernetesContent } from './KubernetesContent';\nimport Button from '@material-ui/core/Button';\n\nconst KUBERNETES_ANNOTATION = 'backstage.io/kubernetes-id';\nconst KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION =\n 'backstage.io/kubernetes-label-selector';\n\nexport const isKubernetesAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[KUBERNETES_ANNOTATION]) ||\n Boolean(\n entity.metadata.annotations?.[KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION],\n );\n\nexport const Router = (props: { refreshIntervalMs?: number }) => {\n const { entity } = useEntity();\n\n const kubernetesAnnotationValue =\n entity.metadata.annotations?.[KUBERNETES_ANNOTATION];\n\n const kubernetesLabelSelectorQueryAnnotationValue =\n entity.metadata.annotations?.[KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION];\n\n if (\n kubernetesAnnotationValue ||\n kubernetesLabelSelectorQueryAnnotationValue\n ) {\n return (\n <Routes>\n <Route\n path=\"/\"\n element={\n <KubernetesContent\n entity={entity}\n refreshIntervalMs={props.refreshIntervalMs}\n />\n }\n />\n </Routes>\n );\n }\n\n return (\n <>\n <MissingAnnotationEmptyState annotation={KUBERNETES_ANNOTATION} />\n <h1>\n Or use a label selector query, which takes precedence over the previous\n annotation.\n </h1>\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://backstage.io/docs/features/kubernetes/configuration#surfacing-your-kubernetes-components-as-part-of-an-entity\"\n >\n Read Kubernetes Plugin Docs\n </Button>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;AA0BA,MAAM,qBAAwB,GAAA,4BAAA,CAAA;AAC9B,MAAM,0CACJ,GAAA,wCAAA,CAAA;AAEW,MAAA,qBAAA,GAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"Router.esm.js","sources":["../src/Router.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport { Route, Routes } from 'react-router-dom';\nimport { KubernetesContent } from './KubernetesContent';\nimport Button from '@material-ui/core/Button';\n\nconst KUBERNETES_ANNOTATION = 'backstage.io/kubernetes-id';\nconst KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION =\n 'backstage.io/kubernetes-label-selector';\n\nexport const isKubernetesAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[KUBERNETES_ANNOTATION]) ||\n Boolean(\n entity.metadata.annotations?.[KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION],\n );\n\nexport const Router = (props: { refreshIntervalMs?: number }) => {\n const { entity } = useEntity();\n\n const kubernetesAnnotationValue =\n entity.metadata.annotations?.[KUBERNETES_ANNOTATION];\n\n const kubernetesLabelSelectorQueryAnnotationValue =\n entity.metadata.annotations?.[KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION];\n\n if (\n kubernetesAnnotationValue ||\n kubernetesLabelSelectorQueryAnnotationValue\n ) {\n return (\n <Routes>\n <Route\n path=\"/\"\n element={\n <KubernetesContent\n entity={entity}\n refreshIntervalMs={props.refreshIntervalMs}\n />\n }\n />\n </Routes>\n );\n }\n\n return (\n <>\n <MissingAnnotationEmptyState annotation={KUBERNETES_ANNOTATION} />\n <h1>\n Or use a label selector query, which takes precedence over the previous\n annotation.\n </h1>\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://backstage.io/docs/features/kubernetes/configuration#surfacing-your-kubernetes-components-as-part-of-an-entity\"\n >\n Read Kubernetes Plugin Docs\n </Button>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;AA0BA,MAAM,qBAAwB,GAAA,4BAAA,CAAA;AAC9B,MAAM,0CACJ,GAAA,wCAAA,CAAA;AAEW,MAAA,qBAAA,GAAwB,CAAC,MACpC,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,qBAAqB,CAAC,CAC5D,IAAA,OAAA;AAAA,EACE,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,0CAA0C,CAAA;AAC1E,EAAA;AAEW,MAAA,MAAA,GAAS,CAAC,KAA0C,KAAA;AAC/D,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAE7B,EAAA,MAAM,yBACJ,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,qBAAqB,CAAA,CAAA;AAErD,EAAA,MAAM,2CACJ,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,0CAA0C,CAAA,CAAA;AAE1E,EAAA,IACE,6BACA,2CACA,EAAA;AACA,IAAA,2CACG,MACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,IAAK,EAAA,GAAA;AAAA,QACL,OACE,kBAAA,KAAA,CAAA,aAAA;AAAA,UAAC,iBAAA;AAAA,UAAA;AAAA,YACC,MAAA;AAAA,YACA,mBAAmB,KAAM,CAAA,iBAAA;AAAA,WAAA;AAAA,SAC3B;AAAA,OAAA;AAAA,KAGN,CAAA,CAAA;AAAA,GAEJ;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,sCACG,2BAA4B,EAAA,EAAA,UAAA,EAAY,uBAAuB,CAChE,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAG,EAAA,IAAA,EAAA,qFAGJ,CACA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,WAAA;AAAA,MACR,KAAM,EAAA,SAAA;AAAA,MACN,IAAK,EAAA,uHAAA;AAAA,KAAA;AAAA,IACN,6BAAA;AAAA,GAGH,CAAA,CAAA;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-kubernetes",
|
|
3
3
|
"description": "A Backstage plugin that integrates towards Kubernetes",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.11-next.0",
|
|
5
5
|
"main": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"clean": "backstage-cli package clean"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@backstage/catalog-model": "^1.5.0
|
|
38
|
-
"@backstage/core-components": "^0.14.
|
|
37
|
+
"@backstage/catalog-model": "^1.5.0",
|
|
38
|
+
"@backstage/core-components": "^0.14.8-next.0",
|
|
39
39
|
"@backstage/core-plugin-api": "^1.9.2",
|
|
40
|
-
"@backstage/plugin-catalog-react": "^1.12.
|
|
41
|
-
"@backstage/plugin-kubernetes-common": "^0.7.6
|
|
42
|
-
"@backstage/plugin-kubernetes-react": "^0.3.
|
|
40
|
+
"@backstage/plugin-catalog-react": "^1.12.1-next.0",
|
|
41
|
+
"@backstage/plugin-kubernetes-common": "^0.7.6",
|
|
42
|
+
"@backstage/plugin-kubernetes-react": "^0.3.6-next.0",
|
|
43
43
|
"@kubernetes-models/apimachinery": "^1.1.0",
|
|
44
44
|
"@kubernetes-models/base": "^4.0.1",
|
|
45
45
|
"@kubernetes/client-node": "0.20.0",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@backstage/cli": "^0.26.
|
|
64
|
-
"@backstage/dev-utils": "^1.0.
|
|
65
|
-
"@backstage/test-utils": "^1.5.
|
|
63
|
+
"@backstage/cli": "^0.26.6-next.0",
|
|
64
|
+
"@backstage/dev-utils": "^1.0.33-next.0",
|
|
65
|
+
"@backstage/test-utils": "^1.5.6-next.0",
|
|
66
66
|
"@testing-library/dom": "^10.0.0",
|
|
67
67
|
"@testing-library/jest-dom": "^6.0.0",
|
|
68
68
|
"@testing-library/react": "^15.0.0"
|