all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Jonas Theisen <j.theisen@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup v3 09/10] api: create datastore: allow creation without prune job
Date: Fri,  9 Oct 2026 16:54:40 +0200	[thread overview]
Message-ID: <20261009145445.282494-7-j.theisen@proxmox.com> (raw)
In-Reply-To: <20261009145445.282494-1-j.theisen@proxmox.com>

To allow users to create datastores without a prune job this patch
adds an optional flag to the API call.

If it is set no prune job will be generated.

Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
 src/api2/config/datastore.rs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs
index f3644149e..76988f592 100644
--- a/src/api2/config/datastore.rs
+++ b/src/api2/config/datastore.rs
@@ -262,6 +262,12 @@ pub(crate) fn do_create_datastore(
                 default: false,
                 description: "Overwrite in use marker (S3 backed datastores only)."
             },
+            "prune-disable": {
+                type: Boolean,
+                optional: true,
+                default: false,
+                description: "Do not create a prune job for the new datastore."
+            },
         },
     },
     access: {
@@ -274,6 +280,7 @@ pub fn create_datastore(
     config: DataStoreConfig,
     reuse_datastore: bool,
     overwrite_in_use: bool,
+    prune_disable: bool,
     rpcenv: &mut dyn RpcEnvironment,
 ) -> Result<String, Error> {
     let lock = pbs_config::datastore::lock_config()?;
@@ -311,7 +318,7 @@ pub fn create_datastore(
     }
 
     let mut prune_job_config = None;
-    if config.keep.keeps_something() || !has_prune_job(&config.name)? {
+    if !prune_disable && (config.keep.keeps_something() || !has_prune_job(&config.name)?) {
         prune_job_config = config.prune_schedule.as_ref().map(|schedule| {
             let mut id = format!("default-{}-{}", config.name, Uuid::generate());
             id.truncate(32);
-- 
2.47.3





  parent reply	other threads:[~2026-10-09 14:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 14:54 [PATCH proxmox-backup v3 03/10] ui: prune job: align prune edit window to other "Enable" checkboxes Jonas Theisen
2026-10-09 14:54 ` [PATCH proxmox-backup v3 04/10] api: prune job: align prune job schedule to other jobs Jonas Theisen
2026-10-09 14:54 ` [PATCH proxmox-backup v3 05/10] fix #7904: api: implement "disable" for {sync,verify,tape,GC} jobs Jonas Theisen
2026-10-09 14:54 ` [PATCH proxmox-backup v3 06/10] fix #7904: ui: job edit: introduce "Enable" checkbox " Jonas Theisen
2026-10-09 14:54 ` [PATCH proxmox-backup v3 07/10] ui: improve visibility of disabled {sync,verify,tape,GC,prune} jobs on the overview page Jonas Theisen
2026-10-09 14:54 ` [PATCH proxmox-backup v3 08/10] ui: calendar-event: remove clear button from calendar selector Jonas Theisen
2026-10-09 14:54 ` Jonas Theisen [this message]
2026-10-09 14:54 ` [PATCH proxmox-backup v3 10/10] ui: create datastore: add enable checkboxes for {GC, prune} Jonas Theisen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261009145445.282494-7-j.theisen@proxmox.com \
    --to=j.theisen@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal