-
Notifications
You must be signed in to change notification settings - Fork 50
/
gc.go
28 lines (26 loc) · 851 Bytes
/
gc.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
package gc
import (
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/gc/activities"
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/gc/jobs"
"github.com/jenkins-x-plugins/jx-gitops/pkg/cmd/gc/pods"
"github.com/jenkins-x/jx-helpers/v3/pkg/cobras"
"github.com/jenkins-x/jx-logging/v3/pkg/log"
"github.com/spf13/cobra"
)
// NewCmdGC creates the new command
func NewCmdGC() *cobra.Command {
command := &cobra.Command{
Use: "gc",
Short: "Commands for garbage collecting resources",
Run: func(command *cobra.Command, _ []string) {
err := command.Help()
if err != nil {
log.Logger().Errorf(err.Error())
}
},
}
command.AddCommand(cobras.SplitCommand(activities.NewCmdGCActivities()))
command.AddCommand(cobras.SplitCommand(pods.NewCmdGCPods()))
command.AddCommand(cobras.SplitCommand(jobs.NewCmdGCJobs()))
return command
}