From b9c428cf7ed4a804444d56e0f8260e23f22530d4 Mon Sep 17 00:00:00 2001 From: Helder Correia <174525+helderco@users.noreply.github.com> Date: Mon, 4 Apr 2022 14:04:46 +0000 Subject: [PATCH] Fix mounts in `cli.#Run` Moving the `if`s inside the fields avoids some issues. Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com> --- pkg/universe.dagger.io/docker/cli/client.cue | 45 +++++++++++--------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/pkg/universe.dagger.io/docker/cli/client.cue b/pkg/universe.dagger.io/docker/cli/client.cue index 0dae3c43..61b3930a 100644 --- a/pkg/universe.dagger.io/docker/cli/client.cue +++ b/pkg/universe.dagger.io/docker/cli/client.cue @@ -51,17 +51,18 @@ import ( docker.#Run & { env: DOCKER_HOST: host - if ssh.key != _|_ { - mounts: ssh_key: { - dest: "/root/.ssh/id_rsa" - contents: ssh.key + mounts: { + if ssh.key != _|_ { + ssh_key: { + dest: "/root/.ssh/id_rsa" + contents: ssh.key + } } - } - - if ssh.knownHosts != _|_ { - mounts: ssh_hosts: { - dest: "/root/.ssh/known_hosts" - contents: ssh.knownHosts + if ssh.knownHosts != _|_ { + ssh_hosts: { + dest: "/root/.ssh/known_hosts" + contents: ssh.knownHosts + } } } } @@ -71,21 +72,25 @@ import ( #RunTCP: { host: =~"^tcp://.+" + // Directory with certificates to verify ({ca,cert,key}.pem files). + // This enables HTTPS. + certs?: dagger.#FS + docker.#Run & { - env: DOCKER_HOST: host + env: { + DOCKER_HOST: host - // Directory with certificates to verify ({ca,cert,key}.pem files). - // This enables HTTPS. - certs?: dagger.#FS - - if certs != _|_ { - env: { + if certs != _|_ { DOCKER_TLS_VERIFY: "1" DOCKER_CERT_PATH: "/certs/client" } - mounts: "certs": { - dest: "/certs/client" - contents: certs + } + mounts: { + if certs != _|_ { + "certs": { + dest: "/certs/client" + contents: certs + } } } }