mirror of https://github.com/docker/docs.git
libmachine: split swarm and engine options
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
31b63a1204
commit
1691d19c9d
|
|
@ -30,6 +30,8 @@ import (
|
||||||
_ "github.com/docker/machine/drivers/vmwarevcloudair"
|
_ "github.com/docker/machine/drivers/vmwarevcloudair"
|
||||||
_ "github.com/docker/machine/drivers/vmwarevsphere"
|
_ "github.com/docker/machine/drivers/vmwarevsphere"
|
||||||
"github.com/docker/machine/libmachine"
|
"github.com/docker/machine/libmachine"
|
||||||
|
"github.com/docker/machine/libmachine/engine"
|
||||||
|
"github.com/docker/machine/libmachine/swarm"
|
||||||
"github.com/docker/machine/state"
|
"github.com/docker/machine/state"
|
||||||
"github.com/docker/machine/utils"
|
"github.com/docker/machine/utils"
|
||||||
)
|
)
|
||||||
|
|
@ -392,8 +394,9 @@ func cmdCreate(c *cli.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
hostOptions := &libmachine.HostOptions{
|
hostOptions := &libmachine.HostOptions{
|
||||||
EngineOptions: &libmachine.EngineOptions{},
|
DriverOptions: c,
|
||||||
SwarmOptions: &libmachine.SwarmOptions{
|
EngineOptions: &engine.EngineOptions{},
|
||||||
|
SwarmOptions: &swarm.SwarmOptions{
|
||||||
Master: c.GlobalBool("swarm-master"),
|
Master: c.GlobalBool("swarm-master"),
|
||||||
Discovery: c.GlobalString("swarm-discovery"),
|
Discovery: c.GlobalString("swarm-discovery"),
|
||||||
Address: c.GlobalString("swarm-addr"),
|
Address: c.GlobalString("swarm-addr"),
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package engine
|
||||||
|
|
||||||
|
type EngineOptions struct {
|
||||||
|
Dns []string
|
||||||
|
GraphDir string
|
||||||
|
Ipv6 bool
|
||||||
|
Labels []string
|
||||||
|
LogLevel string
|
||||||
|
StorageDriver string
|
||||||
|
SelinuxEnabled bool
|
||||||
|
TlsCaCert string
|
||||||
|
TlsCert string
|
||||||
|
TlsKey string
|
||||||
|
TlsVerify bool
|
||||||
|
RegistryMirror []string
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,8 @@ import (
|
||||||
|
|
||||||
log "github.com/Sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
"github.com/docker/machine/drivers"
|
"github.com/docker/machine/drivers"
|
||||||
|
"github.com/docker/machine/libmachine/engine"
|
||||||
|
"github.com/docker/machine/libmachine/swarm"
|
||||||
"github.com/docker/machine/provider"
|
"github.com/docker/machine/provider"
|
||||||
"github.com/docker/machine/ssh"
|
"github.com/docker/machine/ssh"
|
||||||
"github.com/docker/machine/state"
|
"github.com/docker/machine/state"
|
||||||
|
|
@ -44,8 +46,17 @@ type Host struct {
|
||||||
ServerKeyPath string
|
ServerKeyPath string
|
||||||
ClientCertPath string
|
ClientCertPath string
|
||||||
StorePath string
|
StorePath string
|
||||||
EngineOptions *EngineOptions
|
EngineOptions *engine.EngineOptions
|
||||||
SwarmOptions *SwarmOptions
|
SwarmOptions *swarm.SwarmOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
type HostOptions struct {
|
||||||
|
Driver string
|
||||||
|
Memory int
|
||||||
|
Disk int
|
||||||
|
DriverOptions drivers.DriverOptions
|
||||||
|
EngineOptions *engine.EngineOptions
|
||||||
|
SwarmOptions *swarm.SwarmOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
type DockerConfig struct {
|
type DockerConfig struct {
|
||||||
|
|
@ -70,7 +81,7 @@ func waitForDocker(addr string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHost(name, driverName, StorePath, caCert, privateKey string, engineOptions *EngineOptions, swarmOptions *SwarmOptions) (*Host, error) {
|
func NewHost(name, driverName, StorePath, caCert, privateKey string, engineOptions *engine.EngineOptions, swarmOptions *swarm.SwarmOptions) (*Host, error) {
|
||||||
driver, err := drivers.NewDriver(driverName, name, StorePath, caCert, privateKey)
|
driver, err := drivers.NewDriver(driverName, name, StorePath, caCert, privateKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
package libmachine
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/docker/machine/drivers"
|
|
||||||
)
|
|
||||||
|
|
||||||
type EngineOptions struct {
|
|
||||||
Dns []string
|
|
||||||
GraphDir string
|
|
||||||
Ipv6 bool
|
|
||||||
Labels []string
|
|
||||||
LogLevel string
|
|
||||||
StorageDriver string
|
|
||||||
SelinuxEnabled bool
|
|
||||||
TlsCaCert string
|
|
||||||
TlsCert string
|
|
||||||
TlsKey string
|
|
||||||
TlsVerify bool
|
|
||||||
RegistryMirror []string
|
|
||||||
}
|
|
||||||
|
|
||||||
type SwarmOptions struct {
|
|
||||||
Address string
|
|
||||||
Discovery string
|
|
||||||
Master bool
|
|
||||||
Host string
|
|
||||||
Strategy string
|
|
||||||
Heartbeat int
|
|
||||||
Overcommit float64
|
|
||||||
TlsCaCert string
|
|
||||||
TlsCert string
|
|
||||||
TlsKey string
|
|
||||||
TlsVerify bool
|
|
||||||
}
|
|
||||||
|
|
||||||
type HostOptions struct {
|
|
||||||
Driver string
|
|
||||||
Memory int
|
|
||||||
Disk int
|
|
||||||
DriverOptions drivers.DriverOptions
|
|
||||||
EngineOptions *EngineOptions
|
|
||||||
SwarmOptions *SwarmOptions
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package swarm
|
||||||
|
|
||||||
|
type SwarmOptions struct {
|
||||||
|
Address string
|
||||||
|
Discovery string
|
||||||
|
Master bool
|
||||||
|
Host string
|
||||||
|
Strategy string
|
||||||
|
Heartbeat int
|
||||||
|
Overcommit float64
|
||||||
|
TlsCaCert string
|
||||||
|
TlsCert string
|
||||||
|
TlsKey string
|
||||||
|
TlsVerify bool
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue