You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2022/09/27 11:42:35 UTC

[GitHub] [yunikorn-k8shim] pbacsko commented on a diff in pull request #465: [YUNIKORN-1322] [admission] add new config value handling and allow/deny label if defined

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


##########
pkg/plugin/admissioncontrollers/webhook/webhook.go:
##########
@@ -80,6 +92,44 @@ func main() {
 		noLabelNamespaces = ""
 	}
 
+	bypassAuth := defaultBypassAuth
+	bypassAuthEnv, ok := os.LookupEnv(admissionControllerBypassAuth)
+	if ok {
+		parsed, err := strconv.ParseBool(bypassAuthEnv)
+		if err != nil {
+			log.Logger().Warn("Unable to parse value, using default",
+				zap.String("env var", admissionControllerBypassAuth),
+				zap.Bool("default", defaultBypassAuth))
+		} else {
+			bypassAuth = parsed
+		}
+	}
+	systemUsers, ok := os.LookupEnv(admissionControllerSystemUsers)
+	if !ok {
+		systemUsers = defaultSystemUsers
+	}
+	externalUsers, ok := os.LookupEnv(admissionControllerExternalUsers)
+	if !ok {
+		externalUsers = ""
+	}
+	externalGroups, ok := os.LookupEnv(admissionControllerExternalGroups)
+	if !ok {
+		externalUsers = ""

Review Comment:
   Code was extracted to a function & unit tests were added



-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org