-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change cli style, use 'gtctl cluster [create|get|list|delet…
…e|scale]' (#26)
- Loading branch information
Showing
14 changed files
with
79 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package cluster | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/GreptimeTeam/gtctl/cmd/app/cluster/create" | ||
"github.com/GreptimeTeam/gtctl/cmd/app/cluster/delete" | ||
"github.com/GreptimeTeam/gtctl/cmd/app/cluster/get" | ||
"github.com/GreptimeTeam/gtctl/cmd/app/cluster/list" | ||
"github.com/GreptimeTeam/gtctl/cmd/app/cluster/scale" | ||
"github.com/GreptimeTeam/gtctl/pkg/log" | ||
) | ||
|
||
func NewClusterCommand() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Args: cobra.NoArgs, | ||
Use: "cluster", | ||
Short: "Manage GreptimeDB cluster", | ||
Long: `Manage GreptimeDB cluster in Kubernetes`, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
err := cmd.Help() | ||
if err != nil { | ||
return err | ||
} | ||
return errors.New("subcommand is required") | ||
}, | ||
} | ||
|
||
// TODO(zyy17): Maybe ugly to use NewLogger in every command. | ||
cmd.AddCommand(create.NewCreateClusterCommand(log.NewLogger())) | ||
cmd.AddCommand(delete.NewDeleteClusterCommand(log.NewLogger())) | ||
cmd.AddCommand(scale.NewScaleClusterCommand(log.NewLogger())) | ||
cmd.AddCommand(get.NewGetClusterCommand(log.NewLogger())) | ||
cmd.AddCommand(list.NewListClustersCommand(log.NewLogger())) | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.