~rogpeppe/juju-core/azure

« back to all changes in this revision

Viewing changes to state/state.go

[r=wallyworld] New assignment policy is AssignCleanEmpty

Add container support to AssignClean(Empty) policies and make
the default policy AssignCleanEmpty. This allows manual deployment
of charms into existing clean and empty containers/instances, with
the fallback that a new container/instance is created if none are
available. The system behaves the same as previously if a simple
bootstrap and deploy is performed, but if add-machine is used to
create some containers/instances, then those are no longer ignored.

https://codereview.appspot.com/11019044/

Show diffs side-by-side

added added

removed removed

Lines of Context:
1173
1173
                if _, err = u.AssignToCleanMachine(); err != noCleanMachines {
1174
1174
                        return err
1175
1175
                }
1176
 
                return u.AssignToNewMachine()
 
1176
                return u.AssignToNewMachineOrContainer()
1177
1177
        case AssignCleanEmpty:
1178
1178
                if _, err = u.AssignToCleanEmptyMachine(); err != noCleanMachines {
1179
1179
                        return err
1180
1180
                }
1181
 
                return u.AssignToNewMachine()
 
1181
                return u.AssignToNewMachineOrContainer()
1182
1182
        case AssignNew:
1183
1183
                return u.AssignToNewMachine()
1184
1184
        }