Skip to content

Commit

Permalink
Fetch cloud enabled configuration via runtime config
Browse files Browse the repository at this point in the history
Summary:
We were using the static config to fetch if the cloud is enabled, but itest uses runtime
configs to set that. So, we fetch the runtime config per customer instead.

Test Plan:
Run itest for dual NIC universes D15504
https://jenkins.dev.yugabyte.com/job/dev-itest-pipeline/701/

Reviewers: anabaria, hkandala, daniel

Reviewed By: daniel

Subscribers: jenkins-bot, yugaware

Differential Revision: https://phabricator.dev.yugabyte.com/D15762
  • Loading branch information
Arnav15 committed Mar 2, 2022
1 parent fd4fddd commit ee70c62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions managed/src/main/java/com/yugabyte/yw/common/NodeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,10 @@ private Map<String, String> getYCQLGFlags(
}

private Map<String, String> getMasterDefaultGFlags(
AnsibleConfigureServers.Params taskParam, Boolean useHostname, Boolean useSecondaryIp) {
AnsibleConfigureServers.Params taskParam,
Boolean useHostname,
Boolean useSecondaryIp,
Boolean isDualNet) {
Map<String, String> gflags = new HashMap<>();
Universe universe = Universe.getOrBadRequest(taskParam.universeUUID);
NodeDetails node = universe.getNode(taskParam.nodeName);
Expand Down Expand Up @@ -710,6 +713,8 @@ private Map<String, String> getMasterDefaultGFlags(
String.format("%s:%s", node.cloudInfo.secondary_private_ip, node.masterRpcPort);
String bindAddresses = bindAddressSecondary + "," + bindAddressPrimary;
gflags.put("rpc_bind_addresses", bindAddresses);
} else if (isDualNet) {
gflags.put("use_private_ip", "cloud");
}

gflags.put("webserver_port", Integer.toString(node.masterHttpPort));
Expand Down Expand Up @@ -813,7 +818,8 @@ private Map<String, String> getAllDefaultGFlags(
extra_gflags.putAll(
getTServerDefaultGflags(taskParam, useHostname, useSecondaryIp, isDualNet));
} else {
extra_gflags.putAll(getMasterDefaultGFlags(taskParam, useHostname, useSecondaryIp));
extra_gflags.putAll(
getMasterDefaultGFlags(taskParam, useHostname, useSecondaryIp, isDualNet));
}

UserIntent userIntent = getUserIntentFromParams(taskParam);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public UniverseResp createUniverse(Customer customer, UniverseDefinitionTaskPara
universe.updateConfig(ImmutableMap.of(Universe.TAKE_BACKUPS, "true"));
// If cloud enabled and deployment AZs have two subnets, mark the cluster as a
// non legacy cluster for proper operations.
if (runtimeConfigFactory.staticApplicationConf().getBoolean("yb.cloud.enabled")) {
if (runtimeConfigFactory.forCustomer(customer).getBoolean("yb.cloud.enabled")) {
Provider provider =
Provider.getOrBadRequest(UUID.fromString(primaryCluster.userIntent.provider));
AvailabilityZone zone = provider.regions.get(0).zones.get(0);
Expand Down

0 comments on commit ee70c62

Please sign in to comment.