Skip to content

Commit

Permalink
Optimized global template (caoyingjunz#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazytaxii authored Jul 10, 2024
1 parent 9dc2051 commit b074197
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions template/globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enable_kubernetes_ha: "yes"
kube_vip_address: "{{ .Kubernetes.ApiServer }}"
{{- end }}
{{- if ne .Kubernetes.ApiPort "" }}
{{- if .Kubernetes.ApiPort }}
kube_vip_port: "{{ .Kubernetes.ApiPort }}"
{{- end }}
Expand All @@ -37,14 +37,12 @@ service_cidr: "{{ .Network.ServiceNetwork }}"
network_interface: "{{ .Network.NetworkInterface }}"
{{- if .Component.Haproxy }}
{{- if .Component.Haproxy.Enable }}
{{- if and .Component.Haproxy .Component.Haproxy.Enable }}
enable_haproxy: "yes"
{{- if ne .Component.Haproxy.KeepalivedVirtualRouterId "" }}
{{- if .Component.Haproxy.KeepalivedVirtualRouterId }}
keepalived_virtual_router_id: "{{ .Component.Haproxy.KeepalivedVirtualRouterId }}"
{{- end }}
{{- end }}
{{- end }}
{{- if eq .Network.Cni "calico" }}
enable_calico: "yes"
Expand Down

0 comments on commit b074197

Please sign in to comment.