Move connecting socket to client: network

Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
This commit is contained in:
Helder Correia
2022-03-28 18:06:46 +00:00
parent 75a3ae4204
commit d771699df9
15 changed files with 117 additions and 67 deletions

View File

@@ -23,6 +23,11 @@ package dagger
}
}
// Access client network endpoints
network: [address=#Address]: _#clientNetwork & {
"address": address
}
// Access client environment variables
env: _#clientEnv
@@ -65,13 +70,6 @@ _#clientFilesystemRead: {
// Filename patterns to exclude
// Example: ["node_modules"]
exclude?: [...string]
} | {
// CUE type defines expected content:
// #Socket: unix socket or npipe
contents: #Socket
// Type of service
type: *"unix" | "npipe"
}
}
@@ -93,6 +91,22 @@ _#clientFilesystemWrite: {
}
}
_#clientNetwork: {
$dagger: task: _name: "ClientNetwork"
// URL to the socket
// Example: unix:///var/run/docker.sock
address: #Address
{
// unix socket or npipe
connect: #Socket
// } | {
// // FIXME: not yet implemented
// listen: #Socket
}
}
_#clientEnv: {
$dagger: task: _name: "ClientEnv"

View File

@@ -34,4 +34,5 @@ package dagger
}
// A network service address
#Address: string & =~"^(tcp://|unix://|udp://).*"
#Address: string & =~"^(unix://|npipe://).+"
// TODO: #Address: string & =~"^(tcp://|unix://|npipe://|udp://).+"