Skip to content

Commit

Permalink
fix: spark application check fails on missing section (argoproj#6036)
Browse files Browse the repository at this point in the history
* fix: spark application check fails on missing section

Signed-off-by: Petr Drastil <[email protected]>
  • Loading branch information
pdrastil authored Apr 15, 2021
1 parent 62a6c7a commit 887242c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ if obj.status ~= nil then
health_status.message = "SparkApplication was added, enqueuing it for submission"
return health_k9sstatus
end
count=0
executor_instances = obj.spec.executor.instances
for i, executorState in pairs(obj.status.executorState) do
if executorState == "RUNNING" then
count=count+1
if obj.status.applicationState.state == "RUNNING" then
if obj.status.executorState ~= nil then
count=0
executor_instances = obj.spec.executor.instances
for i, executorState in pairs(obj.status.executorState) do
if executorState == "RUNNING" then
count=count+1
end
end
if executor_instances == count then
health_status.status = "Healthy"
health_status.message = "SparkApplication is Running"
return health_status
end
end
if executor_instances == count then
if obj.status.applicationState.state == "RUNNING" then
health_status.status = "Healthy"
health_status.message = "SparkApplication is in RunningState"
return health_status
end
end
if obj.status.applicationState.state == "SUBMITTED" then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ tests:
inputPath: testdata/degraded.yaml
- healthStatus:
status: Healthy
message: "SparkApplication is in RunningState"
message: "SparkApplication is Running"
inputPath: testdata/healthy.yaml

0 comments on commit 887242c

Please sign in to comment.