mirror of
https://github.com/docker/compose.git
synced 2025-07-30 09:04:12 +02:00
Error out for contexts not implementing compose command
Signed-off-by: aiordache <anca.iordache@docker.com>
This commit is contained in:
parent
df9f93cf18
commit
cfd6d2f5d1
@ -18,6 +18,7 @@ package mobycli
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
@ -51,6 +52,12 @@ func mustDelegateToMoby(ctxType string) bool {
|
|||||||
|
|
||||||
// Exec delegates to com.docker.cli if on moby context
|
// Exec delegates to com.docker.cli if on moby context
|
||||||
func Exec(ctx context.Context) {
|
func Exec(ctx context.Context) {
|
||||||
|
if os.Args[1] == "compose" {
|
||||||
|
// command is not implemented for moby or aws context
|
||||||
|
fmt.Fprintln(os.Stderr, errors.New("'compose' command is not implemented for the context in use"))
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
cmd := exec.CommandContext(ctx, ComDockerCli, os.Args[1:]...)
|
cmd := exec.CommandContext(ctx, ComDockerCli, os.Args[1:]...)
|
||||||
cmd.Stdin = os.Stdin
|
cmd.Stdin = os.Stdin
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
|
Loading…
x
Reference in New Issue
Block a user