Rename for clarity
This commit is contained in:
parent
b799515f84
commit
bf86bc3383
@ -41,7 +41,7 @@ func NewOIDCProviderSecretsController(
|
||||
) controllerlib.Controller {
|
||||
return controllerlib.New(
|
||||
controllerlib.Config{
|
||||
Name: fmt.Sprintf("%s%s", secretHelper.Name(), "controller"),
|
||||
Name: fmt.Sprintf("%s%s", secretHelper.NamePrefix(), "controller"),
|
||||
Syncer: &oidcProviderSecretsController{
|
||||
secretHelper: secretHelper,
|
||||
kubeClient: kubeClient,
|
||||
|
@ -144,7 +144,7 @@ func TestOIDCProviderControllerFilterSecret(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
t.Cleanup(ctrl.Finish)
|
||||
secretHelper := mocksecrethelper.NewMockSecretHelper(ctrl)
|
||||
secretHelper.EXPECT().Name().Times(1).Return("some-name")
|
||||
secretHelper.EXPECT().NamePrefix().Times(1).Return("some-name")
|
||||
|
||||
secretInformer := kubeinformers.NewSharedInformerFactory(
|
||||
kubernetesfake.NewSimpleClientset(),
|
||||
@ -202,7 +202,7 @@ func TestNewOIDCProviderSecretsControllerFilterOPC(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
t.Cleanup(ctrl.Finish)
|
||||
secretHelper := mocksecrethelper.NewMockSecretHelper(ctrl)
|
||||
secretHelper.EXPECT().Name().Times(1).Return("some-name")
|
||||
secretHelper.EXPECT().NamePrefix().Times(1).Return("some-name")
|
||||
|
||||
secretInformer := kubeinformers.NewSharedInformerFactory(
|
||||
kubernetesfake.NewSimpleClientset(),
|
||||
@ -511,7 +511,7 @@ func TestOIDCProviderSecretsControllerSync(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
t.Cleanup(ctrl.Finish)
|
||||
secretHelper := mocksecrethelper.NewMockSecretHelper(ctrl)
|
||||
secretHelper.EXPECT().Name().Times(1).Return("some-name")
|
||||
secretHelper.EXPECT().NamePrefix().Times(1).Return("some-name")
|
||||
if test.secretHelper != nil {
|
||||
test.secretHelper(secretHelper)
|
||||
}
|
||||
|
@ -17,9 +17,9 @@ import (
|
||||
// SecretHelper describes an object that can Generate() a Secret and determine whether a Secret
|
||||
// IsValid(). It can also be Notify()'d about a Secret being persisted.
|
||||
//
|
||||
// A SecretHelper has a Name() that can be used to identify it from other SecretHelper instances.
|
||||
// A SecretHelper has a NamePrefix() that can be used to identify it from other SecretHelper instances.
|
||||
type SecretHelper interface {
|
||||
Name() string
|
||||
NamePrefix() string
|
||||
Generate(*configv1alpha1.OIDCProvider) (*corev1.Secret, error)
|
||||
IsValid(*configv1alpha1.OIDCProvider, *corev1.Secret) bool
|
||||
Notify(*configv1alpha1.OIDCProvider, *corev1.Secret)
|
||||
@ -60,7 +60,7 @@ type symmetricSecretHelper struct {
|
||||
notifyFunc func(parent *configv1alpha1.OIDCProvider, child *corev1.Secret)
|
||||
}
|
||||
|
||||
func (s *symmetricSecretHelper) Name() string { return s.namePrefix }
|
||||
func (s *symmetricSecretHelper) NamePrefix() string { return s.namePrefix }
|
||||
|
||||
// Generate implements SecretHelper.Generate().
|
||||
func (s *symmetricSecretHelper) Generate(parent *configv1alpha1.OIDCProvider) (*corev1.Secret, error) {
|
||||
|
@ -67,18 +67,18 @@ func (mr *MockSecretHelperMockRecorder) IsValid(arg0, arg1 interface{}) *gomock.
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsValid", reflect.TypeOf((*MockSecretHelper)(nil).IsValid), arg0, arg1)
|
||||
}
|
||||
|
||||
// Name mocks base method
|
||||
func (m *MockSecretHelper) Name() string {
|
||||
// NamePrefix mocks base method
|
||||
func (m *MockSecretHelper) NamePrefix() string {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Name")
|
||||
ret := m.ctrl.Call(m, "NamePrefix")
|
||||
ret0, _ := ret[0].(string)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Name indicates an expected call of Name
|
||||
func (mr *MockSecretHelperMockRecorder) Name() *gomock.Call {
|
||||
// NamePrefix indicates an expected call of NamePrefix
|
||||
func (mr *MockSecretHelperMockRecorder) NamePrefix() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockSecretHelper)(nil).Name))
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NamePrefix", reflect.TypeOf((*MockSecretHelper)(nil).NamePrefix))
|
||||
}
|
||||
|
||||
// Notify mocks base method
|
||||
|
Loading…
Reference in New Issue
Block a user