Merge pull request #1889 from helderco/socket-rename

Rename `dagger.#Service` to `dagger.#Socket`
This commit is contained in:
Helder Correia 2022-03-28 18:03:30 +00:00 committed by GitHub
commit e304abf246
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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):
return "dagger.#FS"
case plancontext.IsServiceValue(val):
return "dagger.#Service"
return "dagger.#Socket"
}
if val.IsConcreteR() != nil {

View File

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

View File

@ -6,7 +6,7 @@ import (
)
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 & {
host: client.filesystem."/var/run/docker.sock".read.contents

View File

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

View File

@ -1,6 +1,6 @@
dagger.#Plan & {
client: filesystem: "//./pipe/docker_engine": read: {
contents: dagger.#Service
contents: dagger.#Socket
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"
contents: #TempDir
} | {
type: "service"
contents: dagger.#Service
type: "socket"
contents: dagger.#Socket
} | {
type: "fs"
contents: dagger.#FS

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -170,7 +170,7 @@ func (t clientFilesystemReadTask) readService(pctx *plancontext.Context, v *comp
case "npipe":
npipe = path
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)

View File

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

View File

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

View File

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

View File

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

View File

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