Fix CertificateSigningRequest create failed after upgrade to v1

Signed-off-by: hongming <hongming@kubesphere.io>
This commit is contained in:
hongming
2021-08-31 12:10:39 +08:00
parent 9df6df5544
commit db1a70a45b
5 changed files with 141 additions and 21 deletions

View File

@@ -86,7 +86,7 @@ func NewController(k8sClient kubernetes.Interface, csrInformer certificatesinfor
csrLister: csrInformer.Lister(),
csrSynced: csrInformer.Informer().HasSynced,
cmSynced: configMapInformer.Informer().HasSynced,
kubeconfigOperator: kubeconfig.NewOperator(k8sClient, configMapInformer, config),
kubeconfigOperator: kubeconfig.NewOperator(k8sClient, configMapInformer.Lister(), config),
workqueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "CertificateSigningRequest"),
recorder: recorder,
}
@@ -251,6 +251,7 @@ func (c *Controller) Approve(csr *certificatesv1.CertificateSigningRequest) erro
}
csr.Status = certificatesv1.CertificateSigningRequestStatus{
Conditions: []certificatesv1.CertificateSigningRequestCondition{{
Status: corev1.ConditionTrue,
Type: "Approved",
Reason: "KubeSphereApprove",
Message: "This CSR was approved by KubeSphere",