mirror of https://github.com/k3s-io/k3s
parent
9f15368c5c
commit
8272fc54cb
|
@ -118,31 +118,31 @@ func NewServiceAccount() *serviceAccount {
|
|||
}
|
||||
}
|
||||
|
||||
func (a *serviceAccount) SetExternalKubeClientSet(cl kubernetes.Interface) {
|
||||
a.client = cl
|
||||
func (s *serviceAccount) SetExternalKubeClientSet(cl kubernetes.Interface) {
|
||||
s.client = cl
|
||||
}
|
||||
|
||||
func (a *serviceAccount) SetExternalKubeInformerFactory(f informers.SharedInformerFactory) {
|
||||
func (s *serviceAccount) SetExternalKubeInformerFactory(f informers.SharedInformerFactory) {
|
||||
serviceAccountInformer := f.Core().V1().ServiceAccounts()
|
||||
a.serviceAccountLister = serviceAccountInformer.Lister()
|
||||
s.serviceAccountLister = serviceAccountInformer.Lister()
|
||||
|
||||
secretInformer := f.Core().V1().Secrets()
|
||||
a.secretLister = secretInformer.Lister()
|
||||
s.secretLister = secretInformer.Lister()
|
||||
|
||||
a.SetReadyFunc(func() bool {
|
||||
s.SetReadyFunc(func() bool {
|
||||
return serviceAccountInformer.Informer().HasSynced() && secretInformer.Informer().HasSynced()
|
||||
})
|
||||
}
|
||||
|
||||
// ValidateInitialization ensures an authorizer is set.
|
||||
func (a *serviceAccount) ValidateInitialization() error {
|
||||
if a.client == nil {
|
||||
func (s *serviceAccount) ValidateInitialization() error {
|
||||
if s.client == nil {
|
||||
return fmt.Errorf("missing client")
|
||||
}
|
||||
if a.secretLister == nil {
|
||||
if s.secretLister == nil {
|
||||
return fmt.Errorf("missing secretLister")
|
||||
}
|
||||
if a.serviceAccountLister == nil {
|
||||
if s.serviceAccountLister == nil {
|
||||
return fmt.Errorf("missing serviceAccountLister")
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue