Merge pull request #1149 from cumirror/master

Fix #1147: Error in the script used to automatically update certificate in cluster.
This commit is contained in:
KubeSphere CI Bot 2022-03-24 10:00:46 +08:00 committed by GitHub
commit c81fe6f7f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,13 +17,17 @@
package certs
import (
"path/filepath"
versionutil "k8s.io/apimachinery/pkg/util/version"
"github.com/kubesphere/kubekey/pkg/certs/templates"
"github.com/kubesphere/kubekey/pkg/common"
"github.com/kubesphere/kubekey/pkg/core/action"
"github.com/kubesphere/kubekey/pkg/core/prepare"
"github.com/kubesphere/kubekey/pkg/core/task"
"github.com/kubesphere/kubekey/pkg/core/util"
"github.com/kubesphere/kubekey/pkg/kubernetes"
"path/filepath"
)
type CheckCertsModule struct {
@ -136,6 +140,10 @@ func (a *AutoRenewCertsModule) Init() {
Action: &action.Template{
Template: templates.K8sCertsRenewScript,
Dst: filepath.Join("/usr/local/bin/kube-scripts/", templates.K8sCertsRenewScript.Name()),
Data: util.Data{
"IsDocker": a.KubeConf.Cluster.Kubernetes.ContainerManager == common.Docker,
"IsKubeadmAlphaCerts": versionutil.MustParseSemantic(a.KubeConf.Cluster.Kubernetes.Version).LessThan(versionutil.MustParseGeneric("v1.20.0")),
},
},
Parallel: true,
}