Skip to content

Commit a4906fc

Browse files
committed
fix: set container name when calling DockerRunOnceWithStream
1 parent 6a7de83 commit a4906fc

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

internal/db/diff/diff.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ func DiffSchema(ctx context.Context, source, target string, schema []string, p u
8383
nil,
8484
args,
8585
nil,
86+
"",
8687
stream.Stdout(),
8788
stream.Stderr(),
8889
); err != nil {
@@ -97,6 +98,7 @@ func DiffSchema(ctx context.Context, source, target string, schema []string, p u
9798
nil,
9899
append([]string{"--schema", s}, args...),
99100
nil,
101+
"",
100102
stream.Stdout(),
101103
stream.Stderr(),
102104
); err != nil {

internal/functions/serve/serve.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ func runServeAll(ctx context.Context, envFilePath string, noVerifyJWT *bool, imp
295295
append(env, userEnv...),
296296
[]string{"start", "--dir", relayFuncDir, "-p", "8081"},
297297
binds,
298+
utils.DenoRelayId,
298299
os.Stdout,
299300
os.Stderr,
300301
); err != nil {

internal/utils/docker.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ func DockerRunOnce(ctx context.Context, image string, env []string, cmd []string
302302
stderr = os.Stderr
303303
}
304304
var out bytes.Buffer
305-
err := DockerRunOnceWithStream(ctx, image, env, cmd, nil, &out, stderr)
305+
err := DockerRunOnceWithStream(ctx, image, env, cmd, nil, "", &out, stderr)
306306
return out.String(), err
307307
}
308308

309-
func DockerRunOnceWithStream(ctx context.Context, image string, env, cmd, binds []string, stdout, stderr io.Writer) error {
309+
func DockerRunOnceWithStream(ctx context.Context, image string, env, cmd, binds []string, containerName string, stdout, stderr io.Writer) error {
310310
// Cannot rely on docker's auto remove because
311311
// 1. We must inspect exit code after container stops
312312
// 2. Context cancellation may happen after start
@@ -318,7 +318,7 @@ func DockerRunOnceWithStream(ctx context.Context, image string, env, cmd, binds
318318
Binds: binds,
319319
// Allows containerized functions on Linux to reach host OS
320320
ExtraHosts: []string{"host.docker.internal:host-gateway"},
321-
}, "")
321+
}, containerName)
322322
if err != nil {
323323
return err
324324
}

0 commit comments

Comments
 (0)