In more recent versions of Cobra, `--help` parsing is done before anything else resulting in TestDaemonCommand not actually passing. I'm actually unsure if this test ever passed since it appears that !daemon is not being run as part of the test suite. Signed-off-by: Aleksa Sarai <asarai@suse.de> Upstream-commit: dd7159060f60ea04007c069df189a29fda2c655f Component: engine
30 lines
539 B
Go
30 lines
539 B
Go
// +build !daemon
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
"strings"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func newDaemonCommand() *cobra.Command {
|
|
return &cobra.Command{
|
|
Use: "daemon",
|
|
Hidden: true,
|
|
Args: cobra.ArbitraryArgs,
|
|
DisableFlagParsing: true,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
return runDaemon()
|
|
},
|
|
}
|
|
}
|
|
|
|
func runDaemon() error {
|
|
return fmt.Errorf(
|
|
"`docker daemon` is not supported on %s. Please run `dockerd` directly",
|
|
strings.Title(runtime.GOOS))
|
|
}
|