pbacsko commented on code in PR #475:
URL: https://github.com/apache/yunikorn-k8shim/pull/475#discussion_r1015417086
##########
pkg/common/utils/utils.go:
##########
@@ -238,7 +241,27 @@ func MergeMaps(first, second map[string]string)
map[string]string {
}
// find user name from pod label
-func GetUserFromPod(pod *v1.Pod) string {
+func GetUserFromPod(pod *v1.Pod) (string, []string) {
+ if pod.Annotations[userInfoKey] != "" {
+ userInfoJSON := pod.Annotations[userInfoKey]
+ var userGroup si.UserGroupInformation
+ err := json.Unmarshal([]byte(userInfoJSON), &userGroup)
+ if err != nil {
+ log.Logger().Error("unable to process user info
annotation", zap.Error(err))
+ return constants.DefaultUser, nil
+ }
+ user := userGroup.User
+ groups := userGroup.Groups
Review Comment:
Makes sense, I added a default group + logging
--
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]