craigcondit commented on code in PR #475:
URL: https://github.com/apache/yunikorn-k8shim/pull/475#discussion_r1015624032
##########
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:
I disagree that we should have default groups, as this creates "magic"
values that behave in somewhat unpredictable ways. An empty group list is
allowed explicitly by the design, so we should not add additional groups here.
--
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]