Skip to content

Commit

Permalink
no need for object, list is fine
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k committed Apr 30, 2024
1 parent 7e4dd49 commit d986b56
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ix-dev/enterprise/minio/templates/docker-compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,15 @@ services:
- --quiet
{% endif %}
volumes:
{% set v = namespace(volumes=[]) %}
{% set vols = namespace([]) %}
{% for data in data.storage.data %}
{% set v.volumes = v.volumes + [data.mountPath] %}
{% if data.type == 'hostPath' %}
{% set vols = vols + [data.mountPath] %}
- {{ "%s:%s" | format(data.hostPathConfig.path, data.mountPath) }}
{% endif %}
{% endfor %}
environment:
MINIO_ROOT_USER: {{ data.minio.access_key }}
MINIO_ROOT_PASSWORD: {{ data.minio.secret_key }}
MINIO_VOLUMES: {{ v.volumes | join(' ') }}
MINIO_VOLUMES: {{ vols | join(' ') }}
{% if data.minio.server_url %}
MINIO_SERVER_URL: {{ data.minio.server_url }}
{% endif %}
Expand Down Expand Up @@ -129,17 +127,18 @@ services:
permissions:
image: bash
volumes:
{% set hostVols = namespace([]) %}
{% for data in data.storage.data %}
{% if data.type == 'hostPath' %}
{% set ns.volumes = ns.volumes + [data.mountPath] %}
{% set hostVols = hostVols + [data.mountPath] %}
- {{ "%s:%s" | format(data.hostPathConfig.path, data.mountPath) }}
{% endif %}
{% endfor %}
entrypoint: bash
command:
- -c
- |
for vol in {{ ns.volumes | join(' ') }}; do
for vol in {{ hostVols | join(' ') }}; do
chown -R {{ data.minio.user }}:{{ data.minio.group }} $$vol
done

Expand Down

0 comments on commit d986b56

Please sign in to comment.