Skip to content

Commit b4251b2

Browse files
committed
chore: refactor K3s configuration and update Go version
- Update Go version from 1.23.1 to 1.24.2 - Modify K3s configuration to conditionally include `--datastore-endpoint` if the datastore is not "local" - Simplify K3s configuration by ensuring the `--server` flag is conditionally included based on the `Master0` variable - Remove unnecessary lines from K3s configuration related to the `--server` flag Signed-off-by: ysicing <i@ysicing.me>
1 parent 23b51f7 commit b4251b2

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

common/const.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,10 @@ ExecStart=/usr/local/bin/k3s \
159159
--flannel-backend {{ .CNI }} \
160160
{{ end }}
161161
{{- if .DataStore }}
162+
{{- if ne .DataStore "local"}}
162163
--datastore-endpoint {{ .DataStore }} \
164+
{{-end}}
163165
{{- else}}
164-
{{if not .Master0 -}}
165-
--server https://{{ .KubeAPI }}:6443 \
166-
{{ end }}
167166
--cluster-init \
168167
--etcd-expose-metrics \
169168
--etcd-snapshot-name auto-snapshot \
@@ -176,10 +175,12 @@ ExecStart=/usr/local/bin/k3s \
176175
--disable servicelb,traefik,local-storage \
177176
{{- else}}
178177
agent \
179-
--server https://{{ .KubeAPI }}:6443 \
180178
{{- end }}
179+
{{if not .Master0 -}}
180+
--server https://{{ .KubeAPI }}:6443 \
181+
{{ end }}
181182
--token {{ .KubeToken }} \
182-
--data-dir {{.DataDir}} \
183+
--data-dir {{ .DataDir }} \
183184
--pause-image {{ .Registry }}/rancher/mirrored-pause:3.6 \
184185
--prefer-bundled-bin \
185186
--kube-proxy-arg "proxy-mode=ipvs" \

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module github.com/easysoft/qcadmin
22

3-
go 1.23.1
3+
go 1.24.2
4+
45
require (
56
github.com/AlecAivazis/survey/v2 v2.3.7
67
github.com/BeidouCloudPlatform/go-bindata/v4 v4.1.0

0 commit comments

Comments
 (0)