This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch branch-1.15.x
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/branch-1.15.x by this push:
new b39781e [tools] KUDU-1884 Add custom SASL protocol name for some CLI
tools
b39781e is described below
commit b39781e900f55c61b301fa98581c1a0237b682c5
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]>
(cherry picked from commit c91763c8a88d562a32763c4ae8c19644bd2f5468)
Reviewed-on: http://gerrit.cloudera.org:8080/17655
Reviewed-by: Yifan Zhang <[email protected]>
Tested-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 4d9fdfd..2327161 100644
--- a/src/kudu/tools/tool_action_common.cc
+++ b/src/kudu/tools/tool_action_common.cc
@@ -940,6 +940,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_);
}