From 546f6ad897647cd351cbc3976264fe29b43e6db7 Mon Sep 17 00:00:00 2001 From: jacksontong Date: Wed, 23 Mar 2022 21:36:22 +0800 Subject: [PATCH] Fix #1147: Error in the script used to automatically update certificate in cluster. Signed-off-by: cumirror --- pkg/certs/module.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/certs/module.go b/pkg/certs/module.go index d9933008..e49453cd 100644 --- a/pkg/certs/module.go +++ b/pkg/certs/module.go @@ -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, }