Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1850)

Side by Side Diff: provider/local/environ.go

Issue 94410043: Use lxc clone by default (Closed)
Patch Set: Use lxc clone by default Created 9 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013, 2014 Canonical Ltd. 1 // Copyright 2013, 2014 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package local 4 package local
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 "net" 8 "net"
9 "os" 9 "os"
10 "os/exec" 10 "os/exec"
11 "path/filepath" 11 "path/filepath"
12 "regexp" 12 "regexp"
13 "strconv"
14 "strings" 13 "strings"
15 "sync" 14 "sync"
16 "syscall" 15 "syscall"
17 16
18 "github.com/errgo/errgo" 17 "github.com/errgo/errgo"
19 18
20 "launchpad.net/juju-core/agent" 19 "launchpad.net/juju-core/agent"
21 "launchpad.net/juju-core/agent/mongo" 20 "launchpad.net/juju-core/agent/mongo"
22 coreCloudinit "launchpad.net/juju-core/cloudinit" 21 coreCloudinit "launchpad.net/juju-core/cloudinit"
23 "launchpad.net/juju-core/cloudinit/sshinit" 22 "launchpad.net/juju-core/cloudinit/sshinit"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 env.localMutex.Lock() 232 env.localMutex.Lock()
234 defer env.localMutex.Unlock() 233 defer env.localMutex.Unlock()
235 env.config = ecfg 234 env.config = ecfg
236 env.name = ecfg.Name() 235 env.name = ecfg.Name()
237 containerType := ecfg.container() 236 containerType := ecfg.container()
238 managerConfig := container.ManagerConfig{ 237 managerConfig := container.ManagerConfig{
239 container.ConfigName: env.config.namespace(), 238 container.ConfigName: env.config.namespace(),
240 container.ConfigLogDir: env.config.logDir(), 239 container.ConfigLogDir: env.config.logDir(),
241 } 240 }
242 if containerType == instance.LXC { 241 if containerType == instance.LXC {
243 » » managerConfig["use-clone"] = strconv.FormatBool(env.config.lxcCl one()) 242 » » if useLxcClone, ok := cfg.LXCUseClone(); ok {
244 » » managerConfig["use-aufs"] = strconv.FormatBool(env.config.lxcClo neAUFS()) 243 » » » managerConfig["use-clone"] = fmt.Sprint(useLxcClone)
244 » » }
245 » » if useLxcCloneAufs, ok := cfg.LXCUseCloneAUFS(); ok {
246 » » » managerConfig["use-aufs"] = fmt.Sprint(useLxcCloneAufs)
247 » » }
245 } 248 }
246 env.containerManager, err = factory.NewContainerManager( 249 env.containerManager, err = factory.NewContainerManager(
247 containerType, managerConfig) 250 containerType, managerConfig)
248 if err != nil { 251 if err != nil {
249 return err 252 return err
250 } 253 }
251 254
252 // When the localEnviron value is created on the client 255 // When the localEnviron value is created on the client
253 // side, the bootstrap-ip attribute will not exist, 256 // side, the bootstrap-ip attribute will not exist,
254 // because it is only set *within* the running 257 // because it is only set *within* the running
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 515
513 // Ports is specified in the Environ interface. 516 // Ports is specified in the Environ interface.
514 func (env *localEnviron) Ports() ([]instance.Port, error) { 517 func (env *localEnviron) Ports() ([]instance.Port, error) {
515 return nil, nil 518 return nil, nil
516 } 519 }
517 520
518 // Provider is specified in the Environ interface. 521 // Provider is specified in the Environ interface.
519 func (env *localEnviron) Provider() environs.EnvironProvider { 522 func (env *localEnviron) Provider() environs.EnvironProvider {
520 return providerInstance 523 return providerInstance
521 } 524 }
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b