concourse / concourse-bosh-release

Concourse BOSH release
Apache License 2.0
28 stars 49 forks source link

add CONCOURSE_CONTAINERD_INIT_BIN #123

Closed muntac closed 4 years ago

muntac commented 4 years ago

Part of: concourse/concourse#5984

Changed in this PR The CONCOURSE_CONTAINERD_INIT_BIN needs to point to /var/vcap/packages/concourse/bin/init specifically on BOSH when running containerd.

This should only be set when using containerd as the runtime. Currently, that means checking if the runtime property is set to "containerd" explicitly.

In the future when the concourse binary will default to containerd when no runtime property is set we also need to check if runtime is nil.

Notes to reviewer This will be easier to test with the bosh-template gem.

gem install bosh-template

Scenario 1

bosh-template jobs/worker/templates/env.sh.erb --context '{"id":"abc123-123abc", "properties":{"runtime":"containerd", "containerd": {"init_bin_path":"something"}}}'

Result:
export CONCOURSE_CONTAINERD_INIT_BIN=something

Scenario 2

bosh-template jobs/worker/templates/env.sh.erb --context '{"id":"abc123-123abc", "properties":{"runtime":"containerd"}}'

Result: export CONCOURSE_CONTAINERD_INIT_BIN/var/vcap/packages/concourse/bin/init

Scenario 3 bosh-template jobs/worker/templates/env.sh.erb --context '{"id":"abc123-123abc", "properties":{}}' Result: CONCOURSE_CONTAINERD_INIT_BIN will not be set