mirror of https://github.com/docker/docs.git
tls fixes to support swarm; test updates; improved provisioning logging
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
a73deea5d0
commit
557d03a849
|
@ -273,6 +273,8 @@ func (d *Driver) Create() error {
|
|||
return err
|
||||
}
|
||||
|
||||
log.Info("Configuring Machine...")
|
||||
|
||||
log.Debug("Settings tags for instance")
|
||||
tags := map[string]string{
|
||||
"Name": d.MachineName,
|
||||
|
@ -594,6 +596,8 @@ func (d *Driver) configureSecurityGroup(groupName string) error {
|
|||
|
||||
d.SecurityGroupId = securityGroup.GroupId
|
||||
|
||||
// configure swarm permission if needed
|
||||
|
||||
log.Debugf("configuring security group authorization for %s", ipRange)
|
||||
|
||||
perms := configureSecurityGroupPermissions(securityGroup)
|
||||
|
|
|
@ -11,7 +11,6 @@ import (
|
|||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/digitalocean/godo"
|
||||
// "github.com/docker/docker/utils"
|
||||
"github.com/docker/machine/drivers"
|
||||
"github.com/docker/machine/ssh"
|
||||
"github.com/docker/machine/state"
|
||||
|
@ -156,6 +155,8 @@ func (d *Driver) Create() error {
|
|||
return err
|
||||
}
|
||||
|
||||
log.Info("Configuring Machine...")
|
||||
|
||||
log.Debugf("Setting hostname: %s", d.MachineName)
|
||||
cmd, err := d.GetSSHCommand(fmt.Sprintf(
|
||||
"echo \"127.0.0.1 %s\" | sudo tee -a /etc/hosts && sudo hostname %s && echo \"%s\" | sudo tee /etc/hostname",
|
||||
|
|
|
@ -196,6 +196,8 @@ func (c *ComputeUtil) createInstance(d *Driver) error {
|
|||
return err
|
||||
}
|
||||
|
||||
log.Info("Configuring Machine...")
|
||||
|
||||
log.Debugf("Setting hostname: %s", d.MachineName)
|
||||
cmd, err := d.GetSSHCommand(fmt.Sprintf(
|
||||
"echo \"127.0.0.1 %s\" | sudo tee -a /etc/hosts && sudo hostname %s && echo \"%s\" | sudo tee /etc/hostname",
|
||||
|
|
|
@ -62,7 +62,7 @@ func (c *GenericClient) CreateInstance(d *Driver) (string, error) {
|
|||
|
||||
log.WithFields(log.Fields{
|
||||
"Name": d.MachineName,
|
||||
}).Info("Creating server...")
|
||||
}).Info("Creating machine...")
|
||||
|
||||
server, err := servers.Create(c.Compute, keypairs.CreateOptsExt{
|
||||
serverOpts,
|
||||
|
|
|
@ -390,6 +390,8 @@ func (d *Driver) Create() error {
|
|||
return err
|
||||
}
|
||||
|
||||
log.Info("Configuring Machine...")
|
||||
|
||||
log.Debugf("Setting hostname: %s", d.MachineName)
|
||||
cmd, err := d.GetSSHCommand(fmt.Sprintf(
|
||||
"echo \"127.0.0.1 %s\" | sudo tee -a /etc/hosts && sudo hostname %s && echo \"%s\" | sudo tee /etc/hostname",
|
||||
|
|
5
host.go
5
host.go
|
@ -161,10 +161,7 @@ func (h *Host) ConfigureSwarm(discovery string, master bool, host string, addr s
|
|||
if err := cmd.Run(); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO:
|
||||
// - configure swarm to start / autostart
|
||||
// - configure node to join cluster
|
||||
// - configure node to run with IP of machine and URL to Docker
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
2
store.go
2
store.go
|
@ -69,7 +69,7 @@ func (s *Store) Create(name string, driverName string, flags drivers.DriverOptio
|
|||
}
|
||||
|
||||
if flags.Bool("swarm") {
|
||||
log.Info("Configuring Swarm")
|
||||
log.Info("Configuring Swarm...")
|
||||
|
||||
discovery := flags.String("swarm-discovery")
|
||||
master := flags.Bool("swarm-master")
|
||||
|
|
|
@ -36,7 +36,9 @@ func TestStoreCreate(t *testing.T) {
|
|||
|
||||
flags := &DriverOptionsMock{
|
||||
Data: map[string]interface{}{
|
||||
"url": "unix:///var/run/docker.sock",
|
||||
"url": "unix:///var/run/docker.sock",
|
||||
"swarm-master-ip": "",
|
||||
"swarm": false,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -62,7 +64,9 @@ func TestStoreRemove(t *testing.T) {
|
|||
|
||||
flags := &DriverOptionsMock{
|
||||
Data: map[string]interface{}{
|
||||
"url": "unix:///var/run/docker.sock",
|
||||
"url": "unix:///var/run/docker.sock",
|
||||
"swarm-master-ip": "",
|
||||
"swarm": false,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -91,7 +95,9 @@ func TestStoreList(t *testing.T) {
|
|||
|
||||
flags := &DriverOptionsMock{
|
||||
Data: map[string]interface{}{
|
||||
"url": "unix:///var/run/docker.sock",
|
||||
"url": "unix:///var/run/docker.sock",
|
||||
"swarm-master-ip": "",
|
||||
"swarm": false,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -116,7 +122,9 @@ func TestStoreExists(t *testing.T) {
|
|||
|
||||
flags := &DriverOptionsMock{
|
||||
Data: map[string]interface{}{
|
||||
"url": "unix:///var/run/docker.sock",
|
||||
"url": "unix:///var/run/docker.sock",
|
||||
"swarm-master-ip": "",
|
||||
"swarm": false,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -146,7 +154,9 @@ func TestStoreLoad(t *testing.T) {
|
|||
expectedURL := "unix:///foo/baz"
|
||||
flags := &DriverOptionsMock{
|
||||
Data: map[string]interface{}{
|
||||
"url": expectedURL,
|
||||
"url": expectedURL,
|
||||
"swarm-master-ip": "",
|
||||
"swarm": false,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -177,7 +187,9 @@ func TestStoreGetSetActive(t *testing.T) {
|
|||
|
||||
flags := &DriverOptionsMock{
|
||||
Data: map[string]interface{}{
|
||||
"url": "unix:///var/run/docker.sock",
|
||||
"url": "unix:///var/run/docker.sock",
|
||||
"swarm-master-ip": "",
|
||||
"swarm": false,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -93,9 +93,10 @@ func GenerateCert(hosts []string, certFile, keyFile, caFile, caKeyFile, org stri
|
|||
}
|
||||
// client
|
||||
if len(hosts) == 1 && hosts[0] == "" {
|
||||
template.ExtKeyUsage = []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}
|
||||
template.ExtKeyUsage = []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth}
|
||||
template.KeyUsage = x509.KeyUsageDigitalSignature
|
||||
} else { // server
|
||||
template.ExtKeyUsage = []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}
|
||||
for _, h := range hosts {
|
||||
if ip := net.ParseIP(h); ip != nil {
|
||||
template.IPAddresses = append(template.IPAddresses, ip)
|
||||
|
|
Loading…
Reference in New Issue