This is an automated email from the ASF dual-hosted git repository.

wilfreds pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-k8shim.git


The following commit(s) were added to refs/heads/master by this push:
     new 2ce84319 [YUNIKORN-2835] Refactor switch statement in 
UpdateApplication (#901)
2ce84319 is described below

commit 2ce84319027bea6a246c61da068dec866e9e6d70
Author: Tzu-Hua Lan <blue.tzu...@gmail.com>
AuthorDate: Tue Aug 27 13:41:45 2024 +1000

    [YUNIKORN-2835] Refactor switch statement in UpdateApplication (#901)
    
    Closes: #901
    
    Signed-off-by: Wilfred Spiegelenburg <wilfr...@apache.org>
---
 pkg/cache/scheduler_callback.go | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/pkg/cache/scheduler_callback.go b/pkg/cache/scheduler_callback.go
index 0c43b34d..d058be39 100644
--- a/pkg/cache/scheduler_callback.go
+++ b/pkg/cache/scheduler_callback.go
@@ -146,11 +146,9 @@ func (callback *AsyncRMCallback) 
UpdateApplication(response *si.ApplicationRespo
                                ev := 
NewResumingApplicationEvent(updated.ApplicationID)
                                dispatcher.Dispatch(ev)
                        }
-               default:
-                       if updated.State == ApplicationStates().Failing || 
updated.State == ApplicationStates().Failed {
-                               ev := 
NewFailApplicationEvent(updated.ApplicationID, updated.Message)
-                               dispatcher.Dispatch(ev)
-                       }
+               case ApplicationStates().Failing, ApplicationStates().Failed:
+                       ev := NewFailApplicationEvent(updated.ApplicationID, 
updated.Message)
+                       dispatcher.Dispatch(ev)
                }
        }
        return nil


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: issues-h...@yunikorn.apache.org

Reply via email to