diff --git a/pkg/controller/certificatesigningrequest/certificatesigningrequest_controller.go b/pkg/controller/certificatesigningrequest/certificatesigningrequest_controller.go index 350fd8df0befbb20d9e52dc3766cbc91f443c3a9..ae90e87b8ca93e8b8367d33fad18a38811bb7de4 100644 --- a/pkg/controller/certificatesigningrequest/certificatesigningrequest_controller.go +++ b/pkg/controller/certificatesigningrequest/certificatesigningrequest_controller.go @@ -111,8 +111,6 @@ func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error { defer utilruntime.HandleCrash() defer c.workqueue.ShutDown() - //init client - // Start the csrInformer factories to begin populating the csrInformer caches klog.Info("Starting User controller") @@ -227,20 +225,19 @@ func (c *Controller) reconcile(key string) error { klog.Error(err) return err } - } - - // certificate data is not empty - if len(csr.Status.Certificate) > 0 { - err = c.UpdateKubeconfig(csr) - if err != nil { - klog.Error(err) - return err - } - // release - err := c.k8sclient.CertificatesV1beta1().CertificateSigningRequests().Delete(csr.Name, metav1.NewDeleteOptions(0)) - if err != nil { - klog.Error(err) - return err + // certificate data is not empty + if len(csr.Status.Certificate) > 0 { + err = c.UpdateKubeconfig(csr) + if err != nil { + klog.Error(err) + return err + } + // release + err := c.k8sclient.CertificatesV1beta1().CertificateSigningRequests().Delete(csr.Name, metav1.NewDeleteOptions(0)) + if err != nil { + klog.Error(err) + return err + } } } diff --git a/pkg/controller/workspace/workspace_controller.go b/pkg/controller/workspace/workspace_controller.go index acb0d5bba08b89069dc57c2c4d740c94c62b8161..e806c00c5ed8f7525fad655279d83ce508b8b5b9 100644 --- a/pkg/controller/workspace/workspace_controller.go +++ b/pkg/controller/workspace/workspace_controller.go @@ -31,12 +31,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/source" ) -const ( - workspaceAdminDescription = "Allows admin access to perform any action on any resource, it gives full control over every resource in the workspace." - workspaceRegularDescription = "Normal user in the workspace, can create namespace and DevOps project." - workspaceViewerDescription = "Allows viewer access to view all resources in the workspace." -) - // Add creates a new Workspace Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller // and Start it when the Manager is Started. func Add(mgr manager.Manager) error {