func (c Config) AsSpaceConstraints(spaces *[]string) *[]string {
	newSpaces := set.NewStrings()
	if spaces != nil {
		for _, s := range *spaces {
			newSpaces.Add(s)
		}
	}

	for _, c := range []string{c.JujuManagementSpace(), c.JujuHASpace()} {
		// NOTE (hml) 2019-10-30
		// This can cause issues in deployment and/or enabling HA if
		// c == AlphaSpaceName as the provisioner expects any space
		// listed to have subnets. Which is only AWS today.
		if c != "" {
			newSpaces.Add(c)
		}
	}

	// Preserve a nil pointer if there is no change. This conveys information
	// in constraints.Value (not set vs. deliberately set as empty).
	if spaces == nil && len(newSpaces) == 0 {
		return nil
	}
	ns := newSpaces.SortedValues()
	return &ns
}
// AsSpaceConstraints checks to see whether config has spaces names populated
// for management and/or HA (Mongo).
// Non-empty values are merged with any input spaces and returned as a new
// slice reference.
// A slice pointer is used for congruence with the Spaces member in
// constraints.Value.
AsSpaceConstraints checks to see whether config has spaces names populated
for management and/or HA (Mongo).
Non-empty values are merged with any input spaces and returned as a new
slice reference.
A slice pointer is used for congruence with the Spaces member in
constraints.Value.
// AsSpaceConstraints checks to see whether config has spaces names populated // for management and / or HA ( Mongo ) . // Non - empty values are merged with any input spaces and returned as a new // slice reference . // A slice pointer is used for congruence with the Spaces member in // constraints . Value .
func (c Config) AsSpaceConstraints(spaces *[]string) *[]string {
	newSpaces := set.NewStrings()
	if spaces != nil {
		for _, s := range *spaces {
			newSpaces.Add(s)
		}
	}
	for _, c := range []string{c.JujuManagementSpace(), c.JujuHASpace()} {
		if c != "" {
			newSpaces.Add(c)
		}
	}
	if spaces == nil && len(newSpaces) == 0 {
		return nil
	}
	ns := newSpaces.SortedValues()
	return &ns
}
func ( c Config ) AsSpaceConstraints ( spaces * [ ] string ) * [ ] string { newSpaces := set . NewStrings ( ) if spaces != nil { for _ , s := range * spaces { newSpaces . Add ( s ) } } for _ , c := range [ ] string { c . JujuManagementSpace ( ) , c . JujuHASpace ( ) } { if c != " " { newSpaces . Add ( c ) } } if spaces == nil && len ( newSpaces ) == 0 { return nil } ns := newSpaces . SortedValues ( ) return & ns }
AsSpaceConstraints checks to see whether config has spaces names populated
for management and/or HA (Mongo).
AsSpaceConstraints checks to see whether config has spaces names populated for management and / or HA ( Mongo ) .
// NOTE (hml) 2019-10-30 // This can cause issues in deployment and/or enabling HA if // c == AlphaSpaceName as the provisioner expects any space // listed to have subnets. Which is only AWS today. // Preserve a nil pointer if there is no change. This conveys information // in constraints.Value (not set vs. deliberately set as empty).