From 604a5280b5238335466e5e8ba51e04568ce2c033 Mon Sep 17 00:00:00 2001 From: Daishan Peng Date: Tue, 4 Sep 2018 15:44:28 -0700 Subject: [PATCH] add noupdate to projectId and move action --- apis/cluster.cattle.io/v3/schema/schema.go | 10 ++++++++-- apis/cluster.cattle.io/v3/schema/types.go | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apis/cluster.cattle.io/v3/schema/schema.go b/apis/cluster.cattle.io/v3/schema/schema.go index 43004fe4..c54b86c0 100644 --- a/apis/cluster.cattle.io/v3/schema/schema.go +++ b/apis/cluster.cattle.io/v3/schema/schema.go @@ -37,9 +37,15 @@ func namespaceTypes(schemas *types.Schemas) *types.Schemas { MustImport(&Version, NamespaceResourceQuota{}). MustImport(&Version, v1.Namespace{}, struct { Description string `json:"description"` - ProjectID string `norman:"type=reference[/v3/schemas/project]"` + ProjectID string `norman:"type=reference[/v3/schemas/project],noupdate"` ResourceQuota string `json:"resourceQuota,omitempty" norman:"type=namespaceResourceQuota"` - }{}) + }{}). + MustImport(&Version, NamespaceMove{}). + MustImportAndCustomize(&Version, v1.Namespace{}, func(schema *types.Schema) { + schema.ResourceActions["move"] = types.Action{ + Input: "namespaceMove", + } + }) } func persistentVolumeTypes(schemas *types.Schemas) *types.Schemas { diff --git a/apis/cluster.cattle.io/v3/schema/types.go b/apis/cluster.cattle.io/v3/schema/types.go index 07785689..7e890d7d 100644 --- a/apis/cluster.cattle.io/v3/schema/types.go +++ b/apis/cluster.cattle.io/v3/schema/types.go @@ -45,3 +45,7 @@ type ResourceQuotaLimit struct { LimitsCPU string `json:"limitsCpu,omitempty"` LimitsMemory string `json:"limitsMemory,omitempty"` } + +type NamespaceMove struct { + ProjectID string `json:"projectId,omitempty"` +}