Skip to content

Commit 06fc5b7

Browse files
authored
Merge pull request kubernetes#83060 from m3ngyang/mode-valid
to use existing validating function
2 parents ba19458 + da07206 commit 06fc5b7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/kubeapiserver/options/authorization.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ func (s *BuiltInAuthorizationOptions) Validate() []error {
5555
allErrors = append(allErrors, fmt.Errorf("at least one authorization-mode must be passed"))
5656
}
5757

58-
allowedModes := sets.NewString(authzmodes.AuthorizationModeChoices...)
5958
modes := sets.NewString(s.Modes...)
6059
for _, mode := range s.Modes {
61-
if !allowedModes.Has(mode) {
60+
if !authzmodes.IsValidAuthorizationMode(mode) {
6261
allErrors = append(allErrors, fmt.Errorf("authorization-mode %q is not a valid mode", mode))
6362
}
6463
if mode == authzmodes.ModeABAC {

0 commit comments

Comments
 (0)