mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-04-28 12:50:53 +00:00
config: sync: use same config section type sync
for push and pull
Use `sync` as config section type string for both, sync jobs in push
and pull direction, renaming the now combined config plugin to sync
plugin.
Commit bcd80bf9
("api types/config: add `sync-push` config type for
push sync jobs") introduced the additional config type with the
intend to reduce possible misconfiguration. Partially revert this to
use the same config type string again, since the misconfiguration
can happen nevertheless (by editing the config type) and currently
sync job configs are only listed partially when fetched via the
config api endpoint. The filtering based on the additional api
parameter is however retained.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
3b3d63ccfd
commit
b5814a4142
@ -6,7 +6,7 @@ use anyhow::Error;
|
||||
use proxmox_schema::{ApiType, Schema};
|
||||
use proxmox_section_config::{SectionConfig, SectionConfigData, SectionConfigPlugin};
|
||||
|
||||
use pbs_api_types::{SyncDirection, SyncJobConfig, JOB_ID_SCHEMA};
|
||||
use pbs_api_types::{SyncJobConfig, JOB_ID_SCHEMA};
|
||||
|
||||
use crate::{open_backup_lockfile, replace_backup_config, BackupLockGuard};
|
||||
|
||||
@ -18,19 +18,10 @@ fn init() -> SectionConfig {
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
let pull_plugin = SectionConfigPlugin::new(
|
||||
SyncDirection::Pull.as_config_type_str().to_string(),
|
||||
Some(String::from("id")),
|
||||
obj_schema,
|
||||
);
|
||||
let push_plugin = SectionConfigPlugin::new(
|
||||
SyncDirection::Push.as_config_type_str().to_string(),
|
||||
Some(String::from("id")),
|
||||
obj_schema,
|
||||
);
|
||||
let sync_plugin =
|
||||
SectionConfigPlugin::new("sync".to_string(), Some(String::from("id")), obj_schema);
|
||||
let mut config = SectionConfig::new(&JOB_ID_SCHEMA);
|
||||
config.register_plugin(pull_plugin);
|
||||
config.register_plugin(push_plugin);
|
||||
config.register_plugin(sync_plugin);
|
||||
|
||||
config
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user