[pbs-devel] [RFC PATCH proxmox-backup 2/6] client: Add `--protected` CLI flag to backup command

Christoph Heiss c.heiss at proxmox.com
Wed Jan 18 12:50:20 CET 2023


On Wed, Jan 18, 2023 at 12:13:52PM +0100, Fabian Grünbichler wrote:
> On January 18, 2023 11:48 am, Christoph Heiss wrote:
> > [..]
> > @@ -1082,7 +1089,9 @@ async fn create_backup(
> >          .upload_blob_from_data(manifest.into_bytes(), MANIFEST_BLOB_NAME, options)
> >          .await?;
> >
> > -    client.finish().await?;
> > +    client.finish(Some(json!({
> > +        "protected": protected,
> > +    }))).await?;
>
> this fails the backup with new client + --protected, at the very end, if the
> server doesn't have patch #1 of this series.
Right, I did not test _that_ combination. Thanks for taking a look, I
will fix it for the next revision!

>
> we need some sort of compat mechanism...
One approach here would be to check the server version using the
`/version` endpoint and decide on that. (And re-reading that, Fiona
actually brought up that exact point in the previous thread ..)

FWIW, a (more) future-proof and cleaner compat mechanism could maybe be
to have `/version` also return a list of features supported by the
server, beside the current fields?

E.g.
  {
    "data": {
      "release": "2",
      "repoid": "07151513fa92899c65b1efa47d9b2d40c5dc5d82",
      "version": "2.3",
      "features": ["finish-protected-param"]                 <--
    },
    "success": true
  }

Would something like that be acceptable? Just an idea.

>
> >
> >      let end_time = std::time::Instant::now();
> >      let elapsed = end_time.duration_since(start_time);
> > --
> > 2.34.1
> >
> >
> >
> > _______________________________________________
> > pbs-devel mailing list
> > pbs-devel at lists.proxmox.com
> > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> >
> >
> >
>
>
> _______________________________________________
> pbs-devel mailing list
> pbs-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
>
>





More information about the pbs-devel mailing list