mirror of https://github.com/k3s-io/k3s
Merge pull request #54426 from mikedanese/csr1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. certs: remove always nil error from New signature ```release-note-none ```pull/6/head
commit
9b8d70dc42
|
@ -77,14 +77,11 @@ func Run(s *GKECertificatesController) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
controller, err := certificates.NewCertificateController(
|
controller := certificates.NewCertificateController(
|
||||||
client,
|
client,
|
||||||
sharedInformers.Certificates().V1beta1().CertificateSigningRequests(),
|
sharedInformers.Certificates().V1beta1().CertificateSigningRequests(),
|
||||||
signer.handle,
|
signer.handle,
|
||||||
)
|
)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
sharedInformers.Start(nil)
|
sharedInformers.Start(nil)
|
||||||
controller.Run(5, nil) // runs forever
|
controller.Run(5, nil) // runs forever
|
||||||
|
|
|
@ -59,16 +59,10 @@ func startCSRApprovingController(ctx ControllerContext) (bool, error) {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
approver, err := approver.NewCSRApprovingController(
|
approver := approver.NewCSRApprovingController(
|
||||||
ctx.ClientBuilder.ClientOrDie("certificate-controller"),
|
ctx.ClientBuilder.ClientOrDie("certificate-controller"),
|
||||||
ctx.InformerFactory.Certificates().V1beta1().CertificateSigningRequests(),
|
ctx.InformerFactory.Certificates().V1beta1().CertificateSigningRequests(),
|
||||||
)
|
)
|
||||||
if err != nil {
|
|
||||||
// TODO this is failing consistently in test-cmd and local-up-cluster.sh. Fix them and make it consistent with all others which
|
|
||||||
// cause a crash loop
|
|
||||||
glog.Errorf("Failed to start certificate controller: %v", err)
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
go approver.Run(1, ctx.Stop)
|
go approver.Run(1, ctx.Stop)
|
||||||
|
|
||||||
return true, nil
|
return true, nil
|
||||||
|
|
|
@ -44,7 +44,7 @@ type sarApprover struct {
|
||||||
recognizers []csrRecognizer
|
recognizers []csrRecognizer
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCSRApprovingController(client clientset.Interface, csrInformer certificatesinformers.CertificateSigningRequestInformer) (*certificates.CertificateController, error) {
|
func NewCSRApprovingController(client clientset.Interface, csrInformer certificatesinformers.CertificateSigningRequestInformer) *certificates.CertificateController {
|
||||||
approver := &sarApprover{
|
approver := &sarApprover{
|
||||||
client: client,
|
client: client,
|
||||||
recognizers: recognizers(),
|
recognizers: recognizers(),
|
||||||
|
|
|
@ -53,7 +53,7 @@ func NewCertificateController(
|
||||||
kubeClient clientset.Interface,
|
kubeClient clientset.Interface,
|
||||||
csrInformer certificatesinformers.CertificateSigningRequestInformer,
|
csrInformer certificatesinformers.CertificateSigningRequestInformer,
|
||||||
handler func(*certificates.CertificateSigningRequest) error,
|
handler func(*certificates.CertificateSigningRequest) error,
|
||||||
) (*CertificateController, error) {
|
) *CertificateController {
|
||||||
// Send events to the apiserver
|
// Send events to the apiserver
|
||||||
eventBroadcaster := record.NewBroadcaster()
|
eventBroadcaster := record.NewBroadcaster()
|
||||||
eventBroadcaster.StartLogging(glog.Infof)
|
eventBroadcaster.StartLogging(glog.Infof)
|
||||||
|
@ -98,7 +98,7 @@ func NewCertificateController(
|
||||||
cc.csrLister = csrInformer.Lister()
|
cc.csrLister = csrInformer.Lister()
|
||||||
cc.csrsSynced = csrInformer.Informer().HasSynced
|
cc.csrsSynced = csrInformer.Informer().HasSynced
|
||||||
cc.handler = handler
|
cc.handler = handler
|
||||||
return cc, nil
|
return cc
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the main goroutine responsible for watching and syncing jobs.
|
// Run the main goroutine responsible for watching and syncing jobs.
|
||||||
|
|
|
@ -54,14 +54,11 @@ func TestCertificateController(t *testing.T) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
controller, err := NewCertificateController(
|
controller := NewCertificateController(
|
||||||
client,
|
client,
|
||||||
informerFactory.Certificates().V1beta1().CertificateSigningRequests(),
|
informerFactory.Certificates().V1beta1().CertificateSigningRequests(),
|
||||||
handler,
|
handler,
|
||||||
)
|
)
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("error creating controller: %v", err)
|
|
||||||
}
|
|
||||||
controller.csrsSynced = func() bool { return true }
|
controller.csrsSynced = func() bool { return true }
|
||||||
|
|
||||||
stopCh := make(chan struct{})
|
stopCh := make(chan struct{})
|
||||||
|
|
|
@ -50,7 +50,7 @@ func NewCSRSigningController(
|
||||||
client,
|
client,
|
||||||
csrInformer,
|
csrInformer,
|
||||||
signer.handle,
|
signer.handle,
|
||||||
)
|
), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type cfsslSigner struct {
|
type cfsslSigner struct {
|
||||||
|
|
Loading…
Reference in New Issue