Pearl1594 commented on code in PR #12550:
URL: https://github.com/apache/cloudstack/pull/12550#discussion_r2744571345
##########
api/src/main/java/org/apache/cloudstack/backup/BackupManager.java:
##########
@@ -42,10 +43,20 @@ public interface BackupManager extends BackupService,
Configurable, PluggableSer
"false",
"Is backup and recovery framework enabled.", false,
ConfigKey.Scope.Zone);
- ConfigKey<String> BackupProviderPlugin = new ConfigKey<>("Advanced",
String.class,
+ ConfigKey<String> BackupProviderPlugin = new
ValidatedConfigKey<>("Advanced", String.class,
"backup.framework.provider.plugin",
"dummy",
- "The backup and recovery provider plugin.", true,
ConfigKey.Scope.Zone, BackupFrameworkEnabled.key());
+ "The backup and recovery provider plugin. Valid plugin values:
dummy, veeam, networker and nas",
+ true, ConfigKey.Scope.Zone, BackupFrameworkEnabled.key(),
+ value -> {
+ if (value != null && ((String)value).contains(",") ||
((String)value).contains(" ")) {
+ throw new IllegalArgumentException("Multiple backup
provider plugins are not supported. Please provide a single plugin value.");
+ }
+ List<String> validPlugins = List.of("dummy", "veeam",
"networker", "nas");
+ if (!validPlugins.contains(((String) value).toLowerCase())) {
Review Comment:
If empty or null, it defaults to "dummy". Reset behaves normally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]