1
0
mirror of https://github.com/rancher/types.git synced 2025-08-15 19:23:00 +00:00

Add output for catalog refresh

This commit is contained in:
Dan Ramich 2019-10-16 14:24:26 -07:00 committed by Alena Prokharchyk
parent 5500a37724
commit 2deb66b6fb
2 changed files with 11 additions and 6 deletions

View File

@ -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"`
}

View File

@ -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"},
}
})
}