wilfred-s commented on code in PR #628:
URL: https://github.com/apache/yunikorn-k8shim/pull/628#discussion_r1253955747


##########
pkg/appmgmt/general/podevent_handler.go:
##########
@@ -127,6 +128,13 @@ func (p *PodEventHandler) addPod(pod *v1.Pod, eventSource 
EventSource) interface
                                Metadata: appMeta,
                        })
                } else {
+                       if 
conf.GetSchedulerConf().GetAllowSimilarAppIdsByDifferentUsers() && 
app.GetApplicationState() == "Running" && app.GetUser() != appMeta.User {

Review Comment:
   Why does the app need to be in a running state? I would expect all states to 
match this. Otherwise you can still get passed if an app is waiting to be 
scheduled.
   
   `GetAllowSimilarAppIdsByDifferentUsers` does not seem to cover what is 
specified: if it returns true you make check that the users do not match. I 
would expect the check for the setting to be more like: 
`GetSingleUserPerApplication()` if true app user and task user must match. If 
not matched reject, otherwise allow it.
   So:
   ```
   if conf.GetSchedulerConf().GetSingleUserPerApplication() && app.GetUser() != 
appMeta.User {
        reject the task
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to