@backstage/plugin-kubernetes-react 0.5.12-next.2 → 0.5.13-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/api/formatters/GkeClusterLinksFormatter.esm.js +1 -0
- package/dist/api/formatters/GkeClusterLinksFormatter.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/AksKubernetesAuthProvider.esm.js +1 -0
- package/dist/kubernetes-auth-provider/AksKubernetesAuthProvider.esm.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @backstage/plugin-kubernetes-react
|
|
2
2
|
|
|
3
|
+
## 0.5.13-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 05f60e1: Refactored constructor parameter properties to explicit property declarations for compatibility with TypeScript's `erasableSyntaxOnly` setting. This internal refactoring maintains all existing functionality while ensuring TypeScript compilation compatibility.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/core-plugin-api@1.11.2-next.0
|
|
10
|
+
- @backstage/core-components@0.18.3-next.0
|
|
11
|
+
- @backstage/catalog-model@1.7.6-next.0
|
|
12
|
+
- @backstage/errors@1.2.7
|
|
13
|
+
- @backstage/types@1.2.2
|
|
14
|
+
- @backstage/plugin-kubernetes-common@0.9.8-next.0
|
|
15
|
+
|
|
16
|
+
## 0.5.12
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- ac405f2: The configmaps added to be rendered
|
|
21
|
+
- f7a4144: Fixes calculation of CPU utilization in the PodTable
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @backstage/core-components@0.18.2
|
|
24
|
+
- @backstage/plugin-kubernetes-common@0.9.7
|
|
25
|
+
- @backstage/core-plugin-api@1.11.1
|
|
26
|
+
|
|
3
27
|
## 0.5.12-next.2
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GkeClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/GkeClusterLinksFormatter.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 */\nimport {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\nimport { ProfileInfoApi } from '@backstage/core-plugin-api';\n\nconst kindMappings: Record<string, string> = {\n deployment: 'deployment',\n pod: 'pod',\n ingress: 'ingress',\n service: 'service',\n horizontalpodautoscaler: 'deployment',\n};\n\n/** @public */\nexport class GkeClusterLinksFormatter implements ClusterLinksFormatter {\n
|
|
1
|
+
{"version":3,"file":"GkeClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/GkeClusterLinksFormatter.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 */\nimport {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\nimport { ProfileInfoApi } from '@backstage/core-plugin-api';\n\nconst kindMappings: Record<string, string> = {\n deployment: 'deployment',\n pod: 'pod',\n ingress: 'ingress',\n service: 'service',\n horizontalpodautoscaler: 'deployment',\n};\n\n/** @public */\nexport class GkeClusterLinksFormatter implements ClusterLinksFormatter {\n private readonly googleAuthApi: ProfileInfoApi | undefined;\n\n constructor(googleAuthApi: ProfileInfoApi | undefined) {\n this.googleAuthApi = googleAuthApi;\n }\n async formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL> {\n if (!options.dashboardParameters) {\n throw new Error('GKE dashboard requires a dashboardParameters option');\n }\n const args = options.dashboardParameters;\n if (typeof args.projectId !== 'string') {\n throw new Error(\n 'GKE dashboard requires a \"projectId\" of type string in the dashboardParameters option',\n );\n }\n if (typeof args.region !== 'string') {\n throw new Error(\n 'GKE dashboard requires a \"region\" of type string in the dashboardParameters option',\n );\n }\n if (typeof args.clusterName !== 'string') {\n throw new Error(\n 'GKE dashboard requires a \"clusterName\" of type string in the dashboardParameters option',\n );\n }\n const basePath = new URL('https://console.cloud.google.com/');\n const region = encodeURIComponent(args.region);\n const clusterName = encodeURIComponent(args.clusterName);\n const name = encodeURIComponent(options.object.metadata?.name ?? '');\n const namespace = encodeURIComponent(\n options.object.metadata?.namespace ?? '',\n );\n const validKind = kindMappings[options.kind.toLocaleLowerCase('en-US')];\n let path: string;\n if (namespace && name && validKind) {\n const kindsWithDetails = ['ingress', 'pod'];\n const landingPage = kindsWithDetails.includes(validKind)\n ? 'details'\n : 'overview';\n path = `kubernetes/${validKind}/${region}/${clusterName}/${namespace}/${name}/${landingPage}`;\n } else {\n path = `kubernetes/clusters/details/${region}/${clusterName}/details`;\n }\n const result = new URL(path, basePath);\n result.searchParams.set('project', args.projectId);\n if (this.googleAuthApi) {\n const profile = await this.googleAuthApi.getProfile({ optional: true });\n if (profile?.email) {\n result.searchParams.set('authuser', profile.email);\n }\n }\n return result;\n }\n}\n"],"names":[],"mappings":"AAqBA,MAAM,YAAA,GAAuC;AAAA,EAC3C,UAAA,EAAY,YAAA;AAAA,EACZ,GAAA,EAAK,KAAA;AAAA,EACL,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS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tE,IAAA,IAAI,IAAA;AACJ,IAAA,IAAI,SAAA,IAAa,QAAQ,SAAA,EAAW;AAClC,MAAA,MAAM,gBAAA,GAAmB,CAAC,SAAA,EAAW,KAAK,CAAA;AAC1C,MAAA,MAAM,WAAA,GAAc,gBAAA,CAAiB,QAAA,CAAS,SAAS,IACnD,SAAA,GACA,UAAA;AACJ,MAAA,IAAA,GAAO,CAAA,WAAA,EAAc,SAAS,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,EAAI,WAAW,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,EAAI,WAAW,CAAA,CAAA;AAAA,IAC7F,CAAA,MAAO;AACL,MAAA,IAAA,GAAO,CAAA,4BAAA,EAA+B,MAAM,CAAA,CAAA,EAAI,WAAW,CAAA,QAAA,CAAA;AAAA,IAC7D;AACA,IAAA,MAAM,MAAA,GAAS,IAAI,GAAA,CAAI,IAAA,EAAM,QAAQ,CAAA;AACrC,IAAA,MAAA,CAAO,YAAA,CAAa,GAAA,CAAI,SAAA,EAAW,IAAA,CAAK,SAAS,CAAA;AACjD,IAAA,IAAI,KAAK,aAAA,EAAe;AACtB,MAAA,MAAM,OAAA,GAAU,MAAM,IAAA,CAAK,aAAA,CAAc,WAAW,EAAE,QAAA,EAAU,MAAM,CAAA;AACtE,MAAA,IAAI,SAAS,KAAA,EAAO;AAClB,QAAA,MAAA,CAAO,YAAA,CAAa,GAAA,CAAI,UAAA,EAAY,OAAA,CAAQ,KAAK,CAAA;AAAA,MACnD;AAAA,IACF;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
|
|
@@ -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
|
|
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;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-kubernetes-react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13-next.0",
|
|
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": "1.7.
|
|
66
|
-
"@backstage/core-components": "0.18.
|
|
67
|
-
"@backstage/core-plugin-api": "1.11.
|
|
65
|
+
"@backstage/catalog-model": "1.7.6-next.0",
|
|
66
|
+
"@backstage/core-components": "0.18.3-next.0",
|
|
67
|
+
"@backstage/core-plugin-api": "1.11.2-next.0",
|
|
68
68
|
"@backstage/errors": "1.2.7",
|
|
69
|
-
"@backstage/plugin-kubernetes-common": "0.9.
|
|
69
|
+
"@backstage/plugin-kubernetes-common": "0.9.8-next.0",
|
|
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.34.
|
|
89
|
-
"@backstage/core-app-api": "1.19.
|
|
90
|
-
"@backstage/test-utils": "1.7.
|
|
88
|
+
"@backstage/cli": "0.34.5-next.0",
|
|
89
|
+
"@backstage/core-app-api": "1.19.2-next.0",
|
|
90
|
+
"@backstage/test-utils": "1.7.13-next.0",
|
|
91
91
|
"@testing-library/jest-dom": "^6.0.0",
|
|
92
92
|
"@testing-library/react": "^16.0.0",
|
|
93
93
|
"@types/react": "^18.0.0",
|