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>
This commit is contained in:
parent
7dbe4e9aa5
commit
b9c428cf7e
@ -51,17 +51,18 @@ import (
|
|||||||
docker.#Run & {
|
docker.#Run & {
|
||||||
env: DOCKER_HOST: host
|
env: DOCKER_HOST: host
|
||||||
|
|
||||||
if ssh.key != _|_ {
|
mounts: {
|
||||||
mounts: ssh_key: {
|
if ssh.key != _|_ {
|
||||||
dest: "/root/.ssh/id_rsa"
|
ssh_key: {
|
||||||
contents: ssh.key
|
dest: "/root/.ssh/id_rsa"
|
||||||
|
contents: ssh.key
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if ssh.knownHosts != _|_ {
|
||||||
|
ssh_hosts: {
|
||||||
if ssh.knownHosts != _|_ {
|
dest: "/root/.ssh/known_hosts"
|
||||||
mounts: ssh_hosts: {
|
contents: ssh.knownHosts
|
||||||
dest: "/root/.ssh/known_hosts"
|
}
|
||||||
contents: ssh.knownHosts
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,21 +72,25 @@ import (
|
|||||||
#RunTCP: {
|
#RunTCP: {
|
||||||
host: =~"^tcp://.+"
|
host: =~"^tcp://.+"
|
||||||
|
|
||||||
|
// Directory with certificates to verify ({ca,cert,key}.pem files).
|
||||||
|
// This enables HTTPS.
|
||||||
|
certs?: dagger.#FS
|
||||||
|
|
||||||
docker.#Run & {
|
docker.#Run & {
|
||||||
env: DOCKER_HOST: host
|
env: {
|
||||||
|
DOCKER_HOST: host
|
||||||
|
|
||||||
// Directory with certificates to verify ({ca,cert,key}.pem files).
|
if certs != _|_ {
|
||||||
// This enables HTTPS.
|
|
||||||
certs?: dagger.#FS
|
|
||||||
|
|
||||||
if certs != _|_ {
|
|
||||||
env: {
|
|
||||||
DOCKER_TLS_VERIFY: "1"
|
DOCKER_TLS_VERIFY: "1"
|
||||||
DOCKER_CERT_PATH: "/certs/client"
|
DOCKER_CERT_PATH: "/certs/client"
|
||||||
}
|
}
|
||||||
mounts: "certs": {
|
}
|
||||||
dest: "/certs/client"
|
mounts: {
|
||||||
contents: certs
|
if certs != _|_ {
|
||||||
|
"certs": {
|
||||||
|
dest: "/certs/client"
|
||||||
|
contents: certs
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user