Skip to content

Commit

Permalink
salt: set 1 env var per line in containerd unit
Browse files Browse the repository at this point in the history
For the sake of clarity, we set 1 env variable
per line, instead of all the variables on a single
`Environment` entry in the containerd unit file

Refs: #2052
  • Loading branch information
alexandre-allard committed Jan 22, 2020
1 parent fcddd41 commit 0f55466
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# See https://github.com/containerd/containerd/issues/3201
# See https://github.com/containerd/containerd/pull/3202
LimitNOFILE=1048576
Environment="{{ environment }}"
{%- for key, value in (environment | default({}, True)).items() %}
Environment={{ key }}={{ value }}
{%- endfor %}
8 changes: 4 additions & 4 deletions salt/metalk8s/container-engine/containerd/installed.sls
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ Create containerd service drop-in:
- makedirs: true
- dir_mode: 0755
- context:
environment: >-
environment:
{%- if proxies %}
{%- set no_proxy = ["localhost", "127.0.0.1"] + networks.values() %}
{%- if proxies.no_proxy | default %}
{%- do no_proxy.extend(proxies.no_proxy) %}
{%- endif %}
NO_PROXY={{ no_proxy | unique | join(",") }}
NO_PROXY: "{{ no_proxy | unique | join(",") }}"
{%- if proxies.http | default %}
HTTP_PROXY={{ proxies.http }}
HTTP_PROXY: "{{ proxies.http }}"
{%- endif %}
{%- if proxies.https | default %}
HTTPS_PROXY={{ proxies.https }}
HTTPS_PROXY: "{{ proxies.https }}"
{%- endif %}
{%- endif %}
Expand Down

0 comments on commit 0f55466

Please sign in to comment.