@backstage/plugin-kubernetes-react 0.0.0-nightly-20260919022921 → 0.0.0-nightly-20260920023043
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 +6 -6
- package/dist/alpha.esm.js.map +1 -1
- package/dist/api/KubernetesBackendClient.esm.js.map +1 -1
- package/dist/api/KubernetesClusterLinkFormatter.esm.js.map +1 -1
- package/dist/api/KubernetesProxyClient.esm.js.map +1 -1
- package/dist/api/formatters/AksClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/EksClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/GkeClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/HeadlampClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/OpenshiftClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/RancherClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/StandardClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/index.esm.js.map +1 -1
- package/dist/api/types.esm.js.map +1 -1
- package/dist/components/Cluster/Cluster.esm.js.map +1 -1
- package/dist/components/ConfigmapsAccordions/ConfigmapsAccordions.esm.js.map +1 -1
- package/dist/components/ConfigmapsAccordions/ConfigmapsDrawer.esm.js.map +1 -1
- package/dist/components/CronJobsAccordions/CronJobsAccordions.esm.js.map +1 -1
- package/dist/components/CronJobsAccordions/CronJobsDrawer.esm.js.map +1 -1
- package/dist/components/CustomResources/ArgoRollouts/Rollout.esm.js.map +1 -1
- package/dist/components/CustomResources/ArgoRollouts/RolloutDrawer.esm.js.map +1 -1
- package/dist/components/CustomResources/ArgoRollouts/StepsProgress.esm.js.map +1 -1
- package/dist/components/CustomResources/CustomResources.esm.js.map +1 -1
- package/dist/components/CustomResources/DefaultCustomResource.esm.js.map +1 -1
- package/dist/components/CustomResources/DefaultCustomResourceDrawer.esm.js.map +1 -1
- package/dist/components/DaemonSetsAccordions/DaemonSetsAccordions.esm.js.map +1 -1
- package/dist/components/DaemonSetsAccordions/DaemonSetsDrawer.esm.js.map +1 -1
- package/dist/components/DeploymentsAccordions/DeploymentDrawer.esm.js.map +1 -1
- package/dist/components/DeploymentsAccordions/DeploymentsAccordions.esm.js.map +1 -1
- package/dist/components/ErrorPanel/ErrorPanel.esm.js.map +1 -1
- package/dist/components/ErrorReporting/ErrorReporting.esm.js.map +1 -1
- package/dist/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.esm.js.map +1 -1
- package/dist/components/IngressesAccordions/IngressDrawer.esm.js.map +1 -1
- package/dist/components/IngressesAccordions/IngressesAccordions.esm.js.map +1 -1
- package/dist/components/JobsAccordions/JobsAccordions.esm.js.map +1 -1
- package/dist/components/JobsAccordions/JobsDrawer.esm.js.map +1 -1
- package/dist/components/KubernetesDialog/KubernetesDialog.esm.js.map +1 -1
- package/dist/components/KubernetesDrawer/KubernetesDrawer.esm.js.map +1 -1
- package/dist/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.esm.js.map +1 -1
- package/dist/components/KubernetesDrawer/ManifestYaml.esm.js.map +1 -1
- package/dist/components/PersistentVolumesAccordions/PersistentVolumesAccordions.esm.js.map +1 -1
- package/dist/components/PersistentVolumesAccordions/PersistentVolumesDrawer.esm.js.map +1 -1
- package/dist/components/PersistentVolumesAccordions/PersistentVolumesTable.esm.js.map +1 -1
- package/dist/components/PersistentVolumesClaimsAccordions/PersistentVolumeClaimsAccordions.esm.js.map +1 -1
- package/dist/components/PersistentVolumesClaimsAccordions/PersistentVolumeClaimsDrawer.esm.js.map +1 -1
- package/dist/components/PersistentVolumesClaimsAccordions/PersistentVolumeClaimsTable.esm.js.map +1 -1
- package/dist/components/PodExecTerminal/PodExecTerminal.esm.js.map +1 -1
- package/dist/components/PodExecTerminal/PodExecTerminalAttachAddon.esm.js.map +1 -1
- package/dist/components/PodExecTerminal/PodExecTerminalContent.esm.js.map +1 -1
- package/dist/components/PodExecTerminal/PodExecTerminalDialog.esm.js.map +1 -1
- package/dist/components/Pods/ErrorList/ErrorList.esm.js.map +1 -1
- package/dist/components/Pods/Events/Events.esm.js.map +1 -1
- package/dist/components/Pods/Events/useEvents.esm.js.map +1 -1
- package/dist/components/Pods/FixDialog/FixDialog.esm.js.map +1 -1
- package/dist/components/Pods/PodDelete/PodDeleteButton.esm.js.map +1 -1
- package/dist/components/Pods/PodDelete/usePodDelete.esm.js.map +1 -1
- package/dist/components/Pods/PodDrawer/ContainerCard.esm.js.map +1 -1
- package/dist/components/Pods/PodDrawer/PendingPodContent.esm.js.map +1 -1
- package/dist/components/Pods/PodDrawer/PodDrawer.esm.js.map +1 -1
- package/dist/components/Pods/PodLogs/PodLogs.esm.js.map +1 -1
- package/dist/components/Pods/PodLogs/PodLogsDialog.esm.js.map +1 -1
- package/dist/components/Pods/PodLogs/usePodLogs.esm.js.map +1 -1
- package/dist/components/Pods/PodsTable.esm.js.map +1 -1
- package/dist/components/ResourceUtilization/ResourceUtilization.esm.js.map +1 -1
- package/dist/components/SecretsAccordions/SecretsAccordions.esm.js.map +1 -1
- package/dist/components/SecretsAccordions/SecretsDrawer.esm.js.map +1 -1
- package/dist/components/ServicesAccordions/ServiceDrawer.esm.js.map +1 -1
- package/dist/components/ServicesAccordions/ServicesAccordions.esm.js.map +1 -1
- package/dist/components/StatefulSetsAccordions/StatefulSetDrawer.esm.js.map +1 -1
- package/dist/components/StatefulSetsAccordions/StatefulSetsAccordions.esm.js.map +1 -1
- package/dist/hooks/Cluster.esm.js.map +1 -1
- package/dist/hooks/GroupedResponses.esm.js.map +1 -1
- package/dist/hooks/PodNamesWithErrors.esm.js.map +1 -1
- package/dist/hooks/PodNamesWithMetrics.esm.js.map +1 -1
- package/dist/hooks/auth.esm.js.map +1 -1
- package/dist/hooks/useCustomResources.esm.js.map +1 -1
- package/dist/hooks/useIsPodDeleteEnabled.esm.js.map +1 -1
- package/dist/hooks/useIsPodExecTerminalEnabled.esm.js.map +1 -1
- package/dist/hooks/useIsPodExecTerminalSupported.esm.js.map +1 -1
- package/dist/hooks/useKubernetesObjects.esm.js.map +1 -1
- package/dist/hooks/useMatchingErrors.esm.js.map +1 -1
- package/dist/hooks/usePodMetrics.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/AksKubernetesAuthProvider.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/GoogleKubernetesAuthProvider.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/KubernetesAuthProviders.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/OidcKubernetesAuthProvider.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/ServerSideAuthProvider.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/types.esm.js.map +1 -1
- package/dist/translation.esm.js.map +1 -1
- package/dist/utils/crons.esm.js.map +1 -1
- package/dist/utils/owner.esm.js.map +1 -1
- package/dist/utils/persistentVolumes.esm.js.map +1 -1
- package/dist/utils/pod.esm.js.map +1 -1
- package/dist/utils/resources.esm.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.esm.js","sources":["../../src/hooks/auth.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { Entity } from '@backstage/catalog-model';\nimport { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { KubernetesAuthProvidersApi } from '../kubernetes-auth-provider';\nimport { KubernetesApi } from '../api/types';\n\nexport const generateAuth = async (\n entity: Entity,\n kubernetesApi: KubernetesApi,\n kubernetesAuthProvidersApi: KubernetesAuthProvidersApi,\n) => {\n const clusters = await kubernetesApi.getClusters();\n\n const authProviders: string[] = [\n ...new Set(\n clusters.map(\n c =>\n `${c.authProvider}${\n c.oidcTokenProvider ? `.${c.oidcTokenProvider}` : ''\n }`,\n ),\n ),\n ];\n\n let requestBody: KubernetesRequestBody = {\n entity,\n };\n for (const authProviderStr of authProviders) {\n requestBody = await kubernetesAuthProvidersApi.decorateRequestBodyForAuth(\n authProviderStr,\n requestBody,\n );\n }\n return requestBody.auth ?? {};\n};\n"],"names":[],"mappings":"AAqBO,MAAM,YAAA,GAAe,OAC1B,MAAA,EACA,aAAA,EACA,0BAAA,KACG;AACH,EAAA,MAAM,QAAA,GAAW,MAAM,aAAA,CAAc,WAAA,EAAY;AAEjD,EAAA,MAAM,aAAA,GAA0B;AAAA,IAC9B,GAAG,IAAI,GAAA;AAAA,MACL,QAAA,CAAS,GAAA;AAAA,QACP,CAAA,CAAA,KACE,CAAA,EAAG,CAAA,CAAE,YAAY,CAAA,EACf,CAAA,CAAE,iBAAA,GAAoB,CAAA,CAAA,EAAI,CAAA,CAAE,iBAAiB,CAAA,CAAA,GAAK,EACpD,CAAA;AAAA;AACJ;AACF,GACF;AAEA,EAAA,IAAI,WAAA,GAAqC;AAAA,IACvC;AAAA,GACF;AACA,EAAA,KAAA,MAAW,mBAAmB,aAAA,EAAe;AAC3C,IAAA,WAAA,GAAc,MAAM,0BAAA,CAA2B,0BAAA;AAAA,MAC7C,eAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AACA,EAAA,OAAO,WAAA,CAAY,QAAQ,EAAC;AAC9B
|
|
1
|
+
{"version":3,"file":"auth.esm.js","sources":["../../src/hooks/auth.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { Entity } from '@backstage/catalog-model';\nimport { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { KubernetesAuthProvidersApi } from '../kubernetes-auth-provider';\nimport { KubernetesApi } from '../api/types';\n\nexport const generateAuth = async (\n entity: Entity,\n kubernetesApi: KubernetesApi,\n kubernetesAuthProvidersApi: KubernetesAuthProvidersApi,\n) => {\n const clusters = await kubernetesApi.getClusters();\n\n const authProviders: string[] = [\n ...new Set(\n clusters.map(\n c =>\n `${c.authProvider}${\n c.oidcTokenProvider ? `.${c.oidcTokenProvider}` : ''\n }`,\n ),\n ),\n ];\n\n let requestBody: KubernetesRequestBody = {\n entity,\n };\n for (const authProviderStr of authProviders) {\n requestBody = await kubernetesAuthProvidersApi.decorateRequestBodyForAuth(\n authProviderStr,\n requestBody,\n );\n }\n return requestBody.auth ?? {};\n};\n"],"names":[],"mappings":"AAqBO,MAAM,YAAA,GAAe,OAC1B,MAAA,EACA,aAAA,EACA,0BAAA,KACG;AACH,EAAA,MAAM,QAAA,GAAW,MAAM,aAAA,CAAc,WAAA,EAAY;AAEjD,EAAA,MAAM,aAAA,GAA0B;AAAA,IAC9B,GAAG,IAAI,GAAA;AAAA,MACL,QAAA,CAAS,GAAA;AAAA,QACP,CAAA,CAAA,KACE,CAAA,EAAG,CAAA,CAAE,YAAY,CAAA,EACf,CAAA,CAAE,iBAAA,GAAoB,CAAA,CAAA,EAAI,CAAA,CAAE,iBAAiB,CAAA,CAAA,GAAK,EACpD,CAAA;AAAA;AACJ;AACF,GACF;AAEA,EAAA,IAAI,WAAA,GAAqC;AAAA,IACvC;AAAA,GACF;AACA,EAAA,KAAA,MAAW,mBAAmB,aAAA,EAAe;AAC3C,IAAA,WAAA,GAAc,MAAM,0BAAA,CAA2B,0BAAA;AAAA,MAC7C,eAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AACA,EAAA,OAAO,WAAA,CAAY,QAAQ,EAAC;AAC9B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCustomResources.esm.js","sources":["../../src/hooks/useCustomResources.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { Entity } from '@backstage/catalog-model';\nimport { useCallback } from 'react';\nimport useInterval from 'react-use/esm/useInterval';\nimport {\n CustomResourceMatcher,\n ObjectsByEntityResponse,\n} from '@backstage/plugin-kubernetes-common';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { KubernetesObjects } from './useKubernetesObjects';\nimport { generateAuth } from './auth';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\nimport { kubernetesAuthProvidersApiRef } from '../kubernetes-auth-provider';\nimport { kubernetesApiRef } from '../api/types';\n\n/**\n * Retrieves the provided custom resources related to the provided entity, refreshes at an interval.\n *\n * @public\n */\nexport const useCustomResources = (\n entity: Entity,\n customResourceMatchers: CustomResourceMatcher[],\n intervalMs: number = 10000,\n): KubernetesObjects => {\n const kubernetesApi = useApi(kubernetesApiRef);\n const kubernetesAuthProvidersApi = useApi(kubernetesAuthProvidersApiRef);\n const matchersString = JSON.stringify(customResourceMatchers);\n const getCustomObjects = useCallback(\n async (): Promise<ObjectsByEntityResponse> => {\n const auth = await generateAuth(\n entity,\n kubernetesApi,\n kubernetesAuthProvidersApi,\n );\n return await kubernetesApi.getCustomObjectsByEntity({\n auth,\n customResources: customResourceMatchers,\n entity,\n });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [kubernetesApi, entity, kubernetesAuthProvidersApi, matchersString],\n );\n\n const { value, loading, error, retry } = useAsyncRetry(\n () => getCustomObjects(),\n [getCustomObjects],\n );\n\n useInterval(() => retry(), intervalMs);\n\n return {\n kubernetesObjects: value,\n loading,\n error: error?.message,\n };\n};\n"],"names":[],"mappings":";;;;;;;;AAmCO,MAAM,kBAAA,GAAqB,CAChC,MAAA,EACA,sBAAA,EACA,aAAqB,GAAA,KACC;AACtB,EAAA,MAAM,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,MAAM,0BAAA,GAA6B,OAAO,6BAA6B,CAAA;AACvE,EAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,SAAA,CAAU,sBAAsB,CAAA;AAC5D,EAAA,MAAM,gBAAA,GAAmB,WAAA;AAAA,IACvB,YAA8C;AAC5C,MAAA,MAAM,OAAO,MAAM,YAAA;AAAA,QACjB,MAAA;AAAA,QACA,aAAA;AAAA,QACA;AAAA,OACF;AACA,MAAA,OAAO,MAAM,cAAc,wBAAA,CAAyB;AAAA,QAClD,IAAA;AAAA,QACA,eAAA,EAAiB,sBAAA;AAAA,QACjB;AAAA,OACD,CAAA;AAAA,IACH,CAAA;AAAA;AAAA,IAEA,CAAC,aAAA,EAAe,MAAA,EAAQ,0BAAA,EAA4B,cAAc;AAAA,GACpE;AAEA,EAAA,MAAM,EAAE,KAAA,EAAO,OAAA,EAAS,KAAA,EAAO,OAAM,GAAI,aAAA;AAAA,IACvC,MAAM,gBAAA,EAAiB;AAAA,IACvB,CAAC,gBAAgB;AAAA,GACnB;AAEA,EAAA,WAAA,CAAY,MAAM,KAAA,EAAM,EAAG,UAAU,CAAA;AAErC,EAAA,OAAO;AAAA,IACL,iBAAA,EAAmB,KAAA;AAAA,IACnB,OAAA;AAAA,IACA,OAAO,KAAA,EAAO;AAAA,GAChB;AACF
|
|
1
|
+
{"version":3,"file":"useCustomResources.esm.js","sources":["../../src/hooks/useCustomResources.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { Entity } from '@backstage/catalog-model';\nimport { useCallback } from 'react';\nimport useInterval from 'react-use/esm/useInterval';\nimport {\n CustomResourceMatcher,\n ObjectsByEntityResponse,\n} from '@backstage/plugin-kubernetes-common';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { KubernetesObjects } from './useKubernetesObjects';\nimport { generateAuth } from './auth';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\nimport { kubernetesAuthProvidersApiRef } from '../kubernetes-auth-provider';\nimport { kubernetesApiRef } from '../api/types';\n\n/**\n * Retrieves the provided custom resources related to the provided entity, refreshes at an interval.\n *\n * @public\n */\nexport const useCustomResources = (\n entity: Entity,\n customResourceMatchers: CustomResourceMatcher[],\n intervalMs: number = 10000,\n): KubernetesObjects => {\n const kubernetesApi = useApi(kubernetesApiRef);\n const kubernetesAuthProvidersApi = useApi(kubernetesAuthProvidersApiRef);\n const matchersString = JSON.stringify(customResourceMatchers);\n const getCustomObjects = useCallback(\n async (): Promise<ObjectsByEntityResponse> => {\n const auth = await generateAuth(\n entity,\n kubernetesApi,\n kubernetesAuthProvidersApi,\n );\n return await kubernetesApi.getCustomObjectsByEntity({\n auth,\n customResources: customResourceMatchers,\n entity,\n });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [kubernetesApi, entity, kubernetesAuthProvidersApi, matchersString],\n );\n\n const { value, loading, error, retry } = useAsyncRetry(\n () => getCustomObjects(),\n [getCustomObjects],\n );\n\n useInterval(() => retry(), intervalMs);\n\n return {\n kubernetesObjects: value,\n loading,\n error: error?.message,\n };\n};\n"],"names":[],"mappings":";;;;;;;;AAmCO,MAAM,kBAAA,GAAqB,CAChC,MAAA,EACA,sBAAA,EACA,aAAqB,GAAA,KACC;AACtB,EAAA,MAAM,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,MAAM,0BAAA,GAA6B,OAAO,6BAA6B,CAAA;AACvE,EAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,SAAA,CAAU,sBAAsB,CAAA;AAC5D,EAAA,MAAM,gBAAA,GAAmB,WAAA;AAAA,IACvB,YAA8C;AAC5C,MAAA,MAAM,OAAO,MAAM,YAAA;AAAA,QACjB,MAAA;AAAA,QACA,aAAA;AAAA,QACA;AAAA,OACF;AACA,MAAA,OAAO,MAAM,cAAc,wBAAA,CAAyB;AAAA,QAClD,IAAA;AAAA,QACA,eAAA,EAAiB,sBAAA;AAAA,QACjB;AAAA,OACD,CAAA;AAAA,IACH,CAAA;AAAA;AAAA,IAEA,CAAC,aAAA,EAAe,MAAA,EAAQ,0BAAA,EAA4B,cAAc;AAAA,GACpE;AAEA,EAAA,MAAM,EAAE,KAAA,EAAO,OAAA,EAAS,KAAA,EAAO,OAAM,GAAI,aAAA;AAAA,IACvC,MAAM,gBAAA,EAAiB;AAAA,IACvB,CAAC,gBAAgB;AAAA,GACnB;AAEA,EAAA,WAAA,CAAY,MAAM,KAAA,EAAM,EAAG,UAAU,CAAA;AAErC,EAAA,OAAO;AAAA,IACL,iBAAA,EAAmB,KAAA;AAAA,IACnB,OAAA;AAAA,IACA,OAAO,KAAA,EAAO;AAAA,GAChB;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsPodDeleteEnabled.esm.js","sources":["../../src/hooks/useIsPodDeleteEnabled.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { configApiRef, useApi } from '@backstage/core-plugin-api';\n\n/**\n * Check if conditions for a pod delete call through the proxy endpoint are met\n *\n * @internal\n */\nexport const useIsPodDeleteEnabled = (): boolean | undefined => {\n const configApi = useApi(configApiRef);\n\n return configApi\n .getOptionalConfig('kubernetes.frontend')\n ?.getOptionalBoolean('podDelete.enabled');\n};\n"],"names":[],"mappings":";;AAsBO,MAAM,wBAAwB,MAA2B;AAC9D,EAAA,MAAM,SAAA,GAAY,OAAO,YAAY,CAAA;AAErC,EAAA,OAAO,SAAA,CACJ,iBAAA,CAAkB,qBAAqB,CAAA,EACtC,mBAAmB,mBAAmB,CAAA;AAC5C
|
|
1
|
+
{"version":3,"file":"useIsPodDeleteEnabled.esm.js","sources":["../../src/hooks/useIsPodDeleteEnabled.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { configApiRef, useApi } from '@backstage/core-plugin-api';\n\n/**\n * Check if conditions for a pod delete call through the proxy endpoint are met\n *\n * @internal\n */\nexport const useIsPodDeleteEnabled = (): boolean | undefined => {\n const configApi = useApi(configApiRef);\n\n return configApi\n .getOptionalConfig('kubernetes.frontend')\n ?.getOptionalBoolean('podDelete.enabled');\n};\n"],"names":[],"mappings":";;AAsBO,MAAM,wBAAwB,MAA2B;AAC9D,EAAA,MAAM,SAAA,GAAY,OAAO,YAAY,CAAA;AAErC,EAAA,OAAO,SAAA,CACJ,iBAAA,CAAkB,qBAAqB,CAAA,EACtC,mBAAmB,mBAAmB,CAAA;AAC5C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsPodExecTerminalEnabled.esm.js","sources":["../../src/hooks/useIsPodExecTerminalEnabled.ts"],"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 { configApiRef, useApi } from '@backstage/core-plugin-api';\n\n/**\n * Check if conditions for a pod exec call through the proxy endpoint are met\n *\n * @internal\n */\nexport const useIsPodExecTerminalEnabled = (): boolean | undefined => {\n const configApi = useApi(configApiRef);\n\n return configApi.getOptionalBoolean('kubernetes.podExecTerminal.enabled');\n};\n"],"names":[],"mappings":";;AAsBO,MAAM,8BAA8B,MAA2B;AACpE,EAAA,MAAM,SAAA,GAAY,OAAO,YAAY,CAAA;AAErC,EAAA,OAAO,SAAA,CAAU,mBAAmB,oCAAoC,CAAA;AAC1E
|
|
1
|
+
{"version":3,"file":"useIsPodExecTerminalEnabled.esm.js","sources":["../../src/hooks/useIsPodExecTerminalEnabled.ts"],"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 { configApiRef, useApi } from '@backstage/core-plugin-api';\n\n/**\n * Check if conditions for a pod exec call through the proxy endpoint are met\n *\n * @internal\n */\nexport const useIsPodExecTerminalEnabled = (): boolean | undefined => {\n const configApi = useApi(configApiRef);\n\n return configApi.getOptionalBoolean('kubernetes.podExecTerminal.enabled');\n};\n"],"names":[],"mappings":";;AAsBO,MAAM,8BAA8B,MAA2B;AACpE,EAAA,MAAM,SAAA,GAAY,OAAO,YAAY,CAAA;AAErC,EAAA,OAAO,SAAA,CAAU,mBAAmB,oCAAoC,CAAA;AAC1E;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsPodExecTerminalSupported.esm.js","sources":["../../src/hooks/useIsPodExecTerminalSupported.ts"],"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 { useApi } from '@backstage/core-plugin-api';\nimport useAsync, { AsyncState } from 'react-use/esm/useAsync';\n\nimport { kubernetesApiRef } from '../api/types';\n\n/**\n * Check if conditions for a pod exec call through the proxy endpoint are met\n *\n * @internal\n */\nexport const useIsPodExecTerminalSupported = (): AsyncState<boolean> => {\n const kubernetesApi = useApi(kubernetesApiRef);\n\n return useAsync(async () => {\n const clusters = await kubernetesApi.getClusters();\n\n if (clusters.length !== 1) {\n return false;\n }\n\n const { authProvider } = clusters[0];\n const isClientAuthProvider = ['aks', 'oidc'].some(authProviderName =>\n authProvider.includes(authProviderName),\n );\n\n return !isClientAuthProvider;\n });\n};\n"],"names":[],"mappings":";;;;AAyBO,MAAM,gCAAgC,MAA2B;AACtE,EAAA,MAAM,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAE7C,EAAA,OAAO,SAAS,YAAY;AAC1B,IAAA,MAAM,QAAA,GAAW,MAAM,aAAA,CAAc,WAAA,EAAY;AAEjD,IAAA,IAAI,QAAA,CAAS,WAAW,CAAA,EAAG;AACzB,MAAA,OAAO,KAAA;AAAA,IACT;AAEA,IAAA,MAAM,EAAE,YAAA,EAAa,GAAI,QAAA,CAAS,CAAC,CAAA;AACnC,IAAA,MAAM,oBAAA,GAAuB,CAAC,KAAA,EAAO,MAAM,CAAA,CAAE,IAAA;AAAA,MAAK,CAAA,gBAAA,KAChD,YAAA,CAAa,QAAA,CAAS,gBAAgB;AAAA,KACxC;AAEA,IAAA,OAAO,CAAC,oBAAA;AAAA,EACV,CAAC,CAAA;AACH
|
|
1
|
+
{"version":3,"file":"useIsPodExecTerminalSupported.esm.js","sources":["../../src/hooks/useIsPodExecTerminalSupported.ts"],"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 { useApi } from '@backstage/core-plugin-api';\nimport useAsync, { AsyncState } from 'react-use/esm/useAsync';\n\nimport { kubernetesApiRef } from '../api/types';\n\n/**\n * Check if conditions for a pod exec call through the proxy endpoint are met\n *\n * @internal\n */\nexport const useIsPodExecTerminalSupported = (): AsyncState<boolean> => {\n const kubernetesApi = useApi(kubernetesApiRef);\n\n return useAsync(async () => {\n const clusters = await kubernetesApi.getClusters();\n\n if (clusters.length !== 1) {\n return false;\n }\n\n const { authProvider } = clusters[0];\n const isClientAuthProvider = ['aks', 'oidc'].some(authProviderName =>\n authProvider.includes(authProviderName),\n );\n\n return !isClientAuthProvider;\n });\n};\n"],"names":[],"mappings":";;;;AAyBO,MAAM,gCAAgC,MAA2B;AACtE,EAAA,MAAM,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAE7C,EAAA,OAAO,SAAS,YAAY;AAC1B,IAAA,MAAM,QAAA,GAAW,MAAM,aAAA,CAAc,WAAA,EAAY;AAEjD,IAAA,IAAI,QAAA,CAAS,WAAW,CAAA,EAAG;AACzB,MAAA,OAAO,KAAA;AAAA,IACT;AAEA,IAAA,MAAM,EAAE,YAAA,EAAa,GAAI,QAAA,CAAS,CAAC,CAAA;AACnC,IAAA,MAAM,oBAAA,GAAuB,CAAC,KAAA,EAAO,MAAM,CAAA,CAAE,IAAA;AAAA,MAAK,CAAA,gBAAA,KAChD,YAAA,CAAa,QAAA,CAAS,gBAAgB;AAAA,KACxC;AAEA,IAAA,OAAO,CAAC,oBAAA;AAAA,EACV,CAAC,CAAA;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKubernetesObjects.esm.js","sources":["../../src/hooks/useKubernetesObjects.ts"],"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 { Entity } from '@backstage/catalog-model';\nimport { useCallback } from 'react';\nimport useInterval from 'react-use/esm/useInterval';\nimport { ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-common';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { generateAuth } from './auth';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\nimport { kubernetesAuthProvidersApiRef } from '../kubernetes-auth-provider';\nimport { kubernetesApiRef } from '../api/types';\n\n/**\n *\n * @public\n */\nexport interface KubernetesObjects {\n kubernetesObjects?: ObjectsByEntityResponse;\n loading: boolean;\n error?: string;\n}\n\n/**\n *\n * @public\n */\nexport const useKubernetesObjects = (\n entity: Entity,\n intervalMs: number = 10000,\n): KubernetesObjects => {\n const kubernetesApi = useApi(kubernetesApiRef);\n const kubernetesAuthProvidersApi = useApi(kubernetesAuthProvidersApiRef);\n const getObjects = useCallback(async (): Promise<ObjectsByEntityResponse> => {\n const auth = await generateAuth(\n entity,\n kubernetesApi,\n kubernetesAuthProvidersApi,\n );\n return await kubernetesApi.getObjectsByEntity({\n auth,\n entity,\n });\n }, [kubernetesApi, entity, kubernetesAuthProvidersApi]);\n\n const { value, loading, error, retry } = useAsyncRetry(\n () => getObjects(),\n [getObjects],\n );\n\n useInterval(() => retry(), intervalMs);\n\n return {\n kubernetesObjects: value,\n loading,\n error: error?.message,\n };\n};\n"],"names":[],"mappings":";;;;;;;;AAwCO,MAAM,oBAAA,GAAuB,CAClC,MAAA,EACA,UAAA,GAAqB,GAAA,KACC;AACtB,EAAA,MAAM,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,MAAM,0BAAA,GAA6B,OAAO,6BAA6B,CAAA;AACvE,EAAA,MAAM,UAAA,GAAa,YAAY,YAA8C;AAC3E,IAAA,MAAM,OAAO,MAAM,YAAA;AAAA,MACjB,MAAA;AAAA,MACA,aAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,OAAO,MAAM,cAAc,kBAAA,CAAmB;AAAA,MAC5C,IAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA,EACH,CAAA,EAAG,CAAC,aAAA,EAAe,MAAA,EAAQ,0BAA0B,CAAC,CAAA;AAEtD,EAAA,MAAM,EAAE,KAAA,EAAO,OAAA,EAAS,KAAA,EAAO,OAAM,GAAI,aAAA;AAAA,IACvC,MAAM,UAAA,EAAW;AAAA,IACjB,CAAC,UAAU;AAAA,GACb;AAEA,EAAA,WAAA,CAAY,MAAM,KAAA,EAAM,EAAG,UAAU,CAAA;AAErC,EAAA,OAAO;AAAA,IACL,iBAAA,EAAmB,KAAA;AAAA,IACnB,OAAA;AAAA,IACA,OAAO,KAAA,EAAO;AAAA,GAChB;AACF
|
|
1
|
+
{"version":3,"file":"useKubernetesObjects.esm.js","sources":["../../src/hooks/useKubernetesObjects.ts"],"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 { Entity } from '@backstage/catalog-model';\nimport { useCallback } from 'react';\nimport useInterval from 'react-use/esm/useInterval';\nimport { ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-common';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { generateAuth } from './auth';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\nimport { kubernetesAuthProvidersApiRef } from '../kubernetes-auth-provider';\nimport { kubernetesApiRef } from '../api/types';\n\n/**\n *\n * @public\n */\nexport interface KubernetesObjects {\n kubernetesObjects?: ObjectsByEntityResponse;\n loading: boolean;\n error?: string;\n}\n\n/**\n *\n * @public\n */\nexport const useKubernetesObjects = (\n entity: Entity,\n intervalMs: number = 10000,\n): KubernetesObjects => {\n const kubernetesApi = useApi(kubernetesApiRef);\n const kubernetesAuthProvidersApi = useApi(kubernetesAuthProvidersApiRef);\n const getObjects = useCallback(async (): Promise<ObjectsByEntityResponse> => {\n const auth = await generateAuth(\n entity,\n kubernetesApi,\n kubernetesAuthProvidersApi,\n );\n return await kubernetesApi.getObjectsByEntity({\n auth,\n entity,\n });\n }, [kubernetesApi, entity, kubernetesAuthProvidersApi]);\n\n const { value, loading, error, retry } = useAsyncRetry(\n () => getObjects(),\n [getObjects],\n );\n\n useInterval(() => retry(), intervalMs);\n\n return {\n kubernetesObjects: value,\n loading,\n error: error?.message,\n };\n};\n"],"names":[],"mappings":";;;;;;;;AAwCO,MAAM,oBAAA,GAAuB,CAClC,MAAA,EACA,UAAA,GAAqB,GAAA,KACC;AACtB,EAAA,MAAM,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,MAAM,0BAAA,GAA6B,OAAO,6BAA6B,CAAA;AACvE,EAAA,MAAM,UAAA,GAAa,YAAY,YAA8C;AAC3E,IAAA,MAAM,OAAO,MAAM,YAAA;AAAA,MACjB,MAAA;AAAA,MACA,aAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,OAAO,MAAM,cAAc,kBAAA,CAAmB;AAAA,MAC5C,IAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA,EACH,CAAA,EAAG,CAAC,aAAA,EAAe,MAAA,EAAQ,0BAA0B,CAAC,CAAA;AAEtD,EAAA,MAAM,EAAE,KAAA,EAAO,OAAA,EAAS,KAAA,EAAO,OAAM,GAAI,aAAA;AAAA,IACvC,MAAM,UAAA,EAAW;AAAA,IACjB,CAAC,UAAU;AAAA,GACb;AAEA,EAAA,WAAA,CAAY,MAAM,KAAA,EAAM,EAAG,UAAU,CAAA;AAErC,EAAA,OAAO;AAAA,IACL,iBAAA,EAAmB,KAAA;AAAA,IACnB,OAAA;AAAA,IACA,OAAO,KAAA,EAAO;AAAA,GAChB;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMatchingErrors.esm.js","sources":["../../src/hooks/useMatchingErrors.ts"],"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 { createContext, useContext } from 'react';\nimport {\n DetectedError,\n ResourceRef,\n} from '@backstage/plugin-kubernetes-common';\nimport type { TypeMeta } from '@kubernetes-models/base';\nimport type { IIoK8sApimachineryPkgApisMetaV1ObjectMeta as V1ObjectMeta } from '@kubernetes-models/apimachinery/apis/meta/v1/ObjectMeta';\n\n/**\n * Context for detected errors\n *\n * @public\n */\nexport const DetectedErrorsContext = createContext<DetectedError[]>([]);\n\n/**\n *\n * @public\n */\nexport type ErrorMatcher = {\n metadata?: V1ObjectMeta;\n} & TypeMeta;\n\n/**\n * Find errors which match the resource\n *\n * @public\n */\nexport const useMatchingErrors = (matcher: ErrorMatcher): DetectedError[] => {\n const targetRef: ResourceRef = {\n name: matcher.metadata?.name ?? '',\n namespace: matcher.metadata?.namespace ?? '',\n kind: matcher.kind,\n apiGroup: matcher.apiVersion,\n };\n\n const errors = useContext(DetectedErrorsContext);\n\n return errors.filter(e => {\n const r = e.sourceRef;\n return (\n targetRef.apiGroup === r.apiGroup &&\n targetRef.kind === r.kind &&\n targetRef.name === r.name &&\n targetRef.namespace === r.namespace\n );\n });\n};\n"],"names":[],"mappings":";;AA4BO,MAAM,qBAAA,GAAwB,aAAA,CAA+B,EAAE;AAe/D,MAAM,iBAAA,GAAoB,CAAC,OAAA,KAA2C;AAC3E,EAAA,MAAM,SAAA,GAAyB;AAAA,IAC7B,IAAA,EAAM,OAAA,CAAQ,QAAA,EAAU,IAAA,IAAQ,EAAA;AAAA,IAChC,SAAA,EAAW,OAAA,CAAQ,QAAA,EAAU,SAAA,IAAa,EAAA;AAAA,IAC1C,MAAM,OAAA,CAAQ,IAAA;AAAA,IACd,UAAU,OAAA,CAAQ;AAAA,GACpB;AAEA,EAAA,MAAM,MAAA,GAAS,WAAW,qBAAqB,CAAA;AAE/C,EAAA,OAAO,MAAA,CAAO,OAAO,CAAA,CAAA,KAAK;AACxB,IAAA,MAAM,IAAI,CAAA,CAAE,SAAA;AACZ,IAAA,OACE,SAAA,CAAU,QAAA,KAAa,CAAA,CAAE,QAAA,IACzB,UAAU,IAAA,KAAS,CAAA,CAAE,IAAA,IACrB,SAAA,CAAU,IAAA,KAAS,CAAA,CAAE,IAAA,IACrB,SAAA,CAAU,cAAc,CAAA,CAAE,SAAA;AAAA,EAE9B,CAAC,CAAA;AACH
|
|
1
|
+
{"version":3,"file":"useMatchingErrors.esm.js","sources":["../../src/hooks/useMatchingErrors.ts"],"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 { createContext, useContext } from 'react';\nimport {\n DetectedError,\n ResourceRef,\n} from '@backstage/plugin-kubernetes-common';\nimport type { TypeMeta } from '@kubernetes-models/base';\nimport type { IIoK8sApimachineryPkgApisMetaV1ObjectMeta as V1ObjectMeta } from '@kubernetes-models/apimachinery/apis/meta/v1/ObjectMeta';\n\n/**\n * Context for detected errors\n *\n * @public\n */\nexport const DetectedErrorsContext = createContext<DetectedError[]>([]);\n\n/**\n *\n * @public\n */\nexport type ErrorMatcher = {\n metadata?: V1ObjectMeta;\n} & TypeMeta;\n\n/**\n * Find errors which match the resource\n *\n * @public\n */\nexport const useMatchingErrors = (matcher: ErrorMatcher): DetectedError[] => {\n const targetRef: ResourceRef = {\n name: matcher.metadata?.name ?? '',\n namespace: matcher.metadata?.namespace ?? '',\n kind: matcher.kind,\n apiGroup: matcher.apiVersion,\n };\n\n const errors = useContext(DetectedErrorsContext);\n\n return errors.filter(e => {\n const r = e.sourceRef;\n return (\n targetRef.apiGroup === r.apiGroup &&\n targetRef.kind === r.kind &&\n targetRef.name === r.name &&\n targetRef.namespace === r.namespace\n );\n });\n};\n"],"names":[],"mappings":";;AA4BO,MAAM,qBAAA,GAAwB,aAAA,CAA+B,EAAE;AAe/D,MAAM,iBAAA,GAAoB,CAAC,OAAA,KAA2C;AAC3E,EAAA,MAAM,SAAA,GAAyB;AAAA,IAC7B,IAAA,EAAM,OAAA,CAAQ,QAAA,EAAU,IAAA,IAAQ,EAAA;AAAA,IAChC,SAAA,EAAW,OAAA,CAAQ,QAAA,EAAU,SAAA,IAAa,EAAA;AAAA,IAC1C,MAAM,OAAA,CAAQ,IAAA;AAAA,IACd,UAAU,OAAA,CAAQ;AAAA,GACpB;AAEA,EAAA,MAAM,MAAA,GAAS,WAAW,qBAAqB,CAAA;AAE/C,EAAA,OAAO,MAAA,CAAO,OAAO,CAAA,CAAA,KAAK;AACxB,IAAA,MAAM,IAAI,CAAA,CAAE,SAAA;AACZ,IAAA,OACE,SAAA,CAAU,QAAA,KAAa,CAAA,CAAE,QAAA,IACzB,UAAU,IAAA,KAAS,CAAA,CAAE,IAAA,IACrB,SAAA,CAAU,IAAA,KAAS,CAAA,CAAE,IAAA,IACrB,SAAA,CAAU,cAAc,CAAA,CAAE,SAAA;AAAA,EAE9B,CAAC,CAAA;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePodMetrics.esm.js","sources":["../../src/hooks/usePodMetrics.ts"],"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 { createContext, useContext } from 'react';\nimport type { IObjectMeta } from '@kubernetes-models/apimachinery/apis/meta/v1/ObjectMeta';\nimport { ClientPodStatus } from '@backstage/plugin-kubernetes-common';\n\n/**\n * Context for Pod Metrics\n *\n * @public\n */\nexport const PodMetricsContext = createContext<Map<string, ClientPodStatus[]>>(\n new Map(),\n);\n\n/**\n * @public\n */\nexport type PodMetricsMatcher = {\n metadata?: IObjectMeta;\n};\n\n/**\n * Find metrics matching the provided pod\n *\n * @public\n */\nexport const usePodMetrics = (\n clusterName: string,\n matcher: PodMetricsMatcher,\n): ClientPodStatus | undefined => {\n const targetRef = {\n name: matcher.metadata?.name ?? '',\n namespace: matcher.metadata?.namespace ?? '',\n };\n\n const metricsMap = useContext(PodMetricsContext);\n\n const metrics = metricsMap.get(clusterName);\n\n return metrics?.find(m => {\n const pod = m.pod;\n return (\n targetRef.name === (pod.metadata?.name ?? '') &&\n targetRef.namespace === (pod.metadata?.namespace ?? '')\n );\n });\n};\n"],"names":[],"mappings":";;AAwBO,MAAM,iBAAA,GAAoB,aAAA;AAAA,sBAC3B,GAAA;AACN;AAcO,MAAM,aAAA,GAAgB,CAC3B,WAAA,EACA,OAAA,KACgC;AAChC,EAAA,MAAM,SAAA,GAAY;AAAA,IAChB,IAAA,EAAM,OAAA,CAAQ,QAAA,EAAU,IAAA,IAAQ,EAAA;AAAA,IAChC,SAAA,EAAW,OAAA,CAAQ,QAAA,EAAU,SAAA,IAAa;AAAA,GAC5C;AAEA,EAAA,MAAM,UAAA,GAAa,WAAW,iBAAiB,CAAA;AAE/C,EAAA,MAAM,OAAA,GAAU,UAAA,CAAW,GAAA,CAAI,WAAW,CAAA;AAE1C,EAAA,OAAO,OAAA,EAAS,KAAK,CAAA,CAAA,KAAK;AACxB,IAAA,MAAM,MAAM,CAAA,CAAE,GAAA;AACd,IAAA,OACE,SAAA,CAAU,IAAA,MAAU,GAAA,CAAI,QAAA,EAAU,IAAA,IAAQ,OAC1C,SAAA,CAAU,SAAA,MAAe,GAAA,CAAI,QAAA,EAAU,SAAA,IAAa,EAAA,CAAA;AAAA,EAExD,CAAC,CAAA;AACH
|
|
1
|
+
{"version":3,"file":"usePodMetrics.esm.js","sources":["../../src/hooks/usePodMetrics.ts"],"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 { createContext, useContext } from 'react';\nimport type { IObjectMeta } from '@kubernetes-models/apimachinery/apis/meta/v1/ObjectMeta';\nimport { ClientPodStatus } from '@backstage/plugin-kubernetes-common';\n\n/**\n * Context for Pod Metrics\n *\n * @public\n */\nexport const PodMetricsContext = createContext<Map<string, ClientPodStatus[]>>(\n new Map(),\n);\n\n/**\n * @public\n */\nexport type PodMetricsMatcher = {\n metadata?: IObjectMeta;\n};\n\n/**\n * Find metrics matching the provided pod\n *\n * @public\n */\nexport const usePodMetrics = (\n clusterName: string,\n matcher: PodMetricsMatcher,\n): ClientPodStatus | undefined => {\n const targetRef = {\n name: matcher.metadata?.name ?? '',\n namespace: matcher.metadata?.namespace ?? '',\n };\n\n const metricsMap = useContext(PodMetricsContext);\n\n const metrics = metricsMap.get(clusterName);\n\n return metrics?.find(m => {\n const pod = m.pod;\n return (\n targetRef.name === (pod.metadata?.name ?? '') &&\n targetRef.namespace === (pod.metadata?.namespace ?? '')\n );\n });\n};\n"],"names":[],"mappings":";;AAwBO,MAAM,iBAAA,GAAoB,aAAA;AAAA,sBAC3B,GAAA;AACN;AAcO,MAAM,aAAA,GAAgB,CAC3B,WAAA,EACA,OAAA,KACgC;AAChC,EAAA,MAAM,SAAA,GAAY;AAAA,IAChB,IAAA,EAAM,OAAA,CAAQ,QAAA,EAAU,IAAA,IAAQ,EAAA;AAAA,IAChC,SAAA,EAAW,OAAA,CAAQ,QAAA,EAAU,SAAA,IAAa;AAAA,GAC5C;AAEA,EAAA,MAAM,UAAA,GAAa,WAAW,iBAAiB,CAAA;AAE/C,EAAA,MAAM,OAAA,GAAU,UAAA,CAAW,GAAA,CAAI,WAAW,CAAA;AAE1C,EAAA,OAAO,OAAA,EAAS,KAAK,CAAA,CAAA,KAAK;AACxB,IAAA,MAAM,MAAM,CAAA,CAAE,GAAA;AACd,IAAA,OACE,SAAA,CAAU,IAAA,MAAU,GAAA,CAAI,QAAA,EAAU,IAAA,IAAQ,OAC1C,SAAA,CAAU,SAAA,MAAe,GAAA,CAAI,QAAA,EAAU,SAAA,IAAa,EAAA,CAAA;AAAA,EAExD,CAAC,CAAA;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AksKubernetesAuthProvider.esm.js","sources":["../../src/kubernetes-auth-provider/AksKubernetesAuthProvider.ts"],"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 { OAuthApi } from '@backstage/core-plugin-api';\nimport { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { KubernetesAuthProvider } from './types';\n\n/** @public */\nexport class AksKubernetesAuthProvider implements KubernetesAuthProvider {\n private readonly microsoftAuthApi: OAuthApi;\n\n constructor(microsoftAuthApi: OAuthApi) {\n this.microsoftAuthApi = microsoftAuthApi;\n }\n\n async decorateRequestBodyForAuth(\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody> {\n return {\n ...requestBody,\n auth: { ...requestBody.auth, aks: (await this.getCredentials()).token },\n };\n }\n\n async getCredentials(): Promise<{ token?: string }> {\n return {\n token: await this.microsoftAuthApi.getAccessToken(\n '6dae42f8-4368-4678-94ff-3960e28e3630/user.read',\n ),\n };\n }\n}\n"],"names":[],"mappings":"AAoBO,MAAM,yBAAA,CAA4D;AAAA,EACtD,gBAAA;AAAA,EAEjB,YAAY,gBAAA,EAA4B;AACtC,IAAA,IAAA,CAAK,gBAAA,GAAmB,gBAAA;AAAA,EAC1B;AAAA,EAEA,MAAM,2BACJ,WAAA,EACgC;AAChC,IAAA,OAAO;AAAA,MACL,GAAG,WAAA;AAAA,MACH,IAAA,EAAM,EAAE,GAAG,WAAA,CAAY,IAAA,EAAM,MAAM,MAAM,IAAA,CAAK,cAAA,EAAe,EAAG,KAAA;AAAM,KACxE;AAAA,EACF;AAAA,EAEA,MAAM,cAAA,GAA8C;AAClD,IAAA,OAAO;AAAA,MACL,KAAA,EAAO,MAAM,IAAA,CAAK,gBAAA,CAAiB,cAAA;AAAA,QACjC;AAAA;AACF,KACF;AAAA,EACF;AACF
|
|
1
|
+
{"version":3,"file":"AksKubernetesAuthProvider.esm.js","sources":["../../src/kubernetes-auth-provider/AksKubernetesAuthProvider.ts"],"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 { OAuthApi } from '@backstage/core-plugin-api';\nimport { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { KubernetesAuthProvider } from './types';\n\n/** @public */\nexport class AksKubernetesAuthProvider implements KubernetesAuthProvider {\n private readonly microsoftAuthApi: OAuthApi;\n\n constructor(microsoftAuthApi: OAuthApi) {\n this.microsoftAuthApi = microsoftAuthApi;\n }\n\n async decorateRequestBodyForAuth(\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody> {\n return {\n ...requestBody,\n auth: { ...requestBody.auth, aks: (await this.getCredentials()).token },\n };\n }\n\n async getCredentials(): Promise<{ token?: string }> {\n return {\n token: await this.microsoftAuthApi.getAccessToken(\n '6dae42f8-4368-4678-94ff-3960e28e3630/user.read',\n ),\n };\n }\n}\n"],"names":[],"mappings":"AAoBO,MAAM,yBAAA,CAA4D;AAAA,EACtD,gBAAA;AAAA,EAEjB,YAAY,gBAAA,EAA4B;AACtC,IAAA,IAAA,CAAK,gBAAA,GAAmB,gBAAA;AAAA,EAC1B;AAAA,EAEA,MAAM,2BACJ,WAAA,EACgC;AAChC,IAAA,OAAO;AAAA,MACL,GAAG,WAAA;AAAA,MACH,IAAA,EAAM,EAAE,GAAG,WAAA,CAAY,IAAA,EAAM,MAAM,MAAM,IAAA,CAAK,cAAA,EAAe,EAAG,KAAA;AAAM,KACxE;AAAA,EACF;AAAA,EAEA,MAAM,cAAA,GAA8C;AAClD,IAAA,OAAO;AAAA,MACL,KAAA,EAAO,MAAM,IAAA,CAAK,gBAAA,CAAiB,cAAA;AAAA,QACjC;AAAA;AACF,KACF;AAAA,EACF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleKubernetesAuthProvider.esm.js","sources":["../../src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts"],"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 { KubernetesAuthProvider } from './types';\nimport { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { OAuthApi } from '@backstage/core-plugin-api';\n\n/** @public */\nexport class GoogleKubernetesAuthProvider implements KubernetesAuthProvider {\n authProvider: OAuthApi;\n\n constructor(authProvider: OAuthApi) {\n this.authProvider = authProvider;\n }\n\n async decorateRequestBodyForAuth(\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody> {\n const googleAuthToken: string = (await this.getCredentials()).token;\n if ('auth' in requestBody) {\n requestBody.auth!.google = googleAuthToken;\n } else {\n requestBody.auth = { google: googleAuthToken };\n }\n return requestBody;\n }\n async getCredentials(): Promise<{ token: string }> {\n return {\n token: await this.authProvider.getAccessToken(\n 'https://www.googleapis.com/auth/cloud-platform.read-only',\n ),\n };\n }\n}\n"],"names":[],"mappings":"AAqBO,MAAM,4BAAA,CAA+D;AAAA,EAC1E,YAAA;AAAA,EAEA,YAAY,YAAA,EAAwB;AAClC,IAAA,IAAA,CAAK,YAAA,GAAe,YAAA;AAAA,EACtB;AAAA,EAEA,MAAM,2BACJ,WAAA,EACgC;AAChC,IAAA,MAAM,eAAA,GAAA,CAA2B,MAAM,IAAA,CAAK,cAAA,EAAe,EAAG,KAAA;AAC9D,IAAA,IAAI,UAAU,WAAA,EAAa;AACzB,MAAA,WAAA,CAAY,KAAM,MAAA,GAAS,eAAA;AAAA,IAC7B,CAAA,MAAO;AACL,MAAA,WAAA,CAAY,IAAA,GAAO,EAAE,MAAA,EAAQ,eAAA,EAAgB;AAAA,IAC/C;AACA,IAAA,OAAO,WAAA;AAAA,EACT;AAAA,EACA,MAAM,cAAA,GAA6C;AACjD,IAAA,OAAO;AAAA,MACL,KAAA,EAAO,MAAM,IAAA,CAAK,YAAA,CAAa,cAAA;AAAA,QAC7B;AAAA;AACF,KACF;AAAA,EACF;AACF
|
|
1
|
+
{"version":3,"file":"GoogleKubernetesAuthProvider.esm.js","sources":["../../src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts"],"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 { KubernetesAuthProvider } from './types';\nimport { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { OAuthApi } from '@backstage/core-plugin-api';\n\n/** @public */\nexport class GoogleKubernetesAuthProvider implements KubernetesAuthProvider {\n authProvider: OAuthApi;\n\n constructor(authProvider: OAuthApi) {\n this.authProvider = authProvider;\n }\n\n async decorateRequestBodyForAuth(\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody> {\n const googleAuthToken: string = (await this.getCredentials()).token;\n if ('auth' in requestBody) {\n requestBody.auth!.google = googleAuthToken;\n } else {\n requestBody.auth = { google: googleAuthToken };\n }\n return requestBody;\n }\n async getCredentials(): Promise<{ token: string }> {\n return {\n token: await this.authProvider.getAccessToken(\n 'https://www.googleapis.com/auth/cloud-platform.read-only',\n ),\n };\n }\n}\n"],"names":[],"mappings":"AAqBO,MAAM,4BAAA,CAA+D;AAAA,EAC1E,YAAA;AAAA,EAEA,YAAY,YAAA,EAAwB;AAClC,IAAA,IAAA,CAAK,YAAA,GAAe,YAAA;AAAA,EACtB;AAAA,EAEA,MAAM,2BACJ,WAAA,EACgC;AAChC,IAAA,MAAM,eAAA,GAAA,CAA2B,MAAM,IAAA,CAAK,cAAA,EAAe,EAAG,KAAA;AAC9D,IAAA,IAAI,UAAU,WAAA,EAAa;AACzB,MAAA,WAAA,CAAY,KAAM,MAAA,GAAS,eAAA;AAAA,IAC7B,CAAA,MAAO;AACL,MAAA,WAAA,CAAY,IAAA,GAAO,EAAE,MAAA,EAAQ,eAAA,EAAgB;AAAA,IAC/C;AACA,IAAA,OAAO,WAAA;AAAA,EACT;AAAA,EACA,MAAM,cAAA,GAA6C;AACjD,IAAA,OAAO;AAAA,MACL,KAAA,EAAO,MAAM,IAAA,CAAK,YAAA,CAAa,cAAA;AAAA,QAC7B;AAAA;AACF,KACF;AAAA,EACF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KubernetesAuthProviders.esm.js","sources":["../../src/kubernetes-auth-provider/KubernetesAuthProviders.ts"],"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 { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { KubernetesAuthProvider, KubernetesAuthProvidersApi } from './types';\nimport { GoogleKubernetesAuthProvider } from './GoogleKubernetesAuthProvider';\nimport { ServerSideKubernetesAuthProvider } from './ServerSideAuthProvider';\nimport { OAuthApi, OpenIdConnectApi } from '@backstage/core-plugin-api';\nimport { OidcKubernetesAuthProvider } from './OidcKubernetesAuthProvider';\nimport { AksKubernetesAuthProvider } from './AksKubernetesAuthProvider';\n\n/** @public */\nexport class KubernetesAuthProviders implements KubernetesAuthProvidersApi {\n private readonly kubernetesAuthProviderMap: Map<\n string,\n KubernetesAuthProvider\n >;\n\n constructor(options: {\n microsoftAuthApi: OAuthApi;\n googleAuthApi: OAuthApi;\n oidcProviders?: { [key: string]: OpenIdConnectApi };\n }) {\n this.kubernetesAuthProviderMap = new Map<string, KubernetesAuthProvider>();\n this.kubernetesAuthProviderMap.set(\n 'google',\n new GoogleKubernetesAuthProvider(options.googleAuthApi),\n );\n this.kubernetesAuthProviderMap.set(\n 'serviceAccount',\n new ServerSideKubernetesAuthProvider(),\n );\n this.kubernetesAuthProviderMap.set(\n 'googleServiceAccount',\n new ServerSideKubernetesAuthProvider(),\n );\n this.kubernetesAuthProviderMap.set(\n 'aws',\n new ServerSideKubernetesAuthProvider(),\n );\n this.kubernetesAuthProviderMap.set(\n 'azure',\n new ServerSideKubernetesAuthProvider(),\n );\n this.kubernetesAuthProviderMap.set(\n 'localKubectlProxy',\n new ServerSideKubernetesAuthProvider(),\n );\n this.kubernetesAuthProviderMap.set(\n 'aks',\n new AksKubernetesAuthProvider(options.microsoftAuthApi),\n );\n\n if (options.oidcProviders) {\n Object.keys(options.oidcProviders).forEach(provider => {\n this.kubernetesAuthProviderMap.set(\n `oidc.${provider}`,\n new OidcKubernetesAuthProvider(\n provider,\n options.oidcProviders![provider],\n ),\n );\n });\n }\n }\n\n async decorateRequestBodyForAuth(\n authProvider: string,\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody> {\n const kubernetesAuthProvider: KubernetesAuthProvider | undefined =\n this.kubernetesAuthProviderMap.get(authProvider);\n if (kubernetesAuthProvider) {\n return await kubernetesAuthProvider.decorateRequestBodyForAuth(\n requestBody,\n );\n }\n\n if (authProvider.startsWith('oidc.')) {\n throw new Error(\n `KubernetesAuthProviders has no oidcProvider configured for ${authProvider}`,\n );\n }\n throw new Error(\n `authProvider \"${authProvider}\" has no KubernetesAuthProvider defined for it`,\n );\n }\n\n async getCredentials(authProvider: string): Promise<{ token?: string }> {\n const kubernetesAuthProvider: KubernetesAuthProvider | undefined =\n this.kubernetesAuthProviderMap.get(authProvider);\n\n if (kubernetesAuthProvider) {\n return await kubernetesAuthProvider.getCredentials();\n }\n\n if (authProvider.startsWith('oidc.')) {\n throw new Error(\n `KubernetesAuthProviders has no oidcProvider configured for ${authProvider}`,\n );\n }\n throw new Error(\n `authProvider \"${authProvider}\" has no KubernetesAuthProvider defined for it`,\n );\n }\n}\n"],"names":[],"mappings":";;;;;AAyBO,MAAM,uBAAA,CAA8D;AAAA,EACxD,yBAAA;AAAA,EAKjB,YAAY,OAAA,EAIT;AACD,IAAA,IAAA,CAAK,yBAAA,uBAAgC,GAAA,EAAoC;AACzE,IAAA,IAAA,CAAK,yBAAA,CAA0B,GAAA;AAAA,MAC7B,QAAA;AAAA,MACA,IAAI,4BAAA,CAA6B,OAAA,CAAQ,aAAa;AAAA,KACxD;AACA,IAAA,IAAA,CAAK,yBAAA,CAA0B,GAAA;AAAA,MAC7B,gBAAA;AAAA,MACA,IAAI,gCAAA;AAAiC,KACvC;AACA,IAAA,IAAA,CAAK,yBAAA,CAA0B,GAAA;AAAA,MAC7B,sBAAA;AAAA,MACA,IAAI,gCAAA;AAAiC,KACvC;AACA,IAAA,IAAA,CAAK,yBAAA,CAA0B,GAAA;AAAA,MAC7B,KAAA;AAAA,MACA,IAAI,gCAAA;AAAiC,KACvC;AACA,IAAA,IAAA,CAAK,yBAAA,CAA0B,GAAA;AAAA,MAC7B,OAAA;AAAA,MACA,IAAI,gCAAA;AAAiC,KACvC;AACA,IAAA,IAAA,CAAK,yBAAA,CAA0B,GAAA;AAAA,MAC7B,mBAAA;AAAA,MACA,IAAI,gCAAA;AAAiC,KACvC;AACA,IAAA,IAAA,CAAK,yBAAA,CAA0B,GAAA;AAAA,MAC7B,KAAA;AAAA,MACA,IAAI,yBAAA,CAA0B,OAAA,CAAQ,gBAAgB;AAAA,KACxD;AAEA,IAAA,IAAI,QAAQ,aAAA,EAAe;AACzB,MAAA,MAAA,CAAO,IAAA,CAAK,OAAA,CAAQ,aAAa,CAAA,CAAE,QAAQ,CAAA,QAAA,KAAY;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KubernetesAuthProviders.ts"],"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 { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { KubernetesAuthProvider, KubernetesAuthProvidersApi } from './types';\nimport { GoogleKubernetesAuthProvider } from './GoogleKubernetesAuthProvider';\nimport { ServerSideKubernetesAuthProvider } from './ServerSideAuthProvider';\nimport { OAuthApi, OpenIdConnectApi } from '@backstage/core-plugin-api';\nimport { OidcKubernetesAuthProvider } from './OidcKubernetesAuthProvider';\nimport { AksKubernetesAuthProvider } from './AksKubernetesAuthProvider';\n\n/** @public */\nexport class KubernetesAuthProviders implements KubernetesAuthProvidersApi {\n private readonly kubernetesAuthProviderMap: Map<\n string,\n KubernetesAuthProvider\n >;\n\n constructor(options: {\n microsoftAuthApi: OAuthApi;\n googleAuthApi: OAuthApi;\n oidcProviders?: { [key: string]: OpenIdConnectApi };\n }) {\n this.kubernetesAuthProviderMap = new Map<string, KubernetesAuthProvider>();\n this.kubernetesAuthProviderMap.set(\n 'google',\n new GoogleKubernetesAuthProvider(options.googleAuthApi),\n );\n this.kubernetesAuthProviderMap.set(\n 'serviceAccount',\n new ServerSideKubernetesAuthProvider(),\n );\n this.kubernetesAuthProviderMap.set(\n 'googleServiceAccount',\n new ServerSideKubernetesAuthProvider(),\n );\n this.kubernetesAuthProviderMap.set(\n 'aws',\n new ServerSideKubernetesAuthProvider(),\n );\n this.kubernetesAuthProviderMap.set(\n 'azure',\n new ServerSideKubernetesAuthProvider(),\n );\n this.kubernetesAuthProviderMap.set(\n 'localKubectlProxy',\n new ServerSideKubernetesAuthProvider(),\n );\n this.kubernetesAuthProviderMap.set(\n 'aks',\n new AksKubernetesAuthProvider(options.microsoftAuthApi),\n );\n\n if (options.oidcProviders) {\n Object.keys(options.oidcProviders).forEach(provider => {\n this.kubernetesAuthProviderMap.set(\n `oidc.${provider}`,\n new OidcKubernetesAuthProvider(\n provider,\n options.oidcProviders![provider],\n ),\n );\n });\n }\n }\n\n async decorateRequestBodyForAuth(\n authProvider: string,\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody> {\n const kubernetesAuthProvider: KubernetesAuthProvider | undefined =\n this.kubernetesAuthProviderMap.get(authProvider);\n if (kubernetesAuthProvider) {\n return await kubernetesAuthProvider.decorateRequestBodyForAuth(\n requestBody,\n );\n }\n\n if (authProvider.startsWith('oidc.')) {\n throw new Error(\n `KubernetesAuthProviders has no oidcProvider configured for ${authProvider}`,\n );\n }\n throw new Error(\n `authProvider \"${authProvider}\" has no KubernetesAuthProvider defined for it`,\n );\n }\n\n async getCredentials(authProvider: string): Promise<{ token?: string }> {\n const kubernetesAuthProvider: KubernetesAuthProvider | undefined =\n this.kubernetesAuthProviderMap.get(authProvider);\n\n if (kubernetesAuthProvider) {\n return await kubernetesAuthProvider.getCredentials();\n }\n\n if (authProvider.startsWith('oidc.')) {\n throw new Error(\n `KubernetesAuthProviders has no oidcProvider configured for ${authProvider}`,\n );\n }\n throw new Error(\n `authProvider \"${authProvider}\" has no KubernetesAuthProvider defined for it`,\n );\n }\n}\n"],"names":[],"mappings":";;;;;AAyBO,MAAM,uBAAA,CAA8D;AAAA,EACxD,yBAAA;AAAA,EAKjB,YAAY,OAAA,EAIT;AACD,IAAA,IAAA,CAAK,yBAAA,uBAAgC,GAAA,EAAoC;AACzE,IAAA,IAAA,CAAK,yBAAA,CAA0B,GAAA;AAAA,MAC7B,QAAA;AAAA,MACA,IAAI,4BAAA,CAA6B,OAAA,CAAQ,aAAa;AAAA,KACxD;AACA,IAAA,IAAA,CAAK,yB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,CAAa,UAAA,CAAW,OAAO,CAAA,EAAG;AACpC,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,8DAA8D,YAAY,CAAA;AAAA,OAC5E;AAAA,IACF;AACA,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,iBAAiB,YAAY,CAAA,8CAAA;AAAA,KAC/B;AAAA,EACF;AAAA,EAEA,MAAM,eAAe,YAAA,EAAmD;AACtE,IAAA,MAAM,sBAAA,GACJ,IAAA,CAAK,yBAAA,CAA0B,GAAA,CAAI,YAAY,CAAA;AAEjD,IAAA,IAAI,sBAAA,EAAwB;AAC1B,MAAA,OAAO,MAAM,uBAAuB,cAAA,EAAe;AAAA,IACrD;AAEA,IAAA,IAAI,YAAA,CAAa,UAAA,CAAW,OAAO,CAAA,EAAG;AACpC,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,8DAA8D,YAAY,CAAA;AAAA,OAC5E;AAAA,IACF;AACA,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,iBAAiB,YAAY,CAAA,8CAAA;AAAA,KAC/B;AAAA,EACF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OidcKubernetesAuthProvider.esm.js","sources":["../../src/kubernetes-auth-provider/OidcKubernetesAuthProvider.ts"],"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 { JsonObject } from '@backstage/types';\nimport { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { OpenIdConnectApi } from '@backstage/core-plugin-api';\nimport { KubernetesAuthProvider } from './types';\n\n/** @public */\nexport class OidcKubernetesAuthProvider implements KubernetesAuthProvider {\n providerName: string;\n authProvider: OpenIdConnectApi;\n\n constructor(providerName: string, authProvider: OpenIdConnectApi) {\n this.providerName = providerName;\n this.authProvider = authProvider;\n }\n\n async decorateRequestBodyForAuth(\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody> {\n const authToken: string = (await this.getCredentials()).token;\n const auth = { ...(requestBody.auth as JsonObject) };\n if (auth.oidc) {\n (auth.oidc as JsonObject)[this.providerName] = authToken;\n } else {\n auth.oidc = { [this.providerName]: authToken };\n }\n requestBody.auth = auth;\n return requestBody;\n }\n\n async getCredentials(): Promise<{ token: string }> {\n return {\n token: await this.authProvider.getIdToken(),\n };\n }\n}\n"],"names":[],"mappings":"AAsBO,MAAM,0BAAA,CAA6D;AAAA,EACxE,YAAA;AAAA,EACA,YAAA;AAAA,EAEA,WAAA,CAAY,cAAsB,YAAA,EAAgC;AAChE,IAAA,IAAA,CAAK,YAAA,GAAe,YAAA;AACpB,IAAA,IAAA,CAAK,YAAA,GAAe,YAAA;AAAA,EACtB;AAAA,EAEA,MAAM,2BACJ,WAAA,EACgC;AAChC,IAAA,MAAM,SAAA,GAAA,CAAqB,MAAM,IAAA,CAAK,cAAA,EAAe,EAAG,KAAA;AACxD,IAAA,MAAM,IAAA,GAAO,EAAE,GAAI,WAAA,CAAY,IAAA,EAAoB;AACnD,IAAA,IAAI,KAAK,IAAA,EAAM;AACb,MAAC,IAAA,CAAK,IAAA,CAAoB,IAAA,CAAK,YAAY,CAAA,GAAI,SAAA;AAAA,IACjD,CAAA,MAAO;AACL,MAAA,IAAA,CAAK,OAAO,EAAE,CAAC,IAAA,CAAK,YAAY,GAAG,SAAA,EAAU;AAAA,IAC/C;AACA,IAAA,WAAA,CAAY,IAAA,GAAO,IAAA;AACnB,IAAA,OAAO,WAAA;AAAA,EACT;AAAA,EAEA,MAAM,cAAA,GAA6C;AACjD,IAAA,OAAO;AAAA,MACL,KAAA,EAAO,MAAM,IAAA,CAAK,YAAA,CAAa,UAAA;AAAW,KAC5C;AAAA,EACF;AACF
|
|
1
|
+
{"version":3,"file":"OidcKubernetesAuthProvider.esm.js","sources":["../../src/kubernetes-auth-provider/OidcKubernetesAuthProvider.ts"],"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 { JsonObject } from '@backstage/types';\nimport { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { OpenIdConnectApi } from '@backstage/core-plugin-api';\nimport { KubernetesAuthProvider } from './types';\n\n/** @public */\nexport class OidcKubernetesAuthProvider implements KubernetesAuthProvider {\n providerName: string;\n authProvider: OpenIdConnectApi;\n\n constructor(providerName: string, authProvider: OpenIdConnectApi) {\n this.providerName = providerName;\n this.authProvider = authProvider;\n }\n\n async decorateRequestBodyForAuth(\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody> {\n const authToken: string = (await this.getCredentials()).token;\n const auth = { ...(requestBody.auth as JsonObject) };\n if (auth.oidc) {\n (auth.oidc as JsonObject)[this.providerName] = authToken;\n } else {\n auth.oidc = { [this.providerName]: authToken };\n }\n requestBody.auth = auth;\n return requestBody;\n }\n\n async getCredentials(): Promise<{ token: string }> {\n return {\n token: await this.authProvider.getIdToken(),\n };\n }\n}\n"],"names":[],"mappings":"AAsBO,MAAM,0BAAA,CAA6D;AAAA,EACxE,YAAA;AAAA,EACA,YAAA;AAAA,EAEA,WAAA,CAAY,cAAsB,YAAA,EAAgC;AAChE,IAAA,IAAA,CAAK,YAAA,GAAe,YAAA;AACpB,IAAA,IAAA,CAAK,YAAA,GAAe,YAAA;AAAA,EACtB;AAAA,EAEA,MAAM,2BACJ,WAAA,EACgC;AAChC,IAAA,MAAM,SAAA,GAAA,CAAqB,MAAM,IAAA,CAAK,cAAA,EAAe,EAAG,KAAA;AACxD,IAAA,MAAM,IAAA,GAAO,EAAE,GAAI,WAAA,CAAY,IAAA,EAAoB;AACnD,IAAA,IAAI,KAAK,IAAA,EAAM;AACb,MAAC,IAAA,CAAK,IAAA,CAAoB,IAAA,CAAK,YAAY,CAAA,GAAI,SAAA;AAAA,IACjD,CAAA,MAAO;AACL,MAAA,IAAA,CAAK,OAAO,EAAE,CAAC,IAAA,CAAK,YAAY,GAAG,SAAA,EAAU;AAAA,IAC/C;AACA,IAAA,WAAA,CAAY,IAAA,GAAO,IAAA;AACnB,IAAA,OAAO,WAAA;AAAA,EACT;AAAA,EAEA,MAAM,cAAA,GAA6C;AACjD,IAAA,OAAO;AAAA,MACL,KAAA,EAAO,MAAM,IAAA,CAAK,YAAA,CAAa,UAAA;AAAW,KAC5C;AAAA,EACF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerSideAuthProvider.esm.js","sources":["../../src/kubernetes-auth-provider/ServerSideAuthProvider.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { KubernetesAuthProvider } from './types';\nimport { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\n\n/**\n * No-op KubernetesAuthProvider, authorization will be handled in the kubernetes-backend plugin\n *\n * @public\n */\nexport class ServerSideKubernetesAuthProvider\n implements KubernetesAuthProvider\n{\n async decorateRequestBodyForAuth(\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody> {\n // No-op, auth will be taken care of on the server-side\n return requestBody;\n }\n\n async getCredentials(): Promise<{}> {\n return {};\n }\n}\n"],"names":[],"mappings":"AAwBO,MAAM,gCAAA,CAEb;AAAA,EACE,MAAM,2BACJ,WAAA,EACgC;AAEhC,IAAA,OAAO,WAAA;AAAA,EACT;AAAA,EAEA,MAAM,cAAA,GAA8B;AAClC,IAAA,OAAO,EAAC;AAAA,EACV;AACF
|
|
1
|
+
{"version":3,"file":"ServerSideAuthProvider.esm.js","sources":["../../src/kubernetes-auth-provider/ServerSideAuthProvider.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { KubernetesAuthProvider } from './types';\nimport { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\n\n/**\n * No-op KubernetesAuthProvider, authorization will be handled in the kubernetes-backend plugin\n *\n * @public\n */\nexport class ServerSideKubernetesAuthProvider\n implements KubernetesAuthProvider\n{\n async decorateRequestBodyForAuth(\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody> {\n // No-op, auth will be taken care of on the server-side\n return requestBody;\n }\n\n async getCredentials(): Promise<{}> {\n return {};\n }\n}\n"],"names":[],"mappings":"AAwBO,MAAM,gCAAA,CAEb;AAAA,EACE,MAAM,2BACJ,WAAA,EACgC;AAEhC,IAAA,OAAO,WAAA;AAAA,EACT;AAAA,EAEA,MAAM,cAAA,GAA8B;AAClC,IAAA,OAAO,EAAC;AAAA,EACV;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.esm.js","sources":["../../src/kubernetes-auth-provider/types.ts"],"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 { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/** @public */\nexport interface KubernetesAuthProvider {\n decorateRequestBodyForAuth(\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody>;\n getCredentials(): Promise<{ token?: string }>;\n}\n\n/** @public */\nexport const kubernetesAuthProvidersApiRef =\n createApiRef<KubernetesAuthProvidersApi>({\n id: 'plugin.kubernetes-auth-providers.service',\n });\n\n/** @public */\nexport interface KubernetesAuthProvidersApi {\n decorateRequestBodyForAuth(\n authProvider: string,\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody>;\n getCredentials(authProvider: string): Promise<{ token?: string }>;\n}\n"],"names":[],"mappings":";;AA4BO,MAAM,gCACX,YAAA,CAAyC;AAAA,EACvC,EAAA,EAAI;AACN,CAAC
|
|
1
|
+
{"version":3,"file":"types.esm.js","sources":["../../src/kubernetes-auth-provider/types.ts"],"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 { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/** @public */\nexport interface KubernetesAuthProvider {\n decorateRequestBodyForAuth(\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody>;\n getCredentials(): Promise<{ token?: string }>;\n}\n\n/** @public */\nexport const kubernetesAuthProvidersApiRef =\n createApiRef<KubernetesAuthProvidersApi>({\n id: 'plugin.kubernetes-auth-providers.service',\n });\n\n/** @public */\nexport interface KubernetesAuthProvidersApi {\n decorateRequestBodyForAuth(\n authProvider: string,\n requestBody: KubernetesRequestBody,\n ): Promise<KubernetesRequestBody>;\n getCredentials(authProvider: string): Promise<{ token?: string }>;\n}\n"],"names":[],"mappings":";;AA4BO,MAAM,gCACX,YAAA,CAAyC;AAAA,EACvC,EAAA,EAAI;AACN,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport const kubernetesReactTranslationRef = createTranslationRef({\n id: 'kubernetes-react',\n messages: {\n cluster: {\n label: 'Cluster',\n pods: 'pods',\n pods_one: '{{count}} pod',\n pods_other: '{{count}} pods',\n podsWithErrors: 'pods with errors',\n podsWithErrors_one: '{{count}} pod with errors',\n podsWithErrors_other: '{{count}} pods with errors',\n noPodsWithErrors: 'No pods with errors',\n },\n podsTable: {\n columns: {\n id: 'ID',\n name: 'name',\n phase: 'phase',\n status: 'status',\n containersReady: 'containers ready',\n totalRestarts: 'total restarts',\n cpuUsage: 'CPU usage %',\n memoryUsage: 'Memory usage %',\n },\n unknown: 'unknown',\n status: {\n running: 'Running',\n ok: 'OK',\n },\n },\n errorPanel: {\n title: 'There was a problem retrieving Kubernetes objects',\n message:\n 'There was a problem retrieving some Kubernetes resources for the entity: {{entityName}}. This could mean that the Error Reporting card is not completely accurate.',\n errorsLabel: 'Errors',\n clusterLabel: 'Cluster',\n clusterLabelValue: 'Cluster: {{cluster}}',\n fetchError:\n 'Error communicating with Kubernetes: {{errorType}}, message: {{message}}',\n resourceError:\n \"Error fetching Kubernetes resource: '{{resourcePath}}', error: {{errorType}}, status code: {{statusCode}}\",\n },\n fixDialog: {\n helpButton: 'Help',\n title: '{{podName}} - {{errorType}}',\n detectedError: 'Detected error:',\n causeExplanation: 'Cause explanation:',\n fix: 'Fix:',\n crashLogs: 'Crash logs:',\n events: 'Events:',\n openDocs: 'Open docs',\n ariaLabels: {\n fixIssue: 'fix issue',\n close: 'close',\n },\n },\n podDrawer: {\n buttons: {\n delete: 'Delete Pod',\n },\n cpuRequests: 'CPU requests',\n cpuLimits: 'CPU limits',\n memoryRequests: 'Memory requests',\n memoryLimits: 'Memory limits',\n resourceUtilization: 'Resource utilization',\n },\n hpa: {\n minReplicas: 'min replicas',\n maxReplicas: 'max replicas',\n replicasSummary: 'min replicas {{min}} / max replicas {{max}}',\n currentCpuUsage: 'current CPU usage:',\n currentCpuUsageLabel: 'current CPU usage: {{value}}%',\n targetCpuUsage: 'target CPU usage:',\n targetCpuUsageLabel: 'target CPU usage: {{value}}%',\n },\n pods: {\n pods_one: '{{count}} pod',\n pods_other: '{{count}} pods',\n },\n errorReporting: {\n title: 'Error Reporting',\n columns: {\n cluster: 'cluster',\n namespace: 'namespace',\n kind: 'kind',\n name: 'name',\n messages: 'messages',\n },\n },\n podLogs: {\n title: 'No logs emitted',\n description: 'No logs were emitted by the container',\n buttonText: 'Logs',\n buttonAriaLabel: 'get logs',\n titleTemplate:\n '{{podName}} - {{containerName}} logs on cluster {{clusterName}}',\n },\n podExecTerminal: {\n buttonText: 'Terminal',\n buttonAriaLabel: 'open terminal',\n titleTemplate:\n '{{podName}} - {{containerName}} terminal shell on cluster {{clusterName}}',\n },\n events: {\n noEventsFound: 'No events found',\n eventTooltip: '{{eventType}} event',\n firstEvent: 'First event {{timeAgo}} (count: {{count}})',\n },\n kubernetesDrawer: {\n closeDrawer: 'Close the drawer',\n yaml: 'YAML',\n managedFields: 'Managed Fields',\n unknownName: 'unknown name',\n },\n linkErrorPanel: {\n title:\n 'There was a problem formatting the link to the Kubernetes dashboard',\n message:\n \"Could not format the link to the dashboard of your cluster named '{{clusterName}}'. Its dashboardApp property has been set to '{{dashboardApp}}.'\",\n errorsLabel: 'Errors:',\n },\n namespace: {\n label: 'namespace:',\n labelWithValue: 'namespace: {{namespace}}',\n },\n kubernetesDialog: {\n closeAriaLabel: 'close',\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,gCAAgC,oBAAA,CAAqB;AAAA,EAChE,EAAA,EAAI,kBAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,KAAA,EAAO,SAAA;AAAA,MACP,IAAA,EAAM,MAAA;AAAA,MACN,QAAA,EAAU,eAAA;AAAA,MACV,UAAA,EAAY,gBAAA;AAAA,MACZ,cAAA,EAAgB,kBAAA;AAAA,MAChB,kBAAA,EAAoB,2BAAA;AAAA,MACpB,oBAAA,EAAsB,4BAAA;AAAA,MACtB,gBAAA,EAAkB;AAAA,KACpB;AAAA,IACA,SAAA,EAAW;AAAA,MACT,OAAA,EAAS;AAAA,QACP,EAAA,EAAI,IAAA;AAAA,QACJ,IAAA,EAAM,MAAA;AAAA,QACN,KAAA,EAAO,OAAA;AAAA,QACP,MAAA,EAAQ,QAAA;AAAA,QACR,eAAA,EAAiB,k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
|
+
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport const kubernetesReactTranslationRef = createTranslationRef({\n id: 'kubernetes-react',\n messages: {\n cluster: {\n label: 'Cluster',\n pods: 'pods',\n pods_one: '{{count}} pod',\n pods_other: '{{count}} pods',\n podsWithErrors: 'pods with errors',\n podsWithErrors_one: '{{count}} pod with errors',\n podsWithErrors_other: '{{count}} pods with errors',\n noPodsWithErrors: 'No pods with errors',\n },\n podsTable: {\n columns: {\n id: 'ID',\n name: 'name',\n phase: 'phase',\n status: 'status',\n containersReady: 'containers ready',\n totalRestarts: 'total restarts',\n cpuUsage: 'CPU usage %',\n memoryUsage: 'Memory usage %',\n },\n unknown: 'unknown',\n status: {\n running: 'Running',\n ok: 'OK',\n },\n },\n errorPanel: {\n title: 'There was a problem retrieving Kubernetes objects',\n message:\n 'There was a problem retrieving some Kubernetes resources for the entity: {{entityName}}. This could mean that the Error Reporting card is not completely accurate.',\n errorsLabel: 'Errors',\n clusterLabel: 'Cluster',\n clusterLabelValue: 'Cluster: {{cluster}}',\n fetchError:\n 'Error communicating with Kubernetes: {{errorType}}, message: {{message}}',\n resourceError:\n \"Error fetching Kubernetes resource: '{{resourcePath}}', error: {{errorType}}, status code: {{statusCode}}\",\n },\n fixDialog: {\n helpButton: 'Help',\n title: '{{podName}} - {{errorType}}',\n detectedError: 'Detected error:',\n causeExplanation: 'Cause explanation:',\n fix: 'Fix:',\n crashLogs: 'Crash logs:',\n events: 'Events:',\n openDocs: 'Open docs',\n ariaLabels: {\n fixIssue: 'fix issue',\n close: 'close',\n },\n },\n podDrawer: {\n buttons: {\n delete: 'Delete Pod',\n },\n cpuRequests: 'CPU requests',\n cpuLimits: 'CPU limits',\n memoryRequests: 'Memory requests',\n memoryLimits: 'Memory limits',\n resourceUtilization: 'Resource utilization',\n },\n hpa: {\n minReplicas: 'min replicas',\n maxReplicas: 'max replicas',\n replicasSummary: 'min replicas {{min}} / max replicas {{max}}',\n currentCpuUsage: 'current CPU usage:',\n currentCpuUsageLabel: 'current CPU usage: {{value}}%',\n targetCpuUsage: 'target CPU usage:',\n targetCpuUsageLabel: 'target CPU usage: {{value}}%',\n },\n pods: {\n pods_one: '{{count}} pod',\n pods_other: '{{count}} pods',\n },\n errorReporting: {\n title: 'Error Reporting',\n columns: {\n cluster: 'cluster',\n namespace: 'namespace',\n kind: 'kind',\n name: 'name',\n messages: 'messages',\n },\n },\n podLogs: {\n title: 'No logs emitted',\n description: 'No logs were emitted by the container',\n buttonText: 'Logs',\n buttonAriaLabel: 'get logs',\n titleTemplate:\n '{{podName}} - {{containerName}} logs on cluster {{clusterName}}',\n },\n podExecTerminal: {\n buttonText: 'Terminal',\n buttonAriaLabel: 'open terminal',\n titleTemplate:\n '{{podName}} - {{containerName}} terminal shell on cluster {{clusterName}}',\n },\n events: {\n noEventsFound: 'No events found',\n eventTooltip: '{{eventType}} event',\n firstEvent: 'First event {{timeAgo}} (count: {{count}})',\n },\n kubernetesDrawer: {\n closeDrawer: 'Close the drawer',\n yaml: 'YAML',\n managedFields: 'Managed Fields',\n unknownName: 'unknown name',\n },\n linkErrorPanel: {\n title:\n 'There was a problem formatting the link to the Kubernetes dashboard',\n message:\n \"Could not format the link to the dashboard of your cluster named '{{clusterName}}'. Its dashboardApp property has been set to '{{dashboardApp}}.'\",\n errorsLabel: 'Errors:',\n },\n namespace: {\n label: 'namespace:',\n labelWithValue: 'namespace: {{namespace}}',\n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AA;AAAA,MACZ,eAAA,EAAiB,eAAA;AAAA,MACjB,aAAA,EACE;AAAA,KACJ;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,aAAA,EAAe,iBAAA;AAAA,MACf,YAAA,EAAc,qBAAA;AAAA,MACd,UAAA,EAAY;AAAA,KACd;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,WAAA,EAAa,kBAAA;AAAA,MACb,IAAA,EAAM,MAAA;AAAA,MACN,aAAA,EAAe,gBAAA;AAAA,MACf,WAAA,EAAa;AAAA,KACf;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,KAAA,EACE,qEAAA;AAAA,MACF,OAAA,EACE,mJAAA;AAAA,MACF,WAAA,EAAa;AAAA,KACf;AAAA,IACA,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,YAAA;AAAA,MACP,cAAA,EAAgB;AAAA,KAClB;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,cAAA,EAAgB;AAAA;AAClB;AAEJ,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crons.esm.js","sources":["../../src/utils/crons.ts"],"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 cronstrue from 'cronstrue';\n\n// Defined at https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/\nconst k8sCronAliases = new Map([\n ['@yearly', '0 0 1 1 *'],\n ['@annually', '0 0 1 1 *'],\n ['@monthly', '0 0 1 * *'],\n ['@weekly', '0 0 * * 0'],\n ['@daily', '0 0 * * *'],\n ['@midnight', '0 0 * * *'],\n ['@hourly', '0 * * * *'],\n]);\n\n// humanizeCron takes into account the aliases provided by kubernetes before\n// calling cronstrue. In an effort to not throw an error, it will return the\n// original cron formatted schedule if the cronstrue call fails.\nexport const humanizeCron = (schedule: string): string => {\n const deAliasedSchedule = k8sCronAliases.get(schedule) || schedule;\n try {\n return cronstrue.toString(deAliasedSchedule);\n } catch (e) {\n return deAliasedSchedule;\n }\n};\n"],"names":[],"mappings":";;AAmBA,MAAM,cAAA,uBAAqB,GAAA,CAAI;AAAA,EAC7B,CAAC,WAAW,WAAW,CAAA;AAAA,EACvB,CAAC,aAAa,WAAW,CAAA;AAAA,EACzB,CAAC,YAAY,WAAW,CAAA;AAAA,EACxB,CAAC,WAAW,WAAW,CAAA;AAAA,EACvB,CAAC,UAAU,WAAW,CAAA;AAAA,EACtB,CAAC,aAAa,WAAW,CAAA;AAAA,EACzB,CAAC,WAAW,WAAW;AACzB,CAAC,CAAA;AAKM,MAAM,YAAA,GAAe,CAAC,QAAA,KAA6B;AACxD,EAAA,MAAM,iBAAA,GAAoB,cAAA,CAAe,GAAA,CAAI,QAAQ,CAAA,IAAK,QAAA;AAC1D,EAAA,IAAI;AACF,IAAA,OAAO,SAAA,CAAU,SAAS,iBAAiB,CAAA;AAAA,EAC7C,SAAS,CAAA,EAAG;AACV,IAAA,OAAO,iBAAA;AAAA,EACT;AACF
|
|
1
|
+
{"version":3,"file":"crons.esm.js","sources":["../../src/utils/crons.ts"],"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 cronstrue from 'cronstrue';\n\n// Defined at https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/\nconst k8sCronAliases = new Map([\n ['@yearly', '0 0 1 1 *'],\n ['@annually', '0 0 1 1 *'],\n ['@monthly', '0 0 1 * *'],\n ['@weekly', '0 0 * * 0'],\n ['@daily', '0 0 * * *'],\n ['@midnight', '0 0 * * *'],\n ['@hourly', '0 * * * *'],\n]);\n\n// humanizeCron takes into account the aliases provided by kubernetes before\n// calling cronstrue. In an effort to not throw an error, it will return the\n// original cron formatted schedule if the cronstrue call fails.\nexport const humanizeCron = (schedule: string): string => {\n const deAliasedSchedule = k8sCronAliases.get(schedule) || schedule;\n try {\n return cronstrue.toString(deAliasedSchedule);\n } catch (e) {\n return deAliasedSchedule;\n }\n};\n"],"names":[],"mappings":";;AAmBA,MAAM,cAAA,uBAAqB,GAAA,CAAI;AAAA,EAC7B,CAAC,WAAW,WAAW,CAAA;AAAA,EACvB,CAAC,aAAa,WAAW,CAAA;AAAA,EACzB,CAAC,YAAY,WAAW,CAAA;AAAA,EACxB,CAAC,WAAW,WAAW,CAAA;AAAA,EACvB,CAAC,UAAU,WAAW,CAAA;AAAA,EACtB,CAAC,aAAa,WAAW,CAAA;AAAA,EACzB,CAAC,WAAW,WAAW;AACzB,CAAC,CAAA;AAKM,MAAM,YAAA,GAAe,CAAC,QAAA,KAA6B;AACxD,EAAA,MAAM,iBAAA,GAAoB,cAAA,CAAe,GAAA,CAAI,QAAQ,CAAA,IAAK,QAAA;AAC1D,EAAA,IAAI;AACF,IAAA,OAAO,SAAA,CAAU,SAAS,iBAAiB,CAAA;AAAA,EAC7C,SAAS,CAAA,EAAG;AACV,IAAA,OAAO,iBAAA;AAAA,EACT;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owner.esm.js","sources":["../../src/utils/owner.ts"],"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 type {\n V1ObjectMeta,\n V2HorizontalPodAutoscaler,\n V1Pod,\n V1ReplicaSet,\n} from '@kubernetes/client-node';\n\ninterface CanOwn {\n metadata?: V1ObjectMeta;\n}\n\ninterface CanBeOwned {\n metadata?: V1ObjectMeta;\n}\n\nexport function getOwnedResources<R extends CanBeOwned>(\n potentialOwner: CanOwn,\n possiblyOwned: R[],\n): R[] {\n return possiblyOwned.filter(\n p =>\n p.metadata?.ownerReferences?.some(\n o => o.uid === potentialOwner.metadata?.uid,\n ) ?? false,\n );\n}\n\nexport const getOwnedPodsThroughReplicaSets = (\n potentialOwner: CanOwn,\n replicaSets: V1ReplicaSet[],\n pods: V1Pod[],\n) => {\n return getOwnedResources(\n potentialOwner,\n replicaSets.filter(rs => rs.status && rs.status.replicas > 0),\n ).reduce((accum, rs) => {\n return accum.concat(getOwnedResources(rs, pods));\n }, [] as V1Pod[]);\n};\n\ninterface ResourceRef {\n kind: string;\n namespace?: string;\n name?: string;\n}\n\nexport const getMatchingHpa = (\n owner: ResourceRef,\n hpas: V2HorizontalPodAutoscaler[],\n): V2HorizontalPodAutoscaler | undefined => {\n return hpas.find(hpa => {\n return (\n (hpa.spec?.scaleTargetRef?.kind ?? '').toLowerCase() ===\n owner.kind.toLowerCase() &&\n (hpa.metadata?.namespace ?? '') ===\n (owner.namespace ?? 'unknown-namespace') &&\n (hpa.spec?.scaleTargetRef?.name ?? '') ===\n (owner.name ?? 'unknown-deployment')\n );\n });\n};\n"],"names":[],"mappings":"AA+BO,SAAS,iBAAA,CACd,gBACA,aAAA,EACK;AACL,EAAA,OAAO,aAAA,CAAc,MAAA;AAAA,IACnB,CAAA,CAAA,KACE,CAAA,CAAE,QAAA,EAAU,eAAA,EAAiB,IAAA;AAAA,MAC3B,CAAA,CAAA,KAAK,CAAA,CAAE,GAAA,KAAQ,cAAA,CAAe,QAAA,EAAU;AAAA,KAC1C,IAAK;AAAA,GACT;AACF;AAEO,MAAM,8BAAA,GAAiC,CAC5C,cAAA,EACA,WAAA,EACA,IAAA,KACG;AACH,EAAA,OAAO,iBAAA;AAAA,IACL,cAAA;AAAA,IACA,WAAA,CAAY,OAAO,CAAA,EAAA,KAAM,EAAA,CAAG,UAAU,EAAA,CAAG,MAAA,CAAO,WAAW,CAAC;AAAA,GAC9D,CAAE,MAAA,CAAO,CAAC,KAAA,EAAO,EAAA,KAAO;AACtB,IAAA,OAAO,KAAA,CAAM,MAAA,CAAO,iBAAA,CAAkB,EAAA,EAAI,IAAI,CAAC,CAAA;AAAA,EACjD,CAAA,EAAG,EAAa,CAAA;AAClB;AAQO,MAAM,cAAA,GAAiB,CAC5B,KAAA,EACA,IAAA,KAC0C;AAC1C,EAAA,OAAO,IAAA,CAAK,KAAK,CAAA,GAAA,KAAO;AACtB,IAAA,OAAA,CACG,GAAA,CAAI,IAAA,EAAM,cAAA,EAAgB,IAAA,IAAQ,EAAA,EAAI,aAAY,KACjD,KAAA,CAAM,IAAA,CAAK,WAAA,EAAY,IAAA,CACxB,GAAA,CAAI,UAAU,SAAA,IAAa,EAAA,OACzB,KAAA,CAAM,SAAA,IAAa,mBAAA,CAAA,IAAA,CACrB,GAAA,CAAI,MAAM,cAAA,EAAgB,IAAA,IAAQ,EAAA,OAChC,KAAA,CAAM,IAAA,IAAQ,oBAAA,CAAA;AAAA,EAErB,CAAC,CAAA;AACH
|
|
1
|
+
{"version":3,"file":"owner.esm.js","sources":["../../src/utils/owner.ts"],"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 type {\n V1ObjectMeta,\n V2HorizontalPodAutoscaler,\n V1Pod,\n V1ReplicaSet,\n} from '@kubernetes/client-node';\n\ninterface CanOwn {\n metadata?: V1ObjectMeta;\n}\n\ninterface CanBeOwned {\n metadata?: V1ObjectMeta;\n}\n\nexport function getOwnedResources<R extends CanBeOwned>(\n potentialOwner: CanOwn,\n possiblyOwned: R[],\n): R[] {\n return possiblyOwned.filter(\n p =>\n p.metadata?.ownerReferences?.some(\n o => o.uid === potentialOwner.metadata?.uid,\n ) ?? false,\n );\n}\n\nexport const getOwnedPodsThroughReplicaSets = (\n potentialOwner: CanOwn,\n replicaSets: V1ReplicaSet[],\n pods: V1Pod[],\n) => {\n return getOwnedResources(\n potentialOwner,\n replicaSets.filter(rs => rs.status && rs.status.replicas > 0),\n ).reduce((accum, rs) => {\n return accum.concat(getOwnedResources(rs, pods));\n }, [] as V1Pod[]);\n};\n\ninterface ResourceRef {\n kind: string;\n namespace?: string;\n name?: string;\n}\n\nexport const getMatchingHpa = (\n owner: ResourceRef,\n hpas: V2HorizontalPodAutoscaler[],\n): V2HorizontalPodAutoscaler | undefined => {\n return hpas.find(hpa => {\n return (\n (hpa.spec?.scaleTargetRef?.kind ?? '').toLowerCase() ===\n owner.kind.toLowerCase() &&\n (hpa.metadata?.namespace ?? '') ===\n (owner.namespace ?? 'unknown-namespace') &&\n (hpa.spec?.scaleTargetRef?.name ?? '') ===\n (owner.name ?? 'unknown-deployment')\n );\n });\n};\n"],"names":[],"mappings":"AA+BO,SAAS,iBAAA,CACd,gBACA,aAAA,EACK;AACL,EAAA,OAAO,aAAA,CAAc,MAAA;AAAA,IACnB,CAAA,CAAA,KACE,CAAA,CAAE,QAAA,EAAU,eAAA,EAAiB,IAAA;AAAA,MAC3B,CAAA,CAAA,KAAK,CAAA,CAAE,GAAA,KAAQ,cAAA,CAAe,QAAA,EAAU;AAAA,KAC1C,IAAK;AAAA,GACT;AACF;AAEO,MAAM,8BAAA,GAAiC,CAC5C,cAAA,EACA,WAAA,EACA,IAAA,KACG;AACH,EAAA,OAAO,iBAAA;AAAA,IACL,cAAA;AAAA,IACA,WAAA,CAAY,OAAO,CAAA,EAAA,KAAM,EAAA,CAAG,UAAU,EAAA,CAAG,MAAA,CAAO,WAAW,CAAC;AAAA,GAC9D,CAAE,MAAA,CAAO,CAAC,KAAA,EAAO,EAAA,KAAO;AACtB,IAAA,OAAO,KAAA,CAAM,MAAA,CAAO,iBAAA,CAAkB,EAAA,EAAI,IAAI,CAAC,CAAA;AAAA,EACjD,CAAA,EAAG,EAAa,CAAA;AAClB;AAQO,MAAM,cAAA,GAAiB,CAC5B,KAAA,EACA,IAAA,KAC0C;AAC1C,EAAA,OAAO,IAAA,CAAK,KAAK,CAAA,GAAA,KAAO;AACtB,IAAA,OAAA,CACG,GAAA,CAAI,IAAA,EAAM,cAAA,EAAgB,IAAA,IAAQ,EAAA,EAAI,aAAY,KACjD,KAAA,CAAM,IAAA,CAAK,WAAA,EAAY,IAAA,CACxB,GAAA,CAAI,UAAU,SAAA,IAAa,EAAA,OACzB,KAAA,CAAM,SAAA,IAAa,mBAAA,CAAA,IAAA,CACrB,GAAA,CAAI,MAAM,cAAA,EAAgB,IAAA,IAAQ,EAAA,OAChC,KAAA,CAAM,IAAA,IAAQ,oBAAA,CAAA;AAAA,EAErB,CAAC,CAAA;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistentVolumes.esm.js","sources":["../../src/utils/persistentVolumes.ts"],"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\nexport const getPersistentVolumeType = (driver?: string): string | null => {\n if (!driver) return null;\n\n if (driver.includes('aws')) {\n if (driver.includes('ebs')) return `AWS EBS Volume`;\n if (driver.includes('efs')) return `AWS EFS`;\n if (driver.includes('s3')) return `S3 Bucket`;\n }\n\n if (driver.includes('gke')) {\n if (driver.includes('gcsfuse')) return `GCS Fuse`;\n if (driver.includes('filestore')) return `GCP Filestore`;\n if (driver.includes('pd')) return `GCP Persistent Disk`;\n }\n\n if (driver.includes('azure')) {\n if (driver.includes('disk')) return `Azure Disk`;\n if (driver.includes('file')) return `Azure File`;\n if (driver.includes('blob')) return `Azure Blob`;\n }\n\n return driver;\n};\n"],"names":[],"mappings":"AAgBO,MAAM,uBAAA,GAA0B,CAAC,MAAA,KAAmC;AACzE,EAAA,IAAI,CAAC,QAAQ,OAAO,IAAA;AAEpB,EAAA,IAAI,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG;AAC1B,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG,OAAO,CAAA,cAAA,CAAA;AACnC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG,OAAO,CAAA,OAAA,CAAA;AACnC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,IAAI,CAAA,EAAG,OAAO,CAAA,SAAA,CAAA;AAAA,EACpC;AAEA,EAAA,IAAI,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG;AAC1B,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,SAAS,CAAA,EAAG,OAAO,CAAA,QAAA,CAAA;AACvC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,WAAW,CAAA,EAAG,OAAO,CAAA,aAAA,CAAA;AACzC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,IAAI,CAAA,EAAG,OAAO,CAAA,mBAAA,CAAA;AAAA,EACpC;AAEA,EAAA,IAAI,MAAA,CAAO,QAAA,CAAS,OAAO,CAAA,EAAG;AAC5B,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,MAAM,CAAA,EAAG,OAAO,CAAA,UAAA,CAAA;AACpC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,MAAM,CAAA,EAAG,OAAO,CAAA,UAAA,CAAA;AACpC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,MAAM,CAAA,EAAG,OAAO,CAAA,UAAA,CAAA;AAAA,EACtC;AAEA,EAAA,OAAO,MAAA;AACT
|
|
1
|
+
{"version":3,"file":"persistentVolumes.esm.js","sources":["../../src/utils/persistentVolumes.ts"],"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\nexport const getPersistentVolumeType = (driver?: string): string | null => {\n if (!driver) return null;\n\n if (driver.includes('aws')) {\n if (driver.includes('ebs')) return `AWS EBS Volume`;\n if (driver.includes('efs')) return `AWS EFS`;\n if (driver.includes('s3')) return `S3 Bucket`;\n }\n\n if (driver.includes('gke')) {\n if (driver.includes('gcsfuse')) return `GCS Fuse`;\n if (driver.includes('filestore')) return `GCP Filestore`;\n if (driver.includes('pd')) return `GCP Persistent Disk`;\n }\n\n if (driver.includes('azure')) {\n if (driver.includes('disk')) return `Azure Disk`;\n if (driver.includes('file')) return `Azure File`;\n if (driver.includes('blob')) return `Azure Blob`;\n }\n\n return driver;\n};\n"],"names":[],"mappings":"AAgBO,MAAM,uBAAA,GAA0B,CAAC,MAAA,KAAmC;AACzE,EAAA,IAAI,CAAC,QAAQ,OAAO,IAAA;AAEpB,EAAA,IAAI,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG;AAC1B,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG,OAAO,CAAA,cAAA,CAAA;AACnC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG,OAAO,CAAA,OAAA,CAAA;AACnC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,IAAI,CAAA,EAAG,OAAO,CAAA,SAAA,CAAA;AAAA,EACpC;AAEA,EAAA,IAAI,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG;AAC1B,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,SAAS,CAAA,EAAG,OAAO,CAAA,QAAA,CAAA;AACvC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,WAAW,CAAA,EAAG,OAAO,CAAA,aAAA,CAAA;AACzC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,IAAI,CAAA,EAAG,OAAO,CAAA,mBAAA,CAAA;AAAA,EACpC;AAEA,EAAA,IAAI,MAAA,CAAO,QAAA,CAAS,OAAO,CAAA,EAAG;AAC5B,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,MAAM,CAAA,EAAG,OAAO,CAAA,UAAA,CAAA;AACpC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,MAAM,CAAA,EAAG,OAAO,CAAA,UAAA,CAAA;AACpC,IAAA,IAAI,MAAA,CAAO,QAAA,CAAS,MAAM,CAAA,EAAG,OAAO,CAAA,UAAA,CAAA;AAAA,EACtC;AAEA,EAAA,OAAO,MAAA;AACT;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pod.esm.js","sources":["../../src/utils/pod.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 type {\n V1Pod,\n V1PodCondition,\n V1DeploymentCondition,\n} from '@kubernetes/client-node';\nimport { Fragment, ReactNode } from 'react';\nimport Chip from '@material-ui/core/Chip';\nimport {\n StatusAborted,\n StatusError,\n StatusOK,\n SubvalueCell,\n} from '@backstage/core-components';\nimport { ClientPodStatus } from '@backstage/plugin-kubernetes-common';\nimport { Pod } from 'kubernetes-models/v1/Pod';\nimport { bytesToMiB, formatMillicores } from './resources';\n\nexport const imageChips = (pod: V1Pod): ReactNode => {\n const containerStatuses = pod.status?.containerStatuses ?? [];\n const images = containerStatuses.map((cs, i) => {\n return <Chip key={i} label={`${cs.name}=${cs.image}`} size=\"small\" />;\n });\n\n return <div>{images}</div>;\n};\n\nexport const containersReady = (pod: Pod): string => {\n const containerStatuses = pod.status?.containerStatuses ?? [];\n const containersReadyItem = containerStatuses.filter(cs => cs.ready).length;\n\n return `${containersReadyItem}/${containerStatuses.length}`;\n};\n\nexport const totalRestarts = (pod: Pod): number => {\n const containerStatuses = pod.status?.containerStatuses ?? [];\n return containerStatuses?.reduce((a, b) => a + b.restartCount, 0);\n};\n\nexport const containerStatuses = (pod: Pod): ReactNode => {\n const containerStatusesItem = pod.status?.containerStatuses ?? [];\n const errors = containerStatusesItem.reduce((accum, next) => {\n if (next.state === undefined) {\n return accum;\n }\n\n const waiting = next.state.waiting;\n const terminated = next.state.terminated;\n\n const renderCell = (reason: string | undefined) => (\n <Fragment key={`${pod.metadata?.name}-${next.name}`}>\n <SubvalueCell\n value={\n reason === 'Completed' ? (\n <StatusOK>Container: {next.name}</StatusOK>\n ) : (\n <StatusError>Container: {next.name}</StatusError>\n )\n }\n subvalue={reason}\n />\n <br />\n </Fragment>\n );\n\n if (waiting) {\n accum.push(renderCell(waiting.reason));\n }\n\n if (terminated) {\n accum.push(renderCell(terminated.reason));\n }\n\n return accum;\n }, [] as ReactNode[]);\n\n if (errors.length === 0) {\n return <StatusOK>OK</StatusOK>;\n }\n\n return errors;\n};\n\nexport const renderCondition = (\n condition: V1PodCondition | V1DeploymentCondition,\n): [string, ReactNode] => {\n const status = condition.status;\n\n if (status === 'True') {\n return [condition.type, <StatusOK>True</StatusOK>];\n } else if (status === 'False') {\n return [\n condition.type,\n <SubvalueCell\n value={<StatusError>False</StatusError>}\n subvalue={condition.message ?? ''}\n />,\n ];\n }\n return [condition.type, <StatusAborted />];\n};\n\n// visible for testing\nexport const currentToDeclaredResourceToPerc = (\n current: number | string,\n resource: number | string,\n): string => {\n if (Number(resource) === 0) return `0%`;\n\n if (typeof current === 'number' && typeof resource === 'number') {\n return `${Math.round((current / resource) * 100)}%`;\n }\n\n const numerator: bigint = BigInt(\n typeof current === 'number' ? Math.round(current) : Number(current),\n );\n const denominator: bigint = BigInt(\n typeof resource === 'number' ? Math.round(resource) : Number(resource),\n );\n\n return `${(numerator * BigInt(100)) / denominator}%`;\n};\n\nexport const podStatusToCpuUtil = (podStatus: ClientPodStatus): ReactNode => {\n const cpuUtil = podStatus.cpu;\n\n return (\n <SubvalueCell\n value={`requests: ${currentToDeclaredResourceToPerc(\n cpuUtil.currentUsage,\n cpuUtil.requestTotal,\n )} of ${formatMillicores(cpuUtil.requestTotal)}`}\n subvalue={`limits: ${currentToDeclaredResourceToPerc(\n cpuUtil.currentUsage,\n cpuUtil.limitTotal,\n )} of ${formatMillicores(cpuUtil.limitTotal)}`}\n />\n );\n};\n\nexport const podStatusToMemoryUtil = (\n podStatus: ClientPodStatus,\n): ReactNode => {\n const memUtil = podStatus.memory;\n\n return (\n <SubvalueCell\n value={`requests: ${currentToDeclaredResourceToPerc(\n memUtil.currentUsage,\n memUtil.requestTotal,\n )} of ${bytesToMiB(memUtil.requestTotal)}`}\n subvalue={`limits: ${currentToDeclaredResourceToPerc(\n memUtil.currentUsage,\n memUtil.limitTotal,\n )} of ${bytesToMiB(memUtil.limitTotal)}`}\n />\n );\n};\n"],"names":["containerStatuses"],"mappings":";;;;;;AA0CO,MAAM,eAAA,GAAkB,CAAC,GAAA,KAAqB;AACnD,EAAA,MAAMA,kBAAAA,GAAoB,GAAA,CAAI,MAAA,EAAQ,iBAAA,IAAqB,EAAC;AAC5D,EAAA,MAAM,sBAAsBA,kBAAAA,CAAkB,MAAA,CAAO,CAAA,EAAA,KAAM,EAAA,CAAG,KAAK,CAAA,CAAE,MAAA;AAErE,EAAA,OAAO,CAAA,EAAG,mBAAmB,CAAA,CAAA,EAAIA,kBAAAA,CAAkB,MAAM,CAAA,CAAA;AAC3D;AAEO,MAAM,aAAA,GAAgB,CAAC,GAAA,KAAqB;AACjD,EAAA,MAAMA,kBAAAA,GAAoB,GAAA,CAAI,MAAA,EAAQ,iBAAA,IAAqB,EAAC;AAC5D,EAAA,OAAOA,kBAAAA,EAAmB,OAAO,CAAC,CAAA,EAAG,MAAM,CAAA,GAAI,CAAA,CAAE,cAAc,CAAC,CAAA;AAClE;AAEO,MAAM,iBAAA,GAAoB,CAAC,GAAA,KAAwB;AACxD,EAAA,MAAM,qBAAA,GAAwB,GAAA,CAAI,MAAA,EAAQ,iBAAA,IAAqB,EAAC;AAChE,EAAA,MAAM,MAAA,GAAS,qBAAA,CAAsB,MAAA,CAAO,CAAC,OAAO,IAAA,KAAS;AAC3D,IAAA,IAAI,IAAA,CAAK,UAAU,MAAA,EAAW;AAC5B,MAAA,OAAO,KAAA;AAAA,IACT;AAEA,IAAA,MAAM,OAAA,GAAU,KAAK,KAAA,CAAM,OAAA;AAC3B,IAAA,MAAM,UAAA,GAAa,KAAK,KAAA,CAAM,UAAA;AAE9B,IAAA,MAAM,UAAA,GAAa,CAAC,MAAA,qBAClB,IAAA,CAAC,QAAA,EAAA,EACC,QAAA,EA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B,OAAA,CAAQ,YAAA;AAAA,QACR,OAAA,CAAQ;AAAA,OACT,CAAA,IAAA,EAAO,gBAAA,CAAiB,OAAA,CAAQ,YAAY,CAAC,CAAA,CAAA;AAAA,MAC9C,UAAU,CAAA,QAAA,EAAW,+BAAA;AAAA,QACnB,OAAA,CAAQ,YAAA;AAAA,QACR,OAAA,CAAQ;AAAA,OACT,CAAA,IAAA,EAAO,gBAAA,CAAiB,OAAA,CAAQ,UAAU,CAAC,CAAA;AAAA;AAAA,GAC9C;AAEJ;AAEO,MAAM,qBAAA,GAAwB,CACnC,SAAA,KACc;AACd,EAAA,MAAM,UAAU,SAAA,CAAU,MAAA;AAE1B,EAAA,uBACE,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,OAAO,CAAA,UAAA,EAAa,+BAAA;AAAA,QAClB,OAAA,CAAQ,YAAA;AAAA,QACR,OAAA,CAAQ;AAAA,OACT,CAAA,IAAA,EAAO,UAAA,CAAW,OAAA,CAAQ,YAAY,CAAC,CAAA,CAAA;AAAA,MACxC,UAAU,CAAA,QAAA,EAAW,+BAAA;AAAA,QACnB,OAAA,CAAQ,YAAA;AAAA,QACR,OAAA,CAAQ;AAAA,OACT,CAAA,IAAA,EAAO,UAAA,CAAW,OAAA,CAAQ,UAAU,CAAC,CAAA;AAAA;AAAA,GACxC;AAEJ
|
|
1
|
+
{"version":3,"file":"pod.esm.js","sources":["../../src/utils/pod.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 type {\n V1Pod,\n V1PodCondition,\n V1DeploymentCondition,\n} from '@kubernetes/client-node';\nimport { Fragment, ReactNode } from 'react';\nimport Chip from '@material-ui/core/Chip';\nimport {\n StatusAborted,\n StatusError,\n StatusOK,\n SubvalueCell,\n} from '@backstage/core-components';\nimport { ClientPodStatus } from '@backstage/plugin-kubernetes-common';\nimport { Pod } from 'kubernetes-models/v1/Pod';\nimport { bytesToMiB, formatMillicores } from './resources';\n\nexport const imageChips = (pod: V1Pod): ReactNode => {\n const containerStatuses = pod.status?.containerStatuses ?? [];\n const images = containerStatuses.map((cs, i) => {\n return <Chip key={i} label={`${cs.name}=${cs.image}`} size=\"small\" />;\n });\n\n return <div>{images}</div>;\n};\n\nexport const containersReady = (pod: Pod): string => {\n const containerStatuses = pod.status?.containerStatuses ?? [];\n const containersReadyItem = containerStatuses.filter(cs => cs.ready).length;\n\n return `${containersReadyItem}/${containerStatuses.length}`;\n};\n\nexport const totalRestarts = (pod: Pod): number => {\n const containerStatuses = pod.status?.containerStatuses ?? [];\n return containerStatuses?.reduce((a, b) => a + b.restartCount, 0);\n};\n\nexport const containerStatuses = (pod: Pod): ReactNode => {\n const containerStatusesItem = pod.status?.containerStatuses ?? [];\n const errors = containerStatusesItem.reduce((accum, next) => {\n if (next.state === undefined) {\n return accum;\n }\n\n const waiting = next.state.waiting;\n const terminated = next.state.terminated;\n\n const renderCell = (reason: string | undefined) => (\n <Fragment key={`${pod.metadata?.name}-${next.name}`}>\n <SubvalueCell\n value={\n reason === 'Completed' ? (\n <StatusOK>Container: {next.name}</StatusOK>\n ) : (\n <StatusError>Container: {next.name}</StatusError>\n )\n }\n subvalue={reason}\n />\n <br />\n </Fragment>\n );\n\n if (waiting) {\n accum.push(renderCell(waiting.reason));\n }\n\n if (terminated) {\n accum.push(renderCell(terminated.reason));\n }\n\n return accum;\n }, [] as ReactNode[]);\n\n if (errors.length === 0) {\n return <StatusOK>OK</StatusOK>;\n }\n\n return errors;\n};\n\nexport const renderCondition = (\n condition: V1PodCondition | V1DeploymentCondition,\n): [string, ReactNode] => {\n const status = condition.status;\n\n if (status === 'True') {\n return [condition.type, <StatusOK>True</StatusOK>];\n } else if (status === 'False') {\n return [\n condition.type,\n <SubvalueCell\n value={<StatusError>False</StatusError>}\n subvalue={condition.message ?? ''}\n />,\n ];\n }\n return [condition.type, <StatusAborted />];\n};\n\n// visible for testing\nexport const currentToDeclaredResourceToPerc = (\n current: number | string,\n resource: number | string,\n): string => {\n if (Number(resource) === 0) return `0%`;\n\n if (typeof current === 'number' && typeof resource === 'number') {\n return `${Math.round((current / resource) * 100)}%`;\n }\n\n const numerator: bigint = BigInt(\n typeof current === 'number' ? Math.round(current) : Number(current),\n );\n const denominator: bigint = BigInt(\n typeof resource === 'number' ? Math.round(resource) : Number(resource),\n );\n\n return `${(numerator * BigInt(100)) / denominator}%`;\n};\n\nexport const podStatusToCpuUtil = (podStatus: ClientPodStatus): ReactNode => {\n const cpuUtil = podStatus.cpu;\n\n return (\n <SubvalueCell\n value={`requests: ${currentToDeclaredResourceToPerc(\n cpuUtil.currentUsage,\n cpuUtil.requestTotal,\n )} of ${formatMillicores(cpuUtil.requestTotal)}`}\n subvalue={`limits: ${currentToDeclaredResourceToPerc(\n cpuUtil.currentUsage,\n cpuUtil.limitTotal,\n )} of ${formatMillicores(cpuUtil.limitTotal)}`}\n />\n );\n};\n\nexport const podStatusToMemoryUtil = (\n podStatus: ClientPodStatus,\n): ReactNode => {\n const memUtil = podStatus.memory;\n\n return (\n <SubvalueCell\n value={`requests: ${currentToDeclaredResourceToPerc(\n memUtil.currentUsage,\n memUtil.requestTotal,\n )} of ${bytesToMiB(memUtil.requestTotal)}`}\n subvalue={`limits: ${currentToDeclaredResourceToPerc(\n memUtil.currentUsage,\n memUtil.limitTotal,\n )} of ${bytesToMiB(memUtil.limitTotal)}`}\n />\n );\n};\n"],"names":["containerStatuses"],"mappings":";;;;;;AA0CO,MAAM,eAAA,GAAkB,CAAC,GAAA,KAAqB;AACnD,EAAA,MAAMA,kBAAAA,GAAoB,GAAA,CA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AA,CAAiB,OAAA,CAAQ,UAAU,CAAC,CAAA;AAAA;AAAA,GAC9C;AAEJ;AAEO,MAAM,qBAAA,GAAwB,CACnC,SAAA,KACc;AACd,EAAA,MAAM,UAAU,SAAA,CAAU,MAAA;AAE1B,EAAA,uBACE,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,OAAO,CAAA,UAAA,EAAa,+BAAA;AAAA,QAClB,OAAA,CAAQ,YAAA;AAAA,QACR,OAAA,CAAQ;AAAA,OACT,CAAA,IAAA,EAAO,UAAA,CAAW,OAAA,CAAQ,YAAY,CAAC,CAAA,CAAA;AAAA,MACxC,UAAU,CAAA,QAAA,EAAW,+BAAA;AAAA,QACnB,OAAA,CAAQ,YAAA;AAAA,QACR,OAAA,CAAQ;AAAA,OACT,CAAA,IAAA,EAAO,UAAA,CAAW,OAAA,CAAQ,UAAU,CAAC,CAAA;AAAA;AAAA,GACxC;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.esm.js","sources":["../../src/utils/resources.ts"],"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 */\nexport const currentToDeclaredResourceToPerc = (\n current: number | string,\n resource: number | string,\n): number => {\n if (Number(resource) === 0) return 0;\n\n if (typeof current === 'number' && typeof resource === 'number') {\n return Math.round((current / resource) * 100);\n }\n\n const numerator: bigint = BigInt(\n typeof current === 'number' ? Math.round(current) : Number(current),\n );\n const denominator: bigint = BigInt(\n typeof resource === 'number' ? Math.round(resource) : Number(resource),\n );\n\n return Number((numerator * BigInt(100)) / denominator);\n};\n\nexport const bytesToMiB = (value: string | number): string => {\n return `${(parseFloat(value.toString()) / 1024 / 1024).toFixed(0)}MiB`;\n};\n\nexport const formatMillicores = (value: string | number): string => {\n return `${(parseFloat(value.toString()) * 1000).toFixed(0)}m`;\n};\n"],"names":[],"mappings":"AAeO,MAAM,+BAAA,GAAkC,CAC7C,OAAA,EACA,QAAA,KACW;AACX,EAAA,IAAI,MAAA,CAAO,QAAQ,CAAA,KAAM,CAAA,EAAG,OAAO,CAAA;AAEnC,EAAA,IAAI,OAAO,OAAA,KAAY,QAAA,IAAY,OAAO,aAAa,QAAA,EAAU;AAC/D,IAAA,OAAO,IAAA,CAAK,KAAA,CAAO,OAAA,GAAU,QAAA,GAAY,GAAG,CAAA;AAAA,EAC9C;AAEA,EAAA,MAAM,SAAA,GAAoB,MAAA;AAAA,IACxB,OAAO,YAAY,QAAA,GAAW,IAAA,CAAK,MAAM,OAAO,CAAA,GAAI,OAAO,OAAO;AAAA,GACpE;AACA,EAAA,MAAM,WAAA,GAAsB,MAAA;AAAA,IAC1B,OAAO,aAAa,QAAA,GAAW,IAAA,CAAK,MAAM,QAAQ,CAAA,GAAI,OAAO,QAAQ;AAAA,GACvE;AAEA,EAAA,OAAO,MAAA,CAAQ,SAAA,GAAY,MAAA,CAAO,GAAG,IAAK,WAAW,CAAA;AACvD;AAEO,MAAM,UAAA,GAAa,CAAC,KAAA,KAAmC;AAC5D,EAAA,OAAO,CAAA,EAAA,CAAI,UAAA,CAAW,KAAA,CAAM,QAAA,EAAU,IAAI,IAAA,GAAO,IAAA,EAAM,OAAA,CAAQ,CAAC,CAAC,CAAA,GAAA,CAAA;AACnE;AAEO,MAAM,gBAAA,GAAmB,CAAC,KAAA,KAAmC;AAClE,EAAA,OAAO,CAAA,EAAA,CAAI,WAAW,KAAA,CAAM,QAAA,EAAU,CAAA,GAAI,GAAA,EAAM,OAAA,CAAQ,CAAC,CAAC,CAAA,CAAA,CAAA;AAC5D
|
|
1
|
+
{"version":3,"file":"resources.esm.js","sources":["../../src/utils/resources.ts"],"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 */\nexport const currentToDeclaredResourceToPerc = (\n current: number | string,\n resource: number | string,\n): number => {\n if (Number(resource) === 0) return 0;\n\n if (typeof current === 'number' && typeof resource === 'number') {\n return Math.round((current / resource) * 100);\n }\n\n const numerator: bigint = BigInt(\n typeof current === 'number' ? Math.round(current) : Number(current),\n );\n const denominator: bigint = BigInt(\n typeof resource === 'number' ? Math.round(resource) : Number(resource),\n );\n\n return Number((numerator * BigInt(100)) / denominator);\n};\n\nexport const bytesToMiB = (value: string | number): string => {\n return `${(parseFloat(value.toString()) / 1024 / 1024).toFixed(0)}MiB`;\n};\n\nexport const formatMillicores = (value: string | number): string => {\n return `${(parseFloat(value.toString()) * 1000).toFixed(0)}m`;\n};\n"],"names":[],"mappings":"AAeO,MAAM,+BAAA,GAAkC,CAC7C,OAAA,EACA,QAAA,KACW;AACX,EAAA,IAAI,MAAA,CAAO,QAAQ,CAAA,KAAM,CAAA,EAAG,OAAO,CAAA;AAEnC,EAAA,IAAI,OAAO,OAAA,KAAY,QAAA,IAAY,OAAO,aAAa,QAAA,EAAU;AAC/D,IAAA,OAAO,IAAA,CAAK,KAAA,CAAO,OAAA,GAAU,QAAA,GAAY,GAAG,CAAA;AAAA,EAC9C;AAEA,EAAA,MAAM,SAAA,GAAoB,MAAA;AAAA,IACxB,OAAO,YAAY,QAAA,GAAW,IAAA,CAAK,MAAM,OAAO,CAAA,GAAI,OAAO,OAAO;AAAA,GACpE;AACA,EAAA,MAAM,WAAA,GAAsB,MAAA;AAAA,IAC1B,OAAO,aAAa,QAAA,GAAW,IAAA,CAAK,MAAM,QAAQ,CAAA,GAAI,OAAO,QAAQ;AAAA,GACvE;AAEA,EAAA,OAAO,MAAA,CAAQ,SAAA,GAAY,MAAA,CAAO,GAAG,IAAK,WAAW,CAAA;AACvD;AAEO,MAAM,UAAA,GAAa,CAAC,KAAA,KAAmC;AAC5D,EAAA,OAAO,CAAA,EAAA,CAAI,UAAA,CAAW,KAAA,CAAM,QAAA,EAAU,IAAI,IAAA,GAAO,IAAA,EAAM,OAAA,CAAQ,CAAC,CAAC,CAAA,GAAA,CAAA;AACnE;AAEO,MAAM,gBAAA,GAAmB,CAAC,KAAA,KAAmC;AAClE,EAAA,OAAO,CAAA,EAAA,CAAI,WAAW,KAAA,CAAM,QAAA,EAAU,CAAA,GAAI,GAAA,EAAM,OAAA,CAAQ,CAAC,CAAC,CAAA,CAAA,CAAA;AAC5D;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-kubernetes-react",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20260920023043",
|
|
4
4
|
"description": "Web library for the kubernetes-react plugin",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
"test": "backstage-cli package test"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@backstage/catalog-model": "
|
|
66
|
-
"@backstage/core-components": "0.0.0-nightly-
|
|
67
|
-
"@backstage/core-plugin-api": "0.0.0-nightly-
|
|
68
|
-
"@backstage/errors": "
|
|
69
|
-
"@backstage/plugin-kubernetes-common": "0.0.0-nightly-
|
|
65
|
+
"@backstage/catalog-model": "0.0.0-nightly-20260920023043",
|
|
66
|
+
"@backstage/core-components": "0.0.0-nightly-20260920023043",
|
|
67
|
+
"@backstage/core-plugin-api": "0.0.0-nightly-20260920023043",
|
|
68
|
+
"@backstage/errors": "0.0.0-nightly-20260920023043",
|
|
69
|
+
"@backstage/plugin-kubernetes-common": "0.0.0-nightly-20260920023043",
|
|
70
70
|
"@backstage/types": "1.2.2",
|
|
71
71
|
"@kubernetes-models/apimachinery": "^2.0.0",
|
|
72
72
|
"@kubernetes-models/base": "^5.0.0",
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
"react-use": "^17.4.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@backstage/cli": "0.0.0-nightly-
|
|
89
|
-
"@backstage/core-app-api": "0.0.0-nightly-
|
|
90
|
-
"@backstage/test-utils": "0.0.0-nightly-
|
|
88
|
+
"@backstage/cli": "0.0.0-nightly-20260920023043",
|
|
89
|
+
"@backstage/core-app-api": "0.0.0-nightly-20260920023043",
|
|
90
|
+
"@backstage/test-utils": "0.0.0-nightly-20260920023043",
|
|
91
91
|
"@testing-library/dom": "^10.0.0",
|
|
92
92
|
"@testing-library/jest-dom": "^6.0.0",
|
|
93
93
|
"@testing-library/react": "^16.0.0",
|