1
0
mirror of https://github.com/rancher/types.git synced 2025-06-27 14:06:49 +00:00

Field to store roles for targets of mcapp

This commit is contained in:
rajashree 2019-02-25 14:54:13 -08:00 committed by Alena Prokharchyk
parent ee7e7deb08
commit f7d1f26d6e
2 changed files with 9 additions and 8 deletions

View File

@ -26,13 +26,14 @@ type MultiClusterApp struct {
}
type MultiClusterAppSpec struct {
TemplateVersionName string `json:"templateVersionName,omitempty" norman:"type=reference[templateVersion],required"`
Answers []Answer `json:"answers,omitempty"`
Targets []Target `json:"targets,omitempty" norman:"required,noupdate"`
Members []Member `json:"members,omitempty"`
Roles []string `json:"roles,omitempty" norman:"type=array[reference[roleTemplate]]"`
RevisionHistoryLimit int `json:"revisionHistoryLimit,omitempty" norman:"default=10"`
UpgradeStrategy UpgradeStrategy `json:"upgradeStrategy,omitempty"`
TemplateVersionName string `json:"templateVersionName,omitempty" norman:"type=reference[templateVersion],required"`
Answers []Answer `json:"answers,omitempty"`
Targets []Target `json:"targets,omitempty" norman:"required,noupdate"`
Members []Member `json:"members,omitempty"`
Roles []string `json:"roles,omitempty" norman:"type=array[reference[roleTemplate]]"`
RevisionHistoryLimit int `json:"revisionHistoryLimit,omitempty" norman:"default=10"`
UpgradeStrategy UpgradeStrategy `json:"upgradeStrategy,omitempty"`
TargetToRole map[string][]string `json:"targetToRole,omitempty"`
}
type MultiClusterAppStatus struct {

View File

@ -688,7 +688,7 @@ func clusterCatalogTypes(schemas *types.Schemas) *types.Schemas {
func multiClusterAppTypes(schemas *types.Schemas) *types.Schemas {
return schemas.
AddMapperForType(&Version, v3.MultiClusterApp{}, m.Drop{Field: "namespaceId"}).
AddMapperForType(&Version, v3.MultiClusterApp{}, m.Drop{Field: "namespaceId"}, m.Drop{Field: "targetToRole"}).
AddMapperForType(&Version, v3.MultiClusterAppRevision{}, m.Drop{Field: "namespaceId"}).
AddMapperForType(&Version, v3.Member{}, m.Drop{Field: "userName"}, m.Drop{Field: "displayName"}).
MustImport(&Version, v3.MultiClusterApp{}).