Merge branch 'master' into rugvip/moreports

This commit is contained in:
Patrik Oldsberg
2021-02-04 19:43:32 +01:00
committed by GitHub
305 changed files with 4106 additions and 1758 deletions
+20
View File
@@ -1,5 +1,25 @@
# @backstage/plugin-kubernetes
## 0.3.8
### Patch Changes
- Updated dependencies [12ece98cd]
- Updated dependencies [d82246867]
- Updated dependencies [c810082ae]
- Updated dependencies [5fa3bdb55]
- Updated dependencies [6e612ce25]
- Updated dependencies [025e122c3]
- Updated dependencies [21e624ba9]
- Updated dependencies [da9f53c60]
- Updated dependencies [32c95605f]
- Updated dependencies [7881f2117]
- Updated dependencies [54c7d02f7]
- Updated dependencies [11cb5ef94]
- @backstage/core@0.6.0
- @backstage/theme@0.2.3
- @backstage/catalog-model@0.7.1
## 0.3.7
### Patch Changes
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-kubernetes",
"version": "0.3.7",
"version": "0.3.8",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,12 +31,12 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/catalog-model": "^0.7.0",
"@backstage/plugin-catalog-react": "^0.0.1",
"@backstage/catalog-model": "^0.7.1",
"@backstage/plugin-catalog-react": "^0.0.2",
"@backstage/config": "^0.1.2",
"@backstage/core": "^0.5.0",
"@backstage/core": "^0.6.0",
"@backstage/plugin-kubernetes-backend": "^0.2.6",
"@backstage/theme": "^0.2.2",
"@backstage/theme": "^0.2.3",
"@kubernetes/client-node": "^0.13.2",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
@@ -48,8 +48,8 @@
"react-use": "^15.3.3"
},
"devDependencies": {
"@backstage/cli": "^0.5.0",
"@backstage/dev-utils": "^0.1.8",
"@backstage/cli": "^0.6.0",
"@backstage/dev-utils": "^0.1.9",
"@backstage/test-utils": "^0.1.6",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^10.4.1",
@@ -32,8 +32,8 @@ export const DeploymentDrawer = ({
object={deployment}
expanded={expanded}
kind="Deployment"
renderObject={(deployment: V1Deployment) => {
const conditions = (deployment.status?.conditions ?? [])
renderObject={(deploymentObj: V1Deployment) => {
const conditions = (deploymentObj.status?.conditions ?? [])
.map(renderCondition)
.reduce((accum, next) => {
accum[next[0]] = next[1];
@@ -41,10 +41,10 @@ export const DeploymentDrawer = ({
}, {} as { [key: string]: React.ReactNode });
return {
strategy: deployment.spec?.strategy ?? '???',
minReadySeconds: deployment.spec?.minReadySeconds ?? '???',
strategy: deploymentObj.spec?.strategy ?? '???',
minReadySeconds: deploymentObj.spec?.minReadySeconds ?? '???',
progressDeadlineSeconds:
deployment.spec?.progressDeadlineSeconds ?? '???',
deploymentObj.spec?.progressDeadlineSeconds ?? '???',
...conditions,
};
}}
@@ -32,16 +32,16 @@ export const HorizontalPodAutoscalerDrawer = ({
kind="HorizontalPodAutoscaler"
object={hpa}
expanded={expanded}
renderObject={(hpa: V1HorizontalPodAutoscaler) => {
renderObject={(hpaObject: V1HorizontalPodAutoscaler) => {
return {
targetCPUUtilizationPercentage:
hpa.spec?.targetCPUUtilizationPercentage,
hpaObject.spec?.targetCPUUtilizationPercentage,
currentCPUUtilizationPercentage:
hpa.status?.currentCPUUtilizationPercentage,
minReplicas: hpa.spec?.minReplicas,
maxReplicas: hpa.spec?.maxReplicas,
currentReplicas: hpa.status?.currentReplicas,
desiredReplicas: hpa.status?.desiredReplicas,
hpaObject.status?.currentCPUUtilizationPercentage,
minReplicas: hpaObject.spec?.minReplicas,
maxReplicas: hpaObject.spec?.maxReplicas,
currentReplicas: hpaObject.status?.currentReplicas,
desiredReplicas: hpaObject.status?.desiredReplicas,
};
}}
>
@@ -31,8 +31,8 @@ export const IngressDrawer = ({
object={ingress}
expanded={expanded}
kind="Ingress"
renderObject={(ingress: ExtensionsV1beta1Ingress) => {
return ingress.spec || {};
renderObject={(ingressObject: ExtensionsV1beta1Ingress) => {
return ingressObject.spec || {};
}}
>
<Grid
+8 -8
View File
@@ -37,17 +37,17 @@ export const PodDrawer = ({
object={pod}
expanded={expanded}
kind="Pod"
renderObject={(pod: V1Pod) => {
const phase = pod.status?.phase ?? 'unknown';
renderObject={(podObject: V1Pod) => {
const phase = podObject.status?.phase ?? 'unknown';
const ports =
pod.spec?.containers?.map(c => {
podObject.spec?.containers?.map(c => {
return {
[c.name]: c.ports,
};
}) ?? 'N/A';
const conditions = (pod.status?.conditions ?? [])
const conditions = (podObject.status?.conditions ?? [])
.map(renderCondition)
.reduce((accum, next) => {
accum[next[0]] = next[1];
@@ -55,11 +55,11 @@ export const PodDrawer = ({
}, {} as { [key: string]: React.ReactNode });
return {
images: imageChips(pod),
images: imageChips(podObject),
phase: phase,
'Containers Ready': containersReady(pod),
'Total Restarts': totalRestarts(pod),
'Container Statuses': containerStatuses(pod),
'Containers Ready': containersReady(podObject),
'Total Restarts': totalRestarts(podObject),
'Container Statuses': containerStatuses(podObject),
...conditions,
'Exposed ports': ports,
};
@@ -31,8 +31,8 @@ export const ServiceDrawer = ({
object={service}
expanded={expanded}
kind="Service"
renderObject={(service: V1Service) => {
return service.spec || {};
renderObject={(serviceObject: V1Service) => {
return serviceObject.spec || {};
}}
>
<Grid
+4 -4
View File
@@ -36,9 +36,9 @@ export const imageChips = (pod: V1Pod): ReactNode => {
export const containersReady = (pod: V1Pod): string => {
const containerStatuses = pod.status?.containerStatuses ?? [];
const containersReady = containerStatuses.filter(cs => cs.ready).length;
const containersReadyItem = containerStatuses.filter(cs => cs.ready).length;
return `${containersReady}/${containerStatuses.length}`;
return `${containersReadyItem}/${containerStatuses.length}`;
};
export const totalRestarts = (pod: V1Pod): number => {
@@ -47,8 +47,8 @@ export const totalRestarts = (pod: V1Pod): number => {
};
export const containerStatuses = (pod: V1Pod): ReactNode => {
const containerStatuses = pod.status?.containerStatuses ?? [];
const errors = containerStatuses.reduce((accum, next) => {
const containerStatusesItem = pod.status?.containerStatuses ?? [];
const errors = containerStatusesItem.reduce((accum, next) => {
if (next.state === undefined) {
return accum;
}