Skip to content

Commit

Permalink
fix(backups): use config from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
b-Nollet committed Nov 26, 2024
1 parent 49d5f27 commit 18ec524
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion @xen-orchestra/backups/_runners/Metadata.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const DEFAULT_METADATA_SETTINGS = {
export const Metadata = class MetadataBackupRunner extends Abstract {
_computeBaseSettings(config, job) {
const baseSettings = { ...DEFAULT_SETTINGS }
Object.assign(baseSettings, DEFAULT_METADATA_SETTINGS, config.defaultSettings, config.metadata?.defaultSettings)
Object.assign(baseSettings, DEFAULT_METADATA_SETTINGS, config)
Object.assign(baseSettings, job.settings[''])
return baseSettings
}
Expand Down
2 changes: 1 addition & 1 deletion @xen-orchestra/backups/_runners/VmsRemote.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const DEFAULT_REMOTE_VM_SETTINGS = {
export const VmsRemote = class RemoteVmsBackupRunner extends Abstract {
_computeBaseSettings(config, job) {
const baseSettings = { ...DEFAULT_SETTINGS }
Object.assign(baseSettings, DEFAULT_REMOTE_VM_SETTINGS, config.defaultSettings, config.vm?.defaultSettings)
Object.assign(baseSettings, DEFAULT_REMOTE_VM_SETTINGS, config)
Object.assign(baseSettings, job.settings[''])
return baseSettings
}
Expand Down
2 changes: 1 addition & 1 deletion @xen-orchestra/backups/_runners/VmsXapi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const DEFAULT_XAPI_VM_SETTINGS = {
export const VmsXapi = class VmsXapiBackupRunner extends Abstract {
_computeBaseSettings(config, job) {
const baseSettings = { ...DEFAULT_SETTINGS }
Object.assign(baseSettings, DEFAULT_XAPI_VM_SETTINGS, config.defaultSettings, config.vm?.defaultSettings)
Object.assign(baseSettings, DEFAULT_XAPI_VM_SETTINGS, config)
Object.assign(baseSettings, job.settings[''])
return baseSettings
}
Expand Down
3 changes: 1 addition & 2 deletions packages/xo-server/src/xo-mixins/backups-ng/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,7 @@ export default class BackupNg {

// FIXME: does not take into account default values defined in @xen-orchestra/backups/Backup
const jobSettings = {
...config.defaultSettings,
...config.vm?.defaultSettings,
...config,
...job.settings[''],
...job.settings[schedule.id],
}
Expand Down

0 comments on commit 18ec524

Please sign in to comment.