Skip to content

Commit

Permalink
Fix k8s client status cond is possible null in podState (#5264) [ci f…
Browse files Browse the repository at this point in the history
…ast]

Signed-off-by: GlobefishNG <yongcong.ma@neuralgalaxy.com>
Co-authored-by: GlobefishNG <yongcong.ma@neuralgalaxy.com>
  • Loading branch information
2 people authored and pditommaso committed Sep 4, 2024
1 parent 4fd6613 commit 4b75b75
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ class K8sClient {
if( status.conditions instanceof List ) {
final allConditions = status.conditions as List<Map>
final cond = allConditions.find { cond -> cond.type == 'PodScheduled' }
if( cond.reason == 'Unschedulable' ) {
if( cond?.reason == 'Unschedulable' ) {
def message = "K8s pod cannot be scheduled"
if( cond.message ) message += " -- $cond.message"
//def cause = new K8sResponseException(resp)
Expand Down

0 comments on commit 4b75b75

Please sign in to comment.