diff --git a/managed/src/main/java/com/yugabyte/yw/controllers/handlers/CloudProviderHandler.java b/managed/src/main/java/com/yugabyte/yw/controllers/handlers/CloudProviderHandler.java index 2e451ffdf074..a4edf1770305 100644 --- a/managed/src/main/java/com/yugabyte/yw/controllers/handlers/CloudProviderHandler.java +++ b/managed/src/main/java/com/yugabyte/yw/controllers/handlers/CloudProviderHandler.java @@ -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); } diff --git a/managed/src/main/java/com/yugabyte/yw/models/ProviderDetails.java b/managed/src/main/java/com/yugabyte/yw/models/ProviderDetails.java index df251a9371f5..48b565fbf9d0 100644 --- a/managed/src/main/java/com/yugabyte/yw/models/ProviderDetails.java +++ b/managed/src/main/java/com/yugabyte/yw/models/ProviderDetails.java @@ -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; @@ -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) { diff --git a/managed/src/main/resources/reference.conf b/managed/src/main/resources/reference.conf index 66c5d404749a..8d754e3d44b9 100644 --- a/managed/src/main/resources/reference.conf +++ b/managed/src/main/resources/reference.conf @@ -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 { diff --git a/managed/src/main/resources/swagger-strict.json b/managed/src/main/resources/swagger-strict.json index fecdfbb417b1..460b01809b4e 100644 --- a/managed/src/main/resources/swagger-strict.json +++ b/managed/src/main/resources/swagger-strict.json @@ -9570,6 +9570,7 @@ "$ref" : "#/definitions/CloudInfo" }, "enableNodeAgent" : { + "readOnly" : true, "type" : "boolean" }, "installNodeExporter" : { diff --git a/managed/src/main/resources/swagger.json b/managed/src/main/resources/swagger.json index 07acfaa7fbac..711d208df7bd 100644 --- a/managed/src/main/resources/swagger.json +++ b/managed/src/main/resources/swagger.json @@ -9666,6 +9666,7 @@ "$ref" : "#/definitions/CloudInfo" }, "enableNodeAgent" : { + "readOnly" : true, "type" : "boolean" }, "installNodeExporter" : {