1
0
mirror of https://github.com/rancher/types.git synced 2025-08-31 21:00:16 +00:00

Default container limit on a namespace

This commit is contained in:
Alena Prokharchyk
2019-02-01 16:37:56 -08:00
parent 2c7554d1de
commit 2b0e3415a4
6 changed files with 46 additions and 4 deletions

View File

@@ -34,13 +34,16 @@ func namespaceTypes(schemas *types.Schemas) *types.Schemas {
&m.AnnotationField{Field: "description"},
&m.AnnotationField{Field: "projectId"},
&m.AnnotationField{Field: "resourceQuota", Object: true},
&m.AnnotationField{Field: "containerDefaultResourceLimit", Object: true},
&m.Drop{Field: "status"},
).
MustImport(&Version, NamespaceResourceQuota{}).
MustImport(&Version, ContainerResourceLimit{}).
MustImport(&Version, v1.Namespace{}, struct {
Description string `json:"description"`
ProjectID string `norman:"type=reference[/v3/schemas/project],noupdate"`
ResourceQuota string `json:"resourceQuota,omitempty" norman:"type=namespaceResourceQuota"`
Description string `json:"description"`
ProjectID string `norman:"type=reference[/v3/schemas/project],noupdate"`
ResourceQuota string `json:"resourceQuota,omitempty" norman:"type=namespaceResourceQuota"`
ContainerDefaultResourceLimit string `json:"containerDefaultResourceLimit,omitempty" norman:"type=containerResourceLimit"`
}{}).
MustImport(&Version, NamespaceMove{}).
MustImportAndCustomize(&Version, v1.Namespace{}, func(schema *types.Schema) {

View File

@@ -49,3 +49,10 @@ type ResourceQuotaLimit struct {
type NamespaceMove struct {
ProjectID string `json:"projectId,omitempty"`
}
type ContainerResourceLimit struct {
RequestsCPU string `json:"requestsCpu,omitempty"`
RequestsMemory string `json:"requestsMemory,omitempty"`
LimitsCPU string `json:"limitsCpu,omitempty"`
LimitsMemory string `json:"limitsMemory,omitempty"`
}