@backstage/plugin-kubernetes-cluster 0.0.22-next.0 → 0.0.22-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,35 @@
1
1
  # @backstage/plugin-kubernetes-cluster
2
2
 
3
+ ## 0.0.22-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - ca3da29: The `/clusters` endpoint is now protected by the `kubernetes.clusters.read` permission.
8
+ The `/services/:serviceId` endpoint is now protected by the `kubernetes.resources.read` permission.
9
+ The `/resources` endpoints are now protected by the `kubernetes.resources.read` permission.
10
+ - Updated dependencies
11
+ - @backstage/core-components@0.16.4-next.1
12
+ - @backstage/plugin-kubernetes-common@0.9.3-next.1
13
+ - @backstage/plugin-catalog-react@1.15.2-next.2
14
+ - @backstage/catalog-model@1.7.3
15
+ - @backstage/core-plugin-api@1.10.4-next.0
16
+ - @backstage/plugin-kubernetes-react@0.5.4-next.2
17
+ - @backstage/plugin-permission-react@0.4.31-next.0
18
+
19
+ ## 0.0.22-next.1
20
+
21
+ ### Patch Changes
22
+
23
+ - d80b08f: Improved rendering of Kubernetes resources' metadata.
24
+ - 58ec9e7: Removed older versions of React packages as a preparatory step for upgrading to React 19. This commit does not introduce any functional changes, but removes dependencies on previous React versions, allowing for a cleaner upgrade path in subsequent commits.
25
+ - Updated dependencies
26
+ - @backstage/plugin-kubernetes-react@0.5.4-next.1
27
+ - @backstage/core-components@0.16.4-next.0
28
+ - @backstage/core-plugin-api@1.10.4-next.0
29
+ - @backstage/plugin-catalog-react@1.15.2-next.1
30
+ - @backstage/catalog-model@1.7.3
31
+ - @backstage/plugin-kubernetes-common@0.9.3-next.0
32
+
3
33
  ## 0.0.22-next.0
4
34
 
5
35
  ### Patch Changes
@@ -0,0 +1,9 @@
1
+ import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/alpha';
2
+
3
+ /** @alpha */
4
+ declare const kubernetesClusterTranslationRef: _backstage_core_plugin_api_alpha.TranslationRef<"kubernetes-cluster", {
5
+ readonly "kubernetesClusterContentPage.permissionAlert.message": "To view Kubernetes objects, contact your portal administrator to give you the 'kubernetes.clusters.read' permission.";
6
+ readonly "kubernetesClusterContentPage.permissionAlert.title": "Permission required";
7
+ }>;
8
+
9
+ export { kubernetesClusterTranslationRef };
@@ -0,0 +1,2 @@
1
+ export { kubernetesClusterTranslationRef } from './translation.esm.js';
2
+ //# sourceMappingURL=alpha.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -34,7 +34,8 @@ const ClusterOverview = () => {
34
34
  "Backstage auth provider": value.authProvider,
35
35
  "OIDC Token Provider": value.oidcTokenProvider ?? "N/A",
36
36
  "Dashboard Link": value.dashboardUrl ?? "N/A"
37
- }
37
+ },
38
+ options: { nestedValuesAsYaml: true }
38
39
  }
39
40
  ));
40
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ClusterOverview.esm.js","sources":["../../../src/components/ClusterOverview/ClusterOverview.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 */\nimport React, { useCallback, useEffect } from 'react';\nimport { InfoCard, StructuredMetadataTable } from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useCluster } from './useCluster';\nimport Skeleton from '@material-ui/lab/Skeleton';\nimport { Theme, createStyles, makeStyles } from '@material-ui/core/styles';\nimport { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\n\nconst useStyles = makeStyles((_theme: Theme) =>\n createStyles({\n root: {\n height: '100%',\n },\n }),\n);\n\nexport const ClusterOverview = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { value, loading, error } = useCluster({\n clusterName: entity.metadata.name,\n });\n const { setError } = useKubernetesClusterError();\n const setErrorCallback = useCallback(setError, [setError]);\n useEffect(() => {\n if (error) {\n setErrorCallback(error.message);\n }\n }, [error, setErrorCallback]);\n\n return (\n <InfoCard title=\"Cluster Overview\" className={classes.root}>\n {!value && loading && (\n <>\n <Skeleton height=\"35rem\" />\n </>\n )}\n {value && (\n <StructuredMetadataTable\n metadata={{\n name: value.name,\n 'Backstage auth provider': value.authProvider,\n 'OIDC Token Provider': value.oidcTokenProvider ?? 'N/A',\n 'Dashboard Link': value.dashboardUrl ?? 'N/A',\n }}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAuBA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,WAC5B,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,MAAQ,EAAA;AAAA;AACV,GACD;AACH,CAAA;AAEO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,KAAU,UAAW,CAAA;AAAA,IAC3C,WAAA,EAAa,OAAO,QAAS,CAAA;AAAA,GAC9B,CAAA;AACD,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,yBAA0B,EAAA;AAC/C,EAAA,MAAM,gBAAmB,GAAA,WAAA,CAAY,QAAU,EAAA,CAAC,QAAQ,CAAC,CAAA;AACzD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,gBAAA,CAAiB,MAAM,OAAO,CAAA;AAAA;AAChC,GACC,EAAA,CAAC,KAAO,EAAA,gBAAgB,CAAC,CAAA;AAE5B,EAAA,2CACG,QAAS,EAAA,EAAA,KAAA,EAAM,kBAAmB,EAAA,SAAA,EAAW,QAAQ,IACnD,EAAA,EAAA,CAAC,KAAS,IAAA,OAAA,8EAEN,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,QAAO,OAAQ,EAAA,CAC3B,GAED,KACC,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,uBAAA;AAAA,IAAA;AAAA,MACC,QAAU,EAAA;AAAA,QACR,MAAM,KAAM,CAAA,IAAA;AAAA,QACZ,2BAA2B,KAAM,CAAA,YAAA;AAAA,QACjC,qBAAA,EAAuB,MAAM,iBAAqB,IAAA,KAAA;AAAA,QAClD,gBAAA,EAAkB,MAAM,YAAgB,IAAA;AAAA;AAC1C;AAAA,GAGN,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ClusterOverview.esm.js","sources":["../../../src/components/ClusterOverview/ClusterOverview.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 */\nimport React, { useCallback, useEffect } from 'react';\nimport { InfoCard, StructuredMetadataTable } from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useCluster } from './useCluster';\nimport Skeleton from '@material-ui/lab/Skeleton';\nimport { Theme, createStyles, makeStyles } from '@material-ui/core/styles';\nimport { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\n\nconst useStyles = makeStyles((_theme: Theme) =>\n createStyles({\n root: {\n height: '100%',\n },\n }),\n);\n\nexport const ClusterOverview = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { value, loading, error } = useCluster({\n clusterName: entity.metadata.name,\n });\n const { setError } = useKubernetesClusterError();\n const setErrorCallback = useCallback(setError, [setError]);\n useEffect(() => {\n if (error) {\n setErrorCallback(error.message);\n }\n }, [error, setErrorCallback]);\n\n return (\n <InfoCard title=\"Cluster Overview\" className={classes.root}>\n {!value && loading && (\n <>\n <Skeleton height=\"35rem\" />\n </>\n )}\n {value && (\n <StructuredMetadataTable\n metadata={{\n name: value.name,\n 'Backstage auth provider': value.authProvider,\n 'OIDC Token Provider': value.oidcTokenProvider ?? 'N/A',\n 'Dashboard Link': value.dashboardUrl ?? 'N/A',\n }}\n options={{ nestedValuesAsYaml: true }}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAuBA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,WAC5B,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,MAAQ,EAAA;AAAA;AACV,GACD;AACH,CAAA;AAEO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,KAAU,UAAW,CAAA;AAAA,IAC3C,WAAA,EAAa,OAAO,QAAS,CAAA;AAAA,GAC9B,CAAA;AACD,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,yBAA0B,EAAA;AAC/C,EAAA,MAAM,gBAAmB,GAAA,WAAA,CAAY,QAAU,EAAA,CAAC,QAAQ,CAAC,CAAA;AACzD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,gBAAA,CAAiB,MAAM,OAAO,CAAA;AAAA;AAChC,GACC,EAAA,CAAC,KAAO,EAAA,gBAAgB,CAAC,CAAA;AAE5B,EAAA,2CACG,QAAS,EAAA,EAAA,KAAA,EAAM,kBAAmB,EAAA,SAAA,EAAW,QAAQ,IACnD,EAAA,EAAA,CAAC,KAAS,IAAA,OAAA,8EAEN,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,QAAO,OAAQ,EAAA,CAC3B,GAED,KACC,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,uBAAA;AAAA,IAAA;AAAA,MACC,QAAU,EAAA;AAAA,QACR,MAAM,KAAM,CAAA,IAAA;AAAA,QACZ,2BAA2B,KAAM,CAAA,YAAA;AAAA,QACjC,qBAAA,EAAuB,MAAM,iBAAqB,IAAA,KAAA;AAAA,QAClD,gBAAA,EAAkB,MAAM,YAAgB,IAAA;AAAA,OAC1C;AAAA,MACA,OAAA,EAAS,EAAE,kBAAA,EAAoB,IAAK;AAAA;AAAA,GAG1C,CAAA;AAEJ;;;;"}
@@ -6,13 +6,31 @@ import { Nodes } from '../Nodes/Nodes.esm.js';
6
6
  import { ClusterOverview } from '../ClusterOverview/ClusterOverview.esm.js';
7
7
  import { KubernetesClusterErrorProvider, useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext.esm.js';
8
8
  import { WarningPanel } from '@backstage/core-components';
9
+ import { kubernetesClustersReadPermission } from '@backstage/plugin-kubernetes-common';
10
+ import { RequirePermission } from '@backstage/plugin-permission-react';
11
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
12
+ import { kubernetesClusterTranslationRef } from '../../translation.esm.js';
9
13
 
10
14
  const ContentGrid = () => {
11
15
  const { error } = useKubernetesClusterError();
12
16
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { container: true }, error && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(WarningPanel, { title: "Error loading Kubernetes Cluster Plugin" }, /* @__PURE__ */ React.createElement(Typography, null, error))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React.createElement(ClusterOverview, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React.createElement(ApiResources, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Nodes, null))));
13
17
  };
14
18
  const KubernetesClusterContent = () => {
15
- return /* @__PURE__ */ React.createElement(KubernetesClusterErrorProvider, null, /* @__PURE__ */ React.createElement(ContentGrid, null));
19
+ const { t } = useTranslationRef(kubernetesClusterTranslationRef);
20
+ return /* @__PURE__ */ React.createElement(
21
+ RequirePermission,
22
+ {
23
+ permission: kubernetesClustersReadPermission,
24
+ errorPage: /* @__PURE__ */ React.createElement(
25
+ WarningPanel,
26
+ {
27
+ title: t("kubernetesClusterContentPage.permissionAlert.title"),
28
+ message: t("kubernetesClusterContentPage.permissionAlert.message")
29
+ }
30
+ )
31
+ },
32
+ /* @__PURE__ */ React.createElement(KubernetesClusterErrorProvider, null, /* @__PURE__ */ React.createElement(ContentGrid, null))
33
+ );
16
34
  };
17
35
 
18
36
  export { KubernetesClusterContent };
@@ -1 +1 @@
1
- {"version":3,"file":"KubernetesClusterContent.esm.js","sources":["../../../src/components/KubernetesClusterContent/KubernetesClusterContent.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 */\nimport React from 'react';\nimport { ApiResources } from '../ApiResources/ApiResources';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { Nodes } from '../Nodes/Nodes';\nimport { ClusterOverview } from '../ClusterOverview';\nimport {\n KubernetesClusterErrorProvider,\n useKubernetesClusterError,\n} from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { WarningPanel } from '@backstage/core-components';\n\nconst ContentGrid = () => {\n const { error } = useKubernetesClusterError();\n return (\n <>\n <Grid container>\n {error && (\n <Grid item xs={12}>\n <WarningPanel title=\"Error loading Kubernetes Cluster Plugin\">\n <Typography>{error}</Typography>\n </WarningPanel>\n </Grid>\n )}\n <Grid item xs={6}>\n <ClusterOverview />\n </Grid>\n <Grid item xs={6}>\n <ApiResources />\n </Grid>\n <Grid item xs={12}>\n <Nodes />\n </Grid>\n </Grid>\n </>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const KubernetesClusterContent = () => {\n return (\n <KubernetesClusterErrorProvider>\n <ContentGrid />\n </KubernetesClusterErrorProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA2BA,MAAM,cAAc,MAAM;AACxB,EAAM,MAAA,EAAE,KAAM,EAAA,GAAI,yBAA0B,EAAA;AAC5C,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAA,EACZ,yBACE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,sCACZ,YAAa,EAAA,EAAA,KAAA,EAAM,yCAClB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAY,EAAA,IAAA,EAAA,KAAM,CACrB,CACF,CAAA,kBAED,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAI,CACb,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,EAAA,IAAA,CACnB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,CAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAa,CAChB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,sBACZ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAM,CACT,CACF,CACF,CAAA;AAEJ,CAAA;AAOO,MAAM,2BAA2B,MAAM;AAC5C,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,8BAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,CACf,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"KubernetesClusterContent.esm.js","sources":["../../../src/components/KubernetesClusterContent/KubernetesClusterContent.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 */\nimport React from 'react';\nimport { ApiResources } from '../ApiResources/ApiResources';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { Nodes } from '../Nodes/Nodes';\nimport { ClusterOverview } from '../ClusterOverview';\nimport {\n KubernetesClusterErrorProvider,\n useKubernetesClusterError,\n} from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { WarningPanel } from '@backstage/core-components';\nimport { kubernetesClustersReadPermission } from '@backstage/plugin-kubernetes-common';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesClusterTranslationRef } from '../../translation';\n\nconst ContentGrid = () => {\n const { error } = useKubernetesClusterError();\n return (\n <>\n <Grid container>\n {error && (\n <Grid item xs={12}>\n <WarningPanel title=\"Error loading Kubernetes Cluster Plugin\">\n <Typography>{error}</Typography>\n </WarningPanel>\n </Grid>\n )}\n <Grid item xs={6}>\n <ClusterOverview />\n </Grid>\n <Grid item xs={6}>\n <ApiResources />\n </Grid>\n <Grid item xs={12}>\n <Nodes />\n </Grid>\n </Grid>\n </>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const KubernetesClusterContent = () => {\n const { t } = useTranslationRef(kubernetesClusterTranslationRef);\n\n return (\n <RequirePermission\n permission={kubernetesClustersReadPermission}\n errorPage={\n <WarningPanel\n title={t('kubernetesClusterContentPage.permissionAlert.title')}\n message={t('kubernetesClusterContentPage.permissionAlert.message')}\n />\n }\n >\n <KubernetesClusterErrorProvider>\n <ContentGrid />\n </KubernetesClusterErrorProvider>\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AA+BA,MAAM,cAAc,MAAM;AACxB,EAAM,MAAA,EAAE,KAAM,EAAA,GAAI,yBAA0B,EAAA;AAC5C,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAA,EACZ,yBACE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,sCACZ,YAAa,EAAA,EAAA,KAAA,EAAM,yCAClB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAY,EAAA,IAAA,EAAA,KAAM,CACrB,CACF,CAAA,kBAED,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAI,CACb,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,EAAA,IAAA,CACnB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,CAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAa,CAChB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,sBACZ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAM,CACT,CACF,CACF,CAAA;AAEJ,CAAA;AAOO,MAAM,2BAA2B,MAAM;AAC5C,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,+BAA+B,CAAA;AAE/D,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,gCAAA;AAAA,MACZ,SACE,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,EAAE,oDAAoD,CAAA;AAAA,UAC7D,OAAA,EAAS,EAAE,sDAAsD;AAAA;AAAA;AACnE,KAAA;AAAA,oBAGD,KAAA,CAAA,aAAA,CAAA,8BAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,CACf;AAAA,GACF;AAEJ;;;;"}
@@ -27,13 +27,20 @@ const defaultColumns = [
27
27
  kubernetesObject: node,
28
28
  label: node.metadata?.name ?? "unknown-node"
29
29
  },
30
- /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Node Info"), /* @__PURE__ */ React.createElement(StructuredMetadataTable, { metadata: node.status?.nodeInfo ?? {} })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Addresses"), /* @__PURE__ */ React.createElement(
30
+ /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Node Info"), /* @__PURE__ */ React.createElement(
31
+ StructuredMetadataTable,
32
+ {
33
+ metadata: node.status?.nodeInfo ?? {},
34
+ options: { nestedValuesAsYaml: true }
35
+ }
36
+ )), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Addresses"), /* @__PURE__ */ React.createElement(
31
37
  StructuredMetadataTable,
32
38
  {
33
39
  metadata: node.status?.addresses?.reduce((accum, next) => {
34
40
  accum[next.type] = next.address;
35
41
  return accum;
36
- }, {}) ?? {}
42
+ }, {}) ?? {},
43
+ options: { nestedValuesAsYaml: true }
37
44
  }
38
45
  )), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Taints"), /* @__PURE__ */ React.createElement(
39
46
  StructuredMetadataTable,
@@ -41,7 +48,8 @@ const defaultColumns = [
41
48
  metadata: node.spec?.taints?.reduce((accum, next) => {
42
49
  accum[`${next.effect}`] = `${next.key} (${next.value})`;
43
50
  return accum;
44
- }, {}) ?? {}
51
+ }, {}) ?? {},
52
+ options: { nestedValuesAsYaml: true }
45
53
  }
46
54
  )))
47
55
  );
@@ -1 +1 @@
1
- {"version":3,"file":"Nodes.esm.js","sources":["../../../src/components/Nodes/Nodes.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 */\nimport { useNodes } from './useNodes';\nimport React, { useCallback, useEffect } from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport {\n StructuredMetadataTable,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { INode } from 'kubernetes-models/v1';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { KubernetesDrawer } from '@backstage/plugin-kubernetes-react';\n\nconst useStyles = makeStyles(theme => ({\n empty: {\n padding: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n },\n}));\n\nconst defaultColumns: TableColumn<INode>[] = [\n {\n title: 'Name',\n highlight: true,\n width: 'auto',\n render: (node: INode) => {\n return (\n <KubernetesDrawer\n kubernetesObject={node}\n label={node.metadata?.name ?? 'unknown-node'}\n >\n <Grid container>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Node Info</Typography>\n <StructuredMetadataTable metadata={node.status?.nodeInfo ?? {}} />\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Addresses</Typography>\n <StructuredMetadataTable\n metadata={\n node.status?.addresses?.reduce((accum, next) => {\n accum[next.type] = next.address;\n return accum;\n }, {} as any) ?? {}\n }\n />\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Taints</Typography>\n <StructuredMetadataTable\n metadata={\n node.spec?.taints?.reduce((accum, next) => {\n accum[`${next.effect}`] = `${next.key} (${next.value})`;\n return accum;\n }, {} as any) ?? {}\n }\n />\n </Grid>\n </Grid>\n </KubernetesDrawer>\n );\n },\n },\n {\n title: 'Schedulable',\n align: 'center',\n width: 'auto',\n render: (node: INode) => {\n if (node.spec?.unschedulable) {\n return '❌';\n }\n return '✅';\n },\n },\n {\n title: 'Status',\n width: 'auto',\n render: (node: INode) => {\n // TODO add an icon\n const readyCondition = node.status?.conditions?.find(c => {\n return c.type === 'Ready';\n });\n if (!readyCondition) {\n return 'Unknown';\n }\n return readyCondition.status === 'True' ? 'Ready' : 'Not Ready';\n },\n },\n {\n title: 'OS',\n width: 'auto',\n render: (node: INode) => {\n return `${node.status?.nodeInfo?.operatingSystem ?? 'unknown'} (${\n node.status?.nodeInfo?.architecture ?? '?'\n })`;\n },\n },\n];\n\nexport const Nodes = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { value, error, loading } = useNodes({\n clusterName: entity.metadata.name,\n });\n const { setError } = useKubernetesClusterError();\n const setErrorCallback = useCallback(setError, [setError]);\n useEffect(() => {\n if (error) {\n setErrorCallback(error.message);\n }\n }, [error, setErrorCallback]);\n\n return (\n <Table\n title=\"Nodes\"\n options={{ paging: true, search: false, emptyRowsWhenPaging: false }}\n isLoading={!value && loading}\n data={value?.items ?? []}\n emptyContent={\n <div className={classes.empty}>\n {error !== undefined ? 'Error loading nodes' : 'No nodes found'}\n </div>\n }\n columns={defaultColumns}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA8BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,KAAO,EAAA;AAAA,IACL,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACxB,OAAS,EAAA,MAAA;AAAA,IACT,cAAgB,EAAA;AAAA;AAEpB,CAAE,CAAA,CAAA;AAEF,MAAM,cAAuC,GAAA;AAAA,EAC3C;AAAA,IACE,KAAO,EAAA,MAAA;AAAA,IACP,SAAW,EAAA,IAAA;AAAA,IACX,KAAO,EAAA,MAAA;AAAA,IACP,MAAA,EAAQ,CAAC,IAAgB,KAAA;AACvB,MACE,uBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,gBAAA;AAAA,QAAA;AAAA,UACC,gBAAkB,EAAA,IAAA;AAAA,UAClB,KAAA,EAAO,IAAK,CAAA,QAAA,EAAU,IAAQ,IAAA;AAAA,SAAA;AAAA,4CAE7B,IAAK,EAAA,EAAA,SAAA,EAAS,IACb,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,sC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;AAAA,GAC9B,CAAA;AACD,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,yBAA0B,EAAA;AAC/C,EAAA,MAAM,gBAAmB,GAAA,WAAA,CAAY,QAAU,EAAA,CAAC,QAAQ,CAAC,CAAA;AACzD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,gBAAA,CAAiB,MAAM,OAAO,CAAA;AAAA;AAChC,GACC,EAAA,CAAC,KAAO,EAAA,gBAAgB,CAAC,CAAA;AAE5B,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,OAAA;AAAA,MACN,SAAS,EAAE,MAAA,EAAQ,MAAM,MAAQ,EAAA,KAAA,EAAO,qBAAqB,KAAM,EAAA;AAAA,MACnE,SAAA,EAAW,CAAC,KAAS,IAAA,OAAA;AAAA,MACrB,IAAA,EAAM,KAAO,EAAA,KAAA,IAAS,EAAC;AAAA,MACvB,YAAA,sCACG,KAAI,EAAA,EAAA,SAAA,EAAW,QAAQ,KACrB,EAAA,EAAA,KAAA,KAAU,KAAY,CAAA,GAAA,qBAAA,GAAwB,gBACjD,CAAA;AAAA,MAEF,OAAS,EAAA;AAAA;AAAA,GACX;AAEJ;;;;"}
1
+ {"version":3,"file":"Nodes.esm.js","sources":["../../../src/components/Nodes/Nodes.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 */\nimport { useNodes } from './useNodes';\nimport React, { useCallback, useEffect } from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport {\n StructuredMetadataTable,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { INode } from 'kubernetes-models/v1';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { KubernetesDrawer } from '@backstage/plugin-kubernetes-react';\n\nconst useStyles = makeStyles(theme => ({\n empty: {\n padding: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n },\n}));\n\nconst defaultColumns: TableColumn<INode>[] = [\n {\n title: 'Name',\n highlight: true,\n width: 'auto',\n render: (node: INode) => {\n return (\n <KubernetesDrawer\n kubernetesObject={node}\n label={node.metadata?.name ?? 'unknown-node'}\n >\n <Grid container>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Node Info</Typography>\n <StructuredMetadataTable\n metadata={node.status?.nodeInfo ?? {}}\n options={{ nestedValuesAsYaml: true }}\n />\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Addresses</Typography>\n <StructuredMetadataTable\n metadata={\n node.status?.addresses?.reduce((accum, next) => {\n accum[next.type] = next.address;\n return accum;\n }, {} as any) ?? {}\n }\n options={{ nestedValuesAsYaml: true }}\n />\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Taints</Typography>\n <StructuredMetadataTable\n metadata={\n node.spec?.taints?.reduce((accum, next) => {\n accum[`${next.effect}`] = `${next.key} (${next.value})`;\n return accum;\n }, {} as any) ?? {}\n }\n options={{ nestedValuesAsYaml: true }}\n />\n </Grid>\n </Grid>\n </KubernetesDrawer>\n );\n },\n },\n {\n title: 'Schedulable',\n align: 'center',\n width: 'auto',\n render: (node: INode) => {\n if (node.spec?.unschedulable) {\n return '❌';\n }\n return '✅';\n },\n },\n {\n title: 'Status',\n width: 'auto',\n render: (node: INode) => {\n // TODO add an icon\n const readyCondition = node.status?.conditions?.find(c => {\n return c.type === 'Ready';\n });\n if (!readyCondition) {\n return 'Unknown';\n }\n return readyCondition.status === 'True' ? 'Ready' : 'Not Ready';\n },\n },\n {\n title: 'OS',\n width: 'auto',\n render: (node: INode) => {\n return `${node.status?.nodeInfo?.operatingSystem ?? 'unknown'} (${\n node.status?.nodeInfo?.architecture ?? '?'\n })`;\n },\n },\n];\n\nexport const Nodes = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { value, error, loading } = useNodes({\n clusterName: entity.metadata.name,\n });\n const { setError } = useKubernetesClusterError();\n const setErrorCallback = useCallback(setError, [setError]);\n useEffect(() => {\n if (error) {\n setErrorCallback(error.message);\n }\n }, [error, setErrorCallback]);\n\n return (\n <Table\n title=\"Nodes\"\n options={{ paging: true, search: false, emptyRowsWhenPaging: false }}\n isLoading={!value && loading}\n data={value?.items ?? []}\n emptyContent={\n <div className={classes.empty}>\n {error !== undefined ? 'Error loading nodes' : 'No nodes found'}\n </div>\n }\n columns={defaultColumns}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA8BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,KAAO,EAAA;AAAA,IACL,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACxB,OAAS,EAAA,MAAA;AAAA,IACT,cAAgB,EAAA;AAAA;AAEpB,CAAE,CAAA,CAAA;AAEF,MAAM,cAAuC,GAAA;AAAA,EAC3C;AAAA,IACE,KAAO,EAAA,MAAA;AAAA,IACP,SAAW,EAAA,IAAA;AAAA,IACX,KAAO,EAAA,MAAA;AAAA,IACP,MAAA,EAAQ,CAAC,IAAgB,KAAA;AACvB,MACE,uBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,gBAAA;AAAA,QAAA;AAAA,UACC,gBAAkB,EAAA,IAAA;AAAA,UAClB,KAAA,EAAO,IAAK,CAAA,QAAA,EAAU,IAAQ,IAAA;AAAA,SAAA;AAAA,wBAE7B,KAAA,CAAA,aAAA,CAAA,IAA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ranslationRef = createTranslationRef({
4
+ id: "kubernetes-cluster",
5
+ messages: {
6
+ kubernetesClusterContentPage: {
7
+ permissionAlert: {
8
+ title: "Permission required",
9
+ message: "To view Kubernetes objects, contact your portal administrator to give you the 'kubernetes.clusters.read' permission."
10
+ }
11
+ }
12
+ }
13
+ });
14
+
15
+ export { kubernetesClusterTranslationRef };
16
+ //# sourceMappingURL=translation.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 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 */\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const kubernetesClusterTranslationRef = createTranslationRef({\n id: 'kubernetes-cluster',\n messages: {\n kubernetesClusterContentPage: {\n permissionAlert: {\n title: 'Permission required',\n message:\n \"To view Kubernetes objects, contact your portal administrator to give you the 'kubernetes.clusters.read' permission.\",\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,kCAAkC,oBAAqB,CAAA;AAAA,EAClE,EAAI,EAAA,oBAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,4BAA8B,EAAA;AAAA,MAC5B,eAAiB,EAAA;AAAA,QACf,KAAO,EAAA,qBAAA;AAAA,QACP,OACE,EAAA;AAAA;AACJ;AACF;AAEJ,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-kubernetes-cluster",
3
- "version": "0.0.22-next.0",
3
+ "version": "0.0.22-next.2",
4
4
  "description": "A Backstage plugin that shows details of Kubernetes clusters",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -10,9 +10,7 @@
10
10
  ]
11
11
  },
12
12
  "publishConfig": {
13
- "access": "public",
14
- "main": "dist/index.esm.js",
15
- "types": "dist/index.d.ts"
13
+ "access": "public"
16
14
  },
17
15
  "keywords": [
18
16
  "backstage",
@@ -26,8 +24,31 @@
26
24
  },
27
25
  "license": "Apache-2.0",
28
26
  "sideEffects": false,
29
- "main": "dist/index.esm.js",
30
- "types": "dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "import": "./dist/index.esm.js",
30
+ "types": "./dist/index.d.ts",
31
+ "default": "./dist/index.esm.js"
32
+ },
33
+ "./alpha": {
34
+ "import": "./dist/alpha.esm.js",
35
+ "types": "./dist/alpha.d.ts",
36
+ "default": "./dist/alpha.esm.js"
37
+ },
38
+ "./package.json": "./package.json"
39
+ },
40
+ "main": "./dist/index.esm.js",
41
+ "types": "./dist/index.d.ts",
42
+ "typesVersions": {
43
+ "*": {
44
+ "index": [
45
+ "dist/index.d.ts"
46
+ ],
47
+ "alpha": [
48
+ "dist/alpha.d.ts"
49
+ ]
50
+ }
51
+ },
31
52
  "files": [
32
53
  "dist"
33
54
  ],
@@ -42,11 +63,12 @@
42
63
  },
43
64
  "dependencies": {
44
65
  "@backstage/catalog-model": "1.7.3",
45
- "@backstage/core-components": "0.16.3",
46
- "@backstage/core-plugin-api": "1.10.3",
47
- "@backstage/plugin-catalog-react": "1.15.2-next.0",
48
- "@backstage/plugin-kubernetes-common": "0.9.3-next.0",
49
- "@backstage/plugin-kubernetes-react": "0.5.4-next.0",
66
+ "@backstage/core-components": "0.16.4-next.1",
67
+ "@backstage/core-plugin-api": "1.10.4-next.0",
68
+ "@backstage/plugin-catalog-react": "1.15.2-next.2",
69
+ "@backstage/plugin-kubernetes-common": "0.9.3-next.1",
70
+ "@backstage/plugin-kubernetes-react": "0.5.4-next.2",
71
+ "@backstage/plugin-permission-react": "0.4.31-next.0",
50
72
  "@kubernetes-models/apimachinery": "^2.0.0",
51
73
  "@kubernetes-models/base": "^5.0.0",
52
74
  "@material-ui/core": "^4.12.2",
@@ -59,8 +81,8 @@
59
81
  "react-use": "^17.2.4"
60
82
  },
61
83
  "devDependencies": {
62
- "@backstage/cli": "0.30.0-next.0",
63
- "@backstage/test-utils": "1.7.4",
84
+ "@backstage/cli": "0.30.0-next.2",
85
+ "@backstage/test-utils": "1.7.5-next.0",
64
86
  "@testing-library/dom": "^10.0.0",
65
87
  "@testing-library/jest-dom": "^6.0.0",
66
88
  "@testing-library/react": "^16.0.0",
@@ -71,22 +93,15 @@
71
93
  "react-router-dom": "^6.3.0"
72
94
  },
73
95
  "peerDependencies": {
74
- "@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
75
- "react": "^16.13.1 || ^17.0.0 || ^18.0.0",
76
- "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
77
- "react-router-dom": "6.0.0-beta.0 || ^6.3.0"
96
+ "@types/react": "^17.0.0 || ^18.0.0",
97
+ "react": "^17.0.0 || ^18.0.0",
98
+ "react-dom": "^17.0.0 || ^18.0.0",
99
+ "react-router-dom": "^6.3.0"
78
100
  },
79
101
  "peerDependenciesMeta": {
80
102
  "@types/react": {
81
103
  "optional": true
82
104
  }
83
105
  },
84
- "typesVersions": {
85
- "*": {
86
- "index": [
87
- "dist/index.d.ts"
88
- ]
89
- }
90
- },
91
106
  "module": "./dist/index.esm.js"
92
107
  }