Skip to content

Commit e3c8079

Browse files
authored
Merge pull request #601 from Dajeong-Park/total-diplo2
[Mold] DR 관련 글로벌 설정 스토리지 타입에 따른 예외처리 추가 및 패키징 오류 수정
2 parents f8220ca + 9539b4b commit e3c8079

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,8 @@ protected String validateConfigurationValue(String name, String value, String sc
12541254

12551255
validateSpecificConfigurationValues(name, value, type);
12561256

1257+
validateDisasterRecoveryValues(name, value, type);
1258+
12571259
boolean isTypeValid = validateValueType(value, type);
12581260
if (!isTypeValid) {
12591261
return String.format("Value [%s] is not a valid [%s].", value, type);
@@ -1415,6 +1417,22 @@ protected void validateSpecificConfigurationValues(String name, String value, Cl
14151417
}
14161418
}
14171419

1420+
protected void validateDisasterRecoveryValues(String name, String value, Class<?> type) {
1421+
if (name.equals("cloud.dr.service.enabled") && value.equals("true")) {
1422+
boolean rbd = false;
1423+
List<StoragePoolVO> pools = _storagePoolDao.listAll();
1424+
for (StoragePoolVO pool : pools) {
1425+
if (pool.getPoolType() == Storage.StoragePoolType.RBD) {
1426+
rbd = true;
1427+
break;
1428+
}
1429+
}
1430+
if (!rbd) {
1431+
throw new InvalidParameterValueException("Disaster recovery service can only be activated if you have rbd type storage.");
1432+
}
1433+
}
1434+
}
1435+
14181436
protected Pair<Boolean, String> validateCommaSeparatedKeyValueConfigWithPositiveIntegerValues(String value) {
14191437
try {
14201438
if (StringUtils.isNotEmpty(value)) {

ui/src/config/section/compute.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,4 +1121,3 @@ export default {
11211121
}
11221122
]
11231123
}
1124-

ui/src/views/compute/CreateKubernetesCluster.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,4 +529,3 @@ export default {
529529
}
530530
}
531531
</style>
532-

0 commit comments

Comments
 (0)