This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new c91763c [tools] KUDU-1884 Add custom SASL protocol name for some CLI
tools
c91763c is described below
commit c91763c8a88d562a32763c4ae8c19644bd2f5468
Author: zhangyifan27 <[email protected]>
AuthorDate: Tue Jun 29 16:24:07 2021 +0800
[tools] KUDU-1884 Add custom SASL protocol name for some CLI tools
This patch adds support to set a custom SASL protocol name
when using LeaderMasterProxy in kudu CLI tools.
Change-Id: If2163984fc0b144ee7ab11f2f928750925f4beeb
Reviewed-on: http://gerrit.cloudera.org:8080/17641
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <[email protected]>
---
src/kudu/tools/kudu-admin-test.cc | 12 ++++++++++++
src/kudu/tools/tool_action_common.cc | 1 +
2 files changed, 13 insertions(+)
diff --git a/src/kudu/tools/kudu-admin-test.cc
b/src/kudu/tools/kudu-admin-test.cc
index 81f489c..6d3ed27 100644
--- a/src/kudu/tools/kudu-admin-test.cc
+++ b/src/kudu/tools/kudu-admin-test.cc
@@ -2897,5 +2897,17 @@ TEST_F(AdminCliTest,
TestAddAndDropRangePartitionForMultipleRangeColumnsTable) {
});
}
+TEST_F(AdminCliTest, TestNonDefaultPrincipal) {
+ ExternalMiniClusterOptions opts;
+ opts.enable_kerberos = true;
+ opts.principal = "oryx";
+ cluster_.reset(new ExternalMiniCluster(std::move(opts)));
+ ASSERT_OK(cluster_->Start());
+ ASSERT_OK(RunKuduTool({"master",
+ "list",
+ "--sasl_protocol_name=oryx",
+
HostPort::ToCommaSeparatedString(cluster_->master_rpc_addrs())}));
+}
+
} // namespace tools
} // namespace kudu
diff --git a/src/kudu/tools/tool_action_common.cc
b/src/kudu/tools/tool_action_common.cc
index 332c464..32843a9 100644
--- a/src/kudu/tools/tool_action_common.cc
+++ b/src/kudu/tools/tool_action_common.cc
@@ -963,6 +963,7 @@ Status LeaderMasterProxy::Init(const vector<string>&
master_addrs,
.default_rpc_timeout(timeout)
.default_admin_operation_timeout(timeout)
.connection_negotiation_timeout(connection_negotiation_timeout)
+ .sasl_protocol_name(FLAGS_sasl_protocol_name)
.Build(&client_);
}