Merge pull request #428 from ehazlett/fix-dns-length-azure

fix issue with name and dns length in azure
This commit is contained in:
Evan Hazlett 2015-01-28 12:50:44 -05:00
commit 62f46b207f
1 changed files with 6 additions and 0 deletions

View File

@ -111,6 +111,12 @@ func NewDriver(machineName string, storePath string, caCert string, privateKey s
t := time.Now().Format("20060102150405")
name := fmt.Sprintf("%s-%s", machineName, t)
// trim name to 24 chars due to the azure dns name limit
if len(name) > 24 {
name = name[0:24]
}
driver := &Driver{MachineName: name, storePath: storePath, CaCertPath: caCert, PrivateKeyPath: privateKey}
return driver, nil
}