Skip to content

fix: allow third-party backup provider plugins via configurable allowed list#13332

Open
yigitbasalma wants to merge 1 commit into
apache:mainfrom
yigitbasalma:fix/configurable-backup-provider-plugins
Open

fix: allow third-party backup provider plugins via configurable allowed list#13332
yigitbasalma wants to merge 1 commit into
apache:mainfrom
yigitbasalma:fix/configurable-backup-provider-plugins

Conversation

@yigitbasalma

Copy link
Copy Markdown

Description

Currently, the backup.framework.provider.plugin setting validates against a hardcoded list of plugins (dummy, veeam, networker, nas). This prevents third-party backup provider plugins from being registered and used in CloudStack, even when the plugin is correctly implemented and deployed.

This PR introduces a new configuration key backup.framework.provider.plugin.allowed that contains a comma-separated list of allowed backup provider plugins. Administrators can extend this list to include third-party plugins without modifying CloudStack source code.

Default value maintains full backward compatibility with existing plugins.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

N/A

How Has This Been Tested?

  • All existing unit tests pass (714 tests, 0 failures, 0 errors)
  • Verified backward compatibility: default value of backup.framework.provider.plugin.allowed includes all existing plugins (dummy, veeam, networker, nas)
  • Verified third-party plugin registration works by adding a custom plugin name to the allowed list

How did you try to break this feature and the system with this change?

  • Tested with invalid plugin name — proper error message returned with list of allowed plugins
  • Tested with empty allowed list — validation correctly rejects all plugin names
  • Tested with existing plugin names (dummy, veeam, networker, nas) — all work as before

@boring-cyborg

boring-cyborg Bot commented Jun 3, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
Here are some useful points:

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the backup provider plugin selection extensible by replacing the hardcoded built-in plugin allowlist with a new configuration key so administrators can permit third-party backup provider plugins without modifying CloudStack source.

Changes:

  • Adds backup.framework.provider.plugin.allowed (comma-separated) to define which backup provider plugins are permitted.
  • Updates validation for backup.framework.provider.plugin to check against the configured allowlist instead of a hardcoded list.
  • Updates the backup.framework.provider.plugin config description to reference the new allowlist setting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +64 to +69
ConfigKey<String> AllowedBackupProviderPlugins = new ConfigKey<>(
"Advanced", String.class,
"backup.framework.provider.plugin.allowed",
"dummy,veeam,networker,nas",
"Comma-separated list of allowed backup provider plugins.",
true, ConfigKey.Scope.Zone);
Comment on lines 261 to 273
static void validateBackupProviderConfig(String value) {
if (value != null && (value.contains(",") || value.trim().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 (value != null && !validPlugins.contains(value)) {
throw new IllegalArgumentException("Invalid backup provider plugin: " + value + ". Valid plugin values are: " + String.join(", ", validPlugins));
String allowed = AllowedBackupProviderPlugins.value();
if (allowed != null && value != null) {
List<String> validPlugins = Arrays.asList(allowed.split(","));
if (!validPlugins.contains(value.trim())) {
throw new IllegalArgumentException("Invalid backup provider plugin: " + value +
". Valid plugin values are: " + allowed +
". You can add more plugins via backup.framework.provider.plugin.allowed setting.");
}
}
@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants