Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/climc/shell/k8s/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func initKubeCluster() {
cmd.Perform("delete-machines", new(o.KubeClusterDeleteMachinesOptions))
cmd.Perform("add-machines", new(o.KubeClusterAddMachinesOptions))
cmd.PerformClass("gc", new(o.ClusterGCOpts))
cmd.PerformClass("history-data-clean", new(o.ClusterHistoryDataCleanOpts))
cmd.Perform("set-extra-config", new(o.ClusterSetExtraConfigOpt))
cmd.Get("extra-config", new(o.IdentOptions))

Expand Down
12 changes: 12 additions & 0 deletions pkg/mcclient/options/k8s/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,18 @@ func (o ClusterGCOpts) Params() (jsonutils.JSONObject, error) {
return nil, nil
}

type ClusterHistoryDataCleanOpts struct {
Day *int `help:"days to keep soft-deleted k8s resources before hard delete" default:"30"`
}

func (o ClusterHistoryDataCleanOpts) Params() (jsonutils.JSONObject, error) {
params := jsonutils.NewDict()
if o.Day != nil {
params.Set("day", jsonutils.NewInt(int64(*o.Day)))
}
return params, nil
}

type IdentOptions struct {
ID string `help:"ID or name of the model"`
}
Expand Down
Loading