Skip to content

fix next-pool overrides by job#2279

Merged
BareosBot merged 4 commits intobareos:masterfrom
florian-at-bareos:dev/fburger/master/fix-next-pool-config
Sep 2, 2025
Merged

fix next-pool overrides by job#2279
BareosBot merged 4 commits intobareos:masterfrom
florian-at-bareos:dev/fburger/master/fix-next-pool-config

Conversation

@florian-at-bareos
Copy link
Contributor

@florian-at-bareos florian-at-bareos commented May 19, 2025

The next pool directive can be defined in the Pool and Job resource, the next pool directive in the Job resource should override the directive in the Pool resource. Currently, The directive in the job resource is not taken into account when running a job via the "run" command in the bconsole. This PR fixes this and takes the directive from the Job resource if specified.

Also, this PR adds a section in the copy-migrate systemtest to test the override behaviour of this directive.

Fixes #2253: Copy job fails, because "Next Pool" is not accepted as an override in the job config.

Thank you for contributing to the Bareos Project!

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
    Required backport PRs have been created
  • Correct milestone is set
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@florian-at-bareos florian-at-bareos added this to the 25.0.0 milestone May 19, 2025
@florian-at-bareos florian-at-bareos self-assigned this May 19, 2025
@florian-at-bareos florian-at-bareos added the bug This addresses a bug label May 19, 2025
@florian-at-bareos
Copy link
Contributor Author

The code is still awkward because the ScanCommandLineArguments method in ua_run.cc also sets values that are not given in the command line, applying overrides.

@florian-at-bareos
Copy link
Contributor Author

Also, is the name of the method ResetRestoreContext in ua_run.cc correct? The method updates jcr->dir_impl->res values from a RunContext reference, no RestoreContext at all.

@florian-at-bareos florian-at-bareos changed the title Fix next-pool overrides by job fix next-pool overrides by job May 23, 2025
@florian-at-bareos florian-at-bareos force-pushed the dev/fburger/master/fix-next-pool-config branch 2 times, most recently from 1c2657f to 604e379 Compare May 27, 2025 14:25
@florian-at-bareos florian-at-bareos marked this pull request as ready for review May 27, 2025 14:27
@florian-at-bareos florian-at-bareos requested a review from sebsura May 27, 2025 14:27
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

I have not tested this manually yet. Could you add a test that tests the overrides ?
We probably already have a suite that uses copy jobs, so feel free to add one testrunner each for the two cases.

@arogge arogge requested a review from sebsura August 26, 2025 10:40
@sebsura sebsura force-pushed the dev/fburger/master/fix-next-pool-config branch from 7ef3de2 to 4f109e7 Compare August 28, 2025 11:12
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for the work!

@BareosBot BareosBot force-pushed the dev/fburger/master/fix-next-pool-config branch from db9cdcf to 46ebdb4 Compare September 2, 2025 09:07
@BareosBot BareosBot merged commit 674e765 into bareos:master Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This addresses a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy job fails, because "Next Pool" is not accepted as an override in the job config.

4 participants

Comments