)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":28719,"name":"Phil Sphicas","email":"phil.sphicas@att.com","username":"ps3910"},"change_message_id":"a8ef2bc3ee72214ef2694abba589cea14e0105ff","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Sangeet Gupta \u003csg774j@att.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2020-06-26 15:51:18 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[WIP] HTK: Change formatting of TLS Secret"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Changed TLS secret to include CA in tls.crt if present"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"bf51134e_a9334262","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":6},"updated":"2020-06-30 17:42:36.000000000","message":"remove WIP if ready","commit_id":"33d6cd4da56f4fb37cfa9bf85bf5751093a3bf8a"}],"helm-toolkit/templates/manifests/_secret-tls.yaml.tpl":[{"author":{"_account_id":28719,"name":"Phil Sphicas","email":"phil.sphicas@att.com","username":"ps3910"},"change_message_id":"b5667de1abeb7182472e1a3f9b43711bad0e38cc","unresolved":false,"context_lines":[{"line_number":66,"context_line":"type: kubernetes.io/tls"},{"line_number":67,"context_line":"data:"},{"line_number":68,"context_line":"  tls.key: {{ $endpointHost.tls.key | b64enc }}"},{"line_number":69,"context_line":"{{- if $endpointHost.tls.ca }}"},{"line_number":70,"context_line":"  tls.crt: {{ list $endpointHost.tls.crt $endpointHost.tls.ca | join \"\\n\" | b64enc }}"},{"line_number":71,"context_line":"{{- else }}"},{"line_number":72,"context_line":"  tls.crt: {{ $endpointHost.tls.crt | b64enc }}"},{"line_number":73,"context_line":"{{- end }}"},{"line_number":74,"context_line":"{{- end }}"},{"line_number":75,"context_line":"{{- end }}"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"bf51134e_8f70db74","line":72,"range":{"start_line":69,"start_character":0,"end_line":72,"end_character":47},"updated":"2020-06-17 07:26:32.000000000","message":"I wonder if we should do some extra whitespace handling to ensure consistency. The inputs to the chart might reasonably be supplied as:\n\n    tls.crt: |-\n      -----BEGIN_CERTIFICATE-----\n      -----END_CERTIFICATE-----\n    tls.ca: |-\n      -----BEGIN_CERTIFICATE-----\n      -----END_CERTIFICATE-----\n      -----BEGIN_CERTIFICATE-----\n      -----END_CERTIFICATE-----\nor\n    tls.crt: |\n      -----BEGIN_CERTIFICATE-----\n      -----END_CERTIFICATE-----\n    tls.ca: |\n      -----BEGIN_CERTIFICATE-----\n      -----END_CERTIFICATE-----\n      -----BEGIN_CERTIFICATE-----\n      -----END_CERTIFICATE-----\n\nWhen doing the join, it would be nice to make sure that there is not an extra newline between the cert and the rest of the chain, and that there is always a newline at the very end.\n\nOne possibility (slightly aggressive, as it will remove anything between END and BEGIN lines, even non-whitespace):\n\n    {{- $certchain :\u003d list ($endpointHost.tls.crt | trim) ($endpointHost.tls.ca | default \"\" | trim) | join \"\\n\" | trim }}\n\n    {{/* could change \u0027.*?\u0027 to \u0027\\n*\u0027 in regex */}}\n    {{- $certchain \u003d regexReplaceAll \"(?s)(-----END CERTIFICATE-----).*?(-----BEGIN CERTIFICATE-----)\" $certchain \"${1}\\n${2}\" }}\n\n      tls.crt: {{ printf \"%s\\n\" $certchain | b64enc }}","commit_id":"b0a00c75ad856a801fb3389a92b88ca9608b6cbe"},{"author":{"_account_id":16771,"name":"mpolenchuk","email":"mpolenchuk@mirantis.com","username":"mpolenchuk"},"change_message_id":"43d30ac7f8cd356db9b0c4a7b1079124efd3b7b3","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    name: barbican-tls-public"},{"line_number":43,"context_line":"  type: kubernetes.io/tls"},{"line_number":44,"context_line":"  data:"},{"line_number":45,"context_line":"    tls.crt: Rk9PLUNSVAo\u003d"},{"line_number":46,"context_line":"    tls.key: Rk9PLUtFWQo\u003d"},{"line_number":47,"context_line":"    ca.crt: Rk9PLUNBX0NSVAo\u003d"},{"line_number":48,"context_line":"*/}}"}],"source_content_type":"text/x-smarty","patch_set":6,"id":"bf51134e_5fcd2a64","line":45,"range":{"start_line":45,"start_character":4,"end_line":45,"end_character":25},"updated":"2020-07-15 06:19:16.000000000","message":"tls.crt should be changed to\nRk9PLUNSVApGT08tQ0FfQ1JUCg\u003d\u003d\nand below ca.crt removed","commit_id":"f43b7e61b48d02feff0fac9c6437023eaa46d89a"},{"author":{"_account_id":8863,"name":"Andrii Ostapenko","email":"anost1986@gmail.com","username":"aostapenko"},"change_message_id":"a6c129f2c47fbe19f0468a2107a63c1a889518e7","unresolved":false,"context_lines":[{"line_number":66,"context_line":"type: kubernetes.io/tls"},{"line_number":67,"context_line":"data:"},{"line_number":68,"context_line":"  tls.key: {{ $endpointHost.tls.key | b64enc }}"},{"line_number":69,"context_line":"{{- $certchain :\u003d list ($endpointHost.tls.crt | trim) ($endpointHost.tls.ca | default \"\" | trim) | join \"\\n\" | trim }}"},{"line_number":70,"context_line":"{{- $certchain \u003d regexReplaceAll \"(?s)(-----END CERTIFICATE-----).*?(-----BEGIN CERTIFICATE-----)\" $certchain \"${1}\\n${2}\" }}"},{"line_number":71,"context_line":"  tls.crt: {{ printf \"%s\\n\" $certchain | b64enc }}"},{"line_number":72,"context_line":"{{- end }}"},{"line_number":73,"context_line":"{{- end }}"},{"line_number":74,"context_line":"{{- end }}"}],"source_content_type":"text/x-smarty","patch_set":6,"id":"bf51134e_25a03c42","line":71,"range":{"start_line":69,"start_character":0,"end_line":71,"end_character":50},"updated":"2020-07-14 05:11:17.000000000","message":"this is as robust as it\u0027s painful. i\u0027m sure the same can be achieved easier","commit_id":"f43b7e61b48d02feff0fac9c6437023eaa46d89a"},{"author":{"_account_id":8863,"name":"Andrii Ostapenko","email":"anost1986@gmail.com","username":"aostapenko"},"change_message_id":"41103a3c978719d9fbd25fbd819e0197412c6c6b","unresolved":false,"context_lines":[{"line_number":66,"context_line":"type: kubernetes.io/tls"},{"line_number":67,"context_line":"data:"},{"line_number":68,"context_line":"  tls.key: {{ $endpointHost.tls.key | b64enc }}"},{"line_number":69,"context_line":"{{- $certchain :\u003d list ($endpointHost.tls.crt | trim) ($endpointHost.tls.ca | default \"\" | trim) | join \"\\n\" | trim }}"},{"line_number":70,"context_line":"{{- $certchain \u003d regexReplaceAll \"(?s)(-----END CERTIFICATE-----).*?(-----BEGIN CERTIFICATE-----)\" $certchain \"${1}\\n${2}\" }}"},{"line_number":71,"context_line":"  tls.crt: {{ printf \"%s\\n\" $certchain | b64enc }}"},{"line_number":72,"context_line":"{{- end }}"},{"line_number":73,"context_line":"{{- end }}"},{"line_number":74,"context_line":"{{- end }}"}],"source_content_type":"text/x-smarty","patch_set":6,"id":"bf51134e_f72c379a","line":71,"range":{"start_line":69,"start_character":0,"end_line":71,"end_character":50},"in_reply_to":"bf51134e_25a03c42","updated":"2020-07-14 05:42:15.000000000","message":"simple\ntls.crt: {{ printf \"%s\\n%s\" (trim $endpointHost.tls.crt) (trim $endpointHost.tls.ca) | b64enc }} worked for me, newlines were removed by trim as well. Maybe we\u0027re doing different things though.","commit_id":"f43b7e61b48d02feff0fac9c6437023eaa46d89a"},{"author":{"_account_id":16771,"name":"mpolenchuk","email":"mpolenchuk@mirantis.com","username":"mpolenchuk"},"change_message_id":"88f3e538c5cd2118858f9c6d7126db562bd90ee5","unresolved":false,"context_lines":[{"line_number":66,"context_line":"type: kubernetes.io/tls"},{"line_number":67,"context_line":"data:"},{"line_number":68,"context_line":"  tls.key: {{ $endpointHost.tls.key | b64enc }}"},{"line_number":69,"context_line":"{{- $certchain :\u003d list ($endpointHost.tls.crt | trim) ($endpointHost.tls.ca | default \"\" | trim) | join \"\\n\" | trim }}"},{"line_number":70,"context_line":"{{- $certchain \u003d regexReplaceAll \"(?s)(-----END CERTIFICATE-----).*?(-----BEGIN CERTIFICATE-----)\" $certchain \"${1}\\n${2}\" }}"},{"line_number":71,"context_line":"  tls.crt: {{ printf \"%s\\n\" $certchain | b64enc }}"},{"line_number":72,"context_line":"{{- end }}"},{"line_number":73,"context_line":"{{- end }}"},{"line_number":74,"context_line":"{{- end }}"}],"source_content_type":"text/x-smarty","patch_set":6,"id":"bf51134e_ffb97015","line":71,"range":{"start_line":69,"start_character":0,"end_line":71,"end_character":50},"in_reply_to":"bf51134e_3f9f9650","updated":"2020-07-17 10:57:10.000000000","message":"tested the above line, works like a charm","commit_id":"f43b7e61b48d02feff0fac9c6437023eaa46d89a"},{"author":{"_account_id":16771,"name":"mpolenchuk","email":"mpolenchuk@mirantis.com","username":"mpolenchuk"},"change_message_id":"b153e4f2763637b15de21242ea150371ecf988f7","unresolved":false,"context_lines":[{"line_number":66,"context_line":"type: kubernetes.io/tls"},{"line_number":67,"context_line":"data:"},{"line_number":68,"context_line":"  tls.key: {{ $endpointHost.tls.key | b64enc }}"},{"line_number":69,"context_line":"{{- $certchain :\u003d list ($endpointHost.tls.crt | trim) ($endpointHost.tls.ca | default \"\" | trim) | join \"\\n\" | trim }}"},{"line_number":70,"context_line":"{{- $certchain \u003d regexReplaceAll \"(?s)(-----END CERTIFICATE-----).*?(-----BEGIN CERTIFICATE-----)\" $certchain \"${1}\\n${2}\" }}"},{"line_number":71,"context_line":"  tls.crt: {{ printf \"%s\\n\" $certchain | b64enc }}"},{"line_number":72,"context_line":"{{- end }}"},{"line_number":73,"context_line":"{{- end }}"},{"line_number":74,"context_line":"{{- end }}"}],"source_content_type":"text/x-smarty","patch_set":6,"id":"bf51134e_3f9f9650","line":71,"range":{"start_line":69,"start_character":0,"end_line":71,"end_character":50},"in_reply_to":"bf51134e_f72c379a","updated":"2020-07-15 06:17:09.000000000","message":"how about this?\ntls.crt: {{ printf \"%s%s\" $endpointHost.tls.crt ($endpointHost.tls.ca | default \"\") | trim | b64enc }}","commit_id":"f43b7e61b48d02feff0fac9c6437023eaa46d89a"},{"author":{"_account_id":8863,"name":"Andrii Ostapenko","email":"anost1986@gmail.com","username":"aostapenko"},"change_message_id":"7c81e292ce396108bc06222112fd5c119dad03fc","unresolved":false,"context_lines":[{"line_number":66,"context_line":"type: kubernetes.io/tls"},{"line_number":67,"context_line":"data:"},{"line_number":68,"context_line":"  tls.key: {{ $endpointHost.tls.key | b64enc }}"},{"line_number":69,"context_line":"{{- $certchain :\u003d list ($endpointHost.tls.crt | trim) ($endpointHost.tls.ca | default \"\" | trim) | join \"\\n\" | trim }}"},{"line_number":70,"context_line":"{{- $certchain \u003d regexReplaceAll \"(?s)(-----END CERTIFICATE-----).*?(-----BEGIN CERTIFICATE-----)\" $certchain \"${1}\\n${2}\" }}"},{"line_number":71,"context_line":"  tls.crt: {{ printf \"%s\\n\" $certchain | b64enc }}"},{"line_number":72,"context_line":"{{- end }}"},{"line_number":73,"context_line":"{{- end }}"},{"line_number":74,"context_line":"{{- end }}"}],"source_content_type":"text/x-smarty","patch_set":6,"id":"bf51134e_b3544f00","line":71,"range":{"start_line":69,"start_character":0,"end_line":71,"end_character":50},"in_reply_to":"bf51134e_ffb97015","updated":"2020-07-17 14:29:22.000000000","message":"So we had a discussion on it and would rather consider\nhttps://review.opendev.org/#/c/734702/3/helm-toolkit/templates/manifests/_secret-tls.yaml.tpl\n@Phil what do you think?","commit_id":"f43b7e61b48d02feff0fac9c6437023eaa46d89a"},{"author":{"_account_id":16771,"name":"mpolenchuk","email":"mpolenchuk@mirantis.com","username":"mpolenchuk"},"change_message_id":"eb3a92fb8419b680ce93d8fb659d74b986dd0c18","unresolved":false,"context_lines":[{"line_number":96,"context_line":"type: kubernetes.io/tls"},{"line_number":97,"context_line":"data:"},{"line_number":98,"context_line":"  tls.key: {{ $endpointHost.tls.key | b64enc }}"},{"line_number":99,"context_line":"{{- if $endpointHost.tls.ca }}"},{"line_number":100,"context_line":"  tls.crt: {{ list $endpointHost.tls.crt $endpointHost.tls.ca | join \"\\n\" | b64enc }}"},{"line_number":101,"context_line":"{{- else }}"},{"line_number":102,"context_line":"  tls.crt: {{ $endpointHost.tls.crt | b64enc }}"},{"line_number":103,"context_line":"{{- end }}"},{"line_number":104,"context_line":"{{- end }}"},{"line_number":105,"context_line":"{{- end }}"},{"line_number":106,"context_line":"{{- end }}"}],"source_content_type":"text/x-smarty","patch_set":10,"id":"bf51134e_e3dfeb09","line":103,"range":{"start_line":99,"start_character":0,"end_line":103,"end_character":10},"updated":"2020-07-21 16:19:12.000000000","message":"this could be done in one line","commit_id":"80dfaef9eb9a6a2fd9f07848b7cfeca2c55b2fab"}]}
