From 5e52e597240ab2c5694afe361df830decc125dbb Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Wed, 13 Nov 2019 16:45:20 +0800 Subject: [PATCH] climc: fix k8s sa not register --- pkg/mcclient/modules/k8s/rbac.go | 1 + pkg/mcclient/options/k8s/charts.go | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/mcclient/modules/k8s/rbac.go b/pkg/mcclient/modules/k8s/rbac.go index c3439995e7..fac7f78272 100644 --- a/pkg/mcclient/modules/k8s/rbac.go +++ b/pkg/mcclient/modules/k8s/rbac.go @@ -36,6 +36,7 @@ func init() { modules.Register(RbacRoles) modules.Register(RbacRoleBindings) + modules.Register(ServiceAccounts) } func (m RbacRoleManager) GetType(obj jsonutils.JSONObject) interface{} { diff --git a/pkg/mcclient/options/k8s/charts.go b/pkg/mcclient/options/k8s/charts.go index 96f60a1fce..a9d3afd771 100644 --- a/pkg/mcclient/options/k8s/charts.go +++ b/pkg/mcclient/options/k8s/charts.go @@ -22,8 +22,9 @@ type ChartListOptions struct { BaseListOptions Repo string `help:"Repository name"` RepoUrl string `help:"Repository url"` - AllVersion bool `json:"Get Chart all history versions"` - Keyword string `json:"Chart keyword"` + AllVersion bool `help:"Get Chart all history versions"` + Keyword string `help:"Chart keyword"` + Version string `help:"Chart semver version filter"` } func (o ChartListOptions) Params() *jsonutils.JSONDict { @@ -40,6 +41,9 @@ func (o ChartListOptions) Params() *jsonutils.JSONDict { if o.AllVersion { params.Add(jsonutils.JSONTrue, "all_version") } + if len(o.Version) != 0 { + params.Add(jsonutils.NewString(o.Version), "version") + } if len(o.Keyword) != 0 { params.Add(jsonutils.NewString(o.Keyword), "keyword") }