diff --git a/staging/src/k8s.io/apiserver/pkg/server/options/api_enablement.go b/staging/src/k8s.io/apiserver/pkg/server/options/api_enablement.go index 794e89dedb6..13968b4e7d9 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/options/api_enablement.go +++ b/staging/src/k8s.io/apiserver/pkg/server/options/api_enablement.go @@ -58,7 +58,7 @@ func (s *APIEnablementOptions) AddFlags(fs *pflag.FlagSet) { // But in the advanced (and usually not recommended) case of delegated apiservers there can be more. // Validate will filter out the known groups of each registry. // If anything is left over after that, an error is returned. -func (s *APIEnablementOptions) Validate(registries ...GroupRegisty) []error { +func (s *APIEnablementOptions) Validate(registries ...GroupRegistry) []error { if s == nil { return nil } @@ -98,7 +98,7 @@ func (s *APIEnablementOptions) ApplyTo(c *server.Config, defaultResourceConfig * return err } -func unknownGroups(groups []string, registry GroupRegisty) []string { +func unknownGroups(groups []string, registry GroupRegistry) []string { unknownGroups := []string{} for _, group := range groups { if !registry.IsGroupRegistered(group) { @@ -108,8 +108,8 @@ func unknownGroups(groups []string, registry GroupRegisty) []string { return unknownGroups } -// GroupRegisty provides a method to check whether given group is registered. -type GroupRegisty interface { +// GroupRegistry provides a method to check whether given group is registered. +type GroupRegistry interface { // IsRegistered returns true if given group is registered. IsGroupRegistered(group string) bool } diff --git a/staging/src/k8s.io/apiserver/pkg/server/options/api_enablement_test.go b/staging/src/k8s.io/apiserver/pkg/server/options/api_enablement_test.go index fb146bf28bc..b37931eb28c 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/options/api_enablement_test.go +++ b/staging/src/k8s.io/apiserver/pkg/server/options/api_enablement_test.go @@ -24,9 +24,9 @@ import ( cliflag "k8s.io/component-base/cli/flag" ) -type fakeGroupRegisty struct{} +type fakeGroupRegistry struct{} -func (f fakeGroupRegisty) IsGroupRegistered(group string) bool { +func (f fakeGroupRegistry) IsGroupRegistered(group string) bool { return group == "apiregistration.k8s.io" } @@ -67,11 +67,11 @@ func TestAPIEnablementOptionsValidate(t *testing.T) { }, }, } - testGroupRegisty := fakeGroupRegisty{} + testGroupRegistry := fakeGroupRegistry{} for _, testcase := range testCases { t.Run(testcase.name, func(t *testing.T) { - errs := testcase.testOptions.Validate(testGroupRegisty) + errs := testcase.testOptions.Validate(testGroupRegistry) if len(testcase.expectErr) != 0 && !strings.Contains(utilerrors.NewAggregate(errs).Error(), testcase.expectErr) { t.Errorf("got err: %v, expected err: %s", errs, testcase.expectErr) }