func resolveOverlayPresenceFields(base *BundleDataPart) {
	applications := base.PresenceMap.forField("applications")
	if len(applications) == 0 {
		return
	}
	for name, app := range base.Data.Applications {
		if !applications.fieldPresent(name) {
			continue
		}

		presence := applications.forField(name)
		// If the presence map contains scale, but doesn't contain num_units
		// and if the app.Scale_ has been set to zero. We can then assume that a
		// normalistion has occurred.
		if presence.fieldPresent("scale") && !presence.fieldPresent("num_units") && app.Scale_ == 0 && app.NumUnits > 0 {
			presence["num_units"] = presence["scale"]
		}
	}
}
// resolveOverlayPresenceFields exists because we expose an internal bundle
// representation of a type out to the consumers of the library. This means it
// becomes very difficult to know what was re-written during the normalisation
// phase, without telling downstream consumers.
//
// The following attempts to guess when a normalisation has occurred, but the
// presence field map is out of sync with the new changes.
resolveOverlayPresenceFields exists because we expose an internal bundle
representation of a type out to the consumers of the library. This means it
becomes very difficult to know what was re-written during the normalisation
phase, without telling downstream consumers.

The following attempts to guess when a normalisation has occurred, but the
presence field map is out of sync with the new changes.
// resolveOverlayPresenceFields exists because we expose an internal bundle // representation of a type out to the consumers of the library . This means it // becomes very difficult to know what was re - written during the normalisation // phase without telling downstream consumers . // // The following attempts to guess when a normalisation has occurred but the // presence field map is out of sync with the new changes .
func resolveOverlayPresenceFields(base *BundleDataPart) {
	applications := base.PresenceMap.forField("applications")
	if len(applications) == 0 {
		return
	}
	for name, app := range base.Data.Applications {
		if !applications.fieldPresent(name) {
			continue
		}
		presence := applications.forField(name)
		if presence.fieldPresent("scale") && !presence.fieldPresent("num_units") && app.Scale_ == 0 && app.NumUnits > 0 {
			presence["num_units"] = presence["scale"]
		}
	}
}
func resolveOverlayPresenceFields ( base * BundleDataPart ) { applications := base . PresenceMap . forField ( " " ) if len ( applications ) == 0 { return } for name , app := range base . Data . Applications { if ! applications . fieldPresent ( name ) { continue } presence := applications . forField ( name ) if presence . fieldPresent ( " " ) && ! presence . fieldPresent ( " " ) && app . Scale_ == 0 && app . NumUnits > 0 { presence [ " " ] = presence [ " " ] } } }
resolveOverlayPresenceFields exists because we expose an internal bundle
representation of a type out to the consumers of the library.
resolveOverlayPresenceFields exists because we expose an internal bundle representation of a type out to the consumers of the library .
// If the presence map contains scale, but doesn't contain num_units // and if the app.Scale_ has been set to zero. We can then assume that a // normalistion has occurred.