Merge pull request #104227 from astraw99/fix_typo
Fix typo `registry` Kubernetes-commit: 0465cd7d04df7c6f7737bc850538eefd27400fa2
This commit is contained in:
commit
4340b9bf56
8
go.mod
8
go.mod
|
|
@ -46,8 +46,8 @@ require (
|
|||
gopkg.in/square/go-jose.v2 v2.2.2
|
||||
k8s.io/api v0.0.0-20211001003357-dd4141958dfc
|
||||
k8s.io/apimachinery v0.0.0-20211001003147-df63df3af3fc
|
||||
k8s.io/client-go v0.0.0-20211001003700-dbfa30b9d908
|
||||
k8s.io/component-base v0.0.0-20211001004235-05eaa93d6d25
|
||||
k8s.io/client-go v0.0.0-20211001163650-f71d2554c374
|
||||
k8s.io/component-base v0.0.0-20211002003808-8ef22d17745b
|
||||
k8s.io/klog/v2 v2.20.0
|
||||
k8s.io/kube-openapi v0.0.0-20210817084001-7fbd8d59e5b8
|
||||
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b
|
||||
|
|
@ -59,6 +59,6 @@ require (
|
|||
replace (
|
||||
k8s.io/api => k8s.io/api v0.0.0-20211001003357-dd4141958dfc
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20211001003147-df63df3af3fc
|
||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20211001003700-dbfa30b9d908
|
||||
k8s.io/component-base => k8s.io/component-base v0.0.0-20211001004235-05eaa93d6d25
|
||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20211001163650-f71d2554c374
|
||||
k8s.io/component-base => k8s.io/component-base v0.0.0-20211002003808-8ef22d17745b
|
||||
)
|
||||
|
|
|
|||
8
go.sum
8
go.sum
|
|
@ -949,10 +949,10 @@ k8s.io/api v0.0.0-20211001003357-dd4141958dfc h1:mEvk8nUryhzsFO3gvz1GOCHKAk9SwmC
|
|||
k8s.io/api v0.0.0-20211001003357-dd4141958dfc/go.mod h1:X/EFj3T8/b6pT7Vu0CQfs8hKQGD/NpK6nituBPxPypM=
|
||||
k8s.io/apimachinery v0.0.0-20211001003147-df63df3af3fc h1:xWJbWTw1QtGvoHnsdF1oI10d2gEBl2yqipw/m1DQjLU=
|
||||
k8s.io/apimachinery v0.0.0-20211001003147-df63df3af3fc/go.mod h1:RAdi3McqM+9tkYHOyceb4XOeJWm9BCAF4BhZki5iiok=
|
||||
k8s.io/client-go v0.0.0-20211001003700-dbfa30b9d908 h1:B+OGWjn70mELs6xMjuvbxagQo6vMUCvVXRvLU8E/RbU=
|
||||
k8s.io/client-go v0.0.0-20211001003700-dbfa30b9d908/go.mod h1:D3oqLmrdamgyGGdeFnlQ2viGosUBar48jDD5c89k3TA=
|
||||
k8s.io/component-base v0.0.0-20211001004235-05eaa93d6d25 h1:4rKPbaIXyH8ttIz3aM4VdiZ7W3iRhw7Vc+AgR6cMV3w=
|
||||
k8s.io/component-base v0.0.0-20211001004235-05eaa93d6d25/go.mod h1:hJUQ9S5ONjPiJMk3dsctlNEu+CS+jEyu9W5wVEMAF4g=
|
||||
k8s.io/client-go v0.0.0-20211001163650-f71d2554c374 h1:BESUWBMp04vEvrBgB9N9WbDLm5L8T8wGu3CSkVoKFpk=
|
||||
k8s.io/client-go v0.0.0-20211001163650-f71d2554c374/go.mod h1:D3oqLmrdamgyGGdeFnlQ2viGosUBar48jDD5c89k3TA=
|
||||
k8s.io/component-base v0.0.0-20211002003808-8ef22d17745b h1:H+/3fRk52/qS0CiBg1irHq3rdrOtTyoZAR9yfKrgDII=
|
||||
k8s.io/component-base v0.0.0-20211002003808-8ef22d17745b/go.mod h1:k8WbcY75pTS2zc0mVGbSkWIvjrqL51iRgENi98nxCog=
|
||||
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
|
||||
k8s.io/klog/v2 v2.20.0 h1:tlyxlSvd63k7axjhuchckaRJm+a92z5GSOrTOQY5sHw=
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue