From 80b43075c9b213c98fa3bd72326e6ec3e968c2d3 Mon Sep 17 00:00:00 2001 From: BinacsLee Date: Thu, 21 Jul 2022 20:13:30 +0800 Subject: [PATCH] cleanup: use sets.Len() insead of len(sets.List()) --- pkg/kubeapiserver/options/authorization.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubeapiserver/options/authorization.go b/pkg/kubeapiserver/options/authorization.go index a6760d1720e..778ca1210d7 100644 --- a/pkg/kubeapiserver/options/authorization.go +++ b/pkg/kubeapiserver/options/authorization.go @@ -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)) }