cleanup: use sets.Len() insead of len(sets.List())

This commit is contained in:
BinacsLee 2022-07-21 20:13:30 +08:00
parent 303f47c0c0
commit 80b43075c9

View File

@ -88,7 +88,7 @@ func (o *BuiltInAuthorizationOptions) Validate() []error {
allErrors = append(allErrors, fmt.Errorf("cannot specify --authorization-webhook-config-file without mode Webhook"))
}
if len(o.Modes) != len(modes.List()) {
if len(o.Modes) != modes.Len() {
allErrors = append(allErrors, fmt.Errorf("authorization-mode %q has mode specified more than once", o.Modes))
}