mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	certs: remove always nil error from New signature
This commit is contained in:
		@@ -77,14 +77,11 @@ func Run(s *GKECertificatesController) error {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	controller, err := certificates.NewCertificateController(
 | 
			
		||||
	controller := certificates.NewCertificateController(
 | 
			
		||||
		client,
 | 
			
		||||
		sharedInformers.Certificates().V1beta1().CertificateSigningRequests(),
 | 
			
		||||
		signer.handle,
 | 
			
		||||
	)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	sharedInformers.Start(nil)
 | 
			
		||||
	controller.Run(5, nil) // runs forever
 | 
			
		||||
 
 | 
			
		||||
@@ -59,16 +59,10 @@ func startCSRApprovingController(ctx ControllerContext) (bool, error) {
 | 
			
		||||
		return false, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	approver, err := approver.NewCSRApprovingController(
 | 
			
		||||
	approver := approver.NewCSRApprovingController(
 | 
			
		||||
		ctx.ClientBuilder.ClientOrDie("certificate-controller"),
 | 
			
		||||
		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)
 | 
			
		||||
 | 
			
		||||
	return true, nil
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ type sarApprover struct {
 | 
			
		||||
	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{
 | 
			
		||||
		client:      client,
 | 
			
		||||
		recognizers: recognizers(),
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,7 @@ func NewCertificateController(
 | 
			
		||||
	kubeClient clientset.Interface,
 | 
			
		||||
	csrInformer certificatesinformers.CertificateSigningRequestInformer,
 | 
			
		||||
	handler func(*certificates.CertificateSigningRequest) error,
 | 
			
		||||
) (*CertificateController, error) {
 | 
			
		||||
) *CertificateController {
 | 
			
		||||
	// Send events to the apiserver
 | 
			
		||||
	eventBroadcaster := record.NewBroadcaster()
 | 
			
		||||
	eventBroadcaster.StartLogging(glog.Infof)
 | 
			
		||||
@@ -98,7 +98,7 @@ func NewCertificateController(
 | 
			
		||||
	cc.csrLister = csrInformer.Lister()
 | 
			
		||||
	cc.csrsSynced = csrInformer.Informer().HasSynced
 | 
			
		||||
	cc.handler = handler
 | 
			
		||||
	return cc, nil
 | 
			
		||||
	return cc
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Run the main goroutine responsible for watching and syncing jobs.
 | 
			
		||||
 
 | 
			
		||||
@@ -54,14 +54,11 @@ func TestCertificateController(t *testing.T) {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	controller, err := NewCertificateController(
 | 
			
		||||
	controller := NewCertificateController(
 | 
			
		||||
		client,
 | 
			
		||||
		informerFactory.Certificates().V1beta1().CertificateSigningRequests(),
 | 
			
		||||
		handler,
 | 
			
		||||
	)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		t.Fatalf("error creating controller: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
	controller.csrsSynced = func() bool { return true }
 | 
			
		||||
 | 
			
		||||
	stopCh := make(chan struct{})
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,7 @@ func NewCSRSigningController(
 | 
			
		||||
		client,
 | 
			
		||||
		csrInformer,
 | 
			
		||||
		signer.handle,
 | 
			
		||||
	)
 | 
			
		||||
	), nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type cfsslSigner struct {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user