feat: get nodeList from k8s
This commit is contained in:
@@ -523,6 +523,17 @@ class K8sClient {
|
|||||||
throw new K8sResponseException("K8s undetermined status conditions for pod $podName", resp)
|
throw new K8sResponseException("K8s undetermined status conditions for pod $podName", resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of all nodes in the cluster
|
||||||
|
* @return Response object.
|
||||||
|
*/
|
||||||
|
K8sResponseJson nodeList() {
|
||||||
|
final action = "/api/v1/nodes"
|
||||||
|
final resp = get(action)
|
||||||
|
trace('GET', action, resp.text)
|
||||||
|
new K8sResponseJson(resp.text)
|
||||||
|
}
|
||||||
|
|
||||||
protected void checkInvalidWaitingState( Map waiting, K8sResponseJson resp ) {
|
protected void checkInvalidWaitingState( Map waiting, K8sResponseJson resp ) {
|
||||||
if( waiting.reason == 'ErrImagePull' || waiting.reason == 'ImagePullBackOff') {
|
if( waiting.reason == 'ErrImagePull' || waiting.reason == 'ImagePullBackOff') {
|
||||||
def message = "K8s pod image cannot be pulled"
|
def message = "K8s pod image cannot be pulled"
|
||||||
|
|||||||
Reference in New Issue
Block a user