From 2deb66b6fbe59a3682f85e7113a1fc80a9e74ea5 Mon Sep 17 00:00:00 2001 From: Dan Ramich Date: Wed, 16 Oct 2019 14:24:26 -0700 Subject: [PATCH] Add output for catalog refresh --- apis/management.cattle.io/v3/catalog_types.go | 4 ++++ apis/management.cattle.io/v3/schema/schema.go | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apis/management.cattle.io/v3/catalog_types.go b/apis/management.cattle.io/v3/catalog_types.go index 4a22cd9b..4085ed9f 100644 --- a/apis/management.cattle.io/v3/catalog_types.go +++ b/apis/management.cattle.io/v3/catalog_types.go @@ -236,3 +236,7 @@ type ClusterCatalog struct { Catalog `json:",inline" mapstructure:",squash"` ClusterName string `json:"clusterName,omitempty" norman:"required,type=reference[cluster]"` } + +type CatalogRefresh struct { + Catalogs []string `json:"catalogs"` +} diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 5de7297d..0f52abc6 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -109,12 +109,13 @@ func catalogTypes(schemas *types.Schemas) *types.Schemas { &m.Embed{Field: "status"}, &m.Drop{Field: "helmVersionCommits"}, ). + MustImport(&Version, v3.CatalogRefresh{}). MustImportAndCustomize(&Version, v3.Catalog{}, func(schema *types.Schema) { schema.ResourceActions = map[string]types.Action{ - "refresh": {}, + "refresh": {Output: "catalogRefresh"}, } schema.CollectionActions = map[string]types.Action{ - "refresh": {}, + "refresh": {Output: "catalogRefresh"}, } }). AddMapperForType(&Version, v3.Template{}, @@ -726,10 +727,10 @@ func projectCatalogTypes(schemas *types.Schemas) *types.Schemas { &mapper.NamespaceIDMapper{}). MustImportAndCustomize(&Version, v3.ProjectCatalog{}, func(schema *types.Schema) { schema.ResourceActions = map[string]types.Action{ - "refresh": {}, + "refresh": {Output: "catalogRefresh"}, } schema.CollectionActions = map[string]types.Action{ - "refresh": {}, + "refresh": {Output: "catalogRefresh"}, } }) } @@ -743,10 +744,10 @@ func clusterCatalogTypes(schemas *types.Schemas) *types.Schemas { &mapper.NamespaceIDMapper{}). MustImportAndCustomize(&Version, v3.ClusterCatalog{}, func(schema *types.Schema) { schema.ResourceActions = map[string]types.Action{ - "refresh": {}, + "refresh": {Output: "catalogRefresh"}, } schema.CollectionActions = map[string]types.Action{ - "refresh": {}, + "refresh": {Output: "catalogRefresh"}, } }) }