Skip to content

Commit 4b05726

Browse files
committed
[PLAT-17128] Fix dump entities collection on universe with TLS enabled
Summary: Minor fix to use the correct protocol and apiHelper in tablet report component when collecting dump entities. Test Plan: Manually verified dump entities are collected as expected on universes with TLS enabled/disabled. Reviewers: skurapati Reviewed By: skurapati Differential Revision: https://phorge.dev.yugabyte.com/D42906
1 parent b968ed4 commit 4b05726

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

managed/src/main/java/com/yugabyte/yw/common/supportbundle/TabletReportComponent.java

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import com.google.inject.Inject;
88
import com.google.protobuf.util.JsonFormat;
99
import com.yugabyte.yw.commissioner.tasks.params.SupportBundleTaskParams;
10-
import com.yugabyte.yw.common.ApiHelper;
10+
import com.yugabyte.yw.common.NodeUIApiHelper;
1111
import com.yugabyte.yw.common.SupportBundleUtil;
1212
import com.yugabyte.yw.common.services.YBClientService;
1313
import com.yugabyte.yw.forms.SupportBundleFormData;
@@ -37,13 +37,15 @@
3737
@Slf4j
3838
public class TabletReportComponent implements SupportBundleComponent {
3939

40-
private final ApiHelper apiHelper;
40+
private final NodeUIApiHelper apiHelper;
4141
private final SupportBundleUtil supportBundleUtil;
4242
private final YBClientService ybClientService;
4343

4444
@Inject
4545
TabletReportComponent(
46-
ApiHelper apiHelper, SupportBundleUtil supportBundleUtil, YBClientService ybClientService) {
46+
NodeUIApiHelper apiHelper,
47+
SupportBundleUtil supportBundleUtil,
48+
YBClientService ybClientService) {
4749
this.apiHelper = apiHelper;
4850
this.supportBundleUtil = supportBundleUtil;
4951
this.ybClientService = ybClientService;
@@ -67,7 +69,12 @@ public void downloadComponent(
6769
try {
6870
String masterLeaderHost = universe.getMasterLeaderHostText();
6971
int masterHttpPort = universe.getMasterLeaderNode().masterHttpPort;
70-
String url = String.format("http://%s:%d/dump-entities", masterLeaderHost, masterHttpPort);
72+
String protocol =
73+
universe.getUniverseDetails().getPrimaryCluster().userIntent.enableClientToNodeEncrypt
74+
? "https"
75+
: "http";
76+
String url =
77+
String.format("%s://%s:%d/dump-entities", protocol, masterLeaderHost, masterHttpPort);
7178
log.info("Querying url {} for dump entities.", url);
7279
JsonNode response = apiHelper.getRequest(url);
7380
if (response.has("error")) {

0 commit comments

Comments
 (0)