Skip to content

Commit

Permalink
[PLAT-15976] Add static config to enable node agent in provider for YBM
Browse files Browse the repository at this point in the history
Summary:
An independent config is added to independently control the behavior for YBM testing. The steps would be
1. Enable this feature for YBM for testing in local setup.
2. Roll out this feature in higher env later once the tests are fine.

Test Plan: Created an onprem provider and verified that the flag was set in the provider details in the DB entry.

Reviewers: cwang, sanketh, nbhatia

Reviewed By: cwang

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D39742
  • Loading branch information
nkhogen committed Nov 6, 2024
1 parent 8d767d7 commit 4cbf9c1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ public Provider createProvider(
}
}
}
if (reqProvider.getCloudCode() != kubernetes && !config.getBoolean("yb.cloud.enabled")) {
if (reqProvider.getCloudCode() != kubernetes
&& !config.getBoolean("yb.internal.disable_node_agent_provider_property")) {
// Always enable for non-k8s providers.
reqProvider.getDetails().setEnableNodeAgent(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.yugabyte.yw.models.helpers.provider.LocalCloudInfo;
import com.yugabyte.yw.models.helpers.provider.OnPremCloudInfo;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty.AccessMode;
import java.util.Objects;
import lombok.Data;
import lombok.EqualsAndHashCode;
Expand All @@ -46,8 +47,10 @@ public static class CloudInfo {
}

@ApiModelProperty private CloudInfo cloudInfo;

// Flag to enable node agent for this provider depending on the runtime config settings.
@ApiModelProperty public boolean enableNodeAgent;
@ApiModelProperty(accessMode = AccessMode.READ_ONLY)
public boolean enableNodeAgent;

@JsonIgnore
public boolean isUpdateNeeded(ProviderDetails details) {
Expand Down
2 changes: 2 additions & 0 deletions managed/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,8 @@ yb {
allow_unsupported_instances = false
# Enabled fault injected paths with failure rates. E.g ybops.cloud.azure.utils.test1=0.2.
ybops_fault_injected_paths = ""
# Disable node agent property in provider details.
disable_node_agent_provider_property = ${yb.cloud.enabled}
}

dbmem {
Expand Down
1 change: 1 addition & 0 deletions managed/src/main/resources/swagger-strict.json
Original file line number Diff line number Diff line change
Expand Up @@ -9570,6 +9570,7 @@
"$ref" : "#/definitions/CloudInfo"
},
"enableNodeAgent" : {
"readOnly" : true,
"type" : "boolean"
},
"installNodeExporter" : {
Expand Down
1 change: 1 addition & 0 deletions managed/src/main/resources/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -9666,6 +9666,7 @@
"$ref" : "#/definitions/CloudInfo"
},
"enableNodeAgent" : {
"readOnly" : true,
"type" : "boolean"
},
"installNodeExporter" : {
Expand Down

0 comments on commit 4cbf9c1

Please sign in to comment.