Skip to content

Commit

Permalink
[PLAT-15713] Do not run background node-agent installer for onprem no…
Browse files Browse the repository at this point in the history
…n-manual providers

Summary: Check provider flag for node-agent for onprem non-manual providers to decide whether to run background job or not.

Test Plan: Minor change. No regression should happen (itests).

Reviewers: amalyshev, cwang, sanketh

Reviewed By: cwang

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D39019
  • Loading branch information
nkhogen committed Oct 14, 2024
1 parent 06452bf commit 3f7333a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,20 +231,23 @@ public boolean isNodeAgentClientEnabled(Provider provider, @Nullable Universe un
* For 1 and 2, provider flag must not be checked.
*/
private boolean isBackgroundInstallNodeAgentEnabled(Universe universe) {
Cluster primaryCluster = universe.getUniverseDetails().getPrimaryCluster();
if (primaryCluster.userIntent.useSystemd == false) {
log.info(
"Unsupported universe {} for background node-agent installation as systemd is disabled",
universe.getUniverseUUID());
return false;
}
return isNodeAgentEnabled(
universe,
p -> {
Cluster primaryCluster = universe.getUniverseDetails().getPrimaryCluster();
if (primaryCluster.userIntent.useSystemd == false) {
return false;
}
if (p.getCloudCode() != CloudType.onprem || p.getDetails().isSkipProvisioning()) {
// Do not include provider flag for cloud and fully manual onprem providers when the
// enabler is on.
return !isEnabled();
}
// Onprem non-manual provider for which the provider flag is also checked.
return false;
// Always check provider flag for onprem non-manual providers.
return true;
})
.orElse(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ private Universe createAwsUniverse(
userIntent.provider = provider.getUuid().toString();
userIntent.universeName = name;
userIntent.deviceInfo = ApiUtils.getDummyDeviceInfo(1, 100);
userIntent.useSystemd = true;
Universe universe = ModelFactory.createUniverse(name, customer.getId(), providerType);
universe =
Universe.saveDetails(
Expand Down

0 comments on commit 3f7333a

Please sign in to comment.