~rogpeppe/juju-core/azure

« back to all changes in this revision

Viewing changes to constraints/constraints.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:
216
216
        return nil
217
217
}
218
218
 
 
219
// HasContainer returns true if the constraints.Value specifies a container.
 
220
func (v *Value) HasContainer() bool {
 
221
        return v.Container != nil && *v.Container != "" && *v.Container != instance.NONE
 
222
}
 
223
 
219
224
func (v *Value) setArch(str string) error {
220
225
        if v.Arch != nil {
221
226
                return fmt.Errorf("already set")