mirror of
https://github.com/rancher/types.git
synced 2025-09-03 06:04:24 +00:00
Resoure quota refactor - no more template
This commit is contained in:
@@ -31,16 +31,14 @@ func namespaceTypes(schemas *types.Schemas) *types.Schemas {
|
||||
AddMapperForType(&Version, v1.Namespace{},
|
||||
&m.AnnotationField{Field: "description"},
|
||||
&m.AnnotationField{Field: "projectId"},
|
||||
&m.AnnotationField{Field: "resourceQuotaTemplateId"},
|
||||
&m.AnnotationField{Field: "resourceQuotaAppliedTemplateId"},
|
||||
|
||||
&m.AnnotationField{Field: "resourceQuota", Object: true},
|
||||
&m.Drop{Field: "status"},
|
||||
).
|
||||
MustImport(&Version, NamespaceResourceQuota{}).
|
||||
MustImport(&Version, v1.Namespace{}, struct {
|
||||
Description string `json:"description"`
|
||||
ProjectID string `norman:"type=reference[/v3/schemas/project]"`
|
||||
ResourceQuotaTemplateID string `json:"resourceQuotaTemplateId,omitempty" norman:"type=reference[/v3/schemas/resourceQuotaTemplate]"`
|
||||
ResourceQuotaAppliedTemplateID string `json:"resourceQuotaAppliedTemplateId,omitempty" norman:"type=reference[/v3/schemas/resourceQuotaTemplate],nocreate,noupdate"`
|
||||
Description string `json:"description"`
|
||||
ProjectID string `norman:"type=reference[/v3/schemas/project]"`
|
||||
ResourceQuota string `json:"resourceQuota,omitempty" norman:"type=namespaceResourceQuota"`
|
||||
}{})
|
||||
}
|
||||
|
||||
|
@@ -25,3 +25,23 @@ type KubernetesInfo struct {
|
||||
KubeletVersion string
|
||||
KubeProxyVersion string
|
||||
}
|
||||
|
||||
type NamespaceResourceQuota struct {
|
||||
Limit ResourceQuotaLimit `json:"limit,omitempty"`
|
||||
}
|
||||
|
||||
type ResourceQuotaLimit struct {
|
||||
Pods string `json:"pods,omitempty"`
|
||||
Services string `json:"services,omitempty"`
|
||||
ReplicationControllers string `json:"replicationControllers,omitempty"`
|
||||
Secrets string `json:"secrets,omitempty"`
|
||||
ConfigMaps string `json:"configMaps,omitempty"`
|
||||
PersistentVolumeClaims string `json:"persistentVolumeClaims,omitempty"`
|
||||
ServicesNodePorts string `json:"servicesNodePorts,omitempty"`
|
||||
ServicesLoadBalancers string `json:"servicesLoadBalancers,omitempty"`
|
||||
RequestsCPU string `json:"requestsCpu,omitempty"`
|
||||
RequestsMemory string `json:"requestsMemory,omitempty"`
|
||||
RequestsStorage string `json:"requestsStorage,omitempty"`
|
||||
LimitsCPU string `json:"limitsCpu,omitempty"`
|
||||
LimitsMemory string `json:"limitsMemory,omitempty"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user