climc: k8s-repo-sync

This commit is contained in:
Zexi Li
2018-11-02 12:36:51 +08:00
parent c2e628d6ef
commit af97ebe0bc
2 changed files with 11 additions and 4 deletions
+9
View File
@@ -58,4 +58,13 @@ func initRepo() {
printObject(repo)
return nil
})
R(&o.RepoGetOptions{}, cmdN("sync"), "Sync a repository", func(s *mcclient.ClientSession, args *o.RepoGetOptions) error {
repo, err := k8s.Repos.PerformAction(s, args.NAME, "sync", nil)
if err != nil {
return err
}
printObject(repo)
return nil
})
}
+2 -4
View File
@@ -24,7 +24,7 @@ func (o AppBaseCreateOptions) Params() (*jsonutils.JSONDict, error) {
type AppCreateOptions struct {
AppBaseCreateOptions
ChartName string `help:"Meter helm chart name, e.g infra/meter" default:"infra/meter"`
CHARTNAME string `help:"Helm release app chart name, e.g yunion/meter"`
}
func (o AppCreateOptions) Params() (*jsonutils.JSONDict, error) {
@@ -32,8 +32,6 @@ func (o AppCreateOptions) Params() (*jsonutils.JSONDict, error) {
if err != nil {
return nil, err
}
if o.ChartName != "" {
params.Add(jsonutils.NewString(o.ChartName), "chart_name")
}
params.Add(jsonutils.NewString(o.CHARTNAME), "chart_name")
return params, nil
}