File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 11apiVersion : v2
22name : coredns
3- version : 1.19.9
3+ version : 1.19.10
44appVersion : 1.9.4
55home : https://coredns.io
66icon : https://coredns.io/images/CoreDNS_Colour_Horizontal.png
Original file line number Diff line number Diff line change @@ -143,6 +143,10 @@ Generate the list of ports automatically from the server definitions
143143 { {- $innerdict := set $innerdict " istcp" true -} }
144144 { {- end -} }
145145
146+ { {- if .hostPort -} }
147+ { {- $innerdict := set $innerdict " hostPort" .hostPort -} }
148+ { {- end -} }
149+
146150 { {/* Write the dict back into the outer dict */} }
147151 { {- $ports := set $ports $port $innerdict -} }
148152
@@ -159,11 +163,20 @@ Generate the list of ports automatically from the server definitions
159163
160164 { {/* Write out the ports according to the info collected above */} }
161165 { {- range $port , $innerdict := $ports -} }
166+ { {- $portList := list -} }
162167 { {- if index $innerdict " isudp" -} }
163- { {- printf " - { containerPort: %v, protocol: UDP, name: udp-%s} \n " $port $ port -} }
168+ { {- $ portList = append $ portList (dict " containerPort" ( $ port | int) " protocol" " UDP" " name" (printf " udp-%s" $port )) -} }
164169 { {- end -} }
165170 { {- if index $innerdict " istcp" -} }
166- { {- printf " - {containerPort: %v, protocol: TCP, name: tcp-%s}\n " $port $port -} }
171+ { {- $portList = append $portList (dict " containerPort" ($port | int) " protocol" " TCP" " name" (printf " tcp-%s" $port )) -} }
172+ { {- end -} }
173+
174+ { {- range $portDict := $portList -} }
175+ { {- if index $innerdict " hostPort" -} }
176+ { {- $portDict := set $portDict " hostPort" (get $innerdict " hostPort" | int) -} }
177+ { {- end -} }
178+
179+ { {- printf " - %s\n " (toJson $portDict ) -} }
167180 { {- end -} }
168181 { {- end -} }
169182{ {- end -} }
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ servers:
105105 port : 53
106106 # If serviceType is nodePort you can specify nodePort here
107107 # nodePort: 30053
108+ # hostPort: 53
108109 plugins :
109110 - name : errors
110111 # Serves a /health endpoint on :8080, required for livenessProbe
You can’t perform that action at this time.
0 commit comments