Kubectl, oc and the web console all implement an almost identical logic to determine if a pod is considered "running".
I have an implementation that I'd be willing to contribute to the kubernetes-client so that 3rd party users of the client could reuse it instead replicating the logic.
The most appropriate location for it seems the package io.fabric8.kubernetes.client.utils. There's a similar utility at io.fabric8.kubernetes.client.internal.readiness.Readiness but it's in an internal package that's obviously not intended for external consumption.
Thoughts?
@adietish: Sorry for the late response. You're welcome to submit a pull request for this change.
I have an implementation that I'd be willing to contribute to the kubernetes-client so that 3rd party users of the client could reuse it instead replicating the logic.
This is giving 404, so I could not get full idea of your suggestion.
In Eclipse JKube we're doing like this: https://github.com/eclipse/jkube/blob/master/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/util/KubernetesHelper.java#L341
I think it would be a good idea to expand our current KubernetesResourceUtil and add more helpful functions.
@rohanKanojia is this something you'd be willing to include in the client? I can provide a PR
I have an implementation that I'd be willing to contribute to the kubernetes-client so that 3rd party users of the client could reuse it instead replicating the logic.
This is giving 404, so I could not get full idea of your suggestion.
Oh, my bad, my topic branch was merged in the meantime. It's now in master: https://github.com/redhat-developer/intellij-kubernetes/blob/master/src/main/kotlin/org/jboss/tools/intellij/kubernetes/model/util/PodStatus.kt
In Eclipse JKube we're doing like this: https://github.com/eclipse/jkube/blob/master/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/util/KubernetesHelper.java#L341
Afaics the impl in JKube is not equivalent to what kubectl/oc and the web console are doing. It's solely based on the pod phase. But then maybe the purpose is different. Those 2 implementations look at much more things: pod state, container states, ready conditions (like mine is doing) etc.
I think it would be a good idea to expand our current KubernetesResourceUtil and add more helpful functions.
I'd rather have this code in its own class so that KubernetesHelper wont grow even more (it's already >900 lines long). What I'd rather think is a good idea is to add a factory method in KubernetesHelper.
Need to check how does this compare to isReady.
@manusa if isReady is what Readyness.isPodReady is providing, then this is only a part of it. I actually use it among other checks: https://github.com/redhat-developer/intellij-kubernetes/blob/master/src/main/kotlin/org/jboss/tools/intellij/kubernetes/model/util/PodStatus.kt#L41
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!
@adietish : polite ping, Are you still working on this issue?
@rohanKanojia sorry for the late reply. Yes I'll contribute the current code that I am using in intellij-kubernetes with success. I need the time to release our plugin and eventually have the time to have this issue progressing. :)
@adietish : Thanks a lot for your reply. We were discussing this in our previous issue triage session and were wondering if you wanted to contribute. No need to rush, please take your time with IntelliJ release :-)
Most helpful comment
@adietish : Thanks a lot for your reply. We were discussing this in our previous issue triage session and were wondering if you wanted to contribute. No need to rush, please take your time with IntelliJ release :-)