feat: support service account token auth mode

Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
hongming
2025-03-19 11:40:42 +08:00
committed by ks-ci-bot
parent 2660e60209
commit d064ef67c7
14 changed files with 294 additions and 31 deletions

View File

@@ -27,6 +27,7 @@ import (
"kubesphere.io/kubesphere/pkg/constants"
kscontroller "kubesphere.io/kubesphere/pkg/controller"
"kubesphere.io/kubesphere/pkg/models/kubeconfig"
)
const (
@@ -49,6 +50,11 @@ func (r *Reconciler) Name() string {
}
func (r *Reconciler) SetupWithManager(mgr *kscontroller.Manager) error {
if mgr.KubeconfigOptions.AuthMode != kubeconfig.AuthModeClientCertificate {
klog.Infof("Skip %s controller as the auth mode is not client certificate", controllerName)
return nil
}
r.recorder = mgr.GetEventRecorderFor(controllerName)
r.Client = mgr.GetClient()
return builder.