1
0
mirror of https://github.com/rancher/types.git synced 2025-07-31 04:49:37 +00:00

Question API on ClusterTemplates

This commit is contained in:
Prachi Damle 2019-07-01 11:38:56 -07:00 committed by Alena Prokharchyk
parent a875317c20
commit 0a9f28b48e
2 changed files with 12 additions and 1 deletions

View File

@ -45,3 +45,7 @@ type ClusterTemplateRevisionSpec struct {
Questions []Question `json:"questions,omitempty"`
ClusterConfig *ClusterSpecBase `json:"clusterConfig" norman:"required"`
}
type ClusterTemplateQuestionsOutput struct {
Questions []Question `json:"questions,omitempty"`
}

View File

@ -831,8 +831,15 @@ func clusterTemplateTypes(schemas *types.Schemas) *types.Schemas {
TypeName("clusterTemplateRevision", v3.ClusterTemplateRevision{}).
AddMapperForType(&Version, v3.ClusterTemplate{}, m.Drop{Field: "namespaceId"}, m.DisplayName{}).
AddMapperForType(&Version, v3.ClusterTemplateRevision{}, m.Drop{Field: "namespaceId"}).
MustImport(&Version, v3.ClusterTemplateQuestionsOutput{}).
MustImport(&Version, v3.ClusterTemplate{}).
MustImport(&Version, v3.ClusterTemplateRevision{})
MustImportAndCustomize(&Version, v3.ClusterTemplateRevision{}, func(schema *types.Schema) {
schema.CollectionActions = map[string]types.Action{
"listquestions": {
Output: "clusterTemplateQuestionsOutput",
},
}
})
}
func clusterScanTypes(schemas *types.Schemas) *types.Schemas {