pbacsko commented on code in PR #628:
URL: https://github.com/apache/yunikorn-k8shim/pull/628#discussion_r1269577016


##########
pkg/appmgmt/general/podevent_handler.go:
##########
@@ -127,6 +129,19 @@ func (p *PodEventHandler) addPod(pod *v1.Pod, eventSource 
EventSource) interface
                                Metadata: appMeta,
                        })
                } else {
+                       if 
conf.GetSchedulerConf().GetSingleUserPerApplication() && app.GetUser() != 
appMeta.User {
+                               log.Log(log.ShimAppMgmtGeneral).Warn("rejecting 
application as it has been submitted by different user",
+                                       zap.String("app id ", 
appMeta.ApplicationID),
+                                       zap.String("app user", app.GetUser()),
+                                       zap.String("submitted by", 
appMeta.User))
+                               events.GetRecorder().Eventf(pod.DeepCopy(), 
nil, v1.EventTypeWarning,
+                                       "Rejecting the application because 
already application exists with different user",
+                                       "Please try submitting a application by 
same user",
+                                       "SingleUserPerApplication has been 
configured to true. So rejecting the application because it has been submitted 
by different user. "+
+                                               "Either you can disable the 
check by not setting SingleUserPerApplication or try submitting a application 
by same use. "+
+                                               "By default, 
SingleUserPerApplication is false")

Review Comment:
   This is a lot of text. I don't think we need to send that much info. I'd 
send sth like:
   ```
   events.GetRecorder().Eventf(pod.DeepCopy(), nil, v1.EventTypeWarning, 
fmt.Sprintf("Rejecting pod because application ID %s belongs to a different 
user", appMeta.ApplicationID))
   ```
   This is more than enough. 



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