OpenShift#getAnyPod raises IllegalArgumentException when no pod is found.
This is caused by the size of the results (0) being used to call Random#nextInt. nextInt will raise IllegalArgumentException when called with non-positive number.
This behaviour is not documented in the javadoc for getAnyPod nor apparent from the source code.
However, the user of #getAnyPod did not provide any illegal arguments, and the exception is not helpful.
I propose raising a labeld RuntimeException instead.
OpenShift#getAnyPodraisesIllegalArgumentExceptionwhen no pod is found.This is caused by the size of the results (0) being used to call
Random#nextInt.nextIntwill raise IllegalArgumentException when called with non-positive number.This behaviour is not documented in the javadoc for
getAnyPodnor apparent from the source code.However, the user of
#getAnyPoddid not provide any illegal arguments, and the exception is not helpful.I propose raising a labeld RuntimeException instead.