-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimization: Categorize cmd modules by type #1680
Conversation
Codecov ReportBase: 18.23% // Head: 18.59% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1680 +/- ##
==========================================
+ Coverage 18.23% 18.59% +0.36%
==========================================
Files 68 71 +3
Lines 5500 5667 +167
==========================================
+ Hits 1003 1054 +51
- Misses 4374 4480 +106
- Partials 123 133 +10
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
cmd/sealer/cmd/cluster/cluster.go
Outdated
import "github.com/spf13/cobra" | ||
|
||
func NewCmdCluster() *cobra.Command { | ||
cmd := &cobra.Command{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to add cluster
cmd. just add those sub cmd to root cmd.
cmd/sealer/cmd/image/image.go
Outdated
Short: "image sub-commands", | ||
} | ||
cmd.AddCommand(NewBuildCmd()) | ||
cmd.AddCommand(NewCompletionCmd()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewCompletionCmd, NewCompletionCmd is not belong to image
cmd/sealer/cmd/image/image.go
Outdated
import "github.com/spf13/cobra" | ||
|
||
func NewCmdImage() *cobra.Command { | ||
cmd := &cobra.Command{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just add those cmd to root cmd.
cmd/sealer/cmd/image/image.go
Outdated
cmd.AddCommand(NewSaveCmd()) | ||
cmd.AddCommand(NewSearchCmd()) | ||
cmd.AddCommand(NewTagCmd()) | ||
cmd.AddCommand(NewVersionCmd()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same issue: versionCMD is not belong to image
Use: "apply", | ||
Short: "apply a Kubernetes cluster via specified Clusterfile", | ||
Long: `apply command is used to apply a Kubernetes cluster via specified Clusterfile. | ||
var longNewApplyCmdDescription = `apply command is used to apply a Kubernetes cluster via specified Clusterfile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
8621863
to
56bda0f
Compare
cmd/sealer/cmd/image/image.go
Outdated
|
||
import "github.com/spf13/cobra" | ||
|
||
func NewCmdImage() *cobra.Command { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewImageCommands()[]*cobra.Command{}
cmd/sealer/cmd/cluster/check.go
Outdated
Use: "check", | ||
Short: "check the state of cluster", | ||
Long: longNewCheckCmdDescription, | ||
Example: `sealer check --pre or sealer check --post`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sealer check --pre \n sealer check --post
cmd/sealer/cmd/cluster/check.go
Outdated
@@ -38,7 +38,7 @@ func NewCheckCmd() *cobra.Command { | |||
Use: "check", | |||
Short: "check the state of cluster", | |||
Long: longNewCheckCmdDescription, | |||
Example: `sealer check --pre or sealer check --post`, | |||
Example: `sealer check --pre \n sealer check --post`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean change line at "\n", not change or to "\n"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, didn't look carefully😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@kakaZhou719 PTAL
Describe what this PR does / why we need it
Does this pull request fix one issue?
Describe how you did it
Describe how to verify it
Special notes for reviews