I don't believe the client currently supports getting logs for a jobs. It seems that JobOperationsImpl should have the method getLog().
Yep, nice catch. It makes sense to get logs for jobs as we already have support for getting pod logs.
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!
Any update on when getLog will be added for Jobs?
will try to add this feature in next release
Thanks for addressing this!!!
@SunithaR : Hi, I've released v4.6.3. It would be awesome if you could try out this newly added feature and provide some feedback whenever you get time.
@rohanKanojia I'm just starting integrating the new feature - will report back asap.
@roastario : cool, Thanks
@rohanKanojia - I am using watchLog with provided output stream for k8s jobs and I see that the stream is not populated with job logs since the pod is not ready (I see error message saying container is waiting to start in the file output stream) . If I fetch the associated pod for the job and wait for it to be ready before adding log watch then it works fine. I think the code in JobOperationsImpl which gets the associated pods for k8s job should wait for pod readiness instead of the consumer. What do you think?
I think you're right. We're not waiting inside the log method for Job's pods to get ready. We need to modify current JobOperationsImpl in order to accommodate this:
https://github.com/fabric8io/kubernetes-client/blob/8e0682230ff5b80df17f394ef36ea718745ae682/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/batch/v1/JobOperationsImpl.java#L174-L184
Right, I will create an issue and I can also work on fixing this. Thanks.
Most helpful comment
Right, I will create an issue and I can also work on fixing this. Thanks.