|
| 1 | +# Because we are passing through some yaml directly to Kubernetes resources, we have to retain the camelCase keys. |
| 2 | +# All CR parameters are converted to snake_case, but the original yaml is found in the special _kiali_io_kiali param. |
| 3 | +# We need to copy that original yaml into our vars where appropriate to keep the camelCase. |
| 4 | + |
| 5 | +- name: Replace snake_case with camelCase in deployment.affinity.node |
| 6 | + set_fact: |
| 7 | + kiali_vars: | |
| 8 | + {% set a=kiali_vars['deployment']['affinity'].pop('node') %} |
| 9 | + {{ kiali_vars | combine({'deployment': {'affinity': {'node': current_cr.spec.deployment.affinity.node }}}, recursive=True) }} |
| 10 | + when: |
| 11 | + - kiali_vars.deployment.affinity is defined |
| 12 | + - kiali_vars.deployment.affinity.node is defined |
| 13 | + - kiali_vars.deployment.affinity.node | length > 0 |
| 14 | + |
| 15 | +- name: Replace snake_case with camelCase in deployment.affinity.pod |
| 16 | + set_fact: |
| 17 | + kiali_vars: | |
| 18 | + {% set a=kiali_vars['deployment']['affinity'].pop('pod') %} |
| 19 | + {{ kiali_vars | combine({'deployment': {'affinity': {'pod': current_cr.spec.deployment.affinity.pod }}}, recursive=True) }} |
| 20 | + when: |
| 21 | + - kiali_vars.deployment.affinity is defined |
| 22 | + - kiali_vars.deployment.affinity.pod is defined |
| 23 | + - kiali_vars.deployment.affinity.pod | length > 0 |
| 24 | + |
| 25 | +- name: Replace snake_case with camelCase in deployment.affinity.pod_anti |
| 26 | + set_fact: |
| 27 | + kiali_vars: | |
| 28 | + {% set a=kiali_vars['deployment']['affinity'].pop('pod_anti') %} |
| 29 | + {{ kiali_vars | combine({'deployment': {'affinity': {'pod_anti': current_cr.spec.deployment.affinity.pod_anti }}}, recursive=True) }} |
| 30 | + when: |
| 31 | + - kiali_vars.deployment.affinity is defined |
| 32 | + - kiali_vars.deployment.affinity.pod_anti is defined |
| 33 | + - kiali_vars.deployment.affinity.pod_anti | length > 0 |
| 34 | + |
| 35 | +- name: Replace snake_case with camelCase in deployment.tolerations |
| 36 | + set_fact: |
| 37 | + kiali_vars: | |
| 38 | + {% set a=kiali_vars['deployment'].pop('tolerations') %} |
| 39 | + {{ kiali_vars | combine({'deployment': {'tolerations': current_cr.spec.deployment.tolerations }}, recursive=True) }} |
| 40 | + when: |
| 41 | + - kiali_vars.deployment.tolerations is defined |
| 42 | + - kiali_vars.deployment.tolerations | length > 0 |
| 43 | + |
| 44 | +- name: Replace snake_case with camelCase in deployment.additional_service_yaml |
| 45 | + set_fact: |
| 46 | + kiali_vars: | |
| 47 | + {% set a=kiali_vars['deployment'].pop('additional_service_yaml') %} |
| 48 | + {{ kiali_vars | combine({'deployment': {'additional_service_yaml': current_cr.spec.deployment.additional_service_yaml }}, recursive=True) }} |
| 49 | + when: |
| 50 | + - kiali_vars.deployment.additional_service_yaml is defined |
| 51 | + - kiali_vars.deployment.additional_service_yaml | length > 0 |
| 52 | + |
| 53 | +- name: Replace snake_case with camelCase in deployment.resources |
| 54 | + set_fact: |
| 55 | + kiali_vars: | |
| 56 | + {% set a=kiali_vars['deployment'].pop('resources') %} |
| 57 | + {{ kiali_vars | combine({'deployment': {'resources': current_cr.spec.deployment.resources }}, recursive=True) }} |
| 58 | + when: |
| 59 | + - kiali_vars.deployment.resources is defined |
| 60 | + - kiali_vars.deployment.resources | length > 0 |
| 61 | + |
| 62 | +- name: Replace snake_case with camelCase in deployment.ingress.override_yaml |
| 63 | + set_fact: |
| 64 | + kiali_vars: | |
| 65 | + {% set a=kiali_vars['deployment']['ingress'].pop('override_yaml') %} |
| 66 | + {{ kiali_vars | combine({'deployment': {'ingress': {'override_yaml': current_cr.spec.deployment.ingress.override_yaml }}}, recursive=True) }} |
| 67 | + when: |
| 68 | + - kiali_vars.deployment.ingress.override_yaml is defined |
| 69 | + - kiali_vars.deployment.ingress.override_yaml | length > 0 |
| 70 | + |
| 71 | +- name: Replace snake_case with camelCase in deployment.pod_annotations |
| 72 | + set_fact: |
| 73 | + kiali_vars: | |
| 74 | + {% set a=kiali_vars['deployment'].pop('pod_annotations') %} |
| 75 | + {{ kiali_vars | combine({'deployment': {'pod_annotations': current_cr.spec.deployment.pod_annotations }}, recursive=True) }} |
| 76 | + when: |
| 77 | + - kiali_vars.deployment.pod_annotations is defined |
| 78 | + - kiali_vars.deployment.pod_annotations | length > 0 |
| 79 | + |
| 80 | +- name: Replace snake_case with camelCase in deployment.pod_labels |
| 81 | + set_fact: |
| 82 | + kiali_vars: | |
| 83 | + {% set a=kiali_vars['deployment'].pop('pod_labels') %} |
| 84 | + {{ kiali_vars | combine({'deployment': {'pod_labels': current_cr.spec.deployment.pod_labels }}, recursive=True) }} |
| 85 | + when: |
| 86 | + - kiali_vars.deployment.pod_labels is defined |
| 87 | + - kiali_vars.deployment.pod_labels | length > 0 |
| 88 | + |
| 89 | +- name: Replace snake_case with camelCase in deployment.service_annotations |
| 90 | + set_fact: |
| 91 | + kiali_vars: | |
| 92 | + {% set a=kiali_vars['deployment'].pop('service_annotations') %} |
| 93 | + {{ kiali_vars | combine({'deployment': {'service_annotations': current_cr.spec.deployment.service_annotations }}, recursive=True) }} |
| 94 | + when: |
| 95 | + - kiali_vars.deployment.service_annotations is defined |
| 96 | + - kiali_vars.deployment.service_annotations | length > 0 |
| 97 | + |
| 98 | +- name: Replace snake_case with camelCase in deployment.hpa.spec |
| 99 | + set_fact: |
| 100 | + kiali_vars: | |
| 101 | + {% set a=kiali_vars['deployment']['hpa'].pop('spec') %} |
| 102 | + {{ kiali_vars | combine({'deployment': {'hpa': {'spec': current_cr.spec.deployment.hpa.spec }}}, recursive=True) }} |
| 103 | + when: |
| 104 | + - kiali_vars.deployment.hpa is defined |
| 105 | + - kiali_vars.deployment.hpa.spec is defined |
| 106 | + - kiali_vars.deployment.hpa.spec | length > 0 |
| 107 | + |
| 108 | +- name: Replace snake_case with camelCase in deployment.node_selector |
| 109 | + set_fact: |
| 110 | + kiali_vars: | |
| 111 | + {% set a=kiali_vars['deployment'].pop('node_selector') %} |
| 112 | + {{ kiali_vars | combine({'deployment': {'node_selector': current_cr.spec.deployment.node_selector }}, recursive=True) }} |
| 113 | + when: |
| 114 | + - kiali_vars.deployment.node_selector is defined |
| 115 | + - kiali_vars.deployment.node_selector | length > 0 |
| 116 | + |
| 117 | +- name: Replace snake_case with camelCase in external_services.custom_dashboards.prometheus.custom_headers |
| 118 | + set_fact: |
| 119 | + kiali_vars: | |
| 120 | + {% set a=kiali_vars['external_services']['custom_dashboards']['prometheus'].pop('custom_headers') %} |
| 121 | + {{ kiali_vars | combine({'external_services': {'custom_dashboards': {'prometheus': {'custom_headers': current_cr.spec.external_services.custom_dashboards.prometheus.custom_headers }}}}, recursive=True) }} |
| 122 | + when: |
| 123 | + - kiali_vars.external_services.custom_dashboards.prometheus.custom_headers is defined |
| 124 | + - kiali_vars.external_services.custom_dashboards.prometheus.custom_headers | length > 0 |
| 125 | + |
| 126 | +- name: Replace snake_case with camelCase in external_services.custom_dashboards.prometheus.query_scope |
| 127 | + set_fact: |
| 128 | + kiali_vars: | |
| 129 | + {% set a=kiali_vars['external_services']['custom_dashboards']['prometheus'].pop('query_scope') %} |
| 130 | + {{ kiali_vars | combine({'external_services': {'custom_dashboards': {'prometheus': {'query_scope': current_cr.spec.external_services.custom_dashboards.prometheus.query_scope }}}}, recursive=True) }} |
| 131 | + when: |
| 132 | + - kiali_vars.external_services.custom_dashboards.prometheus.query_scope is defined |
| 133 | + - kiali_vars.external_services.custom_dashboards.prometheus.query_scope | length > 0 |
| 134 | + |
| 135 | +- name: Replace snake_case with camelCase in external_services.prometheus.custom_headers |
| 136 | + set_fact: |
| 137 | + kiali_vars: | |
| 138 | + {% set a=kiali_vars['external_services']['prometheus'].pop('custom_headers') %} |
| 139 | + {{ kiali_vars | combine({'external_services': {'prometheus': {'custom_headers': current_cr.spec.external_services.prometheus.custom_headers }}}, recursive=True) }} |
| 140 | + when: |
| 141 | + - kiali_vars.external_services.prometheus.custom_headers is defined |
| 142 | + - kiali_vars.external_services.prometheus.custom_headers | length > 0 |
| 143 | + |
| 144 | +- name: Replace snake_case with camelCase in external_services.prometheus.query_scope |
| 145 | + set_fact: |
| 146 | + kiali_vars: | |
| 147 | + {% set a=kiali_vars['external_services']['prometheus'].pop('query_scope') %} |
| 148 | + {{ kiali_vars | combine({'external_services': {'prometheus': {'query_scope': current_cr.spec.external_services.prometheus.query_scope }}}, recursive=True) }} |
| 149 | + when: |
| 150 | + - kiali_vars.external_services.prometheus.query_scope is defined |
| 151 | + - kiali_vars.external_services.prometheus.query_scope | length > 0 |
| 152 | + |
| 153 | +- name: Replace snake_case with camelCase in deployment.configmap_annotations |
| 154 | + set_fact: |
| 155 | + kiali_vars: | |
| 156 | + {% set a=kiali_vars['deployment'].pop('configmap_annotations') %} |
| 157 | + {{ kiali_vars | combine({'deployment': {'configmap_annotations': current_cr.spec.deployment.configmap_annotations }}, recursive=True) }} |
| 158 | + when: |
| 159 | + - kiali_vars.deployment.configmap_annotations is defined |
| 160 | + - kiali_vars.deployment.configmap_annotations | length > 0 |
| 161 | + |
| 162 | +- name: Replace snake_case with camelCase in deployment.additional_pod_containers_yaml |
| 163 | + set_fact: |
| 164 | + kiali_vars: | |
| 165 | + {% set a=kiali_vars['deployment'].pop('additional_pod_containers_yaml') %} |
| 166 | + {{ kiali_vars | combine({'deployment': {'additional_pod_containers_yaml': current_cr.spec.deployment.additional_pod_containers_yaml }}, recursive=True) }} |
| 167 | + when: |
| 168 | + - kiali_vars.deployment.additional_pod_containers_yaml is defined |
| 169 | + - kiali_vars.deployment.additional_pod_containers_yaml | length > 0 |
0 commit comments