-
Notifications
You must be signed in to change notification settings - Fork 159
Make --condition=Ready=false match running jobs
#337
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
base: master
Are you sure you want to change the base?
Conversation
|
I will check the PR this weekend. |
I don't understand your problem correctly. Please tell me the steps I can take to reproduce your problem. Does this mean that the log is not output with the following command? The This change in PR will break existing behavior, so it is difficult to accept it as it is. |
|
@superbrothers, thanks a lot for looking into it!
Yeah, that's right. Logs for jobs are never shown when using
I'm not sure what's happening here. Is this with current stern or with this PR? If it's with current stern, this is probably a bug.
Well, the But if not it's not tolerable, I will understand. In that case, would you have any suggestion on how to present this feature? I could only think of something like |
|
When Please be more specific about the use cases you would like to achieve so that we can better consider changes. I would prefer to be able to perform the steps you present on my local cluster. |
|
@superbrothers, consider the following job: apiVersion: batch/v1
kind: Job
metadata:
name: test-job
spec:
completions: 1
backoffLimit: 999
template:
metadata:
labels:
app: test-job
spec:
terminationGracePeriodSeconds: 1
restartPolicy: OnFailure
containers:
- name: test
image: bash
command:
- bash
- -c
- |
count=0
while true; do
echo "World Hello: $count"
count=$((count+1))
if [[ $count -eq 10 ]]; then
exit 1
fi
sleep 1
doneAnd consider the following command: stern . --condition=ready=false --tail=0Stern would never capture logs for this pod: Code_MD4jcK7wzU.mp4 |
|
I want to use Stern in a CI pipeline to display logs during a deployment for the pods that aren't yet ready. Because of this issue, Stern will never display logs for jobs. |
This PR adds a special handling for
--condition=Ready=falsefor jobs.Jobs otherwise reports as
Ready=trueas soon as they are started, meaning no jobs would ever be part of the--condition=Ready=falselist, which makes it very difficult to track progress of normal pods alongside jobs using stern.This PR changes the code to consider jobs not to be ready until they are completed. Thus, if the job is running, it is not ready. Which I think makes total sense.
What do you think?