configmap.yaml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. kind: ConfigMap
  2. apiVersion: v1
  3. metadata:
  4. name: {{ include "deepflow.fullname" . }}
  5. labels:
  6. {{- include "deepflow.labels" . | nindent 4 }}
  7. data:
  8. server.yaml: |
  9. {{- range $elem, $elemVal := index .Values "configmap" "server.yaml" -}}
  10. {{- if not (kindIs "map" $elemVal) -}}
  11. {{- if kindIs "invalid" $elemVal -}}
  12. {{- nindent 4 $elem -}}:
  13. {{- else if kindIs "string" $elemVal -}}
  14. {{- if (tpl $elemVal $ ) -}}
  15. {{- nindent 4 $elem }}: {{ tpl $elemVal $ -}}
  16. {{- else -}}
  17. {{- nindent 4 $elem }}:
  18. {{- end -}}
  19. {{- else if kindIs "float64" $elemVal -}}
  20. {{- nindent 4 $elem }}: {{ int $elemVal -}}
  21. {{- else if kindIs "slice" $elemVal -}}
  22. {{- nindent 4 $elem -}}:
  23. {{- tpl (toYaml $elemVal ) $| nindent 4 -}}
  24. {{- else -}}
  25. {{- if $elemVal -}}
  26. {{- nindent 4 $elem }}: {{ toYaml $elemVal -}}
  27. {{- else -}}
  28. {{- nindent 4 $elem }}:
  29. {{- end -}}
  30. {{- end -}}
  31. {{- end -}}
  32. {{- end -}}
  33. {{- range $key, $value := index .Values "configmap" "server.yaml" -}}
  34. {{- if kindIs "map" $value -}}
  35. {{- nindent 4 $key -}}:
  36. {{- range $elem, $elemVal := $value -}}
  37. {{- if not (kindIs "map" $elemVal) -}}
  38. {{- if kindIs "invalid" $elemVal -}}
  39. {{- nindent 6 $elem -}}:
  40. {{- else if kindIs "string" $elemVal -}}
  41. {{- nindent 6 $elem }}: {{ tpl $elemVal $ -}}
  42. {{- else if kindIs "float64" $elemVal -}}
  43. {{- nindent 6 $elem }}: {{ int $elemVal -}}
  44. {{- else if kindIs "slice" $elemVal -}}
  45. {{- nindent 6 $elem -}}:
  46. {{- tpl (toYaml $elemVal ) $| nindent 6 -}}
  47. {{- else -}}
  48. {{- nindent 6 $elem }}: {{ $elemVal -}}
  49. {{- end -}}
  50. {{- end -}}
  51. {{- end -}}
  52. {{- range $elem, $elemVal := $value -}}
  53. {{- if kindIs "map" $elemVal -}}
  54. {{- nindent 6 $elem -}}:
  55. {{- range $therrKey, $therrVal := $elemVal -}}
  56. {{- if not (kindIs "map" $therrVal) -}}
  57. {{- if kindIs "invalid" $therrVal -}}
  58. {{- nindent 8 $therrKey -}}:
  59. {{- else if kindIs "string" $therrVal -}}
  60. {{- if (tpl $therrVal $ ) -}}
  61. {{- nindent 8 $therrKey }}: {{ tpl $therrVal $ -}}
  62. {{- else -}}
  63. {{- nindent 8 $therrKey }}:
  64. {{- end -}}
  65. {{- else if kindIs "float64" $therrVal -}}
  66. {{- nindent 8 $therrKey }}: {{ int $therrVal -}}
  67. {{- else if kindIs "slice" $therrVal -}}
  68. {{- nindent 8 $therrKey -}}:
  69. {{- tpl (toYaml $therrVal ) $| nindent 8 -}}
  70. {{- else -}}
  71. {{- if $therrVal -}}
  72. {{- nindent 8 $therrKey }}: {{ toYaml $therrVal -}}
  73. {{- else -}}
  74. {{- nindent 8 $therrKey }}:
  75. {{- end -}}
  76. {{- end -}}
  77. {{- end -}}
  78. {{- end -}}
  79. {{- range $therrKey, $therrVal := $elemVal -}}
  80. {{- if kindIs "map" $therrVal -}}
  81. {{- nindent 8 $therrKey -}}:
  82. {{- range $fourKey, $fourVal := $therrVal -}}
  83. {{- if not (kindIs "map" $fourVal) -}}
  84. {{- if kindIs "invalid" $fourVal -}}
  85. {{- nindent 10 $fourKey -}}:
  86. {{- else if kindIs "string" $fourVal -}}
  87. {{- if (tpl $fourVal $ ) -}}
  88. {{- nindent 10 $fourKey }}: {{ tpl $fourVal $ -}}
  89. {{- else -}}
  90. {{- nindent 10 $fourKey }}:
  91. {{- end -}}
  92. {{- else if kindIs "float64" $fourVal -}}
  93. {{- nindent 10 $fourKey }}: {{ int $fourVal -}}
  94. {{- else if kindIs "slice" $fourVal -}}
  95. {{- nindent 10 $fourKey -}}:
  96. {{- tpl (toYaml $fourVal ) $| nindent 10 -}}
  97. {{- else -}}
  98. {{- if $fourVal -}}
  99. {{- nindent 10 $fourKey }}: {{ toYaml $fourVal -}}
  100. {{- else -}}
  101. {{- nindent 10 $fourKey }}:
  102. {{- end -}}
  103. {{- end -}}
  104. {{- end -}}
  105. {{- end -}}
  106. {{- range $fourKey, $fourVal := $therrVal -}}
  107. {{- if kindIs "map" $fourVal -}}
  108. {{- nindent 10 $fourKey -}}:
  109. {{- range $fiveKey, $fiveVal := $fourVal -}}
  110. {{- if not (kindIs "map" $fiveVal) -}}
  111. {{- if kindIs "invalid" $fiveVal -}}
  112. {{- nindent 12 $fiveKey -}}:
  113. {{- else if kindIs "string" $fiveVal -}}
  114. {{- if $fiveVal -}}
  115. {{- nindent 12 $fiveKey }}: {{ tpl $fiveVal $ -}}
  116. {{- else -}}
  117. {{- nindent 12 $fiveKey }}:
  118. {{- end -}}
  119. {{- else if kindIs "float64" $fiveVal -}}
  120. {{- nindent 12 $fiveKey }}: {{ int $fiveVal -}}
  121. {{- else if kindIs "slice" $fiveVal -}}
  122. {{- nindent 12 $fiveKey -}}:
  123. {{- tpl (toYaml $fiveVal ) $| nindent 12 -}}
  124. {{- else -}}
  125. {{- if $fiveVal -}}
  126. {{- nindent 12 $fiveKey }}: {{ $fiveVal -}}
  127. {{- else -}}
  128. {{- nindent 12 $fiveKey }}:
  129. {{- end -}}
  130. {{- end -}}
  131. {{- end -}}
  132. {{- end -}}
  133. {{- end -}}
  134. {{- end -}}
  135. {{- end -}}
  136. {{- end -}}
  137. {{- end -}}
  138. {{- end -}}
  139. {{- end -}}
  140. {{- end }}
  141. app.yaml: |
  142. {{- range $elem, $elemVal := index .Values "configmap" "app.yaml" -}}
  143. {{- if not (kindIs "map" $elemVal) -}}
  144. {{- if kindIs "invalid" $elemVal -}}
  145. {{- nindent 4 $elem -}}:
  146. {{- else if kindIs "string" $elemVal -}}
  147. {{- if (tpl $elemVal $ ) -}}
  148. {{- nindent 4 $elem }}: {{ tpl $elemVal $ -}}
  149. {{- else -}}
  150. {{- nindent 4 $elem }}:
  151. {{- end -}}
  152. {{- else if kindIs "float64" $elemVal -}}
  153. {{- nindent 4 $elem }}: {{ int $elemVal -}}
  154. {{- else if kindIs "slice" $elemVal -}}
  155. {{- nindent 4 $elem -}}:
  156. {{- tpl (toYaml $elemVal ) $| nindent 4 -}}
  157. {{- else -}}
  158. {{- if $elemVal -}}
  159. {{- nindent 4 $elem }}: {{ toYaml $elemVal -}}
  160. {{- else -}}
  161. {{- nindent 4 $elem }}:
  162. {{- end -}}
  163. {{- end -}}
  164. {{- end -}}
  165. {{- end -}}
  166. {{- range $key, $value := index .Values "configmap" "app.yaml" -}}
  167. {{- if kindIs "map" $value -}}
  168. {{- nindent 4 $key -}}:
  169. {{- range $elem, $elemVal := $value -}}
  170. {{- if not (kindIs "map" $elemVal) -}}
  171. {{- if kindIs "invalid" $elemVal -}}
  172. {{- nindent 6 $elem -}}:
  173. {{- else if kindIs "string" $elemVal -}}
  174. {{- nindent 6 $elem }}: {{ tpl $elemVal $ -}}
  175. {{- else if kindIs "float64" $elemVal -}}
  176. {{- nindent 6 $elem }}: {{ int $elemVal -}}
  177. {{- else if kindIs "slice" $elemVal -}}
  178. {{- nindent 6 $elem -}}:
  179. {{- tpl (toYaml $elemVal ) $| nindent 6 -}}
  180. {{- else -}}
  181. {{- nindent 6 $elem }}: {{ $elemVal -}}
  182. {{- end -}}
  183. {{- end -}}
  184. {{- end -}}
  185. {{- range $elem, $elemVal := $value -}}
  186. {{- if kindIs "map" $elemVal -}}
  187. {{- nindent 6 $elem -}}:
  188. {{- range $therrKey, $therrVal := $elemVal -}}
  189. {{- if not (kindIs "map" $therrVal) -}}
  190. {{- if kindIs "invalid" $therrVal -}}
  191. {{- nindent 8 $therrKey -}}:
  192. {{- else if kindIs "string" $therrVal -}}
  193. {{- if (tpl $therrVal $ ) -}}
  194. {{- nindent 8 $therrKey }}: {{ tpl $therrVal $ -}}
  195. {{- else -}}
  196. {{- nindent 8 $therrKey }}:
  197. {{- end -}}
  198. {{- else if kindIs "float64" $therrVal -}}
  199. {{- nindent 8 $therrKey }}: {{ int $therrVal -}}
  200. {{- else if kindIs "slice" $therrVal -}}
  201. {{- nindent 8 $therrKey -}}:
  202. {{- tpl (toYaml $therrVal ) $| nindent 8 -}}
  203. {{- else -}}
  204. {{- if $therrVal -}}
  205. {{- nindent 8 $therrKey }}: {{ toYaml $therrVal -}}
  206. {{- else -}}
  207. {{- nindent 8 $therrKey }}:
  208. {{- end -}}
  209. {{- end -}}
  210. {{- end -}}
  211. {{- end -}}
  212. {{- range $therrKey, $therrVal := $elemVal -}}
  213. {{- if kindIs "map" $therrVal -}}
  214. {{- nindent 8 $therrKey -}}:
  215. {{- range $fourKey, $fourVal := $therrVal -}}
  216. {{- if not (kindIs "map" $fourVal) -}}
  217. {{- if kindIs "invalid" $fourVal -}}
  218. {{- nindent 10 $fourKey -}}:
  219. {{- else if kindIs "string" $fourVal -}}
  220. {{- if (tpl $fourVal $ ) -}}
  221. {{- nindent 10 $fourKey }}: {{ tpl $fourVal $ -}}
  222. {{- else -}}
  223. {{- nindent 10 $fourKey }}:
  224. {{- end -}}
  225. {{- else if kindIs "float64" $fourVal -}}
  226. {{- nindent 10 $fourKey }}: {{ int $fourVal -}}
  227. {{- else if kindIs "slice" $fourVal -}}
  228. {{- nindent 10 $fourKey -}}:
  229. {{- tpl (toYaml $fourVal ) $| nindent 10 -}}
  230. {{- else -}}
  231. {{- if $fourVal -}}
  232. {{- nindent 10 $fourKey }}: {{ toYaml $fourVal -}}
  233. {{- else -}}
  234. {{- nindent 10 $fourKey }}:
  235. {{- end -}}
  236. {{- end -}}
  237. {{- end -}}
  238. {{- end -}}
  239. {{- range $fourKey, $fourVal := $therrVal -}}
  240. {{- if kindIs "map" $fourVal -}}
  241. {{- nindent 10 $fourKey -}}:
  242. {{- range $fiveKey, $fiveVal := $fourVal -}}
  243. {{- if not (kindIs "map" $fiveVal) -}}
  244. {{- if kindIs "invalid" $fiveVal -}}
  245. {{- nindent 12 $fiveKey -}}:
  246. {{- else if kindIs "string" $fiveVal -}}
  247. {{- if $fiveVal -}}
  248. {{- nindent 12 $fiveKey }}: {{ tpl $fiveVal $ -}}
  249. {{- else -}}
  250. {{- nindent 12 $fiveKey }}:
  251. {{- end -}}
  252. {{- else if kindIs "float64" $fiveVal -}}
  253. {{- nindent 12 $fiveKey }}: {{ int $fiveVal -}}
  254. {{- else if kindIs "slice" $fiveVal -}}
  255. {{- nindent 12 $fiveKey -}}:
  256. {{- tpl (toYaml $fiveVal ) $| nindent 12 -}}
  257. {{- else -}}
  258. {{- if $fiveVal -}}
  259. {{- nindent 12 $fiveKey }}: {{ $fiveVal -}}
  260. {{- else -}}
  261. {{- nindent 12 $fiveKey }}:
  262. {{- end -}}
  263. {{- end -}}
  264. {{- end -}}
  265. {{- end -}}
  266. {{- end -}}
  267. {{- end -}}
  268. {{- end -}}
  269. {{- end -}}
  270. {{- end -}}
  271. {{- end -}}
  272. {{- end -}}
  273. {{- end }}