-
Notifications
You must be signed in to change notification settings - Fork 72
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
change the replicas keyword to service_num #294
Closed
Closed
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
98fe79a
FIx issue
tiansuo114 1cfb78f
dc change
tiansuo114 f8d078a
Replicas commit
tiansuo114 14fbd20
part todo
tiansuo114 fd8636d
111
tiansuo114 5d109d4
111
tiansuo114 b9f1d9a
1111
tiansuo114 98e73ab
change service_num to instance
tiansuo114 fa08b9c
change replicas to instances
tiansuo114 d8ad03d
change replicas to instances
tiansuo114 8fe3e05
Merge branch 'develop' of https://github.com/tiansuo114/curveadm into…
tiansuo114 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,12 +47,13 @@ var ( | |
} | ||
) | ||
|
||
// todo change status print from replicas to service num | ||
type statusOptions struct { | ||
id string | ||
role string | ||
host string | ||
verbose bool | ||
showReplicas bool | ||
showInstance bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto. |
||
} | ||
|
||
func NewStatusCommand(curveadm *cli.CurveAdm) *cobra.Command { | ||
|
@@ -73,7 +74,7 @@ func NewStatusCommand(curveadm *cli.CurveAdm) *cobra.Command { | |
flags.StringVar(&options.role, "role", "*", "Specify service role") | ||
flags.StringVar(&options.host, "host", "*", "Specify service host") | ||
flags.BoolVarP(&options.verbose, "verbose", "v", false, "Verbose output for status") | ||
flags.BoolVarP(&options.showReplicas, "show-replicas", "s", false, "Display service replicas") | ||
flags.BoolVarP(&options.showInstance, "show-instance", "s", false, "Display service num") | ||
|
||
return cmd | ||
} | ||
|
@@ -113,7 +114,7 @@ func displayStatus(curveadm *cli.CurveAdm, dcs []*topology.DeployConfig, options | |
} | ||
} | ||
|
||
output := tui.FormatStatus(statuses, options.verbose, options.showReplicas) | ||
output := tui.FormatStatus(statuses, options.verbose, options.showInstance) | ||
curveadm.WriteOutln("") | ||
curveadm.WriteOutln("cluster name : %s", curveadm.ClusterName()) | ||
curveadm.WriteOutln("cluster kind : %s", dcs[0].GetKind()) | ||
|
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
Large diffs are not rendered by default.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -348,11 +348,13 @@ var ( | |
ERR_RENDERING_VARIABLE_FAILED = EC(330007, "rendering variable failed") | ||
ERR_CREATE_HASH_FOR_TOPOLOGY_FAILED = EC(330008, "create hash for topology failed") | ||
// 331: configure (topology.yaml: invalid configure value) | ||
ERR_UNSUPPORT_CLUSTER_KIND = EC(331000, "unsupport cluster kind") | ||
ERR_NO_SERVICES_IN_TOPOLOGY = EC(331001, "no services in topology") | ||
ERR_REPLICAS_REQUIRES_POSITIVE_INTEGER = EC(331002, "replicas requires a positive integer") | ||
ERR_INVALID_VARIABLE_SECTION = EC(331003, "invalid variable section") | ||
ERR_DUPLICATE_SERVICE_ID = EC(331004, "service id is duplicate") | ||
//todo: remove ERR_REPLICAS_REQUIRES_POSITIVE_INTEGER and change to ERR_NO_SERVICES_NUM_TOPOLOGY | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should update the error code which show below. |
||
ERR_UNSUPPORT_CLUSTER_KIND = EC(331000, "unsupport cluster kind") | ||
ERR_NO_SERVICES_IN_TOPOLOGY = EC(331001, "no services in topology") | ||
ERR_REPLICAS_REQUIRES_POSITIVE_INTEGER = EC(331002, "replicas requires a positive integer") | ||
ERR_INVALID_VARIABLE_SECTION = EC(331003, "invalid variable section") | ||
ERR_DUPLICATE_SERVICE_ID = EC(331004, "service id is duplicate") | ||
ERR_SERVICE_NUM_REQUIRES_POSITIVE_INTEGER = EC(331005, "service_num requires a positive integer") | ||
// 332: configure (topology.yaml: update topology) | ||
ERR_DELETE_SERVICE_WHILE_COMMIT_TOPOLOGY_IS_DENIED = EC(332000, "delete service while commit topology is denied") | ||
ERR_ADD_SERVICE_WHILE_COMMIT_TOPOLOGY_IS_DENIED = EC(332001, "add service while commit topology is denied") | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, i didn't express clearly, actually we should use word instances for multi-instances, so
GetInstances
notGetInstance
.