Example #1
0
func setQuota(app provision.App, toAdd map[string]*containersToAdd) error {
	if quota := app.GetQuota(); quota.Unlimited() {
		return nil
	}
	var total int
	for _, ct := range toAdd {
		total += ct.Quantity
	}
	err := app.SetQuotaInUse(total)
	if err != nil {
		return &errors.CompositeError{
			Base:    err,
			Message: "Cannot start application units",
		}
	}
	return nil
}