Skip to content

Commit

Permalink
Merge pull request #14598 from openshift-cherrypick-robot/cherry-pick…
Browse files Browse the repository at this point in the history
…-14313-to-release-4.18

[release-4.18] OCPBUGS-45843: OCP web console show pod status as Init:0/1 after using Native sidecars
  • Loading branch information
openshift-merge-bot[bot] authored Dec 12, 2024
2 parents d9d7bd6 + 1c8168e commit 54018fd
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 54018fd

Please sign in to comment.