mirror of https://github.com/apache/cloudstack.git
CKS: Prevent etcd node start port number to coincide with k8s cluster start port numbers
This commit is contained in:
parent
7cf7f1f1b8
commit
2eae6a92c8
|
|
@ -308,6 +308,7 @@ import com.googlecode.ipv6.IPv6Network;
|
|||
public class ConfigurationManagerImpl extends ManagerBase implements ConfigurationManager, ConfigurationService, Configurable {
|
||||
public static final String PERACCOUNT = "peraccount";
|
||||
public static final String PERZONE = "perzone";
|
||||
public static final String CLUSTER_NODES_DEFAULT_START_SSH_PORT = "2222";
|
||||
|
||||
@Inject
|
||||
EntityManager _entityMgr;
|
||||
|
|
@ -644,6 +645,17 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||
}
|
||||
}
|
||||
|
||||
protected void validateConflictingConfigValue(final String configName, final String value) {
|
||||
if (configName.equals("cloud.kubernetes.etcd.node.start.port")) {
|
||||
if (value.equals(CLUSTER_NODES_DEFAULT_START_SSH_PORT)) {
|
||||
String errorMessage = "This range is reserved for Kubernetes cluster nodes." +
|
||||
"Please choose a value in a higher range would does not conflict with a kubernetes cluster deployed";
|
||||
logger.error(errorMessage);
|
||||
throw new InvalidParameterValueException(errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean start() {
|
||||
|
||||
|
|
@ -945,6 +957,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||
}
|
||||
|
||||
validateIpAddressRelatedConfigValues(name, value);
|
||||
validateConflictingConfigValue(name, value);
|
||||
|
||||
if (value == null) {
|
||||
return _configDao.findByName(name);
|
||||
|
|
|
|||
Loading…
Reference in New Issue