Liveness probe added in ContainerCard component (#25958)
* Liveness probe added in ContainerCard component Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * liveness probe shows only if available Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> * changed return object from variable Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com> --------- Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-kubernetes-react': patch
|
||||
---
|
||||
|
||||
`Liveness Probe` added in ContainerCard Component of PodDrawer
|
||||
+1
@@ -40,6 +40,7 @@ describe('ContainerCard', () => {
|
||||
},
|
||||
containerSpec: {
|
||||
readinessProbe: {},
|
||||
livenessProbe: {},
|
||||
},
|
||||
containerStatus: {
|
||||
name: 'some-name',
|
||||
|
||||
+16
-11
@@ -35,20 +35,25 @@ const getContainerHealthChecks = (
|
||||
containerSpec: IContainer,
|
||||
containerStatus: IContainerStatus,
|
||||
): { [key: string]: boolean } => {
|
||||
if (containerStatus.state?.terminated?.reason === 'Completed') {
|
||||
return {
|
||||
'not waiting to start': containerStatus.state?.waiting === undefined,
|
||||
'no restarts': containerStatus.restartCount === 0,
|
||||
};
|
||||
}
|
||||
return {
|
||||
const healthCheck = {
|
||||
'not waiting to start': containerStatus.state?.waiting === undefined,
|
||||
started: !!containerStatus.started,
|
||||
ready: containerStatus.ready,
|
||||
'no restarts': containerStatus.restartCount === 0,
|
||||
'readiness probe set':
|
||||
containerSpec && containerSpec?.readinessProbe !== undefined,
|
||||
};
|
||||
if (containerStatus.state?.terminated?.reason === 'Completed') {
|
||||
return healthCheck;
|
||||
}
|
||||
Object.assign(
|
||||
healthCheck,
|
||||
{ started: !!containerStatus.started },
|
||||
{ ready: containerStatus.ready },
|
||||
{ 'readiness probe set': containerSpec?.readinessProbe !== undefined },
|
||||
);
|
||||
if (containerSpec && containerSpec?.livenessProbe !== undefined) {
|
||||
Object.assign(healthCheck, {
|
||||
'liveness probe set': containerSpec.livenessProbe,
|
||||
});
|
||||
}
|
||||
return healthCheck;
|
||||
};
|
||||
|
||||
const getCurrentState = (containerStatus: IContainerStatus): string => {
|
||||
|
||||
Reference in New Issue
Block a user