aboutsummaryrefslogtreecommitdiffstats
path: root/src/dcm/pkg/module/quota.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/dcm/pkg/module/quota.go')
-rw-r--r--src/dcm/pkg/module/quota.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/dcm/pkg/module/quota.go b/src/dcm/pkg/module/quota.go
index cbd9c8b7..c961fdfc 100644
--- a/src/dcm/pkg/module/quota.go
+++ b/src/dcm/pkg/module/quota.go
@@ -22,8 +22,9 @@ import (
// Quota contains the parameters needed for a Quota
type Quota struct {
- MetaData QMetaDataList `json:"metadata"`
- Specification QSpec `json:"spec"`
+ MetaData QMetaDataList `json:"metadata"`
+ // Specification QSpec `json:"spec"`
+ Specification map[string]string `json:"spec"`
}
// MetaData contains the parameters needed for metadata
@@ -32,6 +33,7 @@ type QMetaDataList struct {
Description string `json:"description"`
}
+// TODO: use QSpec fields to validate quota keys
// Spec contains the parameters needed for spec
type QSpec struct {
LimitsCPU string `json:"limits.cpu"`
@@ -152,7 +154,7 @@ func (v *QuotaClient) GetQuota(project, logicalCloud, quotaName string) (Quota,
return q, nil
}
- return Quota{}, pkgerrors.New("Error getting Quota")
+ return Quota{}, pkgerrors.New("Cluster Quota does not exist")
}
// GetAll returns all cluster quotas in the logical cloud
@@ -211,7 +213,7 @@ func (v *QuotaClient) UpdateQuota(project, logicalCloud, quotaName string, c Quo
//Check if this Quota exists
_, err := v.GetQuota(project, logicalCloud, quotaName)
if err != nil {
- return Quota{}, pkgerrors.New("Update Error - Quota doesn't exist")
+ return Quota{}, pkgerrors.New("Cluster Quota does not exist")
}
err = v.util.DBInsert(v.storeName, key, nil, v.tagMeta, c)
if err != nil {