Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
2.17.12
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelgatelement committed Apr 23, 2024
1 parent abf8668 commit a45f673
Show file tree
Hide file tree
Showing 21 changed files with 105 additions and 99 deletions.
4 changes: 2 additions & 2 deletions helm/operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.17.11
version: 2.17.12

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 2.17.11
appVersion: 2.17.12
4 changes: 2 additions & 2 deletions helm/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ crds:
imagePullPolicy: Always
image:
repository: docker.io/vectorim/ess-core-operator-conversion-webhook
tag: 2.17.11
tag: 2.17.12

operator:
extraPodSpec:
Expand Down Expand Up @@ -69,7 +69,7 @@ operator:
imagePullPolicy: Always
image:
repository: docker.io/vectorim/ess-core-operator
tag: 2.17.11
tag: 2.17.12

rbacProxy:
resources:
Expand Down
4 changes: 2 additions & 2 deletions helm/updater/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.17.11
version: 2.17.12

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 2.17.11
appVersion: 2.17.12
4 changes: 2 additions & 2 deletions helm/updater/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ crds:
imagePullPolicy: Always
image:
repository: docker.io/vectorim/ess-core-updater-conversion-webhook
tag: 2.17.11
tag: 2.17.12

updater:
extraPodSpec:
Expand Down Expand Up @@ -69,7 +69,7 @@ updater:
- ALL
image:
repository: docker.io/vectorim/ess-core-updater
tag: 2.17.11
tag: 2.17.12

rbacProxy:
resources:
Expand Down
2 changes: 1 addition & 1 deletion roles/elementdeployment/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ansible.builtin.include_role:
name: "generic_apply"
vars:
_rendered_manifests_strings: "{{ _all_components_manifests_content }}"
_rendered_manifests_strings: "{{ [_all_components_manifests_content] }}"
when: "_all_components_manifests_content | length > 0"

- name: "Finalising tasks"
Expand Down
31 changes: 18 additions & 13 deletions roles/elementdeployment/tasks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,22 @@
input: "{{ _global_secret }}"

- name: "Build all components manifests"
ansible.builtin.set_fact:
_all_components_manifests_content: >-
{{
_all_components_manifests_content | default([]) + (
query('template', *_manifest_template_filenames)
)
}}
vars:
_manifest_template_filenames: "{{ query('fileglob', 'templates/' + _component_item + '/*.j2') | sort | list }}"
when: "_manifest_template_filenames | length > 0"
loop: "{{ components.keys() | sort_apply_order | list }}"
loop_control:
loop_var: _component_item
label: _component_item
# We cannot use `{% set _component_item = ... %}` because the variable used in the set is not reachable outside of jinja engine
# and ansible cannot use the macros defined in defaults.
# Instead we use a magic variable injected by ansible into the jinja engine
# https://github.com/ansible/ansible/blob/devel/lib/ansible/template/__init__.py#L105
_component_item: "{{ template_path | dirname | basename }}"
ansible.builtin.set_fact:
_all_components_manifests_content: |
{% for _comp in components %}
{% set _manifest_template_filenames = query('fileglob', 'templates/' + _comp + '/*.j2') | sort | list %}
{% if _manifest_template_filenames | length > 0 %}
{% for _template in query('template', *_manifest_template_filenames) %}
{% if _template | select | length > 0 %}
{{ _template }}
---
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
12 changes: 6 additions & 6 deletions roles/elementdeployment/templates/element_web/elementweb.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ metadata:
name: "{{ ansible_operator_meta.name }}"
namespace: "{{ ansible_operator_meta.namespace }}"
spec:
{{ lookup('template', 'templates/any/k8s-image.yaml.j2') | indent(2) }}
{{ lookup('template', 'templates/any/k8s-workloads.yaml.j2') | indent(2) }}
{{ lookup('template', 'templates/any/k8s-image.yaml.j2', template_vars={'_component_item': _component_item}) | indent(2) }}
{{ lookup('template', 'templates/any/k8s-workloads.yaml.j2', template_vars={'_component_item': _component_item}) | indent(2) }}
ingress:
{{ lookup('template', 'templates/any/k8s-ingress.yaml.j2', template_vars={'_tls_secret': 'element-tls-secret'}) | indent(4) }}
{{ lookup('template', 'templates/any/k8s-ingress.yaml.j2', template_vars={'_component_item': _component_item, '_tls_secret': 'element-tls-secret'}) | indent(4) }}
service:
{{ lookup('template', 'templates/any/k8s-services.yaml.j2') | indent(4) }}
{{ lookup('template', 'templates/any/k8s-services.yaml.j2', template_vars={'_component_item': _component_item}) | indent(4) }}
config:
{{ lookup('template', 'templates/any/k8s-config.yaml.j2') | indent(4) }}
{{ lookup('template', 'templates/any/k8s-config.yaml.j2', template_vars={'_component_item': _component_item}) | indent(4) }}
defaultMatrixServer:
baseUrl: {{ components.synapse.k8s.ingress.fqdn }}
serverName: {{ _global.config.domain_name }}
{% set _config_template_files = query('fileglob', 'templates/element_web/config/*.json.j2') | sort %}
{% set _additional_configs = query('template', *_config_template_files, convert_data=false) | select | map('trim') | select | map('from_json') %}
{% set _additional_configs = query('template', *_config_template_files, convert_data=false, template_vars={'_component_item': _component_item}) | select | map('trim') | select | map('from_json') %}
{% if _additional_configs | length > 0 %}
additional: |
{{ ({} | combine(_additional_configs, recursive=true) | to_nice_json(indent=2) | indent(6) | trim)[1:-1] }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{#
Copyright 2023 New Vector Ltd
Copyright 2023-2024 New Vector Ltd
SPDX-License-Identifier: AGPL-3.0-or-later
#}

{{ lookup('template', 'templates/any/tls-secrets.yaml.j2', template_vars={'_tls_secret': 'element-tls-secret'}) }}
{{ lookup('template', 'templates/any/tls-secrets.yaml.j2', template_vars={'_component_item': _component_item, '_tls_secret': 'element-tls-secret'}) }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ metadata:
name: "{{ ansible_operator_meta.name }}"
namespace: "{{ ansible_operator_meta.namespace }}"
annotations:
k8s.element.io/secretshash: "{{ lookup('template', 'matrix_content_scanner/secrets.yaml.j2') | hash('sha1') }}"
k8s.element.io/secretshash: "{{ lookup('template', 'matrix_content_scanner/secrets.yaml.j2', template_vars={'_component_item': _component_item}) | hash('sha1') }}"
spec:
image:
{{ lookup('template', 'templates/any/k8s-image.yaml.j2', template_vars={'_subcomponent':'matrix_content_scanner'})
{{ lookup('template', 'templates/any/k8s-image.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent':'matrix_content_scanner'})
| regex_replace('image:', 'matrixContentScanner:') | indent(4) }}
{{ lookup('template', 'templates/any/k8s-image.yaml.j2', template_vars={'_subcomponent':'clam_anti_virus'})
{{ lookup('template', 'templates/any/k8s-image.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent':'clam_anti_virus'})
| regex_replace('image:', 'clamAntiVirus:') | indent(4) }}
{{ lookup('template', 'templates/any/k8s-image.yaml.j2', template_vars={'_subcomponent':'icap'})
{{ lookup('template', 'templates/any/k8s-image.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent':'icap'})
| regex_replace('image:', 'icap:') | indent(4) }}
workloads:
{{ lookup('template', 'templates/any/k8s-workloads.yaml.j2', template_vars={'_subcomponent':'matrix_content_scanner'})
{{ lookup('template', 'templates/any/k8s-workloads.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent':'matrix_content_scanner'})
| regex_replace('workloads:', 'matrixContentScanner:') | indent(4) }}
{{ lookup('template', 'templates/any/k8s-workloads.yaml.j2', template_vars={'_subcomponent':'clam_anti_virus'})
{{ lookup('template', 'templates/any/k8s-workloads.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent':'clam_anti_virus'})
| regex_replace('workloads:', 'clamAntiVirus:') | indent(4) }}
service:
{{ lookup('template', 'templates/any/k8s-services.yaml.j2') | indent(4) }}
{{ lookup('template', 'templates/any/k8s-services.yaml.j2', template_vars={'_component_item': _component_item}) | indent(4) }}
config:
matrixContentScanner:
{{ lookup('template', 'templates/any/k8s-config.yaml.j2', template_vars={'_subcomponent':'matrix_content_scanner'}) | indent(6) }}
{{ lookup('template', 'templates/any/k8s-config.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent':'matrix_content_scanner'}) | indent(6) }}
clamAntiVirus:
{{ lookup('template', 'templates/any/k8s-config.yaml.j2', template_vars={'_subcomponent':'clam_anti_virus'}) | indent(6) }}
{{ lookup('template', 'templates/any/k8s-config.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent':'clam_anti_virus'}) | indent(6) }}
volumeClaim: {{ ansible_operator_meta.name }}-matrix-content-scanner
icap:
{{ lookup('template', 'templates/any/k8s-config.yaml.j2', template_vars={'_subcomponent':'icap'})
{{ lookup('template', 'templates/any/k8s-config.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent':'icap'})
| from_yaml
| ansible.utils.remove_keys(target=['podSecurityContext'])
| to_nice_yaml(indent=2)
| indent(6) }}
{{ lookup('template', 'templates/any/k8s-host-aliases.yaml.j2') | indent(4) }}
{{ lookup('template', 'templates/any/k8s-host-aliases.yaml.j2', template_vars={'_component_item': _component_item}) | indent(4) }}
externalSecret:
name: {{ ansible_operator_meta.name }}-matrix-content-scanner-secrets
matrixServer:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{#
Copyright 2023 New Vector Ltd
Copyright 2023-2024 New Vector Ltd
SPDX-License-Identifier: AGPL-3.0-or-later
#}

{{ lookup('template', 'templates/any/pvc.yaml.j2', template_vars={'_subcomponent': 'clam_anti_virus'}) }}
{{ lookup('template', 'templates/any/pvc.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent': 'clam_anti_virus'}) }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{#
Copyright 2023 New Vector Ltd
Copyright 2023-2024 New Vector Ltd
SPDX-License-Identifier: AGPL-3.0-or-later
#}

{{ lookup('template', 'templates/any/tls-secrets.yaml.j2', template_vars={'_tls_secret': 'matrix-content-scanner-tls-secret'}) }}
{{ lookup('template', 'templates/any/tls-secrets.yaml.j2', template_vars={'_component_item': _component_item, '_tls_secret': 'matrix-content-scanner-tls-secret'}) }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{#
Copyright 2023 New Vector Ltd
Copyright 2023-2024 New Vector Ltd
SPDX-License-Identifier: AGPL-3.0-or-later
#}

{{ lookup('template', 'sliding_sync/service_monitor/service_monitor.yaml.j2', template_vars={'_subcomponent': 'api'}) }}
{{ lookup('template', 'sliding_sync/service_monitor/service_monitor.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent': 'api'}) }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ metadata:
name: "{{ ansible_operator_meta.name }}"
namespace: "{{ ansible_operator_meta.namespace }}"
annotations:
k8s.element.io/secretshash: "{{ lookup('template', 'sliding_sync/secrets.yaml.j2') | hash('sha1') }}"
k8s.element.io/secretshash: "{{ lookup('template', 'sliding_sync/secrets.yaml.j2', template_vars={'_component_item': _component_item}) | hash('sha1') }}"
spec:
image:
{{ lookup('template', 'templates/any/k8s-image.yaml.j2', template_vars={'_subcomponent':'api'})
{{ lookup('template', 'templates/any/k8s-image.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent':'api'})
| regex_replace('image:', 'api:') | indent(6) }}
workloads:
{{ lookup('template', 'templates/any/k8s-workloads.yaml.j2', template_vars={'_subcomponent':'api'})
{{ lookup('template', 'templates/any/k8s-workloads.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent':'api'})
| regex_replace('workloads:', 'api:')
| indent(4) }}
ingress:
{{ lookup('template', 'templates/any/k8s-ingress.yaml.j2', template_vars={'_tls_secret': 'sliding-sync-tls-secret'}) | indent(4) }}
{{ lookup('template', 'templates/any/k8s-ingress.yaml.j2', template_vars={'_component_item': _component_item, '_tls_secret': 'sliding-sync-tls-secret'}) | indent(4) }}
service:
{{ lookup('template', 'templates/any/k8s-services.yaml.j2') | indent(4) }}
{{ lookup('template', 'templates/any/k8s-services.yaml.j2', template_vars={'_component_item': _component_item}) | indent(4) }}
config:
api:
{{ lookup('template', 'templates/any/k8s-config.yaml.j2', template_vars={'_subcomponent':'api'})
{{ lookup('template', 'templates/any/k8s-config.yaml.j2', template_vars={'_component_item': _component_item, '_subcomponent':'api'})
| indent(6) }}
log:
level: {{ components.sliding_sync.config.log.level }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{#
Copyright 2023 New Vector Ltd
Copyright 2023-2024 New Vector Ltd
SPDX-License-Identifier: AGPL-3.0-or-later
#}

{{ lookup('template', 'templates/any/tls-secrets.yaml.j2', template_vars={'_tls_secret': 'sliding-sync-tls-secret'}) }}
{{ lookup('template', 'templates/any/tls-secrets.yaml.j2', template_vars={'_component_item': _component_item, '_tls_secret': 'sliding-sync-tls-secret'}) }}
4 changes: 2 additions & 2 deletions roles/elementdeployment/templates/synapse/secrets.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ data:
{% endif %}
{% endfor %}
{% set _config_template_files = (query('fileglob', 'templates/synapse/bootstrap/*.yml.j2') + query('fileglob', 'templates/synapse/config/*.yml.j2')) | sort %}
{% set _additional_configs = query('template', *_config_template_files, convert_data=false) | select | map('trim') | select | map('from_yaml') %}
{% set _additional_configs = query('template', *_config_template_files, convert_data=false, template_vars={'_component_item': _component_item}) | select | map('trim') | select | map('from_yaml') %}
{% if _additional_configs | length > 0 %}
shared.yaml: {{ {} | combine(_additional_configs, recursive=true) | to_nice_yaml(indent=2) | b64encode }}
{% endif %}
{% set _bootstrap_template_files = query('fileglob', 'templates/synapse/bootstrap/*.yml.j2') | sort %}
{% set _additional_bootstraps = query('template', *_bootstrap_template_files, convert_data=false) | select | map('trim') | select | map('from_yaml') %}
{% set _additional_bootstraps = query('template', *_bootstrap_template_files, convert_data=false, template_vars={'_component_item': _component_item}) | select | map('trim') | select | map('from_yaml') %}
{% if _additional_bootstraps | length > 0 %}
bootstrap.yaml: {{ {} | combine(_additional_bootstraps, recursive=true) | to_nice_yaml(indent=2) | b64encode }}
{% endif %}
Loading

0 comments on commit a45f673

Please sign in to comment.