Rename dagger.#Service to dagger.#Socket

Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
This commit is contained in:
Helder Correia 2022-03-28 17:54:08 +00:00
parent 4058d56f1b
commit 6a2bbc62e0
No known key found for this signature in database
GPG Key ID: C6490D872EF1DCA7
19 changed files with 25 additions and 21 deletions

View File

@ -24,7 +24,7 @@ func FormatValue(val *compiler.Value) string {
case plancontext.IsFSValue(val): case plancontext.IsFSValue(val):
return "dagger.#FS" return "dagger.#FS"
case plancontext.IsServiceValue(val): case plancontext.IsServiceValue(val):
return "dagger.#Service" return "dagger.#Socket"
} }
if val.IsConcreteR() != nil { if val.IsConcreteR() != nil {

View File

@ -7,7 +7,7 @@ import (
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket
actions: { actions: {
build: docker.#Build & { build: docker.#Build & {

View File

@ -6,7 +6,7 @@ import (
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket
actions: run: cli.#Run & { actions: run: cli.#Run & {
host: client.filesystem."/var/run/docker.sock".read.contents host: client.filesystem."/var/run/docker.sock".read.contents

View File

@ -1,5 +1,5 @@
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket
actions: { actions: {
image: alpine.#Build & { image: alpine.#Build & {

View File

@ -1,6 +1,6 @@
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "//./pipe/docker_engine": read: { client: filesystem: "//./pipe/docker_engine": read: {
contents: dagger.#Service contents: dagger.#Socket
type: "npipe" type: "npipe"
} }

View File

@ -0,0 +1,4 @@
package dagger
// DEPRECATED: Use #Socket instead
#Service: #Socket

View File

@ -55,8 +55,8 @@ import "dagger.io/dagger"
type: "tmp" type: "tmp"
contents: #TempDir contents: #TempDir
} | { } | {
type: "service" type: "socket"
contents: dagger.#Service contents: dagger.#Socket
} | { } | {
type: "fs" type: "fs"
contents: dagger.#FS contents: dagger.#FS

View File

@ -67,8 +67,8 @@ _#clientFilesystemRead: {
exclude?: [...string] exclude?: [...string]
} | { } | {
// CUE type defines expected content: // CUE type defines expected content:
// #Service: unix socket or npipe // #Socket: unix socket or npipe
contents: #Service contents: #Socket
// Type of service // Type of service
type: *"unix" | "npipe" type: *"unix" | "npipe"

View File

@ -26,10 +26,10 @@ package dagger
} }
// A reference to a network service endpoint, for example: // A reference to a network service endpoint, for example:
// - A TCP or UDP port
// - A unix socket // - A unix socket
// - A TCP or UDP port
// - An HTTPS endpoint // - An HTTPS endpoint
#Service: { #Socket: {
$dagger: service: _id: string $dagger: service: _id: string
} }

View File

@ -20,7 +20,7 @@ import (
// Connect via local docker socket // Connect via local docker socket
#RunSocket: { #RunSocket: {
host: dagger.#Service host: dagger.#Socket
docker.#Run & { docker.#Run & {
mounts: docker: { mounts: docker: {

View File

@ -10,7 +10,7 @@ import (
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket
actions: test: { actions: test: {
_cli: alpine.#Build & { _cli: alpine.#Build & {

View File

@ -8,7 +8,7 @@ import (
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket
actions: test: { actions: test: {
run: cli.#Run & { run: cli.#Run & {

View File

@ -20,7 +20,7 @@ import (
// Expose network ports // Expose network ports
// FIXME: investigate feasibility // FIXME: investigate feasibility
ports: [name=string]: { ports: [name=string]: {
frontend: dagger.#Service frontend: dagger.#Socket
backend: { backend: {
protocol: *"tcp" | "udp" protocol: *"tcp" | "udp"
address: string address: string

View File

@ -170,7 +170,7 @@ func (t clientFilesystemReadTask) readService(pctx *plancontext.Context, v *comp
case "npipe": case "npipe":
npipe = path npipe = path
default: default:
return nil, fmt.Errorf("invalid service type %q", typ) return nil, fmt.Errorf("invalid socket type %q", typ)
} }
service := pctx.Services.New(unix, npipe) service := pctx.Services.New(unix, npipe)

View File

@ -175,7 +175,7 @@ func (t execTask) mount(pctx *plancontext.Context, dest string, mnt *compiler.Va
return t.mountCache(pctx, dest, mnt) return t.mountCache(pctx, dest, mnt)
case "tmp": case "tmp":
return t.mountTmp(pctx, dest, mnt) return t.mountTmp(pctx, dest, mnt)
case "service": case "socket":
return t.mountService(pctx, dest, mnt) return t.mountService(pctx, dest, mnt)
case "fs": case "fs":
return t.mountFS(pctx, dest, mnt) return t.mountFS(pctx, dest, mnt)

View File

@ -6,7 +6,7 @@ import (
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "/var/run/docker.soc": read: contents: dagger.#Service client: filesystem: "/var/run/docker.soc": read: contents: dagger.#Socket
actions: { actions: {
image: core.#Pull & { image: core.#Pull & {

View File

@ -6,7 +6,7 @@ import (
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket
actions: { actions: {
image: core.#Pull & { image: core.#Pull & {

View File

@ -6,7 +6,7 @@ import (
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "//./pipe/docker_engine": read: contents: dagger.#Service client: filesystem: "//./pipe/docker_engine": read: contents: dagger.#Socket
actions: { actions: {
image: core.#Pull & { image: core.#Pull & {

View File

@ -6,7 +6,7 @@ import (
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket
actions: { actions: {
image: core.#Pull & { image: core.#Pull & {