Skip to content

Commit

Permalink
Merge pull request #14313 from cyril-ui-developer/incorrect-pod-statu…
Browse files Browse the repository at this point in the history
…s-listpage

OCPBUGS-38543: OCP web console show pod status as Init:0/1 after using Native sidecars
  • Loading branch information
openshift-merge-bot[bot] authored Dec 6, 2024
2 parents 74d43c1 + 90bfbe1 commit 8ffe062
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/public/module/k8s/pods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,16 @@ export const podPhase = (pod: PodKind): PodPhase => {

_.each(pod.status.initContainerStatuses, (container: ContainerStatus, i: number) => {
const { terminated, waiting } = container.state;
const initContainerSpec = pod.spec.initContainers.find((c) => c.name === container.name);

if (terminated && terminated.exitCode === 0) {
return true;
}

if (initContainerSpec?.restartPolicy === 'Always' && container.started) {
return true;
}

initializing = true;
if (terminated && terminated.reason) {
phase = `Init:${terminated.reason}`;
Expand Down
1 change: 1 addition & 0 deletions frontend/public/module/k8s/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export type ContainerStatus = {
image: string;
imageID: string;
containerID?: string;
started?: boolean;
};

export type PodCondition = {
Expand Down

0 comments on commit 8ffe062

Please sign in to comment.