Skip to content

Commit c620733

Browse files
committed
* [fix] fix typo systemd
1 parent 22bd763 commit c620733

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

common/const.go

+5-15
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,9 @@ ExecStart=/usr/local/bin/k3s \
160160
--tls-san kubeapi.corp.cc \
161161
--tls-san apiserver.cluster.local \
162162
--tls-san {{ .KubeAPI }} \
163-
{{- if .PodCIDR }}
164-
--cluster-cidr {{ .PodCIDR }} \
165-
{{- end -}}
166-
{{- if .ServiceCIDR }}
167-
--service-cidr {{ .ServiceCIDR }} \
168-
{{- end -}}
163+
{{if .PodCIDR }}--cluster-cidr {{ .PodCIDR }} \ {{end}}
164+
{{if .ServiceCIDR }}--service-cidr {{ .ServiceCIDR }} \ {{end}}
165+
{{if .CNI }}--flannel-backend {{ .CNI }} \ {{ end }}
169166
{{- if .DataStore }}
170167
--datastore-endpoint {{ .DataStore }} \
171168
{{- else}}
@@ -176,19 +173,12 @@ ExecStart=/usr/local/bin/k3s \
176173
--etcd-expose-metrics \
177174
--etcd-snapshot-name auto-snapshot \
178175
--etcd-snapshot-compress \
179-
{{- end -}}
180-
{{- if .LocalStorage }}
181-
--disable servicelb,traefik \
182-
{{else -}}
183-
--disable servicelb,traefik,local-storage \
184-
{{- end -}}
176+
{{- end}}
185177
--disable-cloud-controller \
186178
--system-default-registry {{ .Registry }} \
187179
--disable-network-policy \
188180
--disable-helm-controller \
189-
{{if .CNI }}
190-
--flannel-backend {{ .CNI }} \
191-
{{end -}}
181+
{{if .LocalStorage }}--disable servicelb,traefik \ {{- else }}--disable servicelb,traefik,local-storage \ {{- end }}
192182
{{- else}}
193183
agent \
194184
--server https://{{ .KubeAPI }}:6443 \

hack/scripts/getk3s.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
set -xe
99

1010
if [ ! -f "hack/bin/k3s-linux-amd64" ]; then
11-
wget -O hack/bin/k3s-linux-amd64 https://github.com/k3s-io/k3s/releases/download/v1.28.12%2Bk3s1/k3s
11+
wget -O hack/bin/k3s-linux-amd64 https://github.com/k3s-io/k3s/releases/download/v1.28.13%2Bk3s1/k3s
1212
fi
1313
if [ ! -f "hack/bin/k3s-linux-arm64" ]; then
14-
wget -O hack/bin/k3s-linux-arm64 https://github.com/k3s-io/k3s/releases/download/v1.28.12%2Bk3s1/k3s-arm64
14+
wget -O hack/bin/k3s-linux-arm64 https://github.com/k3s-io/k3s/releases/download/v1.28.13%2Bk3s1/k3s-arm64
1515
fi
1616

1717
chmod +x hack/bin/k3s-linux-amd64 hack/bin/k3s-linux-arm64

internal/pkg/cli/k3stpl/k3stpl.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package k3stpl
99
import (
1010
"bytes"
1111
"os"
12+
"regexp"
1213
"text/template"
1314

1415
"github.com/ergoapi/util/exnet"
@@ -39,7 +40,8 @@ func render(data K3sArgs, temp string) string {
3940
var b bytes.Buffer
4041
t := template.Must(template.New("k3s").Parse(temp))
4142
_ = t.Execute(&b, &data)
42-
return b.String()
43+
re := regexp.MustCompile(`(?m)^\s*$[\r\n]*|[\r\n]+\s+\z`)
44+
return re.ReplaceAllString(b.String(), "")
4345
}
4446

4547
func (k3s K3sArgs) Manifests(template string) string {
@@ -95,5 +97,6 @@ func EmbedCommand(f factory.Factory) *cobra.Command {
9597
rootCmd.Flags().StringVar(&k3sargs.Master0IP, "master0ip", "", "master0ip, only work offline mode")
9698
rootCmd.Flags().StringVar(&k3sargs.Registry, "registry", "hub.zentao.net", "registry")
9799
rootCmd.Flags().StringVar(&k3sargs.DataStore, "datasource", "", "datasource")
100+
rootCmd.Flags().StringVar(&k3sargs.CNI, "cni", "", "cni")
98101
return rootCmd
99102
}

0 commit comments

Comments
 (0)