Fix 'endpointe.url' global settings configuration typo (#5832)

* Update 'endpointe.url' global settings to 'endpoint.url'

* Add PR number on 'schema-41610to41700.sql'

* Use ApiServiceConfiguration.ApiServletPath.key() instead of "hardcoded" string
This commit is contained in:
Gabriel Beims Bräscher 2022-02-06 16:11:45 +01:00 committed by GitHub
parent 649be0d8c7
commit 2c11171517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 7 deletions

View File

@ -21,7 +21,7 @@ import org.apache.cloudstack.framework.config.Configurable;
public class ApiServiceConfiguration implements Configurable { public class ApiServiceConfiguration implements Configurable {
public static final ConfigKey<String> ManagementServerAddresses = new ConfigKey<String>("Advanced", String.class, "host", "localhost", "The ip address of management server. This can also accept comma separated addresses.", true); public static final ConfigKey<String> ManagementServerAddresses = new ConfigKey<String>("Advanced", String.class, "host", "localhost", "The ip address of management server. This can also accept comma separated addresses.", true);
public static final ConfigKey<String> ApiServletPath = new ConfigKey<String>("Advanced", String.class, "endpointe.url", "http://localhost:8080/client/api", public static final ConfigKey<String> ApiServletPath = new ConfigKey<String>("Advanced", String.class, "endpoint.url", "http://localhost:8080/client/api",
"API end point. Can be used by CS components/services deployed remotely, for sending CS API requests", true); "API end point. Can be used by CS components/services deployed remotely, for sending CS API requests", true);
public static final ConfigKey<Long> DefaultUIPageSize = new ConfigKey<Long>("Advanced", Long.class, "default.ui.page.size", "20", public static final ConfigKey<Long> DefaultUIPageSize = new ConfigKey<Long>("Advanced", Long.class, "default.ui.page.size", "20",
"The default pagesize to be used by UI and other clients when making list* API calls", true, ConfigKey.Scope.Global); "The default pagesize to be used by UI and other clients when making list* API calls", true, ConfigKey.Scope.Global);

View File

@ -23,6 +23,10 @@
ALTER TABLE cloud.remote_access_vpn MODIFY ipsec_psk text NOT NULL; ALTER TABLE cloud.remote_access_vpn MODIFY ipsec_psk text NOT NULL;
-- PR#5832 Fix 'endpointe.url' global settings configruation typo.
UPDATE `cloud`.`configuration` SET name='endpoint.url' WHERE name='endpointe.url';
ALTER TABLE `cloud`.`service_offering` ADD COLUMN `uuid` varchar(40) UNIQUE DEFAULT NULL; ALTER TABLE `cloud`.`service_offering` ADD COLUMN `uuid` varchar(40) UNIQUE DEFAULT NULL;
ALTER TABLE `cloud`.`service_offering` ADD COLUMN `name` varchar(255) NOT NULL; ALTER TABLE `cloud`.`service_offering` ADD COLUMN `name` varchar(255) NOT NULL;
@ -638,4 +642,4 @@ CREATE VIEW `cloud`.`domain_router_view` AS
left join left join
`cloud`.`async_job` ON async_job.instance_id = vm_instance.id `cloud`.`async_job` ON async_job.instance_id = vm_instance.id
and async_job.instance_type = 'DomainRouter' and async_job.instance_type = 'DomainRouter'
and async_job.job_status = 0; and async_job.job_status = 0;

View File

@ -328,7 +328,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
} }
if (csUrl == null || csUrl.contains("localhost")) { if (csUrl == null || csUrl.contains("localhost")) {
throw new InvalidParameterValueException("Global setting endpointe.url has to be set to the Management Server's API end point"); throw new InvalidParameterValueException(String.format("Global setting %s has to be set to the Management Server's API end point", ApiServiceConfiguration.ApiServletPath.key()));
} }
vmProfile = _autoScaleVmProfileDao.persist(vmProfile); vmProfile = _autoScaleVmProfileDao.persist(vmProfile);

View File

@ -339,7 +339,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
} }
if (csUrl == null || csUrl.contains("localhost")) { if (csUrl == null || csUrl.contains("localhost")) {
throw new InvalidParameterValueException("Global setting endpointe.url has to be set to the Management Server's API end point"); throw new InvalidParameterValueException(String.format("Global setting %s has to be set to the Management Server's API end point", ApiServiceConfiguration.ApiServletPath.key()));
} }
LbAutoScaleVmProfile lbAutoScaleVmProfile = LbAutoScaleVmProfile lbAutoScaleVmProfile =

View File

@ -76,11 +76,11 @@ class TestKubernetesCluster(cloudstackTestCase):
cls.kubernetes_version_ids = [] cls.kubernetes_version_ids = []
if cls.hypervisorNotSupported == False: if cls.hypervisorNotSupported == False:
cls.endpoint_url = Configurations.list(cls.apiclient, name="endpointe.url")[0].value cls.endpoint_url = Configurations.list(cls.apiclient, name="endpoint.url")[0].value
if "localhost" in cls.endpoint_url: if "localhost" in cls.endpoint_url:
endpoint_url = "http://%s:%d/client/api " %(cls.mgtSvrDetails["mgtSvrIp"], cls.mgtSvrDetails["port"]) endpoint_url = "http://%s:%d/client/api " %(cls.mgtSvrDetails["mgtSvrIp"], cls.mgtSvrDetails["port"])
cls.debug("Setting endpointe.url to %s" %(endpoint_url)) cls.debug("Setting endpoint.url to %s" %(endpoint_url))
Configurations.update(cls.apiclient, "endpointe.url", endpoint_url) Configurations.update(cls.apiclient, "endpoint.url", endpoint_url)
cls.initial_configuration_cks_enabled = Configurations.list(cls.apiclient, name="cloud.kubernetes.service.enabled")[0].value cls.initial_configuration_cks_enabled = Configurations.list(cls.apiclient, name="cloud.kubernetes.service.enabled")[0].value
if cls.initial_configuration_cks_enabled not in ["true", True]: if cls.initial_configuration_cks_enabled not in ["true", True]:
cls.debug("Enabling CloudStack Kubernetes Service plugin and restarting management server") cls.debug("Enabling CloudStack Kubernetes Service plugin and restarting management server")