Add garden to root execution allow list for Concourse CI containers

- Concourse CI uses `garden` under the hood for its containers.
- Running the Homebrew Docker container for a Concourse job was failing
  with the "can't run as root" error. In the same way as
  bc320ad2291f5ec652d8f4bcf3f7b7ff3c9af3bd, this adds `garden` as one of
  the allowed providers.
This commit is contained in:
Issy Long 2019-12-17 10:25:07 +00:00
parent 4973f6707b
commit aedfbd4550
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -390,8 +390,8 @@ fi
check-run-command-as-root() {
[[ "$(id -u)" = 0 ]] || return
# Allow Azure Pipelines/Docker/Kubernetes to do everything as root (as it's normal there)
[[ -f /proc/1/cgroup ]] && grep -E "azpl_job|docker|kubepods" -q /proc/1/cgroup && return
# Allow Azure Pipelines/Docker/Concourse/Kubernetes to do everything as root (as it's normal there)
[[ -f /proc/1/cgroup ]] && grep -E "azpl_job|docker|garden|kubepods" -q /proc/1/cgroup && return
# Homebrew Services may need `sudo` for system-wide daemons.
[[ "$HOMEBREW_COMMAND" = "services" ]] && return