[pve-devel] [PATCH common/access-control/wt/manager v3] add realm sync jobs

Dominik Csapak d.csapak at proxmox.com
Tue Jan 17 12:46:51 CET 2023


with this, users now can schedule realm sync jobs, instead of manually
pressing 'sync' or configuring a cronjob for 'pveum realm sync'

the access-control patch needs special care, since i try to sync
independent pve-scheduler calls across the cluster. in my tests here
it worked, but that does not mean i didn't overlook some things.

access-control depends on pve-common and pve-manager depends
on access-control and widget-toolkit

the most notable changes (beside what thomas said in the review) is
that i moved the api from /access/jobs to /cluster/jobs, since we
already have that, and it made more sense to have it there
(especially if we want to have more type of 'jobs' later on, having
them all in one place makes more sense).

if we rather want to have it in /access/jobs (like i sent it last)
i can make the change and send a v4 (should be relatively trivial)

changes from v2:
* incorporated thomas suggestions:
  - typo fixes
  - use of register_standard_option for reuse
  - better description
  - omitting of the 'node' parameter, always schedule in cluster
  - use 'realm-sync' as 'domain' for cluster locking
  - refactor/reuse state saving/reading
  - refactor crud ap update delete checks
    (if we go forward with this series, i'll send patches to make use
    of this in other parts of our code)
  - renamed 'realmsync' to 'realm-sync'
    (this made it necessary to change the regex in the job cleanup
    slightly, see pve-manager patch 1/4)
* moved crud api to /cluster/jobs (was /access/jobs)
* removed calls to PVE::Jobs from AccessControl
  (was an implicit cyclic dependency, but actually not necessary)

changes from v1:
* include thomas suggestions
* add patches to allow 'none' for remove-vanished
* add patch for wt that allows filtering for the realm combobox
* load the default values (if any) from the realm on sync job create,
  but not on edit

pve-common:

Dominik Csapak (1):
  SectionConfig: add helper to delete keys from a section config entry

 src/PVE/SectionConfig.pm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

pve-access-control:

Dominik Csapak (2):
  realm sync: refactor scope/remove-vanished into a standard option
  add realm-sync plugin for jobs and CRUD api for realm-sync-jobs

 src/PVE/API2/AccessControl/Makefile     |   6 +
 src/PVE/API2/AccessControl/RealmSync.pm | 292 ++++++++++++++++++++++++
 src/PVE/API2/Makefile                   |   4 +
 src/PVE/Auth/Plugin.pm                  |  42 ++--
 src/PVE/Jobs/Makefile                   |   6 +
 src/PVE/Jobs/RealmSync.pm               | 201 ++++++++++++++++
 src/PVE/Makefile                        |   1 +
 7 files changed, 533 insertions(+), 19 deletions(-)
 create mode 100644 src/PVE/API2/AccessControl/Makefile
 create mode 100644 src/PVE/API2/AccessControl/RealmSync.pm
 create mode 100644 src/PVE/Jobs/Makefile
 create mode 100644 src/PVE/Jobs/RealmSync.pm

proxmox-widget-toolkit:

Dominik Csapak (1):
  RealmComboBox: add custom store filters for callers

 src/form/RealmComboBox.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

pve-manager:

Dominik Csapak (4):
  Jobs: include existing types in state file regex for deletion
  Jobs: add RealmSync Plugin and register it
  api: add realm-sync crud api to /cluster/jobs
  ui: add Realm Sync panel

 PVE/API2/Cluster/Jobs.pm        |   7 +
 PVE/Jobs.pm                     |   7 +-
 www/manager6/Makefile           |   1 +
 www/manager6/dc/Config.js       |   7 +
 www/manager6/dc/RealmSyncJob.js | 364 ++++++++++++++++++++++++++++++++
 5 files changed, 385 insertions(+), 1 deletion(-)
 create mode 100644 www/manager6/dc/RealmSyncJob.js

-- 
2.30.2






More information about the pve-devel mailing list