-
Notifications
You must be signed in to change notification settings - Fork 39k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make pod status to Running if some are Running and some are Completed #62642
Make pod status to Running if some are Running and some are Completed #62642
Conversation
/assign @smarterclayton |
@ceshiha, it seems I can not ping this kind of pod (which some containers are Running and some are Completed) from another pod through service. Can this printer fix also fix that issue? |
No, it is different. I think it is another issue. |
/ok-to-test |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better add a test for this change.
/retest |
/test pull-kubernetes-e2e-kops-aws |
1 similar comment
/test pull-kubernetes-e2e-kops-aws |
readyContainers++ | ||
} | ||
} | ||
if reason == string(api.PodRunning) && hasCompleted && !hasRunning { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the pod's status is Completed
?
This line would make it so that Completed pods would appear with a Succeeded
status, rather than Completed
.
Why not simplify to this (or something similar)?
...
if !initializing {
restarts = 0
hasRunning := false
for i := ... {
...
// last "else if" in loop
} else if container.Ready && container.State.Running != nil {
hasRunning = true
readyContainers++
}
}
// revert status back to "Running" if there is at least onr
// container still reporting the "Running" status
if reason == "Completed" && hasRunning {
reason = "Running"
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
Sounds great.
Change the pod status codes according to your comment.
@soltysh fyi |
/test pull-kubernetes-e2e-gce |
We probably want a release note, since this is a behavior change to fix a bug. |
lgtm pending a release note |
Add a meaningful release note. |
/retest |
@ceshihao Would you please squash your commits. No need to have 4 commits on 2 files. |
… reporting as "Running" status
@dixudx |
/lgtm |
ping @kubernetes/sig-cli-maintainers for approval. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ceshihao, dixudx, smarterclayton The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Automatic merge from submit-queue (batch tested with PRs 62642, 62855, 62487, 62858, 62873). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
Make pod status to Running if some are Running and some are Completed
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #62588
Special notes for your reviewer:
Only Set Pod status to Completed when no other reason, no Running container and only Completed containers.
Set status to Running if some are Running and some are Completed
Release note: