forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prune.go
36 lines (27 loc) · 1.18 KB
/
prune.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package prune
import (
"io"
"github.com/spf13/cobra"
groups "github.com/openshift/origin/pkg/cmd/admin/groups/sync/cli"
cmdutil "github.com/openshift/origin/pkg/cmd/util"
"github.com/openshift/origin/pkg/cmd/util/clientcmd"
)
const PruneRecommendedName = "prune"
const PruneGroupsRecommendedName = "groups"
const pruneLong = `Remove older versions of resources from the server
The commands here allow administrators to manage the older versions of resources on
the system by removing them.`
func NewCommandPrune(name, fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
// Parent command to which all subcommands are added.
cmds := &cobra.Command{
Use: name,
Short: "Remove older versions of resources from the server",
Long: pruneLong,
Run: cmdutil.DefaultSubCommandRun(out),
}
cmds.AddCommand(NewCmdPruneBuilds(f, fullName, PruneBuildsRecommendedName, out))
cmds.AddCommand(NewCmdPruneDeployments(f, fullName, PruneDeploymentsRecommendedName, out))
cmds.AddCommand(NewCmdPruneImages(f, fullName, PruneImagesRecommendedName, out))
cmds.AddCommand(groups.NewCmdPrune(PruneGroupsRecommendedName, fullName+" "+PruneGroupsRecommendedName, f, out))
return cmds
}