Skip to content

Commit

Permalink
fix bootstrapToken (#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
oldthreefeng authored Dec 8, 2021
1 parent 7519f4d commit d623669
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
7 changes: 1 addition & 6 deletions install/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Add InitConfiguration.patches.directory, JoinConfiguration.patches.directory to
Move the BootstrapToken∗ API and related utilities out of the "kubeadm" API group to a new group "bootstraptoken". The kubeadm API version v1beta3 no longer contains the BootstrapToken∗ structures.
*/
Bootstraptokenv1 = "bootstraptoken/v1"
)

const (
Expand All @@ -65,11 +64,7 @@ const (
JoinConfigurationDefault +
kubeletConfigDefault)

bootstrapTokenDefault = `{{- if eq .BootstrapApi "bootstraptoken/v1" }}
apiVersion: {{.BootstrapApi}}
{{- else}}
apiVersion: {{.KubeadmApi}}
{{- end}}
bootstrapTokenDefault = `apiVersion: {{.KubeadmApi}}
caCertPath: /etc/kubernetes/pki/ca.crt
discovery:
bootstrapToken:
Expand Down
3 changes: 0 additions & 3 deletions install/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ func setKubeadmApi(version string) {
case major >= 123:
KubeadmApi = KubeadmV1beta3
CriSocket = DefaultContainerdCRISocket
BootstrapApi = Bootstraptokenv1
default:
KubeadmApi = KubeadmV1beta3
CriSocket = DefaultContainerdCRISocket
BootstrapApi = Bootstraptokenv1
}
logger.Debug("KubeadmApi: %s", KubeadmApi)
logger.Debug("CriSocket: %s", CriSocket)
Expand Down Expand Up @@ -94,7 +92,6 @@ func JoinTemplateFromTemplateContent(templateContent, ip, cgroup string) []byte
envMap["VIP"] = VIP
envMap["KubeadmApi"] = KubeadmApi
envMap["CriSocket"] = CriSocket
envMap["BootstrapApi"] = BootstrapApi
envMap["CgroupDriver"] = cgroup
var buffer bytes.Buffer
_ = tmpl.Execute(&buffer, envMap)
Expand Down
1 change: 0 additions & 1 deletion install/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ var (
CriSocket string
CgroupDriver string
KubeadmApi string
BootstrapApi string

VIP string
PkgUrl string
Expand Down

0 comments on commit d623669

Please sign in to comment.