-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add command cluster create-failure-domain
#21
Conversation
create-failure-domain
9902b67
to
d230065
Compare
create-failure-domain
create-failure-domain
386fda2
to
919d4d0
Compare
The output doesn't seem to be correct to me.
|
@sijie Ah. It already fixes in the code. I forget fix the description of this pull request. |
} | ||
out = append(out, successOut) | ||
out = append(out, argsError) | ||
out = append(out, clusterNonExist) |
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.
clusterNonExist is for cluster commands. please make sure the error message is correct.
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
@sijie PTAL |
"testing" | ||
) | ||
|
||
func TestCreateFailureDomainCmdSuccess(t *testing.T) { |
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.
please add test cases for failure cases.
desc.CommandPermission = "This command requires super-user permissions." | ||
|
||
var examples []pulsar.Example | ||
create := pulsar.Example{ |
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.
does Pulsar allow creating a failure domain without a broker list?
I don't think that is a valid case.
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.
yes. I will check the broker list in pulsarctl.
Using pulsar-admin
bin/pulsar-admin clusters create-failure-domain --domain-name hello standalone
bin/pulsar-admin clusters list-failure-domains standalone
{
"hello" : {
"brokers" : [ ]
}
}
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.
ok
### Motivation We can't get the error info when running a command. When testing a command, we need to verify the error output. ### Modification Make a handler to handle errors. Create a test handler in TestClusterCommand for test other commands.
--- Master Issue: #2
Master issue: streamnative/pulsarctl#2 ``` USED FOR: This command is used for creating a failure domain of the <cluster-name>. REQUIRED PERMISSION: This command requires super-user permissions. EXAMPLES: #creating the failure domain pulsarctl clusters create-failure-domain <cluster-name> <domain-name> #creating the failure domain with brokers pulsarctl clusters create-failure-domain --broker-list <cluster-A> --broker-list <cluster-B> <cluster-name> <domain-name> OUTPUT: #normal output Create failure domain <domain-name> for cluster <cluster-name> succeed #the args need to be specified as <cluster-name> <domain-name> [✖] need specified two names for cluster and failure domain #the specified cluster does not exist in the broker [✖] code: 404 reason: Cluster does not exist Usage: pulsarctl clusters create-failure-domain [flags] Aliases: create-failure-domain, cfd FailureDomainData flags: -b, --broker-list strings Set the failure domain clusters Common flags: -s, --admin-service-url string The admin web service url that pulsarctl connects to. (default "http://localhost:8080") --auth-params string Authentication parameters are used to configure the public and private key files required by tls For example: "tlsCertFile:val1,tlsKeyFile:val2" -C, --color string toggle colorized logs (true,false,fabulous) (default "true") -h, --help help for this command --tls-allow-insecure Allow TLS insecure connection --tls-trust-cert-pat string Allow TLS trust cert file path -v, --verbose int set log level, use 0 to silence, 4 for debugging (default 3) Use 'pulsarctl clusters create-failure-domain [command] --help' for more information about a command. ```
Master issue: streamnative/pulsarctl#2 ``` USED FOR: This command is used for creating a failure domain of the <cluster-name>. REQUIRED PERMISSION: This command requires super-user permissions. EXAMPLES: #creating the failure domain pulsarctl clusters create-failure-domain <cluster-name> <domain-name> #creating the failure domain with brokers pulsarctl clusters create-failure-domain --broker-list <cluster-A> --broker-list <cluster-B> <cluster-name> <domain-name> OUTPUT: #normal output Create failure domain <domain-name> for cluster <cluster-name> succeed #the args need to be specified as <cluster-name> <domain-name> [✖] need specified two names for cluster and failure domain #the specified cluster does not exist in the broker [✖] code: 404 reason: Cluster does not exist Usage: pulsarctl clusters create-failure-domain [flags] Aliases: create-failure-domain, cfd FailureDomainData flags: -b, --broker-list strings Set the failure domain clusters Common flags: -s, --admin-service-url string The admin web service url that pulsarctl connects to. (default "http://localhost:8080") --auth-params string Authentication parameters are used to configure the public and private key files required by tls For example: "tlsCertFile:val1,tlsKeyFile:val2" -C, --color string toggle colorized logs (true,false,fabulous) (default "true") -h, --help help for this command --tls-allow-insecure Allow TLS insecure connection --tls-trust-cert-pat string Allow TLS trust cert file path -v, --verbose int set log level, use 0 to silence, 4 for debugging (default 3) Use 'pulsarctl clusters create-failure-domain [command] --help' for more information about a command. ```
Master issue: #2