fix js backups (#2496)

This commit is contained in:
Aiden McClelland
2023-11-02 17:13:48 -06:00
committed by GitHub
parent 4625711606
commit f54f950f81

View File

@@ -27,6 +27,12 @@ impl Volumes {
volume volume
.validate(interfaces) .validate(interfaces)
.with_ctx(|_| (crate::ErrorKind::ValidateS9pk, format!("Volume {}", id)))?; .with_ctx(|_| (crate::ErrorKind::ValidateS9pk, format!("Volume {}", id)))?;
if let Volume::Backup { .. } = volume {
return Err(Error::new(
eyre!("Invalid volume type \"backup\""),
ErrorKind::ParseS9pk,
)); // Volume::Backup is for internal use and shouldn't be declared in manifest
}
} }
Ok(()) Ok(())
} }
@@ -131,7 +137,6 @@ pub enum Volume {
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "kebab-case")]
Certificate { interface_id: InterfaceId }, Certificate { interface_id: InterfaceId },
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "kebab-case")]
#[serde(skip)]
Backup { readonly: bool }, Backup { readonly: bool },
} }
impl Volume { impl Volume {