mirror of
https://github.com/rancher/os.git
synced 2025-09-02 07:15:41 +00:00
move dependencies to vendor
This commit is contained in:
58
vendor/github.com/docker/libcompose/cli/docker/app/commands.go
generated
vendored
Normal file
58
vendor/github.com/docker/libcompose/cli/docker/app/commands.go
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/docker/libcompose/docker"
|
||||
)
|
||||
|
||||
// DockerClientFlags defines the flags that are specific to the docker client,
|
||||
// like configdir or tls related flags.
|
||||
func DockerClientFlags() []cli.Flag {
|
||||
return []cli.Flag{
|
||||
cli.BoolFlag{
|
||||
Name: "tls",
|
||||
Usage: "Use TLS; implied by --tlsverify",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "tlsverify",
|
||||
Usage: "Use TLS and verify the remote",
|
||||
EnvVar: "DOCKER_TLS_VERIFY",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "tlscacert",
|
||||
Usage: "Trust certs signed only by this CA",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "tlscert",
|
||||
Usage: "Path to TLS certificate file",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "tlskey",
|
||||
Usage: "Path to TLS key file",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "configdir",
|
||||
Usage: "Path to docker config dir, default ${HOME}/.docker",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Populate updates the specified docker context based on command line arguments and subcommands.
|
||||
func Populate(context *docker.Context, c *cli.Context) {
|
||||
context.ConfigDir = c.String("configdir")
|
||||
|
||||
opts := docker.ClientOpts{}
|
||||
opts.TLS = c.GlobalBool("tls")
|
||||
opts.TLSVerify = c.GlobalBool("tlsverify")
|
||||
opts.TLSOptions.CAFile = c.GlobalString("tlscacert")
|
||||
opts.TLSOptions.CertFile = c.GlobalString("tlscert")
|
||||
opts.TLSOptions.KeyFile = c.GlobalString("tlskey")
|
||||
|
||||
clientFactory, err := docker.NewDefaultClientFactory(opts)
|
||||
if err != nil {
|
||||
logrus.Fatalf("Failed to construct Docker client: %v", err)
|
||||
}
|
||||
|
||||
context.ClientFactory = clientFactory
|
||||
}
|
23
vendor/github.com/docker/libcompose/cli/docker/app/factory.go
generated
vendored
Normal file
23
vendor/github.com/docker/libcompose/cli/docker/app/factory.go
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/docker/libcompose/cli/command"
|
||||
"github.com/docker/libcompose/cli/logger"
|
||||
"github.com/docker/libcompose/docker"
|
||||
"github.com/docker/libcompose/project"
|
||||
)
|
||||
|
||||
// ProjectFactory is a struct that hold the app.ProjectFactory implementation.
|
||||
type ProjectFactory struct {
|
||||
}
|
||||
|
||||
// Create implements ProjectFactory.Create using docker client.
|
||||
func (p *ProjectFactory) Create(c *cli.Context) (*project.Project, error) {
|
||||
context := &docker.Context{}
|
||||
context.LoggerFactory = logger.NewColorLoggerFactory()
|
||||
Populate(context, c)
|
||||
command.Populate(&context.Context, c)
|
||||
|
||||
return docker.NewProject(context)
|
||||
}
|
Reference in New Issue
Block a user