feat: get nodeList from k8s

This commit is contained in:
2026-04-30 11:49:40 +02:00
parent 272e924792
commit 1683894cf0

View File

@@ -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"