You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have just came across a case, and would like to understand the concept behind this as it seems odd to me.
The case I had was doing a status check for pods to see if there running or not. Now when the pod is not running and status check is done, an exception is thrown at KubernetesClientImpl.scala:648. Which means a failed future.
This is in particular to me is odd, because the call it self was successful (check if a pod has a status), but instead of returning an exception the status of the pod should be None with UNKNOWN.
To deal with the exception I did this:
for { status <- pod.status phase <- status.phase } yield phase } recover { case err: K8SException if err.status.code.map(_ == 404).getOrElse(false) => None }
None, in my case will be translated into UNKNOWN by the caller.
To clarify my question would it not be better to return an UNKNOWN status for a pod that is not found when doing a status check?
The text was updated successfully, but these errors were encountered:
I have just came across a case, and would like to understand the concept behind this as it seems odd to me.
The case I had was doing a status check for pods to see if there running or not. Now when the pod is not running and status check is done, an exception is thrown at KubernetesClientImpl.scala:648. Which means a failed future.
This is in particular to me is odd, because the call it self was successful (check if a pod has a status), but instead of returning an exception the status of the pod should be None with UNKNOWN.
To deal with the exception I did this:
for { status <- pod.status phase <- status.phase } yield phase } recover { case err: K8SException if err.status.code.map(_ == 404).getOrElse(false) => None }
None, in my case will be translated into UNKNOWN by the caller.
To clarify my question would it not be better to return an UNKNOWN status for a pod that is not found when doing a status check?
The text was updated successfully, but these errors were encountered: